@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
@@ -6,8 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = exports.Slider = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
+ var _reactNativeGestureHandler = require("react-native-gesture-handler");
10
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
9
11
  var _index = require("../../theme/index.js");
10
12
  var _index2 = require("../../utils/index.js");
13
+ var _index3 = require("../../hooks/index.js");
11
14
  var _jsxRuntime = require("react/jsx-runtime");
12
15
  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
16
  const SIZE_MAP = {
@@ -34,7 +37,6 @@ const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
34
37
  const snapToStep = (value, min, max, step) => {
35
38
  if (step <= 0) return clamp(value, min, max);
36
39
  const stepped = Math.round((value - min) / step) * step + min;
37
- // Guard against floating-point drift.
38
40
  const decimals = String(step).split('.')[1]?.length ?? 0;
39
41
  const fixed = decimals > 0 ? Number(stepped.toFixed(decimals)) : stepped;
40
42
  return clamp(fixed, min, max);
@@ -51,6 +53,7 @@ const Slider = exports.Slider = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
51
53
  showLabel = false,
52
54
  formatLabel = defaultFormatLabel,
53
55
  accessibilityLabel,
56
+ haptic,
54
57
  style,
55
58
  containerStyle,
56
59
  trackStyle,
@@ -65,222 +68,241 @@ const Slider = exports.Slider = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
65
68
  const theme = (0, _index.useTheme)();
66
69
  const sliderTheme = theme.components.slider;
67
70
  const sliderSizeTheme = sliderTheme?.[size];
68
- const sizeCfg = {
71
+ const sizeCfg = (0, _react.useMemo)(() => ({
69
72
  trackHeight: sliderSizeTheme?.trackHeight ?? SIZE_MAP[size].trackHeight,
70
73
  thumbDiameter: sliderSizeTheme?.thumbDiameter ?? SIZE_MAP[size].thumbDiameter
71
- };
74
+ }), [sliderSizeTheme, size]);
72
75
  const thumbPressAnimationEnabled = sliderTheme?.thumbPressAnimation ?? false;
73
76
  const resolvedPressScale = thumbPressScale ?? sliderTheme?.thumbPressScale ?? 1.1;
74
77
  const resolvedLabelDuration = labelShowDuration ?? sliderTheme?.labelShowDuration ?? theme.motion.duration.fast;
75
78
  const resolvedLabelOpacity = labelOpacityProp ?? sliderTheme?.labelOpacity ?? 1;
76
79
  const styles = (0, _react.useMemo)(() => buildStyles(theme, sizeCfg), [theme, sizeCfg]);
77
-
78
- // Track layout (width + x offset within container)
80
+ const springCfg = (0, _react.useMemo)(() => ({
81
+ damping: theme.motion.spring.snappy.damping,
82
+ stiffness: theme.motion.spring.snappy.stiffness,
83
+ mass: theme.motion.spring.snappy.mass
84
+ }), [theme.motion.spring.snappy]);
79
85
  const [trackWidth, setTrackWidth] = (0, _react.useState)(0);
80
86
  const fillColor = theme.colors[TONE_TO_COLOR_KEY[tone]];
81
87
  const isRange = props.range === true;
88
+ const [currentValue, setCurrentValue] = (0, _index3.useControllableState)({
89
+ value: props.value,
90
+ defaultValue: props.defaultValue ?? (isRange ? [min, max] : min),
91
+ onChange: props.onChange
92
+ });
82
93
 
83
- // Current value is mirrored in refs so PanResponder closures get fresh values.
84
- const lowRef = (0, _react.useRef)(isRange ? props.value[0] : props.value);
85
- const highRef = (0, _react.useRef)(isRange ? props.value[1] : props.value);
86
- const lastReportedLow = (0, _react.useRef)(lowRef.current);
87
- const lastReportedHigh = (0, _react.useRef)(highRef.current);
88
-
89
- // Animated x positions (px) for thumbs.
90
- const lowX = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
91
- const highX = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
92
-
93
- // Press / drag scale animations.
94
- const lowScale = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
95
- const highScale = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
96
-
97
- // Label opacity per thumb.
98
- const lowLabelOpacity = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
99
- const highLabelOpacity = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
100
-
101
- // Track which thumb is actively dragging (to anchor gesture math).
102
- const dragOffsetRef = (0, _react.useRef)(0);
94
+ // ───────── Shared values (UI thread) ─────────
95
+ // lowX/highX: thumb px positions. lowVal/highVal: their snapped numeric values
96
+ // (mirrored on the UI thread so worklets can clamp the range + detect changes).
97
+ const lowX = (0, _reactNativeReanimated.useSharedValue)(0);
98
+ const highX = (0, _reactNativeReanimated.useSharedValue)(0);
99
+ const lowVal = (0, _reactNativeReanimated.useSharedValue)(isRange ? currentValue[0] : currentValue);
100
+ const highVal = (0, _reactNativeReanimated.useSharedValue)(isRange ? currentValue[1] : currentValue);
101
+ const dragStartX = (0, _reactNativeReanimated.useSharedValue)(0);
102
+ const trackW = (0, _reactNativeReanimated.useSharedValue)(0);
103
+ const lowScale = (0, _reactNativeReanimated.useSharedValue)(1);
104
+ const highScale = (0, _reactNativeReanimated.useSharedValue)(1);
105
+ const lowLabelOpacity = (0, _reactNativeReanimated.useSharedValue)(0);
106
+ const highLabelOpacity = (0, _reactNativeReanimated.useSharedValue)(0);
103
107
 
104
- // Derived helper: convert value -> px on track.
108
+ // Float-drift guard precision for step snapping (e.g. step 0.1 -> precision 10).
109
+ const precision = (0, _react.useMemo)(() => {
110
+ const decimals = String(step).split('.')[1]?.length ?? 0;
111
+ return Math.pow(10, decimals);
112
+ }, [step]);
113
+ (0, _react.useEffect)(() => {
114
+ return () => {
115
+ (0, _reactNativeReanimated.cancelAnimation)(lowX);
116
+ (0, _reactNativeReanimated.cancelAnimation)(highX);
117
+ (0, _reactNativeReanimated.cancelAnimation)(lowScale);
118
+ (0, _reactNativeReanimated.cancelAnimation)(highScale);
119
+ (0, _reactNativeReanimated.cancelAnimation)(lowLabelOpacity);
120
+ (0, _reactNativeReanimated.cancelAnimation)(highLabelOpacity);
121
+ };
122
+ }, [lowX, highX, lowScale, highScale, lowLabelOpacity, highLabelOpacity]);
105
123
  const valueToPx = (0, _react.useCallback)((value, width) => {
106
124
  if (max === min || width <= 0) return 0;
107
- const ratio = (value - min) / (max - min);
108
- return ratio * width;
125
+ return (value - min) / (max - min) * width;
109
126
  }, [min, max]);
110
-
111
- // Derived helper: convert px -> snapped value.
112
127
  const pxToValue = (0, _react.useCallback)((px, width) => {
113
128
  if (width <= 0) return min;
114
129
  const ratio = clamp(px / width, 0, 1);
115
- const raw = min + ratio * (max - min);
116
- return snapToStep(raw, min, max, step);
130
+ return snapToStep(min + ratio * (max - min), min, max, step);
117
131
  }, [min, max, step]);
118
132
 
119
- // Sync external value -> animated values.
133
+ // Sync external value -> shared values (controlled updates, value prop changes).
120
134
  (0, _react.useEffect)(() => {
121
135
  if (trackWidth <= 0) return;
122
136
  if (isRange) {
123
- const [v0, v1] = props.value;
137
+ const [v0, v1] = currentValue;
124
138
  const lo = Math.min(v0, v1);
125
139
  const hi = Math.max(v0, v1);
126
- lowRef.current = lo;
127
- highRef.current = hi;
128
- lastReportedLow.current = lo;
129
- lastReportedHigh.current = hi;
130
- (0, _index.setNativeValue)(lowX, valueToPx(lo, trackWidth));
131
- (0, _index.setNativeValue)(highX, valueToPx(hi, trackWidth));
140
+ lowVal.value = lo;
141
+ highVal.value = hi;
142
+ lowX.value = valueToPx(lo, trackWidth);
143
+ highX.value = valueToPx(hi, trackWidth);
132
144
  } else {
133
- const v = props.value;
134
- lowRef.current = v;
135
- highRef.current = v;
136
- lastReportedLow.current = v;
137
- (0, _index.setNativeValue)(lowX, valueToPx(v, trackWidth));
145
+ const v = currentValue;
146
+ lowVal.value = v;
147
+ highVal.value = v;
148
+ lowX.value = valueToPx(v, trackWidth);
138
149
  }
139
- // We intentionally listen to props.value across both shapes via JSON; ESLint is fine.
140
150
  // eslint-disable-next-line react-hooks/exhaustive-deps
141
- }, [JSON.stringify(props.value), trackWidth, isRange, valueToPx]);
151
+ }, [JSON.stringify(currentValue), trackWidth, isRange, valueToPx]);
142
152
  const onTrackLayout = (0, _react.useCallback)(e => {
143
153
  const w = e.nativeEvent.layout.width;
154
+ trackW.value = w;
144
155
  setTrackWidth(w);
145
- // Initialize positions immediately.
146
- if (isRange) {
147
- const [v0, v1] = props.value;
148
- const lo = Math.min(v0, v1);
149
- const hi = Math.max(v0, v1);
150
- (0, _index.setNativeValue)(lowX, valueToPx(lo, w));
151
- (0, _index.setNativeValue)(highX, valueToPx(hi, w));
152
- } else {
153
- (0, _index.setNativeValue)(lowX, valueToPx(props.value, w));
154
- }
155
- },
156
- // eslint-disable-next-line react-hooks/exhaustive-deps
157
- [isRange, valueToPx]);
156
+ }, [trackW]);
158
157
  const fireChange = (0, _react.useCallback)((lo, hi) => {
159
- if (isRange) {
160
- props.onChange([lo, hi]);
161
- } else {
162
- props.onChange(lo);
163
- }
164
- }, [isRange, props]);
165
- const animateThumbPress = (0, _react.useCallback)((target, opacity, pressed) => {
166
- if (thumbPressAnimationEnabled) {
167
- _reactNative.Animated.spring(target, {
168
- toValue: pressed ? resolvedPressScale : 1,
169
- damping: theme.motion.spring.snappy.damping,
170
- stiffness: theme.motion.spring.snappy.stiffness,
171
- mass: theme.motion.spring.snappy.mass,
172
- useNativeDriver: true
173
- }).start();
174
- }
175
- if (showLabel) {
176
- _reactNative.Animated.timing(opacity, {
177
- toValue: pressed ? resolvedLabelOpacity : 0,
178
- duration: resolvedLabelDuration,
179
- easing: _reactNative.Easing.out(_reactNative.Easing.cubic),
180
- useNativeDriver: true
181
- }).start();
182
- }
183
- }, [showLabel, theme.motion, thumbPressAnimationEnabled, resolvedPressScale, resolvedLabelDuration, resolvedLabelOpacity]);
158
+ setCurrentValue(isRange ? [lo, hi] : lo);
159
+ }, [isRange, setCurrentValue]);
160
+ const fireHaptic = (0, _react.useCallback)(() => {
161
+ const h = (0, _index2.resolveHaptic)(haptic, 'selection');
162
+ if (h) (0, _index2.triggerHaptic)(h);
163
+ }, [haptic]);
164
+
165
+ // ───────── Pan gesture per thumb (UI thread) ─────────
166
+ const buildPan = (0, _react.useCallback)(which => {
167
+ const xSV = which === 'low' ? lowX : highX;
168
+ const valSV = which === 'low' ? lowVal : highVal;
169
+ const otherSV = which === 'low' ? highVal : lowVal;
170
+ const scaleSV = which === 'low' ? lowScale : highScale;
171
+ const labelSV = which === 'low' ? lowLabelOpacity : highLabelOpacity;
172
+ const isLow = which === 'low';
173
+ const _min = min;
174
+ const _max = max;
175
+ const _step = step;
176
+ const _precision = precision;
177
+ const _range = isRange;
178
+ const _pressScale = resolvedPressScale;
179
+ const _pressAnim = thumbPressAnimationEnabled;
180
+ const _showLabel = showLabel;
181
+ const _labelOpacity = resolvedLabelOpacity;
182
+ const _labelDur = resolvedLabelDuration;
183
+ const _spring = springCfg;
184
+ return _reactNativeGestureHandler.Gesture.Pan().enabled(!disabled).minDistance(0).onStart(() => {
185
+ 'worklet';
184
186
 
185
- // Build PanResponder for a thumb.
186
- const buildResponder = (0, _react.useCallback)(which => {
187
- return _reactNative.PanResponder.create({
188
- onStartShouldSetPanResponder: () => !disabled,
189
- onMoveShouldSetPanResponder: () => !disabled,
190
- onPanResponderGrant: () => {
191
- dragOffsetRef.current = which === 'low' ? valueToPx(lowRef.current, trackWidth) : valueToPx(highRef.current, trackWidth);
192
- animateThumbPress(which === 'low' ? lowScale : highScale, which === 'low' ? lowLabelOpacity : highLabelOpacity, true);
193
- if (sliderTheme?.dragHaptic ?? false) (0, _index2.triggerHaptic)('selection');
194
- },
195
- onPanResponderMove: (_evt, gesture) => {
196
- if (trackWidth <= 0) return;
197
- const nextPx = clamp(dragOffsetRef.current + gesture.dx, 0, trackWidth);
198
- let nextValue = pxToValue(nextPx, trackWidth);
199
- if (which === 'low') {
200
- if (isRange && nextValue > highRef.current) nextValue = highRef.current;
201
- if (nextValue !== lastReportedLow.current) {
202
- if (sliderTheme?.stepHaptic ?? false) (0, _index2.triggerHaptic)('selection');
203
- lastReportedLow.current = nextValue;
204
- }
205
- lowRef.current = nextValue;
206
- (0, _index.setNativeValue)(lowX, valueToPx(nextValue, trackWidth));
207
- fireChange(nextValue, highRef.current);
208
- } else {
209
- if (isRange && nextValue < lowRef.current) nextValue = lowRef.current;
210
- if (nextValue !== lastReportedHigh.current) {
211
- if (sliderTheme?.stepHaptic ?? false) (0, _index2.triggerHaptic)('selection');
212
- lastReportedHigh.current = nextValue;
213
- }
214
- highRef.current = nextValue;
215
- (0, _index.setNativeValue)(highX, valueToPx(nextValue, trackWidth));
216
- fireChange(lowRef.current, nextValue);
217
- }
218
- },
219
- onPanResponderRelease: () => {
220
- animateThumbPress(which === 'low' ? lowScale : highScale, which === 'low' ? lowLabelOpacity : highLabelOpacity, false);
221
- },
222
- onPanResponderTerminate: () => {
223
- animateThumbPress(which === 'low' ? lowScale : highScale, which === 'low' ? lowLabelOpacity : highLabelOpacity, false);
187
+ dragStartX.value = xSV.value;
188
+ if (_pressAnim) scaleSV.value = (0, _reactNativeReanimated.withSpring)(_pressScale, _spring);
189
+ if (_showLabel) {
190
+ labelSV.value = (0, _reactNativeReanimated.withTiming)(_labelOpacity, {
191
+ duration: _labelDur,
192
+ easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic)
193
+ });
224
194
  }
225
- });
226
- }, [disabled, trackWidth, isRange, valueToPx, pxToValue, fireChange, animateThumbPress, lowX, highX, lowScale, highScale, lowLabelOpacity, highLabelOpacity]);
195
+ (0, _reactNativeReanimated.runOnJS)(fireHaptic)();
196
+ }).onUpdate(event => {
197
+ 'worklet';
227
198
 
228
- // Re-create responders when deps change so closures stay current.
229
- const lowResponder = (0, _react.useMemo)(() => buildResponder('low'), [buildResponder]);
230
- const highResponder = (0, _react.useMemo)(() => buildResponder('high'), [buildResponder]);
199
+ if (trackW.value <= 0) return;
200
+ const px = Math.min(Math.max(dragStartX.value + event.translationX, 0), trackW.value);
201
+ const ratio = px / trackW.value;
202
+ let v = _min + ratio * (_max - _min);
203
+ if (_step > 0) {
204
+ v = Math.round((v - _min) / _step) * _step + _min;
205
+ v = Math.round(v * _precision) / _precision;
206
+ }
207
+ v = Math.min(Math.max(v, _min), _max);
208
+ if (_range) {
209
+ if (isLow && v > otherSV.value) v = otherSV.value;
210
+ if (!isLow && v < otherSV.value) v = otherSV.value;
211
+ }
212
+ // Thumb sits at the snapped value's position.
213
+ xSV.value = _max === _min ? 0 : (v - _min) / (_max - _min) * trackW.value;
214
+ if (v !== valSV.value) {
215
+ valSV.value = v;
216
+ (0, _reactNativeReanimated.runOnJS)(fireHaptic)();
217
+ (0, _reactNativeReanimated.runOnJS)(fireChange)(lowVal.value, highVal.value);
218
+ }
219
+ }).onEnd(() => {
220
+ 'worklet';
221
+
222
+ if (_pressAnim) scaleSV.value = (0, _reactNativeReanimated.withSpring)(1, _spring);
223
+ if (_showLabel) {
224
+ labelSV.value = (0, _reactNativeReanimated.withTiming)(0, {
225
+ duration: _labelDur,
226
+ easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic)
227
+ });
228
+ }
229
+ });
230
+ }, [disabled, min, max, step, precision, isRange, resolvedPressScale, thumbPressAnimationEnabled, showLabel, resolvedLabelOpacity, resolvedLabelDuration, springCfg, fireChange, fireHaptic, lowX, highX, lowVal, highVal, lowScale, highScale, lowLabelOpacity, highLabelOpacity, dragStartX, trackW]);
231
+ const lowPan = (0, _react.useMemo)(() => buildPan('low'), [buildPan]);
232
+ const highPan = (0, _react.useMemo)(() => buildPan('high'), [buildPan]);
231
233
 
232
234
  // Tap on track jumps to position (single mode only).
233
235
  const handleTrackPress = (0, _react.useCallback)(e => {
234
236
  if (disabled || isRange || trackWidth <= 0) return;
235
237
  const px = clamp(e.nativeEvent.locationX, 0, trackWidth);
236
238
  const next = pxToValue(px, trackWidth);
237
- if (next !== lowRef.current) {
238
- if (sliderTheme?.tapHaptic ?? false) (0, _index2.triggerHaptic)('selection');
239
- lowRef.current = next;
240
- lastReportedLow.current = next;
241
- _reactNative.Animated.timing(lowX, {
242
- toValue: valueToPx(next, trackWidth),
239
+ if (next !== lowVal.value) {
240
+ fireHaptic();
241
+ lowVal.value = next;
242
+ lowX.value = (0, _reactNativeReanimated.withTiming)(valueToPx(next, trackWidth), {
243
243
  duration: theme.motion.duration.fast,
244
- easing: _reactNative.Easing.out(_reactNative.Easing.cubic),
245
- useNativeDriver: true
246
- }).start();
244
+ easing: _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic)
245
+ });
247
246
  fireChange(next, next);
248
247
  }
249
- }, [disabled, isRange, trackWidth, pxToValue, valueToPx, fireChange, lowX, theme.motion.duration.fast]);
248
+ }, [disabled, isRange, trackWidth, pxToValue, valueToPx, fireChange, fireHaptic, lowX, lowVal, theme.motion.duration.fast]);
250
249
 
251
- // Accessibility actions: increment / decrement
250
+ // Accessibility actions: increment / decrement.
252
251
  const handleAccessibilityAction = (0, _react.useCallback)(event => {
253
252
  if (disabled) return;
254
253
  const delta = event.nativeEvent.actionName === 'increment' ? step : -step;
255
254
  if (isRange) {
256
- const nextLow = clamp(lowRef.current + delta, min, highRef.current);
257
- if (nextLow !== lowRef.current) {
258
- lowRef.current = nextLow;
259
- lastReportedLow.current = nextLow;
260
- (0, _index.setNativeValue)(lowX, valueToPx(nextLow, trackWidth));
261
- if (sliderTheme?.a11yHaptic ?? false) (0, _index2.triggerHaptic)('selection');
262
- fireChange(nextLow, highRef.current);
255
+ const nextLow = clamp(lowVal.value + delta, min, highVal.value);
256
+ if (nextLow !== lowVal.value) {
257
+ lowVal.value = nextLow;
258
+ lowX.value = valueToPx(nextLow, trackWidth);
259
+ fireHaptic();
260
+ fireChange(nextLow, highVal.value);
263
261
  }
264
262
  } else {
265
- const next = clamp(lowRef.current + delta, min, max);
266
- if (next !== lowRef.current) {
267
- lowRef.current = next;
268
- lastReportedLow.current = next;
269
- (0, _index.setNativeValue)(lowX, valueToPx(next, trackWidth));
270
- if (sliderTheme?.a11yHaptic ?? false) (0, _index2.triggerHaptic)('selection');
263
+ const next = clamp(lowVal.value + delta, min, max);
264
+ if (next !== lowVal.value) {
265
+ lowVal.value = next;
266
+ lowX.value = valueToPx(next, trackWidth);
267
+ fireHaptic();
271
268
  fireChange(next, next);
272
269
  }
273
270
  }
274
- }, [disabled, step, isRange, min, max, valueToPx, trackWidth, lowX, fireChange, sliderTheme]);
275
-
276
- // Computed values for fill bar.
277
- const fillLeft = isRange ? lowX : new _reactNative.Animated.Value(0);
278
- const fillWidth = isRange ? _reactNative.Animated.subtract(highX, lowX) : lowX;
271
+ }, [disabled, step, isRange, min, max, valueToPx, trackWidth, lowX, lowVal, highVal, fireChange, fireHaptic]);
279
272
  const thumbRadius = sizeCfg.thumbDiameter / 2;
280
273
 
281
- // Display values for labels.
282
- const lowDisplayValue = isRange ? lowRef.current : lowRef.current;
283
- const highDisplayValue = highRef.current;
274
+ // ───────── Animated styles ─────────
275
+ const fillAnimStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => isRange ? {
276
+ left: lowX.value,
277
+ width: Math.max(0, highX.value - lowX.value)
278
+ } : {
279
+ left: 0,
280
+ width: lowX.value
281
+ });
282
+ const lowThumbStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
283
+ transform: [{
284
+ translateX: lowX.value - thumbRadius
285
+ }, {
286
+ scale: lowScale.value
287
+ }]
288
+ }));
289
+ const highThumbStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
290
+ transform: [{
291
+ translateX: highX.value - thumbRadius
292
+ }, {
293
+ scale: highScale.value
294
+ }]
295
+ }));
296
+ const lowLabelStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
297
+ opacity: lowLabelOpacity.value
298
+ }));
299
+ const highLabelStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
300
+ opacity: highLabelOpacity.value
301
+ }));
302
+
303
+ // Display values (from committed state) for labels + a11y.
304
+ const lowDisplayValue = isRange ? Math.min(...currentValue) : currentValue;
305
+ const highDisplayValue = isRange ? Math.max(...currentValue) : currentValue;
284
306
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
285
307
  ref: ref,
286
308
  style: [styles.container, containerStyle, style],
@@ -290,10 +312,15 @@ const Slider = exports.Slider = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
290
312
  accessibilityState: {
291
313
  disabled
292
314
  },
293
- accessibilityValue: {
315
+ accessibilityValue: isRange ? {
316
+ min,
317
+ max,
318
+ now: lowDisplayValue,
319
+ text: `${lowDisplayValue} to ${highDisplayValue}`
320
+ } : {
294
321
  min,
295
322
  max,
296
- now: isRange ? lowDisplayValue : lowDisplayValue
323
+ now: lowDisplayValue
297
324
  },
298
325
  accessibilityActions: [{
299
326
  name: 'increment'
@@ -314,69 +341,59 @@ const Slider = exports.Slider = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
314
341
  style: [styles.track, {
315
342
  backgroundColor: disabled ? theme.colors.surface.disabled : theme.colors.border.primary
316
343
  }, trackStyle]
317
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
344
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
318
345
  style: [styles.fill, {
319
- left: fillLeft,
320
- width: fillWidth,
321
346
  backgroundColor: disabled ? theme.colors.surface.disabled : fillColor,
322
- opacity: disabled ? 0.6 : 1
323
- }, fillStyle]
324
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
325
- ...lowResponder.panHandlers,
326
- style: [styles.thumb, {
327
- width: sizeCfg.thumbDiameter,
328
- height: sizeCfg.thumbDiameter,
329
- borderRadius: thumbRadius,
330
- backgroundColor: theme.colors.background.elevated,
331
- borderColor: disabled ? theme.colors.surface.disabled : fillColor,
332
- transform: [{
333
- translateX: _reactNative.Animated.subtract(lowX, new _reactNative.Animated.Value(thumbRadius))
334
- }, {
335
- scale: lowScale
336
- }],
337
- opacity: disabled ? 0.6 : 1
338
- }, thumbStyle],
339
- accessibilityElementsHidden: true,
340
- importantForAccessibility: "no-hide-descendants",
341
- children: showLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
342
- style: [styles.bubble, {
343
- opacity: lowLabelOpacity,
344
- backgroundColor: fillColor
345
- }],
346
- pointerEvents: "none",
347
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
348
- style: [styles.bubbleText, labelStyle],
349
- children: formatLabel(lowDisplayValue)
350
- })
351
- }) : null
352
- }), isRange ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
353
- ...highResponder.panHandlers,
354
- style: [styles.thumb, {
355
- width: sizeCfg.thumbDiameter,
356
- height: sizeCfg.thumbDiameter,
357
- borderRadius: thumbRadius,
358
- backgroundColor: theme.colors.background.elevated,
359
- borderColor: disabled ? theme.colors.surface.disabled : fillColor,
360
- transform: [{
361
- translateX: _reactNative.Animated.subtract(highX, new _reactNative.Animated.Value(thumbRadius))
362
- }, {
363
- scale: highScale
364
- }],
365
- opacity: disabled ? 0.6 : 1
366
- }, thumbStyle],
367
- accessibilityElementsHidden: true,
368
- importantForAccessibility: "no-hide-descendants",
369
- children: showLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
370
- style: [styles.bubble, {
371
- opacity: highLabelOpacity,
372
- backgroundColor: fillColor
373
- }],
374
- pointerEvents: "none",
375
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
376
- style: [styles.bubbleText, labelStyle],
377
- children: formatLabel(highDisplayValue)
378
- })
379
- }) : null
347
+ opacity: disabled ? 0.55 : 1
348
+ }, fillStyle, fillAnimStyle]
349
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector, {
350
+ gesture: lowPan,
351
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
352
+ style: [styles.thumb, {
353
+ width: sizeCfg.thumbDiameter,
354
+ height: sizeCfg.thumbDiameter,
355
+ borderRadius: thumbRadius,
356
+ backgroundColor: theme.colors.background.elevated,
357
+ borderColor: disabled ? theme.colors.surface.disabled : fillColor,
358
+ opacity: disabled ? 0.55 : 1
359
+ }, thumbStyle, lowThumbStyle],
360
+ accessibilityElementsHidden: true,
361
+ importantForAccessibility: "no-hide-descendants",
362
+ children: showLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
363
+ style: [styles.bubble, {
364
+ backgroundColor: fillColor
365
+ }, lowLabelStyle],
366
+ pointerEvents: "none",
367
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
368
+ style: [styles.bubbleText, labelStyle],
369
+ children: formatLabel(lowDisplayValue)
370
+ })
371
+ }) : null
372
+ })
373
+ }), isRange ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector, {
374
+ gesture: highPan,
375
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
376
+ style: [styles.thumb, {
377
+ width: sizeCfg.thumbDiameter,
378
+ height: sizeCfg.thumbDiameter,
379
+ borderRadius: thumbRadius,
380
+ backgroundColor: theme.colors.background.elevated,
381
+ borderColor: disabled ? theme.colors.surface.disabled : fillColor,
382
+ opacity: disabled ? 0.55 : 1
383
+ }, thumbStyle, highThumbStyle],
384
+ accessibilityElementsHidden: true,
385
+ importantForAccessibility: "no-hide-descendants",
386
+ children: showLabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
387
+ style: [styles.bubble, {
388
+ backgroundColor: fillColor
389
+ }, highLabelStyle],
390
+ pointerEvents: "none",
391
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
392
+ style: [styles.bubbleText, labelStyle],
393
+ children: formatLabel(highDisplayValue)
394
+ })
395
+ }) : null
396
+ })
380
397
  }) : null]
381
398
  })
382
399
  })
@@ -437,7 +454,6 @@ const buildStyles = (theme, sizeCfg) => {
437
454
  minWidth: 36,
438
455
  alignItems: 'center',
439
456
  justifyContent: 'center',
440
- // A subtle shadow for elevation.
441
457
  ..._reactNative.Platform.select({
442
458
  ios: {
443
459
  shadowColor: theme.shadows.sm.shadowColor,
@@ -10,9 +10,9 @@ var _index = require("../../theme/index.js");
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
11
  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); }
12
12
  const sizeMap = {
13
- small: 20,
14
- medium: 32,
15
- large: 48
13
+ sm: 20,
14
+ md: 32,
15
+ lg: 48
16
16
  };
17
17
  const DOT_COUNT = 3;
18
18
  const DOT_STAGGER_MS = 150;
@@ -55,7 +55,7 @@ const Dot = ({
55
55
  };
56
56
  const Spinner = exports.Spinner = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
57
57
  const {
58
- size = 'medium',
58
+ size = 'md',
59
59
  color,
60
60
  message,
61
61
  overlay = false,
@@ -98,7 +98,7 @@ const Spinner = exports.Spinner = /*#__PURE__*/(0, _react.forwardRef)((props, re
98
98
  }
99
99
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
100
100
  color: resolvedColor,
101
- size: size === 'small' ? 'small' : 'large',
101
+ size: size === 'sm' ? 'small' : 'large',
102
102
  style: {
103
103
  width: dimension,
104
104
  height: dimension