@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
|
@@ -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]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority-technologies/mobile",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Beautiful, animated, accessible React Native components plus API/auth/logging/network/storage utilities for Webority projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"react-native-device-info": ">=14.0.0",
|
|
73
73
|
"react-native-gesture-handler": "^2.21.0",
|
|
74
74
|
"react-native-keychain": ">=9.0.0",
|
|
75
|
+
"react-native-linear-gradient": ">=2.8.0",
|
|
75
76
|
"react-native-permissions": ">=4.0.0",
|
|
76
77
|
"react-native-reanimated": "^4.0.0",
|
|
77
78
|
"react-native-safe-area-context": ">=5.4.0",
|
|
@@ -96,6 +97,9 @@
|
|
|
96
97
|
"react-native-keychain": {
|
|
97
98
|
"optional": true
|
|
98
99
|
},
|
|
100
|
+
"react-native-linear-gradient": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
99
103
|
"react-native-permissions": {
|
|
100
104
|
"optional": true
|
|
101
105
|
},
|