react-native-ui-lib 7.46.3 → 8.0.0

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 (214) hide show
  1. package/babel.config.js +12 -0
  2. package/incubator.d.ts +2 -2
  3. package/incubator.js +0 -2
  4. package/index.js +1 -0
  5. package/lib/android/build.gradle +5 -5
  6. package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -2
  7. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +31 -23
  8. package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +1 -1
  9. package/lib/components/{HighlighterOverlayView.d.ts → HighlighterOverlayView/index.d.ts} +1 -1
  10. package/lib/components/HighlighterOverlayView/index.js +49 -0
  11. package/lib/components/{HighlighterOverlayView.web.d.ts → HighlighterOverlayView/index.web.d.ts} +1 -1
  12. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.android.d.ts +5 -2
  13. package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.js +51 -0
  14. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.d.ts +1 -1
  15. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/CustomKeyboardView.ios.js +3 -3
  16. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.d.ts +3 -0
  17. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/CustomKeyboardView}/CustomKeyboardViewBase.js +1 -1
  18. package/lib/components/Keyboard/{KeyboardInput/utils → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager}/__tests__/EventEmitterManager.spec.js +1 -1
  19. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/__tests__/KeyboardRegistry.spec.js +1 -1
  20. package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.d.ts → KeyboardAccessoryView/KeyboardRegistry/index.d.ts} +1 -1
  21. package/lib/components/Keyboard/{KeyboardInput/KeyboardRegistry.js → KeyboardAccessoryView/KeyboardRegistry/index.js} +1 -1
  22. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView/KeyboardRegistry}/keyboardRegistry.api.json +9 -9
  23. package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.ts +26 -0
  24. package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.js +91 -0
  25. package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.d.ts → KeyboardAccessoryView/index.d.ts} +11 -1
  26. package/lib/components/Keyboard/{KeyboardInput/KeyboardAccessoryView.js → KeyboardAccessoryView/index.js} +31 -5
  27. package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/keyboardAccessoryView.api.json +5 -5
  28. package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.d.ts → KeyboardAwareInsetsView/index.d.ts} +1 -1
  29. package/lib/components/Keyboard/{KeyboardTracking/KeyboardAwareInsetsView.js → KeyboardAwareInsetsView/index.js} +1 -1
  30. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.d.ts +1 -4
  31. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.ios.js +5 -8
  32. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.d.ts +2 -2
  33. package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/keyboardTrackingView.api.json +11 -20
  34. package/lib/components/Keyboard/index.d.ts +6 -6
  35. package/lib/components/Keyboard/index.js +6 -6
  36. package/lib/components/SafeArea/SafeAreaInsetsManager.d.ts +21 -7
  37. package/lib/components/SafeArea/SafeAreaInsetsManager.js +95 -31
  38. package/lib/components/SafeArea/SafeAreaSpacerView.d.ts +2 -2
  39. package/lib/components/SafeArea/SafeAreaSpacerView.js +63 -9
  40. package/lib/components/SafeArea/__tests__/SafeAreaInsetsManager.spec.js +274 -0
  41. package/lib/components/SafeArea/index.d.ts +10 -0
  42. package/lib/components/SafeArea/index.js +11 -0
  43. package/lib/components/index.d.ts +1 -1
  44. package/lib/components/index.js +1 -1
  45. package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +56 -8
  46. package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +1 -7
  47. package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +1 -1
  48. package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +134 -44
  49. package/lib/package.json +3 -3
  50. package/lib/react-native.config.js +1 -3
  51. package/metro.config.js +2 -2
  52. package/package.json +33 -32
  53. package/panView.d.ts +2 -0
  54. package/panView.js +1 -0
  55. package/scripts/release/prReleaseNotesCommon.js +15 -4
  56. package/src/commons/Constants.js +2 -5
  57. package/src/commons/modifiers.d.ts +1 -0
  58. package/src/commons/modifiers.js +5 -2
  59. package/src/components/KeyboardAwareScrollView/KeyboardAwareBase.js +5 -1
  60. package/src/components/actionSheet/index.d.ts +2 -12
  61. package/src/components/actionSheet/index.js +3 -42
  62. package/src/components/animatedImage/index.js +12 -2
  63. package/src/components/badge/index.d.ts +107 -47
  64. package/src/components/button/button.api.json +1 -1
  65. package/src/components/button/index.d.ts +53 -23
  66. package/src/components/button/types.d.ts +0 -1
  67. package/src/components/colorPicker/ColorPickerDialog.d.ts +1 -1
  68. package/src/components/colorPicker/ColorPickerDialog.js +1 -1
  69. package/src/components/dateTimePicker/index.d.ts +186 -5
  70. package/src/components/dateTimePicker/index.js +3 -4
  71. package/src/components/dialog/dialog.api.json +34 -35
  72. package/src/{incubator → components}/dialog/dialogHeader.api.json +2 -2
  73. package/src/components/dialog/index.d.ts +13 -105
  74. package/src/components/dialog/index.js +205 -212
  75. package/src/{incubator → components}/dialog/types.d.ts +7 -19
  76. package/src/{incubator → components}/dialog/types.js +1 -3
  77. package/src/{incubator → components}/dialog/useDialogContent.d.ts +1 -1
  78. package/src/components/drawer/Swipeable.js +1 -2
  79. package/src/components/drawer/index.js +31 -25
  80. package/src/components/fadedScrollView/index.js +7 -2
  81. package/src/components/featureHighlight/index.d.ts +1 -1
  82. package/src/components/hint/index.d.ts +0 -8
  83. package/src/components/hint/index.js +4 -6
  84. package/src/components/image/index.js +4 -0
  85. package/src/components/index.js +0 -19
  86. package/src/components/marquee/types.js +4 -1
  87. package/src/components/modal/index.d.ts +5 -0
  88. package/src/components/modal/index.js +14 -10
  89. package/src/components/modal/modal.api.json +5 -0
  90. package/src/{incubator → components}/panView/index.d.ts +3 -3
  91. package/src/{incubator → components}/panView/index.js +4 -4
  92. package/src/{incubator → components}/panView/usePanGesture.d.ts +1 -1
  93. package/src/components/picker/Picker.driver.new.d.ts +2 -2
  94. package/src/components/picker/Picker.driver.new.js +3 -3
  95. package/src/components/picker/PickerItem.js +6 -20
  96. package/src/components/picker/PickerPresenter.d.ts +0 -1
  97. package/src/components/picker/PickerPresenter.js +1 -23
  98. package/src/components/picker/api/picker.api.json +0 -1
  99. package/src/components/picker/api/pickerItem.api.json +0 -5
  100. package/src/components/picker/helpers/useFieldType.d.ts +53 -23
  101. package/src/components/picker/helpers/usePickerLabel.d.ts +1 -1
  102. package/src/components/picker/helpers/usePickerLabel.js +2 -3
  103. package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +1 -1
  104. package/src/components/picker/helpers/usePickerMigrationWarnings.js +0 -12
  105. package/src/components/picker/helpers/usePickerSearch.d.ts +1 -1
  106. package/src/components/picker/helpers/usePickerSearch.js +4 -8
  107. package/src/components/picker/helpers/usePickerSelection.d.ts +1 -1
  108. package/src/components/picker/helpers/usePickerSelection.js +2 -10
  109. package/src/components/picker/index.js +4 -22
  110. package/src/components/picker/types.d.ts +1 -24
  111. package/src/components/segmentedControl/index.js +3 -3
  112. package/src/components/slider/GradientSlider.d.ts +1 -1
  113. package/src/components/slider/index.js +1 -1
  114. package/src/components/sortableGridList/SortableItem.js +13 -4
  115. package/src/components/sortableList/SortableListItem.js +13 -4
  116. package/src/components/stackAggregator/index.js +16 -11
  117. package/src/components/tabController/TabPage.js +18 -14
  118. package/src/components/text/Text.driver.new.d.ts +2 -2
  119. package/src/components/text/Text.driver.new.js +2 -2
  120. package/src/components/text/index.js +2 -3
  121. package/src/components/textField/Input.js +0 -1
  122. package/src/components/textField/TextField.driver.new.d.ts +2 -2
  123. package/src/components/textField/TextField.driver.new.js +2 -2
  124. package/src/components/textField/presets/outline.d.ts +106 -46
  125. package/src/components/textField/presets/underline.d.ts +106 -46
  126. package/src/components/textField/types.js +1 -0
  127. package/src/components/textField/usePreset.d.ts +72 -44
  128. package/src/components/timeline/types.js +3 -0
  129. package/src/{incubator/hooks/useHiddenLocation.web.d.ts → hooks/useHiddenLocation/index.d.ts} +1 -1
  130. package/src/{incubator/hooks/useHiddenLocation.d.ts → hooks/useHiddenLocation/index.web.d.ts} +1 -1
  131. package/src/incubator/expandableOverlay/ExpandableOverlay.driver.js +1 -1
  132. package/src/incubator/expandableOverlay/index.d.ts +42 -3
  133. package/src/incubator/expandableOverlay/index.js +1 -4
  134. package/src/incubator/index.d.ts +0 -2
  135. package/src/incubator/index.js +0 -2
  136. package/src/incubator/slider/SliderPresenter.js +2 -1
  137. package/src/incubator/toast/index.js +1 -1
  138. package/src/index.d.ts +3 -10
  139. package/src/index.js +42 -162
  140. package/src/testkit/index.d.ts +1 -1
  141. package/src/testkit/index.js +1 -1
  142. package/src/testkit/new/Component.driver.d.ts +4 -1
  143. package/src/testkit/new/Component.driver.js +3 -3
  144. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReactHacks.java +0 -30
  145. package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/ReflectionUtils.java +0 -34
  146. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/DefaultKeyListener.java +0 -33
  147. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/KeyListenerProxy.java +0 -53
  148. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerModule.java +0 -54
  149. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/TextInputDelKeyHandlerPackage.java +0 -28
  150. package/lib/android/src/main/java/com/wix/reactnativeuilib/textinput/ViewUtils.java +0 -36
  151. package/lib/components/HighlighterOverlayView.js +0 -40
  152. package/lib/components/Keyboard/KeyboardInput/CustomKeyboardView/CustomKeyboardView.android.js +0 -28
  153. package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.d.ts +0 -11
  154. package/lib/components/Keyboard/KeyboardInput/utils/KeyboardUtils.js +0 -17
  155. package/panningViews.d.ts +0 -2
  156. package/panningViews.js +0 -1
  157. package/react-native.config.js +0 -22
  158. package/sharedTransition.d.ts +0 -2
  159. package/sharedTransition.js +0 -1
  160. package/src/components/dialog/DialogDismissibleView.d.ts +0 -34
  161. package/src/components/dialog/DialogDismissibleView.js +0 -184
  162. package/src/components/dialog/OverlayFadingBackground.d.ts +0 -14
  163. package/src/components/dialog/OverlayFadingBackground.js +0 -45
  164. package/src/components/panningViews/asPanViewConsumer.d.ts +0 -3
  165. package/src/components/panningViews/asPanViewConsumer.js +0 -16
  166. package/src/components/panningViews/panDismissibleView.d.ts +0 -51
  167. package/src/components/panningViews/panDismissibleView.js +0 -350
  168. package/src/components/panningViews/panGestureView.d.ts +0 -23
  169. package/src/components/panningViews/panGestureView.js +0 -156
  170. package/src/components/panningViews/panListenerView.d.ts +0 -66
  171. package/src/components/panningViews/panListenerView.js +0 -155
  172. package/src/components/panningViews/panResponderView.d.ts +0 -19
  173. package/src/components/panningViews/panResponderView.js +0 -79
  174. package/src/components/panningViews/panningContext.d.ts +0 -3
  175. package/src/components/panningViews/panningContext.js +0 -4
  176. package/src/components/panningViews/panningProvider.d.ts +0 -73
  177. package/src/components/panningViews/panningProvider.js +0 -101
  178. package/src/components/sharedTransition/ShareTransitionContext.js +0 -3
  179. package/src/components/sharedTransition/SharedArea.js +0 -153
  180. package/src/components/sharedTransition/SourceElement.js +0 -44
  181. package/src/components/sharedTransition/TargetElement.js +0 -38
  182. package/src/components/sharedTransition/index.js +0 -9
  183. package/src/incubator/dialog/dialog.api.json +0 -54
  184. package/src/incubator/dialog/index.d.ts +0 -15
  185. package/src/incubator/dialog/index.js +0 -218
  186. /package/lib/components/{HighlighterOverlayView.web.js → HighlighterOverlayView/index.web.js} +0 -0
  187. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.d.ts +0 -0
  188. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.js +0 -0
  189. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.d.ts +0 -0
  190. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/CustomKeyboardView/index.web.js +0 -0
  191. /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.d.ts → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.ts} +0 -0
  192. /package/lib/components/Keyboard/{KeyboardInput/utils/EventEmitterManager.js → KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.js} +0 -0
  193. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.d.ts +0 -0
  194. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.android.js +0 -0
  195. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.ts +0 -0
  196. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/TextInputKeyboardManager.ios.js +0 -0
  197. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.d.ts +0 -0
  198. /package/lib/components/Keyboard/{KeyboardInput → KeyboardAccessoryView}/TextInputKeyboardManager/index.js +0 -0
  199. /package/lib/components/Keyboard/{KeyboardTracking → KeyboardAwareInsetsView}/keyboardAwareInsetsView.api.json +0 -0
  200. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.d.ts +0 -0
  201. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/KeyboardTrackingView.android.js +0 -0
  202. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.js +0 -0
  203. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.d.ts +0 -0
  204. /package/lib/components/Keyboard/{KeyboardTracking/KeyboardTrackingView → KeyboardTrackingView}/index.web.js +0 -0
  205. /package/src/{incubator → components}/dialog/Dialog.driver.new.d.ts +0 -0
  206. /package/src/{incubator → components}/dialog/Dialog.driver.new.js +0 -0
  207. /package/src/{incubator → components}/dialog/DialogHeader.d.ts +0 -0
  208. /package/src/{incubator → components}/dialog/DialogHeader.js +0 -0
  209. /package/src/{incubator → components}/dialog/useDialogContent.js +0 -0
  210. /package/src/{incubator → components}/panView/panningUtil.d.ts +0 -0
  211. /package/src/{incubator → components}/panView/panningUtil.js +0 -0
  212. /package/src/{incubator → components}/panView/usePanGesture.js +0 -0
  213. /package/src/{incubator/hooks/useHiddenLocation.js → hooks/useHiddenLocation/index.js} +0 -0
  214. /package/src/{incubator/hooks/useHiddenLocation.web.js → hooks/useHiddenLocation/index.web.js} +0 -0
@@ -2,11 +2,11 @@ import React from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
3
  import { BaseComponentInjectedProps } from '../../commons/new';
4
4
  import { TextFieldProps } from '../textField';
5
- import type { DialogMigrationProps } from '../../incubator/dialog';
5
+ import type { DialogProps } from '../dialog';
6
6
  import { ButtonProps } from '../button';
7
7
  import { OldApiProps } from './useOldApi';
8
8
  export type DateTimePickerMode = 'date' | 'time';
9
- export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | 'onChange'> & DialogMigrationProps & {
9
+ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | 'onChange'> & {
10
10
  /**
11
11
  * The type of picker to display ('date' or 'time')
12
12
  */
@@ -15,6 +15,10 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
15
15
  * The initial value to set the picker to. Defaults to device's date / time
16
16
  */
17
17
  value?: Date;
18
+ /**
19
+ * The props to pass to the dialog expandable container
20
+ */
21
+ dialogProps?: DialogProps;
18
22
  /**
19
23
  * The onChange callback
20
24
  */
@@ -92,7 +96,6 @@ export type DateTimePickerProps = OldApiProps & Omit<TextFieldProps, 'value' | '
92
96
  */
93
97
  cancelButtonProps?: ButtonProps;
94
98
  };
95
- type DateTimePickerPropsInternal = DateTimePickerProps & BaseComponentInjectedProps;
96
99
  /**
97
100
  * @description: Date and Time Picker Component that wraps RNDateTimePicker for date and time modes.
98
101
  * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DateTimePickerScreen.tsx
@@ -101,7 +104,185 @@ type DateTimePickerPropsInternal = DateTimePickerProps & BaseComponentInjectedPr
101
104
  * @extendsLink: https://github.com/react-native-community/react-native-datetimepicker#react-native-datetimepicker
102
105
  * @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/DateTimePicker/DateTimePicker_iOS.gif?raw=true, https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/DateTimePicker/DateTimePicker_Android.gif?raw=true
103
106
  */
104
- declare const DateTimePicker: React.ForwardRefExoticComponent<DateTimePickerPropsInternal & React.RefAttributes<any>>;
107
+ declare const DateTimePicker: React.ForwardRefExoticComponent<OldApiProps & Omit<TextFieldProps, "value" | "onChange"> & {
108
+ /**
109
+ * The type of picker to display ('date' or 'time')
110
+ */
111
+ mode?: DateTimePickerMode | undefined;
112
+ /**
113
+ * The initial value to set the picker to. Defaults to device's date / time
114
+ */
115
+ value?: Date | undefined;
116
+ /**
117
+ * The props to pass to the dialog expandable container
118
+ */
119
+ dialogProps?: DialogProps | undefined;
120
+ /**
121
+ * The onChange callback
122
+ */
123
+ onChange?: ((date: Date) => void) | undefined;
124
+ /**
125
+ * Should this input be editable or disabled
126
+ */
127
+ editable?: boolean | undefined;
128
+ /**
129
+ * The minimum date or time value to use
130
+ */
131
+ minimumDate?: Date | undefined;
132
+ /**
133
+ * The maximum date or time value to use
134
+ */
135
+ maximumDate?: Date | undefined;
136
+ /**
137
+ * A callback function to format the time or date
138
+ * @param mode the type of the picker ('date' or 'time')
139
+ * @returns the formatted string to display
140
+ */
141
+ dateTimeFormatter?: ((value: Date, mode: DateTimePickerMode) => string) | undefined;
142
+ /**
143
+ * Allows changing of the locale of the component (iOS only)
144
+ */
145
+ locale?: string | undefined;
146
+ /**
147
+ * Allows changing of the time picker to a 24 hour format (Android only)
148
+ */
149
+ is24Hour?: boolean | undefined;
150
+ /**
151
+ * The interval at which minutes can be selected. Possible values are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 (iOS only)
152
+ */
153
+ minuteInterval?: number | undefined;
154
+ /**
155
+ * Allows changing of the timeZone of the date picker. By default it uses the device's time zone (iOS only)
156
+ */
157
+ timeZoneOffsetInMinutes?: number | undefined;
158
+ /**
159
+ * style to apply to the iOS dialog header
160
+ */
161
+ headerStyle?: StyleProp<ViewStyle>;
162
+ /**
163
+ * Render custom input
164
+ */
165
+ renderInput?: ((props: Omit<DateTimePickerProps, 'value'> & {
166
+ value?: string;
167
+ }) => React.ReactElement) | undefined;
168
+ /**
169
+ * Override system theme variant (dark or light mode) used by the date picker.
170
+ */
171
+ themeVariant?: "light" | "dark" | undefined;
172
+ /**
173
+ * The component testID
174
+ */
175
+ testID?: string | undefined;
176
+ /**
177
+ * Allows changing the visual display of the picker
178
+ */
179
+ display?: string | undefined;
180
+ /**
181
+ * Text color of the wheel picker items
182
+ */
183
+ textColor?: string | undefined;
184
+ /**
185
+ * Background color of the wheel picker
186
+ */
187
+ backgroundColor?: string | undefined;
188
+ /**
189
+ * Confirm button props
190
+ */
191
+ confirmButtonProps?: ButtonProps | undefined;
192
+ /**
193
+ * Cancel button props
194
+ */
195
+ cancelButtonProps?: ButtonProps | undefined;
196
+ } & BaseComponentInjectedProps & React.RefAttributes<any>>;
105
197
  export { DateTimePicker };
106
- declare const _default: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<any>>;
198
+ declare const _default: React.ForwardRefExoticComponent<OldApiProps & Omit<TextFieldProps, "value" | "onChange"> & {
199
+ /**
200
+ * The type of picker to display ('date' or 'time')
201
+ */
202
+ mode?: DateTimePickerMode | undefined;
203
+ /**
204
+ * The initial value to set the picker to. Defaults to device's date / time
205
+ */
206
+ value?: Date | undefined;
207
+ /**
208
+ * The props to pass to the dialog expandable container
209
+ */
210
+ dialogProps?: DialogProps | undefined;
211
+ /**
212
+ * The onChange callback
213
+ */
214
+ onChange?: ((date: Date) => void) | undefined;
215
+ /**
216
+ * Should this input be editable or disabled
217
+ */
218
+ editable?: boolean | undefined;
219
+ /**
220
+ * The minimum date or time value to use
221
+ */
222
+ minimumDate?: Date | undefined;
223
+ /**
224
+ * The maximum date or time value to use
225
+ */
226
+ maximumDate?: Date | undefined;
227
+ /**
228
+ * A callback function to format the time or date
229
+ * @param mode the type of the picker ('date' or 'time')
230
+ * @returns the formatted string to display
231
+ */
232
+ dateTimeFormatter?: ((value: Date, mode: DateTimePickerMode) => string) | undefined;
233
+ /**
234
+ * Allows changing of the locale of the component (iOS only)
235
+ */
236
+ locale?: string | undefined;
237
+ /**
238
+ * Allows changing of the time picker to a 24 hour format (Android only)
239
+ */
240
+ is24Hour?: boolean | undefined;
241
+ /**
242
+ * The interval at which minutes can be selected. Possible values are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 (iOS only)
243
+ */
244
+ minuteInterval?: number | undefined;
245
+ /**
246
+ * Allows changing of the timeZone of the date picker. By default it uses the device's time zone (iOS only)
247
+ */
248
+ timeZoneOffsetInMinutes?: number | undefined;
249
+ /**
250
+ * style to apply to the iOS dialog header
251
+ */
252
+ headerStyle?: StyleProp<ViewStyle>;
253
+ /**
254
+ * Render custom input
255
+ */
256
+ renderInput?: ((props: Omit<DateTimePickerProps, "value"> & {
257
+ value?: string | undefined;
258
+ }) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | undefined;
259
+ /**
260
+ * Override system theme variant (dark or light mode) used by the date picker.
261
+ */
262
+ themeVariant?: "light" | "dark" | undefined;
263
+ /**
264
+ * The component testID
265
+ */
266
+ testID?: string | undefined;
267
+ /**
268
+ * Allows changing the visual display of the picker
269
+ */
270
+ display?: string | undefined;
271
+ /**
272
+ * Text color of the wheel picker items
273
+ */
274
+ textColor?: string | undefined;
275
+ /**
276
+ * Background color of the wheel picker
277
+ */
278
+ backgroundColor?: string | undefined;
279
+ /**
280
+ * Confirm button props
281
+ */
282
+ confirmButtonProps?: ButtonProps | undefined;
283
+ /**
284
+ * Cancel button props
285
+ */
286
+ cancelButtonProps?: ButtonProps | undefined;
287
+ } & React.RefAttributes<any>>;
107
288
  export default _default;
@@ -42,7 +42,6 @@ const DateTimePicker = forwardRef((props, ref) => {
42
42
  themeVariant = Colors.getScheme(),
43
43
  onChange,
44
44
  dialogProps,
45
- migrateDialog,
46
45
  textColor = Colors.$textDefault,
47
46
  backgroundColor = Colors.$backgroundDefault,
48
47
  headerStyle,
@@ -150,10 +149,10 @@ const DateTimePicker = forwardRef((props, ref) => {
150
149
  return <RNDateTimePicker mode={mode} value={value || new Date()} onChange={handleChange} minimumDate={minimumDate} maximumDate={maximumDate} locale={locale} is24Hour={is24Hour} minuteInterval={minuteInterval} timeZoneOffsetInMinutes={timeZoneOffsetInMinutes} display={display} textColor={textColor} style={dateTimePickerStyle} themeVariant={themeVariant} testID={`${testID}.picker`} />;
151
150
  }, [mode, value, handleChange, minimumDate, maximumDate, locale, is24Hour, minuteInterval, timeZoneOffsetInMinutes, themeVariant]);
152
151
  const renderIOSExpandableOverlay = () => {
153
- return <>
152
+ return <View>
154
153
  {renderHeader()}
155
154
  {renderDateTimePicker()}
156
- </>;
155
+ </View>;
157
156
  };
158
157
  const renderAndroidDateTimePicker = useCallback(({
159
158
  visible
@@ -165,7 +164,7 @@ const DateTimePicker = forwardRef((props, ref) => {
165
164
  return <>
166
165
  <ExpandableOverlay
167
166
  // @ts-expect-error
168
- ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps} migrateDialog={migrateDialog} disabled={editable === false}
167
+ ref={expandable} expandableContent={Constants.isIOS ? renderIOSExpandableOverlay() : undefined} useDialog dialogProps={_dialogProps} disabled={editable === false}
169
168
  // NOTE: Android picker comes with its own overlay built-in therefor we're not using ExpandableOverlay for it
170
169
  renderCustomOverlay={Constants.isAndroid ? renderAndroidDateTimePicker : undefined} testID={`${testID}.overlay`}>
171
170
  {renderInput ? renderInput({
@@ -2,59 +2,58 @@
2
2
  "name": "Dialog",
3
3
  "category": "overlays",
4
4
  "description": "Component for displaying custom content inside a popup dialog",
5
- "note": "Use alignment modifiers to control the dialog position (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center)",
5
+ "note": "Use alignment modifiers to control the dialog position (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center). \nWhen adding a `FlatList` \\ `ScrollView` to the content be sure to use one from `react-native-gesture-handler` (see [this link](https://github.com/software-mansion/react-native-gesture-handler/issues/1380) for `SectionList`).",
6
6
  "modifiers": ["alignment"],
7
- "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.js",
8
- "images": ["https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Dialog/Dialog.gif?raw=true"],
7
+ "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.tsx",
9
8
  "props": [
10
- {"name": "visible", "type": "boolean", "description": "Control visibility of the component"},
11
- {"name": "ignoreBackgroundPress", "type": "boolean", "description": "Whether or not to ignore background press"},
9
+ {"name": "visible", "type": "boolean", "description": "The visibility of the dialog"},
10
+ {"name": "headerProps", "type": "DialogHeaderProps", "description": "The Dialog's header (title, subtitle etc)"},
12
11
  {
13
- "name": "overlayBackgroundColor",
14
- "type": "string",
15
- "description": "The color of the overlay background",
16
- "default": "Colors.rgba(Colors.grey10, 0.6)"
12
+ "name": "containerStyle",
13
+ "type": "ViewStyle",
14
+ "description": "The Dialog`s container style (it is set to {position: 'absolute'})"
17
15
  },
18
- {"name": "width", "type": "string | number", "description": "Width", "default": "90%"},
19
- {"name": "height", "type": "string | number", "description": "Height", "default": "undefined"},
20
16
  {
21
- "name": "panDirection",
22
- "type": "UP | DOWN | LEFT | RIGHT",
23
- "description": "The direction of the allowed pan",
24
- "default": "PanningProvider.Directions.DOWN"
17
+ "name": "containerProps",
18
+ "type": "ViewProps",
19
+ "description": "Extra props for the container"
25
20
  },
26
- {"name": "onDismiss", "type": "(props?: any) => void", "description": "Called when clicking on the background"},
27
21
  {
28
- "name": "onDialogDismissed",
29
- "type": "(props: any) => void",
30
- "description": "Called once the dialog has been dismissed completely"
22
+ "name": "onDismiss",
23
+ "type": "(props?: DialogProps) => void",
24
+ "description": "Callback that is called after the dialog's dismiss (after the animation has ended)."
31
25
  },
32
26
  {
33
- "name": "renderPannableHeader",
34
- "type": "(props: any) => JSX.Element",
35
- "description": "For scrollable content (the children of the dialog)",
36
- "note": "If this is added only the header will be pannable. Props are transferred to the 'renderPannableHeader'"
27
+ "name": "direction",
28
+ "type": "up | down | left | right",
29
+ "description": "The direction from which and to which the dialog is animating \\ panning (default down).",
30
+ "default": "down"
37
31
  },
38
32
  {
39
- "name": "pannableHeaderProps",
40
- "type": "any",
41
- "description": "The props that will be passed to the pannable header"
33
+ "name": "showClose",
34
+ "type": "boolean",
35
+ "description": "Show the close button"
42
36
  },
37
+ {"name": "ignoreBackgroundPress", "type": "boolean", "description": "Whether or not to ignore background press."},
38
+ {"name": "modalProps", "type": "ModalProps", "description": "Pass props to the dialog modal"},
43
39
  {
44
- "name": "useSafeArea",
40
+ "name": "disableAnimation",
45
41
  "type": "boolean",
46
- "description": "In iOS, use safe area, in case component attached to the bottom"
42
+ "description": "Disable animation (default is false) \nIn some cases you might want to disable the animation (probably for Android only), this is when the dialog is scrollable and has touchable items in the scrollable area. \nThis is a temporary solution for a reanimated + RN77\\8 bug. \nSee https://github.com/software-mansion/react-native-reanimated/issues/6659 and https://github.com/facebook/react-native/issues/49694"
47
43
  },
48
- {"name": "containerStyle", "type": "ViewStyle", "description": "Component's container style"},
49
- {"name": "testID", "type": "string", "description": "The test id for e2e tests"}
44
+ {
45
+ "name": "testID",
46
+ "type": "string",
47
+ "description": "Used to locate this view in end-to-end tests. \nThe container has the original id. \nSupported inner elements IDs: \n`${TestID}.modal` - the Modal's id. \n`${TestID}.overlayFadingBackground` - the fading background id."
48
+ }
50
49
  ],
51
50
  "snippet": [
52
- "<Dialog",
53
- " visible={isVisible$1}",
54
- " onDismiss={() => console.log('dismissed')$2}",
55
- " panDirection={PanningProvider.Directions.DOWN$3}",
51
+ "<Dialog",
52
+ " visible={isVisible$1}",
53
+ " onDismiss={() => console.log('dismissed')$2}",
54
+ " direction={Dialog.directions.DOWN$3}",
56
55
  ">",
57
- " <Text text60>Content</Text>$4",
56
+ " <Text text60>Content</Text>$4",
58
57
  "</Dialog>"
59
58
  ]
60
59
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "Dialog.Header",
3
- "category": "incubator",
3
+ "category": "overlays",
4
4
  "description": "Component for displaying the header of a popup dialog",
5
- "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/incubatorScreens/IncubatorDialogScreen.tsx",
5
+ "example": "https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.tsx",
6
6
  "props": [
7
7
  {"name": "title", "type": "string", "description": "Title"},
8
8
  {"name": "titleStyle", "type": "StyleProp<TextStyle>", "description": "Title text style"},
@@ -1,107 +1,15 @@
1
- import React, { Component } from 'react';
2
- import { StyleProp, ViewStyle, ModalPropsIOS, AccessibilityProps, type DimensionValue } from 'react-native';
3
- import { AlignmentModifiers } from '../../commons/modifiers';
4
- import { ModalProps } from '../modal';
5
- import { PanningDirections, PanningDirectionsEnum } from '../panningViews/panningProvider';
6
- export { PanningDirections as DialogDirections, PanningDirectionsEnum as DialogDirectionsEnum };
7
- interface RNPartialProps extends Pick<ModalPropsIOS, 'supportedOrientations'>, Pick<AccessibilityProps, 'accessibilityLabel'> {
8
- }
9
- export interface DialogProps extends AlignmentModifiers, RNPartialProps {
10
- /**
11
- * Control visibility of the dialog
12
- */
13
- visible?: boolean;
14
- /**
15
- * Dismiss callback for when clicking on the background
16
- */
17
- onDismiss?: (props?: any) => void;
18
- /**
19
- * Whether or not to ignore background press
20
- */
21
- ignoreBackgroundPress?: boolean;
22
- /**
23
- * The color of the overlay background
24
- */
25
- overlayBackgroundColor?: string;
26
- /**
27
- * The dialog width (default: 90%)
28
- */
29
- width?: DimensionValue;
30
- /**
31
- * The dialog height (default: undefined)
32
- */
33
- height?: DimensionValue;
34
- /**
35
- * The direction of the allowed pan (default is DOWN).
36
- * Types: UP, DOWN, LEFT and RIGHT (using PanningProvider.Directions.###).
37
- * Pass null to remove pan.
38
- */
39
- panDirection?: PanningDirections;
40
- /**
41
- * Whether or not to handle SafeArea
42
- */
43
- useSafeArea?: boolean;
44
- /**
45
- * Called once the dialog has been dismissed completely
46
- */
47
- onDialogDismissed?: (props: any) => void;
48
- /**
49
- * If this is added only the header will be pannable;
50
- * this allows for scrollable content (the children of the dialog)
51
- * props are transferred to the renderPannableHeader
52
- */
53
- renderPannableHeader?: (props: any) => JSX.Element;
54
- /**
55
- * The props that will be passed to the pannable header
56
- */
57
- pannableHeaderProps?: any;
58
- /**
59
- * Additional props for the modal.
60
- */
61
- modalProps?: ModalProps;
62
- /**
63
- * The Dialog`s container style
64
- */
65
- containerStyle?: StyleProp<ViewStyle>;
66
- /**
67
- * Used as a testing identifier
68
- */
69
- testID?: string;
1
+ import React from 'react';
2
+ import DialogHeader from './DialogHeader';
3
+ import { DialogProps, DialogDirections, DialogDirectionsEnum, DialogHeaderProps } from './types';
4
+ export { DialogProps, DialogDirections, DialogDirectionsEnum, DialogHeaderProps };
5
+ export interface DialogStatics {
6
+ directions: typeof DialogDirectionsEnum;
7
+ Header: typeof DialogHeader;
8
+ }
9
+ export interface DialogImperativeMethods {
10
+ dismiss: () => void;
11
+ }
12
+ declare const _default: React.ForwardRefExoticComponent<import("./types")._DialogProps & {
70
13
  children?: React.ReactNode;
71
- }
72
- interface DialogState {
73
- alignments: AlignmentModifiers;
74
- modalVisibility?: boolean;
75
- dialogVisibility?: boolean;
76
- fadeOut?: boolean;
77
- }
78
- /**
79
- * @description: Dialog component for displaying custom content inside a popup dialog
80
- * @notes: Use alignment modifiers to control the dialog position
81
- * (top, bottom, centerV, centerH, etc... by default the dialog is aligned to center)
82
- * @modifiers: alignment
83
- * @example: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/DialogScreen.js
84
- * @gif: https://github.com/wix/react-native-ui-lib/blob/master/demo/showcase/Dialog/Dialog.gif?raw=true
85
- */
86
- declare class Dialog extends Component<DialogProps, DialogState> {
87
- static displayName: string;
88
- static directions: typeof PanningDirectionsEnum;
89
- static defaultProps: {
90
- overlayBackgroundColor: string | undefined;
91
- };
92
- private styles;
93
- constructor(props: DialogProps);
94
- UNSAFE_componentWillReceiveProps(nextProps: DialogProps): void;
95
- setAlignment(): void;
96
- onFadeDone: () => void;
97
- _onDismiss: () => void;
98
- onDismiss: () => void;
99
- hideDialogView: () => void;
100
- renderPannableHeader: (directions: PanningDirections[]) => React.JSX.Element | undefined;
101
- getContainerType: () => React.ForwardRefExoticComponent<import("../view").ViewProps & React.RefAttributes<import("react-native").View>> | React.ComponentClass<import("../panningViews/panListenerView").PanListenerViewProps, any>;
102
- renderDialogView: () => React.JSX.Element;
103
- renderDialogContainer: () => React.JSX.Element;
104
- render: () => React.JSX.Element;
105
- }
106
- declare const _default: React.ForwardRefExoticComponent<DialogProps & React.RefAttributes<any>> & typeof Dialog;
14
+ } & React.RefAttributes<any>> & DialogStatics;
107
15
  export default _default;