@webority-technologies/mobile 0.0.15 → 0.0.21

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 (202) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +60 -19
  2. package/lib/commonjs/components/AppBar/AppBar.js +29 -20
  3. package/lib/commonjs/components/Avatar/Avatar.js +38 -8
  4. package/lib/commonjs/components/Badge/Badge.js +66 -4
  5. package/lib/commonjs/components/Banner/Banner.js +146 -66
  6. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +37 -15
  7. package/lib/commonjs/components/BottomSheet/BottomSheet.js +78 -53
  8. package/lib/commonjs/components/Button/Button.js +12 -5
  9. package/lib/commonjs/components/Card/Card.js +106 -16
  10. package/lib/commonjs/components/Carousel/Carousel.js +66 -12
  11. package/lib/commonjs/components/Checkbox/Checkbox.js +11 -7
  12. package/lib/commonjs/components/Chip/Chip.js +44 -12
  13. package/lib/commonjs/components/DatePicker/DatePicker.js +185 -76
  14. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +133 -59
  15. package/lib/commonjs/components/Dialog/Dialog.js +16 -10
  16. package/lib/commonjs/components/Drawer/Drawer.js +13 -10
  17. package/lib/commonjs/components/FieldBase/FieldBase.js +494 -0
  18. package/lib/commonjs/components/FieldBase/index.js +32 -0
  19. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +69 -44
  20. package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
  21. package/lib/commonjs/components/FormField/FormField.js +3 -2
  22. package/lib/commonjs/components/ImageGallery/ImageGallery.js +132 -44
  23. package/lib/commonjs/components/Input/Input.js +144 -181
  24. package/lib/commonjs/components/ListItem/ListItem.js +90 -11
  25. package/lib/commonjs/components/Modal/Modal.js +55 -27
  26. package/lib/commonjs/components/NumberInput/NumberInput.js +60 -106
  27. package/lib/commonjs/components/OTPInput/OTPInput.js +65 -58
  28. package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +185 -0
  29. package/lib/commonjs/components/{AppIcon → PickerTrigger}/index.js +4 -4
  30. package/lib/commonjs/components/ProgressBar/ProgressBar.js +19 -11
  31. package/lib/commonjs/components/Radio/Radio.js +11 -6
  32. package/lib/commonjs/components/Rating/Rating.js +85 -19
  33. package/lib/commonjs/components/SearchBar/SearchBar.js +90 -107
  34. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +22 -11
  35. package/lib/commonjs/components/Select/Select.js +62 -91
  36. package/lib/commonjs/components/Skeleton/Skeleton.js +131 -174
  37. package/lib/commonjs/components/Skeleton/SkeletonClock.js +117 -0
  38. package/lib/commonjs/components/Skeleton/SkeletonContent.js +164 -81
  39. package/lib/commonjs/components/Skeleton/SkeletonProvider.js +72 -10
  40. package/lib/commonjs/components/Skeleton/index.js +17 -16
  41. package/lib/commonjs/components/Slider/Slider.js +44 -25
  42. package/lib/commonjs/components/Stepper/Stepper.js +199 -29
  43. package/lib/commonjs/components/Swipeable/Swipeable.js +36 -19
  44. package/lib/commonjs/components/Switch/Switch.js +9 -2
  45. package/lib/commonjs/components/Tabs/Tabs.js +84 -21
  46. package/lib/commonjs/components/TimePicker/TimePicker.js +123 -45
  47. package/lib/commonjs/components/Toast/Toast.js +27 -16
  48. package/lib/commonjs/components/Tooltip/Tooltip.js +56 -32
  49. package/lib/commonjs/components/index.js +37 -37
  50. package/lib/commonjs/theme/tokens.js +55 -7
  51. package/lib/module/components/Accordion/Accordion.js +61 -20
  52. package/lib/module/components/AppBar/AppBar.js +29 -20
  53. package/lib/module/components/Avatar/Avatar.js +39 -9
  54. package/lib/module/components/Badge/Badge.js +67 -5
  55. package/lib/module/components/Banner/Banner.js +147 -67
  56. package/lib/module/components/BottomNavigation/BottomNavigation.js +37 -15
  57. package/lib/module/components/BottomSheet/BottomSheet.js +80 -55
  58. package/lib/module/components/Button/Button.js +12 -5
  59. package/lib/module/components/Card/Card.js +107 -17
  60. package/lib/module/components/Carousel/Carousel.js +67 -13
  61. package/lib/module/components/Checkbox/Checkbox.js +11 -7
  62. package/lib/module/components/Chip/Chip.js +45 -13
  63. package/lib/module/components/DatePicker/DatePicker.js +185 -76
  64. package/lib/module/components/DateRangePicker/DateRangePicker.js +134 -60
  65. package/lib/module/components/Dialog/Dialog.js +16 -10
  66. package/lib/module/components/Drawer/Drawer.js +13 -10
  67. package/lib/module/components/FieldBase/FieldBase.js +485 -0
  68. package/lib/module/components/FieldBase/index.js +4 -0
  69. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +69 -44
  70. package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +8 -2
  71. package/lib/module/components/FormField/FormField.js +3 -2
  72. package/lib/module/components/ImageGallery/ImageGallery.js +128 -40
  73. package/lib/module/components/Input/Input.js +144 -179
  74. package/lib/module/components/ListItem/ListItem.js +91 -12
  75. package/lib/module/components/Modal/Modal.js +55 -27
  76. package/lib/module/components/NumberInput/NumberInput.js +60 -106
  77. package/lib/module/components/OTPInput/OTPInput.js +65 -58
  78. package/lib/module/components/PickerTrigger/PickerTrigger.js +181 -0
  79. package/lib/module/components/PickerTrigger/index.js +4 -0
  80. package/lib/module/components/ProgressBar/ProgressBar.js +19 -11
  81. package/lib/module/components/Radio/Radio.js +11 -6
  82. package/lib/module/components/Rating/Rating.js +86 -20
  83. package/lib/module/components/SearchBar/SearchBar.js +90 -107
  84. package/lib/module/components/SegmentedControl/SegmentedControl.js +22 -11
  85. package/lib/module/components/Select/Select.js +62 -91
  86. package/lib/module/components/Skeleton/Skeleton.js +135 -175
  87. package/lib/module/components/Skeleton/SkeletonClock.js +110 -0
  88. package/lib/module/components/Skeleton/SkeletonContent.js +167 -84
  89. package/lib/module/components/Skeleton/SkeletonProvider.js +71 -10
  90. package/lib/module/components/Skeleton/index.js +3 -2
  91. package/lib/module/components/Slider/Slider.js +44 -25
  92. package/lib/module/components/Stepper/Stepper.js +201 -31
  93. package/lib/module/components/Swipeable/Swipeable.js +36 -19
  94. package/lib/module/components/Switch/Switch.js +9 -2
  95. package/lib/module/components/Tabs/Tabs.js +84 -21
  96. package/lib/module/components/TimePicker/TimePicker.js +123 -45
  97. package/lib/module/components/Toast/Toast.js +27 -16
  98. package/lib/module/components/Tooltip/Tooltip.js +56 -32
  99. package/lib/module/components/index.js +2 -2
  100. package/lib/module/theme/tokens.js +55 -7
  101. package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +10 -5
  102. package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +8 -0
  103. package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +12 -6
  104. package/lib/typescript/commonjs/components/Badge/Badge.d.ts +7 -6
  105. package/lib/typescript/commonjs/components/Banner/Banner.d.ts +17 -6
  106. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +7 -0
  107. package/lib/typescript/commonjs/components/Card/Card.d.ts +17 -6
  108. package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +7 -6
  109. package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +9 -1
  110. package/lib/typescript/commonjs/components/Chip/Chip.d.ts +13 -6
  111. package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +38 -3
  112. package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +36 -3
  113. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +13 -1
  114. package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +172 -0
  115. package/lib/typescript/commonjs/components/FieldBase/index.d.ts +3 -0
  116. package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
  117. package/lib/typescript/commonjs/components/FloatingActionButton/index.d.ts +1 -1
  118. package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
  119. package/lib/typescript/commonjs/components/FormField/FormField.d.ts +7 -0
  120. package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +6 -4
  121. package/lib/typescript/commonjs/components/Input/Input.d.ts +7 -1
  122. package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +13 -6
  123. package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -0
  124. package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +57 -0
  125. package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +3 -0
  126. package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +2 -0
  127. package/lib/typescript/commonjs/components/Radio/Radio.d.ts +3 -0
  128. package/lib/typescript/commonjs/components/Rating/Rating.d.ts +9 -6
  129. package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  130. package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +49 -20
  131. package/lib/typescript/commonjs/components/Skeleton/SkeletonClock.d.ts +60 -0
  132. package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +80 -19
  133. package/lib/typescript/commonjs/components/Skeleton/SkeletonProvider.d.ts +39 -5
  134. package/lib/typescript/commonjs/components/Skeleton/index.d.ts +6 -4
  135. package/lib/typescript/commonjs/components/Slider/Slider.d.ts +12 -1
  136. package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +18 -6
  137. package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +2 -0
  138. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +1 -0
  139. package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +26 -2
  140. package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +36 -3
  141. package/lib/typescript/commonjs/components/Toast/Toast.d.ts +8 -0
  142. package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +7 -1
  143. package/lib/typescript/commonjs/components/index.d.ts +5 -5
  144. package/lib/typescript/commonjs/index.d.ts +1 -1
  145. package/lib/typescript/commonjs/theme/index.d.ts +1 -1
  146. package/lib/typescript/commonjs/theme/types.d.ts +578 -12
  147. package/lib/typescript/module/components/Accordion/Accordion.d.ts +10 -5
  148. package/lib/typescript/module/components/AppBar/AppBar.d.ts +8 -0
  149. package/lib/typescript/module/components/Avatar/Avatar.d.ts +12 -6
  150. package/lib/typescript/module/components/Badge/Badge.d.ts +7 -6
  151. package/lib/typescript/module/components/Banner/Banner.d.ts +17 -6
  152. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +7 -0
  153. package/lib/typescript/module/components/Card/Card.d.ts +17 -6
  154. package/lib/typescript/module/components/Carousel/Carousel.d.ts +7 -6
  155. package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +9 -1
  156. package/lib/typescript/module/components/Chip/Chip.d.ts +13 -6
  157. package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +38 -3
  158. package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +36 -3
  159. package/lib/typescript/module/components/Dialog/Dialog.d.ts +13 -1
  160. package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +172 -0
  161. package/lib/typescript/module/components/FieldBase/index.d.ts +3 -0
  162. package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +8 -6
  163. package/lib/typescript/module/components/FloatingActionButton/index.d.ts +1 -1
  164. package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +7 -0
  165. package/lib/typescript/module/components/FormField/FormField.d.ts +7 -0
  166. package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +6 -4
  167. package/lib/typescript/module/components/Input/Input.d.ts +7 -1
  168. package/lib/typescript/module/components/ListItem/ListItem.d.ts +13 -6
  169. package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -0
  170. package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +57 -0
  171. package/lib/typescript/module/components/PickerTrigger/index.d.ts +3 -0
  172. package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +2 -0
  173. package/lib/typescript/module/components/Radio/Radio.d.ts +3 -0
  174. package/lib/typescript/module/components/Rating/Rating.d.ts +9 -6
  175. package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +3 -0
  176. package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +49 -20
  177. package/lib/typescript/module/components/Skeleton/SkeletonClock.d.ts +60 -0
  178. package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +80 -19
  179. package/lib/typescript/module/components/Skeleton/SkeletonProvider.d.ts +39 -5
  180. package/lib/typescript/module/components/Skeleton/index.d.ts +6 -4
  181. package/lib/typescript/module/components/Slider/Slider.d.ts +12 -1
  182. package/lib/typescript/module/components/Stepper/Stepper.d.ts +18 -6
  183. package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +2 -0
  184. package/lib/typescript/module/components/Switch/Switch.d.ts +1 -0
  185. package/lib/typescript/module/components/Tabs/Tabs.d.ts +26 -2
  186. package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +36 -3
  187. package/lib/typescript/module/components/Toast/Toast.d.ts +8 -0
  188. package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +7 -1
  189. package/lib/typescript/module/components/index.d.ts +5 -5
  190. package/lib/typescript/module/index.d.ts +1 -1
  191. package/lib/typescript/module/theme/index.d.ts +1 -1
  192. package/lib/typescript/module/theme/types.d.ts +578 -12
  193. package/package.json +2 -6
  194. package/lib/commonjs/components/AppIcon/AppIcon.js +0 -120
  195. package/lib/commonjs/types/vector-icons.d.js +0 -2
  196. package/lib/module/components/AppIcon/AppIcon.js +0 -111
  197. package/lib/module/components/AppIcon/index.js +0 -4
  198. package/lib/module/types/vector-icons.d.js +0 -2
  199. package/lib/typescript/commonjs/components/AppIcon/AppIcon.d.ts +0 -20
  200. package/lib/typescript/commonjs/components/AppIcon/index.d.ts +0 -3
  201. package/lib/typescript/module/components/AppIcon/AppIcon.d.ts +0 -20
  202. package/lib/typescript/module/components/AppIcon/index.d.ts +0 -3
@@ -9,10 +9,11 @@ var _reactNative = require("react-native");
9
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
- const SWIPE_DISMISS_THRESHOLD = 80;
13
- const SWIPE_VELOCITY_THRESHOLD = 0.5;
14
- const STACK_OFFSET = 8;
15
- const STACK_SCALE_STEP = 0.04;
12
+ const DEFAULT_SWIPE_DISMISS_THRESHOLD = 80;
13
+ const DEFAULT_SWIPE_VELOCITY_THRESHOLD = 0.5;
14
+ const DEFAULT_STACK_OFFSET = 8;
15
+ const DEFAULT_STACK_SCALE_STEP = 0.04;
16
+ const DEFAULT_AUTO_DISMISS_MS = 3000;
16
17
  const Toast = ({
17
18
  toast,
18
19
  index,
@@ -28,6 +29,16 @@ const Toast = ({
28
29
  const iconCircleBorderRadius = toastTokens?.iconCircleBorderRadius ?? 14;
29
30
  const iconGlyphFontSize = toastTokens?.iconGlyphFontSize ?? 16;
30
31
  const tintBarWidth = toastTokens?.tintBarWidth ?? 4;
32
+ const swipeDismissThreshold = toastTokens?.swipeDismissThreshold ?? DEFAULT_SWIPE_DISMISS_THRESHOLD;
33
+ const swipeVelocityThreshold = toastTokens?.swipeVelocityThreshold ?? DEFAULT_SWIPE_VELOCITY_THRESHOLD;
34
+ const stackOffset = toastTokens?.stackOffset ?? DEFAULT_STACK_OFFSET;
35
+ const stackScaleStep = toastTokens?.stackScaleStep ?? DEFAULT_STACK_SCALE_STEP;
36
+ const stackMinScale = toastTokens?.stackMinScale ?? 0.9;
37
+ const defaultDurationMs = toastTokens?.defaultDurationMs ?? DEFAULT_AUTO_DISMISS_MS;
38
+ const enableSwipeDismiss = toastTokens?.enableSwipeDismiss ?? true;
39
+ const enterSpringDamping = toastTokens?.enterSpringDamping ?? 18;
40
+ const enterSpringStiffness = toastTokens?.enterSpringStiffness ?? 180;
41
+ const enterSpringMass = toastTokens?.enterSpringMass ?? 1;
31
42
  const enterFrom = position === 'top' ? -120 : 120;
32
43
  const translateY = (0, _react.useRef)((0, _index.createAnimatedValue)(enterFrom)).current;
33
44
  const translateX = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
@@ -53,16 +64,16 @@ const Toast = ({
53
64
  (0, _react.useEffect)(() => {
54
65
  _reactNative.Animated.parallel([_reactNative.Animated.spring(translateY, {
55
66
  toValue: 0,
56
- damping: 18,
57
- stiffness: 180,
58
- mass: 1,
67
+ damping: enterSpringDamping,
68
+ stiffness: enterSpringStiffness,
69
+ mass: enterSpringMass,
59
70
  useNativeDriver: true
60
71
  }), _reactNative.Animated.timing(opacity, {
61
72
  toValue: 1,
62
73
  duration: theme.motion.duration.fast,
63
74
  useNativeDriver: true
64
75
  })]).start();
65
- const duration = toast.duration ?? 3000;
76
+ const duration = toast.duration ?? defaultDurationMs;
66
77
  if (duration > 0) {
67
78
  const timer = setTimeout(() => dismiss(true), duration);
68
79
  return () => clearTimeout(timer);
@@ -78,7 +89,7 @@ const Toast = ({
78
89
  (0, _index.setNativeValue)(opacity, fade);
79
90
  },
80
91
  onPanResponderRelease: (_evt, gesture) => {
81
- if (Math.abs(gesture.dx) > SWIPE_DISMISS_THRESHOLD || Math.abs(gesture.vx) > SWIPE_VELOCITY_THRESHOLD) {
92
+ if (Math.abs(gesture.dx) > swipeDismissThreshold || Math.abs(gesture.vx) > swipeVelocityThreshold) {
82
93
  const direction = gesture.dx >= 0 ? 1 : -1;
83
94
  _reactNative.Animated.parallel([_reactNative.Animated.timing(translateX, {
84
95
  toValue: direction * 500,
@@ -105,8 +116,8 @@ const Toast = ({
105
116
  }),
106
117
  // eslint-disable-next-line react-hooks/exhaustive-deps
107
118
  []);
108
- const stackTranslate = position === 'top' ? index * STACK_OFFSET : -index * STACK_OFFSET;
109
- const stackScale = Math.max(1 - index * STACK_SCALE_STEP, 0.9);
119
+ const stackTranslate = position === 'top' ? index * stackOffset : -index * stackOffset;
120
+ const stackScale = Math.max(1 - index * stackScaleStep, stackMinScale);
110
121
  const handleActionPress = () => {
111
122
  toast.action?.onPress();
112
123
  dismiss(true);
@@ -121,7 +132,7 @@ const Toast = ({
121
132
  height: iconCircleSize,
122
133
  borderRadius: iconCircleBorderRadius,
123
134
  backgroundColor: tint + '22'
124
- }],
135
+ }, toast.iconCircleStyle],
125
136
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
126
137
  style: [styles.iconGlyph, {
127
138
  color: tint,
@@ -134,7 +145,7 @@ const Toast = ({
134
145
  };
135
146
  const a11yLabel = toast.description ? `${toast.message}. ${toast.description}` : toast.message;
136
147
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
137
- ...panResponder.panHandlers,
148
+ ...(enableSwipeDismiss ? panResponder.panHandlers : {}),
138
149
  accessibilityRole: "alert",
139
150
  accessibilityLiveRegion: "assertive",
140
151
  accessibilityLabel: a11yLabel,
@@ -152,7 +163,7 @@ const Toast = ({
152
163
  }, {
153
164
  scale: stackScale
154
165
  }]
155
- }, toast.style],
166
+ }, toast.style, toast.containerStyle],
156
167
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
157
168
  style: [styles.tintBar, {
158
169
  width: tintBarWidth,
@@ -167,7 +178,7 @@ const Toast = ({
167
178
  color: theme.colors.text.primary,
168
179
  fontSize: theme.typography.fontSize.base,
169
180
  ...(0, _index.fontFor)(theme, 'semibold')
170
- }, toast.textStyle],
181
+ }, toast.textStyle, toast.messageStyle],
171
182
  numberOfLines: 2,
172
183
  children: toast.message
173
184
  }), toast.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
@@ -186,7 +197,7 @@ const Toast = ({
186
197
  pressed
187
198
  }) => [styles.actionBtn, {
188
199
  backgroundColor: pressed ? theme.colors.surface.pressed : 'transparent'
189
- }],
200
+ }, toast.actionButtonStyle],
190
201
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
191
202
  style: {
192
203
  color: tint,
@@ -9,12 +9,14 @@ var _reactNative = require("react-native");
9
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
- const TOOLTIP_GAP = 8;
13
- const SCREEN_PADDING = 8;
14
- const PRESS_AUTO_HIDE_MS = 4000;
15
- const ARROW_HALF_WIDTH = 4; // half of 8px arrow base
16
- const ARROW_HEIGHT = 6;
17
- const ARROW_CORNER_PADDING = 12;
12
+ const DEFAULT_TOOLTIP_GAP = 8;
13
+ const DEFAULT_SCREEN_PADDING = 8;
14
+ const DEFAULT_PRESS_AUTO_HIDE_MS = 4000;
15
+ const DEFAULT_ARROW_HALF_WIDTH = 4; // half of 8px arrow base
16
+ const DEFAULT_ARROW_HEIGHT = 6;
17
+ const DEFAULT_ARROW_CORNER_PADDING = 12;
18
+ const DEFAULT_MAX_WIDTH = 240;
19
+ const DEFAULT_LINE_HEIGHT = 18;
18
20
  const Tooltip = props => {
19
21
  const {
20
22
  content,
@@ -24,14 +26,28 @@ const Tooltip = props => {
24
26
  visible: controlledVisible,
25
27
  onVisibleChange,
26
28
  hideOnContentPress = true,
27
- maxWidth = 240,
29
+ maxWidth,
28
30
  showArrow = true,
29
31
  accessibilityLabel,
30
32
  style,
33
+ containerStyle,
34
+ arrowStyle: arrowStyleOverride,
35
+ messageStyle,
31
36
  testID
32
37
  } = props;
33
38
  const theme = (0, _index.useTheme)();
34
39
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
40
+ const tooltipTokens = theme.components.tooltip;
41
+ const TOOLTIP_GAP = tooltipTokens?.gap ?? DEFAULT_TOOLTIP_GAP;
42
+ const SCREEN_PADDING = tooltipTokens?.screenPadding ?? DEFAULT_SCREEN_PADDING;
43
+ const PRESS_AUTO_HIDE_MS = tooltipTokens?.pressAutoHideMs ?? DEFAULT_PRESS_AUTO_HIDE_MS;
44
+ const ARROW_HALF_WIDTH = tooltipTokens?.arrowHalfWidth ?? DEFAULT_ARROW_HALF_WIDTH;
45
+ const ARROW_HEIGHT = tooltipTokens?.arrowHeight ?? DEFAULT_ARROW_HEIGHT;
46
+ const ARROW_CORNER_PADDING = tooltipTokens?.arrowCornerPadding ?? DEFAULT_ARROW_CORNER_PADDING;
47
+ const MESSAGE_LINE_HEIGHT = tooltipTokens?.lineHeight ?? DEFAULT_LINE_HEIGHT;
48
+ const resolvedMaxWidth = maxWidth ?? tooltipTokens?.maxWidth ?? DEFAULT_MAX_WIDTH;
49
+ const enableScaleAnimation = tooltipTokens?.enableScaleAnimation ?? false;
50
+ const exitDurationMs = tooltipTokens?.exitDurationMs ?? 150;
35
51
  const isControlled = trigger === 'manual' || typeof controlledVisible === 'boolean';
36
52
  const [internalVisible, setInternalVisible] = (0, _react.useState)(false);
37
53
  const visible = isControlled ? Boolean(controlledVisible) : internalVisible;
@@ -41,7 +57,7 @@ const Tooltip = props => {
41
57
  height: 0
42
58
  });
43
59
  const wrapperRef = (0, _react.useRef)(null);
44
- const scale = (0, _react.useRef)((0, _index.createAnimatedValue)(visible ? 1 : 0.85)).current;
60
+ const scale = (0, _react.useRef)((0, _index.createAnimatedValue)(visible ? 1 : enableScaleAnimation ? 0.85 : 1)).current;
45
61
  const opacity = (0, _react.useRef)((0, _index.createAnimatedValue)(visible ? 1 : 0)).current;
46
62
  const autoHideTimer = (0, _react.useRef)(null);
47
63
  const didMount = (0, _react.useRef)(false);
@@ -93,17 +109,21 @@ const Tooltip = props => {
93
109
  }
94
110
  if (visible) {
95
111
  measureAnchor();
96
- _reactNative.Animated.parallel([_reactNative.Animated.spring(scale, {
97
- toValue: 1,
98
- damping: theme.motion.spring.snappy.damping,
99
- stiffness: theme.motion.spring.snappy.stiffness,
100
- mass: theme.motion.spring.snappy.mass,
101
- useNativeDriver: true
102
- }), _reactNative.Animated.timing(opacity, {
112
+ const enterAnims = [_reactNative.Animated.timing(opacity, {
103
113
  toValue: 1,
104
114
  duration: theme.motion.duration.fast,
105
115
  useNativeDriver: true
106
- })]).start();
116
+ })];
117
+ if (enableScaleAnimation) {
118
+ enterAnims.push(_reactNative.Animated.spring(scale, {
119
+ toValue: 1,
120
+ damping: theme.motion.spring.snappy.damping,
121
+ stiffness: theme.motion.spring.snappy.stiffness,
122
+ mass: theme.motion.spring.snappy.mass,
123
+ useNativeDriver: true
124
+ }));
125
+ }
126
+ _reactNative.Animated.parallel(enterAnims).start();
107
127
  if (trigger === 'press') {
108
128
  if (autoHideTimer.current) clearTimeout(autoHideTimer.current);
109
129
  autoHideTimer.current = setTimeout(() => {
@@ -111,15 +131,19 @@ const Tooltip = props => {
111
131
  }, PRESS_AUTO_HIDE_MS);
112
132
  }
113
133
  } else {
114
- _reactNative.Animated.parallel([_reactNative.Animated.timing(scale, {
115
- toValue: 0.85,
116
- duration: 150,
117
- useNativeDriver: true
118
- }), _reactNative.Animated.timing(opacity, {
134
+ const exitAnims = [_reactNative.Animated.timing(opacity, {
119
135
  toValue: 0,
120
- duration: 150,
136
+ duration: exitDurationMs,
121
137
  useNativeDriver: true
122
- })]).start();
138
+ })];
139
+ if (enableScaleAnimation) {
140
+ exitAnims.push(_reactNative.Animated.timing(scale, {
141
+ toValue: 0.85,
142
+ duration: exitDurationMs,
143
+ useNativeDriver: true
144
+ }));
145
+ }
146
+ _reactNative.Animated.parallel(exitAnims).start();
123
147
  if (autoHideTimer.current) {
124
148
  clearTimeout(autoHideTimer.current);
125
149
  autoHideTimer.current = null;
@@ -156,7 +180,7 @@ const Tooltip = props => {
156
180
  arrowOffset: 0
157
181
  };
158
182
  }
159
- const tooltipWidth = size.width || Math.min(maxWidth, screen.width - SCREEN_PADDING * 2);
183
+ const tooltipWidth = size.width || Math.min(resolvedMaxWidth, screen.width - SCREEN_PADDING * 2);
160
184
  const tooltipHeight = size.height || 0;
161
185
 
162
186
  // Choose placement.
@@ -215,7 +239,7 @@ const Tooltip = props => {
215
239
  placement: resolved,
216
240
  arrowOffset
217
241
  };
218
- }, [anchor, size, placement, maxWidth]);
242
+ }, [anchor, size, placement, resolvedMaxWidth, SCREEN_PADDING, TOOLTIP_GAP, ARROW_CORNER_PADDING]);
219
243
 
220
244
  // Build the cloned trigger.
221
245
  const triggerProps = {};
@@ -292,7 +316,7 @@ const Tooltip = props => {
292
316
  rotate: '-90deg'
293
317
  }]
294
318
  };
295
- }, [showArrow, position, theme]);
319
+ }, [showArrow, position, theme, ARROW_HALF_WIDTH, ARROW_HEIGHT]);
296
320
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
297
321
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
298
322
  ref: wrapperRef,
@@ -321,12 +345,12 @@ const Tooltip = props => {
321
345
  position: 'absolute',
322
346
  top: position.top,
323
347
  left: position.left,
324
- maxWidth,
348
+ maxWidth: resolvedMaxWidth,
325
349
  opacity,
326
350
  transform: [{
327
351
  scale
328
352
  }]
329
- }, style],
353
+ }, style, containerStyle],
330
354
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
331
355
  style: [styles.tooltip, {
332
356
  backgroundColor: theme.colors.background.inverse,
@@ -337,15 +361,15 @@ const Tooltip = props => {
337
361
  shadowColor: theme.shadows.lg.shadowColor
338
362
  }],
339
363
  children: typeof content === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
340
- style: {
364
+ style: [{
341
365
  color: theme.colors.text.inverse,
342
366
  fontSize: theme.typography.fontSize.sm,
343
- lineHeight: 18
344
- },
367
+ lineHeight: MESSAGE_LINE_HEIGHT
368
+ }, messageStyle],
345
369
  children: content
346
370
  }) : content
347
371
  }), arrowStyle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
348
- style: arrowStyle,
372
+ style: [arrowStyle, arrowStyleOverride],
349
373
  pointerEvents: "none"
350
374
  }) : null]
351
375
  }) : null
@@ -21,12 +21,6 @@ Object.defineProperty(exports, "AppBar", {
21
21
  return _index19.AppBar;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "AppIcon", {
25
- enumerable: true,
26
- get: function () {
27
- return _index20.AppIcon;
28
- }
29
- });
30
24
  Object.defineProperty(exports, "Avatar", {
31
25
  enumerable: true,
32
26
  get: function () {
@@ -156,37 +150,43 @@ Object.defineProperty(exports, "FormField", {
156
150
  Object.defineProperty(exports, "ImageGallery", {
157
151
  enumerable: true,
158
152
  get: function () {
159
- return _index21.ImageGallery;
153
+ return _index20.ImageGallery;
160
154
  }
161
155
  });
162
156
  Object.defineProperty(exports, "Input", {
163
157
  enumerable: true,
164
158
  get: function () {
165
- return _index22.Input;
159
+ return _index21.Input;
166
160
  }
167
161
  });
168
162
  Object.defineProperty(exports, "ListItem", {
169
163
  enumerable: true,
170
164
  get: function () {
171
- return _index23.ListItem;
165
+ return _index22.ListItem;
172
166
  }
173
167
  });
174
168
  Object.defineProperty(exports, "Modal", {
175
169
  enumerable: true,
176
170
  get: function () {
177
- return _index25.Modal;
171
+ return _index24.Modal;
178
172
  }
179
173
  });
180
174
  Object.defineProperty(exports, "NumberInput", {
181
175
  enumerable: true,
182
176
  get: function () {
183
- return _index26.NumberInput;
177
+ return _index25.NumberInput;
184
178
  }
185
179
  });
186
180
  Object.defineProperty(exports, "OTPInput", {
187
181
  enumerable: true,
188
182
  get: function () {
189
- return _index27.OTPInput;
183
+ return _index26.OTPInput;
184
+ }
185
+ });
186
+ Object.defineProperty(exports, "PickerTrigger", {
187
+ enumerable: true,
188
+ get: function () {
189
+ return _index27.PickerTrigger;
190
190
  }
191
191
  });
192
192
  Object.defineProperty(exports, "ProgressBar", {
@@ -237,22 +237,16 @@ Object.defineProperty(exports, "Skeleton", {
237
237
  return _index35.Skeleton;
238
238
  }
239
239
  });
240
- Object.defineProperty(exports, "SkeletonAvatar", {
241
- enumerable: true,
242
- get: function () {
243
- return _index35.SkeletonAvatar;
244
- }
245
- });
246
- Object.defineProperty(exports, "SkeletonCard", {
240
+ Object.defineProperty(exports, "SkeletonCircle", {
247
241
  enumerable: true,
248
242
  get: function () {
249
- return _index35.SkeletonCard;
243
+ return _index35.SkeletonCircle;
250
244
  }
251
245
  });
252
- Object.defineProperty(exports, "SkeletonCircle", {
246
+ Object.defineProperty(exports, "SkeletonClockProvider", {
253
247
  enumerable: true,
254
248
  get: function () {
255
- return _index35.SkeletonCircle;
249
+ return _index35.SkeletonClockProvider;
256
250
  }
257
251
  });
258
252
  Object.defineProperty(exports, "SkeletonContent", {
@@ -267,12 +261,6 @@ Object.defineProperty(exports, "SkeletonList", {
267
261
  return _index35.SkeletonList;
268
262
  }
269
263
  });
270
- Object.defineProperty(exports, "SkeletonListItem", {
271
- enumerable: true,
272
- get: function () {
273
- return _index35.SkeletonListItem;
274
- }
275
- });
276
264
  Object.defineProperty(exports, "SkeletonProvider", {
277
265
  enumerable: true,
278
266
  get: function () {
@@ -300,7 +288,7 @@ Object.defineProperty(exports, "Slider", {
300
288
  Object.defineProperty(exports, "Spinner", {
301
289
  enumerable: true,
302
290
  get: function () {
303
- return _index24.Spinner;
291
+ return _index23.Spinner;
304
292
  }
305
293
  });
306
294
  Object.defineProperty(exports, "Stepper", {
@@ -357,6 +345,18 @@ Object.defineProperty(exports, "toast", {
357
345
  return _index41.toast;
358
346
  }
359
347
  });
348
+ Object.defineProperty(exports, "useReduceMotion", {
349
+ enumerable: true,
350
+ get: function () {
351
+ return _index35.useReduceMotion;
352
+ }
353
+ });
354
+ Object.defineProperty(exports, "useSkeletonClock", {
355
+ enumerable: true,
356
+ get: function () {
357
+ return _index35.useSkeletonClock;
358
+ }
359
+ });
360
360
  Object.defineProperty(exports, "useSkeletonDefaults", {
361
361
  enumerable: true,
362
362
  get: function () {
@@ -390,14 +390,14 @@ var _index16 = require("./FormField/index.js");
390
390
  var _index17 = require("./FloatingActionButton/index.js");
391
391
  var _index18 = require("./ForceUpdateDialog/index.js");
392
392
  var _index19 = require("./AppBar/index.js");
393
- var _index20 = require("./AppIcon/index.js");
394
- var _index21 = require("./ImageGallery/index.js");
395
- var _index22 = require("./Input/index.js");
396
- var _index23 = require("./ListItem/index.js");
397
- var _index24 = require("./Spinner/index.js");
398
- var _index25 = require("./Modal/index.js");
399
- var _index26 = require("./NumberInput/index.js");
400
- var _index27 = require("./OTPInput/index.js");
393
+ var _index20 = require("./ImageGallery/index.js");
394
+ var _index21 = require("./Input/index.js");
395
+ var _index22 = require("./ListItem/index.js");
396
+ var _index23 = require("./Spinner/index.js");
397
+ var _index24 = require("./Modal/index.js");
398
+ var _index25 = require("./NumberInput/index.js");
399
+ var _index26 = require("./OTPInput/index.js");
400
+ var _index27 = require("./PickerTrigger/index.js");
401
401
  var _index28 = require("./ProgressBar/index.js");
402
402
  var _index29 = require("./Radio/index.js");
403
403
  var _index30 = require("./Rating/index.js");
@@ -54,6 +54,39 @@ const radius = {
54
54
  '2xl': 28,
55
55
  full: 9999
56
56
  };
57
+
58
+ // `field` tokens hold the canonical dimensions every input-like control
59
+ // inherits via FieldBase. Heights, radii and padding ladders here are the
60
+ // single source of truth — Input, Select, SearchBar, NumberInput, OTPInput
61
+ // cell and PickerTrigger fall through to these unless their own component
62
+ // tokens override. Fill / border colours resolve at theme-build time inside
63
+ // the providers (which know `colors.*`) — these defaults are dimension-only.
64
+ const fieldSizes = {
65
+ sm: {
66
+ paddingHorizontal: 12,
67
+ paddingVertical: 8,
68
+ minHeight: 38,
69
+ fontSize: 13,
70
+ borderRadius: 10,
71
+ iconSize: 16
72
+ },
73
+ md: {
74
+ paddingHorizontal: 14,
75
+ paddingVertical: 11,
76
+ minHeight: 46,
77
+ fontSize: 15,
78
+ borderRadius: 12,
79
+ iconSize: 18
80
+ },
81
+ lg: {
82
+ paddingHorizontal: 16,
83
+ paddingVertical: 14,
84
+ minHeight: 54,
85
+ fontSize: 16,
86
+ borderRadius: 14,
87
+ iconSize: 20
88
+ }
89
+ };
57
90
  const components = {
58
91
  button: {
59
92
  xs: {
@@ -122,26 +155,33 @@ const components = {
122
155
  }
123
156
  },
124
157
  searchBar: {
158
+ // `borderRadius: radius.full` keeps the historical pill shape as the
159
+ // library default. Brands wanting SearchBar to share Input / Select's
160
+ // rounded-rect shape override per size to match `field.<size>.borderRadius`
161
+ // (10 / 12 / 14), or drop a single value in via theme merge.
125
162
  sm: {
126
163
  height: 36,
127
164
  paddingHorizontal: 10,
128
165
  fontSize: 13,
129
166
  iconSize: 16,
130
- gap: 6
167
+ gap: 6,
168
+ borderRadius: radius.full
131
169
  },
132
170
  md: {
133
171
  height: 44,
134
172
  paddingHorizontal: 12,
135
173
  fontSize: 15,
136
174
  iconSize: 18,
137
- gap: 8
175
+ gap: 8,
176
+ borderRadius: radius.full
138
177
  },
139
178
  lg: {
140
179
  height: 52,
141
180
  paddingHorizontal: 14,
142
181
  fontSize: 16,
143
182
  iconSize: 20,
144
- gap: 10
183
+ gap: 10,
184
+ borderRadius: radius.full
145
185
  },
146
186
  cancelButtonWidth: 72
147
187
  },
@@ -165,6 +205,14 @@ const components = {
165
205
  paddingVertical: '2xl'
166
206
  }
167
207
  },
208
+ field: {
209
+ defaultVariant: 'outlined',
210
+ sm: fieldSizes.sm,
211
+ md: fieldSizes.md,
212
+ lg: fieldSizes.lg
213
+ // Variant fill / border colours are filled in at theme-build time by the
214
+ // light/dark Theme objects below — they need access to `colors.*`.
215
+ },
168
216
  listItem: {
169
217
  sm: {
170
218
  paddingVertical: 'sm',
@@ -233,7 +281,6 @@ const components = {
233
281
  lg: {
234
282
  boxSize: 24
235
283
  },
236
- borderWidth: 1.5,
237
284
  labelGap: 10
238
285
  },
239
286
  radio: {
@@ -249,7 +296,6 @@ const components = {
249
296
  outer: 24,
250
297
  inner: 12
251
298
  },
252
- borderWidth: 1.5,
253
299
  labelGap: 10
254
300
  },
255
301
  switch: {
@@ -499,7 +545,8 @@ const lightTheme = exports.lightTheme = {
499
545
  primary: '#E5E5EC',
500
546
  secondary: '#EFEFF3',
501
547
  focus: '#5B5BD6',
502
- error: '#E5484D'
548
+ error: '#E5484D',
549
+ width: 1.5
503
550
  },
504
551
  surface: {
505
552
  pressed: 'rgba(15, 15, 26, 0.06)',
@@ -553,7 +600,8 @@ const darkTheme = exports.darkTheme = {
553
600
  primary: '#27272F',
554
601
  secondary: '#1C1C26',
555
602
  focus: '#7C7CE8',
556
- error: '#F87171'
603
+ error: '#F87171',
604
+ width: 1.5
557
605
  },
558
606
  surface: {
559
607
  pressed: 'rgba(255, 255, 255, 0.08)',