@webority-technologies/mobile 0.0.22 → 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 (181) 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 +8 -9
  7. package/lib/commonjs/components/Box/Box.js +162 -0
  8. package/lib/commonjs/components/Box/index.js +37 -0
  9. package/lib/commonjs/components/Button/Button.js +7 -7
  10. package/lib/commonjs/components/Carousel/Carousel.js +4 -2
  11. package/lib/commonjs/components/Checkbox/Checkbox.js +14 -5
  12. package/lib/commonjs/components/DatePicker/DatePicker.js +9 -7
  13. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +5 -2
  14. package/lib/commonjs/components/Dialog/Dialog.js +2 -2
  15. package/lib/commonjs/components/FieldBase/FieldBase.js +8 -4
  16. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +13 -5
  17. package/lib/commonjs/components/FormField/FormField.js +61 -25
  18. package/lib/commonjs/components/Input/Input.js +41 -29
  19. package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +102 -0
  20. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +13 -0
  21. package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +130 -0
  22. package/lib/commonjs/components/KeyboardToolbar/index.js +13 -0
  23. package/lib/commonjs/components/Modal/Modal.js +17 -6
  24. package/lib/commonjs/components/NumberInput/NumberInput.js +35 -28
  25. package/lib/commonjs/components/OTPInput/OTPInput.js +33 -18
  26. package/lib/commonjs/components/Radio/Radio.js +7 -5
  27. package/lib/commonjs/components/Radio/RadioGroup.js +10 -3
  28. package/lib/commonjs/components/SearchBar/SearchBar.js +4 -2
  29. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +20 -10
  30. package/lib/commonjs/components/Select/Select.js +33 -32
  31. package/lib/commonjs/components/Skeleton/SkeletonContent.js +5 -2
  32. package/lib/commonjs/components/Slider/Slider.js +42 -26
  33. package/lib/commonjs/components/Spinner/Spinner.js +5 -5
  34. package/lib/commonjs/components/Switch/Switch.js +29 -16
  35. package/lib/commonjs/components/Tabs/Tabs.js +4 -2
  36. package/lib/commonjs/components/Text/Text.js +142 -0
  37. package/lib/commonjs/components/Text/index.js +13 -0
  38. package/lib/commonjs/components/TimePicker/TimePicker.js +10 -7
  39. package/lib/commonjs/components/Toast/Toast.js +22 -10
  40. package/lib/commonjs/components/Tooltip/Tooltip.js +6 -2
  41. package/lib/commonjs/components/index.js +135 -89
  42. package/lib/commonjs/form/FormContext.js +40 -0
  43. package/lib/commonjs/form/index.js +68 -0
  44. package/lib/commonjs/form/path.js +79 -0
  45. package/lib/commonjs/form/rules.js +67 -0
  46. package/lib/commonjs/form/types.js +2 -0
  47. package/lib/commonjs/form/useField.js +54 -0
  48. package/lib/commonjs/form/useForm.js +316 -0
  49. package/lib/commonjs/hooks/index.js +14 -0
  50. package/lib/commonjs/hooks/useControllableState.js +30 -0
  51. package/lib/commonjs/hooks/useReducedMotion.js +31 -0
  52. package/lib/commonjs/index.js +96 -11
  53. package/lib/commonjs/theme/ThemeContext.js +30 -2
  54. package/lib/commonjs/theme/tokens.js +12 -0
  55. package/lib/module/components/Accordion/Accordion.js +4 -2
  56. package/lib/module/components/Avatar/Avatar.js +4 -2
  57. package/lib/module/components/Badge/Badge.js +5 -5
  58. package/lib/module/components/Banner/Banner.js +8 -4
  59. package/lib/module/components/BottomNavigation/BottomNavigation.js +6 -4
  60. package/lib/module/components/BottomSheet/BottomSheet.js +8 -9
  61. package/lib/module/components/Box/Box.js +156 -0
  62. package/lib/module/components/Box/index.js +4 -0
  63. package/lib/module/components/Button/Button.js +7 -7
  64. package/lib/module/components/Carousel/Carousel.js +4 -2
  65. package/lib/module/components/Checkbox/Checkbox.js +14 -5
  66. package/lib/module/components/DatePicker/DatePicker.js +9 -7
  67. package/lib/module/components/DateRangePicker/DateRangePicker.js +5 -2
  68. package/lib/module/components/Dialog/Dialog.js +2 -2
  69. package/lib/module/components/FieldBase/FieldBase.js +8 -4
  70. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +13 -5
  71. package/lib/module/components/FormField/FormField.js +62 -26
  72. package/lib/module/components/Input/Input.js +41 -29
  73. package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +98 -0
  74. package/lib/module/components/KeyboardAwareScrollView/index.js +4 -0
  75. package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +125 -0
  76. package/lib/module/components/KeyboardToolbar/index.js +4 -0
  77. package/lib/module/components/Modal/Modal.js +17 -6
  78. package/lib/module/components/NumberInput/NumberInput.js +30 -23
  79. package/lib/module/components/OTPInput/OTPInput.js +30 -15
  80. package/lib/module/components/Radio/Radio.js +7 -5
  81. package/lib/module/components/Radio/RadioGroup.js +10 -3
  82. package/lib/module/components/SearchBar/SearchBar.js +4 -2
  83. package/lib/module/components/SegmentedControl/SegmentedControl.js +20 -10
  84. package/lib/module/components/Select/Select.js +33 -32
  85. package/lib/module/components/Skeleton/SkeletonContent.js +5 -2
  86. package/lib/module/components/Slider/Slider.js +42 -26
  87. package/lib/module/components/Spinner/Spinner.js +5 -5
  88. package/lib/module/components/Switch/Switch.js +29 -16
  89. package/lib/module/components/Tabs/Tabs.js +4 -2
  90. package/lib/module/components/Text/Text.js +138 -0
  91. package/lib/module/components/Text/index.js +4 -0
  92. package/lib/module/components/TimePicker/TimePicker.js +10 -7
  93. package/lib/module/components/Toast/Toast.js +22 -10
  94. package/lib/module/components/Tooltip/Tooltip.js +6 -2
  95. package/lib/module/components/index.js +4 -0
  96. package/lib/module/form/FormContext.js +32 -0
  97. package/lib/module/form/index.js +12 -0
  98. package/lib/module/form/path.js +72 -0
  99. package/lib/module/form/rules.js +52 -0
  100. package/lib/module/form/types.js +2 -0
  101. package/lib/module/form/useField.js +49 -0
  102. package/lib/module/form/useForm.js +312 -0
  103. package/lib/module/hooks/index.js +2 -0
  104. package/lib/module/hooks/useControllableState.js +26 -0
  105. package/lib/module/hooks/useReducedMotion.js +27 -0
  106. package/lib/module/index.js +3 -1
  107. package/lib/module/theme/ThemeContext.js +30 -2
  108. package/lib/module/theme/tokens.js +12 -0
  109. package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  110. package/lib/typescript/commonjs/components/Box/Box.d.ts +60 -0
  111. package/lib/typescript/commonjs/components/Box/index.d.ts +3 -0
  112. package/lib/typescript/commonjs/components/Button/Button.d.ts +1 -1
  113. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +3 -2
  114. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +3 -3
  115. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +2 -2
  116. package/lib/typescript/commonjs/components/FormField/FormField.d.ts +13 -2
  117. package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
  118. package/lib/typescript/commonjs/components/KeyboardAwareScrollView/index.d.ts +3 -0
  119. package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
  120. package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +3 -0
  121. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -2
  122. package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +3 -2
  123. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +2 -2
  124. package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +3 -2
  125. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -2
  126. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +6 -4
  127. package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +1 -1
  128. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +3 -2
  129. package/lib/typescript/commonjs/components/Text/Text.d.ts +25 -0
  130. package/lib/typescript/commonjs/components/Text/index.d.ts +3 -0
  131. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +3 -3
  132. package/lib/typescript/commonjs/components/index.d.ts +8 -0
  133. package/lib/typescript/commonjs/form/FormContext.d.ts +17 -0
  134. package/lib/typescript/commonjs/form/index.d.ts +9 -0
  135. package/lib/typescript/commonjs/form/path.d.ts +10 -0
  136. package/lib/typescript/commonjs/form/rules.d.ts +31 -0
  137. package/lib/typescript/commonjs/form/types.d.ts +94 -0
  138. package/lib/typescript/commonjs/form/useField.d.ts +27 -0
  139. package/lib/typescript/commonjs/form/useForm.d.ts +10 -0
  140. package/lib/typescript/commonjs/hooks/index.d.ts +3 -0
  141. package/lib/typescript/commonjs/hooks/useControllableState.d.ts +17 -0
  142. package/lib/typescript/commonjs/hooks/useReducedMotion.d.ts +8 -0
  143. package/lib/typescript/commonjs/index.d.ts +4 -2
  144. package/lib/typescript/commonjs/theme/types.d.ts +15 -0
  145. package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  146. package/lib/typescript/module/components/Box/Box.d.ts +60 -0
  147. package/lib/typescript/module/components/Box/index.d.ts +3 -0
  148. package/lib/typescript/module/components/Button/Button.d.ts +1 -1
  149. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +3 -2
  150. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +3 -3
  151. package/lib/typescript/module/components/Dialog/Dialog.d.ts +2 -2
  152. package/lib/typescript/module/components/FormField/FormField.d.ts +13 -2
  153. package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
  154. package/lib/typescript/module/components/KeyboardAwareScrollView/index.d.ts +3 -0
  155. package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
  156. package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +3 -0
  157. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -2
  158. package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +3 -2
  159. package/lib/typescript/module/components/Radio/Radio.d.ts +2 -2
  160. package/lib/typescript/module/components/Radio/RadioGroup.d.ts +3 -2
  161. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -2
  162. package/lib/typescript/module/components/Slider/Slider.d.ts +6 -4
  163. package/lib/typescript/module/components/Spinner/Spinner.d.ts +1 -1
  164. package/lib/typescript/module/components/Switch/Switch.d.ts +3 -2
  165. package/lib/typescript/module/components/Text/Text.d.ts +25 -0
  166. package/lib/typescript/module/components/Text/index.d.ts +3 -0
  167. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +3 -3
  168. package/lib/typescript/module/components/index.d.ts +8 -0
  169. package/lib/typescript/module/form/FormContext.d.ts +17 -0
  170. package/lib/typescript/module/form/index.d.ts +9 -0
  171. package/lib/typescript/module/form/path.d.ts +10 -0
  172. package/lib/typescript/module/form/rules.d.ts +31 -0
  173. package/lib/typescript/module/form/types.d.ts +94 -0
  174. package/lib/typescript/module/form/useField.d.ts +27 -0
  175. package/lib/typescript/module/form/useForm.d.ts +10 -0
  176. package/lib/typescript/module/hooks/index.d.ts +3 -0
  177. package/lib/typescript/module/hooks/useControllableState.d.ts +17 -0
  178. package/lib/typescript/module/hooks/useReducedMotion.d.ts +8 -0
  179. package/lib/typescript/module/index.d.ts +4 -2
  180. package/lib/typescript/module/theme/types.d.ts +15 -0
  181. package/package.json +1 -1
@@ -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, {
@@ -98,7 +98,6 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
98
98
  return () => sub.remove();
99
99
  }, []);
100
100
  const closedY = screenHeight; // fully off-screen
101
- const minSnapPoint = resolvedSnapPoints[0] ?? 0;
102
101
  const maxSnapPoint = resolvedSnapPoints[resolvedSnapPoints.length - 1] ?? 0;
103
102
 
104
103
  // translateY: 0 = top of screen, screenHeight = fully closed.
@@ -132,6 +131,13 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
132
131
  currentIndexShared.value = next;
133
132
  onChange?.(next);
134
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]);
135
141
  const animateTo = useCallback((to, fromIndex, toIndex) => {
136
142
  isAnimatingRef.current = true;
137
143
  onAnimate?.(fromIndex, toIndex);
@@ -142,14 +148,7 @@ const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
142
148
  runOnJS(markAnimationDone)();
143
149
  }
144
150
  });
145
- }, [onAnimate, translateY]);
146
- const markAnimationDone = useCallback(() => {
147
- isAnimatingRef.current = false;
148
- // If we just finished a close animation, unmount the sheet wrapper.
149
- if (currentIndexShared.value < 0) {
150
- if (mode === 'modal') setModalVisible(false);else setInlineMounted(false);
151
- }
152
- }, [mode, currentIndexShared]);
151
+ }, [onAnimate, translateY, markAnimationDone]);
153
152
  const expand = useCallback(idx => {
154
153
  const target = typeof idx === 'number' ? clamp(idx, 0, resolvedSnapPoints.length - 1) : currentIndex >= 0 ? currentIndex : 0;
155
154
  const fromIndex = currentIndexShared.value;
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+
3
+ import React, { forwardRef } from 'react';
4
+ import { View } from 'react-native';
5
+ import { useTheme } from "../../theme/index.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const space = (theme, token) => token == null ? undefined : theme.spacing[token];
8
+ export const resolveBoxStyle = (theme, p) => {
9
+ const style = {};
10
+ if (p.p != null) style.padding = space(theme, p.p);
11
+ if (p.px != null) style.paddingHorizontal = space(theme, p.px);
12
+ if (p.py != null) style.paddingVertical = space(theme, p.py);
13
+ if (p.pt != null) style.paddingTop = space(theme, p.pt);
14
+ if (p.pr != null) style.paddingRight = space(theme, p.pr);
15
+ if (p.pb != null) style.paddingBottom = space(theme, p.pb);
16
+ if (p.pl != null) style.paddingLeft = space(theme, p.pl);
17
+ if (p.m != null) style.margin = space(theme, p.m);
18
+ if (p.mx != null) style.marginHorizontal = space(theme, p.mx);
19
+ if (p.my != null) style.marginVertical = space(theme, p.my);
20
+ if (p.mt != null) style.marginTop = space(theme, p.mt);
21
+ if (p.mr != null) style.marginRight = space(theme, p.mr);
22
+ if (p.mb != null) style.marginBottom = space(theme, p.mb);
23
+ if (p.ml != null) style.marginLeft = space(theme, p.ml);
24
+ if (p.gap != null) style.gap = space(theme, p.gap);
25
+ if (p.bg != null) {
26
+ const bgTokens = theme.colors.background;
27
+ style.backgroundColor = bgTokens[p.bg] ?? p.bg;
28
+ }
29
+ if (p.radius != null) style.borderRadius = theme.radius[p.radius];
30
+ if (p.border) {
31
+ style.borderWidth = theme.colors.border.width;
32
+ style.borderColor = theme.colors.border.primary;
33
+ }
34
+ if (p.flex != null) style.flex = p.flex;
35
+ if (p.align != null) style.alignItems = p.align;
36
+ if (p.justify != null) style.justifyContent = p.justify;
37
+ if (p.direction != null) style.flexDirection = p.direction;
38
+ if (p.wrap) style.flexWrap = 'wrap';
39
+ return style;
40
+ };
41
+ const Box = /*#__PURE__*/forwardRef((props, ref) => {
42
+ const theme = useTheme();
43
+ const {
44
+ // layout props consumed by the resolver — kept out of the View spread
45
+ p,
46
+ px,
47
+ py,
48
+ pt,
49
+ pr,
50
+ pb,
51
+ pl,
52
+ m,
53
+ mx,
54
+ my,
55
+ mt,
56
+ mr,
57
+ mb,
58
+ ml,
59
+ gap,
60
+ bg,
61
+ radius,
62
+ border,
63
+ flex,
64
+ align,
65
+ justify,
66
+ direction,
67
+ wrap,
68
+ style,
69
+ children,
70
+ ...viewProps
71
+ } = props;
72
+ const boxStyle = resolveBoxStyle(theme, {
73
+ p,
74
+ px,
75
+ py,
76
+ pt,
77
+ pr,
78
+ pb,
79
+ pl,
80
+ m,
81
+ mx,
82
+ my,
83
+ mt,
84
+ mr,
85
+ mb,
86
+ ml,
87
+ gap,
88
+ bg,
89
+ radius,
90
+ border,
91
+ flex,
92
+ align,
93
+ justify,
94
+ direction,
95
+ wrap
96
+ });
97
+ return /*#__PURE__*/_jsx(View, {
98
+ ref: ref,
99
+ style: [boxStyle, style],
100
+ ...viewProps,
101
+ children: children
102
+ });
103
+ });
104
+ Box.displayName = 'Box';
105
+ /** Vertical flex container with token spacing between children (default gap `md`). */
106
+ const Stack = /*#__PURE__*/forwardRef(({
107
+ gap = 'md',
108
+ ...rest
109
+ }, ref) => /*#__PURE__*/_jsx(Box, {
110
+ ref: ref,
111
+ direction: "column",
112
+ gap: gap,
113
+ ...rest
114
+ }));
115
+ Stack.displayName = 'Stack';
116
+ /** Horizontal flex container (default `align="center"`, gap `sm`). */
117
+ const Row = /*#__PURE__*/forwardRef(({
118
+ gap = 'sm',
119
+ align = 'center',
120
+ ...rest
121
+ }, ref) => /*#__PURE__*/_jsx(Box, {
122
+ ref: ref,
123
+ direction: "row",
124
+ gap: gap,
125
+ align: align,
126
+ ...rest
127
+ }));
128
+ Row.displayName = 'Row';
129
+ /** Fixed gap (`size`) or a flexible push (`flex: 1`) between siblings. */
130
+ const Spacer = ({
131
+ size,
132
+ style,
133
+ testID
134
+ }) => {
135
+ const theme = useTheme();
136
+ if (size != null) {
137
+ const value = theme.spacing[size];
138
+ return /*#__PURE__*/_jsx(View, {
139
+ testID: testID,
140
+ style: [{
141
+ width: value,
142
+ height: value
143
+ }, style]
144
+ });
145
+ }
146
+ return /*#__PURE__*/_jsx(View, {
147
+ testID: testID,
148
+ style: [{
149
+ flex: 1
150
+ }, style]
151
+ });
152
+ };
153
+ Spacer.displayName = 'Spacer';
154
+ export { Box, Stack, Row, Spacer };
155
+ export default Box;
156
+ //# sourceMappingURL=Box.js.map
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { Box, Stack, Row, Spacer, resolveBoxStyle } from "./Box.js";
4
+ //# sourceMappingURL=index.js.map
@@ -67,7 +67,7 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
67
67
  style: styles.contentRow,
68
68
  children: loading ? /*#__PURE__*/_jsx(Spinner, {
69
69
  variant: "circular",
70
- size: "small",
70
+ size: "sm",
71
71
  color: variantStyles.textColor,
72
72
  accessibilityLabel: "Loading"
73
73
  }) : /*#__PURE__*/_jsxs(_Fragment, {
@@ -184,7 +184,7 @@ const toneFor = (theme, tone) => {
184
184
  base: theme.colors.primary,
185
185
  hover: theme.colors.primaryHover,
186
186
  pressed: theme.colors.primaryPressed,
187
- on: theme.colors.text.inverse,
187
+ on: theme.colors.onPrimary,
188
188
  muted: theme.colors.primaryMuted
189
189
  };
190
190
  case 'secondary':
@@ -192,7 +192,7 @@ const toneFor = (theme, tone) => {
192
192
  base: theme.colors.secondary,
193
193
  hover: theme.colors.secondaryHover,
194
194
  pressed: theme.colors.secondaryHover,
195
- on: theme.colors.text.primary,
195
+ on: theme.colors.onSecondary,
196
196
  muted: theme.colors.secondary
197
197
  };
198
198
  case 'success':
@@ -200,7 +200,7 @@ const toneFor = (theme, tone) => {
200
200
  base: theme.colors.success,
201
201
  hover: theme.colors.success,
202
202
  pressed: theme.colors.success,
203
- on: theme.colors.text.inverse,
203
+ on: theme.colors.onSuccess,
204
204
  muted: theme.colors.background.secondary
205
205
  };
206
206
  case 'warning':
@@ -208,15 +208,15 @@ const toneFor = (theme, tone) => {
208
208
  base: theme.colors.warning,
209
209
  hover: theme.colors.warning,
210
210
  pressed: theme.colors.warning,
211
- on: theme.colors.text.inverse,
211
+ on: theme.colors.onWarning,
212
212
  muted: theme.colors.background.secondary
213
213
  };
214
- case 'danger':
214
+ case 'error':
215
215
  return {
216
216
  base: theme.colors.error,
217
217
  hover: theme.colors.error,
218
218
  pressed: theme.colors.error,
219
- on: theme.colors.text.inverse,
219
+ on: theme.colors.onError,
220
220
  muted: theme.colors.background.secondary
221
221
  };
222
222
  case 'neutral':