@webority-technologies/mobile 0.0.21 → 0.0.23

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 (187) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +4 -2
  2. package/lib/commonjs/components/Avatar/Avatar.js +4 -2
  3. package/lib/commonjs/components/Badge/Badge.js +5 -5
  4. package/lib/commonjs/components/Banner/Banner.js +8 -4
  5. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +6 -4
  6. package/lib/commonjs/components/BottomSheet/BottomSheet.js +69 -13
  7. package/lib/commonjs/components/BottomSheet/index.js +6 -0
  8. package/lib/commonjs/components/Box/Box.js +162 -0
  9. package/lib/commonjs/components/Box/index.js +37 -0
  10. package/lib/commonjs/components/Button/Button.js +7 -7
  11. package/lib/commonjs/components/Carousel/Carousel.js +4 -2
  12. package/lib/commonjs/components/Checkbox/Checkbox.js +14 -5
  13. package/lib/commonjs/components/DatePicker/DatePicker.js +9 -7
  14. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +5 -2
  15. package/lib/commonjs/components/Dialog/Dialog.js +2 -2
  16. package/lib/commonjs/components/FieldBase/FieldBase.js +8 -4
  17. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +13 -5
  18. package/lib/commonjs/components/FormField/FormField.js +61 -25
  19. package/lib/commonjs/components/Input/Input.js +41 -29
  20. package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +102 -0
  21. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +13 -0
  22. package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +130 -0
  23. package/lib/commonjs/components/KeyboardToolbar/index.js +13 -0
  24. package/lib/commonjs/components/Modal/Modal.js +17 -6
  25. package/lib/commonjs/components/NumberInput/NumberInput.js +35 -28
  26. package/lib/commonjs/components/OTPInput/OTPInput.js +33 -18
  27. package/lib/commonjs/components/Radio/Radio.js +7 -5
  28. package/lib/commonjs/components/Radio/RadioGroup.js +10 -3
  29. package/lib/commonjs/components/SearchBar/SearchBar.js +4 -2
  30. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +20 -10
  31. package/lib/commonjs/components/Select/Select.js +33 -32
  32. package/lib/commonjs/components/Skeleton/SkeletonContent.js +5 -2
  33. package/lib/commonjs/components/Slider/Slider.js +42 -26
  34. package/lib/commonjs/components/Spinner/Spinner.js +5 -5
  35. package/lib/commonjs/components/Switch/Switch.js +29 -16
  36. package/lib/commonjs/components/Tabs/Tabs.js +4 -2
  37. package/lib/commonjs/components/Text/Text.js +142 -0
  38. package/lib/commonjs/components/Text/index.js +13 -0
  39. package/lib/commonjs/components/TimePicker/TimePicker.js +10 -7
  40. package/lib/commonjs/components/Toast/Toast.js +22 -10
  41. package/lib/commonjs/components/Tooltip/Tooltip.js +6 -2
  42. package/lib/commonjs/components/index.js +141 -89
  43. package/lib/commonjs/form/FormContext.js +40 -0
  44. package/lib/commonjs/form/index.js +68 -0
  45. package/lib/commonjs/form/path.js +79 -0
  46. package/lib/commonjs/form/rules.js +67 -0
  47. package/lib/commonjs/form/types.js +2 -0
  48. package/lib/commonjs/form/useField.js +54 -0
  49. package/lib/commonjs/form/useForm.js +316 -0
  50. package/lib/commonjs/hooks/index.js +14 -0
  51. package/lib/commonjs/hooks/useControllableState.js +30 -0
  52. package/lib/commonjs/hooks/useReducedMotion.js +31 -0
  53. package/lib/commonjs/index.js +96 -11
  54. package/lib/commonjs/theme/ThemeContext.js +30 -2
  55. package/lib/commonjs/theme/tokens.js +12 -0
  56. package/lib/module/components/Accordion/Accordion.js +4 -2
  57. package/lib/module/components/Avatar/Avatar.js +4 -2
  58. package/lib/module/components/Badge/Badge.js +5 -5
  59. package/lib/module/components/Banner/Banner.js +8 -4
  60. package/lib/module/components/BottomNavigation/BottomNavigation.js +6 -4
  61. package/lib/module/components/BottomSheet/BottomSheet.js +68 -13
  62. package/lib/module/components/BottomSheet/index.js +1 -1
  63. package/lib/module/components/Box/Box.js +156 -0
  64. package/lib/module/components/Box/index.js +4 -0
  65. package/lib/module/components/Button/Button.js +7 -7
  66. package/lib/module/components/Carousel/Carousel.js +4 -2
  67. package/lib/module/components/Checkbox/Checkbox.js +14 -5
  68. package/lib/module/components/DatePicker/DatePicker.js +9 -7
  69. package/lib/module/components/DateRangePicker/DateRangePicker.js +5 -2
  70. package/lib/module/components/Dialog/Dialog.js +2 -2
  71. package/lib/module/components/FieldBase/FieldBase.js +8 -4
  72. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +13 -5
  73. package/lib/module/components/FormField/FormField.js +62 -26
  74. package/lib/module/components/Input/Input.js +41 -29
  75. package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +98 -0
  76. package/lib/module/components/KeyboardAwareScrollView/index.js +4 -0
  77. package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +125 -0
  78. package/lib/module/components/KeyboardToolbar/index.js +4 -0
  79. package/lib/module/components/Modal/Modal.js +17 -6
  80. package/lib/module/components/NumberInput/NumberInput.js +30 -23
  81. package/lib/module/components/OTPInput/OTPInput.js +30 -15
  82. package/lib/module/components/Radio/Radio.js +7 -5
  83. package/lib/module/components/Radio/RadioGroup.js +10 -3
  84. package/lib/module/components/SearchBar/SearchBar.js +4 -2
  85. package/lib/module/components/SegmentedControl/SegmentedControl.js +20 -10
  86. package/lib/module/components/Select/Select.js +33 -32
  87. package/lib/module/components/Skeleton/SkeletonContent.js +5 -2
  88. package/lib/module/components/Slider/Slider.js +42 -26
  89. package/lib/module/components/Spinner/Spinner.js +5 -5
  90. package/lib/module/components/Switch/Switch.js +29 -16
  91. package/lib/module/components/Tabs/Tabs.js +4 -2
  92. package/lib/module/components/Text/Text.js +138 -0
  93. package/lib/module/components/Text/index.js +4 -0
  94. package/lib/module/components/TimePicker/TimePicker.js +10 -7
  95. package/lib/module/components/Toast/Toast.js +22 -10
  96. package/lib/module/components/Tooltip/Tooltip.js +6 -2
  97. package/lib/module/components/index.js +5 -1
  98. package/lib/module/form/FormContext.js +32 -0
  99. package/lib/module/form/index.js +12 -0
  100. package/lib/module/form/path.js +72 -0
  101. package/lib/module/form/rules.js +52 -0
  102. package/lib/module/form/types.js +2 -0
  103. package/lib/module/form/useField.js +49 -0
  104. package/lib/module/form/useForm.js +312 -0
  105. package/lib/module/hooks/index.js +2 -0
  106. package/lib/module/hooks/useControllableState.js +26 -0
  107. package/lib/module/hooks/useReducedMotion.js +27 -0
  108. package/lib/module/index.js +3 -1
  109. package/lib/module/theme/ThemeContext.js +30 -2
  110. package/lib/module/theme/tokens.js +12 -0
  111. package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  112. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +41 -0
  113. package/lib/typescript/commonjs/components/BottomSheet/index.d.ts +2 -2
  114. package/lib/typescript/commonjs/components/Box/Box.d.ts +60 -0
  115. package/lib/typescript/commonjs/components/Box/index.d.ts +3 -0
  116. package/lib/typescript/commonjs/components/Button/Button.d.ts +1 -1
  117. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +3 -2
  118. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +3 -3
  119. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +2 -2
  120. package/lib/typescript/commonjs/components/FormField/FormField.d.ts +13 -2
  121. package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
  122. package/lib/typescript/commonjs/components/KeyboardAwareScrollView/index.d.ts +3 -0
  123. package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
  124. package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +3 -0
  125. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -2
  126. package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +3 -2
  127. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +2 -2
  128. package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +3 -2
  129. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -2
  130. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +6 -4
  131. package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +1 -1
  132. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +3 -2
  133. package/lib/typescript/commonjs/components/Text/Text.d.ts +25 -0
  134. package/lib/typescript/commonjs/components/Text/index.d.ts +3 -0
  135. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +3 -3
  136. package/lib/typescript/commonjs/components/index.d.ts +10 -2
  137. package/lib/typescript/commonjs/form/FormContext.d.ts +17 -0
  138. package/lib/typescript/commonjs/form/index.d.ts +9 -0
  139. package/lib/typescript/commonjs/form/path.d.ts +10 -0
  140. package/lib/typescript/commonjs/form/rules.d.ts +31 -0
  141. package/lib/typescript/commonjs/form/types.d.ts +94 -0
  142. package/lib/typescript/commonjs/form/useField.d.ts +27 -0
  143. package/lib/typescript/commonjs/form/useForm.d.ts +10 -0
  144. package/lib/typescript/commonjs/hooks/index.d.ts +3 -0
  145. package/lib/typescript/commonjs/hooks/useControllableState.d.ts +17 -0
  146. package/lib/typescript/commonjs/hooks/useReducedMotion.d.ts +8 -0
  147. package/lib/typescript/commonjs/index.d.ts +4 -2
  148. package/lib/typescript/commonjs/theme/types.d.ts +15 -0
  149. package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  150. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +41 -0
  151. package/lib/typescript/module/components/BottomSheet/index.d.ts +2 -2
  152. package/lib/typescript/module/components/Box/Box.d.ts +60 -0
  153. package/lib/typescript/module/components/Box/index.d.ts +3 -0
  154. package/lib/typescript/module/components/Button/Button.d.ts +1 -1
  155. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +3 -2
  156. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +3 -3
  157. package/lib/typescript/module/components/Dialog/Dialog.d.ts +2 -2
  158. package/lib/typescript/module/components/FormField/FormField.d.ts +13 -2
  159. package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
  160. package/lib/typescript/module/components/KeyboardAwareScrollView/index.d.ts +3 -0
  161. package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
  162. package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +3 -0
  163. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -2
  164. package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +3 -2
  165. package/lib/typescript/module/components/Radio/Radio.d.ts +2 -2
  166. package/lib/typescript/module/components/Radio/RadioGroup.d.ts +3 -2
  167. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -2
  168. package/lib/typescript/module/components/Slider/Slider.d.ts +6 -4
  169. package/lib/typescript/module/components/Spinner/Spinner.d.ts +1 -1
  170. package/lib/typescript/module/components/Switch/Switch.d.ts +3 -2
  171. package/lib/typescript/module/components/Text/Text.d.ts +25 -0
  172. package/lib/typescript/module/components/Text/index.d.ts +3 -0
  173. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +3 -3
  174. package/lib/typescript/module/components/index.d.ts +10 -2
  175. package/lib/typescript/module/form/FormContext.d.ts +17 -0
  176. package/lib/typescript/module/form/index.d.ts +9 -0
  177. package/lib/typescript/module/form/path.d.ts +10 -0
  178. package/lib/typescript/module/form/rules.d.ts +31 -0
  179. package/lib/typescript/module/form/types.d.ts +94 -0
  180. package/lib/typescript/module/form/useField.d.ts +27 -0
  181. package/lib/typescript/module/form/useForm.d.ts +10 -0
  182. package/lib/typescript/module/hooks/index.d.ts +3 -0
  183. package/lib/typescript/module/hooks/useControllableState.d.ts +17 -0
  184. package/lib/typescript/module/hooks/useReducedMotion.d.ts +8 -0
  185. package/lib/typescript/module/index.d.ts +4 -2
  186. package/lib/typescript/module/theme/types.d.ts +15 -0
  187. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useControllableState = useControllableState;
7
+ var _react = require("react");
8
+ /**
9
+ * Bridges controlled and uncontrolled usage for a value+onChange pair. When
10
+ * `value` is provided the component is controlled (the hook just forwards it
11
+ * and calls `onChange`); otherwise the hook owns the state, seeded from
12
+ * `defaultValue`. The controlled/uncontrolled decision is locked on first
13
+ * render so a component never flips modes mid-life.
14
+ */
15
+ function useControllableState({
16
+ value,
17
+ defaultValue,
18
+ onChange
19
+ }) {
20
+ const isControlledRef = (0, _react.useRef)(value !== undefined);
21
+ const isControlled = isControlledRef.current;
22
+ const [internal, setInternal] = (0, _react.useState)(defaultValue);
23
+ const current = isControlled ? value : internal;
24
+ const setValue = (0, _react.useCallback)(next => {
25
+ if (!isControlled) setInternal(next);
26
+ onChange?.(next);
27
+ }, [isControlled, onChange]);
28
+ return [current, setValue];
29
+ }
30
+ //# sourceMappingURL=useControllableState.js.map
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useReducedMotion = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ /**
10
+ * Tracks the OS "Reduce Motion" accessibility setting. The library's
11
+ * ThemeProvider uses this to collapse `theme.motion` (durations → 0, springs →
12
+ * near-instant) so animations don't trigger vestibular discomfort; consumers
13
+ * can also read it directly to swap an animated path for a static one.
14
+ */
15
+ const useReducedMotion = () => {
16
+ const [reduced, setReduced] = (0, _react.useState)(false);
17
+ (0, _react.useEffect)(() => {
18
+ let mounted = true;
19
+ _reactNative.AccessibilityInfo.isReduceMotionEnabled().then(value => {
20
+ if (mounted) setReduced(value);
21
+ });
22
+ const sub = _reactNative.AccessibilityInfo.addEventListener('reduceMotionChanged', value => setReduced(value));
23
+ return () => {
24
+ mounted = false;
25
+ sub.remove();
26
+ };
27
+ }, []);
28
+ return reduced;
29
+ };
30
+ exports.useReducedMotion = useReducedMotion;
31
+ //# sourceMappingURL=useReducedMotion.js.map
@@ -42,6 +42,8 @@ var _exportNames = {
42
42
  useToggle: true,
43
43
  useDebounce: true,
44
44
  usePressAnimation: true,
45
+ useReducedMotion: true,
46
+ useControllableState: true,
45
47
  ScreenDimensions: true,
46
48
  Breakpoints: true,
47
49
  Responsive: true,
@@ -83,6 +85,16 @@ var _exportNames = {
83
85
  isBetween: true,
84
86
  minLength: true,
85
87
  maxLength: true,
88
+ useForm: true,
89
+ useField: true,
90
+ useFieldArray: true,
91
+ Form: true,
92
+ useFormContext: true,
93
+ useOptionalFormContext: true,
94
+ rules: true,
95
+ getPath: true,
96
+ setPath: true,
97
+ deletePath: true,
86
98
  useNetworkStatus: true,
87
99
  getNetworkStatus: true,
88
100
  addNetworkStatusListener: true,
@@ -95,6 +107,12 @@ Object.defineProperty(exports, "Breakpoints", {
95
107
  return _index7.Breakpoints;
96
108
  }
97
109
  });
110
+ Object.defineProperty(exports, "Form", {
111
+ enumerable: true,
112
+ get: function () {
113
+ return _index0.Form;
114
+ }
115
+ });
98
116
  Object.defineProperty(exports, "Logger", {
99
117
  enumerable: true,
100
118
  get: function () {
@@ -110,7 +128,7 @@ Object.defineProperty(exports, "Margin", {
110
128
  Object.defineProperty(exports, "NetworkStatusBanner", {
111
129
  enumerable: true,
112
130
  get: function () {
113
- return _index0.NetworkStatusBanner;
131
+ return _index1.NetworkStatusBanner;
114
132
  }
115
133
  });
116
134
  Object.defineProperty(exports, "Padding", {
@@ -122,7 +140,7 @@ Object.defineProperty(exports, "Padding", {
122
140
  Object.defineProperty(exports, "Permissions", {
123
141
  enumerable: true,
124
142
  get: function () {
125
- return _index1.Permissions;
143
+ return _index10.Permissions;
126
144
  }
127
145
  });
128
146
  Object.defineProperty(exports, "Responsive", {
@@ -164,7 +182,7 @@ Object.defineProperty(exports, "VersionCheck", {
164
182
  Object.defineProperty(exports, "addNetworkStatusListener", {
165
183
  enumerable: true,
166
184
  get: function () {
167
- return _index0.addNetworkStatusListener;
185
+ return _index1.addNetworkStatusListener;
168
186
  }
169
187
  });
170
188
  Object.defineProperty(exports, "compressImage", {
@@ -185,6 +203,12 @@ Object.defineProperty(exports, "decodeJWT", {
185
203
  return _jwt.decodeJWT;
186
204
  }
187
205
  });
206
+ Object.defineProperty(exports, "deletePath", {
207
+ enumerable: true,
208
+ get: function () {
209
+ return _index0.deletePath;
210
+ }
211
+ });
188
212
  Object.defineProperty(exports, "formatCompactNumber", {
189
213
  enumerable: true,
190
214
  get: function () {
@@ -272,7 +296,13 @@ Object.defineProperty(exports, "getJWTExpiry", {
272
296
  Object.defineProperty(exports, "getNetworkStatus", {
273
297
  enumerable: true,
274
298
  get: function () {
275
- return _index0.getNetworkStatus;
299
+ return _index1.getNetworkStatus;
300
+ }
301
+ });
302
+ Object.defineProperty(exports, "getPath", {
303
+ enumerable: true,
304
+ get: function () {
305
+ return _index0.getPath;
276
306
  }
277
307
  });
278
308
  Object.defineProperty(exports, "getTheme", {
@@ -485,6 +515,12 @@ Object.defineProperty(exports, "resetTheme", {
485
515
  return _index5.resetTheme;
486
516
  }
487
517
  });
518
+ Object.defineProperty(exports, "rules", {
519
+ enumerable: true,
520
+ get: function () {
521
+ return _index0.rules;
522
+ }
523
+ });
488
524
  Object.defineProperty(exports, "setColorMode", {
489
525
  enumerable: true,
490
526
  get: function () {
@@ -503,6 +539,12 @@ Object.defineProperty(exports, "setHapticImplementation", {
503
539
  return _index7.setHapticImplementation;
504
540
  }
505
541
  });
542
+ Object.defineProperty(exports, "setPath", {
543
+ enumerable: true,
544
+ get: function () {
545
+ return _index0.setPath;
546
+ }
547
+ });
506
548
  Object.defineProperty(exports, "setRemoteLogger", {
507
549
  enumerable: true,
508
550
  get: function () {
@@ -545,16 +587,52 @@ Object.defineProperty(exports, "triggerHaptic", {
545
587
  return _index7.triggerHaptic;
546
588
  }
547
589
  });
590
+ Object.defineProperty(exports, "useControllableState", {
591
+ enumerable: true,
592
+ get: function () {
593
+ return _index6.useControllableState;
594
+ }
595
+ });
548
596
  Object.defineProperty(exports, "useDebounce", {
549
597
  enumerable: true,
550
598
  get: function () {
551
599
  return _index6.useDebounce;
552
600
  }
553
601
  });
602
+ Object.defineProperty(exports, "useField", {
603
+ enumerable: true,
604
+ get: function () {
605
+ return _index0.useField;
606
+ }
607
+ });
608
+ Object.defineProperty(exports, "useFieldArray", {
609
+ enumerable: true,
610
+ get: function () {
611
+ return _index0.useFieldArray;
612
+ }
613
+ });
614
+ Object.defineProperty(exports, "useForm", {
615
+ enumerable: true,
616
+ get: function () {
617
+ return _index0.useForm;
618
+ }
619
+ });
620
+ Object.defineProperty(exports, "useFormContext", {
621
+ enumerable: true,
622
+ get: function () {
623
+ return _index0.useFormContext;
624
+ }
625
+ });
554
626
  Object.defineProperty(exports, "useNetworkStatus", {
555
627
  enumerable: true,
556
628
  get: function () {
557
- return _index0.useNetworkStatus;
629
+ return _index1.useNetworkStatus;
630
+ }
631
+ });
632
+ Object.defineProperty(exports, "useOptionalFormContext", {
633
+ enumerable: true,
634
+ get: function () {
635
+ return _index0.useOptionalFormContext;
558
636
  }
559
637
  });
560
638
  Object.defineProperty(exports, "usePressAnimation", {
@@ -563,6 +641,12 @@ Object.defineProperty(exports, "usePressAnimation", {
563
641
  return _index6.usePressAnimation;
564
642
  }
565
643
  });
644
+ Object.defineProperty(exports, "useReducedMotion", {
645
+ enumerable: true,
646
+ get: function () {
647
+ return _index6.useReducedMotion;
648
+ }
649
+ });
566
650
  Object.defineProperty(exports, "useTheme", {
567
651
  enumerable: true,
568
652
  get: function () {
@@ -609,17 +693,18 @@ var _index6 = require("./hooks/index.js");
609
693
  var _index7 = require("./utils/index.js");
610
694
  var _index8 = require("./formatters/index.js");
611
695
  var _index9 = require("./validators/index.js");
612
- var _index0 = require("./network/index.js");
613
- var _index1 = require("./permissions/index.js");
614
- var _index10 = require("./components/index.js");
615
- Object.keys(_index10).forEach(function (key) {
696
+ var _index0 = require("./form/index.js");
697
+ var _index1 = require("./network/index.js");
698
+ var _index10 = require("./permissions/index.js");
699
+ var _index11 = require("./components/index.js");
700
+ Object.keys(_index11).forEach(function (key) {
616
701
  if (key === "default" || key === "__esModule") return;
617
702
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
618
- if (key in exports && exports[key] === _index10[key]) return;
703
+ if (key in exports && exports[key] === _index11[key]) return;
619
704
  Object.defineProperty(exports, key, {
620
705
  enumerable: true,
621
706
  get: function () {
622
- return _index10[key];
707
+ return _index11[key];
623
708
  }
624
709
  });
625
710
  });
@@ -8,8 +8,31 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _tokens = require("./tokens.js");
10
10
  var _merge = require("./merge.js");
11
+ var _useReducedMotion = require("../hooks/useReducedMotion.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); }
14
+ const REDUCED_SPRING = {
15
+ damping: 100,
16
+ stiffness: 1000,
17
+ mass: 1
18
+ };
19
+ // Reduce Motion: collapse timed animations to instant and make springs settle in
20
+ // ~1 frame, so vestibular-sensitive users aren't subjected to slides/scales/bounces.
21
+ const collapseMotion = motion => ({
22
+ ...motion,
23
+ duration: {
24
+ instant: 0,
25
+ fast: 0,
26
+ normal: 0,
27
+ slow: 0,
28
+ slower: 0
29
+ },
30
+ spring: {
31
+ gentle: REDUCED_SPRING,
32
+ bouncy: REDUCED_SPRING,
33
+ snappy: REDUCED_SPRING
34
+ }
35
+ });
13
36
  const defaultValue = {
14
37
  theme: _tokens.lightTheme,
15
38
  mode: 'light',
@@ -35,11 +58,16 @@ const ThemeProvider = ({
35
58
  return () => sub.remove();
36
59
  }, []);
37
60
  const mode = preference === 'system' ? systemMode : preference;
61
+ const reduceMotion = (0, _useReducedMotion.useReducedMotion)();
38
62
  const theme = (0, _react.useMemo)(() => {
39
63
  const base = mode === 'dark' ? _tokens.darkTheme : _tokens.lightTheme;
40
64
  const overrides = mode === 'dark' ? darkOverrides : lightOverrides;
41
- return overrides ? (0, _merge.mergeTheme)(base, overrides) : base;
42
- }, [mode, lightOverrides, darkOverrides]);
65
+ const merged = overrides ? (0, _merge.mergeTheme)(base, overrides) : base;
66
+ return reduceMotion ? {
67
+ ...merged,
68
+ motion: collapseMotion(merged.motion)
69
+ } : merged;
70
+ }, [mode, lightOverrides, darkOverrides, reduceMotion]);
43
71
  const value = (0, _react.useMemo)(() => ({
44
72
  theme,
45
73
  mode,
@@ -525,6 +525,12 @@ const lightTheme = exports.lightTheme = {
525
525
  warning: '#F59E0B',
526
526
  error: '#E5484D',
527
527
  info: '#3B82F6',
528
+ onPrimary: '#FFFFFF',
529
+ onSecondary: '#0F0F1A',
530
+ onSuccess: '#FFFFFF',
531
+ onWarning: '#0F0F1A',
532
+ onError: '#FFFFFF',
533
+ onInfo: '#FFFFFF',
528
534
  text: {
529
535
  primary: '#0F0F1A',
530
536
  secondary: '#52525B',
@@ -580,6 +586,12 @@ const darkTheme = exports.darkTheme = {
580
586
  warning: '#FBBF24',
581
587
  error: '#F87171',
582
588
  info: '#60A5FA',
589
+ onPrimary: '#0F0F1A',
590
+ onSecondary: '#FAFAFA',
591
+ onSuccess: '#0F0F1A',
592
+ onWarning: '#0F0F1A',
593
+ onError: '#0F0F1A',
594
+ onInfo: '#0F0F1A',
583
595
  text: {
584
596
  primary: '#FAFAFA',
585
597
  secondary: '#B4B4BB',
@@ -108,7 +108,7 @@ const Accordion = props => {
108
108
  // Skip animation when state matches the previous value (e.g. on mount).
109
109
  if (lastExpandedRef.current === expanded) return;
110
110
  lastExpandedRef.current = expanded;
111
- Animated.parallel([Animated.timing(heightAnim, {
111
+ const anim = Animated.parallel([Animated.timing(heightAnim, {
112
112
  toValue: expanded ? 1 : 0,
113
113
  duration: theme.motion.duration.normal,
114
114
  easing: Easing.bezier(...theme.motion.easing.standard),
@@ -127,7 +127,9 @@ const Accordion = props => {
127
127
  duration: theme.motion.duration.normal,
128
128
  easing: Easing.bezier(...theme.motion.easing.standard),
129
129
  useNativeDriver: false
130
- })]).start();
130
+ })]);
131
+ anim.start();
132
+ return () => anim.stop();
131
133
  }, [expanded, heightAnim, opacityAnim, rotateAnim, theme.motion]);
132
134
  const onContentLayout = useCallback(e => {
133
135
  const h = e.nativeEvent.layout.height;
@@ -208,13 +208,15 @@ const AvatarGroupItem = ({
208
208
  }) => {
209
209
  const opacity = useRef(createAnimatedValue(0)).current;
210
210
  useEffect(() => {
211
- Animated.timing(opacity, {
211
+ const anim = Animated.timing(opacity, {
212
212
  toValue: 1,
213
213
  duration: ENTRANCE_DURATION_MS,
214
214
  delay,
215
215
  easing: Easing.out(Easing.cubic),
216
216
  useNativeDriver: true
217
- }).start();
217
+ });
218
+ anim.start();
219
+ return () => anim.stop();
218
220
  }, [delay, opacity]);
219
221
  return /*#__PURE__*/_jsx(Animated.View, {
220
222
  style: [groupStyles.item, {
@@ -10,22 +10,22 @@ const toneFor = (theme, tone) => {
10
10
  case 'primary':
11
11
  return {
12
12
  background: theme.colors.primary,
13
- text: theme.colors.text.inverse
13
+ text: theme.colors.onPrimary
14
14
  };
15
15
  case 'success':
16
16
  return {
17
17
  background: theme.colors.success,
18
- text: theme.colors.text.inverse
18
+ text: theme.colors.onSuccess
19
19
  };
20
20
  case 'warning':
21
21
  return {
22
22
  background: theme.colors.warning,
23
- text: theme.colors.text.inverse
23
+ text: theme.colors.onWarning
24
24
  };
25
25
  case 'info':
26
26
  return {
27
27
  background: theme.colors.info,
28
- text: theme.colors.text.inverse
28
+ text: theme.colors.onInfo
29
29
  };
30
30
  case 'neutral':
31
31
  return {
@@ -36,7 +36,7 @@ const toneFor = (theme, tone) => {
36
36
  default:
37
37
  return {
38
38
  background: theme.colors.error,
39
- text: theme.colors.text.inverse
39
+ text: theme.colors.onError
40
40
  };
41
41
  }
42
42
  };
@@ -39,9 +39,10 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
39
39
  isFirstRun.current = false;
40
40
  if (!animateMount) return;
41
41
  }
42
+ let anim;
42
43
  if (visible) {
43
44
  setMounted(true);
44
- Animated.parallel([Animated.timing(translateY, {
45
+ anim = Animated.parallel([Animated.timing(translateY, {
45
46
  toValue: 0,
46
47
  duration: theme.motion.duration.normal,
47
48
  useNativeDriver: true
@@ -49,9 +50,10 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
49
50
  toValue: 1,
50
51
  duration: theme.motion.duration.normal,
51
52
  useNativeDriver: true
52
- })]).start();
53
+ })]);
54
+ anim.start();
53
55
  } else if (mounted) {
54
- Animated.parallel([Animated.timing(translateY, {
56
+ anim = Animated.parallel([Animated.timing(translateY, {
55
57
  toValue: -20,
56
58
  duration: theme.motion.duration.fast,
57
59
  useNativeDriver: true
@@ -59,10 +61,12 @@ const Banner = /*#__PURE__*/forwardRef((props, ref) => {
59
61
  toValue: 0,
60
62
  duration: theme.motion.duration.fast,
61
63
  useNativeDriver: true
62
- })]).start(() => {
64
+ })]);
65
+ anim.start(() => {
63
66
  setMounted(false);
64
67
  });
65
68
  }
69
+ return () => anim?.stop();
66
70
  // eslint-disable-next-line react-hooks/exhaustive-deps
67
71
  }, [visible]);
68
72
  if (!mounted) return null;
@@ -46,7 +46,7 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
46
46
  const {
47
47
  tabs,
48
48
  activeTab,
49
- onTabPress,
49
+ onChange,
50
50
  haptic = 'selection',
51
51
  showLabels = true,
52
52
  variant = 'pill',
@@ -95,12 +95,14 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
95
95
  // this value directly.
96
96
  useEffect(() => {
97
97
  if (tabWidth <= 0) return;
98
- Animated.spring(indicatorTranslateX, {
98
+ const anim = Animated.spring(indicatorTranslateX, {
99
99
  toValue: activeIndex * tabWidth,
100
100
  tension: 120,
101
101
  friction: 14,
102
102
  useNativeDriver: true
103
- }).start();
103
+ });
104
+ anim.start();
105
+ return () => anim.stop();
104
106
  }, [activeIndex, tabWidth, indicatorTranslateX]);
105
107
  const handleLayout = e => {
106
108
  const total = e.nativeEvent.layout.width;
@@ -125,7 +127,7 @@ const BottomNavigation = /*#__PURE__*/forwardRef((props, ref) => {
125
127
  useNativeDriver: true
126
128
  })]).start();
127
129
  }
128
- onTabPress(tab.key);
130
+ onChange(tab.key);
129
131
  };
130
132
  const paddingBottom = Math.max(8, insets.bottom);
131
133
  return /*#__PURE__*/_jsx(View, {
@@ -19,14 +19,40 @@
19
19
  * ref.current?.close(); // dismiss
20
20
  */
21
21
 
22
- import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
22
+ import React, { createContext, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
23
23
  import { Dimensions, Keyboard, Modal, Platform, StyleSheet, View } from 'react-native';
24
24
  import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
25
25
  import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
26
26
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
27
27
  import { useTheme } from "../../theme/index.js";
28
28
  import { triggerHaptic } from "../../utils/index.js";
29
+
30
+ /**
31
+ * State + actions exposed to anything rendered inside a `<BottomSheet>` —
32
+ * including the `header` and `footer` slots. Read via `useBottomSheet()`.
33
+ *
34
+ * `snapIndex` is the JS-thread mirror of the current snap point. -1 means the
35
+ * sheet is closed (mid-close-animation included). Use it to drive footer
36
+ * button enable state, conditional headers, etc. If you need per-frame
37
+ * progress (e.g. fade a header in as the sheet expands), reach for the
38
+ * animated value via a future enhancement — not exposed today to keep the
39
+ * surface minimal.
40
+ */
29
41
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
42
+ const BottomSheetContext = /*#__PURE__*/createContext(null);
43
+
44
+ /**
45
+ * Access the enclosing `<BottomSheet>`'s state and imperative actions.
46
+ * Must be called from a component rendered inside a `<BottomSheet>` (as
47
+ * `children`, `header`, or `footer`).
48
+ */
49
+ export const useBottomSheet = () => {
50
+ const ctx = useContext(BottomSheetContext);
51
+ if (!ctx) {
52
+ throw new Error('useBottomSheet must be used inside a <BottomSheet>.');
53
+ }
54
+ return ctx;
55
+ };
30
56
  const SPRING_CONFIG = {
31
57
  damping: 20,
32
58
  stiffness: 240,
@@ -46,6 +72,10 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
46
72
  mode = 'modal',
47
73
  handleIndicatorStyle,
48
74
  containerStyle,
75
+ header,
76
+ footer,
77
+ headerStyle,
78
+ footerStyle,
49
79
  children,
50
80
  accessibilityLabel,
51
81
  accessibilityViewIsModal,
@@ -68,7 +98,6 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
68
98
  return () => sub.remove();
69
99
  }, []);
70
100
  const closedY = screenHeight; // fully off-screen
71
- const minSnapPoint = resolvedSnapPoints[0] ?? 0;
72
101
  const maxSnapPoint = resolvedSnapPoints[resolvedSnapPoints.length - 1] ?? 0;
73
102
 
74
103
  // translateY: 0 = top of screen, screenHeight = fully closed.
@@ -102,6 +131,13 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
102
131
  currentIndexShared.value = next;
103
132
  onChange?.(next);
104
133
  }, [currentIndex, currentIndexShared, onChange]);
134
+ const markAnimationDone = useCallback(() => {
135
+ isAnimatingRef.current = false;
136
+ // If we just finished a close animation, unmount the sheet wrapper.
137
+ if (currentIndexShared.value < 0) {
138
+ if (mode === 'modal') setModalVisible(false);else setInlineMounted(false);
139
+ }
140
+ }, [mode, currentIndexShared]);
105
141
  const animateTo = useCallback((to, fromIndex, toIndex) => {
106
142
  isAnimatingRef.current = true;
107
143
  onAnimate?.(fromIndex, toIndex);
@@ -112,14 +148,7 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
112
148
  runOnJS(markAnimationDone)();
113
149
  }
114
150
  });
115
- }, [onAnimate, translateY]);
116
- const markAnimationDone = useCallback(() => {
117
- isAnimatingRef.current = false;
118
- // If we just finished a close animation, unmount the sheet wrapper.
119
- if (currentIndexShared.value < 0) {
120
- if (mode === 'modal') setModalVisible(false);else setInlineMounted(false);
121
- }
122
- }, [mode, currentIndexShared]);
151
+ }, [onAnimate, translateY, markAnimationDone]);
123
152
  const expand = useCallback(idx => {
124
153
  const target = typeof idx === 'number' ? clamp(idx, 0, resolvedSnapPoints.length - 1) : currentIndex >= 0 ? currentIndex : 0;
125
154
  const fromIndex = currentIndexShared.value;
@@ -331,6 +360,13 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
331
360
  if (!success) return;
332
361
  runOnJS(handleBackdropPress)();
333
362
  }), [handleBackdropPress]);
363
+ const contextValue = useMemo(() => ({
364
+ snapIndex: currentIndex,
365
+ snapPoints: resolvedSnapPoints,
366
+ expand,
367
+ collapse,
368
+ close
369
+ }), [currentIndex, resolvedSnapPoints, expand, collapse, close]);
334
370
 
335
371
  // Don't render the backdrop / sheet tree when the sheet is fully closed.
336
372
  // Inline: gated by `inlineMounted` (set in expand, cleared in
@@ -384,13 +420,23 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
384
420
  backgroundColor: theme.components.bottomSheet?.handleColor ?? theme.colors.border.primary
385
421
  }, handleIndicatorStyle]
386
422
  })
423
+ }), header != null && /*#__PURE__*/_jsx(View, {
424
+ style: [styles.header, headerStyle],
425
+ children: header
387
426
  }), /*#__PURE__*/_jsx(View, {
388
427
  style: styles.content,
389
428
  children: children
429
+ }), footer != null && /*#__PURE__*/_jsx(View, {
430
+ style: [styles.footer, footerStyle],
431
+ children: footer
390
432
  })]
391
433
  })
392
434
  })]
393
435
  });
436
+ const wrappedTree = /*#__PURE__*/_jsx(BottomSheetContext.Provider, {
437
+ value: contextValue,
438
+ children: sheetTree
439
+ });
394
440
  if (mode === 'modal') {
395
441
  return /*#__PURE__*/_jsx(Modal, {
396
442
  transparent: true,
@@ -405,11 +451,11 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
405
451
  supportedOrientations: ['portrait', 'landscape'],
406
452
  children: Platform.OS === 'android' ? /*#__PURE__*/_jsx(GestureHandlerRootView, {
407
453
  style: styles.modalRoot,
408
- children: sheetTree
409
- }) : sheetTree
454
+ children: wrappedTree
455
+ }) : wrappedTree
410
456
  });
411
457
  }
412
- return sheetTree;
458
+ return wrappedTree;
413
459
  });
414
460
  BottomSheet.displayName = 'BottomSheet';
415
461
 
@@ -454,6 +500,15 @@ const buildStyles = _theme => StyleSheet.create({
454
500
  paddingTop: 10,
455
501
  paddingBottom: 8
456
502
  },
503
+ header: {
504
+ // No opinionated padding — slot owns its own styling. Sits between the
505
+ // drag handle and the scrollable content; does not flex.
506
+ },
507
+ footer: {
508
+ // Pinned to the bottom of the sheet (above safe-area inset, which lives
509
+ // on the sheet's paddingBottom). Does not flex, does not scroll with
510
+ // content. Rides with the keyboard via the sheet's `top` animation.
511
+ },
457
512
  handle: {
458
513
  width: 36,
459
514
  height: 4,
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export { BottomSheet, default } from "./BottomSheet.js";
3
+ export { BottomSheet, default, useBottomSheet } from "./BottomSheet.js";
4
4
  //# sourceMappingURL=index.js.map