diff --git a/demo/src/screens/DemoScreen.js b/demo/src/screens/DemoScreen.js deleted file mode 100644 index 0b501336d2..0000000000 --- a/demo/src/screens/DemoScreen.js +++ /dev/null @@ -1,96 +0,0 @@ -import React, {Component} from 'react'; -import PropTypes from 'prop-types'; -import _ from 'lodash'; -import {ScrollView, Switch} from 'react-native'; -import {View, TextField, Text, Badge, Colors} from 'react-native-ui-lib';//eslint-disable-line - -export default class DemoScreen extends Component { - - constructor(props) { - super(props); - - this.state = { - backgroundColor: Colors.red50, - label: '12', - }; - - this.updatePropValue = this.updatePropValue.bind(this); - } - - componentDidMount() { - this.getComponentProps(); - } - - getComponentProps() { - const DemoComponent = this.getComponent(); - return DemoComponent.propTypes; - } - - shouldRenderProp(propId) { - let shouldRender = true; - shouldRender = shouldRender && propId !== 'testID'; - if (this.propsToRender) { - shouldRender = shouldRender && _.includes(this.propsToRender, propId); - } - return shouldRender; - } - - updatePropValue(value, propId, prop) { - let validValue = value; - - if (prop === PropTypes.number) { - validValue = isNaN(value) ? undefined : Number(value); - } - - this.setState({ - [propId]: validValue, - }); - } - - - renderProp(prop, propId) { - if (!this.shouldRenderProp(propId)) return; - - if (PropTypes.bool === prop) { - return ( - - - {propId} - - this.updatePropValue(value, propId, prop)} - /> - - ); - } - - // if (_.includes([PropTypes.string, PropTypes.number], prop)) { - return ( - - this.updatePropValue(text, propId, prop)} - autoCapitalize='none' - /> - - ); - // } - } - - renderComponentSettings() { - const props = this.getComponentProps(); - return ( - - - {_.map(props, (prop, propId) => { - return this.renderProp(prop, propId); - })} - - - ); - } -} diff --git a/demo/src/screens/MainScreen.js b/demo/src/screens/MainScreen.js index e739c1db10..3f49f23529 100644 --- a/demo/src/screens/MainScreen.js +++ b/demo/src/screens/MainScreen.js @@ -1,8 +1,6 @@ import _ from 'lodash'; import React, {Component} from 'react'; -import PropTypes from 'prop-types'; import {StyleSheet, FlatList, SectionList, ScrollView} from 'react-native'; -import {ViewPropTypes} from 'deprecated-react-native-prop-types'; import {Navigation} from 'react-native-navigation'; import { Assets, @@ -27,12 +25,6 @@ const chevronIcon = require('../assets/icons/chevronRight.png'); const FADER_SIZE = 50; class MainScreen extends Component { - static propTypes = { - containerStyle: ViewPropTypes.style, - renderItem: PropTypes.func, - pageStyle: ViewPropTypes.style - }; - settingsScreenName = 'unicorn.Settings'; static options() { diff --git a/demo/src/screens/componentScreens/ConversationListScreen.js b/demo/src/screens/componentScreens/ConversationListScreen.js index 02ccf9be33..1c25659a16 100644 --- a/demo/src/screens/componentScreens/ConversationListScreen.js +++ b/demo/src/screens/componentScreens/ConversationListScreen.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React, {Component, PureComponent} from 'react'; import {StyleSheet, Alert, FlatList} from 'react-native'; import {Colors, ListItem, Text, Avatar, AvatarHelper, Drawer, Button} from 'react-native-ui-lib'; //eslint-disable-line @@ -121,13 +120,6 @@ class ConversationListScreen extends Component { } class ContactItem extends PureComponent { - static propTypes = { - item: PropTypes.object, - index: PropTypes.number, - addRef: PropTypes.func, - onSwipeableWillOpen: PropTypes.func - }; - render() { const {item, index, addRef, onSwipeableWillOpen} = this.props; diff --git a/demo/src/screens/foundationScreens/TypographyScreen.js b/demo/src/screens/foundationScreens/TypographyScreen.js index bda6316dbd..67adfa7c4a 100644 --- a/demo/src/screens/foundationScreens/TypographyScreen.js +++ b/demo/src/screens/foundationScreens/TypographyScreen.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {ScrollView} from 'react-native'; import {TabController, Colors, Typography, View, Text} from 'react-native-ui-lib'; @@ -7,10 +6,6 @@ import {TabController, Colors, Typography, View, Text} from 'react-native-ui-lib const WEIGHTS = ['Thin', 'Light', 'Default', 'Regular', 'Medium', 'Bold', 'Heavy', 'Black']; export default class TypographyScreen extends Component { - static propTypes = { - color: PropTypes.string - }; - static defaultProps = { color: Colors.grey10 }; diff --git a/demo/src/screens/realExamples/ListActions/ActionsList.js b/demo/src/screens/realExamples/ListActions/ActionsList.js index 720ce21a36..0a9737cb62 100644 --- a/demo/src/screens/realExamples/ListActions/ActionsList.js +++ b/demo/src/screens/realExamples/ListActions/ActionsList.js @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {Animated, LayoutAnimation, PanResponder, I18nManager} from 'react-native'; import {Constants, Assets, Colors, View, TouchableOpacity, Button, Text} from 'react-native-ui-lib'; //eslint-disable-line @@ -17,11 +16,6 @@ const DIRECTIONS = { export default class ActionsList extends Component { static displayName = 'ActionsList'; - - static propTypes = { - item: PropTypes.object, - index: PropTypes.number - } constructor(props) { super(props); diff --git a/expoDemo/package.json b/expoDemo/package.json index 549f9f6169..d4ad8dd4c8 100644 --- a/expoDemo/package.json +++ b/expoDemo/package.json @@ -36,7 +36,7 @@ "@react-native-community/cli": "15.0.1", "@react-native-community/cli-platform-android": "15.0.1", "@react-native-community/cli-platform-ios": "15.0.1", - "@types/react": "~18.3.24", + "@types/react": "19.0.0", "typescript": "^4.9.5" }, "private": true diff --git a/lib/package.json b/lib/package.json index c16d58f453..0c61b6a28d 100644 --- a/lib/package.json +++ b/lib/package.json @@ -10,8 +10,7 @@ "author": "Ethan Sharabi ", "license": "MIT", "dependencies": { - "lodash": "^4.17.21", - "prop-types": "^15.5.10" + "lodash": "^4.17.21" }, "devDependencies": { "shell-utils": "^1.0.10" diff --git a/package.json b/package.json index e8d7aeaac7..fd64125a84 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "@types/hoist-non-react-statics": "^3.3.1", "@types/jest": "^29.5.13", "@types/lodash": "^4.0.0", - "@types/prop-types": "^15.5.3", "@types/react": "19.0.0", "@types/react-test-renderer": "^19.0.0", "@types/tinycolor2": "^1.4.2", diff --git a/packages/react-native-ui-lib/package.json b/packages/react-native-ui-lib/package.json index f78eaa5d91..95f880812a 100644 --- a/packages/react-native-ui-lib/package.json +++ b/packages/react-native-ui-lib/package.json @@ -32,11 +32,9 @@ "color": "^3.1.0", "commons-validator-js": "^1.0.237", "date-fns": "^2.29.3", - "deprecated-react-native-prop-types": "^2.3.0", "hoist-non-react-statics": "^3.0.0", "lodash": "^4.17.21", "memoize-one": "^5.0.5", - "prop-types": "^15.5.10", "react-freeze": "^1.0.0", "react-native-redash": "^12.0.3", "semver": "^5.5.0", @@ -70,7 +68,6 @@ "@types/hoist-non-react-statics": "^3.3.1", "@types/jest": "^29.5.13", "@types/lodash": "^4.0.0", - "@types/prop-types": "^15.5.3", "@types/react": "19.0.0", "@types/react-test-renderer": "19.0.0", "@types/tinycolor2": "^1.4.2", diff --git a/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js b/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js index e527c514f2..789bf2d07d 100644 --- a/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js +++ b/packages/react-native-ui-lib/src/commons/__tests__/modifiers.spec.js @@ -1,14 +1,9 @@ -import PropTypes from 'prop-types'; import {ThemeManager, Colors, Typography, BorderRadiuses, Spacings} from '../../style'; import * as uut from '../modifiers'; describe('Modifiers', () => { const SampleComponent = () => {}; SampleComponent.displayName = 'SampleComponent'; - SampleComponent.propTypes = { - prop1: PropTypes.string, - prop2: PropTypes.number - }; describe('extractColorValue', () => { it('should return color value according to modifier', () => { diff --git a/packages/react-native-ui-lib/src/commons/baseComponent.tsx b/packages/react-native-ui-lib/src/commons/baseComponent.tsx index 180129297c..2ab4affa83 100644 --- a/packages/react-native-ui-lib/src/commons/baseComponent.tsx +++ b/packages/react-native-ui-lib/src/commons/baseComponent.tsx @@ -1,5 +1,4 @@ import React, {ComponentType} from 'react'; -// import PropTypes from 'prop-types'; import {StyleSheet} from 'react-native'; import _ from 'lodash'; import {Colors} from '../style'; @@ -8,12 +7,6 @@ import * as Modifiers from './modifiers'; export default function baseComponent(usePure: boolean): ComponentType { const parent = usePure ? React.PureComponent : React.Component; class BaseComponent extends parent { - // static propTypes = { - // ..._.mapValues(Typography, () => PropTypes.bool), - // ..._.mapValues(Colors, () => PropTypes.bool), - // useNativeDriver: PropTypes.bool, - // }; - styles: any; view: any; diff --git a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js index 0a456af5d1..5ecdb2e7d4 100644 --- a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +++ b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js @@ -1,6 +1,5 @@ import _ from 'lodash'; import {Component} from 'react'; -import PropTypes from 'prop-types'; import ReactNative, {DeviceEventEmitter, Keyboard} from 'react-native'; export default class KeyboardAwareBase extends Component { @@ -22,12 +21,6 @@ export default class KeyboardAwareBase extends Component { this._addKeyboardEventListeners(); } - static propTypes = { - startScrolledToBottom: PropTypes.bool, - scrollToBottomOnKBShow: PropTypes.bool, - scrollToInputAdditionalOffset: PropTypes.number - }; - static defaultProps = { startScrolledToBottom: false, scrollToBottomOnKBShow: false, diff --git a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js index 55b4bb6ed3..ca59e294c3 100644 --- a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js +++ b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {FlatList} from 'react-native'; import KeyboardAwareBase from './KeyboardAwareBase'; @@ -10,11 +9,6 @@ import KeyboardAwareBase from './KeyboardAwareBase'; export default class KeyboardAwareFlatList extends KeyboardAwareBase { static displayName = 'KeyboardAwareFlatList'; - static PropTypes = { - getTextInputRefs: PropTypes.func, - onScroll: PropTypes.func - }; - static defaultProps = { ...KeyboardAwareBase.defaultProps, getTextInputRefs: () => { diff --git a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js index 5bfa0518b6..9dd8dbba1b 100644 --- a/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +++ b/packages/react-native-ui-lib/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {ScrollView} from 'react-native'; import KeyboardAwareBase from './KeyboardAwareBase'; @@ -10,11 +9,6 @@ import KeyboardAwareBase from './KeyboardAwareBase'; export default class KeyboardAwareScrollView extends KeyboardAwareBase { static displayName = 'KeyboardAwareScrollView'; - static PropTypes = { - getTextInputRefs: PropTypes.func, - onScroll: PropTypes.func - }; - static defaultProps = { ...KeyboardAwareBase.defaultProps, getTextInputRefs: () => { diff --git a/packages/react-native-ui-lib/src/components/animatedScanner/index.js b/packages/react-native-ui-lib/src/components/animatedScanner/index.js index 3fc6291f7c..bf480c76ae 100644 --- a/packages/react-native-ui-lib/src/components/animatedScanner/index.js +++ b/packages/react-native-ui-lib/src/components/animatedScanner/index.js @@ -1,8 +1,6 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {StyleSheet, Animated} from 'react-native'; -import {ViewPropTypes} from 'deprecated-react-native-prop-types'; import {Colors} from '../../style'; import {BaseComponent} from '../../commons'; import View from '../../components/view'; @@ -16,41 +14,6 @@ import View from '../../components/view'; */ export default class AnimatedScanner extends BaseComponent { static displayName = 'AnimatedScanner'; - static propTypes = { - /** - * animated value between 0 and 100 - */ - // progress: PropTypes.object, - progress: PropTypes.number, - /** - * Duration of current break (can be change between breaks) - */ - duration: PropTypes.number, - /** - * scanner opacity - */ - opacity: PropTypes.number, - /** - * scanner background color - */ - backgroundColor: PropTypes.string, - /** - * breakpoint callback - ({progress, isDone}) => {} - */ - onBreakpoint: PropTypes.func, - /** - * should hide the scanner line - */ - hideScannerLine: PropTypes.bool, - /** - * the container style - */ - containerStyle: ViewPropTypes.style, - /** - * Used as a testing identifier - */ - testID: PropTypes.string - }; static defaultProps = { progress: 0, diff --git a/packages/react-native-ui-lib/src/components/carousel/types.ts b/packages/react-native-ui-lib/src/components/carousel/types.ts index d813ca86a3..221a502d20 100644 --- a/packages/react-native-ui-lib/src/components/carousel/types.ts +++ b/packages/react-native-ui-lib/src/components/carousel/types.ts @@ -1,6 +1,4 @@ import {ScrollViewProps, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent, Animated} from 'react-native'; -// @ts-expect-error No typings available for 'deprecated-react-native-prop-types' -import {PointPropType} from 'deprecated-react-native-prop-types'; import {PageControlProps} from '../pageControl'; export enum PageControlPosition { @@ -8,6 +6,11 @@ export enum PageControlPosition { UNDER = 'under' } +export type PointPropType = { + x: number; + y: number; +}; + export interface CarouselProps extends ScrollViewProps { /** * the first page to start with @@ -96,7 +99,6 @@ export interface CarouselProps extends ScrollViewProps { * Carousel scroll offset (pass new Animated.ValueXY()) */ animatedScrollOffset?: Animated.ValueXY; - } export interface CarouselState { diff --git a/packages/react-native-ui-lib/src/components/maskedInput/old.js b/packages/react-native-ui-lib/src/components/maskedInput/old.js index 0019549508..c14939dd8b 100644 --- a/packages/react-native-ui-lib/src/components/maskedInput/old.js +++ b/packages/react-native-ui-lib/src/components/maskedInput/old.js @@ -1,8 +1,6 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {StyleSheet, Keyboard} from 'react-native'; -import {ViewPropTypes} from 'deprecated-react-native-prop-types'; import BaseInput from '../baseInput'; import TextField from '../textFieldOld'; import View from '../view'; @@ -16,17 +14,6 @@ import TouchableOpacity from '../touchableOpacity'; */ export default class MaskedInput extends BaseInput { static displayName = 'MaskedInput'; - static propTypes = { - ...TextField.propTypes, - /** - * callback for rendering the custom input out of the value returns from the actual input - */ - renderMaskedText: PropTypes.elementType.isRequired, - /** - * container style for the masked input container - */ - containerStyle: ViewPropTypes.style - }; componentDidMount() { this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => { diff --git a/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js b/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js index 0ea1f25b45..ffe959d445 100644 --- a/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js +++ b/packages/react-native-ui-lib/src/components/picker/PickerDialog.android.js @@ -1,7 +1,5 @@ import React, {Component} from 'react'; import {StyleSheet} from 'react-native'; -import {TextPropTypes} from 'deprecated-react-native-prop-types'; -import PropTypes from 'prop-types'; import _ from 'lodash'; import Dialog from '../dialog'; @@ -11,19 +9,6 @@ import {Colors, BorderRadiuses} from '../../style'; class PickerDialog extends Component { static displayName = 'PickerDialog'; - static propTypes = { - onDone: PropTypes.func, - onCancel: PropTypes.func, - children: PropTypes.array, - /** - * select label style - */ - selectLabelStyle: TextPropTypes.style, - /** - * cancel label style - */ - cancelLabelStyle: TextPropTypes.style - }; state = {}; diff --git a/packages/react-native-ui-lib/src/components/picker/PickerDialog.js b/packages/react-native-ui-lib/src/components/picker/PickerDialog.js index 9e1a311d12..3de99c6ed4 100644 --- a/packages/react-native-ui-lib/src/components/picker/PickerDialog.js +++ b/packages/react-native-ui-lib/src/components/picker/PickerDialog.js @@ -1,6 +1,5 @@ import React, {Component} from 'react'; import {StyleSheet} from 'react-native'; -import PropTypes from 'prop-types'; import _ from 'lodash'; import Dialog from '../dialog'; @@ -10,12 +9,6 @@ import {Colors} from '../../style'; class PickerDialog extends Component { static displayName = 'PickerDialog'; - static propTypes = { - onDone: PropTypes.func, - onCancel: PropTypes.func, - topBarProps: PropTypes.object, - children: PropTypes.array - }; state = {}; diff --git a/packages/react-native-ui-lib/src/components/textArea/index.js b/packages/react-native-ui-lib/src/components/textArea/index.js index 410efc248e..5d602d2943 100644 --- a/packages/react-native-ui-lib/src/components/textArea/index.js +++ b/packages/react-native-ui-lib/src/components/textArea/index.js @@ -1,6 +1,5 @@ import React from 'react'; import {View, TextInput as RNTextInput, StyleSheet} from 'react-native'; -import {TextInputPropTypes} from 'deprecated-react-native-prop-types'; import BaseInput from '../baseInput'; import {Colors} from '../../style'; @@ -15,11 +14,6 @@ import {Colors} from '../../style'; export default class TextArea extends BaseInput { static displayName = 'TextArea'; - static propTypes = { - ...TextInputPropTypes, - ...BaseInput.propTypes - }; - generateStyles() { this.styles = createStyles(this.props); } diff --git a/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx b/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx index 3c94df0b10..dda34ea5da 100644 --- a/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx +++ b/packages/react-native-ui-lib/src/components/textFieldOld/index.tsx @@ -6,10 +6,8 @@ // TODO: add trailing/leading icon props // TODO: support margin modifiers import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {StyleSheet, Animated, TextInput as RNTextInput} from 'react-native'; -import {TextInputPropTypes, ImagePropTypes} from 'deprecated-react-native-prop-types'; import memoize from 'memoize-one'; import {Constants} from '../../commons/new'; import {Colors, Typography, Spacings} from '../../style'; @@ -57,136 +55,6 @@ const FLOATING_PLACEHOLDER_SCALE = 0.875; export default class TextField extends BaseInput { static displayName = 'TextFieldOld'; - static propTypes = { - ...TextInputPropTypes, - ...BaseInput.propTypes, - /** - * should placeholder have floating behavior - */ - floatingPlaceholder: PropTypes.bool, - /** - * floating placeholder color as a string or object of states, ex. {default: 'black', error: 'red', focus: 'blue', disabled: 'grey'} - */ - floatingPlaceholderColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - /** - * Custom style for floating placeholder - */ - floatingPlaceholderStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]), - /** - * This text will appear as a placeholder when the textInput becomes focused, only when passing floatingPlaceholder - * as well (NOT for expandable textInputs) - */ - helperText: PropTypes.string, - /** - * hide text input underline, by default false - */ - hideUnderline: PropTypes.bool, - /** - * underline color as a string or object of states, ex. {default: 'black', error: 'red', focus: 'blue', disabled: 'grey'} - */ - underlineColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - /** - * the color of all text when the input is disabled (if undefined will not apply color) - */ - disabledColor: PropTypes.string, - /** - * should text input be align to center - */ - centered: PropTypes.bool, - /** - * input error message, should be empty if no error exists - */ - error: PropTypes.string, - /** - * should the input component support error messages - */ - enableErrors: PropTypes.bool, - /** - * input error message's text color - */ - errorColor: PropTypes.string, - /** - * should the input expand to another text area modal - */ - expandable: PropTypes.bool, - /** - * Render custom expandable input (requires expandable to be true) - */ - renderExpandableInput: PropTypes.elementType, - /** - * allow custom rendering of expandable content when clicking on the input (useful for pickers) - * accept props and state as params, ex. (props, state) => {...} - * use toggleExpandableModal(false) method to toggle off the expandable content - */ - renderExpandable: PropTypes.elementType, - /** - * Callback for the modal toggle. Pass with renderExpandable to control the modal toggle - */ - onToggleExpandableModal: PropTypes.func, - /** - * The picker modal top bar props - */ - topBarProps: PropTypes.shape(Modal.TopBar.propTypes), - /** - * transform function executed on value and return transformed value - */ - transformer: PropTypes.func, - /** - * Pass to render a prefix text as part of the input (doesn't work with floatingPlaceholder) - */ - prefix: PropTypes.string, - /** - * The prefix style - */ - prefixStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]), - /** - * Fixed title that will displayed above the input (note: floatingPlaceholder MUST be 'false') - */ - title: PropTypes.string, - /** - * The title's color as a string or object of states, ex. {default: 'black', error: 'red', focus: 'blue', disabled: 'grey'} - */ - titleColor: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - /** - * Additional styles for the title (not including 'color') - */ - titleStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]), - /** - * should the input display a character counter (only when passing 'maxLength') - */ - showCharacterCounter: PropTypes.bool, - /** - * should float the placeholder when focused (instead of when typing) - */ - floatOnFocus: PropTypes.bool, - /** - * should the errors be displayed at the top - */ - useTopErrors: PropTypes.bool, - /** - * Icon asset source for showing on the right side, appropriate for dropdown icon and such - */ - rightIconSource: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - /** - * Pass to style the right icon source - */ - rightIconStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - /** - * Props for the right button {iconSource, onPress, style} - */ - rightButtonProps: PropTypes.shape({ - iconSource: ImagePropTypes.source, - iconColor: PropTypes.string, - onPress: PropTypes.func, - style: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - accessibilityLabel: PropTypes.string - }), - /** - * Pass to render a leading icon to the TextInput value. Accepts Image props (doesn't work with floatingPlaceholder) - */ - leadingIcon: PropTypes.shape(ImagePropTypes) - }; - static defaultProps = { enableErrors: true, validateOnBlur: true diff --git a/packages/react-native-ui-lib/src/components/toast/index.js b/packages/react-native-ui-lib/src/components/toast/index.js index f1408ee0b2..63e77af3a0 100644 --- a/packages/react-native-ui-lib/src/components/toast/index.js +++ b/packages/react-native-ui-lib/src/components/toast/index.js @@ -1,5 +1,4 @@ import _ from 'lodash'; -import PropTypes from 'prop-types'; import React from 'react'; import {AccessibilityInfo, findNodeHandle, StyleSheet, Animated, Easing, ActivityIndicator} from 'react-native'; import {PureBaseComponent} from '../../commons'; @@ -21,74 +20,6 @@ const COLOR = Colors.white; export default class Toast extends PureBaseComponent { static displayName = 'Toast'; - static propTypes = { - /** - * Whether to show or hide the toast - */ - visible: PropTypes.bool, - /** - * The position of the toast. 'top' or 'bottom'. - */ - position: PropTypes.oneOf(['top', 'bottom']), - /** - * custom zIndex for toast - */ - zIndex: PropTypes.number, - /** - * The background color of the toast - */ - backgroundColor: PropTypes.string, - /** - * the toast content color (message, actions labels) - */ - color: PropTypes.string, - /** - * the toast message - */ - message: PropTypes.string, - /** - * should message be centered in the toast - */ - centerMessage: PropTypes.bool, - /** - * a left icon - */ - icon: PropTypes.oneOfType([PropTypes.object, PropTypes.number]), - /** - * a single action for the user - */ - action: PropTypes.shape(Button.propTypes), - /** - * should show a loader (showDismiss must be false) - */ - showLoader: PropTypes.bool, - /** - * callback for dismiss action - */ - onDismiss: PropTypes.func, - /** - * number of milliseconds to automatically invoke the onDismiss callback - */ - autoDismiss: PropTypes.number, - /** - * show dismiss action (right 'X' button) - */ - showDismiss: PropTypes.bool, - /** - * callback for end of component animation - */ - onAnimationEnd: PropTypes.func, - /** - * render a custom view that will appear permanently above or below a Toast, - * depends on the Toast's position, and animate with it when the Toast is made visible or dismissed - */ - renderAttachment: PropTypes.elementType, - /** - * render a custom loader component instead of the default when passing showLoader - */ - customLoader: PropTypes.func - }; - static defaultProps = { position: 'top', zIndex: 100 diff --git a/packages/react-native-ui-lib/src/components/wizard/types.ts b/packages/react-native-ui-lib/src/components/wizard/types.ts index 3ca8855b96..12b7b1e62b 100644 --- a/packages/react-native-ui-lib/src/components/wizard/types.ts +++ b/packages/react-native-ui-lib/src/components/wizard/types.ts @@ -77,7 +77,7 @@ export interface WizardProps { */ activeIndex: number; /** - * The configuration of the active step (see Wizard.Step.propTypes) + * The configuration of the active step */ activeConfig?: WizardStepProps; /** diff --git a/packages/react-native-ui-lib/src/components/wizard/wizard.api.json b/packages/react-native-ui-lib/src/components/wizard/wizard.api.json index ac84d739a9..7fe3ae2d98 100644 --- a/packages/react-native-ui-lib/src/components/wizard/wizard.api.json +++ b/packages/react-native-ui-lib/src/components/wizard/wizard.api.json @@ -17,7 +17,7 @@ { "name": "activeConfig", "type": "WizardStepProps", - "description": "The configuration of the active step (see Wizard.Step.propTypes)" + "description": "The configuration of the active step" }, { "name": "onActiveIndexChanged", diff --git a/yarn.lock b/yarn.lock index d554888930..0382bd9608 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2615,13 +2615,6 @@ __metadata: languageName: node linkType: hard -"@react-native/normalize-color@npm:*": - version: 2.1.0 - resolution: "@react-native/normalize-color@npm:2.1.0" - checksum: 10c0/95814a1e2aac9c00dfc2c65f9e2caec07f70d3dba903b5640f5cf24605bf39863e572f2a5138a85d1c514fb3c33f6931595e0a9f738a58b5c220ee74f2bec13b - languageName: node - linkType: hard - "@react-native/normalize-colors@npm:0.78.3": version: 0.78.3 resolution: "@react-native/normalize-colors@npm:0.78.3" @@ -3013,13 +3006,6 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:^15.5.3": - version: 15.7.13 - resolution: "@types/prop-types@npm:15.7.13" - checksum: 10c0/1b20fc67281902c6743379960247bc161f3f0406ffc0df8e7058745a85ea1538612109db0406290512947f9632fe9e10e7337bf0ce6338a91d6c948df16a7c61 - languageName: node - linkType: hard - "@types/react-test-renderer@npm:19.0.0": version: 19.0.0 resolution: "@types/react-test-renderer@npm:19.0.0" @@ -4896,17 +4882,6 @@ __metadata: languageName: node linkType: hard -"deprecated-react-native-prop-types@npm:^2.3.0": - version: 2.3.0 - resolution: "deprecated-react-native-prop-types@npm:2.3.0" - dependencies: - "@react-native/normalize-color": "npm:*" - invariant: "npm:*" - prop-types: "npm:*" - checksum: 10c0/a4bf78dde109cd1a706206fa6e06f7c44e70bc327b990f0f7f936d5d0b8a2372bc78e09979fb2e84bbc5233774aca4165b3ecd17a74765ccc11cead4827380ca - languageName: node - linkType: hard - "destroy@npm:1.2.0": version: 1.2.0 resolution: "destroy@npm:1.2.0" @@ -6574,7 +6549,7 @@ __metadata: languageName: node linkType: hard -"invariant@npm:*, invariant@npm:^2.2.4": +"invariant@npm:^2.2.4": version: 2.2.4 resolution: "invariant@npm:2.2.4" dependencies: @@ -9251,7 +9226,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:*, prop-types@npm:15.8.1, prop-types@npm:15.x.x, prop-types@npm:^15.5.10, prop-types@npm:^15.8.1": +"prop-types@npm:15.8.1, prop-types@npm:15.x.x, prop-types@npm:^15.5.10, prop-types@npm:^15.8.1": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -9588,7 +9563,6 @@ __metadata: "@types/hoist-non-react-statics": "npm:^3.3.1" "@types/jest": "npm:^29.5.13" "@types/lodash": "npm:^4.0.0" - "@types/prop-types": "npm:^15.5.3" "@types/react": "npm:19.0.0" "@types/react-test-renderer": "npm:^19.0.0" "@types/tinycolor2": "npm:^1.4.2" @@ -9639,7 +9613,6 @@ __metadata: "@types/hoist-non-react-statics": "npm:^3.3.1" "@types/jest": "npm:^29.5.13" "@types/lodash": "npm:^4.0.0" - "@types/prop-types": "npm:^15.5.3" "@types/react": "npm:19.0.0" "@types/react-test-renderer": "npm:19.0.0" "@types/tinycolor2": "npm:^1.4.2" @@ -9651,7 +9624,6 @@ __metadata: color: "npm:^3.1.0" commons-validator-js: "npm:^1.0.237" date-fns: "npm:^2.29.3" - deprecated-react-native-prop-types: "npm:^2.3.0" hoist-non-react-statics: "npm:^3.0.0" jest: "npm:^29.6.3" light-date: "npm:^1.2.0" @@ -9662,7 +9634,6 @@ __metadata: postcss: "npm:^8.4.21" postcss-js: "npm:^4.0.0" prettier: "npm:^3.2.5" - prop-types: "npm:^15.5.10" react: "npm:19.0.0" react-autobind: "npm:^1.0.6" react-dom: "npm:19.0.0"