@webority-technologies/mobile 0.0.7 → 0.0.9

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 (105) hide show
  1. package/lib/commonjs/components/Accordion/Accordion.js +3 -3
  2. package/lib/commonjs/components/Avatar/Avatar.js +1 -1
  3. package/lib/commonjs/components/Badge/Badge.js +24 -14
  4. package/lib/commonjs/components/Banner/Banner.js +2 -2
  5. package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
  6. package/lib/commonjs/components/BottomSheet/BottomSheet.js +39 -5
  7. package/lib/commonjs/components/Button/Button.js +25 -6
  8. package/lib/commonjs/components/Card/Card.js +13 -1
  9. package/lib/commonjs/components/Carousel/Carousel.js +2 -2
  10. package/lib/commonjs/components/Checkbox/Checkbox.js +6 -4
  11. package/lib/commonjs/components/Chip/Chip.js +12 -3
  12. package/lib/commonjs/components/DatePicker/DatePicker.js +8 -8
  13. package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +4 -4
  14. package/lib/commonjs/components/Dialog/Dialog.js +15 -8
  15. package/lib/commonjs/components/EmptyState/EmptyState.js +32 -26
  16. package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +2 -2
  17. package/lib/commonjs/components/FormField/FormField.js +4 -4
  18. package/lib/commonjs/components/Input/Input.js +18 -10
  19. package/lib/commonjs/components/ListItem/ListItem.js +33 -27
  20. package/lib/commonjs/components/Modal/Modal.js +4 -4
  21. package/lib/commonjs/components/OTPInput/OTPInput.js +7 -4
  22. package/lib/commonjs/components/ProgressBar/ProgressBar.js +2 -2
  23. package/lib/commonjs/components/Radio/Radio.js +8 -7
  24. package/lib/commonjs/components/SearchBar/SearchBar.js +10 -6
  25. package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +2 -2
  26. package/lib/commonjs/components/Select/Select.js +3 -3
  27. package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
  28. package/lib/commonjs/components/Slider/Slider.js +6 -6
  29. package/lib/commonjs/components/Spinner/Spinner.js +2 -2
  30. package/lib/commonjs/components/Stepper/Stepper.js +3 -3
  31. package/lib/commonjs/components/Switch/Switch.js +33 -4
  32. package/lib/commonjs/components/Tabs/Tabs.js +2 -2
  33. package/lib/commonjs/components/TimePicker/TimePicker.js +3 -3
  34. package/lib/commonjs/components/Toast/Toast.js +19 -14
  35. package/lib/commonjs/components/Tooltip/Tooltip.js +2 -2
  36. package/lib/commonjs/theme/Gradient.js +57 -0
  37. package/lib/commonjs/theme/animatedValue.js +28 -0
  38. package/lib/commonjs/theme/index.js +27 -0
  39. package/lib/commonjs/theme/textStyle.js +37 -0
  40. package/lib/commonjs/theme/tokens.js +260 -2
  41. package/lib/module/components/Accordion/Accordion.js +4 -4
  42. package/lib/module/components/Avatar/Avatar.js +2 -2
  43. package/lib/module/components/Badge/Badge.js +25 -15
  44. package/lib/module/components/Banner/Banner.js +3 -3
  45. package/lib/module/components/BottomNavigation/BottomNavigation.js +2 -2
  46. package/lib/module/components/BottomSheet/BottomSheet.js +40 -6
  47. package/lib/module/components/Button/Button.js +26 -7
  48. package/lib/module/components/Card/Card.js +14 -2
  49. package/lib/module/components/Carousel/Carousel.js +3 -3
  50. package/lib/module/components/Checkbox/Checkbox.js +7 -5
  51. package/lib/module/components/Chip/Chip.js +13 -4
  52. package/lib/module/components/DatePicker/DatePicker.js +9 -9
  53. package/lib/module/components/DateRangePicker/DateRangePicker.js +5 -5
  54. package/lib/module/components/Dialog/Dialog.js +16 -9
  55. package/lib/module/components/EmptyState/EmptyState.js +33 -27
  56. package/lib/module/components/FloatingActionButton/FloatingActionButton.js +3 -3
  57. package/lib/module/components/FormField/FormField.js +5 -5
  58. package/lib/module/components/Input/Input.js +19 -11
  59. package/lib/module/components/ListItem/ListItem.js +34 -28
  60. package/lib/module/components/Modal/Modal.js +5 -5
  61. package/lib/module/components/OTPInput/OTPInput.js +8 -5
  62. package/lib/module/components/ProgressBar/ProgressBar.js +3 -3
  63. package/lib/module/components/Radio/Radio.js +9 -8
  64. package/lib/module/components/SearchBar/SearchBar.js +11 -7
  65. package/lib/module/components/SegmentedControl/SegmentedControl.js +3 -3
  66. package/lib/module/components/Select/Select.js +4 -4
  67. package/lib/module/components/Skeleton/Skeleton.js +2 -2
  68. package/lib/module/components/Slider/Slider.js +7 -7
  69. package/lib/module/components/Spinner/Spinner.js +3 -3
  70. package/lib/module/components/Stepper/Stepper.js +4 -4
  71. package/lib/module/components/Switch/Switch.js +34 -5
  72. package/lib/module/components/Tabs/Tabs.js +3 -3
  73. package/lib/module/components/TimePicker/TimePicker.js +4 -4
  74. package/lib/module/components/Toast/Toast.js +20 -15
  75. package/lib/module/components/Tooltip/Tooltip.js +3 -3
  76. package/lib/module/theme/Gradient.js +50 -0
  77. package/lib/module/theme/animatedValue.js +24 -0
  78. package/lib/module/theme/index.js +3 -0
  79. package/lib/module/theme/textStyle.js +32 -0
  80. package/lib/module/theme/tokens.js +260 -2
  81. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +10 -0
  82. package/lib/typescript/commonjs/components/Button/Button.d.ts +8 -0
  83. package/lib/typescript/commonjs/components/Card/Card.d.ts +8 -0
  84. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +5 -0
  85. package/lib/typescript/commonjs/components/Input/Input.d.ts +12 -0
  86. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +5 -0
  87. package/lib/typescript/commonjs/components/Toast/Toast.d.ts +5 -0
  88. package/lib/typescript/commonjs/theme/Gradient.d.ts +11 -0
  89. package/lib/typescript/commonjs/theme/animatedValue.d.ts +21 -0
  90. package/lib/typescript/commonjs/theme/index.d.ts +6 -1
  91. package/lib/typescript/commonjs/theme/textStyle.d.ts +18 -0
  92. package/lib/typescript/commonjs/theme/types.d.ts +178 -0
  93. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +10 -0
  94. package/lib/typescript/module/components/Button/Button.d.ts +8 -0
  95. package/lib/typescript/module/components/Card/Card.d.ts +8 -0
  96. package/lib/typescript/module/components/Dialog/Dialog.d.ts +5 -0
  97. package/lib/typescript/module/components/Input/Input.d.ts +12 -0
  98. package/lib/typescript/module/components/Switch/Switch.d.ts +5 -0
  99. package/lib/typescript/module/components/Toast/Toast.d.ts +5 -0
  100. package/lib/typescript/module/theme/Gradient.d.ts +11 -0
  101. package/lib/typescript/module/theme/animatedValue.d.ts +21 -0
  102. package/lib/typescript/module/theme/index.d.ts +6 -1
  103. package/lib/typescript/module/theme/textStyle.d.ts +18 -0
  104. package/lib/typescript/module/theme/types.d.ts +178 -0
  105. package/package.json +5 -1
@@ -104,9 +104,9 @@ const Accordion = props => {
104
104
  const groupExpanded = group && id ? group.isExpanded(id) : null;
105
105
  const expanded = groupExpanded !== null ? groupExpanded : isControlled ? !!expandedProp : internalExpanded;
106
106
  const [measuredHeight, setMeasuredHeight] = (0, _react.useState)(null);
107
- const heightAnim = (0, _react.useRef)(new _reactNative.Animated.Value(expanded ? 1 : 0)).current;
108
- const opacityAnim = (0, _react.useRef)(new _reactNative.Animated.Value(expanded ? 1 : 0)).current;
109
- const rotateAnim = (0, _react.useRef)(new _reactNative.Animated.Value(expanded ? 1 : 0)).current;
107
+ const heightAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(expanded ? 1 : 0)).current;
108
+ const opacityAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(expanded ? 1 : 0)).current;
109
+ const rotateAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(expanded ? 1 : 0)).current;
110
110
  const lastExpandedRef = (0, _react.useRef)(expanded);
111
111
  (0, _react.useEffect)(() => {
112
112
  // Skip animation when state matches the previous value (e.g. on mount).
@@ -181,7 +181,7 @@ const AvatarGroupItem = ({
181
181
  borderWidth,
182
182
  children
183
183
  }) => {
184
- const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
184
+ const opacity = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
185
185
  (0, _react.useEffect)(() => {
186
186
  _reactNative.Animated.timing(opacity, {
187
187
  toValue: 1,
@@ -61,28 +61,29 @@ const sizeMap = {
61
61
  dot: 10
62
62
  }
63
63
  };
64
- const anchorPosition = anchor => {
64
+ const anchorPosition = (anchor, offset) => {
65
+ const o = -offset;
65
66
  switch (anchor) {
66
67
  case 'topLeft':
67
68
  return {
68
- top: -4,
69
- left: -4
69
+ top: o,
70
+ left: o
70
71
  };
71
72
  case 'bottomRight':
72
73
  return {
73
- bottom: -4,
74
- right: -4
74
+ bottom: o,
75
+ right: o
75
76
  };
76
77
  case 'bottomLeft':
77
78
  return {
78
- bottom: -4,
79
- left: -4
79
+ bottom: o,
80
+ left: o
80
81
  };
81
82
  case 'topRight':
82
83
  default:
83
84
  return {
84
- top: -4,
85
- right: -4
85
+ top: o,
86
+ right: o
86
87
  };
87
88
  }
88
89
  };
@@ -115,10 +116,19 @@ const Badge = exports.Badge = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
115
116
  } = props;
116
117
  const theme = (0, _index.useTheme)();
117
118
  const tones = (0, _react.useMemo)(() => toneFor(theme, tone), [theme, tone]);
118
- const sz = sizeMap[size];
119
+ const overrides = theme.components.badge?.[size];
120
+ const sz = {
121
+ fontSize: overrides?.fontSize ?? sizeMap[size].fontSize,
122
+ minWidth: overrides?.minWidth ?? sizeMap[size].minWidth,
123
+ height: overrides?.height ?? sizeMap[size].height,
124
+ paddingH: overrides?.paddingHorizontal ?? sizeMap[size].paddingH,
125
+ dot: overrides?.dotSize ?? sizeMap[size].dot
126
+ };
127
+ const badgeBorderWidth = theme.components.badge?.borderWidth ?? 1.5;
128
+ const badgeAnchorOffset = theme.components.badge?.anchorOffset ?? 4;
119
129
  const formatted = variant === 'dot' ? null : formatValue(value, max);
120
130
  const shouldRender = !invisible && (variant === 'dot' || formatted !== null);
121
- const pulseScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
131
+ const pulseScale = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
122
132
  (0, _react.useEffect)(() => {
123
133
  if (!pulse || !shouldRender) {
124
134
  pulseScale.setValue(1);
@@ -161,9 +171,9 @@ const Badge = exports.Badge = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
161
171
  }]
162
172
  }, children ? {
163
173
  position: 'absolute',
164
- borderWidth: 1.5,
174
+ borderWidth: badgeBorderWidth,
165
175
  borderColor: theme.colors.background.elevated,
166
- ...anchorPosition(anchor)
176
+ ...anchorPosition(anchor, badgeAnchorOffset)
167
177
  } : null, badgeStyle],
168
178
  accessible: true,
169
179
  accessibilityRole: a11yRole,
@@ -172,7 +182,7 @@ const Badge = exports.Badge = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
172
182
  style: [styles.text, {
173
183
  color: tones.text,
174
184
  fontSize: sz.fontSize,
175
- fontWeight: theme.typography.fontWeight.bold
185
+ ...(0, _index.fontFor)(theme, 'bold')
176
186
  }, textStyle],
177
187
  numberOfLines: 1,
178
188
  allowFontScaling: false,
@@ -29,8 +29,8 @@ const Banner = exports.Banner = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
29
29
  const theme = (0, _index.useTheme)();
30
30
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
31
31
  const tint = (0, _react.useMemo)(() => tintFor(theme, variant), [theme, variant]);
32
- const translateY = (0, _react.useRef)(new _reactNative.Animated.Value(animateMount && visible ? -20 : 0)).current;
33
- const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(animateMount && visible ? 0 : visible ? 1 : 0)).current;
32
+ const translateY = (0, _react.useRef)((0, _index.createAnimatedValue)(animateMount && visible ? -20 : 0)).current;
33
+ const opacity = (0, _react.useRef)((0, _index.createAnimatedValue)(animateMount && visible ? 0 : visible ? 1 : 0)).current;
34
34
  const [mounted, setMounted] = (0, _react.useState)(visible);
35
35
  const isFirstRun = (0, _react.useRef)(true);
36
36
  (0, _react.useEffect)(() => {
@@ -63,7 +63,7 @@ const BottomNavigation = exports.BottomNavigation = /*#__PURE__*/(0, _react.forw
63
63
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
64
64
  const activeIndex = Math.max(0, tabs.findIndex(tab => tab.key === activeTab));
65
65
  const [tabWidth, setTabWidth] = _react.default.useState(0);
66
- const indicatorTranslateX = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
66
+ const indicatorTranslateX = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
67
67
  const iconScales = (0, _react.useRef)({});
68
68
 
69
69
  // Ensure each tab has a persistent scale value
@@ -48,6 +48,7 @@ const BottomSheet = exports.BottomSheet = /*#__PURE__*/(0, _react.forwardRef)((p
48
48
  enablePanDownToClose = true,
49
49
  enableBackdropPress = true,
50
50
  backdropOpacity = 0.5,
51
+ keyboardBehavior = 'none',
51
52
  handleIndicatorStyle,
52
53
  containerStyle,
53
54
  children,
@@ -240,12 +241,45 @@ const BottomSheet = exports.BottomSheet = /*#__PURE__*/(0, _react.forwardRef)((p
240
241
  });
241
242
  }, [closedY, dragStartY, enablePanDownToClose, handleSnapEnd, minTopY, snapTargets, translateY]);
242
243
 
244
+ // ───────── Keyboard tracking ─────────
245
+ // keyboardOffset is added to translateY in sheetStyle so we don't disturb
246
+ // snap-point math. iOS gets keyboardWillShow/Hide (smoother), Android only
247
+ // emits keyboardDidShow/Hide.
248
+ const keyboardOffset = (0, _reactNativeReanimated.useSharedValue)(0);
249
+ (0, _react.useEffect)(() => {
250
+ if (keyboardBehavior === 'none') return;
251
+ const showEvt = _reactNative.Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
252
+ const hideEvt = _reactNative.Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
253
+ const onShow = e => {
254
+ const h = e.endCoordinates?.height ?? 0;
255
+ keyboardOffset.value = (0, _reactNativeReanimated.withTiming)(-h, {
256
+ duration: 220
257
+ });
258
+ };
259
+ const onHide = () => {
260
+ keyboardOffset.value = (0, _reactNativeReanimated.withTiming)(0, {
261
+ duration: 220
262
+ });
263
+ };
264
+ const showSub = _reactNative.Keyboard.addListener(showEvt, onShow);
265
+ const hideSub = _reactNative.Keyboard.addListener(hideEvt, onHide);
266
+ return () => {
267
+ showSub.remove();
268
+ hideSub.remove();
269
+ };
270
+ }, [keyboardBehavior, keyboardOffset]);
271
+
243
272
  // ───────── Animated styles ─────────
244
- const sheetStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
245
- transform: [{
246
- translateY: translateY.value
247
- }]
248
- }));
273
+ const sheetStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
274
+ // Don't push past the screen top — keyboard offset is clamped to minTopY.
275
+ const yWithKb = translateY.value + keyboardOffset.value;
276
+ const clamped = yWithKb < minTopY ? minTopY : yWithKb;
277
+ return {
278
+ transform: [{
279
+ translateY: clamped
280
+ }]
281
+ };
282
+ });
249
283
  const backdropStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
250
284
  // 0 opacity when sheet is closed, full backdropOpacity at minSnap height (and above).
251
285
  const closedAt = screenHeight;
@@ -26,6 +26,7 @@ const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
26
26
  rightIcon,
27
27
  haptic = 'selection',
28
28
  rounded = false,
29
+ gradient,
29
30
  style,
30
31
  textStyle,
31
32
  pressAnimation = true,
@@ -45,9 +46,22 @@ const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
45
46
  enabled: pressAnimation && isInteractive
46
47
  });
47
48
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
48
- const sizeStyles = sizeMap[size];
49
+ const sizeStyles = {
50
+ ...sizeMap[size],
51
+ ...(theme.components.button?.[size] ?? {})
52
+ };
49
53
  const toneColors = (0, _react.useMemo)(() => toneFor(theme, tone), [theme, tone]);
50
54
  const variantStyles = (0, _react.useMemo)(() => variantFor(theme, variant, toneColors, disabled), [theme, variant, toneColors, disabled]);
55
+
56
+ // Resolve gradient: string token → theme.gradients[token]; literal passes through.
57
+ // Skipped when disabled (parity with disabled flat-color treatment).
58
+ const resolvedGradient = (0, _react.useMemo)(() => {
59
+ if (!gradient || disabled || variant !== 'solid') return null;
60
+ if (typeof gradient === 'string') {
61
+ return theme.gradients[gradient] ?? null;
62
+ }
63
+ return gradient;
64
+ }, [gradient, disabled, variant, theme.gradients]);
51
65
  const handlePress = event => {
52
66
  if (!isInteractive) return;
53
67
  if (haptic !== false) (0, _hapticUtils.triggerHaptic)(haptic);
@@ -69,7 +83,7 @@ const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
69
83
  style: [styles.label, {
70
84
  color: variantStyles.textColor,
71
85
  fontSize: sizeStyles.fontSize,
72
- fontWeight: theme.typography.fontWeight.semibold
86
+ ...(0, _index.fontFor)(theme, 'semibold')
73
87
  }, textStyle],
74
88
  numberOfLines: 1,
75
89
  children: title
@@ -85,7 +99,7 @@ const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
85
99
  scale
86
100
  }]
87
101
  }, fullWidth ? styles.fullWidth : null],
88
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
102
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
89
103
  ref: ref,
90
104
  onPress: handlePress,
91
105
  onPressIn: pressIn,
@@ -113,15 +127,20 @@ const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
113
127
  paddingVertical: sizeStyles.paddingVertical,
114
128
  minHeight: sizeStyles.minHeight,
115
129
  borderRadius: rounded ? theme.radius.full : sizeStyles.borderRadius,
116
- backgroundColor: variantStyles.backgroundColor,
130
+ // Hide solid bg when a gradient layer covers it; preserve outline borders.
131
+ backgroundColor: resolvedGradient ? 'transparent' : variantStyles.backgroundColor,
117
132
  borderWidth: variantStyles.borderWidth,
118
133
  borderColor: variantStyles.borderColor,
119
- opacity: !isInteractive ? 0.55 : 1
134
+ opacity: !isInteractive ? 0.55 : 1,
135
+ overflow: resolvedGradient ? 'hidden' : undefined
120
136
  }, pressed && variant !== 'solid' ? {
121
137
  backgroundColor: theme.colors.surface.pressed
122
138
  } : null, fullWidth ? styles.fullWidth : null, style],
123
139
  ...rest,
124
- children: content
140
+ children: [resolvedGradient ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Gradient, {
141
+ gradient: resolvedGradient,
142
+ style: _reactNative.StyleSheet.absoluteFill
143
+ }) : null, content]
125
144
  })
126
145
  });
127
146
  });
@@ -34,6 +34,7 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
34
34
  imageAspectRatio,
35
35
  imageOverlay,
36
36
  loading = false,
37
+ gradient,
37
38
  onPress,
38
39
  accessibilityLabel,
39
40
  accessibilityHint,
@@ -54,6 +55,11 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
54
55
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
55
56
  const hasImage = Boolean(imageSource);
56
57
  const contentPadding = theme.spacing[paddingMap[padding]];
58
+ const resolvedGradient = (0, _react.useMemo)(() => {
59
+ if (!gradient) return null;
60
+ if (typeof gradient === 'string') return theme.gradients[gradient] ?? null;
61
+ return gradient;
62
+ }, [gradient, theme.gradients]);
57
63
  const containerStyle = (0, _react.useMemo)(() => {
58
64
  const base = {
59
65
  borderRadius: theme.radius[radius],
@@ -113,7 +119,7 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
113
119
  children: footer
114
120
  }) : null]
115
121
  });
116
- const content = hasImage ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
122
+ const baseContent = hasImage ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
117
123
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
118
124
  style: styles.imageWrapper,
119
125
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
@@ -134,6 +140,12 @@ const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
134
140
  children: innerContent
135
141
  })]
136
142
  }) : innerContent;
143
+ const content = resolvedGradient ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
144
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Gradient, {
145
+ gradient: resolvedGradient,
146
+ style: _reactNative.StyleSheet.absoluteFillObject
147
+ }), baseContent]
148
+ }) : baseContent;
137
149
  let rendered;
138
150
  if (isInteractive) {
139
151
  const handlePress = event => {
@@ -65,7 +65,7 @@ const CarouselInner = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
65
65
  const resolvedItemWidth = itemWidth === 'screen' ? containerWidth : itemWidth;
66
66
  const slideStride = resolvedItemWidth + spacing;
67
67
  const flatListRef = (0, _react.useRef)(null);
68
- const scrollX = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
68
+ const scrollX = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
69
69
  const initialIndex = clamp(isControlled ? controlledIndex : defaultIndex, 0, Math.max(0, data.length - 1));
70
70
  const [currentIndex, setCurrentIndex] = (0, _react.useState)(initialIndex);
71
71
 
@@ -386,7 +386,7 @@ const ThumbnailItem = ({
386
386
  onPress,
387
387
  theme
388
388
  }) => {
389
- const scale = (0, _react.useRef)(new _reactNative.Animated.Value(isActive ? 1.1 : 1)).current;
389
+ const scale = (0, _react.useRef)((0, _index.createAnimatedValue)(isActive ? 1.1 : 1)).current;
390
390
  (0, _react.useEffect)(() => {
391
391
  _reactNative.Animated.spring(scale, {
392
392
  toValue: isActive ? 1.1 : 1,
@@ -46,10 +46,12 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
46
46
  } = props;
47
47
  const theme = (0, _index.useTheme)();
48
48
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
49
- const boxSize = sizeMap[size];
49
+ const boxSize = theme.components.checkbox?.[size]?.boxSize ?? sizeMap[size];
50
+ const checkboxBorderWidth = theme.components.checkbox?.borderWidth ?? 1.5;
51
+ const checkboxLabelGap = theme.components.checkbox?.labelGap ?? 10;
50
52
  const fillColor = toneColor(theme, tone);
51
53
  const isActive = checked || indeterminate;
52
- const progress = (0, _react.useRef)(new _reactNative.Animated.Value(isActive ? 1 : 0)).current;
54
+ const progress = (0, _react.useRef)((0, _index.createAnimatedValue)(isActive ? 1 : 0)).current;
53
55
  (0, _react.useEffect)(() => {
54
56
  _reactNative.Animated.spring(progress, {
55
57
  toValue: isActive ? 1 : 0,
@@ -98,6 +100,7 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
98
100
  style: [styles.box, {
99
101
  width: boxSize,
100
102
  height: boxSize,
103
+ borderWidth: checkboxBorderWidth,
101
104
  borderRadius: theme.radius.xs,
102
105
  borderColor,
103
106
  backgroundColor
@@ -128,6 +131,7 @@ const Checkbox = exports.Checkbox = /*#__PURE__*/(0, _react.forwardRef)((props,
128
131
  })
129
132
  }), label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
130
133
  style: [styles.label, {
134
+ marginLeft: checkboxLabelGap,
131
135
  color: disabled ? theme.colors.text.disabled : theme.colors.text.primary,
132
136
  fontSize: theme.typography.fontSize.base
133
137
  }],
@@ -143,7 +147,6 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
143
147
  alignItems: 'center'
144
148
  },
145
149
  box: {
146
- borderWidth: 1.5,
147
150
  alignItems: 'center',
148
151
  justifyContent: 'center'
149
152
  },
@@ -157,7 +160,6 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
157
160
  includeFontPadding: false
158
161
  },
159
162
  label: {
160
- marginLeft: 10,
161
163
  flexShrink: 1
162
164
  }
163
165
  });
@@ -118,7 +118,16 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
118
118
  enabled: isPressable
119
119
  });
120
120
  const tones = (0, _react.useMemo)(() => toneFor(theme, tone), [theme, tone]);
121
- const sz = sizeMap[size];
121
+ const overrides = theme.components.chip?.[size];
122
+ const sz = {
123
+ paddingH: overrides?.paddingHorizontal ?? sizeMap[size].paddingH,
124
+ paddingV: overrides?.paddingVertical ?? sizeMap[size].paddingV,
125
+ fontSize: overrides?.fontSize ?? sizeMap[size].fontSize,
126
+ minHeight: overrides?.minHeight ?? sizeMap[size].minHeight,
127
+ closeSize: overrides?.closeSize ?? sizeMap[size].closeSize,
128
+ closeFont: overrides?.closeFontSize ?? sizeMap[size].closeFont,
129
+ gap: overrides?.gap ?? sizeMap[size].gap
130
+ };
122
131
  const isFilled = variant === 'filled';
123
132
  const backgroundColor = (() => {
124
133
  if (selected) return isFilled ? tones.selectedBg : 'transparent';
@@ -158,7 +167,7 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
158
167
  style: [styles.label, {
159
168
  color: textColor,
160
169
  fontSize: sz.fontSize,
161
- fontWeight: theme.typography.fontWeight.medium
170
+ ...(0, _index.fontFor)(theme, 'medium')
162
171
  }, textStyle],
163
172
  numberOfLines: 1,
164
173
  children: label ?? ' '
@@ -184,7 +193,7 @@ const Chip = exports.Chip = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =>
184
193
  style: {
185
194
  color: textColor,
186
195
  fontSize: sz.closeFont,
187
- fontWeight: theme.typography.fontWeight.bold,
196
+ ...(0, _index.fontFor)(theme, 'bold'),
188
197
  lineHeight: sz.closeFont + 2
189
198
  },
190
199
  allowFontScaling: false,
@@ -111,14 +111,14 @@ const DatePicker = props => {
111
111
  const [viewMode, setViewMode] = (0, _react.useState)('days');
112
112
 
113
113
  // Animations
114
- const backdrop = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
115
- const sheet = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
116
- const monthSlide = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
117
- const monthFade = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
118
- const selectScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
119
- const viewFade = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
120
- const viewScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
121
- const headerScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
114
+ const backdrop = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
115
+ const sheet = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
116
+ const monthSlide = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
117
+ const monthFade = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
118
+ const selectScale = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
119
+ const viewFade = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
120
+ const viewScale = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
121
+ const headerScale = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
122
122
 
123
123
  // Sync anchor / pending when value prop changes.
124
124
  (0, _react.useEffect)(() => {
@@ -96,10 +96,10 @@ const DateRangePicker = exports.DateRangePicker = /*#__PURE__*/(0, _react.forwar
96
96
  const [pendingEnd, setPendingEnd] = (0, _react.useState)(value.end ? startOfDay(value.end) : null);
97
97
 
98
98
  // Animations
99
- const backdrop = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
100
- const sheet = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
101
- const monthSlide = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
102
- const monthFade = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
99
+ const backdrop = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
100
+ const sheet = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
101
+ const monthSlide = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
102
+ const monthFade = (0, _react.useRef)((0, _index.createAnimatedValue)(1)).current;
103
103
 
104
104
  // Sync external value -> pending state when it changes.
105
105
  (0, _react.useEffect)(() => {
@@ -22,11 +22,17 @@ const Dialog = props => {
22
22
  actions,
23
23
  dismissOnAction = true,
24
24
  accessibilityLabel,
25
+ contentStyle,
26
+ containerStyle,
25
27
  testID
26
28
  } = props;
27
29
  const theme = (0, _index.useTheme)();
28
30
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
29
31
  const variantTint = (0, _react.useMemo)(() => tintForVariant(theme, variant), [theme, variant]);
32
+ const dialogTokens = theme.components.dialog;
33
+ const iconWrapperSize = dialogTokens?.iconWrapperSize ?? 48;
34
+ const iconWrapperBorderRadius = dialogTokens?.iconWrapperBorderRadius ?? 24;
35
+ const actionButtonMinHeight = dialogTokens?.actionButtonMinHeight ?? 44;
30
36
  const handleAction = (0, _react.useCallback)(action => {
31
37
  if (action.loading) return;
32
38
  (0, _hapticUtils.triggerHaptic)('selection');
@@ -40,13 +46,17 @@ const Dialog = props => {
40
46
  onRequestClose: onClose,
41
47
  presentation: "centered",
42
48
  accessibilityLabel: accessibilityLabel ?? title,
49
+ contentStyle: contentStyle,
43
50
  testID: testID,
44
51
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
45
52
  accessibilityRole: 'alertdialog',
46
53
  accessibilityLabel: accessibilityLabel ?? title,
47
- style: styles.container,
54
+ style: [styles.container, containerStyle],
48
55
  children: [icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
49
56
  style: [styles.iconWrapper, {
57
+ width: iconWrapperSize,
58
+ height: iconWrapperSize,
59
+ borderRadius: iconWrapperBorderRadius,
50
60
  backgroundColor: variantTint.muted,
51
61
  marginBottom: theme.spacing.md
52
62
  }],
@@ -55,7 +65,7 @@ const Dialog = props => {
55
65
  style: [styles.title, {
56
66
  color: theme.colors.text.primary,
57
67
  fontSize: theme.typography.fontSize.xl,
58
- fontWeight: theme.typography.fontWeight.semibold,
68
+ ...(0, _index.fontFor)(theme, 'semibold'),
59
69
  marginBottom: message ? theme.spacing.sm : theme.spacing.md
60
70
  }],
61
71
  accessibilityRole: "header",
@@ -91,6 +101,7 @@ const Dialog = props => {
91
101
  style: ({
92
102
  pressed
93
103
  }) => [styles.actionButton, {
104
+ minHeight: actionButtonMinHeight,
94
105
  backgroundColor: buttonStyle.backgroundColor,
95
106
  borderColor: buttonStyle.borderColor,
96
107
  borderWidth: buttonStyle.borderWidth,
@@ -107,7 +118,7 @@ const Dialog = props => {
107
118
  style: {
108
119
  color: buttonStyle.textColor,
109
120
  fontSize: theme.typography.fontSize.base,
110
- fontWeight: theme.typography.fontWeight.semibold,
121
+ ...(0, _index.fontFor)(theme, 'semibold'),
111
122
  textAlign: 'center'
112
123
  },
113
124
  numberOfLines: 1,
@@ -186,9 +197,6 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
186
197
  alignItems: 'stretch'
187
198
  },
188
199
  iconWrapper: {
189
- width: 48,
190
- height: 48,
191
- borderRadius: 24,
192
200
  alignItems: 'center',
193
201
  justifyContent: 'center',
194
202
  alignSelf: 'center'
@@ -207,8 +215,7 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
207
215
  actionButton: {
208
216
  flex: 1,
209
217
  alignItems: 'center',
210
- justifyContent: 'center',
211
- minHeight: 44
218
+ justifyContent: 'center'
212
219
  }
213
220
  });
214
221
  var _default = exports.default = Dialog;
@@ -11,32 +11,38 @@ var _usePressAnimation = require("../../hooks/usePressAnimation.js");
11
11
  var _hapticUtils = require("../../utils/hapticUtils.js");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
- const sizeFor = (theme, size) => {
15
- switch (size) {
16
- case 'sm':
17
- return {
18
- iconSize: 48,
19
- titleSize: theme.typography.fontSize.lg,
20
- descriptionSize: theme.typography.fontSize.sm,
21
- paddingVertical: theme.spacing.lg
22
- };
23
- case 'lg':
24
- return {
25
- iconSize: 80,
26
- titleSize: theme.typography.fontSize['2xl'],
27
- descriptionSize: theme.typography.fontSize.base,
28
- paddingVertical: theme.spacing['2xl']
29
- };
30
- case 'md':
31
- default:
32
- return {
33
- iconSize: 64,
34
- titleSize: theme.typography.fontSize.xl,
35
- descriptionSize: theme.typography.fontSize.base,
36
- paddingVertical: theme.spacing.xl
37
- };
14
+ const SIZE_FALLBACK = {
15
+ sm: {
16
+ iconSize: 48,
17
+ titleFontSize: 'lg',
18
+ descriptionFontSize: 'sm',
19
+ paddingVertical: 'lg'
20
+ },
21
+ md: {
22
+ iconSize: 64,
23
+ titleFontSize: 'xl',
24
+ descriptionFontSize: 'base',
25
+ paddingVertical: 'xl'
26
+ },
27
+ lg: {
28
+ iconSize: 80,
29
+ titleFontSize: '2xl',
30
+ descriptionFontSize: 'base',
31
+ paddingVertical: '2xl'
38
32
  }
39
33
  };
34
+ const sizeFor = (theme, size) => {
35
+ const tokens = {
36
+ ...SIZE_FALLBACK[size],
37
+ ...(theme.components.emptyState?.[size] ?? {})
38
+ };
39
+ return {
40
+ iconSize: tokens.iconSize,
41
+ titleSize: theme.typography.fontSize[tokens.titleFontSize],
42
+ descriptionSize: theme.typography.fontSize[tokens.descriptionFontSize],
43
+ paddingVertical: theme.spacing[tokens.paddingVertical]
44
+ };
45
+ };
40
46
  const ActionButton = ({
41
47
  action,
42
48
  variant
@@ -115,7 +121,7 @@ const EmptyState = exports.EmptyState = /*#__PURE__*/(0, _react.forwardRef)((pro
115
121
  }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
116
122
  style: [styles.title, {
117
123
  fontSize: sz.titleSize,
118
- fontWeight: theme.typography.fontWeight.semibold
124
+ ...(0, _index.fontFor)(theme, 'semibold')
119
125
  }],
120
126
  children: title
121
127
  }), description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
@@ -188,7 +194,7 @@ const buildActionStyles = theme => _reactNative.StyleSheet.create({
188
194
  },
189
195
  buttonText: {
190
196
  fontSize: theme.typography.fontSize.base,
191
- fontWeight: theme.typography.fontWeight.semibold
197
+ ...(0, _index.fontFor)(theme, 'semibold')
192
198
  },
193
199
  buttonTextPrimary: {
194
200
  color: theme.colors.text.inverse
@@ -83,7 +83,7 @@ const FloatingActionButton = exports.FloatingActionButton = /*#__PURE__*/(0, _re
83
83
  } = (0, _usePressAnimation.usePressAnimation)({
84
84
  enabled: !disabled
85
85
  });
86
- const hideAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
86
+ const hideAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
87
87
  (0, _react.useEffect)(() => {
88
88
  if (!hideOnScroll) {
89
89
  hideAnim.setValue(0);
@@ -239,7 +239,7 @@ const FloatingActionButtonGroup = props => {
239
239
  const isOpen = isControlled ? controlledOpen : internalOpen;
240
240
 
241
241
  // Animation drivers
242
- const progress = (0, _react.useRef)(new _reactNative.Animated.Value(isOpen ? 1 : 0)).current;
242
+ const progress = (0, _react.useRef)((0, _index.createAnimatedValue)(isOpen ? 1 : 0)).current;
243
243
  const itemAnims = (0, _react.useRef)([]);
244
244
 
245
245
  // Resize per-item anim array if action count changes
@@ -26,7 +26,7 @@ const FormField = exports.FormField = /*#__PURE__*/(0, _react.forwardRef)((props
26
26
  } = props;
27
27
  const theme = (0, _index.useTheme)();
28
28
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
29
- const errorOpacity = (0, _react.useRef)(new _reactNative.Animated.Value(error ? 1 : 0)).current;
29
+ const errorOpacity = (0, _react.useRef)((0, _index.createAnimatedValue)(error ? 1 : 0)).current;
30
30
  (0, _react.useEffect)(() => {
31
31
  _reactNative.Animated.timing(errorOpacity, {
32
32
  toValue: error ? 1 : 0,
@@ -97,15 +97,15 @@ const buildStyles = theme => _reactNative.StyleSheet.create({
97
97
  },
98
98
  label: {
99
99
  fontSize: theme.typography.fontSize.sm,
100
- fontWeight: theme.typography.fontWeight.medium,
100
+ ...(0, _index.fontFor)(theme, 'medium'),
101
101
  color: theme.colors.text.secondary
102
102
  },
103
103
  labelInline: {
104
- width: '35%'
104
+ width: theme.components.formField?.inlineLabelWidth ?? '35%'
105
105
  },
106
106
  requiredMark: {
107
107
  color: theme.colors.error,
108
- fontWeight: theme.typography.fontWeight.medium
108
+ ...(0, _index.fontFor)(theme, 'medium')
109
109
  },
110
110
  inputStacked: {
111
111
  width: '100%'