react-native-ui-lib 8.2.2-snapshot.7685 → 8.2.2-snapshot.7707

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/ReactNativeUiLib.podspec +22 -0
  2. package/lib/components/HighlighterOverlayView/index.d.ts +2 -2
  3. package/lib/components/HighlighterOverlayView/index.web.d.ts +2 -2
  4. package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.ts +1 -1
  5. package/lib/components/Keyboard/KeyboardAccessoryView/index.d.ts +2 -2
  6. package/lib/components/Keyboard/KeyboardAccessoryView/index.js +1 -3
  7. package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.js +1 -3
  8. package/lib/components/Keyboard/KeyboardTrackingView/index.d.ts +2 -6
  9. package/lib/components/Keyboard/KeyboardTrackingView/index.js +4 -5
  10. package/lib/components/Keyboard/index.d.ts +1 -2
  11. package/lib/package.json +5 -4
  12. package/package.json +21 -19
  13. package/src/commons/asBaseComponent.js +1 -2
  14. package/src/commons/baseComponent.js +8 -0
  15. package/src/commons/forwardRef.js +4 -1
  16. package/src/commons/modifiers.d.ts +6 -0
  17. package/src/commons/modifiers.js +18 -0
  18. package/src/commons/withScrollEnabler.js +6 -4
  19. package/src/commons/withScrollReached.js +4 -0
  20. package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +7 -0
  21. package/src/components/KeyboardAwareScrollView/KeyboardAwareFlatList.js +6 -0
  22. package/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +6 -0
  23. package/src/components/WheelPicker/WheelPicker.driver.d.ts +2 -2
  24. package/src/components/WheelPicker/index.d.ts +2 -2
  25. package/src/components/WheelPicker/index.js +1 -1
  26. package/src/components/WheelPicker/usePresenter.d.ts +1 -1
  27. package/src/components/actionSheet/index.d.ts +1 -1
  28. package/src/components/animatedImage/index.d.ts +1 -1
  29. package/src/components/animatedScanner/index.js +37 -0
  30. package/src/components/avatar/index.d.ts +1 -1
  31. package/src/components/badge/index.d.ts +4 -4
  32. package/src/components/baseInput/index.d.ts +1 -0
  33. package/src/components/baseInput/index.js +49 -1
  34. package/src/components/button/index.d.ts +4 -4
  35. package/src/components/button/types.d.ts +2 -2
  36. package/src/components/carousel/index.d.ts +8 -8
  37. package/src/components/carousel/types.d.ts +1 -4
  38. package/src/components/carousel/types.js +2 -0
  39. package/src/components/checkbox/index.d.ts +1 -1
  40. package/src/components/chip/index.d.ts +1 -1
  41. package/src/components/colorPalette/index.d.ts +1 -1
  42. package/src/components/dateTimePicker/index.d.ts +2 -2
  43. package/src/components/dateTimePicker/index.js +2 -2
  44. package/src/components/dialog/types.d.ts +4 -4
  45. package/src/components/drawer/index.d.ts +1 -1
  46. package/src/components/expandableSection/index.d.ts +2 -2
  47. package/src/components/fadedScrollView/index.js +1 -1
  48. package/src/components/featureHighlight/index.js +7 -5
  49. package/src/components/gridListItem/index.d.ts +7 -7
  50. package/src/components/gridView/index.d.ts +1 -1
  51. package/src/components/hint/HintBubble.d.ts +1 -1
  52. package/src/components/hint/HintOld.d.ts +10 -10
  53. package/src/components/hint/hooks/useHintLayout.d.ts +1 -1
  54. package/src/components/hint/index.d.ts +2 -2
  55. package/src/components/hint/types.d.ts +2 -2
  56. package/src/components/icon/index.js +3 -0
  57. package/src/components/image/index.d.ts +1 -1
  58. package/src/components/image/index.js +17 -20
  59. package/src/components/loaderScreen/index.d.ts +1 -1
  60. package/src/components/loaderScreen/types.d.ts +1 -1
  61. package/src/components/maskedInput/index.d.ts +4 -21
  62. package/src/components/maskedInput/index.js +18 -79
  63. package/src/components/maskedInput/maskedInput.api.json +1 -0
  64. package/src/components/maskedInput/new.d.ts +22 -0
  65. package/src/components/maskedInput/new.js +85 -0
  66. package/src/components/maskedInput/old.js +95 -0
  67. package/src/components/modal/index.d.ts +3 -3
  68. package/src/components/numberInput/index.js +2 -2
  69. package/src/components/overlay/index.d.ts +1 -1
  70. package/src/components/picker/PickerDialog.android.js +15 -0
  71. package/src/components/picker/PickerDialog.js +7 -0
  72. package/src/components/picker/helpers/useImperativePickerHandle.d.ts +1 -1
  73. package/src/components/picker/helpers/useImperativePickerHandle.js +1 -1
  74. package/src/components/picker/types.d.ts +9 -9
  75. package/src/components/progressBar/index.d.ts +2 -2
  76. package/src/components/scrollBar/index.d.ts +4 -11
  77. package/src/components/searchInput/index.js +1 -1
  78. package/src/components/searchInput/types.d.ts +2 -2
  79. package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +2 -2
  80. package/src/components/skeletonView/index.d.ts +4 -4
  81. package/src/components/slider/Thumb.d.ts +1 -1
  82. package/src/components/slider/types.d.ts +1 -1
  83. package/src/components/stackAggregator/index.d.ts +1 -1
  84. package/src/components/tabController/TabBarItem.d.ts +2 -2
  85. package/src/components/tabController/TabBarItem.js +1 -1
  86. package/src/components/tabController/TabPage.d.ts +2 -2
  87. package/src/components/tabController/useScrollToItem.d.ts +1 -1
  88. package/src/components/text/Text.driver.d.ts +1 -1
  89. package/src/components/textArea/index.js +6 -0
  90. package/src/components/textField/types.d.ts +4 -4
  91. package/src/components/textField/useImperativeInputHandle.d.ts +1 -1
  92. package/src/components/textField/useImperativeInputHandle.js +1 -1
  93. package/src/components/textField/usePreset.d.ts +20 -20
  94. package/src/components/textFieldOld/index.d.ts +71 -0
  95. package/src/components/textFieldOld/index.js +807 -0
  96. package/src/components/timeline/index.js +1 -1
  97. package/src/components/toast/index.js +69 -0
  98. package/src/components/view/index.js +5 -2
  99. package/src/components/wizard/index.d.ts +1 -1
  100. package/src/components/wizard/types.d.ts +1 -1
  101. package/src/components/wizard/wizard.api.json +1 -1
  102. package/src/helpers/DocsGenerator.js +61 -0
  103. package/src/hooks/useCombinedRefs/index.js +2 -1
  104. package/src/hooks/useDebounce/index.js +1 -1
  105. package/src/hooks/useHiddenLocation/index.js +2 -2
  106. package/src/hooks/useHiddenLocation/index.web.js +2 -2
  107. package/src/hooks/useMeasure/index.d.ts +1 -1
  108. package/src/hooks/useMeasure/index.js +1 -1
  109. package/src/hooks/useScrollTo/index.d.ts +2 -2
  110. package/src/incubator/calendar/index.js +1 -1
  111. package/src/incubator/calendar/types.d.ts +2 -2
  112. package/src/incubator/expandableOverlay/index.d.ts +2 -2
  113. package/src/incubator/slider/Track.d.ts +1 -1
  114. package/src/incubator/slider/index.d.ts +1 -1
  115. package/src/incubator/toast/helpers/useToastTimer.js +1 -1
  116. package/src/incubator/toast/index.js +1 -1
  117. package/src/incubator/toast/types.d.ts +2 -2
  118. package/src/testkit/Component.driver.d.ts +1 -1
  119. package/src/testkit/drivers/TestingLibraryDriver.d.ts +1 -1
  120. package/src/typings/module.d.ts +3 -12
  121. package/textFieldOld.d.ts +2 -0
  122. package/textFieldOld.js +1 -0
@@ -0,0 +1,22 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'lib/package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "ReactNativeUiLib"
7
+ s.version = package['version']
8
+ s.summary = "React Native UI Library"
9
+
10
+ s.authors = "Wix.com"
11
+ s.homepage = package['homepage']
12
+ s.license = package['license']
13
+ s.platforms = { :ios => "9.0", :tvos => "9.2" }
14
+
15
+ s.module_name = 'ReactNativeUiLib'
16
+
17
+ s.source = { :git => "https://github.com/wix/react-native-ui-lib.git", :tag => "#{s.version}" }
18
+ s.source_files = "lib/ios/**/*.{h,m}"
19
+
20
+ s.dependency 'React'
21
+ s.frameworks = 'UIKit'
22
+ end
@@ -1,4 +1,4 @@
1
- import { type JSX } from 'react';
1
+ import React from 'react';
2
2
  import { ViewStyle } from 'react-native';
3
3
  type HighlightFrameType = {
4
4
  x: number;
@@ -28,7 +28,7 @@ export type HighlighterOverlayViewProps = {
28
28
  testID?: string;
29
29
  };
30
30
  declare const HighlighterOverlayView: {
31
- (props: HighlighterOverlayViewProps): JSX.Element;
31
+ (props: HighlighterOverlayViewProps): React.JSX.Element;
32
32
  displayName: string;
33
33
  };
34
34
  export default HighlighterOverlayView;
@@ -1,4 +1,4 @@
1
- import { type JSX } from 'react';
1
+ import React from 'react';
2
2
  import { ViewStyle } from 'react-native';
3
3
  type HighlightFrameType = {
4
4
  x: number;
@@ -28,7 +28,7 @@ export type HighlighterOverlayViewProps = {
28
28
  testID?: string;
29
29
  };
30
30
  declare const HighlighterOverlayView: {
31
- (props: HighlighterOverlayViewProps): JSX.Element;
31
+ (props: HighlighterOverlayViewProps): React.JSX.Element;
32
32
  displayName: string;
33
33
  };
34
34
  export default HighlighterOverlayView;
@@ -9,7 +9,7 @@ export type CustomKeyboardViewBaseProps = {
9
9
  component?: string;
10
10
  onItemSelected?: (component?: string, args?: any) => void;
11
11
  onRequestShowKeyboard?: (keyboardId: string) => void;
12
- children?: React.ReactNode;
12
+ children?: React.ReactChild | React.ReactChild[];
13
13
  };
14
14
  export default class CustomKeyboardViewBase<T extends CustomKeyboardViewBaseProps> extends Component<T> {
15
15
  static defaultProps: {
@@ -6,7 +6,7 @@ export type KeyboardAccessoryViewProps = kbTrackingViewProps & {
6
6
  /**
7
7
  * Content to be rendered above the keyboard
8
8
  */
9
- renderContent?: () => React.ReactElement<any>;
9
+ renderContent?: () => React.ReactElement;
10
10
  /**
11
11
  * iOS only.
12
12
  * The reference to the actual text input (or the keyboard may not reset when instructed to, etc.).
@@ -37,7 +37,7 @@ export type KeyboardAccessoryViewProps = kbTrackingViewProps & {
37
37
  * Callback that will be called once the keyboard has been closed
38
38
  */
39
39
  onKeyboardResigned?: () => void;
40
- children?: React.ReactNode;
40
+ children?: React.ReactChild;
41
41
  };
42
42
  /**
43
43
  * @description: View that allows replacing the default keyboard with other components
@@ -141,9 +141,7 @@ class KeyboardAccessoryView extends Component {
141
141
  scrollBehavior,
142
142
  ...others
143
143
  } = this.props;
144
- return <KeyboardTrackingView {...others} scrollBehavior={scrollBehavior} ref={r => {
145
- this.trackingViewRef = r;
146
- }} style={styles.trackingToolbarContainer} onLayout={this.onContainerComponentHeightChanged}>
144
+ return <KeyboardTrackingView {...others} scrollBehavior={scrollBehavior} ref={r => this.trackingViewRef = r} style={styles.trackingToolbarContainer} onLayout={this.onContainerComponentHeightChanged}>
147
145
  <KeyboardHeightListener id={`${this.id}`} onDismiss={this.onDismiss} onKeyboardHeightChange={this.onKeyboardHeightChange} />
148
146
  <>{renderContent?.()}</>
149
147
  <CustomKeyboardView keyboardHeight={keyboardHeight} shouldFocus={shouldFocus} onKeyboardDismiss={this.onKeyboardDismiss} inputRef={kbInputRef} component={kbComponent} initialProps={this.processInitialProps()} onItemSelected={onItemSelected} onRequestShowKeyboard={onRequestShowKeyboard} useSafeArea={others.useSafeArea} />
@@ -18,9 +18,7 @@ class KeyboardTrackingView extends PureComponent {
18
18
  useSafeArea: false
19
19
  };
20
20
  render() {
21
- return <KeyboardTrackingViewNativeComponent {...this.props} ref={r => {
22
- this.ref = r;
23
- }} />;
21
+ return <KeyboardTrackingViewNativeComponent {...this.props} ref={r => this.ref = r} />;
24
22
  }
25
23
  async getNativeProps() {
26
24
  if (this.ref && KeyboardTrackingViewTempManager && KeyboardTrackingViewTempManager.getNativeProps) {
@@ -73,13 +73,9 @@ export type KeyboardTrackingViewProps = ViewProps & {
73
73
  usesBottomTabs?: boolean;
74
74
  ref?: any;
75
75
  style?: StyleProp<ViewStyle>;
76
- children?: React.ReactNode;
76
+ children?: React.ReactChild | React.ReactChild[];
77
77
  };
78
- declare const defaultProps: KeyboardTrackingViewProps;
79
- declare const KeyboardTrackingView: React.ForwardRefExoticComponent<Omit<KeyboardTrackingViewProps, "ref"> & React.RefAttributes<unknown>>;
80
- type KeyboardTrackingViewType = typeof KeyboardTrackingView & {
78
+ declare const _default: React.ForwardRefExoticComponent<Omit<KeyboardTrackingViewProps, "ref"> & React.RefAttributes<unknown>> & {
81
79
  scrollBehaviors: typeof SCROLL_BEHAVIORS;
82
- defaultProps: typeof defaultProps;
83
80
  };
84
- declare const _default: KeyboardTrackingViewType;
85
81
  export default _default;
@@ -8,16 +8,15 @@ const SCROLL_BEHAVIORS = {
8
8
  SCROLL_TO_BOTTOM_INVERTED_ONLY: NativeModules.KeyboardTrackingViewTempManager?.KeyboardTrackingScrollBehaviorScrollToBottomInvertedOnly,
9
9
  FIXED_OFFSET: NativeModules.KeyboardTrackingViewTempManager?.KeyboardTrackingScrollBehaviorFixedOffset
10
10
  };
11
- const defaultProps = {};
12
11
  const KeyboardTrackingView = forwardRef(({
13
12
  children,
14
13
  ...others
15
14
  }, ref) => {
16
15
  const KeyboardTrackingViewContainer = isAndroid ? KeyboardTrackingViewAndroid : KeyboardTrackingViewIOS;
17
- return <KeyboardTrackingViewContainer {...defaultProps} {...others} ref={ref}>
16
+ return <KeyboardTrackingViewContainer {...others} ref={ref}>
18
17
  {children}
19
18
  </KeyboardTrackingViewContainer>;
20
19
  });
21
- KeyboardTrackingView.defaultProps = defaultProps;
22
- KeyboardTrackingView.scrollBehaviors = SCROLL_BEHAVIORS;
23
- export default KeyboardTrackingView;
20
+ export default KeyboardTrackingView;
21
+ // @ts-expect-error
22
+ KeyboardTrackingView.scrollBehaviors = SCROLL_BEHAVIORS;
@@ -11,7 +11,6 @@ declare const _default: {
11
11
  SCROLL_TO_BOTTOM_INVERTED_ONLY: any;
12
12
  FIXED_OFFSET: any;
13
13
  };
14
- defaultProps: KeyboardTrackingViewProps;
15
14
  };
16
15
  KeyboardAwareInsetsView: {
17
16
  (props: import("react-native/types").ViewProps & {
@@ -28,7 +27,7 @@ declare const _default: {
28
27
  usesBottomTabs?: boolean | undefined;
29
28
  ref?: any;
30
29
  style?: import("react-native/types").StyleProp<import("react-native/types").ViewStyle>;
31
- children?: import("react").ReactNode;
30
+ children?: import("react").ReactChild | import("react").ReactChild[] | undefined;
32
31
  } & {
33
32
  offset?: number | undefined;
34
33
  }): import("react").JSX.Element;
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uilib-native",
3
- "version": "5.1.0",
3
+ "version": "5.0.1",
4
4
  "homepage": "https://github.com/wix/react-native-ui-lib",
5
5
  "description": "uilib native components (separated from js components)",
6
6
  "main": "components/index",
@@ -10,13 +10,14 @@
10
10
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "lodash": "^4.17.21"
13
+ "lodash": "^4.17.21",
14
+ "prop-types": "^15.5.10"
14
15
  },
15
16
  "devDependencies": {
16
17
  "shell-utils": "^1.0.10"
17
18
  },
18
19
  "peerDependencies": {
19
- "react": ">=19.0.0",
20
- "react-native": ">=0.78.3"
20
+ "react": ">=18.3.1",
21
+ "react-native": ">=0.77.3"
21
22
  }
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "8.2.2-snapshot.7685",
3
+ "version": "8.2.2-snapshot.7707",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -32,9 +32,11 @@
32
32
  "color": "^3.1.0",
33
33
  "commons-validator-js": "^1.0.237",
34
34
  "date-fns": "^2.29.3",
35
+ "deprecated-react-native-prop-types": "^2.3.0",
35
36
  "hoist-non-react-statics": "^3.0.0",
36
37
  "lodash": "^4.17.21",
37
38
  "memoize-one": "^5.0.5",
39
+ "prop-types": "^15.5.10",
38
40
  "react-freeze": "^1.0.0",
39
41
  "react-native-redash": "^12.0.3",
40
42
  "semver": "^5.5.0",
@@ -60,16 +62,17 @@
60
62
  "@react-native-community/cli-platform-ios": "15.0.1",
61
63
  "@react-native-community/datetimepicker": "8.2.0",
62
64
  "@react-native-community/netinfo": "11.3.3",
63
- "@react-native/babel-preset": "0.78.3",
64
- "@react-native/metro-config": "0.78.3",
65
- "@react-native/typescript-config": "0.78.3",
65
+ "@react-native/babel-preset": "0.77.3",
66
+ "@react-native/metro-config": "0.77.3",
67
+ "@react-native/typescript-config": "0.77.3",
66
68
  "@shopify/flash-list": "1.7.6",
67
- "@testing-library/react-native": "^13.3.3",
68
- "@types/hoist-non-react-statics": "^3.3.7",
69
+ "@testing-library/react-native": "^11.5.1",
70
+ "@types/hoist-non-react-statics": "^3.3.1",
69
71
  "@types/jest": "^29.5.13",
70
72
  "@types/lodash": "^4.0.0",
71
- "@types/react": "19.0.0",
72
- "@types/react-test-renderer": "19.0.0",
73
+ "@types/prop-types": "^15.5.3",
74
+ "@types/react": "18.3.24",
75
+ "@types/react-test-renderer": "^18.3.0",
73
76
  "@types/tinycolor2": "^1.4.2",
74
77
  "@types/url-parse": "^1.4.3",
75
78
  "@welldone-software/why-did-you-render": "^3.2.1",
@@ -82,34 +85,33 @@
82
85
  "postcss": "^8.4.21",
83
86
  "postcss-js": "^4.0.0",
84
87
  "prettier": "^3.2.5",
85
- "react": "19.0.0",
88
+ "react": "18.3.1",
86
89
  "react-autobind": "^1.0.6",
87
- "react-dom": "19.0.0",
88
- "react-native": "0.78.3",
90
+ "react-dom": "18.3.1",
91
+ "react-native": "0.77.3",
89
92
  "react-native-fs": "^2.20.0",
90
93
  "react-native-gesture-handler": "2.24.0",
91
94
  "react-native-haptic-feedback": "^1.11.0",
92
95
  "react-native-linear-gradient": "2.6.2",
93
96
  "react-native-mmkv": "3.2.0",
94
- "react-native-navigation": "8.4.3",
95
- "react-native-reanimated": "3.19.4",
97
+ "react-native-navigation": "8.1.2",
98
+ "react-native-reanimated": "3.18.0",
96
99
  "react-native-shimmer-placeholder": "^2.0.6",
97
100
  "react-native-svg": "15.11.2",
98
101
  "react-native-svg-transformer": "1.5.0",
99
- "react-test-renderer": "19.0.0",
102
+ "react-test-renderer": "18.3.1",
100
103
  "reassure": "^0.4.1",
101
104
  "setimmediate": "^1.0.5",
102
105
  "shell-utils": "^1.0.10",
103
106
  "typescript": "5.0.4",
104
- "uilib-native": "5.1.0-snapshot.7635"
107
+ "uilib-native": "^5.0.1"
105
108
  },
106
109
  "peerDependencies": {
107
- "react": ">=19.0.0",
110
+ "react": ">=18.3.1",
108
111
  "react-native": ">=0.77.3",
109
112
  "react-native-gesture-handler": ">=2.24.0",
110
- "react-native-reanimated": ">=3.19.4",
111
- "react-native-ui-lib": "*",
112
- "uilib-native": "5.1.0-snapshot.7635"
113
+ "react-native-reanimated": ">=3.17.5",
114
+ "uilib-native": "^5.0.1"
113
115
  },
114
116
  "jest": {
115
117
  "preset": "react-native",
@@ -32,7 +32,7 @@ function asBaseComponent(WrappedComponent, options = {}) {
32
32
  return Modifiers.getThemeProps.call(WrappedComponent, props, context);
33
33
  };
34
34
  static getDerivedStateFromError(error) {
35
- UIComponent.defaultProps?.onError?.(error);
35
+ UIComponent.defaultProps?.onError?.(error, WrappedComponent.defaultProps);
36
36
  return {
37
37
  error: true
38
38
  };
@@ -55,7 +55,6 @@ function asBaseComponent(WrappedComponent, options = {}) {
55
55
  hoistStatics(BaseComponent, WrappedComponent);
56
56
  BaseComponent.displayName = WrappedComponent.displayName;
57
57
  BaseComponent.propTypes = WrappedComponent.propTypes;
58
- // @ts-expect-error class component have defaultProps and functions do not and so should not be affected by this
59
58
  BaseComponent.defaultProps = WrappedComponent.defaultProps;
60
59
  const ThemeContext = ThemeManager.getThemeContext();
61
60
  if (ThemeContext) {
@@ -8,12 +8,20 @@ import _includes from "lodash/includes";
8
8
  import _pickBy from "lodash/pickBy";
9
9
  import _pick from "lodash/pick";
10
10
  import React from 'react';
11
+ // import PropTypes from 'prop-types';
11
12
  import { StyleSheet } from 'react-native';
12
13
  import { Colors } from "../style";
13
14
  import * as Modifiers from "./modifiers";
14
15
  export default function baseComponent(usePure) {
15
16
  const parent = usePure ? React.PureComponent : React.Component;
16
17
  class BaseComponent extends parent {
18
+ // static propTypes = {
19
+ // ..._.mapValues(Typography, () => PropTypes.bool),
20
+ // ..._.mapValues(Colors, () => PropTypes.bool),
21
+ // useNativeDriver: PropTypes.bool,
22
+ // };
23
+
24
+ static extractOwnProps = Modifiers.extractOwnProps;
17
25
  constructor(props) {
18
26
  super(props);
19
27
  if (!this.styles) {
@@ -8,8 +8,11 @@ export default function forwardRef(WrappedComponent) {
8
8
  // @ts-expect-error
9
9
  const ForwardedComponent = React.forwardRef(forwardRef);
10
10
  hoistStatics(ForwardedComponent, WrappedComponent);
11
+ //@ts-ignore
11
12
  ForwardedComponent.displayName = WrappedComponent.displayName;
12
- // @ts-expect-error
13
+ //@ts-ignore
14
+ ForwardedComponent.propTypes = WrappedComponent.propTypes;
15
+ //@ts-ignore
13
16
  ForwardedComponent.defaultProps = WrappedComponent.defaultProps;
14
17
  return ForwardedComponent;
15
18
  }
@@ -105,6 +105,12 @@ export declare function extractAccessibilityProps(props?: any): Partial<any>;
105
105
  export declare function extractAnimationProps(props?: any): Pick<any, "animation" | "duration" | "delay" | "direction" | "easing" | "iterationCount" | "transition" | "onAnimationBegin" | "onAnimationEnd" | "useNativeDriver">;
106
106
  export declare function extractBorderRadiusValue(props: Dictionary<any>): number | undefined;
107
107
  export declare function extractModifierProps(props: Dictionary<any>): _.Dictionary<any>;
108
+ /**
109
+ * TODO:
110
+ * @deprecated switch to Modifiers#extractComponentProps
111
+ */
112
+ export declare function extractOwnProps(props: Dictionary<any>, ignoreProps: string[]): _.Omit<_.Dictionary<any>, string>;
113
+ export declare function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps?: string[]): _.Omit<_.Dictionary<any>, string>;
108
114
  export declare function getComponentName(componentDisplayName: string): any;
109
115
  export declare function getThemeProps<T extends object>(props?: T, context?: any, componentDisplayName?: string): T;
110
116
  export declare function generateModifiersStyle(options: ModifiersOptions | undefined, props: Dictionary<any>): ExtractedStyle;
@@ -2,6 +2,8 @@ import _isEqual from "lodash/isEqual";
2
2
  import _keys from "lodash/keys";
3
3
  import _union from "lodash/union";
4
4
  import _isFunction from "lodash/isFunction";
5
+ import _omit from "lodash/omit";
6
+ import _flow from "lodash/flow";
5
7
  import _find from "lodash/find";
6
8
  import _pick from "lodash/pick";
7
9
  import _pickBy from "lodash/pickBy";
@@ -230,6 +232,22 @@ export function extractModifierProps(props) {
230
232
  });
231
233
  return modifierProps;
232
234
  }
235
+
236
+ /**
237
+ * TODO:
238
+ * @deprecated switch to Modifiers#extractComponentProps
239
+ */
240
+ export function extractOwnProps(props, ignoreProps) {
241
+ //@ts-ignore
242
+ const ownPropTypes = this.propTypes;
243
+ const ownProps = _flow(props => _pickBy(props, (_value, key) => _includes(Object.keys(ownPropTypes), key)), props => _omit(props, ignoreProps))(props);
244
+ return ownProps;
245
+ }
246
+ export function extractComponentProps(component, props, ignoreProps = []) {
247
+ const componentPropTypes = component.propTypes;
248
+ const componentProps = _flow(props => _pickBy(props, (_value, key) => _includes(Object.keys(componentPropTypes), key)), props => _omit(props, ignoreProps))(props);
249
+ return componentProps;
250
+ }
233
251
  export function getComponentName(componentDisplayName) {
234
252
  //@ts-ignore
235
253
  return componentDisplayName || this.displayName || this.constructor.displayName || this.constructor.name;
@@ -8,10 +8,8 @@ function withScrollEnabler(WrappedComponent) {
8
8
  const layoutSize = useRef(0);
9
9
  const checkScroll = useCallback(() => {
10
10
  const isScrollEnabled = Math.floor(contentSize.current) > layoutSize.current;
11
- if (isScrollEnabled !== scrollEnabled) {
12
- setScrollEnabled(isScrollEnabled);
13
- }
14
- }, [scrollEnabled]);
11
+ setScrollEnabled(isScrollEnabled);
12
+ }, []);
15
13
  const onContentSizeChange = useCallback((contentWidth, contentHeight) => {
16
14
  const size = props.horizontal ? contentWidth : contentHeight;
17
15
  if (size !== contentSize.current) {
@@ -46,6 +44,10 @@ function withScrollEnabler(WrappedComponent) {
46
44
  };
47
45
  hoistStatics(ScrollEnabler, WrappedComponent);
48
46
  ScrollEnabler.displayName = WrappedComponent.displayName;
47
+ //@ts-ignore
48
+ ScrollEnabler.propTypes = WrappedComponent.propTypes;
49
+ //@ts-ignore
50
+ ScrollEnabler.defaultProps = WrappedComponent.defaultProps;
49
51
  return forwardRef(ScrollEnabler);
50
52
  }
51
53
  export default withScrollEnabler;
@@ -57,6 +57,10 @@ function withScrollReached(WrappedComponent, options = {}) {
57
57
  };
58
58
  hoistStatics(ScrollReachedDetector, WrappedComponent);
59
59
  ScrollReachedDetector.displayName = WrappedComponent.displayName;
60
+ //@ts-ignore
61
+ ScrollReachedDetector.propTypes = WrappedComponent.propTypes;
62
+ //@ts-ignore
63
+ ScrollReachedDetector.defaultProps = WrappedComponent.defaultProps;
60
64
  return forwardRef(ScrollReachedDetector);
61
65
  }
62
66
  export default withScrollReached;
@@ -1,5 +1,6 @@
1
1
  import _ from 'lodash';
2
2
  import {Component} from 'react';
3
+ import PropTypes from 'prop-types';
3
4
  import ReactNative, {DeviceEventEmitter, Keyboard} from 'react-native';
4
5
 
5
6
  export default class KeyboardAwareBase extends Component {
@@ -21,6 +22,12 @@ export default class KeyboardAwareBase extends Component {
21
22
  this._addKeyboardEventListeners();
22
23
  }
23
24
 
25
+ static propTypes = {
26
+ startScrolledToBottom: PropTypes.bool,
27
+ scrollToBottomOnKBShow: PropTypes.bool,
28
+ scrollToInputAdditionalOffset: PropTypes.number
29
+ };
30
+
24
31
  static defaultProps = {
25
32
  startScrolledToBottom: false,
26
33
  scrollToBottomOnKBShow: false,
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import PropTypes from 'prop-types';
2
3
  import {FlatList} from 'react-native';
3
4
  import KeyboardAwareBase from './KeyboardAwareBase';
4
5
 
@@ -9,6 +10,11 @@ import KeyboardAwareBase from './KeyboardAwareBase';
9
10
  export default class KeyboardAwareFlatList extends KeyboardAwareBase {
10
11
  static displayName = 'KeyboardAwareFlatList';
11
12
 
13
+ static PropTypes = {
14
+ getTextInputRefs: PropTypes.func,
15
+ onScroll: PropTypes.func
16
+ };
17
+
12
18
  static defaultProps = {
13
19
  ...KeyboardAwareBase.defaultProps,
14
20
  getTextInputRefs: () => {
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import PropTypes from 'prop-types';
2
3
  import {ScrollView} from 'react-native';
3
4
  import KeyboardAwareBase from './KeyboardAwareBase';
4
5
 
@@ -9,6 +10,11 @@ import KeyboardAwareBase from './KeyboardAwareBase';
9
10
  export default class KeyboardAwareScrollView extends KeyboardAwareBase {
10
11
  static displayName = 'KeyboardAwareScrollView';
11
12
 
13
+ static PropTypes = {
14
+ getTextInputRefs: PropTypes.func,
15
+ onScroll: PropTypes.func
16
+ };
17
+
12
18
  static defaultProps = {
13
19
  ...KeyboardAwareBase.defaultProps,
14
20
  getTextInputRefs: () => {
@@ -4,11 +4,11 @@ export declare const WheelPickerDriver: (props: ComponentProps) => {
4
4
  moveToItem: (index: number, itemHeight?: number, numberOfRows?: number) => void;
5
5
  getLabel: () => string | (string | import("react-test-renderer").ReactTestInstance)[];
6
6
  scroll: (contentOffset: Partial<import("react-native/types").NativeScrollPoint>, options?: {
7
+ contentInset: import("react-native/types").NativeScrollRectangle;
8
+ zoomScale: number;
7
9
  layoutMeasurement: import("react-native/types").NativeScrollSize;
8
10
  contentSize: import("react-native/types").NativeScrollSize;
9
11
  velocity?: import("react-native/types").NativeScrollVelocity | undefined;
10
- contentInset: import("react-native/types").NativeScrollRectangle;
11
- zoomScale: number;
12
12
  targetContentOffset?: import("react-native/types").NativeScrollPoint | undefined;
13
13
  } | undefined) => void;
14
14
  triggerEvent: (eventName?: string | undefined, event?: Partial<import("react-native/types").NativeScrollEvent> | undefined) => void;
@@ -1,4 +1,4 @@
1
- import { type JSX } from 'react';
1
+ import React from 'react';
2
2
  import { TextStyle, ViewStyle, FlatListProps } from 'react-native';
3
3
  import { TextProps } from '../text';
4
4
  import { FaderProps } from '../fader';
@@ -81,7 +81,7 @@ export type WheelPickerProps<T = WheelPickerItemValue> = {
81
81
  flatListProps?: Partial<FlatListProps<WheelPickerItemProps<T>>>;
82
82
  };
83
83
  declare const WheelPicker: {
84
- <T extends WheelPickerItemValue>(props: WheelPickerProps<T>): JSX.Element;
84
+ <T extends WheelPickerItemValue>(props: WheelPickerProps<T>): React.JSX.Element;
85
85
  alignments: typeof WheelPickerAlign;
86
86
  };
87
87
  export default WheelPicker;
@@ -39,7 +39,7 @@ const WheelPicker = props => {
39
39
  faderProps,
40
40
  flatListProps
41
41
  } = themeProps;
42
- const scrollView = useRef(undefined);
42
+ const scrollView = useRef();
43
43
  const offset = useSharedValue(0);
44
44
  const scrollHandler = useAnimatedScrollHandler(e => {
45
45
  offset.value = e.contentOffset.y;
@@ -1,4 +1,4 @@
1
- import { type JSX } from 'react';
1
+ /// <reference types="react" />
2
2
  import { WheelPickerItemValue } from './types';
3
3
  import { WheelPickerItemProps } from './Item';
4
4
  type PropTypes<T> = {
@@ -1,4 +1,4 @@
1
- import React, { type JSX } from 'react';
1
+ import React from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
3
  import { ButtonProps } from '../button';
4
4
  import { type DialogProps } from '../dialog';
@@ -13,7 +13,7 @@ export interface AnimatedImageProps extends ImageProps {
13
13
  /**
14
14
  * A component to render while the image is loading
15
15
  */
16
- loader?: React.ReactElement<any>;
16
+ loader?: React.ReactElement;
17
17
  }
18
18
  /**
19
19
  * @description: Image component that fades-in the image with animation once it's loaded
@@ -1,6 +1,8 @@
1
1
  import _ from 'lodash';
2
+ import PropTypes from 'prop-types';
2
3
  import React from 'react';
3
4
  import {StyleSheet, Animated} from 'react-native';
5
+ import {ViewPropTypes} from 'deprecated-react-native-prop-types';
4
6
  import {Colors} from '../../style';
5
7
  import {BaseComponent} from '../../commons';
6
8
  import View from '../../components/view';
@@ -14,6 +16,41 @@ import View from '../../components/view';
14
16
  */
15
17
  export default class AnimatedScanner extends BaseComponent {
16
18
  static displayName = 'AnimatedScanner';
19
+ static propTypes = {
20
+ /**
21
+ * animated value between 0 and 100
22
+ */
23
+ // progress: PropTypes.object,
24
+ progress: PropTypes.number,
25
+ /**
26
+ * Duration of current break (can be change between breaks)
27
+ */
28
+ duration: PropTypes.number,
29
+ /**
30
+ * scanner opacity
31
+ */
32
+ opacity: PropTypes.number,
33
+ /**
34
+ * scanner background color
35
+ */
36
+ backgroundColor: PropTypes.string,
37
+ /**
38
+ * breakpoint callback - ({progress, isDone}) => {}
39
+ */
40
+ onBreakpoint: PropTypes.func,
41
+ /**
42
+ * should hide the scanner line
43
+ */
44
+ hideScannerLine: PropTypes.bool,
45
+ /**
46
+ * the container style
47
+ */
48
+ containerStyle: ViewPropTypes.style,
49
+ /**
50
+ * Used as a testing identifier
51
+ */
52
+ testID: PropTypes.string
53
+ };
17
54
 
18
55
  static defaultProps = {
19
56
  progress: 0,
@@ -1,4 +1,4 @@
1
- import React, { PropsWithChildren, type JSX } from 'react';
1
+ import React, { PropsWithChildren } from 'react';
2
2
  import { StyleProp, ViewStyle, ImagePropsBase, ImageStyle, TextStyle, TextProps, AccessibilityProps } from 'react-native';
3
3
  import { BadgeProps } from '../badge';
4
4
  import { ImageProps } from '../image';
@@ -1,4 +1,4 @@
1
- import React, { PureComponent, type JSX } from 'react';
1
+ import React, { PureComponent } from 'react';
2
2
  import { ImageSourcePropType, ImageStyle, StyleProp, TextStyle, TouchableOpacityProps, ViewStyle, ViewProps } from 'react-native';
3
3
  declare const LABEL_FORMATTER_VALUES: readonly [1, 2, 3, 4];
4
4
  type LabelFormatterValues = typeof LABEL_FORMATTER_VALUES[number];
@@ -89,10 +89,10 @@ declare class Badge extends PureComponent<BadgeProps> {
89
89
  getBadgeSizeStyle(): any;
90
90
  getFormattedLabel(): any;
91
91
  getBorderStyling(): ViewStyle;
92
- renderLabel(): JSX.Element | undefined;
92
+ renderLabel(): React.JSX.Element | undefined;
93
93
  renderCustomElement(): JSX.Element | undefined;
94
- renderIcon(): 0 | JSX.Element | undefined;
95
- render(): JSX.Element;
94
+ renderIcon(): 0 | React.JSX.Element | undefined;
95
+ render(): React.JSX.Element;
96
96
  }
97
97
  declare function createStyles(props: BadgeProps): {
98
98
  badge: {
@@ -2,6 +2,7 @@ import 'react';
2
2
  import { BaseComponent } from '../../commons';
3
3
  export default class BaseInput extends BaseComponent {
4
4
  static displayName: string;
5
+ static propTypes: any;
5
6
  static defaultProps: {
6
7
  validateOnBlur: boolean;
7
8
  };