@webority-technologies/mobile 0.0.7 → 0.0.8

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 (63) hide show
  1. package/lib/commonjs/components/Badge/Badge.js +23 -13
  2. package/lib/commonjs/components/BottomSheet/BottomSheet.js +39 -5
  3. package/lib/commonjs/components/Button/Button.js +25 -6
  4. package/lib/commonjs/components/Card/Card.js +13 -1
  5. package/lib/commonjs/components/Checkbox/Checkbox.js +5 -3
  6. package/lib/commonjs/components/Chip/Chip.js +12 -3
  7. package/lib/commonjs/components/Dialog/Dialog.js +15 -8
  8. package/lib/commonjs/components/EmptyState/EmptyState.js +32 -26
  9. package/lib/commonjs/components/FormField/FormField.js +3 -3
  10. package/lib/commonjs/components/Input/Input.js +13 -5
  11. package/lib/commonjs/components/ListItem/ListItem.js +33 -27
  12. package/lib/commonjs/components/OTPInput/OTPInput.js +6 -3
  13. package/lib/commonjs/components/Radio/Radio.js +7 -6
  14. package/lib/commonjs/components/SearchBar/SearchBar.js +9 -5
  15. package/lib/commonjs/components/Switch/Switch.js +31 -2
  16. package/lib/commonjs/components/Toast/Toast.js +16 -11
  17. package/lib/commonjs/theme/Gradient.js +57 -0
  18. package/lib/commonjs/theme/index.js +20 -0
  19. package/lib/commonjs/theme/textStyle.js +37 -0
  20. package/lib/commonjs/theme/tokens.js +260 -2
  21. package/lib/module/components/Badge/Badge.js +24 -14
  22. package/lib/module/components/BottomSheet/BottomSheet.js +40 -6
  23. package/lib/module/components/Button/Button.js +26 -7
  24. package/lib/module/components/Card/Card.js +14 -2
  25. package/lib/module/components/Checkbox/Checkbox.js +5 -3
  26. package/lib/module/components/Chip/Chip.js +13 -4
  27. package/lib/module/components/Dialog/Dialog.js +16 -9
  28. package/lib/module/components/EmptyState/EmptyState.js +33 -27
  29. package/lib/module/components/FormField/FormField.js +4 -4
  30. package/lib/module/components/Input/Input.js +14 -6
  31. package/lib/module/components/ListItem/ListItem.js +34 -28
  32. package/lib/module/components/OTPInput/OTPInput.js +7 -4
  33. package/lib/module/components/Radio/Radio.js +7 -6
  34. package/lib/module/components/SearchBar/SearchBar.js +10 -6
  35. package/lib/module/components/Switch/Switch.js +31 -2
  36. package/lib/module/components/Toast/Toast.js +17 -12
  37. package/lib/module/theme/Gradient.js +50 -0
  38. package/lib/module/theme/index.js +2 -0
  39. package/lib/module/theme/textStyle.js +32 -0
  40. package/lib/module/theme/tokens.js +260 -2
  41. package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +10 -0
  42. package/lib/typescript/commonjs/components/Button/Button.d.ts +8 -0
  43. package/lib/typescript/commonjs/components/Card/Card.d.ts +8 -0
  44. package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +5 -0
  45. package/lib/typescript/commonjs/components/Input/Input.d.ts +12 -0
  46. package/lib/typescript/commonjs/components/Switch/Switch.d.ts +5 -0
  47. package/lib/typescript/commonjs/components/Toast/Toast.d.ts +5 -0
  48. package/lib/typescript/commonjs/theme/Gradient.d.ts +11 -0
  49. package/lib/typescript/commonjs/theme/index.d.ts +5 -1
  50. package/lib/typescript/commonjs/theme/textStyle.d.ts +18 -0
  51. package/lib/typescript/commonjs/theme/types.d.ts +178 -0
  52. package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +10 -0
  53. package/lib/typescript/module/components/Button/Button.d.ts +8 -0
  54. package/lib/typescript/module/components/Card/Card.d.ts +8 -0
  55. package/lib/typescript/module/components/Dialog/Dialog.d.ts +5 -0
  56. package/lib/typescript/module/components/Input/Input.d.ts +12 -0
  57. package/lib/typescript/module/components/Switch/Switch.d.ts +5 -0
  58. package/lib/typescript/module/components/Toast/Toast.d.ts +5 -0
  59. package/lib/typescript/module/theme/Gradient.d.ts +11 -0
  60. package/lib/typescript/module/theme/index.d.ts +5 -1
  61. package/lib/typescript/module/theme/textStyle.d.ts +18 -0
  62. package/lib/typescript/module/theme/types.d.ts +178 -0
  63. package/package.json +5 -1
@@ -57,7 +57,10 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
57
57
  } = props;
58
58
  const theme = (0, _index.useTheme)();
59
59
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
60
- const sizeStyles = sizeMap[size];
60
+ const sizeStyles = {
61
+ ...sizeMap[size],
62
+ ...(theme.components.otpInput?.[size] ?? {})
63
+ };
61
64
  const inputsRef = (0, _react.useRef)([]);
62
65
  const [focusedIndex, setFocusedIndex] = (0, _react.useState)(-1);
63
66
  const previousErrorRef = (0, _react.useRef)(null);
@@ -302,7 +305,7 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
302
305
  style: [styles.input, {
303
306
  fontSize: sizeStyles.fontSize,
304
307
  color: theme.colors.text.primary,
305
- fontWeight: theme.typography.fontWeight.semibold
308
+ ...(0, _index.fontFor)(theme, 'semibold')
306
309
  }, textStyle]
307
310
  }), secure && isFilled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
308
311
  pointerEvents: "none",
@@ -311,7 +314,7 @@ const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props,
311
314
  style: [{
312
315
  fontSize: sizeStyles.fontSize,
313
316
  color: theme.colors.text.primary,
314
- fontWeight: theme.typography.fontWeight.semibold
317
+ ...(0, _index.fontFor)(theme, 'semibold')
315
318
  }, textStyle],
316
319
  children: display
317
320
  })
@@ -62,10 +62,11 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
62
62
  const selected = ctx ? ctx.selectedValue === value : !!selectedProp;
63
63
  const disabled = ctx ? ctx.disabled || disabledProp : disabledProp;
64
64
  const fillColor = toneColor(theme, tone);
65
- const {
66
- outer,
67
- inner
68
- } = sizeMap[size];
65
+ const sizeOverrides = theme.components.radio?.[size];
66
+ const outer = sizeOverrides?.outer ?? sizeMap[size].outer;
67
+ const inner = sizeOverrides?.inner ?? sizeMap[size].inner;
68
+ const radioBorderWidth = theme.components.radio?.borderWidth ?? 1.5;
69
+ const radioLabelGap = theme.components.radio?.labelGap ?? 10;
69
70
  const progress = (0, _react.useRef)(new _reactNative.Animated.Value(selected ? 1 : 0)).current;
70
71
  (0, _react.useEffect)(() => {
71
72
  _reactNative.Animated.spring(progress, {
@@ -114,6 +115,7 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
114
115
  style: [styles.outer, {
115
116
  width: outer,
116
117
  height: outer,
118
+ borderWidth: radioBorderWidth,
117
119
  borderRadius: outer / 2,
118
120
  borderColor
119
121
  }, circleStyle],
@@ -131,6 +133,7 @@ const Radio = exports.Radio = /*#__PURE__*/(0, _react.forwardRef)((props, ref) =
131
133
  })
132
134
  }), label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
133
135
  style: [styles.label, {
136
+ marginLeft: radioLabelGap,
134
137
  color: disabled ? theme.colors.text.disabled : theme.colors.text.primary,
135
138
  fontSize: theme.typography.fontSize.base
136
139
  }],
@@ -146,13 +149,11 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
146
149
  alignItems: 'center'
147
150
  },
148
151
  outer: {
149
- borderWidth: 1.5,
150
152
  alignItems: 'center',
151
153
  justifyContent: 'center'
152
154
  },
153
155
  inner: {},
154
156
  label: {
155
- marginLeft: 10,
156
157
  flexShrink: 1
157
158
  }
158
159
  });
@@ -58,7 +58,11 @@ const SearchBar = exports.SearchBar = /*#__PURE__*/(0, _react.forwardRef)((props
58
58
  ...rest
59
59
  } = props;
60
60
  const theme = (0, _index.useTheme)();
61
- const sizeStyles = sizeMap[size];
61
+ const sizeStyles = {
62
+ ...sizeMap[size],
63
+ ...(theme.components.searchBar?.[size] ?? {})
64
+ };
65
+ const cancelWidth = theme.components.searchBar?.cancelButtonWidth ?? CANCEL_WIDTH;
62
66
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
63
67
  const [isFocused, setIsFocused] = (0, _react.useState)(false);
64
68
  const [internalValue, setInternalValue] = (0, _react.useState)(value);
@@ -127,7 +131,7 @@ const SearchBar = exports.SearchBar = /*#__PURE__*/(0, _react.forwardRef)((props
127
131
  // Container shrinks left to make room for cancel button on right.
128
132
  const cancelTranslateX = cancelAnim.interpolate({
129
133
  inputRange: [0, 1],
130
- outputRange: [CANCEL_WIDTH, 0]
134
+ outputRange: [cancelWidth, 0]
131
135
  });
132
136
  const cancelOpacity = cancelAnim;
133
137
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
@@ -144,7 +148,7 @@ const SearchBar = exports.SearchBar = /*#__PURE__*/(0, _react.forwardRef)((props
144
148
  opacity: disabled ? 0.55 : 1,
145
149
  marginRight: cancelAnim.interpolate({
146
150
  inputRange: [0, 1],
147
- outputRange: [0, CANCEL_WIDTH + theme.spacing.sm]
151
+ outputRange: [0, cancelWidth + theme.spacing.sm]
148
152
  })
149
153
  }],
150
154
  accessibilityRole: "search",
@@ -199,7 +203,7 @@ const SearchBar = exports.SearchBar = /*#__PURE__*/(0, _react.forwardRef)((props
199
203
  }), showCancel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
200
204
  pointerEvents: showCancelButton ? 'auto' : 'none',
201
205
  style: [styles.cancelWrap, {
202
- width: CANCEL_WIDTH,
206
+ width: cancelWidth,
203
207
  transform: [{
204
208
  translateX: cancelTranslateX
205
209
  }],
@@ -215,7 +219,7 @@ const SearchBar = exports.SearchBar = /*#__PURE__*/(0, _react.forwardRef)((props
215
219
  style: [styles.cancelText, {
216
220
  color: theme.colors.primary,
217
221
  fontSize: sizeStyles.fontSize,
218
- fontWeight: theme.typography.fontWeight.medium
222
+ ...(0, _index.fontFor)(theme, 'medium')
219
223
  }],
220
224
  numberOfLines: 1,
221
225
  children: cancelLabel
@@ -53,6 +53,7 @@ const Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
53
53
  label,
54
54
  accessibilityLabel,
55
55
  haptic = 'selection',
56
+ bounce = false,
56
57
  style,
57
58
  trackStyle,
58
59
  thumbStyle,
@@ -60,7 +61,11 @@ const Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
60
61
  ...rest
61
62
  } = props;
62
63
  const theme = (0, _index.useTheme)();
63
- const sizeStyles = sizeMap[size];
64
+ const sizeStyles = {
65
+ ...sizeMap[size],
66
+ ...(theme.components.switch?.[size] ?? {})
67
+ };
68
+ const switchThumbColor = theme.components.switch?.thumbColor ?? '#FFFFFF';
64
69
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
65
70
  const offTrackColor = theme.mode === 'dark' ? theme.colors.secondary : theme.colors.surface.disabled;
66
71
  const onTrackColor = toneColor(theme, tone);
@@ -93,6 +98,28 @@ const Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
93
98
  inputRange: [0, 1],
94
99
  outputRange: [offTrackColor, onTrackColor]
95
100
  });
101
+ const bounceScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
102
+ const isFirstRender = (0, _react.useRef)(true);
103
+ (0, _react.useEffect)(() => {
104
+ if (!bounce) return;
105
+ if (isFirstRender.current) {
106
+ isFirstRender.current = false;
107
+ return;
108
+ }
109
+ _reactNative.Animated.sequence([_reactNative.Animated.spring(bounceScale, {
110
+ toValue: 1.15,
111
+ damping: 10,
112
+ stiffness: 220,
113
+ mass: 1,
114
+ useNativeDriver: true
115
+ }), _reactNative.Animated.spring(bounceScale, {
116
+ toValue: 1,
117
+ damping: 14,
118
+ stiffness: 240,
119
+ mass: 1,
120
+ useNativeDriver: true
121
+ })]).start();
122
+ }, [value, bounce, bounceScale]);
96
123
  const handlePress = event => {
97
124
  if (disabled) return;
98
125
  if (haptic !== false) (0, _hapticUtils.triggerHaptic)(haptic);
@@ -127,11 +154,14 @@ const Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)((props, ref)
127
154
  }, trackStyle],
128
155
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
129
156
  style: [styles.thumb, theme.shadows.sm, {
157
+ backgroundColor: switchThumbColor,
130
158
  width: sizeStyles.thumbSize,
131
159
  height: sizeStyles.thumbSize,
132
160
  borderRadius: sizeStyles.thumbSize / 2,
133
161
  transform: [{
134
162
  translateX
163
+ }, {
164
+ scale: bounceScale
135
165
  }]
136
166
  }, thumbStyle]
137
167
  })
@@ -160,7 +190,6 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
160
190
  justifyContent: 'center'
161
191
  },
162
192
  thumb: {
163
- backgroundColor: '#FFFFFF',
164
193
  position: 'absolute',
165
194
  top: 2
166
195
  },
@@ -23,6 +23,11 @@ const Toast = ({
23
23
  const position = toast.position ?? 'bottom';
24
24
  const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
25
25
  const tint = (0, _react.useMemo)(() => tintFor(theme, variant), [theme, variant]);
26
+ const toastTokens = theme.components.toast;
27
+ const iconCircleSize = toastTokens?.iconCircleSize ?? 28;
28
+ const iconCircleBorderRadius = toastTokens?.iconCircleBorderRadius ?? 14;
29
+ const iconGlyphFontSize = toastTokens?.iconGlyphFontSize ?? 16;
30
+ const tintBarWidth = toastTokens?.tintBarWidth ?? 4;
26
31
  const enterFrom = position === 'top' ? -120 : 120;
27
32
  const translateY = (0, _react.useRef)(new _reactNative.Animated.Value(enterFrom)).current;
28
33
  const translateX = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
@@ -112,11 +117,15 @@ const Toast = ({
112
117
  if (!glyph) return null;
113
118
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
114
119
  style: [styles.iconCircle, {
120
+ width: iconCircleSize,
121
+ height: iconCircleSize,
122
+ borderRadius: iconCircleBorderRadius,
115
123
  backgroundColor: tint + '22'
116
124
  }],
117
125
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
118
126
  style: [styles.iconGlyph, {
119
- color: tint
127
+ color: tint,
128
+ fontSize: iconGlyphFontSize
120
129
  }],
121
130
  accessible: false,
122
131
  children: glyph
@@ -143,9 +152,10 @@ const Toast = ({
143
152
  }, {
144
153
  scale: stackScale
145
154
  }]
146
- }],
155
+ }, toast.style],
147
156
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
148
157
  style: [styles.tintBar, {
158
+ width: tintBarWidth,
149
159
  backgroundColor: tint
150
160
  }]
151
161
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
@@ -156,8 +166,8 @@ const Toast = ({
156
166
  style: [styles.message, {
157
167
  color: theme.colors.text.primary,
158
168
  fontSize: theme.typography.fontSize.base,
159
- fontWeight: theme.typography.fontWeight.semibold
160
- }],
169
+ ...(0, _index.fontFor)(theme, 'semibold')
170
+ }, toast.textStyle],
161
171
  numberOfLines: 2,
162
172
  children: toast.message
163
173
  }), toast.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
@@ -181,7 +191,7 @@ const Toast = ({
181
191
  style: {
182
192
  color: tint,
183
193
  fontSize: theme.typography.fontSize.sm,
184
- fontWeight: theme.typography.fontWeight.semibold
194
+ ...(0, _index.fontFor)(theme, 'semibold')
185
195
  },
186
196
  numberOfLines: 1,
187
197
  children: toast.action.label
@@ -230,8 +240,7 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
230
240
  position: 'absolute',
231
241
  left: 0,
232
242
  top: 0,
233
- bottom: 0,
234
- width: 4
243
+ bottom: 0
235
244
  },
236
245
  row: {
237
246
  flexDirection: 'row',
@@ -239,15 +248,11 @@ const buildStyles = _theme => _reactNative.StyleSheet.create({
239
248
  paddingLeft: 8
240
249
  },
241
250
  iconCircle: {
242
- width: 28,
243
- height: 28,
244
- borderRadius: 14,
245
251
  alignItems: 'center',
246
252
  justifyContent: 'center',
247
253
  marginRight: 12
248
254
  },
249
255
  iconGlyph: {
250
- fontSize: 16,
251
256
  fontWeight: '700',
252
257
  lineHeight: 18
253
258
  },
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isGradientAvailable = exports.Gradient = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * Render a linear gradient using `react-native-linear-gradient` when available.
13
+ *
14
+ * The dep is OPTIONAL — apps that never use gradients don't need it installed.
15
+ * If `<Gradient>` (or any component that accepts a `gradient` prop) is reached
16
+ * without the package present, we fall back to a flat View using the first
17
+ * colour and emit a one-time dev warning so the omission is loud but
18
+ * non-fatal.
19
+ */
20
+ let LinearGradientImpl = null;
21
+ let warned = false;
22
+ try {
23
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
24
+ LinearGradientImpl = require('react-native-linear-gradient').default;
25
+ } catch {
26
+ // Optional peer; resolved lazily by consumers that need gradients.
27
+ }
28
+ const Gradient = ({
29
+ gradient,
30
+ style,
31
+ children
32
+ }) => {
33
+ if (LinearGradientImpl) {
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinearGradientImpl, {
35
+ colors: gradient.colors,
36
+ locations: gradient.locations,
37
+ start: gradient.start,
38
+ end: gradient.end,
39
+ style: style,
40
+ children: children
41
+ });
42
+ }
43
+ if (__DEV__ && !warned) {
44
+ warned = true;
45
+ console.warn('[@webority-technologies/mobile] gradient prop set but react-native-linear-gradient is not installed. ' + 'Run `npm install react-native-linear-gradient` to enable.');
46
+ }
47
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
48
+ style: [{
49
+ backgroundColor: gradient.colors[0]
50
+ }, style],
51
+ children: children
52
+ });
53
+ };
54
+ exports.Gradient = Gradient;
55
+ const isGradientAvailable = () => LinearGradientImpl != null;
56
+ exports.isGradientAvailable = isGradientAvailable;
57
+ //# sourceMappingURL=Gradient.js.map
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "Gradient", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Gradient.Gradient;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "ThemeProvider", {
7
13
  enumerable: true,
8
14
  get: function () {
@@ -15,7 +21,19 @@ Object.defineProperty(exports, "darkTheme", {
15
21
  return _tokens.darkTheme;
16
22
  }
17
23
  });
24
+ Object.defineProperty(exports, "fontFor", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _textStyle.fontFor;
28
+ }
29
+ });
18
30
  exports.getTheme = exports.getColorMode = void 0;
31
+ Object.defineProperty(exports, "isGradientAvailable", {
32
+ enumerable: true,
33
+ get: function () {
34
+ return _Gradient.isGradientAvailable;
35
+ }
36
+ });
19
37
  Object.defineProperty(exports, "lightTheme", {
20
38
  enumerable: true,
21
39
  get: function () {
@@ -44,6 +62,8 @@ Object.defineProperty(exports, "useThemeMode", {
44
62
  var _tokens = require("./tokens.js");
45
63
  var _merge = require("./merge.js");
46
64
  var _ThemeContext = require("./ThemeContext.js");
65
+ var _textStyle = require("./textStyle.js");
66
+ var _Gradient = require("./Gradient.js");
47
67
  let currentMode = 'light';
48
68
  let currentTheme = _tokens.lightTheme;
49
69
  let lightOverridesGlobal;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.fontFor = void 0;
7
+ const FAMILY_KEY = {
8
+ normal: 'regular',
9
+ medium: 'medium',
10
+ semibold: 'semibold',
11
+ bold: 'bold'
12
+ };
13
+
14
+ /**
15
+ * Resolve text-weight style for the active theme.
16
+ *
17
+ * When the consumer registers a brand `theme.typography.fontFamily.<weight>`,
18
+ * we set `fontFamily` and leave `fontWeight` undefined — RN can't combine the
19
+ * two reliably across iOS/Android once a custom face is in play, so the brand
20
+ * file controls the weight glyph itself. Falls back to `fontWeight` when no
21
+ * brand font is registered for that weight.
22
+ *
23
+ * Note: the fontWeight scale uses `normal` while FontFamilyScale uses
24
+ * `regular` (the conventional font-name suffix). The helper maps between
25
+ * them transparently.
26
+ */
27
+ const fontFor = (theme, weight) => {
28
+ const family = theme.typography.fontFamily?.[FAMILY_KEY[weight]];
29
+ if (family) return {
30
+ fontFamily: family
31
+ };
32
+ return {
33
+ fontWeight: theme.typography.fontWeight[weight]
34
+ };
35
+ };
36
+ exports.fontFor = fontFor;
37
+ //# sourceMappingURL=textStyle.js.map
@@ -54,6 +54,260 @@ const radius = {
54
54
  '2xl': 28,
55
55
  full: 9999
56
56
  };
57
+ const components = {
58
+ button: {
59
+ xs: {
60
+ paddingHorizontal: 10,
61
+ paddingVertical: 4,
62
+ minHeight: 28,
63
+ fontSize: 12,
64
+ borderRadius: 8
65
+ },
66
+ sm: {
67
+ paddingHorizontal: 12,
68
+ paddingVertical: 6,
69
+ minHeight: 34,
70
+ fontSize: 13,
71
+ borderRadius: 10
72
+ },
73
+ md: {
74
+ paddingHorizontal: 16,
75
+ paddingVertical: 9,
76
+ minHeight: 42,
77
+ fontSize: 15,
78
+ borderRadius: 12
79
+ },
80
+ lg: {
81
+ paddingHorizontal: 20,
82
+ paddingVertical: 12,
83
+ minHeight: 50,
84
+ fontSize: 16,
85
+ borderRadius: 14
86
+ },
87
+ xl: {
88
+ paddingHorizontal: 24,
89
+ paddingVertical: 14,
90
+ minHeight: 58,
91
+ fontSize: 17,
92
+ borderRadius: 16
93
+ }
94
+ },
95
+ input: {
96
+ sm: {
97
+ paddingHorizontal: 12,
98
+ paddingVertical: 8,
99
+ minHeight: 38,
100
+ multilineMinHeight: 72,
101
+ fontSize: 13,
102
+ borderRadius: 10,
103
+ iconSize: 16
104
+ },
105
+ md: {
106
+ paddingHorizontal: 14,
107
+ paddingVertical: 11,
108
+ minHeight: 46,
109
+ multilineMinHeight: 92,
110
+ fontSize: 15,
111
+ borderRadius: 12,
112
+ iconSize: 18
113
+ },
114
+ lg: {
115
+ paddingHorizontal: 16,
116
+ paddingVertical: 14,
117
+ minHeight: 54,
118
+ multilineMinHeight: 110,
119
+ fontSize: 16,
120
+ borderRadius: 14,
121
+ iconSize: 20
122
+ }
123
+ },
124
+ searchBar: {
125
+ sm: {
126
+ height: 36,
127
+ paddingHorizontal: 10,
128
+ fontSize: 13,
129
+ iconSize: 16,
130
+ gap: 6
131
+ },
132
+ md: {
133
+ height: 44,
134
+ paddingHorizontal: 12,
135
+ fontSize: 15,
136
+ iconSize: 18,
137
+ gap: 8
138
+ },
139
+ lg: {
140
+ height: 52,
141
+ paddingHorizontal: 14,
142
+ fontSize: 16,
143
+ iconSize: 20,
144
+ gap: 10
145
+ },
146
+ cancelButtonWidth: 72
147
+ },
148
+ emptyState: {
149
+ sm: {
150
+ iconSize: 48,
151
+ titleFontSize: 'lg',
152
+ descriptionFontSize: 'sm',
153
+ paddingVertical: 'lg'
154
+ },
155
+ md: {
156
+ iconSize: 64,
157
+ titleFontSize: 'xl',
158
+ descriptionFontSize: 'base',
159
+ paddingVertical: 'xl'
160
+ },
161
+ lg: {
162
+ iconSize: 80,
163
+ titleFontSize: '2xl',
164
+ descriptionFontSize: 'base',
165
+ paddingVertical: '2xl'
166
+ }
167
+ },
168
+ listItem: {
169
+ sm: {
170
+ paddingVertical: 'sm',
171
+ titleFontSize: 'sm',
172
+ subtitleFontSize: 'xs',
173
+ minHeight: 44
174
+ },
175
+ md: {
176
+ paddingVertical: 'md',
177
+ titleFontSize: 'base',
178
+ subtitleFontSize: 'sm',
179
+ minHeight: 56
180
+ },
181
+ lg: {
182
+ paddingVertical: 'lg',
183
+ titleFontSize: 'lg',
184
+ subtitleFontSize: 'sm',
185
+ minHeight: 72
186
+ }
187
+ },
188
+ badge: {
189
+ sm: {
190
+ fontSize: 10,
191
+ minWidth: 16,
192
+ height: 16,
193
+ paddingHorizontal: 5,
194
+ dotSize: 8
195
+ },
196
+ md: {
197
+ fontSize: 11,
198
+ minWidth: 20,
199
+ height: 20,
200
+ paddingHorizontal: 6,
201
+ dotSize: 10
202
+ },
203
+ borderWidth: 1.5,
204
+ anchorOffset: 4
205
+ },
206
+ chip: {
207
+ sm: {
208
+ paddingHorizontal: 10,
209
+ paddingVertical: 4,
210
+ fontSize: 12,
211
+ minHeight: 26,
212
+ closeSize: 16,
213
+ closeFontSize: 12,
214
+ gap: 6
215
+ },
216
+ md: {
217
+ paddingHorizontal: 12,
218
+ paddingVertical: 6,
219
+ fontSize: 13,
220
+ minHeight: 32,
221
+ closeSize: 18,
222
+ closeFontSize: 13,
223
+ gap: 8
224
+ }
225
+ },
226
+ checkbox: {
227
+ sm: {
228
+ boxSize: 16
229
+ },
230
+ md: {
231
+ boxSize: 20
232
+ },
233
+ lg: {
234
+ boxSize: 24
235
+ },
236
+ borderWidth: 1.5,
237
+ labelGap: 10
238
+ },
239
+ radio: {
240
+ sm: {
241
+ outer: 16,
242
+ inner: 8
243
+ },
244
+ md: {
245
+ outer: 20,
246
+ inner: 10
247
+ },
248
+ lg: {
249
+ outer: 24,
250
+ inner: 12
251
+ },
252
+ borderWidth: 1.5,
253
+ labelGap: 10
254
+ },
255
+ switch: {
256
+ sm: {
257
+ trackWidth: 42,
258
+ trackHeight: 26,
259
+ thumbSize: 22,
260
+ padding: 2
261
+ },
262
+ md: {
263
+ trackWidth: 51,
264
+ trackHeight: 31,
265
+ thumbSize: 27,
266
+ padding: 2
267
+ },
268
+ lg: {
269
+ trackWidth: 60,
270
+ trackHeight: 36,
271
+ thumbSize: 32,
272
+ padding: 2
273
+ },
274
+ thumbColor: '#FFFFFF'
275
+ },
276
+ otpInput: {
277
+ sm: {
278
+ cell: 36,
279
+ fontSize: 16,
280
+ borderRadius: 8,
281
+ gap: 8
282
+ },
283
+ md: {
284
+ cell: 48,
285
+ fontSize: 20,
286
+ borderRadius: 10,
287
+ gap: 10
288
+ },
289
+ lg: {
290
+ cell: 56,
291
+ fontSize: 24,
292
+ borderRadius: 12,
293
+ gap: 12
294
+ }
295
+ },
296
+ dialog: {
297
+ iconWrapperSize: 48,
298
+ iconWrapperBorderRadius: 24,
299
+ actionButtonMinHeight: 44
300
+ },
301
+ toast: {
302
+ iconCircleSize: 28,
303
+ iconCircleBorderRadius: 14,
304
+ iconGlyphFontSize: 16,
305
+ tintBarWidth: 4
306
+ },
307
+ formField: {
308
+ inlineLabelWidth: '35%'
309
+ }
310
+ };
57
311
  const motion = {
58
312
  duration: {
59
313
  instant: 80,
@@ -262,7 +516,9 @@ const lightTheme = exports.lightTheme = {
262
516
  spacing,
263
517
  radius,
264
518
  shadows: lightShadows,
265
- motion
519
+ motion,
520
+ components,
521
+ gradients: {}
266
522
  };
267
523
  const darkTheme = exports.darkTheme = {
268
524
  mode: 'dark',
@@ -314,6 +570,8 @@ const darkTheme = exports.darkTheme = {
314
570
  spacing,
315
571
  radius,
316
572
  shadows: darkShadows,
317
- motion
573
+ motion,
574
+ components,
575
+ gradients: {}
318
576
  };
319
577
  //# sourceMappingURL=tokens.js.map