@webority-technologies/mobile 0.0.22 → 0.0.24

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 (249) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +9 -7
  2. package/lib/commonjs/components/AnimatePresence/AnimatePresence.js +69 -0
  3. package/lib/commonjs/components/AnimatePresence/index.js +13 -0
  4. package/lib/commonjs/components/AppBar/AppBar.js +9 -6
  5. package/lib/commonjs/components/Avatar/Avatar.js +4 -2
  6. package/lib/commonjs/components/Badge/Badge.js +5 -5
  7. package/lib/commonjs/components/Banner/Banner.js +20 -6
  8. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +6 -4
  9. package/lib/commonjs/components/BottomSheet/BottomSheet.js +8 -9
  10. package/lib/commonjs/components/Box/Box.js +162 -0
  11. package/lib/commonjs/components/Box/index.js +37 -0
  12. package/lib/commonjs/components/Button/Button.js +7 -7
  13. package/lib/commonjs/components/Card/Card.js +3 -3
  14. package/lib/commonjs/components/Carousel/Carousel.js +4 -2
  15. package/lib/commonjs/components/Checkbox/Checkbox.js +17 -7
  16. package/lib/commonjs/components/Chip/Chip.js +4 -2
  17. package/lib/commonjs/components/DatePicker/DatePicker.js +31 -24
  18. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +16 -11
  19. package/lib/commonjs/components/Dialog/Dialog.js +6 -4
  20. package/lib/commonjs/components/Drawer/Drawer.js +4 -2
  21. package/lib/commonjs/components/FieldBase/FieldBase.js +8 -4
  22. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +23 -13
  23. package/lib/commonjs/components/FormField/FormField.js +61 -25
  24. package/lib/commonjs/components/ImageGallery/ImageGallery.js +17 -15
  25. package/lib/commonjs/components/Input/Input.js +41 -29
  26. package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +102 -0
  27. package/lib/commonjs/components/KeyboardAwareScrollView/index.js +13 -0
  28. package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +130 -0
  29. package/lib/commonjs/components/KeyboardToolbar/index.js +13 -0
  30. package/lib/commonjs/components/ListItem/ListItem.js +4 -3
  31. package/lib/commonjs/components/Modal/Modal.js +21 -9
  32. package/lib/commonjs/components/NumberInput/NumberInput.js +38 -29
  33. package/lib/commonjs/components/OTPInput/OTPInput.js +37 -22
  34. package/lib/commonjs/components/Radio/Radio.js +9 -8
  35. package/lib/commonjs/components/Radio/RadioGroup.js +10 -3
  36. package/lib/commonjs/components/Rating/Rating.js +4 -3
  37. package/lib/commonjs/components/SearchBar/SearchBar.js +11 -6
  38. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +23 -12
  39. package/lib/commonjs/components/Select/Select.js +40 -36
  40. package/lib/commonjs/components/Skeleton/SkeletonContent.js +5 -2
  41. package/lib/commonjs/components/Slider/Slider.js +241 -225
  42. package/lib/commonjs/components/Spinner/Spinner.js +5 -5
  43. package/lib/commonjs/components/Stepper/Stepper.js +6 -5
  44. package/lib/commonjs/components/Swipeable/Swipeable.js +8 -9
  45. package/lib/commonjs/components/Switch/Switch.js +29 -16
  46. package/lib/commonjs/components/Tabs/Tabs.js +8 -5
  47. package/lib/commonjs/components/Text/Text.js +142 -0
  48. package/lib/commonjs/components/Text/index.js +13 -0
  49. package/lib/commonjs/components/TimePicker/TimePicker.js +23 -15
  50. package/lib/commonjs/components/Toast/Toast.js +22 -10
  51. package/lib/commonjs/components/Tooltip/Tooltip.js +6 -2
  52. package/lib/commonjs/components/index.js +156 -103
  53. package/lib/commonjs/form/FormContext.js +40 -0
  54. package/lib/commonjs/form/index.js +68 -0
  55. package/lib/commonjs/form/path.js +79 -0
  56. package/lib/commonjs/form/rules.js +67 -0
  57. package/lib/commonjs/form/types.js +2 -0
  58. package/lib/commonjs/form/useField.js +54 -0
  59. package/lib/commonjs/form/useForm.js +316 -0
  60. package/lib/commonjs/hooks/index.js +14 -0
  61. package/lib/commonjs/hooks/useControllableState.js +30 -0
  62. package/lib/commonjs/hooks/useReducedMotion.js +31 -0
  63. package/lib/commonjs/index.js +96 -11
  64. package/lib/commonjs/theme/ThemeContext.js +30 -2
  65. package/lib/commonjs/theme/tokens.js +12 -0
  66. package/lib/commonjs/utils/hapticUtils.js +11 -1
  67. package/lib/commonjs/utils/index.js +6 -0
  68. package/lib/module/components/Accordion/Accordion.js +10 -8
  69. package/lib/module/components/AnimatePresence/AnimatePresence.js +63 -0
  70. package/lib/module/components/AnimatePresence/index.js +4 -0
  71. package/lib/module/components/AppBar/AppBar.js +10 -7
  72. package/lib/module/components/Avatar/Avatar.js +4 -2
  73. package/lib/module/components/Badge/Badge.js +5 -5
  74. package/lib/module/components/Banner/Banner.js +20 -6
  75. package/lib/module/components/BottomNavigation/BottomNavigation.js +6 -4
  76. package/lib/module/components/BottomSheet/BottomSheet.js +8 -9
  77. package/lib/module/components/Box/Box.js +156 -0
  78. package/lib/module/components/Box/index.js +4 -0
  79. package/lib/module/components/Button/Button.js +7 -7
  80. package/lib/module/components/Card/Card.js +4 -4
  81. package/lib/module/components/Carousel/Carousel.js +4 -2
  82. package/lib/module/components/Checkbox/Checkbox.js +18 -8
  83. package/lib/module/components/Chip/Chip.js +5 -3
  84. package/lib/module/components/DatePicker/DatePicker.js +32 -25
  85. package/lib/module/components/DateRangePicker/DateRangePicker.js +17 -12
  86. package/lib/module/components/Dialog/Dialog.js +7 -5
  87. package/lib/module/components/Drawer/Drawer.js +5 -3
  88. package/lib/module/components/FieldBase/FieldBase.js +8 -4
  89. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +24 -14
  90. package/lib/module/components/FormField/FormField.js +62 -26
  91. package/lib/module/components/ImageGallery/ImageGallery.js +18 -16
  92. package/lib/module/components/Input/Input.js +41 -29
  93. package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +98 -0
  94. package/lib/module/components/KeyboardAwareScrollView/index.js +4 -0
  95. package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +125 -0
  96. package/lib/module/components/KeyboardToolbar/index.js +4 -0
  97. package/lib/module/components/ListItem/ListItem.js +5 -4
  98. package/lib/module/components/Modal/Modal.js +22 -10
  99. package/lib/module/components/NumberInput/NumberInput.js +36 -27
  100. package/lib/module/components/OTPInput/OTPInput.js +37 -22
  101. package/lib/module/components/Radio/Radio.js +10 -9
  102. package/lib/module/components/Radio/RadioGroup.js +10 -3
  103. package/lib/module/components/Rating/Rating.js +5 -4
  104. package/lib/module/components/SearchBar/SearchBar.js +12 -7
  105. package/lib/module/components/SegmentedControl/SegmentedControl.js +24 -13
  106. package/lib/module/components/Select/Select.js +41 -37
  107. package/lib/module/components/Skeleton/SkeletonContent.js +5 -2
  108. package/lib/module/components/Slider/Slider.js +244 -228
  109. package/lib/module/components/Spinner/Spinner.js +5 -5
  110. package/lib/module/components/Stepper/Stepper.js +7 -6
  111. package/lib/module/components/Swipeable/Swipeable.js +9 -10
  112. package/lib/module/components/Switch/Switch.js +29 -16
  113. package/lib/module/components/Tabs/Tabs.js +9 -6
  114. package/lib/module/components/Text/Text.js +138 -0
  115. package/lib/module/components/Text/index.js +4 -0
  116. package/lib/module/components/TimePicker/TimePicker.js +24 -16
  117. package/lib/module/components/Toast/Toast.js +22 -10
  118. package/lib/module/components/Tooltip/Tooltip.js +6 -2
  119. package/lib/module/components/index.js +5 -0
  120. package/lib/module/form/FormContext.js +32 -0
  121. package/lib/module/form/index.js +12 -0
  122. package/lib/module/form/path.js +72 -0
  123. package/lib/module/form/rules.js +52 -0
  124. package/lib/module/form/types.js +2 -0
  125. package/lib/module/form/useField.js +49 -0
  126. package/lib/module/form/useForm.js +312 -0
  127. package/lib/module/hooks/index.js +2 -0
  128. package/lib/module/hooks/useControllableState.js +26 -0
  129. package/lib/module/hooks/useReducedMotion.js +27 -0
  130. package/lib/module/index.js +3 -1
  131. package/lib/module/theme/ThemeContext.js +30 -2
  132. package/lib/module/theme/tokens.js +12 -0
  133. package/lib/module/utils/hapticUtils.js +9 -0
  134. package/lib/module/utils/index.js +1 -1
  135. package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +3 -0
  136. package/lib/typescript/commonjs/components/AnimatePresence/AnimatePresence.d.ts +30 -0
  137. package/lib/typescript/commonjs/components/AnimatePresence/index.d.ts +3 -0
  138. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +6 -0
  139. package/lib/typescript/commonjs/components/Banner/Banner.d.ts +3 -0
  140. package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  141. package/lib/typescript/commonjs/components/Box/Box.d.ts +60 -0
  142. package/lib/typescript/commonjs/components/Box/index.d.ts +3 -0
  143. package/lib/typescript/commonjs/components/Button/Button.d.ts +1 -1
  144. package/lib/typescript/commonjs/components/Card/Card.d.ts +3 -0
  145. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +4 -2
  146. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +3 -0
  147. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +6 -3
  148. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +6 -0
  149. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +5 -2
  150. package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +3 -0
  151. package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +5 -0
  152. package/lib/typescript/commonjs/components/FormField/FormField.d.ts +13 -2
  153. package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +6 -0
  154. package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
  155. package/lib/typescript/commonjs/components/KeyboardAwareScrollView/index.d.ts +3 -0
  156. package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
  157. package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +3 -0
  158. package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +3 -0
  159. package/lib/typescript/commonjs/components/Modal/Modal.d.ts +6 -0
  160. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +6 -2
  161. package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +9 -2
  162. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +2 -2
  163. package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +3 -2
  164. package/lib/typescript/commonjs/components/Rating/Rating.d.ts +6 -0
  165. package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +3 -0
  166. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +6 -2
  167. package/lib/typescript/commonjs/components/Select/Select.d.ts +6 -0
  168. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +9 -4
  169. package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +1 -1
  170. package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +6 -0
  171. package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +3 -0
  172. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +3 -2
  173. package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +3 -0
  174. package/lib/typescript/commonjs/components/Text/Text.d.ts +25 -0
  175. package/lib/typescript/commonjs/components/Text/index.d.ts +3 -0
  176. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +6 -3
  177. package/lib/typescript/commonjs/components/index.d.ts +10 -0
  178. package/lib/typescript/commonjs/form/FormContext.d.ts +17 -0
  179. package/lib/typescript/commonjs/form/index.d.ts +9 -0
  180. package/lib/typescript/commonjs/form/path.d.ts +10 -0
  181. package/lib/typescript/commonjs/form/rules.d.ts +31 -0
  182. package/lib/typescript/commonjs/form/types.d.ts +94 -0
  183. package/lib/typescript/commonjs/form/useField.d.ts +27 -0
  184. package/lib/typescript/commonjs/form/useForm.d.ts +10 -0
  185. package/lib/typescript/commonjs/hooks/index.d.ts +3 -0
  186. package/lib/typescript/commonjs/hooks/useControllableState.d.ts +17 -0
  187. package/lib/typescript/commonjs/hooks/useReducedMotion.d.ts +8 -0
  188. package/lib/typescript/commonjs/index.d.ts +4 -2
  189. package/lib/typescript/commonjs/theme/types.d.ts +17 -67
  190. package/lib/typescript/commonjs/utils/hapticUtils.d.ts +8 -0
  191. package/lib/typescript/commonjs/utils/index.d.ts +1 -1
  192. package/lib/typescript/module/components/Accordion/Accordion.d.ts +3 -0
  193. package/lib/typescript/module/components/AnimatePresence/AnimatePresence.d.ts +30 -0
  194. package/lib/typescript/module/components/AnimatePresence/index.d.ts +3 -0
  195. package/lib/typescript/module/components/AppBar/AppBar.d.ts +6 -0
  196. package/lib/typescript/module/components/Banner/Banner.d.ts +3 -0
  197. package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +1 -1
  198. package/lib/typescript/module/components/Box/Box.d.ts +60 -0
  199. package/lib/typescript/module/components/Box/index.d.ts +3 -0
  200. package/lib/typescript/module/components/Button/Button.d.ts +1 -1
  201. package/lib/typescript/module/components/Card/Card.d.ts +3 -0
  202. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +4 -2
  203. package/lib/typescript/module/components/Chip/Chip.d.ts +3 -0
  204. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +6 -3
  205. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +6 -0
  206. package/lib/typescript/module/components/Dialog/Dialog.d.ts +5 -2
  207. package/lib/typescript/module/components/Drawer/Drawer.d.ts +3 -0
  208. package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +5 -0
  209. package/lib/typescript/module/components/FormField/FormField.d.ts +13 -2
  210. package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +6 -0
  211. package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
  212. package/lib/typescript/module/components/KeyboardAwareScrollView/index.d.ts +3 -0
  213. package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
  214. package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +3 -0
  215. package/lib/typescript/module/components/ListItem/ListItem.d.ts +3 -0
  216. package/lib/typescript/module/components/Modal/Modal.d.ts +6 -0
  217. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +6 -2
  218. package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +9 -2
  219. package/lib/typescript/module/components/Radio/Radio.d.ts +2 -2
  220. package/lib/typescript/module/components/Radio/RadioGroup.d.ts +3 -2
  221. package/lib/typescript/module/components/Rating/Rating.d.ts +6 -0
  222. package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +3 -0
  223. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +6 -2
  224. package/lib/typescript/module/components/Select/Select.d.ts +6 -0
  225. package/lib/typescript/module/components/Slider/Slider.d.ts +9 -4
  226. package/lib/typescript/module/components/Spinner/Spinner.d.ts +1 -1
  227. package/lib/typescript/module/components/Stepper/Stepper.d.ts +6 -0
  228. package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +3 -0
  229. package/lib/typescript/module/components/Switch/Switch.d.ts +3 -2
  230. package/lib/typescript/module/components/Tabs/Tabs.d.ts +3 -0
  231. package/lib/typescript/module/components/Text/Text.d.ts +25 -0
  232. package/lib/typescript/module/components/Text/index.d.ts +3 -0
  233. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +6 -3
  234. package/lib/typescript/module/components/index.d.ts +10 -0
  235. package/lib/typescript/module/form/FormContext.d.ts +17 -0
  236. package/lib/typescript/module/form/index.d.ts +9 -0
  237. package/lib/typescript/module/form/path.d.ts +10 -0
  238. package/lib/typescript/module/form/rules.d.ts +31 -0
  239. package/lib/typescript/module/form/types.d.ts +94 -0
  240. package/lib/typescript/module/form/useField.d.ts +27 -0
  241. package/lib/typescript/module/form/useForm.d.ts +10 -0
  242. package/lib/typescript/module/hooks/index.d.ts +3 -0
  243. package/lib/typescript/module/hooks/useControllableState.d.ts +17 -0
  244. package/lib/typescript/module/hooks/useReducedMotion.d.ts +8 -0
  245. package/lib/typescript/module/index.d.ts +4 -2
  246. package/lib/typescript/module/theme/types.d.ts +17 -67
  247. package/lib/typescript/module/utils/hapticUtils.d.ts +8 -0
  248. package/lib/typescript/module/utils/index.d.ts +1 -1
  249. package/package.json +1 -1
@@ -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 _index3 = require("../../hooks/index.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
  /**
@@ -34,12 +35,14 @@ const TRACK_PADDING = 2;
34
35
  const SegmentedControl = exports.SegmentedControl = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
35
36
  const {
36
37
  segments,
37
- value,
38
+ value: valueProp,
39
+ defaultValue,
38
40
  onChange,
39
41
  size = 'md',
40
42
  fullWidth = true,
41
43
  disabled = false,
42
44
  tone = 'primary',
45
+ haptic,
43
46
  accessibilityLabel,
44
47
  style,
45
48
  containerStyle,
@@ -49,6 +52,11 @@ const SegmentedControl = exports.SegmentedControl = /*#__PURE__*/(0, _react.forw
49
52
  labelStyle,
50
53
  testID
51
54
  } = props;
55
+ const [current, setCurrent] = (0, _index3.useControllableState)({
56
+ value: valueProp,
57
+ defaultValue: defaultValue ?? segments[0]?.value,
58
+ onChange
59
+ });
52
60
  const theme = (0, _index.useTheme)();
53
61
  const segTheme = theme.components.segmentedControl;
54
62
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
@@ -59,7 +67,6 @@ const SegmentedControl = exports.SegmentedControl = /*#__PURE__*/(0, _react.forw
59
67
  paddingHorizontal: segTheme?.[size]?.paddingHorizontal ?? baseSize.paddingHorizontal
60
68
  };
61
69
  const trackPadding = segTheme?.trackPadding ?? TRACK_PADDING;
62
- const changeHapticEnabled = segTheme?.changeHaptic ?? false;
63
70
 
64
71
  // Track width is measured from onLayout. Thumb width is a regular number (not
65
72
  // animated) — `width` cannot be driven by the native animated module, and mixing
@@ -69,23 +76,26 @@ const SegmentedControl = exports.SegmentedControl = /*#__PURE__*/(0, _react.forw
69
76
  // only animate translateX via the native driver.
70
77
  const [trackWidth, setTrackWidth] = (0, _react.useState)(0);
71
78
  const thumbTranslateX = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
72
- const activeIndex = Math.max(0, segments.findIndex(s => s.value === value));
79
+ const activeIndex = Math.max(0, segments.findIndex(s => s.value === current));
73
80
  const segmentWidth = trackWidth > 0 ? (trackWidth - trackPadding * 2) / Math.max(segments.length, 1) : 0;
74
81
  const animateThumb = (0, _react.useCallback)((index, segWidth) => {
75
- if (segWidth <= 0) return;
82
+ if (segWidth <= 0) return undefined;
76
83
  const targetX = trackPadding + segWidth * index;
77
84
  const spring = theme.motion.spring.snappy;
78
- _reactNative.Animated.spring(thumbTranslateX, {
85
+ const anim = _reactNative.Animated.spring(thumbTranslateX, {
79
86
  toValue: targetX,
80
87
  damping: spring.damping,
81
88
  stiffness: spring.stiffness,
82
89
  mass: spring.mass,
83
90
  useNativeDriver: true
84
- }).start();
91
+ });
92
+ anim.start();
93
+ return anim;
85
94
  }, [theme.motion.spring.snappy, thumbTranslateX]);
86
95
  (0, _react.useEffect)(() => {
87
96
  if (segmentWidth > 0) {
88
- animateThumb(activeIndex, segmentWidth);
97
+ const anim = animateThumb(activeIndex, segmentWidth);
98
+ return () => anim?.stop();
89
99
  }
90
100
  }, [activeIndex, segmentWidth, animateThumb]);
91
101
  const handleTrackLayout = (0, _react.useCallback)(e => {
@@ -96,10 +106,11 @@ const SegmentedControl = exports.SegmentedControl = /*#__PURE__*/(0, _react.forw
96
106
  }, [trackWidth]);
97
107
  const handlePress = (0, _react.useCallback)(segment => {
98
108
  if (disabled) return;
99
- if (segment.value === value) return;
100
- if (changeHapticEnabled) (0, _index2.triggerHaptic)('selection');
101
- onChange(segment.value);
102
- }, [disabled, onChange, value, changeHapticEnabled]);
109
+ if (segment.value === current) return;
110
+ const h = (0, _index2.resolveHaptic)(haptic, 'selection');
111
+ if (h) (0, _index2.triggerHaptic)(h);
112
+ setCurrent(segment.value);
113
+ }, [disabled, setCurrent, current, haptic]);
103
114
  const thumbBg = tone === 'primary' ? theme.colors.background.elevated : theme.colors.background.elevated;
104
115
  const activeTextColor = tone === 'primary' ? theme.colors.text.primary : theme.colors.text.primary;
105
116
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
@@ -130,7 +141,7 @@ const SegmentedControl = exports.SegmentedControl = /*#__PURE__*/(0, _react.forw
130
141
  ...theme.shadows.sm
131
142
  }, selectedIndicatorStyle]
132
143
  }) : null, segments.map(segment => {
133
- const isActive = segment.value === value;
144
+ const isActive = segment.value === current;
134
145
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
135
146
  onPress: () => handlePress(segment),
136
147
  disabled: disabled,
@@ -32,6 +32,7 @@ const Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
32
32
  getOptionDescription,
33
33
  placeholder,
34
34
  searchable = false,
35
+ haptic,
35
36
  label,
36
37
  error,
37
38
  disabled = false,
@@ -66,34 +67,32 @@ const Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
66
67
  const backdropAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
67
68
  const sheetAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(sheetMaxHeight)).current;
68
69
  (0, _react.useEffect)(() => {
69
- if (open) {
70
- _reactNative.Animated.parallel([
71
- // Backdrop opacity uses JS driver — see Modal.tsx for the Fabric reason.
72
- _reactNative.Animated.timing(backdropAnim, {
73
- toValue: 1,
74
- duration: theme.motion.duration.fast,
75
- easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
76
- useNativeDriver: false
77
- }), _reactNative.Animated.spring(sheetAnim, {
78
- toValue: 0,
79
- damping: theme.motion.spring.snappy.damping,
80
- stiffness: theme.motion.spring.snappy.stiffness,
81
- mass: theme.motion.spring.snappy.mass,
82
- useNativeDriver: true
83
- })]).start();
84
- } else {
85
- _reactNative.Animated.parallel([_reactNative.Animated.timing(backdropAnim, {
86
- toValue: 0,
87
- duration: theme.motion.duration.fast,
88
- easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
89
- useNativeDriver: false
90
- }), _reactNative.Animated.timing(sheetAnim, {
91
- toValue: sheetMaxHeight,
92
- duration: theme.motion.duration.fast,
93
- easing: _reactNative.Easing.bezier(...theme.motion.easing.accelerate),
94
- useNativeDriver: true
95
- })]).start();
96
- }
70
+ const anim = open ? _reactNative.Animated.parallel([
71
+ // Backdrop opacity uses JS driver — see Modal.tsx for the Fabric reason.
72
+ _reactNative.Animated.timing(backdropAnim, {
73
+ toValue: 1,
74
+ duration: theme.motion.duration.fast,
75
+ easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
76
+ useNativeDriver: false
77
+ }), _reactNative.Animated.spring(sheetAnim, {
78
+ toValue: 0,
79
+ damping: theme.motion.spring.snappy.damping,
80
+ stiffness: theme.motion.spring.snappy.stiffness,
81
+ mass: theme.motion.spring.snappy.mass,
82
+ useNativeDriver: true
83
+ })]) : _reactNative.Animated.parallel([_reactNative.Animated.timing(backdropAnim, {
84
+ toValue: 0,
85
+ duration: theme.motion.duration.fast,
86
+ easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
87
+ useNativeDriver: false
88
+ }), _reactNative.Animated.timing(sheetAnim, {
89
+ toValue: sheetMaxHeight,
90
+ duration: theme.motion.duration.fast,
91
+ easing: _reactNative.Easing.bezier(...theme.motion.easing.accelerate),
92
+ useNativeDriver: true
93
+ })]);
94
+ anim.start();
95
+ return () => anim.stop();
97
96
  }, [open, backdropAnim, sheetAnim, sheetMaxHeight, theme.motion.duration.fast, theme.motion.easing.standard, theme.motion.easing.accelerate, theme.motion.spring.snappy]);
98
97
 
99
98
  // Selection helpers — typed to keep callbacks fully type-safe.
@@ -121,9 +120,10 @@ const Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
121
120
  }, [searchable, query, options, labelOf, descriptionOf]);
122
121
  const handleOpen = (0, _react.useCallback)(() => {
123
122
  if (disabled) return;
124
- (0, _index2.triggerHaptic)('selection');
123
+ const h = (0, _index2.resolveHaptic)(haptic, 'selection');
124
+ if (h) (0, _index2.triggerHaptic)(h);
125
125
  setOpen(true);
126
- }, [disabled]);
126
+ }, [disabled, haptic]);
127
127
  const handleClose = (0, _react.useCallback)(() => {
128
128
  setOpen(false);
129
129
  setQuery('');
@@ -131,7 +131,8 @@ const Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
131
131
  const handleSelect = (0, _react.useCallback)(option => {
132
132
  if (disabledOf(option)) return;
133
133
  const optValue = valueOf(option);
134
- (0, _index2.triggerHaptic)('selection');
134
+ const h = (0, _index2.resolveHaptic)(haptic, 'selection');
135
+ if (h) (0, _index2.triggerHaptic)(h);
135
136
  if (multi) {
136
137
  const current = props.value ?? [];
137
138
  const next = current.includes(optValue) ? current.filter(v => v !== optValue) : [...current, optValue];
@@ -140,7 +141,7 @@ const Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
140
141
  }
141
142
  props.onChange(optValue);
142
143
  handleClose();
143
- }, [multi, props, handleClose, disabledOf, valueOf]);
144
+ }, [multi, props, handleClose, disabledOf, valueOf, haptic]);
144
145
 
145
146
  // Trigger label / placeholder text.
146
147
  const triggerText = selectedOptions.length === 0 ? placeholder ?? 'Select…' : selectedOptions.map(o => labelOf(o)).join(', ');
@@ -391,14 +392,17 @@ const Chevron = ({
391
392
  size,
392
393
  open
393
394
  }) => {
395
+ const theme = (0, _index.useTheme)();
394
396
  const rotate = (0, _react.useRef)((0, _index.createAnimatedValue)(open ? 1 : 0)).current;
395
397
  (0, _react.useEffect)(() => {
396
- _reactNative.Animated.timing(rotate, {
398
+ const anim = _reactNative.Animated.timing(rotate, {
397
399
  toValue: open ? 1 : 0,
398
- duration: 160,
400
+ duration: theme.motion.duration.fast,
399
401
  useNativeDriver: true
400
- }).start();
401
- }, [open, rotate]);
402
+ });
403
+ anim.start();
404
+ return () => anim.stop();
405
+ }, [open, rotate, theme.motion.duration.fast]);
402
406
  const rotation = rotate.interpolate({
403
407
  inputRange: [0, 1],
404
408
  outputRange: ['0deg', '180deg']
@@ -221,19 +221,22 @@ const SkeletonContent = ({
221
221
  const wasLoadingRef = (0, _react.useRef)(loading);
222
222
  const fadeAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(loading ? 0 : 1)).current;
223
223
  (0, _react.useEffect)(() => {
224
+ let anim;
224
225
  if (wasLoadingRef.current && !loading) {
225
226
  fadeAnim.setValue(0);
226
- _reactNative.Animated.timing(fadeAnim, {
227
+ anim = _reactNative.Animated.timing(fadeAnim, {
227
228
  toValue: 1,
228
229
  duration: resolvedFadeDuration,
229
230
  useNativeDriver: true
230
- }).start();
231
+ });
232
+ anim.start();
231
233
  } else if (!wasLoadingRef.current && loading) {
232
234
  // Going back into loading from loaded — snap opacity so the
233
235
  // placeholder appears instantly when data invalidates.
234
236
  fadeAnim.setValue(1);
235
237
  }
236
238
  wasLoadingRef.current = loading;
239
+ return () => anim?.stop();
237
240
  }, [loading, fadeAnim, resolvedFadeDuration]);
238
241
  if (!loading) {
239
242
  if (resolvedFadeDuration <= 0) {