@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.
- package/lib/commonjs/components/Accordion/Accordion.js +3 -3
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Badge/Badge.js +24 -14
- package/lib/commonjs/components/Banner/Banner.js +2 -2
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +39 -5
- package/lib/commonjs/components/Button/Button.js +25 -6
- package/lib/commonjs/components/Card/Card.js +13 -1
- package/lib/commonjs/components/Carousel/Carousel.js +2 -2
- package/lib/commonjs/components/Checkbox/Checkbox.js +6 -4
- package/lib/commonjs/components/Chip/Chip.js +12 -3
- package/lib/commonjs/components/DatePicker/DatePicker.js +8 -8
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +4 -4
- package/lib/commonjs/components/Dialog/Dialog.js +15 -8
- package/lib/commonjs/components/EmptyState/EmptyState.js +32 -26
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +2 -2
- package/lib/commonjs/components/FormField/FormField.js +4 -4
- package/lib/commonjs/components/Input/Input.js +18 -10
- package/lib/commonjs/components/ListItem/ListItem.js +33 -27
- package/lib/commonjs/components/Modal/Modal.js +4 -4
- package/lib/commonjs/components/OTPInput/OTPInput.js +7 -4
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +2 -2
- package/lib/commonjs/components/Radio/Radio.js +8 -7
- package/lib/commonjs/components/SearchBar/SearchBar.js +10 -6
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +2 -2
- package/lib/commonjs/components/Select/Select.js +3 -3
- package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
- package/lib/commonjs/components/Slider/Slider.js +6 -6
- package/lib/commonjs/components/Spinner/Spinner.js +2 -2
- package/lib/commonjs/components/Stepper/Stepper.js +3 -3
- package/lib/commonjs/components/Switch/Switch.js +33 -4
- package/lib/commonjs/components/Tabs/Tabs.js +2 -2
- package/lib/commonjs/components/TimePicker/TimePicker.js +3 -3
- package/lib/commonjs/components/Toast/Toast.js +19 -14
- package/lib/commonjs/components/Tooltip/Tooltip.js +2 -2
- package/lib/commonjs/theme/Gradient.js +57 -0
- package/lib/commonjs/theme/animatedValue.js +28 -0
- package/lib/commonjs/theme/index.js +27 -0
- package/lib/commonjs/theme/textStyle.js +37 -0
- package/lib/commonjs/theme/tokens.js +260 -2
- package/lib/module/components/Accordion/Accordion.js +4 -4
- package/lib/module/components/Avatar/Avatar.js +2 -2
- package/lib/module/components/Badge/Badge.js +25 -15
- package/lib/module/components/Banner/Banner.js +3 -3
- package/lib/module/components/BottomNavigation/BottomNavigation.js +2 -2
- package/lib/module/components/BottomSheet/BottomSheet.js +40 -6
- package/lib/module/components/Button/Button.js +26 -7
- package/lib/module/components/Card/Card.js +14 -2
- package/lib/module/components/Carousel/Carousel.js +3 -3
- package/lib/module/components/Checkbox/Checkbox.js +7 -5
- package/lib/module/components/Chip/Chip.js +13 -4
- package/lib/module/components/DatePicker/DatePicker.js +9 -9
- package/lib/module/components/DateRangePicker/DateRangePicker.js +5 -5
- package/lib/module/components/Dialog/Dialog.js +16 -9
- package/lib/module/components/EmptyState/EmptyState.js +33 -27
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +3 -3
- package/lib/module/components/FormField/FormField.js +5 -5
- package/lib/module/components/Input/Input.js +19 -11
- package/lib/module/components/ListItem/ListItem.js +34 -28
- package/lib/module/components/Modal/Modal.js +5 -5
- package/lib/module/components/OTPInput/OTPInput.js +8 -5
- package/lib/module/components/ProgressBar/ProgressBar.js +3 -3
- package/lib/module/components/Radio/Radio.js +9 -8
- package/lib/module/components/SearchBar/SearchBar.js +11 -7
- package/lib/module/components/SegmentedControl/SegmentedControl.js +3 -3
- package/lib/module/components/Select/Select.js +4 -4
- package/lib/module/components/Skeleton/Skeleton.js +2 -2
- package/lib/module/components/Slider/Slider.js +7 -7
- package/lib/module/components/Spinner/Spinner.js +3 -3
- package/lib/module/components/Stepper/Stepper.js +4 -4
- package/lib/module/components/Switch/Switch.js +34 -5
- package/lib/module/components/Tabs/Tabs.js +3 -3
- package/lib/module/components/TimePicker/TimePicker.js +4 -4
- package/lib/module/components/Toast/Toast.js +20 -15
- package/lib/module/components/Tooltip/Tooltip.js +3 -3
- package/lib/module/theme/Gradient.js +50 -0
- package/lib/module/theme/animatedValue.js +24 -0
- package/lib/module/theme/index.js +3 -0
- package/lib/module/theme/textStyle.js +32 -0
- package/lib/module/theme/tokens.js +260 -2
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +10 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +8 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +8 -0
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +5 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +12 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +5 -0
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts +5 -0
- package/lib/typescript/commonjs/theme/Gradient.d.ts +11 -0
- package/lib/typescript/commonjs/theme/animatedValue.d.ts +21 -0
- package/lib/typescript/commonjs/theme/index.d.ts +6 -1
- package/lib/typescript/commonjs/theme/textStyle.d.ts +18 -0
- package/lib/typescript/commonjs/theme/types.d.ts +178 -0
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +10 -0
- package/lib/typescript/module/components/Button/Button.d.ts +8 -0
- package/lib/typescript/module/components/Card/Card.d.ts +8 -0
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +5 -0
- package/lib/typescript/module/components/Input/Input.d.ts +12 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts +5 -0
- package/lib/typescript/module/components/Toast/Toast.d.ts +5 -0
- package/lib/typescript/module/theme/Gradient.d.ts +11 -0
- package/lib/typescript/module/theme/animatedValue.d.ts +21 -0
- package/lib/typescript/module/theme/index.d.ts +6 -1
- package/lib/typescript/module/theme/textStyle.d.ts +18 -0
- package/lib/typescript/module/theme/types.d.ts +178 -0
- package/package.json +5 -1
|
@@ -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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Create an `Animated.Value` that survives RN 0.85's dev-mode prop deepFreeze.
|
|
4
|
+
*
|
|
5
|
+
* RN's Fabric renderer deep-freezes prop trees on host components. If an
|
|
6
|
+
* `Animated.Value` is reachable from a `style` prop via interpolation chains
|
|
7
|
+
* (the `_parent` ref on `AnimatedInterpolation` nodes), the recursive freeze
|
|
8
|
+
* converts the value's `_animation` slot into a throwing setter — the next
|
|
9
|
+
* `Animated.timing(v).start()` then crashes with
|
|
10
|
+
* "_animation: object that is meant to be immutable".
|
|
11
|
+
*
|
|
12
|
+
* Sealing the value at construction makes `Object.isSealed(v) === true`,
|
|
13
|
+
* which causes `deepFreezeAndThrowOnMutationInDev` to skip-and-return at
|
|
14
|
+
* its top guard. Existing-property mutation (`_animation`, `_value`,
|
|
15
|
+
* `_listeners`, `_tracking`) keeps working — seal only blocks adding NEW
|
|
16
|
+
* properties, and `Animated.Value` doesn't add any post-construction.
|
|
17
|
+
*
|
|
18
|
+
* Use everywhere the library would otherwise call `new Animated.Value(...)`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createAnimatedValue: (initial: number, config?: ConstructorParameters<typeof Animated.Value>[1]) => Animated.Value;
|
|
21
|
+
//# sourceMappingURL=animatedValue.d.ts.map
|
|
@@ -9,5 +9,10 @@ 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
|
|
12
|
+
export { fontFor } from './textStyle';
|
|
13
|
+
export type { FontWeightKey } from './textStyle';
|
|
14
|
+
export { createAnimatedValue } from './animatedValue';
|
|
15
|
+
export { Gradient, isGradientAvailable } from './Gradient';
|
|
16
|
+
export type { GradientProps } from './Gradient';
|
|
17
|
+
export type { ColorMode, ColorPalette, GradientDefinition, GradientScale, RadiusScale, ShadowDefinition, ShadowScale, SpacingScale, Theme, ThemeOverrides, TypographyScale, MotionScale, DeepPartial } from './types';
|
|
13
18
|
//# 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;
|
|
@@ -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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Animated } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Create an `Animated.Value` that survives RN 0.85's dev-mode prop deepFreeze.
|
|
4
|
+
*
|
|
5
|
+
* RN's Fabric renderer deep-freezes prop trees on host components. If an
|
|
6
|
+
* `Animated.Value` is reachable from a `style` prop via interpolation chains
|
|
7
|
+
* (the `_parent` ref on `AnimatedInterpolation` nodes), the recursive freeze
|
|
8
|
+
* converts the value's `_animation` slot into a throwing setter — the next
|
|
9
|
+
* `Animated.timing(v).start()` then crashes with
|
|
10
|
+
* "_animation: object that is meant to be immutable".
|
|
11
|
+
*
|
|
12
|
+
* Sealing the value at construction makes `Object.isSealed(v) === true`,
|
|
13
|
+
* which causes `deepFreezeAndThrowOnMutationInDev` to skip-and-return at
|
|
14
|
+
* its top guard. Existing-property mutation (`_animation`, `_value`,
|
|
15
|
+
* `_listeners`, `_tracking`) keeps working — seal only blocks adding NEW
|
|
16
|
+
* properties, and `Animated.Value` doesn't add any post-construction.
|
|
17
|
+
*
|
|
18
|
+
* Use everywhere the library would otherwise call `new Animated.Value(...)`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const createAnimatedValue: (initial: number, config?: ConstructorParameters<typeof Animated.Value>[1]) => Animated.Value;
|
|
21
|
+
//# sourceMappingURL=animatedValue.d.ts.map
|
|
@@ -9,5 +9,10 @@ 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
|
|
12
|
+
export { fontFor } from './textStyle';
|
|
13
|
+
export type { FontWeightKey } from './textStyle';
|
|
14
|
+
export { createAnimatedValue } from './animatedValue';
|
|
15
|
+
export { Gradient, isGradientAvailable } from './Gradient';
|
|
16
|
+
export type { GradientProps } from './Gradient';
|
|
17
|
+
export type { ColorMode, ColorPalette, GradientDefinition, GradientScale, RadiusScale, ShadowDefinition, ShadowScale, SpacingScale, Theme, ThemeOverrides, TypographyScale, MotionScale, DeepPartial } from './types';
|
|
13
18
|
//# 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
|