@webority-technologies/mobile 0.0.15 → 0.0.20

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 (202) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +60 -19
  2. package/lib/commonjs/components/AppBar/AppBar.js +29 -20
  3. package/lib/commonjs/components/Avatar/Avatar.js +38 -8
  4. package/lib/commonjs/components/Badge/Badge.js +66 -4
  5. package/lib/commonjs/components/Banner/Banner.js +146 -66
  6. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +37 -15
  7. package/lib/commonjs/components/BottomSheet/BottomSheet.js +78 -53
  8. package/lib/commonjs/components/Button/Button.js +12 -5
  9. package/lib/commonjs/components/Card/Card.js +106 -16
  10. package/lib/commonjs/components/Carousel/Carousel.js +66 -12
  11. package/lib/commonjs/components/Checkbox/Checkbox.js +11 -7
  12. package/lib/commonjs/components/Chip/Chip.js +44 -12
  13. package/lib/commonjs/components/DatePicker/DatePicker.js +185 -76
  14. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +133 -59
  15. package/lib/commonjs/components/Dialog/Dialog.js +16 -10
  16. package/lib/commonjs/components/Drawer/Drawer.js +13 -10
  17. package/lib/commonjs/components/FieldBase/FieldBase.js +306 -0
  18. package/lib/commonjs/components/FieldBase/index.js +32 -0
  19. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +69 -44
  20. package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
  21. package/lib/commonjs/components/FormField/FormField.js +3 -2
  22. package/lib/commonjs/components/ImageGallery/ImageGallery.js +132 -44
  23. package/lib/commonjs/components/Input/Input.js +144 -181
  24. package/lib/commonjs/components/ListItem/ListItem.js +90 -11
  25. package/lib/commonjs/components/Modal/Modal.js +55 -27
  26. package/lib/commonjs/components/NumberInput/NumberInput.js +60 -106
  27. package/lib/commonjs/components/OTPInput/OTPInput.js +65 -58
  28. package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +185 -0
  29. package/lib/commonjs/components/{AppIcon → PickerTrigger}/index.js +4 -4
  30. package/lib/commonjs/components/ProgressBar/ProgressBar.js +19 -11
  31. package/lib/commonjs/components/Radio/Radio.js +11 -6
  32. package/lib/commonjs/components/Rating/Rating.js +85 -19
  33. package/lib/commonjs/components/SearchBar/SearchBar.js +84 -107
  34. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +22 -11
  35. package/lib/commonjs/components/Select/Select.js +62 -91
  36. package/lib/commonjs/components/Skeleton/Skeleton.js +131 -174
  37. package/lib/commonjs/components/Skeleton/SkeletonClock.js +117 -0
  38. package/lib/commonjs/components/Skeleton/SkeletonContent.js +164 -81
  39. package/lib/commonjs/components/Skeleton/SkeletonProvider.js +72 -10
  40. package/lib/commonjs/components/Skeleton/index.js +17 -16
  41. package/lib/commonjs/components/Slider/Slider.js +44 -25
  42. package/lib/commonjs/components/Stepper/Stepper.js +199 -29
  43. package/lib/commonjs/components/Swipeable/Swipeable.js +36 -19
  44. package/lib/commonjs/components/Switch/Switch.js +9 -2
  45. package/lib/commonjs/components/Tabs/Tabs.js +84 -21
  46. package/lib/commonjs/components/TimePicker/TimePicker.js +123 -45
  47. package/lib/commonjs/components/Toast/Toast.js +27 -16
  48. package/lib/commonjs/components/Tooltip/Tooltip.js +56 -32
  49. package/lib/commonjs/components/index.js +37 -37
  50. package/lib/commonjs/theme/tokens.js +55 -7
  51. package/lib/module/components/Accordion/Accordion.js +61 -20
  52. package/lib/module/components/AppBar/AppBar.js +29 -20
  53. package/lib/module/components/Avatar/Avatar.js +39 -9
  54. package/lib/module/components/Badge/Badge.js +67 -5
  55. package/lib/module/components/Banner/Banner.js +147 -67
  56. package/lib/module/components/BottomNavigation/BottomNavigation.js +37 -15
  57. package/lib/module/components/BottomSheet/BottomSheet.js +80 -55
  58. package/lib/module/components/Button/Button.js +12 -5
  59. package/lib/module/components/Card/Card.js +107 -17
  60. package/lib/module/components/Carousel/Carousel.js +67 -13
  61. package/lib/module/components/Checkbox/Checkbox.js +11 -7
  62. package/lib/module/components/Chip/Chip.js +45 -13
  63. package/lib/module/components/DatePicker/DatePicker.js +185 -76
  64. package/lib/module/components/DateRangePicker/DateRangePicker.js +134 -60
  65. package/lib/module/components/Dialog/Dialog.js +16 -10
  66. package/lib/module/components/Drawer/Drawer.js +13 -10
  67. package/lib/module/components/FieldBase/FieldBase.js +297 -0
  68. package/lib/module/components/FieldBase/index.js +4 -0
  69. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +69 -44
  70. package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
  71. package/lib/module/components/FormField/FormField.js +3 -2
  72. package/lib/module/components/ImageGallery/ImageGallery.js +128 -40
  73. package/lib/module/components/Input/Input.js +144 -179
  74. package/lib/module/components/ListItem/ListItem.js +91 -12
  75. package/lib/module/components/Modal/Modal.js +55 -27
  76. package/lib/module/components/NumberInput/NumberInput.js +60 -106
  77. package/lib/module/components/OTPInput/OTPInput.js +65 -58
  78. package/lib/module/components/PickerTrigger/PickerTrigger.js +181 -0
  79. package/lib/module/components/PickerTrigger/index.js +4 -0
  80. package/lib/module/components/ProgressBar/ProgressBar.js +19 -11
  81. package/lib/module/components/Radio/Radio.js +11 -6
  82. package/lib/module/components/Rating/Rating.js +86 -20
  83. package/lib/module/components/SearchBar/SearchBar.js +84 -107
  84. package/lib/module/components/SegmentedControl/SegmentedControl.js +22 -11
  85. package/lib/module/components/Select/Select.js +62 -91
  86. package/lib/module/components/Skeleton/Skeleton.js +135 -175
  87. package/lib/module/components/Skeleton/SkeletonClock.js +110 -0
  88. package/lib/module/components/Skeleton/SkeletonContent.js +167 -84
  89. package/lib/module/components/Skeleton/SkeletonProvider.js +71 -10
  90. package/lib/module/components/Skeleton/index.js +3 -2
  91. package/lib/module/components/Slider/Slider.js +44 -25
  92. package/lib/module/components/Stepper/Stepper.js +201 -31
  93. package/lib/module/components/Swipeable/Swipeable.js +36 -19
  94. package/lib/module/components/Switch/Switch.js +9 -2
  95. package/lib/module/components/Tabs/Tabs.js +84 -21
  96. package/lib/module/components/TimePicker/TimePicker.js +123 -45
  97. package/lib/module/components/Toast/Toast.js +27 -16
  98. package/lib/module/components/Tooltip/Tooltip.js +56 -32
  99. package/lib/module/components/index.js +2 -2
  100. package/lib/module/theme/tokens.js +55 -7
  101. package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +10 -5
  102. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +8 -0
  103. package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +12 -6
  104. package/lib/typescript/commonjs/components/Badge/Badge.d.ts +7 -6
  105. package/lib/typescript/commonjs/components/Banner/Banner.d.ts +17 -6
  106. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +7 -0
  107. package/lib/typescript/commonjs/components/Card/Card.d.ts +17 -6
  108. package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +7 -6
  109. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +9 -1
  110. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +13 -6
  111. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +38 -3
  112. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +36 -3
  113. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +13 -1
  114. package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +141 -0
  115. package/lib/typescript/commonjs/components/FieldBase/index.d.ts +3 -0
  116. package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
  117. package/lib/typescript/commonjs/components/FloatingActionButton/index.d.ts +1 -1
  118. package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
  119. package/lib/typescript/commonjs/components/FormField/FormField.d.ts +7 -0
  120. package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +6 -4
  121. package/lib/typescript/commonjs/components/Input/Input.d.ts +6 -0
  122. package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +13 -6
  123. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -0
  124. package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +57 -0
  125. package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +3 -0
  126. package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +2 -0
  127. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +3 -0
  128. package/lib/typescript/commonjs/components/Rating/Rating.d.ts +9 -6
  129. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  130. package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +49 -20
  131. package/lib/typescript/commonjs/components/Skeleton/SkeletonClock.d.ts +60 -0
  132. package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +80 -19
  133. package/lib/typescript/commonjs/components/Skeleton/SkeletonProvider.d.ts +39 -5
  134. package/lib/typescript/commonjs/components/Skeleton/index.d.ts +6 -4
  135. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +12 -1
  136. package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +18 -6
  137. package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +2 -0
  138. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +1 -0
  139. package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +26 -2
  140. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +36 -3
  141. package/lib/typescript/commonjs/components/Toast/Toast.d.ts +8 -0
  142. package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +7 -1
  143. package/lib/typescript/commonjs/components/index.d.ts +5 -5
  144. package/lib/typescript/commonjs/index.d.ts +1 -1
  145. package/lib/typescript/commonjs/theme/index.d.ts +1 -1
  146. package/lib/typescript/commonjs/theme/types.d.ts +553 -11
  147. package/lib/typescript/module/components/Accordion/Accordion.d.ts +10 -5
  148. package/lib/typescript/module/components/AppBar/AppBar.d.ts +8 -0
  149. package/lib/typescript/module/components/Avatar/Avatar.d.ts +12 -6
  150. package/lib/typescript/module/components/Badge/Badge.d.ts +7 -6
  151. package/lib/typescript/module/components/Banner/Banner.d.ts +17 -6
  152. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +7 -0
  153. package/lib/typescript/module/components/Card/Card.d.ts +17 -6
  154. package/lib/typescript/module/components/Carousel/Carousel.d.ts +7 -6
  155. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +9 -1
  156. package/lib/typescript/module/components/Chip/Chip.d.ts +13 -6
  157. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +38 -3
  158. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +36 -3
  159. package/lib/typescript/module/components/Dialog/Dialog.d.ts +13 -1
  160. package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +141 -0
  161. package/lib/typescript/module/components/FieldBase/index.d.ts +3 -0
  162. package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
  163. package/lib/typescript/module/components/FloatingActionButton/index.d.ts +1 -1
  164. package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
  165. package/lib/typescript/module/components/FormField/FormField.d.ts +7 -0
  166. package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +6 -4
  167. package/lib/typescript/module/components/Input/Input.d.ts +6 -0
  168. package/lib/typescript/module/components/ListItem/ListItem.d.ts +13 -6
  169. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -0
  170. package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +57 -0
  171. package/lib/typescript/module/components/PickerTrigger/index.d.ts +3 -0
  172. package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +2 -0
  173. package/lib/typescript/module/components/Radio/Radio.d.ts +3 -0
  174. package/lib/typescript/module/components/Rating/Rating.d.ts +9 -6
  175. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  176. package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +49 -20
  177. package/lib/typescript/module/components/Skeleton/SkeletonClock.d.ts +60 -0
  178. package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +80 -19
  179. package/lib/typescript/module/components/Skeleton/SkeletonProvider.d.ts +39 -5
  180. package/lib/typescript/module/components/Skeleton/index.d.ts +6 -4
  181. package/lib/typescript/module/components/Slider/Slider.d.ts +12 -1
  182. package/lib/typescript/module/components/Stepper/Stepper.d.ts +18 -6
  183. package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +2 -0
  184. package/lib/typescript/module/components/Switch/Switch.d.ts +1 -0
  185. package/lib/typescript/module/components/Tabs/Tabs.d.ts +26 -2
  186. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +36 -3
  187. package/lib/typescript/module/components/Toast/Toast.d.ts +8 -0
  188. package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +7 -1
  189. package/lib/typescript/module/components/index.d.ts +5 -5
  190. package/lib/typescript/module/index.d.ts +1 -1
  191. package/lib/typescript/module/theme/index.d.ts +1 -1
  192. package/lib/typescript/module/theme/types.d.ts +553 -11
  193. package/package.json +2 -6
  194. package/lib/commonjs/components/AppIcon/AppIcon.js +0 -120
  195. package/lib/commonjs/types/vector-icons.d.js +0 -2
  196. package/lib/module/components/AppIcon/AppIcon.js +0 -111
  197. package/lib/module/components/AppIcon/index.js +0 -4
  198. package/lib/module/types/vector-icons.d.js +0 -2
  199. package/lib/typescript/commonjs/components/AppIcon/AppIcon.d.ts +0 -20
  200. package/lib/typescript/commonjs/components/AppIcon/index.d.ts +0 -3
  201. package/lib/typescript/module/components/AppIcon/AppIcon.d.ts +0 -20
  202. package/lib/typescript/module/components/AppIcon/index.d.ts +0 -3
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _index = require("../../theme/index.js");
10
10
  var _index2 = require("../../utils/index.js");
11
+ var _FieldBase = require("../FieldBase/FieldBase.js");
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
14
  const sizeMap = {
@@ -65,21 +66,28 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
65
66
  const [focusedIndex, setFocusedIndex] = (0, _react.useState)(-1);
66
67
  const previousErrorRef = (0, _react.useRef)(null);
67
68
  const shake = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
68
- const underlines = (0, _react.useRef)(Array.from({
69
- length
70
- }, () => new _reactNative.Animated.Value(0))).current;
71
- const previousFocusedIndexRef = (0, _react.useRef)(-1);
72
-
73
- // Resize underline array if length prop changes between renders.
74
- if (underlines.length !== length) {
75
- if (underlines.length < length) {
76
- for (let i = underlines.length; i < length; i += 1) {
77
- underlines.push(new _reactNative.Animated.Value(0));
69
+ const underlinesMapRef = (0, _react.useRef)(new Map());
70
+ const underlines = (0, _react.useMemo)(() => {
71
+ const map = underlinesMapRef.current;
72
+ const out = [];
73
+ for (let i = 0; i < length; i += 1) {
74
+ let v = map.get(i);
75
+ if (!v) {
76
+ v = new _reactNative.Animated.Value(0);
77
+ map.set(i, v);
78
78
  }
79
- } else {
80
- underlines.length = length;
79
+ out.push(v);
81
80
  }
82
- }
81
+ // Trim stale entries beyond current length.
82
+ for (const key of Array.from(map.keys())) {
83
+ if (key >= length) map.delete(key);
84
+ }
85
+ return out;
86
+ }, [length]);
87
+ const previousFocusedIndexRef = (0, _react.useRef)(-1);
88
+ const shakeOnError = theme.components.otpInput?.shakeOnError ?? false;
89
+ const errorHaptic = theme.components.otpInput?.errorHaptic ?? false;
90
+ const selectionHaptic = theme.components.otpInput?.selectionHaptic ?? false;
83
91
  const hasError = Boolean(error);
84
92
  const errorMessage = typeof error === 'string' ? error : undefined;
85
93
 
@@ -88,32 +96,34 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
88
96
  (0, _react.useEffect)(() => {
89
97
  const isFirstRun = previousErrorRef.current === null;
90
98
  if (!isFirstRun && hasError && !previousErrorRef.current) {
91
- (0, _index2.triggerHaptic)('notificationError');
92
- (0, _index.setNativeValue)(shake, 0);
93
- _reactNative.Animated.sequence([_reactNative.Animated.timing(shake, {
94
- toValue: 1,
95
- duration: 75,
96
- easing: _reactNative.Easing.linear,
97
- useNativeDriver: true
98
- }), _reactNative.Animated.timing(shake, {
99
- toValue: -1,
100
- duration: 75,
101
- easing: _reactNative.Easing.linear,
102
- useNativeDriver: true
103
- }), _reactNative.Animated.timing(shake, {
104
- toValue: 1,
105
- duration: 75,
106
- easing: _reactNative.Easing.linear,
107
- useNativeDriver: true
108
- }), _reactNative.Animated.timing(shake, {
109
- toValue: 0,
110
- duration: 75,
111
- easing: _reactNative.Easing.linear,
112
- useNativeDriver: true
113
- })]).start();
99
+ if (errorHaptic) (0, _index2.triggerHaptic)('notificationError');
100
+ if (shakeOnError) {
101
+ (0, _index.setNativeValue)(shake, 0);
102
+ _reactNative.Animated.sequence([_reactNative.Animated.timing(shake, {
103
+ toValue: 1,
104
+ duration: 75,
105
+ easing: _reactNative.Easing.linear,
106
+ useNativeDriver: true
107
+ }), _reactNative.Animated.timing(shake, {
108
+ toValue: -1,
109
+ duration: 75,
110
+ easing: _reactNative.Easing.linear,
111
+ useNativeDriver: true
112
+ }), _reactNative.Animated.timing(shake, {
113
+ toValue: 1,
114
+ duration: 75,
115
+ easing: _reactNative.Easing.linear,
116
+ useNativeDriver: true
117
+ }), _reactNative.Animated.timing(shake, {
118
+ toValue: 0,
119
+ duration: 75,
120
+ easing: _reactNative.Easing.linear,
121
+ useNativeDriver: true
122
+ })]).start();
123
+ }
114
124
  }
115
125
  previousErrorRef.current = hasError;
116
- }, [hasError, shake]);
126
+ }, [hasError, shake, shakeOnError, errorHaptic]);
117
127
 
118
128
  // Animate underline opacity for the focused cell. Skip on first mount
119
129
  // (no prior focus state) — values are already at 0 and there's nothing to animate.
@@ -205,7 +215,7 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
205
215
  const next = chars.join('').slice(0, length);
206
216
  const previousLength = value.length;
207
217
  updateValue(next);
208
- if (next.length !== previousLength) {
218
+ if (next.length !== previousLength && selectionHaptic) {
209
219
  (0, _index2.triggerHaptic)('selection');
210
220
  }
211
221
 
@@ -216,7 +226,7 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
216
226
  } else {
217
227
  focusCell(nextFocus);
218
228
  }
219
- }, [cells, focusCell, keyboardType, length, updateValue, value]);
229
+ }, [cells, focusCell, keyboardType, length, selectionHaptic, updateValue, value]);
220
230
  const handleKeyPress = (0, _react.useCallback)((index, e) => {
221
231
  const key = e.nativeEvent.key;
222
232
  if (key !== 'Backspace') return;
@@ -281,23 +291,26 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
281
291
  children: cells.map((char, index) => {
282
292
  const isFocused = focusedIndex === index;
283
293
  const isFilled = char.length > 0;
284
- const borderColor = hasError ? theme.colors.border.error : isFocused ? theme.colors.border.focus : theme.colors.border.primary;
285
- const backgroundColor = disabled ? theme.colors.surface.disabled : theme.colors.background.secondary;
286
294
  const underlineColor = hasError ? theme.colors.border.error : theme.colors.border.focus;
287
- const underlineOpacity = underlines[index] ?? new _reactNative.Animated.Value(0);
295
+ const underlineOpacity = underlines[index];
296
+ if (!underlineOpacity) return null;
288
297
  const display = secure && isFilled ? '●' : char;
289
298
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
290
299
  style: styles.cellWrapper,
291
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
292
- style: [styles.cell, {
293
- width: sizeStyles.cell,
294
- height: sizeStyles.cell,
295
- borderRadius: sizeStyles.borderRadius,
296
- backgroundColor,
297
- borderColor
298
- }, cellStyle],
299
- accessibilityElementsHidden: true,
300
- importantForAccessibility: "no-hide-descendants",
300
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_FieldBase.FieldBase, {
301
+ size: size,
302
+ width: sizeStyles.cell,
303
+ height: sizeStyles.cell,
304
+ borderRadius: sizeStyles.borderRadius,
305
+ borderWidth: 1.5,
306
+ focused: isFocused,
307
+ error: hasError,
308
+ filled: isFilled,
309
+ disabled: disabled,
310
+ paddingHorizontal: 0,
311
+ paddingVertical: 0,
312
+ gap: 0,
313
+ style: cellStyle,
301
314
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
302
315
  ref: node => {
303
316
  inputsRef.current[index] = node;
@@ -367,12 +380,6 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
367
380
  cellWrapper: {
368
381
  alignItems: 'center'
369
382
  },
370
- cell: {
371
- borderWidth: 1.5,
372
- alignItems: 'center',
373
- justifyContent: 'center',
374
- overflow: 'hidden'
375
- },
376
383
  input: {
377
384
  width: '100%',
378
385
  height: '100%',
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.PickerTrigger = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _index = require("../../theme/index.js");
10
+ var _index2 = require("../FieldBase/index.js");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
+ /**
14
+ * PickerTrigger — the tappable input field that opens a modal picker.
15
+ *
16
+ * Standalone read-only field built on FieldBase, used by DatePicker,
17
+ * TimePicker and DateRangePicker (and any consumer-built picker) to render
18
+ * the closed-state row that matches Input / Select pixel-for-pixel.
19
+ *
20
+ * The component is purely visual + interactive — it does not own picker
21
+ * state. Consumers either:
22
+ * - Use the built-in trigger mode on a picker, which composes this
23
+ * internally and manages its own open/close.
24
+ * - Render PickerTrigger themselves alongside a controlled picker.
25
+ */
26
+
27
+ const PickerTrigger = exports.PickerTrigger = /*#__PURE__*/(0, _react.forwardRef)((props, _ref) => {
28
+ const {
29
+ value,
30
+ placeholder,
31
+ label,
32
+ helperText,
33
+ error,
34
+ required = false,
35
+ onPress,
36
+ clearable = false,
37
+ onClear,
38
+ leadingIcon,
39
+ trailing,
40
+ disabled = false,
41
+ size = 'md',
42
+ variant,
43
+ style,
44
+ triggerStyle,
45
+ valueStyle,
46
+ labelStyle,
47
+ messageStyle,
48
+ accessibilityLabel,
49
+ testID
50
+ } = props;
51
+ const theme = (0, _index.useTheme)();
52
+ const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
53
+ const sizeTokens = (0, _index2.resolveFieldSize)(theme, size);
54
+ const fieldText = (0, _index2.resolveFieldTextStyle)(theme, {
55
+ disabled
56
+ });
57
+ const hasValue = typeof value === 'string' && value.length > 0;
58
+ const hasError = typeof error === 'string' && error.length > 0;
59
+ const displayText = hasValue ? value : placeholder ?? 'Select…';
60
+ const valueColor = hasValue ? fieldText.color : fieldText.placeholderColor;
61
+ const a11ySummary = hasValue ? `${label ?? 'Selection'}: ${value}` : placeholder ?? 'No selection';
62
+ const a11yLabel = accessibilityLabel ?? a11ySummary;
63
+ const a11yState = {
64
+ disabled
65
+ };
66
+ const handleClear = () => {
67
+ if (disabled) return;
68
+ onClear?.();
69
+ };
70
+ const showChevron = trailing === undefined;
71
+ const showClear = clearable && hasValue && !disabled;
72
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
73
+ style: [styles.root, style],
74
+ testID: testID,
75
+ children: [label ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
76
+ style: [styles.label, {
77
+ color: hasError ? theme.colors.error : theme.colors.text.secondary,
78
+ fontSize: theme.typography.fontSize.sm,
79
+ ...(0, _index.fontFor)(theme, 'medium'),
80
+ marginBottom: theme.spacing.xxs
81
+ }, labelStyle],
82
+ children: [label, required ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
83
+ style: {
84
+ color: theme.colors.error
85
+ },
86
+ children: " *"
87
+ }) : null]
88
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.FieldBase, {
89
+ size: size,
90
+ variant: variant,
91
+ disabled: disabled,
92
+ error: hasError,
93
+ filled: hasValue,
94
+ onPress: onPress,
95
+ leading: leadingIcon,
96
+ trailing: showClear || showChevron || trailing !== null ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
97
+ style: styles.trailingRow,
98
+ children: [showClear ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
99
+ onPress: handleClear,
100
+ accessibilityRole: "button",
101
+ accessibilityLabel: "Clear",
102
+ style: {
103
+ fontSize: sizeTokens.iconSize,
104
+ color: theme.colors.text.secondary,
105
+ paddingHorizontal: 4
106
+ },
107
+ children: "\xD7"
108
+ }) : null, trailing !== undefined ? trailing : showChevron ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Chevron, {
109
+ size: sizeTokens.iconSize,
110
+ color: disabled ? theme.colors.text.disabled : theme.colors.text.tertiary
111
+ }) : null]
112
+ }) : null,
113
+ accessibilityLabel: a11yLabel,
114
+ accessibilityState: a11yState,
115
+ accessibilityRole: "button",
116
+ style: triggerStyle,
117
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
118
+ numberOfLines: 1,
119
+ style: [styles.valueText, {
120
+ color: valueColor,
121
+ fontSize: sizeTokens.fontSize,
122
+ ...fieldText.weightStyle
123
+ }, valueStyle],
124
+ children: displayText
125
+ })
126
+ }), hasError || helperText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
127
+ style: [styles.message, {
128
+ color: hasError ? theme.colors.error : theme.colors.text.secondary,
129
+ fontSize: theme.typography.fontSize.xs,
130
+ marginTop: theme.spacing.xxs
131
+ }, messageStyle],
132
+ accessibilityLiveRegion: hasError ? 'polite' : 'none',
133
+ children: hasError ? error : helperText
134
+ }) : null]
135
+ });
136
+ });
137
+ PickerTrigger.displayName = 'PickerTrigger';
138
+ const Chevron = ({
139
+ size,
140
+ color
141
+ }) => {
142
+ // Simple down-pointing triangle drawn with borders — no icon dependency.
143
+ const half = size / 2;
144
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
145
+ style: {
146
+ width: size,
147
+ height: size,
148
+ alignItems: 'center',
149
+ justifyContent: 'center'
150
+ },
151
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
152
+ style: {
153
+ width: 0,
154
+ height: 0,
155
+ borderLeftWidth: half * 0.7,
156
+ borderRightWidth: half * 0.7,
157
+ borderTopWidth: half * 0.7,
158
+ borderLeftColor: 'transparent',
159
+ borderRightColor: 'transparent',
160
+ borderTopColor: color
161
+ }
162
+ })
163
+ });
164
+ };
165
+ const buildStyles = _theme => _reactNative.StyleSheet.create({
166
+ root: {
167
+ width: '100%'
168
+ },
169
+ label: {
170
+ includeFontPadding: false
171
+ },
172
+ valueText: {
173
+ flex: 1,
174
+ includeFontPadding: false
175
+ },
176
+ message: {
177
+ includeFontPadding: false
178
+ },
179
+ trailingRow: {
180
+ flexDirection: 'row',
181
+ alignItems: 'center'
182
+ }
183
+ });
184
+ var _default = exports.default = PickerTrigger;
185
+ //# sourceMappingURL=PickerTrigger.js.map
@@ -3,18 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "AppIcon", {
6
+ Object.defineProperty(exports, "PickerTrigger", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _AppIcon.AppIcon;
9
+ return _PickerTrigger.PickerTrigger;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "default", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _AppIcon.default;
15
+ return _PickerTrigger.default;
16
16
  }
17
17
  });
18
- var _AppIcon = _interopRequireWildcard(require("./AppIcon.js"));
18
+ var _PickerTrigger = _interopRequireWildcard(require("./PickerTrigger.js"));
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
20
  //# sourceMappingURL=index.js.map
@@ -40,6 +40,8 @@ const ProgressBar = exports.ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((p
40
40
  barColor,
41
41
  animated = true,
42
42
  style,
43
+ containerStyle,
44
+ barStyle,
43
45
  accessibilityLabel,
44
46
  testID
45
47
  } = props;
@@ -47,7 +49,11 @@ const ProgressBar = exports.ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((p
47
49
  const clamped = clampProgress(progress);
48
50
  const fillAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(clamped)).current;
49
51
  const loopAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
52
+ const widthAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
50
53
  const widthRef = (0, _react.useRef)(0);
54
+ const determinateDuration = theme.components.progressBar?.determinateAnimationDuration ?? 400;
55
+ const indeterminateDuration = theme.components.progressBar?.indeterminateLoopDuration ?? 1500;
56
+ const indeterminateWidth = theme.components.progressBar?.indeterminateWidth ?? '30%';
51
57
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
52
58
  const resolvedRadius = radius ?? theme.radius.full;
53
59
  const resolvedTrack = trackColor ?? theme.colors.surface.disabled;
@@ -60,17 +66,17 @@ const ProgressBar = exports.ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((p
60
66
  }
61
67
  _reactNative.Animated.timing(fillAnim, {
62
68
  toValue: clamped,
63
- duration: 400,
69
+ duration: determinateDuration,
64
70
  easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
65
71
  useNativeDriver: false
66
72
  }).start();
67
- }, [animated, clamped, fillAnim, isIndeterminate, theme]);
73
+ }, [animated, clamped, determinateDuration, fillAnim, isIndeterminate, theme]);
68
74
  (0, _react.useEffect)(() => {
69
75
  if (!isIndeterminate) return;
70
76
  (0, _index.setNativeValue)(loopAnim, 0);
71
77
  const animation = _reactNative.Animated.loop(_reactNative.Animated.timing(loopAnim, {
72
78
  toValue: 1,
73
- duration: 1500,
79
+ duration: indeterminateDuration,
74
80
  easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
75
81
  useNativeDriver: true
76
82
  }));
@@ -78,7 +84,7 @@ const ProgressBar = exports.ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((p
78
84
  return () => {
79
85
  animation.stop();
80
86
  };
81
- }, [isIndeterminate, loopAnim]);
87
+ }, [isIndeterminate, loopAnim, indeterminateDuration]);
82
88
  const determinateWidth = fillAnim.interpolate({
83
89
  inputRange: [0, 1],
84
90
  outputRange: ['0%', '100%']
@@ -88,7 +94,9 @@ const ProgressBar = exports.ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((p
88
94
  outputRange: [-1, 1]
89
95
  });
90
96
  const onLayout = event => {
91
- widthRef.current = event.nativeEvent.layout.width;
97
+ const w = event.nativeEvent.layout.width;
98
+ widthRef.current = w;
99
+ (0, _index.setNativeValue)(widthAnim, w);
92
100
  };
93
101
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
94
102
  ref: ref,
@@ -107,23 +115,24 @@ const ProgressBar = exports.ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((p
107
115
  height,
108
116
  borderRadius: resolvedRadius,
109
117
  backgroundColor: resolvedTrack
110
- }, style],
118
+ }, style, containerStyle],
111
119
  children: isIndeterminate ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
112
120
  style: [styles.indeterminateBar, {
113
121
  height,
114
122
  borderRadius: resolvedRadius,
115
123
  backgroundColor: resolvedBar,
124
+ width: indeterminateWidth,
116
125
  transform: [{
117
- translateX: _reactNative.Animated.multiply(indeterminateTranslate, new _reactNative.Animated.Value(widthRef.current || 0))
126
+ translateX: _reactNative.Animated.multiply(indeterminateTranslate, widthAnim)
118
127
  }]
119
- }]
128
+ }, barStyle]
120
129
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
121
130
  style: [styles.determinateBar, {
122
131
  height,
123
132
  borderRadius: resolvedRadius,
124
133
  backgroundColor: resolvedBar,
125
134
  width: determinateWidth
126
- }]
135
+ }, barStyle]
127
136
  })
128
137
  });
129
138
  });
@@ -141,8 +150,7 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
141
150
  indeterminateBar: {
142
151
  position: 'absolute',
143
152
  left: 0,
144
- top: 0,
145
- width: '30%'
153
+ top: 0
146
154
  }
147
155
  });
148
156
  var _default = exports.default = ProgressBar;
@@ -50,9 +50,12 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
50
50
  size = 'md',
51
51
  tone = 'primary',
52
52
  accessibilityLabel,
53
- haptic = 'selection',
53
+ haptic,
54
54
  style,
55
+ containerStyle,
55
56
  circleStyle,
57
+ dotStyle,
58
+ labelStyle,
56
59
  testID,
57
60
  ...rest
58
61
  } = props;
@@ -65,8 +68,10 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
65
68
  const sizeOverrides = theme.components.radio?.[size];
66
69
  const outer = sizeOverrides?.outer ?? sizeMap[size].outer;
67
70
  const inner = sizeOverrides?.inner ?? sizeMap[size].inner;
68
- const radioBorderWidth = theme.components.radio?.borderWidth ?? 1.5;
71
+ const radioBorderWidth = theme.colors.border.width;
69
72
  const radioLabelGap = theme.components.radio?.labelGap ?? 10;
73
+ const pressHapticEnabled = theme.components.radio?.pressHaptic ?? false;
74
+ const resolvedHaptic = haptic === undefined ? pressHapticEnabled ? 'selection' : false : haptic;
70
75
  const progress = (0, _react.useRef)((0, _index.createAnimatedValue)(selected ? 1 : 0)).current;
71
76
  (0, _react.useEffect)(() => {
72
77
  _reactNative.Animated.spring(progress, {
@@ -83,7 +88,7 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
83
88
  });
84
89
  const handlePress = event => {
85
90
  if (disabled) return;
86
- if (haptic !== false) (0, _hapticUtils.triggerHaptic)(haptic);
91
+ if (resolvedHaptic !== false) (0, _hapticUtils.triggerHaptic)(resolvedHaptic);
87
92
  if (ctx) {
88
93
  ctx.onSelect(value);
89
94
  } else {
@@ -110,7 +115,7 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
110
115
  pressed
111
116
  }) => [styles.row, {
112
117
  opacity: disabled ? 0.55 : pressed ? 0.85 : 1
113
- }, style],
118
+ }, style, containerStyle],
114
119
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
115
120
  style: [styles.outer, {
116
121
  width: outer,
@@ -129,14 +134,14 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
129
134
  transform: [{
130
135
  scale
131
136
  }]
132
- }]
137
+ }, dotStyle]
133
138
  })
134
139
  }), label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
135
140
  style: [styles.label, {
136
141
  marginLeft: radioLabelGap,
137
142
  color: disabled ? theme.colors.text.disabled : theme.colors.text.primary,
138
143
  fontSize: theme.typography.fontSize.base
139
- }],
144
+ }, labelStyle],
140
145
  numberOfLines: 2,
141
146
  children: label
142
147
  }) : null]