@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
@@ -50,6 +50,260 @@ const radius = {
50
50
  '2xl': 28,
51
51
  full: 9999
52
52
  };
53
+ const components = {
54
+ button: {
55
+ xs: {
56
+ paddingHorizontal: 10,
57
+ paddingVertical: 4,
58
+ minHeight: 28,
59
+ fontSize: 12,
60
+ borderRadius: 8
61
+ },
62
+ sm: {
63
+ paddingHorizontal: 12,
64
+ paddingVertical: 6,
65
+ minHeight: 34,
66
+ fontSize: 13,
67
+ borderRadius: 10
68
+ },
69
+ md: {
70
+ paddingHorizontal: 16,
71
+ paddingVertical: 9,
72
+ minHeight: 42,
73
+ fontSize: 15,
74
+ borderRadius: 12
75
+ },
76
+ lg: {
77
+ paddingHorizontal: 20,
78
+ paddingVertical: 12,
79
+ minHeight: 50,
80
+ fontSize: 16,
81
+ borderRadius: 14
82
+ },
83
+ xl: {
84
+ paddingHorizontal: 24,
85
+ paddingVertical: 14,
86
+ minHeight: 58,
87
+ fontSize: 17,
88
+ borderRadius: 16
89
+ }
90
+ },
91
+ input: {
92
+ sm: {
93
+ paddingHorizontal: 12,
94
+ paddingVertical: 8,
95
+ minHeight: 38,
96
+ multilineMinHeight: 72,
97
+ fontSize: 13,
98
+ borderRadius: 10,
99
+ iconSize: 16
100
+ },
101
+ md: {
102
+ paddingHorizontal: 14,
103
+ paddingVertical: 11,
104
+ minHeight: 46,
105
+ multilineMinHeight: 92,
106
+ fontSize: 15,
107
+ borderRadius: 12,
108
+ iconSize: 18
109
+ },
110
+ lg: {
111
+ paddingHorizontal: 16,
112
+ paddingVertical: 14,
113
+ minHeight: 54,
114
+ multilineMinHeight: 110,
115
+ fontSize: 16,
116
+ borderRadius: 14,
117
+ iconSize: 20
118
+ }
119
+ },
120
+ searchBar: {
121
+ sm: {
122
+ height: 36,
123
+ paddingHorizontal: 10,
124
+ fontSize: 13,
125
+ iconSize: 16,
126
+ gap: 6
127
+ },
128
+ md: {
129
+ height: 44,
130
+ paddingHorizontal: 12,
131
+ fontSize: 15,
132
+ iconSize: 18,
133
+ gap: 8
134
+ },
135
+ lg: {
136
+ height: 52,
137
+ paddingHorizontal: 14,
138
+ fontSize: 16,
139
+ iconSize: 20,
140
+ gap: 10
141
+ },
142
+ cancelButtonWidth: 72
143
+ },
144
+ emptyState: {
145
+ sm: {
146
+ iconSize: 48,
147
+ titleFontSize: 'lg',
148
+ descriptionFontSize: 'sm',
149
+ paddingVertical: 'lg'
150
+ },
151
+ md: {
152
+ iconSize: 64,
153
+ titleFontSize: 'xl',
154
+ descriptionFontSize: 'base',
155
+ paddingVertical: 'xl'
156
+ },
157
+ lg: {
158
+ iconSize: 80,
159
+ titleFontSize: '2xl',
160
+ descriptionFontSize: 'base',
161
+ paddingVertical: '2xl'
162
+ }
163
+ },
164
+ listItem: {
165
+ sm: {
166
+ paddingVertical: 'sm',
167
+ titleFontSize: 'sm',
168
+ subtitleFontSize: 'xs',
169
+ minHeight: 44
170
+ },
171
+ md: {
172
+ paddingVertical: 'md',
173
+ titleFontSize: 'base',
174
+ subtitleFontSize: 'sm',
175
+ minHeight: 56
176
+ },
177
+ lg: {
178
+ paddingVertical: 'lg',
179
+ titleFontSize: 'lg',
180
+ subtitleFontSize: 'sm',
181
+ minHeight: 72
182
+ }
183
+ },
184
+ badge: {
185
+ sm: {
186
+ fontSize: 10,
187
+ minWidth: 16,
188
+ height: 16,
189
+ paddingHorizontal: 5,
190
+ dotSize: 8
191
+ },
192
+ md: {
193
+ fontSize: 11,
194
+ minWidth: 20,
195
+ height: 20,
196
+ paddingHorizontal: 6,
197
+ dotSize: 10
198
+ },
199
+ borderWidth: 1.5,
200
+ anchorOffset: 4
201
+ },
202
+ chip: {
203
+ sm: {
204
+ paddingHorizontal: 10,
205
+ paddingVertical: 4,
206
+ fontSize: 12,
207
+ minHeight: 26,
208
+ closeSize: 16,
209
+ closeFontSize: 12,
210
+ gap: 6
211
+ },
212
+ md: {
213
+ paddingHorizontal: 12,
214
+ paddingVertical: 6,
215
+ fontSize: 13,
216
+ minHeight: 32,
217
+ closeSize: 18,
218
+ closeFontSize: 13,
219
+ gap: 8
220
+ }
221
+ },
222
+ checkbox: {
223
+ sm: {
224
+ boxSize: 16
225
+ },
226
+ md: {
227
+ boxSize: 20
228
+ },
229
+ lg: {
230
+ boxSize: 24
231
+ },
232
+ borderWidth: 1.5,
233
+ labelGap: 10
234
+ },
235
+ radio: {
236
+ sm: {
237
+ outer: 16,
238
+ inner: 8
239
+ },
240
+ md: {
241
+ outer: 20,
242
+ inner: 10
243
+ },
244
+ lg: {
245
+ outer: 24,
246
+ inner: 12
247
+ },
248
+ borderWidth: 1.5,
249
+ labelGap: 10
250
+ },
251
+ switch: {
252
+ sm: {
253
+ trackWidth: 42,
254
+ trackHeight: 26,
255
+ thumbSize: 22,
256
+ padding: 2
257
+ },
258
+ md: {
259
+ trackWidth: 51,
260
+ trackHeight: 31,
261
+ thumbSize: 27,
262
+ padding: 2
263
+ },
264
+ lg: {
265
+ trackWidth: 60,
266
+ trackHeight: 36,
267
+ thumbSize: 32,
268
+ padding: 2
269
+ },
270
+ thumbColor: '#FFFFFF'
271
+ },
272
+ otpInput: {
273
+ sm: {
274
+ cell: 36,
275
+ fontSize: 16,
276
+ borderRadius: 8,
277
+ gap: 8
278
+ },
279
+ md: {
280
+ cell: 48,
281
+ fontSize: 20,
282
+ borderRadius: 10,
283
+ gap: 10
284
+ },
285
+ lg: {
286
+ cell: 56,
287
+ fontSize: 24,
288
+ borderRadius: 12,
289
+ gap: 12
290
+ }
291
+ },
292
+ dialog: {
293
+ iconWrapperSize: 48,
294
+ iconWrapperBorderRadius: 24,
295
+ actionButtonMinHeight: 44
296
+ },
297
+ toast: {
298
+ iconCircleSize: 28,
299
+ iconCircleBorderRadius: 14,
300
+ iconGlyphFontSize: 16,
301
+ tintBarWidth: 4
302
+ },
303
+ formField: {
304
+ inlineLabelWidth: '35%'
305
+ }
306
+ };
53
307
  const motion = {
54
308
  duration: {
55
309
  instant: 80,
@@ -258,7 +512,9 @@ export const lightTheme = {
258
512
  spacing,
259
513
  radius,
260
514
  shadows: lightShadows,
261
- motion
515
+ motion,
516
+ components,
517
+ gradients: {}
262
518
  };
263
519
  export const darkTheme = {
264
520
  mode: 'dark',
@@ -310,6 +566,8 @@ export const darkTheme = {
310
566
  spacing,
311
567
  radius,
312
568
  shadows: darkShadows,
313
- motion
569
+ motion,
570
+ components,
571
+ gradients: {}
314
572
  };
315
573
  //# sourceMappingURL=tokens.js.map
@@ -19,6 +19,7 @@
19
19
  import React from 'react';
20
20
  import type { StyleProp, ViewStyle } from 'react-native';
21
21
  export type SnapPoint = number | `${number}%`;
22
+ export type KeyboardBehavior = 'none' | 'shift';
22
23
  export interface BottomSheetProps {
23
24
  snapPoints: SnapPoint[];
24
25
  index?: number;
@@ -27,6 +28,15 @@ export interface BottomSheetProps {
27
28
  enablePanDownToClose?: boolean;
28
29
  enableBackdropPress?: boolean;
29
30
  backdropOpacity?: number;
31
+ /**
32
+ * How the sheet reacts to the soft keyboard.
33
+ * - `'none'` (default): the sheet stays put; keyboard may overlap content.
34
+ * - `'shift'`: animate the sheet upward by the keyboard height while it's
35
+ * visible (clamped so the sheet never extends past the top of the screen)
36
+ * and animate back when dismissed. Best for forms that live inside the
37
+ * sheet itself.
38
+ */
39
+ keyboardBehavior?: KeyboardBehavior;
30
40
  handleIndicatorStyle?: StyleProp<ViewStyle>;
31
41
  containerStyle?: StyleProp<ViewStyle>;
32
42
  children?: React.ReactNode;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
3
  import type { PressableProps, StyleProp, TextStyle, ViewStyle } from 'react-native';
4
+ import type { GradientDefinition } from '../../theme/types';
4
5
  import type { HapticType } from '../../utils/hapticUtils';
5
6
  export type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link';
6
7
  export type ButtonTone = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'neutral';
@@ -23,6 +24,13 @@ export interface ButtonProps extends Omit<PressableProps, 'style' | 'children'>
23
24
  rightIcon?: React.ReactNode;
24
25
  haptic?: HapticType | false;
25
26
  rounded?: boolean;
27
+ /**
28
+ * Optional gradient background. Pass either a key from `theme.gradients`
29
+ * (e.g. `"primary"`) or a `GradientDefinition` literal. Requires
30
+ * `react-native-linear-gradient` to be installed; without it the button
31
+ * falls back to flat colour with a dev warning.
32
+ */
33
+ gradient?: string | GradientDefinition;
26
34
  style?: StyleProp<ViewStyle>;
27
35
  textStyle?: StyleProp<TextStyle>;
28
36
  pressAnimation?: boolean;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
3
  import type { GestureResponderEvent, ImageSourcePropType, PressableProps, StyleProp, ViewStyle } from 'react-native';
4
+ import type { GradientDefinition } from '../../theme/types';
4
5
  export type CardVariant = 'elevated' | 'outlined' | 'filled';
5
6
  export type CardElevation = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
6
7
  export type CardRadius = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
@@ -24,6 +25,13 @@ export interface CardProps extends Omit<PressableProps, 'style' | 'children'> {
24
25
  * with shimmer blocks. Use this when the data driving the component is still being fetched.
25
26
  */
26
27
  loading?: boolean;
28
+ /**
29
+ * Optional gradient background. Pass a key from `theme.gradients` or a
30
+ * literal `GradientDefinition`. Layered behind the card's content so
31
+ * existing variant/elevation/radius continue to work. Requires
32
+ * `react-native-linear-gradient` to be installed.
33
+ */
34
+ gradient?: string | GradientDefinition;
27
35
  onPress?: (event: GestureResponderEvent) => void;
28
36
  accessibilityLabel?: string;
29
37
  style?: StyleProp<ViewStyle>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
2
3
  export type DialogVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';
3
4
  export type DialogActionTone = 'primary' | 'neutral' | 'danger';
4
5
  export interface DialogAction {
@@ -17,6 +18,10 @@ export interface DialogProps {
17
18
  actions?: DialogAction[];
18
19
  dismissOnAction?: boolean;
19
20
  accessibilityLabel?: string;
21
+ /** Style applied to the underlying Modal sheet (consumer may override radius, padding, etc.). */
22
+ contentStyle?: StyleProp<ViewStyle>;
23
+ /** Style applied to the dialog inner container (above icon/title/message). */
24
+ containerStyle?: StyleProp<ViewStyle>;
20
25
  testID?: string;
21
26
  }
22
27
  declare const Dialog: React.FC<DialogProps>;
@@ -20,6 +20,18 @@ export interface InputProps extends Omit<TextInputProps, 'style'> {
20
20
  variant?: InputVariant;
21
21
  required?: boolean;
22
22
  maxLength?: number;
23
+ /**
24
+ * Format the raw `value` for display. Common uses: phone-number formatting
25
+ * ("5551234567" → "(555) 123-4567"), currency, postal codes, masked IDs.
26
+ * The TextInput shows `format(value)`; user input is passed to `parse` (or
27
+ * left raw) before reaching `onChangeText`.
28
+ */
29
+ format?: (raw: string) => string;
30
+ /**
31
+ * Reverse of `format` — strips the formatted display back to the canonical
32
+ * value the consumer wants in state. If omitted, defaults to identity.
33
+ */
34
+ parse?: (formatted: string) => string;
23
35
  style?: StyleProp<ViewStyle>;
24
36
  inputStyle?: StyleProp<TextStyle>;
25
37
  labelStyle?: StyleProp<TextStyle>;
@@ -13,6 +13,11 @@ export interface SwitchProps extends Omit<PressableProps, 'style' | 'children' |
13
13
  label?: string;
14
14
  accessibilityLabel?: string;
15
15
  haptic?: HapticType | false;
16
+ /**
17
+ * When true, the thumb briefly scales up on value change (1 → 1.15 → 1).
18
+ * Use for playful/brand-flavored switches; default off for system feel.
19
+ */
20
+ bounce?: boolean;
16
21
  style?: StyleProp<ViewStyle>;
17
22
  trackStyle?: StyleProp<ViewStyle>;
18
23
  thumbStyle?: StyleProp<ViewStyle>;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { StyleProp, TextStyle, ViewStyle } from 'react-native';
2
3
  import type { HapticType } from '../../utils/hapticUtils';
3
4
  export type ToastVariant = 'default' | 'success' | 'error' | 'warning' | 'info';
4
5
  export type ToastPosition = 'top' | 'bottom';
@@ -15,6 +16,10 @@ export interface ToastOptions {
15
16
  action?: ToastAction;
16
17
  haptic?: HapticType | false;
17
18
  icon?: React.ReactNode;
19
+ /** Style applied to the toast container (override radius, padding, shadow per-toast). */
20
+ style?: StyleProp<ViewStyle>;
21
+ /** Style applied to the toast message Text. */
22
+ textStyle?: StyleProp<TextStyle>;
18
23
  }
19
24
  export interface ToastItem extends ToastOptions {
20
25
  id: string;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
3
+ import type { GradientDefinition } from './types';
4
+ export interface GradientProps {
5
+ gradient: GradientDefinition;
6
+ style?: StyleProp<ViewStyle>;
7
+ children?: React.ReactNode;
8
+ }
9
+ export declare const Gradient: React.FC<GradientProps>;
10
+ export declare const isGradientAvailable: () => boolean;
11
+ //# sourceMappingURL=Gradient.d.ts.map
@@ -9,5 +9,9 @@ export { ThemeProvider, useTheme, useThemeMode } from './ThemeContext';
9
9
  export type { ThemeProviderProps, ColorSchemePreference } from './ThemeContext';
10
10
  export { lightTheme, darkTheme } from './tokens';
11
11
  export { mergeTheme } from './merge';
12
- export type { ColorMode, ColorPalette, RadiusScale, ShadowDefinition, ShadowScale, SpacingScale, Theme, ThemeOverrides, TypographyScale, MotionScale, DeepPartial } from './types';
12
+ export { fontFor } from './textStyle';
13
+ export type { FontWeightKey } from './textStyle';
14
+ export { Gradient, isGradientAvailable } from './Gradient';
15
+ export type { GradientProps } from './Gradient';
16
+ export type { ColorMode, ColorPalette, GradientDefinition, GradientScale, RadiusScale, ShadowDefinition, ShadowScale, SpacingScale, Theme, ThemeOverrides, TypographyScale, MotionScale, DeepPartial } from './types';
13
17
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { TextStyle } from 'react-native';
2
+ import type { Theme, TypographyScale } from './types';
3
+ export type FontWeightKey = keyof TypographyScale['fontWeight'];
4
+ /**
5
+ * Resolve text-weight style for the active theme.
6
+ *
7
+ * When the consumer registers a brand `theme.typography.fontFamily.<weight>`,
8
+ * we set `fontFamily` and leave `fontWeight` undefined — RN can't combine the
9
+ * two reliably across iOS/Android once a custom face is in play, so the brand
10
+ * file controls the weight glyph itself. Falls back to `fontWeight` when no
11
+ * brand font is registered for that weight.
12
+ *
13
+ * Note: the fontWeight scale uses `normal` while FontFamilyScale uses
14
+ * `regular` (the conventional font-name suffix). The helper maps between
15
+ * them transparently.
16
+ */
17
+ export declare const fontFor: (theme: Theme, weight: FontWeightKey) => Pick<TextStyle, "fontFamily" | "fontWeight">;
18
+ //# sourceMappingURL=textStyle.d.ts.map
@@ -1,5 +1,32 @@
1
1
  import type { TextStyle, ViewStyle } from 'react-native';
2
2
  export type ColorMode = 'light' | 'dark';
3
+ /**
4
+ * A linear gradient definition used by Button, Card and consumer components.
5
+ * `colors` must have at least 2 entries. `start`/`end` follow the
6
+ * react-native-linear-gradient convention: { x: 0..1, y: 0..1 }.
7
+ */
8
+ export interface GradientDefinition {
9
+ colors: string[];
10
+ locations?: number[];
11
+ start?: {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ end?: {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ }
20
+ export interface GradientScale {
21
+ /** Brand-primary gradient — used by `Button gradient` and `Card gradient="primary"`. */
22
+ primary?: GradientDefinition;
23
+ /** Secondary brand gradient. */
24
+ secondary?: GradientDefinition;
25
+ /** Backdrop / banner gradient (for hero sections). */
26
+ surface?: GradientDefinition;
27
+ /** Free-form named gradients. Consumer extends as needed. */
28
+ [key: string]: GradientDefinition | undefined;
29
+ }
3
30
  export interface ColorPalette {
4
31
  primary: string;
5
32
  primaryHover: string;
@@ -44,6 +71,13 @@ export interface ColorPalette {
44
71
  highlight: string;
45
72
  };
46
73
  }
74
+ export interface FontFamilyScale {
75
+ /** Font family for normal-weight text. Falls back to platform system font when undefined. */
76
+ regular?: string;
77
+ medium?: string;
78
+ semibold?: string;
79
+ bold?: string;
80
+ }
47
81
  export interface TypographyScale {
48
82
  fontSize: {
49
83
  xs: number;
@@ -61,6 +95,13 @@ export interface TypographyScale {
61
95
  semibold: TextStyle['fontWeight'];
62
96
  bold: TextStyle['fontWeight'];
63
97
  };
98
+ /**
99
+ * Optional brand font families. When set, library text components prefer
100
+ * `fontFamily.<weight>` over `fontWeight.<weight>` to match the consumer
101
+ * app's typeface. Each key is independently optional — leave undefined to
102
+ * fall back to the system font for that weight.
103
+ */
104
+ fontFamily?: FontFamilyScale;
64
105
  lineHeight: {
65
106
  tight: number;
66
107
  normal: number;
@@ -145,6 +186,135 @@ export interface MotionScale {
145
186
  };
146
187
  };
147
188
  }
189
+ /**
190
+ * Per-component size tokens. Each component that exposes a `size` prop
191
+ * resolves dimensions via `theme.components.<name>[size]`. Library ships
192
+ * sensible defaults; consumer overrides win via `mergeTheme`.
193
+ *
194
+ * Keep entries here as components gain themable per-size dimensions —
195
+ * this is the single home for "X is X tall, has Y radius, uses Z font size".
196
+ */
197
+ export type ComponentSizeKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
198
+ export interface ButtonSizeTokens {
199
+ paddingHorizontal: number;
200
+ paddingVertical: number;
201
+ minHeight: number;
202
+ fontSize: number;
203
+ borderRadius: number;
204
+ }
205
+ export interface InputSizeTokens {
206
+ paddingHorizontal: number;
207
+ paddingVertical: number;
208
+ minHeight: number;
209
+ multilineMinHeight: number;
210
+ fontSize: number;
211
+ borderRadius: number;
212
+ iconSize: number;
213
+ }
214
+ export interface SearchBarSizeTokens {
215
+ height: number;
216
+ paddingHorizontal: number;
217
+ fontSize: number;
218
+ iconSize: number;
219
+ gap: number;
220
+ }
221
+ export interface EmptyStateSizeTokens {
222
+ iconSize: number;
223
+ /** Resolves against the active theme's typography.fontSize scale, e.g. "lg", "xl", "2xl". */
224
+ titleFontSize: keyof TypographyScale['fontSize'];
225
+ descriptionFontSize: keyof TypographyScale['fontSize'];
226
+ /** Resolves against the active theme's spacing scale. */
227
+ paddingVertical: keyof SpacingScale;
228
+ }
229
+ export interface ListItemSizeTokens {
230
+ /** Resolves against the active theme's spacing scale. */
231
+ paddingVertical: keyof SpacingScale;
232
+ titleFontSize: keyof TypographyScale['fontSize'];
233
+ subtitleFontSize: keyof TypographyScale['fontSize'];
234
+ minHeight: number;
235
+ }
236
+ export interface BadgeSizeTokens {
237
+ fontSize: number;
238
+ minWidth: number;
239
+ height: number;
240
+ paddingHorizontal: number;
241
+ dotSize: number;
242
+ }
243
+ export interface ChipSizeTokens {
244
+ paddingHorizontal: number;
245
+ paddingVertical: number;
246
+ fontSize: number;
247
+ minHeight: number;
248
+ closeSize: number;
249
+ closeFontSize: number;
250
+ gap: number;
251
+ }
252
+ export interface SwitchSizeTokens {
253
+ trackWidth: number;
254
+ trackHeight: number;
255
+ thumbSize: number;
256
+ padding: number;
257
+ }
258
+ export interface OTPInputSizeTokens {
259
+ cell: number;
260
+ fontSize: number;
261
+ borderRadius: number;
262
+ gap: number;
263
+ }
264
+ export interface DialogTokens {
265
+ iconWrapperSize: number;
266
+ iconWrapperBorderRadius: number;
267
+ actionButtonMinHeight: number;
268
+ }
269
+ export interface ToastTokens {
270
+ iconCircleSize: number;
271
+ iconCircleBorderRadius: number;
272
+ iconGlyphFontSize: number;
273
+ tintBarWidth: number;
274
+ }
275
+ export interface FormFieldTokens {
276
+ /** Width of the inline label column when `layout="inline"`. Accepts CSS-like string ("35%") or number. */
277
+ inlineLabelWidth: number | `${number}%`;
278
+ }
279
+ export interface BadgeTokens extends Partial<Record<'sm' | 'md', BadgeSizeTokens>> {
280
+ borderWidth?: number;
281
+ anchorOffset?: number;
282
+ }
283
+ export interface CheckboxSizeTokens {
284
+ boxSize: number;
285
+ }
286
+ export interface CheckboxTokens extends Partial<Record<ComponentSizeKey, CheckboxSizeTokens>> {
287
+ borderWidth?: number;
288
+ labelGap?: number;
289
+ }
290
+ export interface RadioSizeTokens {
291
+ outer: number;
292
+ inner: number;
293
+ }
294
+ export interface RadioTokens extends Partial<Record<ComponentSizeKey, RadioSizeTokens>> {
295
+ borderWidth?: number;
296
+ labelGap?: number;
297
+ }
298
+ export interface ComponentTokens {
299
+ button?: Partial<Record<ComponentSizeKey, ButtonSizeTokens>>;
300
+ input?: Partial<Record<ComponentSizeKey, InputSizeTokens>>;
301
+ searchBar?: Partial<Record<ComponentSizeKey, SearchBarSizeTokens>> & {
302
+ cancelButtonWidth?: number;
303
+ };
304
+ emptyState?: Partial<Record<ComponentSizeKey, EmptyStateSizeTokens>>;
305
+ listItem?: Partial<Record<ComponentSizeKey, ListItemSizeTokens>>;
306
+ badge?: BadgeTokens;
307
+ chip?: Partial<Record<ComponentSizeKey, ChipSizeTokens>>;
308
+ checkbox?: CheckboxTokens;
309
+ radio?: RadioTokens;
310
+ switch?: Partial<Record<ComponentSizeKey, SwitchSizeTokens>> & {
311
+ thumbColor?: string;
312
+ };
313
+ otpInput?: Partial<Record<ComponentSizeKey, OTPInputSizeTokens>>;
314
+ dialog?: DialogTokens;
315
+ toast?: ToastTokens;
316
+ formField?: FormFieldTokens;
317
+ }
148
318
  export interface Theme {
149
319
  mode: ColorMode;
150
320
  colors: ColorPalette;
@@ -153,6 +323,14 @@ export interface Theme {
153
323
  radius: RadiusScale;
154
324
  shadows: ShadowScale;
155
325
  motion: MotionScale;
326
+ components: ComponentTokens;
327
+ /**
328
+ * Optional brand gradient palette. Empty by default — consumers register
329
+ * their own via theme overrides. Components that accept gradient inputs
330
+ * (Button, Card) read from here when consumers pass a string token, OR
331
+ * accept a `GradientDefinition` literal directly.
332
+ */
333
+ gradients: GradientScale;
156
334
  }
157
335
  export type DeepPartial<T> = T extends object ? {
158
336
  [K in keyof T]?: DeepPartial<T[K]>;
@@ -19,6 +19,7 @@
19
19
  import React from 'react';
20
20
  import type { StyleProp, ViewStyle } from 'react-native';
21
21
  export type SnapPoint = number | `${number}%`;
22
+ export type KeyboardBehavior = 'none' | 'shift';
22
23
  export interface BottomSheetProps {
23
24
  snapPoints: SnapPoint[];
24
25
  index?: number;
@@ -27,6 +28,15 @@ export interface BottomSheetProps {
27
28
  enablePanDownToClose?: boolean;
28
29
  enableBackdropPress?: boolean;
29
30
  backdropOpacity?: number;
31
+ /**
32
+ * How the sheet reacts to the soft keyboard.
33
+ * - `'none'` (default): the sheet stays put; keyboard may overlap content.
34
+ * - `'shift'`: animate the sheet upward by the keyboard height while it's
35
+ * visible (clamped so the sheet never extends past the top of the screen)
36
+ * and animate back when dismissed. Best for forms that live inside the
37
+ * sheet itself.
38
+ */
39
+ keyboardBehavior?: KeyboardBehavior;
30
40
  handleIndicatorStyle?: StyleProp<ViewStyle>;
31
41
  containerStyle?: StyleProp<ViewStyle>;
32
42
  children?: React.ReactNode;