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