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
@@ -1,15 +1,12 @@
1
1
  import _xor from "lodash/xor";
2
- import _xorBy from "lodash/xorBy";
3
2
  import { useCallback, useState, useEffect, useMemo } from 'react';
4
3
  import { PickerModes } from "../types";
5
4
  const usePickerSelection = props => {
6
5
  const {
7
- migrate,
8
6
  value,
9
7
  onChange,
10
8
  topBarProps,
11
9
  pickerExpandableRef,
12
- getItemValue,
13
10
  setSearchValue,
14
11
  mode,
15
12
  items
@@ -29,15 +26,10 @@ const usePickerSelection = props => {
29
26
  onChange?.(item);
30
27
  }, [onChange]);
31
28
  const toggleItemSelection = useCallback(item => {
32
- let newValue;
33
29
  const itemAsArray = [item];
34
- if (!migrate) {
35
- newValue = _xorBy(multiDraftValue, itemAsArray, getItemValue || 'value');
36
- } else {
37
- newValue = _xor(multiDraftValue, itemAsArray);
38
- }
30
+ const newValue = _xor(multiDraftValue, itemAsArray);
39
31
  setMultiDraftValue(newValue);
40
- }, [multiDraftValue, getItemValue]);
32
+ }, [multiDraftValue]);
41
33
  const cancelSelect = useCallback(() => {
42
34
  setSearchValue('');
43
35
  setMultiDraftValue(multiFinalValue);
@@ -1,5 +1,4 @@
1
- import _map from "lodash/map";
2
- import _isArray from "lodash/isArray"; // TODO: deprecate all places where we check if _.isPlainObject
1
+ import _map from "lodash/map"; // TODO: deprecate all places where we check if _.isPlainObject
3
2
  // TODO: Add initialValue prop
4
3
  // TODO: consider deprecating renderCustomModal prop
5
4
  import React, { useMemo, useState, useRef, useCallback, useEffect } from 'react';
@@ -45,13 +44,9 @@ const Picker = React.forwardRef((props, ref) => {
45
44
  listProps,
46
45
  value,
47
46
  getLabel,
48
- getItemLabel,
49
- getItemValue,
50
47
  renderItem,
51
48
  children,
52
49
  useSafeArea,
53
- // TODO: Remove migrate props and migrate code
54
- migrate = true,
55
50
  accessibilityLabel,
56
51
  accessibilityHint,
57
52
  items: propItems,
@@ -78,10 +73,6 @@ const Picker = React.forwardRef((props, ref) => {
78
73
  const [items, setItems] = useState(propItems || extractPickerItems(themeProps));
79
74
  const pickerExpandable = useRef(null);
80
75
  const pickerRef = useImperativePickerHandle(ref, pickerExpandable);
81
-
82
- // TODO: Remove this when migration is completed, starting of v8
83
- // usePickerMigrationWarnings({children, migrate, getItemLabel, getItemValue});
84
-
85
76
  useEffect(() => {
86
77
  if (propItems) {
87
78
  setItems(propItems);
@@ -94,7 +85,6 @@ const Picker = React.forwardRef((props, ref) => {
94
85
  } = usePickerSearch({
95
86
  showSearch,
96
87
  onSearchChange,
97
- getItemLabel,
98
88
  children,
99
89
  items
100
90
  });
@@ -107,11 +97,9 @@ const Picker = React.forwardRef((props, ref) => {
107
97
  selectedCount,
108
98
  toggleAllItemsSelection
109
99
  } = usePickerSelection({
110
- migrate,
111
100
  value,
112
101
  onChange,
113
102
  pickerExpandableRef: pickerExpandable,
114
- getItemValue,
115
103
  topBarProps,
116
104
  setSearchValue,
117
105
  mode,
@@ -132,7 +120,6 @@ const Picker = React.forwardRef((props, ref) => {
132
120
  } = usePickerLabel({
133
121
  value,
134
122
  items,
135
- getItemLabel,
136
123
  getLabel,
137
124
  accessibilityLabel,
138
125
  accessibilityHint,
@@ -157,15 +144,10 @@ const Picker = React.forwardRef((props, ref) => {
157
144
  setSelectedItemPosition(y);
158
145
  }, []);
159
146
  const contextValue = useMemo(() => {
160
- // @ts-expect-error cleanup after removing migrate prop
161
- const pickerValue = !migrate && typeof value === 'object' && !_isArray(value) ? value?.value : value;
162
147
  return {
163
- migrate,
164
- value: mode === PickerModes.MULTI ? multiDraftValue : pickerValue,
148
+ value: mode === PickerModes.MULTI ? multiDraftValue : value,
165
149
  onPress: mode === PickerModes.MULTI ? toggleItemSelection : onDoneSelecting,
166
150
  isMultiMode: mode === PickerModes.MULTI,
167
- getItemValue,
168
- getItemLabel,
169
151
  onSelectedLayout: onSelectedItemLayout,
170
152
  renderItem,
171
153
  selectionLimit,
@@ -173,7 +155,7 @@ const Picker = React.forwardRef((props, ref) => {
173
155
  selectedCount,
174
156
  toggleAllItemsSelection
175
157
  };
176
- }, [migrate, mode, value, multiDraftValue, renderItem, getItemValue, getItemLabel, selectionLimit, onSelectedItemLayout, toggleItemSelection, onDoneSelecting, areAllItemsSelected, selectedCount, toggleAllItemsSelection]);
158
+ }, [mode, value, multiDraftValue, renderItem, selectionLimit, onSelectedItemLayout, toggleItemSelection, onDoneSelecting, areAllItemsSelected, selectedCount, toggleAllItemsSelection]);
177
159
  const renderPickerItem = useCallback((item, index) => {
178
160
  return <PickerItem key={`${index}-${item.value}`} {...item} />;
179
161
  }, []);
@@ -223,7 +205,7 @@ const Picker = React.forwardRef((props, ref) => {
223
205
  </PickerItemsList>;
224
206
  }, [testID, mode, useDialog, selectedItemPosition, topBarProps, cancelSelect, onDoneSelecting, multiDraftValue, showSearch, searchStyle, searchPlaceholder, _onSearchChange, renderCustomSearch, renderHeader, listProps, accessibleFilteredItems, useSafeArea, useWheelPicker, items, showLoader]);
225
207
  return <PickerContext.Provider value={contextValue}>
226
- {<ExpandableOverlay ref={pickerExpandable} useDialog={useDialog || useWheelPicker} dialogProps={DEFAULT_DIALOG_PROPS} migrateDialog expandableContent={expandableModalContent} renderCustomOverlay={renderOverlay ? _renderOverlay : undefined} onPress={onPress} testID={testID} {...customPickerProps} disabled={themeProps.editable === false}>
208
+ {<ExpandableOverlay ref={pickerExpandable} useDialog={useDialog || useWheelPicker} dialogProps={DEFAULT_DIALOG_PROPS} expandableContent={expandableModalContent} renderCustomOverlay={renderOverlay ? _renderOverlay : undefined} onPress={onPress} testID={testID} {...customPickerProps} disabled={themeProps.editable === false}>
227
209
  {renderTextField()}
228
210
  </ExpandableOverlay>}
229
211
  </PickerContext.Provider>;
@@ -36,21 +36,6 @@ export interface PickerSearchStyle {
36
36
  selectionColor?: string;
37
37
  }
38
38
  type PickerPropsDeprecation = {
39
- /**
40
- * @deprecated
41
- * Temporary prop required for migration to Picker's new API
42
- */
43
- migrate?: boolean;
44
- /**
45
- * @deprecated
46
- * A function that extract the unique value out of the value prop in case value has a custom structure (e.g. {myValue, myLabel})
47
- */
48
- getItemValue?: (value: PickerValue) => any;
49
- /**
50
- * @deprecated
51
- * A function that extract the label out of the value prop in case value has a custom structure (e.g. {myValue, myLabel})
52
- */
53
- getItemLabel?: (value: PickerValue) => string;
54
39
  /**
55
40
  * @deprecated
56
41
  * Callback for modal onShow event
@@ -290,14 +275,6 @@ export interface PickerItemProps extends Pick<TouchableOpacityProps, 'customValu
290
275
  * Item's label style
291
276
  */
292
277
  labelStyle?: StyleProp<TextStyle>;
293
- /**
294
- * Custom function for the item label (e.g (value) => customLabel)
295
- */
296
- getItemLabel?: (value: PickerValue) => string;
297
- /**
298
- * @deprecated Function to return the value out of the item value prop when value is custom shaped.
299
- */
300
- getItemValue?: PickerProps['getItemValue'];
301
278
  /**
302
279
  * Render custom item
303
280
  */
@@ -325,7 +302,7 @@ export interface PickerItemProps extends Pick<TouchableOpacityProps, 'customValu
325
302
  */
326
303
  testID?: string;
327
304
  }
328
- export interface PickerContextProps extends Pick<PickerProps, 'migrate' | 'value' | 'getItemValue' | 'getItemLabel' | 'renderItem' | 'selectionLimit'> {
305
+ export interface PickerContextProps extends Pick<PickerProps, 'value' | 'renderItem' | 'selectionLimit'> {
329
306
  onPress: (value: PickerSingleValue) => void;
330
307
  isMultiMode: boolean;
331
308
  onSelectedLayout: (event: any) => any;
@@ -20,7 +20,7 @@ export let SegmentedControlPreset = /*#__PURE__*/function (SegmentedControlPrese
20
20
  return SegmentedControlPreset;
21
21
  }({});
22
22
  export { SegmentedControlItemProps };
23
- const nonAreUndefined = array => {
23
+ const noneAreUndefined = array => {
24
24
  'worklet';
25
25
 
26
26
  for (const item of array) {
@@ -99,7 +99,7 @@ const SegmentedControl = props => {
99
99
  x,
100
100
  width
101
101
  };
102
- if (segmentsDimensions.current.length === segments.length && nonAreUndefined(segmentsDimensions.current)) {
102
+ if (segmentsDimensions.current.length === segments.length && noneAreUndefined(segmentsDimensions.current)) {
103
103
  segmentsStyle.value = [...segmentsDimensions.current];
104
104
  // shouldResetOnDimensionsOnNextLayout.current = true;// in case onLayout will be called again (orientation change etc.)
105
105
  }
@@ -122,7 +122,7 @@ const SegmentedControl = props => {
122
122
  const {
123
123
  value: height
124
124
  } = containerHeight;
125
- if (height !== 0 && value.length === segments.length && nonAreUndefined(value)) {
125
+ if (height !== 0 && value.length === segments.length && noneAreUndefined(value)) {
126
126
  const isFirstElementSelected = animatedSelectedIndex.value === 0;
127
127
  const isLastElementSelected = animatedSelectedIndex.value === value.length - 1;
128
128
  const isMiddleSelected = !isFirstElementSelected && !isLastElementSelected;
@@ -6,7 +6,7 @@ import { GradientSliderProps, GradientSliderTypes } from './types';
6
6
  type Props<T> = GradientSliderProps<T> & ForwardRefInjectedProps;
7
7
  declare const _default: React.ForwardRefExoticComponent<Omit<import("./types").SliderProps, "onValueChange"> & {
8
8
  color?: string | import("tinycolor2").ColorFormats.HSLA | undefined;
9
- type?: "default" | "hue" | "lightness" | "saturation" | GradientSliderTypes | undefined;
9
+ type?: "default" | "hue" | "saturation" | "lightness" | GradientSliderTypes | undefined;
10
10
  gradientSteps?: number | undefined;
11
11
  onValueChange?: ((value: string, alfa: number) => void) | undefined;
12
12
  accessible?: boolean | undefined;
@@ -117,7 +117,7 @@ class Slider extends PureComponent {
117
117
  maximumValue,
118
118
  value
119
119
  } = props;
120
- if (minimumValue >= maximumValue) {
120
+ if (minimumValue > maximumValue) {
121
121
  console.warn('Slider minimumValue must be lower than maximumValue');
122
122
  }
123
123
  if (!useRange && (value < minimumValue || value > maximumValue)) {
@@ -23,6 +23,8 @@ function SortableItem(props) {
23
23
  const currIndex = useSharedValue(initialIndex.value);
24
24
  const translateX = useSharedValue(0);
25
25
  const translateY = useSharedValue(0);
26
+ const zIndex = useSharedValue(0);
27
+ const scale = useSharedValue(1);
26
28
  const isDragging = useSharedValue(false);
27
29
  const tempItemsOrder = useSharedValue(itemsOrder.value);
28
30
  const tempTranslateX = useSharedValue(0);
@@ -85,6 +87,15 @@ function SortableItem(props) {
85
87
  translateY.value = withTiming(translation.y, animationConfig);
86
88
  }
87
89
  }, []);
90
+ useAnimatedReaction(() => isDragging.value, (isDragging, wasDragging) => {
91
+ if (isDragging && !wasDragging) {
92
+ zIndex.value = withTiming(100, animationConfig);
93
+ scale.value = withSpring(1.1);
94
+ } else if (!isDragging && wasDragging) {
95
+ zIndex.value = withTiming(0, animationConfig);
96
+ scale.value = withSpring(1);
97
+ }
98
+ }, []);
88
99
  const onLayout = useCallback(event => {
89
100
  'worklet';
90
101
 
@@ -148,16 +159,14 @@ function SortableItem(props) {
148
159
  }
149
160
  });
150
161
  const animatedStyle = useAnimatedStyle(() => {
151
- const scale = withSpring(isDragging.value ? 1.1 : 1);
152
- const zIndex = isDragging.value ? 100 : withTiming(0, animationConfig);
153
162
  return {
154
- zIndex,
163
+ zIndex: Math.round(zIndex.value),
155
164
  transform: [{
156
165
  translateX: translateX.value
157
166
  }, {
158
167
  translateY: translateY.value
159
168
  }, {
160
- scale
169
+ scale: scale.value
161
170
  }]
162
171
  };
163
172
  });
@@ -51,6 +51,8 @@ const SortableListItem = props => {
51
51
  });
52
52
  const currIndex = useSharedValue(initialIndex.value);
53
53
  const translation = useSharedValue(0);
54
+ const zIndex = useSharedValue(0);
55
+ const scale = useSharedValue(1);
54
56
  const isDragging = useSharedValue(false);
55
57
  const draggedItemShadow = useSharedValue(StyleUtils.unpackStyle({
56
58
  ...Shadows.sh30.bottom,
@@ -78,6 +80,15 @@ const SortableListItem = props => {
78
80
  translation.value = withTiming(_translation, animationConfig);
79
81
  }
80
82
  }, []);
83
+ useAnimatedReaction(() => isDragging.value, (isDragging, wasDragging) => {
84
+ if (isDragging && !wasDragging) {
85
+ zIndex.value = withTiming(100, animationConfig);
86
+ scale.value = withSpring(propsScale);
87
+ } else if (!isDragging && wasDragging) {
88
+ zIndex.value = withTiming(0, animationConfig);
89
+ scale.value = withSpring(1);
90
+ }
91
+ }, []);
81
92
  const dragOnLongPressGesture = Gesture.Pan().activateAfterLongPress(250).enabled(!locked).onStart(() => {
82
93
  isDragging.value = true;
83
94
  translation.value = getTranslationByIndexChange(currIndex.value, initialIndex.value, itemSize.value);
@@ -143,20 +154,18 @@ const SortableListItem = props => {
143
154
  }
144
155
  });
145
156
  const draggedAnimatedStyle = useAnimatedStyle(() => {
146
- const scale = withSpring(isDragging.value ? propsScale : 1);
147
- const zIndex = isDragging.value ? 100 : withTiming(0, animationConfig);
148
157
  const opacity = isDragging.value ? 0.95 : 1;
149
158
  const shadow = isDragging.value ? draggedItemShadow.value : defaultItemShadow.value;
150
159
  return {
151
160
  backgroundColor: itemProps?.backgroundColor ?? LIST_ITEM_BACKGROUND,
152
161
  // required for elevation to work in Android
153
- zIndex,
162
+ zIndex: Math.round(zIndex.value),
154
163
  transform: [horizontal ? {
155
164
  translateX: translation.value
156
165
  } : {
157
166
  translateY: translation.value
158
167
  }, {
159
- scale
168
+ scale: scale.value
160
169
  }],
161
170
  opacity,
162
171
  ...itemProps?.margins,
@@ -27,6 +27,7 @@ const StackAggregator = props => {
27
27
  onItemPress,
28
28
  contentContainerStyle,
29
29
  itemBorderRadius = 0,
30
+ backgroundColor,
30
31
  onCollapseWillChange,
31
32
  onCollapseChanged
32
33
  } = props;
@@ -36,11 +37,11 @@ const StackAggregator = props => {
36
37
  useEffect(() => {
37
38
  setIsCollapsed(collapsed);
38
39
  }, [collapsed]);
39
- useDidUpdate(() => {
40
+ useDidUpdate(async () => {
40
41
  onCollapseWillChange?.(isCollapsed);
41
- animate();
42
+ await animate();
42
43
  onCollapseChanged?.(isCollapsed);
43
- }, [isCollapsed, onCollapseWillChange, onCollapseChanged]);
44
+ }, [isCollapsed, itemsCount]);
44
45
 
45
46
  /** Animations */
46
47
 
@@ -52,10 +53,10 @@ const StackAggregator = props => {
52
53
  const easeOut = Easing.bezier(0, 0, 0.58, 1);
53
54
  const getItemScale = useCallback(index => {
54
55
  if (isCollapsed) {
55
- if (index === itemsCount - 2) {
56
+ if (index === 1) {
56
57
  return 0.95;
57
58
  }
58
- if (index === itemsCount - 1) {
59
+ if (index === 2) {
59
60
  return 0.9;
60
61
  }
61
62
  }
@@ -123,10 +124,10 @@ const StackAggregator = props => {
123
124
 
124
125
  const getTop = index => {
125
126
  let start = 0;
126
- if (index === itemsCount - 2) {
127
+ if (index === 1) {
127
128
  start += PEEP;
128
129
  }
129
- if (index === itemsCount - 1) {
130
+ if (index === 2) {
130
131
  start += PEEP * 2;
131
132
  }
132
133
  return start;
@@ -149,6 +150,11 @@ const StackAggregator = props => {
149
150
  zIndex: itemsCount
150
151
  }];
151
152
  }, [firstItemHeight, itemsCount]);
153
+ const cardStyle = useMemo(() => {
154
+ return backgroundColor ? [styles.card, {
155
+ backgroundColor
156
+ }] : styles.card;
157
+ }, [backgroundColor]);
152
158
 
153
159
  /** Events */
154
160
 
@@ -167,7 +173,7 @@ const StackAggregator = props => {
167
173
  /** Renders */
168
174
 
169
175
  const renderItem = (item, index) => {
170
- return <Animated.View onLayout={index === 0 ? onLayout : undefined} style={[Constants.isIOS && styles.containerShadow, contentContainerStyle,
176
+ return <Animated.View onLayout={index === 0 ? onLayout : undefined} style={[Constants.isIOS && (index === 0 || index === 1 || index === 2 || !isCollapsed) && styles.containerShadow, contentContainerStyle,
171
177
  //@ts-expect-error 'position' doesn't match AnimatedInterpolation type
172
178
  getItemStyle(index), {
173
179
  borderRadius: Constants.isIOS ? itemBorderRadius : undefined,
@@ -179,7 +185,7 @@ const StackAggregator = props => {
179
185
  width: Constants.windowWidth - 40,
180
186
  height: isCollapsed ? firstItemHeight : undefined
181
187
  }]} collapsable={false}>
182
- <Card style={styles.card} onPress={() => _onItemPress(index)} borderRadius={itemBorderRadius} elevation={5}>
188
+ <Card style={cardStyle} onPress={() => _onItemPress(index)} borderRadius={itemBorderRadius} elevation={5}>
183
189
  <Animated.View style={index !== 0 ? {
184
190
  opacity: animatedContentOpacity
185
191
  } : undefined} collapsable={false}>
@@ -231,8 +237,7 @@ const styles = StyleSheet.create({
231
237
  },
232
238
  card: {
233
239
  overflow: 'hidden',
234
- flexShrink: 1,
235
- backgroundColor: 'transparent'
240
+ flexShrink: 1
236
241
  },
237
242
  button: {
238
243
  zIndex: 100
@@ -23,6 +23,9 @@ export default function TabPage({
23
23
  containerWidth
24
24
  } = useContext(TabBarContext);
25
25
  const [shouldLoad, setLoaded] = useState(!lazy);
26
+
27
+ // TODO: RN 77 hack - remove the state in future RN\reanimated release (ticket 4838 \ https://github.com/software-mansion/react-native-reanimated/issues/8517) when fixed we should revert to the original logic (see this PR: https://github.com/wix/react-native-ui-lib/pull/3829)
28
+ const [isActive, setIsActive] = useState(currentPage.value === index);
26
29
  // const [focused, setFocused] = useState(false);
27
30
 
28
31
  const lazyLoad = useCallback(() => {
@@ -36,6 +39,7 @@ export default function TabPage({
36
39
  return currentPage.value;
37
40
  }, (currentPage /* , previousPage */) => {
38
41
  const isActive = currentPage === index;
42
+ runOnJS(setIsActive)(isActive);
39
43
  // const wasActive = previousPage === index;
40
44
  // const nearActive = asCarousel && (currentPage - 1 === index || currentPage + 1 === index);
41
45
  // const wasNearActive =
@@ -52,23 +56,25 @@ export default function TabPage({
52
56
  // }
53
57
  }, [currentPage, lazyLoad]);
54
58
  const animatedPageStyle = useAnimatedStyle(() => {
59
+ if (!nestedInScrollView) {
60
+ return {};
61
+ }
55
62
  const isActive = Math.round(currentPage.value) === index;
56
-
57
- // TODO: Fix to proper animated style once Reanimated export AnimatedStyleProp
58
- const style = {
59
- opacity: isActive || asCarousel ? 1 : 0,
60
- zIndex: isActive || asCarousel ? 1 : 0
63
+ return {
64
+ position: isActive ? 'relative' : 'absolute'
61
65
  };
62
- if (nestedInScrollView) {
63
- style.position = isActive ? 'relative' : 'absolute';
64
- }
65
- return style;
66
66
  });
67
67
  const _style = useMemo(() => {
68
68
  return [!asCarousel && styles.page, animatedPageStyle, {
69
69
  width: asCarousel ? containerWidth : undefined
70
- }, style];
71
- }, [asCarousel, animatedPageStyle, containerWidth, style]);
70
+ }, style, !isActive && !asCarousel ? {
71
+ opacity: 0,
72
+ zIndex: 0
73
+ } : {
74
+ opacity: 1,
75
+ zIndex: 1
76
+ }];
77
+ }, [asCarousel, animatedPageStyle, containerWidth, style, isActive]);
72
78
  return <Reanimated.View style={_style} testID={testID}>
73
79
  {!shouldLoad && renderLoading?.()}
74
80
  {shouldLoad && props.children}
@@ -76,7 +82,5 @@ export default function TabPage({
76
82
  </Reanimated.View>;
77
83
  }
78
84
  const styles = StyleSheet.create({
79
- page: {
80
- ...StyleSheet.absoluteFillObject
81
- }
85
+ page: StyleSheet.absoluteFillObject
82
86
  });
@@ -1,6 +1,6 @@
1
1
  import { TextStyle } from 'react-native';
2
- import { ComponentProps } from '../../testkit/new/Component.driver';
3
- export declare const TextDriver: (props: ComponentProps) => {
2
+ import { ComponentProps, ComponentDriverOptions } from '../../testkit/new/Component.driver';
3
+ export declare const TextDriver: (props: ComponentProps, options?: ComponentDriverOptions) => {
4
4
  getText: () => string | (string | import("react-test-renderer").ReactTestInstance)[];
5
5
  getStyle: () => TextStyle;
6
6
  press: () => void;
@@ -1,8 +1,8 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
  import { useComponentDriver } from "../../testkit/new/Component.driver";
3
3
  import { usePressableDriver } from "../../testkit/new/usePressable.driver";
4
- export const TextDriver = props => {
5
- const driver = usePressableDriver(useComponentDriver(props));
4
+ export const TextDriver = (props, options) => {
5
+ const driver = usePressableDriver(useComponentDriver(props, options));
6
6
  const getText = () => {
7
7
  const textChildren = driver.getElement().children;
8
8
  if (textChildren.length === 0) {
@@ -98,10 +98,9 @@ const styles = StyleSheet.create({
98
98
  backgroundColor: 'transparent',
99
99
  color: Colors.$textDefault,
100
100
  ...(Constants.isIOS ? {
101
+ textAlign: 'left',
101
102
  writingDirection: Constants.isRTL ? writingDirectionTypes.RTL : writingDirectionTypes.LTR
102
- } : {
103
- textAlign: 'left'
104
- })
103
+ } : undefined)
105
104
  },
106
105
  centered: {
107
106
  textAlign: 'center'
@@ -81,7 +81,6 @@ const styles = StyleSheet.create({
81
81
  })
82
82
  },
83
83
  webStyle: {
84
- // @ts-expect-error
85
84
  outlineWidth: 0
86
85
  }
87
86
  });
@@ -1,5 +1,5 @@
1
- import { ComponentProps } from '../../testkit/new/Component.driver';
2
- export declare const TextFieldDriver: (props: ComponentProps) => {
1
+ import { ComponentProps, ComponentDriverOptions } from '../../testkit/new/Component.driver';
2
+ export declare const TextFieldDriver: (props: ComponentProps, options?: ComponentDriverOptions) => {
3
3
  getValue: () => string | undefined;
4
4
  changeText: (text: string) => void;
5
5
  focus: () => void;
@@ -7,8 +7,8 @@ import { TextDriver } from "../text/Text.driver.new";
7
7
  import { ImageDriver } from "../image/Image.driver.new";
8
8
  import { ButtonDriver } from "../button/Button.driver.new";
9
9
  import { ViewDriver } from "../view/View.driver.new";
10
- export const TextFieldDriver = props => {
11
- const driver = usePressableDriver(useComponentDriver(props));
10
+ export const TextFieldDriver = (props, options) => {
11
+ const driver = usePressableDriver(useComponentDriver(props, options));
12
12
  const floatingPlaceholderDriver = TextDriver({
13
13
  renderTree: props.renderTree,
14
14
  testID: `${props.testID}.floatingPlaceholder`