@impulse-ui-native/theme 1.0.10 → 2.0.1

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 (43) hide show
  1. package/README.md +53 -0
  2. package/dist/index.d.mts +446 -101
  3. package/dist/index.js +1052 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +21 -16
  6. package/dist/index.cjs.js +0 -429
  7. package/dist/index.cjs.js.map +0 -1
  8. package/dist/index.d.ts +0 -209
  9. package/dist/index.esm.js +0 -406
  10. package/dist/index.esm.js.map +0 -1
  11. package/src/constants/index.ts +0 -2
  12. package/src/constants/style.constants.ts +0 -80
  13. package/src/constants/typography.constants.ts +0 -25
  14. package/src/hooks/index.ts +0 -8
  15. package/src/hooks/use-border.hook.ts +0 -10
  16. package/src/hooks/use-colors.hook.ts +0 -10
  17. package/src/hooks/use-components-theme.hook.ts +0 -13
  18. package/src/hooks/use-radii.hook.ts +0 -10
  19. package/src/hooks/use-space.hook.ts +0 -10
  20. package/src/hooks/use-style-props.hook.ts +0 -9
  21. package/src/hooks/use-theme.hook.ts +0 -10
  22. package/src/hooks/use-themed-styles.ts +0 -25
  23. package/src/index.ts +0 -6
  24. package/src/providers/index.ts +0 -1
  25. package/src/providers/theme.provider.tsx +0 -113
  26. package/src/theme/dark.theme.ts +0 -40
  27. package/src/theme/index.ts +0 -4
  28. package/src/theme/light.theme.ts +0 -40
  29. package/src/theme/tokens.theme.ts +0 -64
  30. package/src/types/border.types.ts +0 -8
  31. package/src/types/color.types.ts +0 -7
  32. package/src/types/components.types.ts +0 -1
  33. package/src/types/dimension.types.ts +0 -11
  34. package/src/types/flex.types.ts +0 -27
  35. package/src/types/index.ts +0 -11
  36. package/src/types/shadow.types.ts +0 -9
  37. package/src/types/spacing.types.ts +0 -19
  38. package/src/types/style.types.ts +0 -19
  39. package/src/types/theme-provider.types.ts +0 -65
  40. package/src/types/tokens.types.ts +0 -88
  41. package/src/types/typography.types.ts +0 -66
  42. package/src/utils/index.ts +0 -1
  43. package/src/utils/style.utils.ts +0 -31
package/dist/index.d.mts CHANGED
@@ -1,26 +1,37 @@
1
- import { ViewStyle, TextStyle, DimensionValue, StyleSheet } from 'react-native';
2
- import { DeepPartial } from '@impulse-ui-native/core';
1
+ import { ViewStyle, TextStyle, StyleSheet } from 'react-native';
3
2
  import * as react from 'react';
4
3
  import { PropsWithChildren } from 'react';
4
+ import { DeepPartial } from '@impulse-ui-native/core';
5
5
 
6
- declare const StylePropsSet: Set<keyof SpacingProps | keyof ColorProps | keyof ShadowProps | keyof BorderProps | keyof TypographyProps | keyof FlexProps | keyof DimensionProps>;
7
-
8
- type BorderProps = {
9
- borderRadius?: ViewStyle['borderRadius'];
10
- borderColor?: ViewStyle['borderColor'];
11
- borderWidth?: ViewStyle['borderWidth'];
12
- borderStyle?: ViewStyle['borderStyle'];
13
- };
6
+ interface BorderProps {
7
+ borderRadius?: ViewStyle["borderRadius"];
8
+ borderTopLeftRadius?: ViewStyle["borderTopLeftRadius"];
9
+ borderTopRightRadius?: ViewStyle["borderTopRightRadius"];
10
+ borderBottomLeftRadius?: ViewStyle["borderBottomLeftRadius"];
11
+ borderBottomRightRadius?: ViewStyle["borderBottomRightRadius"];
12
+ borderWidth?: ViewStyle["borderWidth"];
13
+ borderTopWidth?: ViewStyle["borderTopWidth"];
14
+ borderRightWidth?: ViewStyle["borderRightWidth"];
15
+ borderBottomWidth?: ViewStyle["borderBottomWidth"];
16
+ borderLeftWidth?: ViewStyle["borderLeftWidth"];
17
+ borderColor?: ViewStyle["borderColor"];
18
+ borderTopColor?: ViewStyle["borderTopColor"];
19
+ borderRightColor?: ViewStyle["borderRightColor"];
20
+ borderBottomColor?: ViewStyle["borderBottomColor"];
21
+ borderLeftColor?: ViewStyle["borderLeftColor"];
22
+ borderStyle?: ViewStyle["borderStyle"];
23
+ }
14
24
 
15
- type ColorProps = {
16
- color?: TextStyle['color'];
17
- backgroundColor?: ViewStyle['backgroundColor'];
18
- opacity?: ViewStyle['opacity'];
19
- };
25
+ interface ColorProps {
26
+ color?: TextStyle["color"];
27
+ backgroundColor?: ViewStyle["backgroundColor"];
28
+ opacity?: ViewStyle["opacity"];
29
+ }
20
30
 
21
31
  type ComponentSize = "small" | "medium" | "large";
32
+ type ComponentVariant = "filled" | "outlined" | "soft" | "ghost" | "plain";
22
33
 
23
- type DimensionProps = {
34
+ interface DimensionProps {
24
35
  width?: ViewStyle["width"];
25
36
  height?: ViewStyle["height"];
26
37
  minWidth?: ViewStyle["minWidth"];
@@ -28,7 +39,8 @@ type DimensionProps = {
28
39
  minHeight?: ViewStyle["minHeight"];
29
40
  maxHeight?: ViewStyle["maxHeight"];
30
41
  aspectRatio?: ViewStyle["aspectRatio"];
31
- };
42
+ overflow?: ViewStyle["overflow"];
43
+ }
32
44
 
33
45
  type FlexProps = {
34
46
  flex?: ViewStyle["flex"];
@@ -49,37 +61,74 @@ type FlexProps = {
49
61
  right?: ViewStyle["right"];
50
62
  bottom?: ViewStyle["bottom"];
51
63
  left?: ViewStyle["left"];
64
+ zIndex?: ViewStyle["zIndex"];
52
65
  };
53
66
 
67
+ type ShadowLevel = "none" | "xs" | "sm" | "md" | "lg" | "xl";
68
+ type ShadowPosition = "around" | "bottom" | "top";
69
+ type ShadowIntensity = {
70
+ radius: number;
71
+ opacity: number;
72
+ elevation: number;
73
+ };
54
74
  type ShadowProps = {
55
- shadowColor?: ViewStyle['shadowColor'];
56
- shadowOpacity?: ViewStyle['shadowOpacity'];
57
- shadowRadius?: ViewStyle['shadowRadius'];
58
- shadowOffset?: ViewStyle['shadowOffset'];
59
- elevation?: ViewStyle['elevation'];
75
+ shadow?: ShadowLevel;
76
+ shadowPosition?: ShadowPosition;
77
+ shadowColor?: ViewStyle["shadowColor"];
78
+ shadowOpacity?: ViewStyle["shadowOpacity"];
79
+ shadowRadius?: ViewStyle["shadowRadius"];
80
+ shadowOffset?: ViewStyle["shadowOffset"];
81
+ elevation?: ViewStyle["elevation"];
60
82
  };
61
83
 
62
- type SpacingProps = {
63
- margin?: ViewStyle['margin'];
64
- marginTop?: ViewStyle['marginTop'];
65
- marginBottom?: ViewStyle['marginBottom'];
66
- marginLeft?: ViewStyle['marginLeft'];
67
- marginRight?: ViewStyle['marginRight'];
68
- marginHorizontal?: ViewStyle['marginHorizontal'];
69
- marginVertical?: ViewStyle['marginVertical'];
70
- padding?: ViewStyle['padding'];
71
- paddingTop?: ViewStyle['paddingTop'];
72
- paddingBottom?: ViewStyle['paddingBottom'];
73
- paddingLeft?: ViewStyle['paddingLeft'];
74
- paddingRight?: ViewStyle['paddingRight'];
75
- paddingHorizontal?: ViewStyle['paddingHorizontal'];
76
- paddingVertical?: ViewStyle['paddingVertical'];
77
- };
84
+ interface SpacingProps {
85
+ margin?: ViewStyle["margin"];
86
+ marginTop?: ViewStyle["marginTop"];
87
+ marginBottom?: ViewStyle["marginBottom"];
88
+ marginLeft?: ViewStyle["marginLeft"];
89
+ marginRight?: ViewStyle["marginRight"];
90
+ marginHorizontal?: ViewStyle["marginHorizontal"];
91
+ marginVertical?: ViewStyle["marginVertical"];
92
+ padding?: ViewStyle["padding"];
93
+ paddingTop?: ViewStyle["paddingTop"];
94
+ paddingBottom?: ViewStyle["paddingBottom"];
95
+ paddingLeft?: ViewStyle["paddingLeft"];
96
+ paddingRight?: ViewStyle["paddingRight"];
97
+ paddingHorizontal?: ViewStyle["paddingHorizontal"];
98
+ paddingVertical?: ViewStyle["paddingVertical"];
99
+ }
78
100
 
79
- type TypographyProps = {
101
+ type FontWeightNormal = "Montserrat_100Thin" | "Montserrat_200ExtraLight" | "Montserrat_300Light" | "Montserrat_400Regular" | "Montserrat_500Medium" | "Montserrat_600SemiBold" | "Montserrat_700Bold" | "Montserrat_800ExtraBold" | "Montserrat_900Black";
102
+ type FontWeightItalic = "Montserrat_100Thin_Italic" | "Montserrat_200ExtraLight_Italic" | "Montserrat_300Light_Italic" | "Montserrat_400Regular_Italic" | "Montserrat_500Medium_Italic" | "Montserrat_600SemiBold_Italic" | "Montserrat_700Bold_Italic" | "Montserrat_800ExtraBold_Italic" | "Montserrat_900Black_Italic";
103
+ type FontWeightValue = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
104
+ type SpaceSizesKey = "none" | "xxs" | "xs" | "mxs" | "sm" | "msm" | "md" | "lg" | "xl" | "xxl";
105
+ type Space = Record<SpaceSizesKey, number>;
106
+ type TypographyKey = "xxs" | "xs" | "xsm" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "huge" | "massive" | "giant" | "colossal";
107
+ type FontSize = Record<TypographyKey, number>;
108
+ type LineHeight = Record<TypographyKey, number>;
109
+ type FontWeightKeys = "thin" | "extraLight" | "light" | "regular" | "medium" | "semiBold" | "bold" | "extraBold" | "black";
110
+ type FontFamily = Record<"normal" | "italic", Record<FontWeightValue, string>>;
111
+ type FontWeight = Record<FontWeightKeys, FontWeightValue>;
112
+ type LetterSpacingKey = "tightest" | "tighter" | "tight" | "normal" | "wide" | "wider" | "widest" | "ultraWide";
113
+ type LetterSpacings = Record<LetterSpacingKey, number>;
114
+ type BorderSizeKey = "sm" | "md" | "lg" | "xl" | "xxl";
115
+ type BorderSize = Record<BorderSizeKey, number>;
116
+ type RadiusKey = "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "round";
117
+ type Radii = Record<RadiusKey, number>;
118
+ type RadiusDrawnKey = "drawn1" | "drawn2" | "drawn3" | "drawn4" | "drawn5" | "drawn6";
119
+ type RadiiDrawn = Record<RadiusDrawnKey, string>;
120
+ type RadiusBlobKey = "blob1" | "blob2" | "blob3" | "blob4" | "blob5";
121
+ type RadiiBlob = Record<RadiusBlobKey, string>;
122
+ type RadiusConditionalKey = "conditional1" | "conditional2" | "conditional3" | "conditional4" | "conditional5" | "conditional6";
123
+ type RadiiConditional = Record<RadiusConditionalKey, string>;
124
+ type NeutralColorKey = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
125
+ type NeutralColor = Record<NeutralColorKey, string>;
126
+
127
+ interface TypographyProps {
80
128
  fontSize?: TextStyle["fontSize"];
81
129
  fontFamily?: TextStyle["fontFamily"];
82
- fontWeight?: FontWeightKey;
130
+ fontWeight?: FontWeightValue;
131
+ fontVariant?: TextStyle["fontVariant"];
83
132
  fontStyle?: TextStyle["fontStyle"];
84
133
  letterSpacing?: TextStyle["letterSpacing"];
85
134
  lineHeight?: TextStyle["lineHeight"];
@@ -91,84 +140,369 @@ type TypographyProps = {
91
140
  includeFontPadding?: TextStyle["includeFontPadding"];
92
141
  textAlignVertical?: TextStyle["textAlignVertical"];
93
142
  writingDirection?: TextStyle["writingDirection"];
94
- };
143
+ }
95
144
  type TypographyPresetKey = "Master" | "DisplayLarge" | "DisplayMedium" | "DisplaySmall" | "Title1" | "Title2" | "Title3" | "Title4" | "Title5" | "Title6" | "Subtitle1" | "Subtitle2" | "BodyLarge" | "Body" | "BodySmall" | "Caption" | "Label" | "Overline" | "Helper" | "Code" | "Quote" | "Eyebrow";
96
- type FontWeightNormal = "Montserrat_100Thin" | "Montserrat_200ExtraLight" | "Montserrat_300Light" | "Montserrat_400Regular" | "Montserrat_500Medium" | "Montserrat_600SemiBold" | "Montserrat_700Bold" | "Montserrat_800ExtraBold" | "Montserrat_900Black";
97
- type FontWeightItalic = "Montserrat_100Thin_Italic" | "Montserrat_200ExtraLight_Italic" | "Montserrat_300Light_Italic" | "Montserrat_400Regular_Italic" | "Montserrat_500Medium_Italic" | "Montserrat_600SemiBold_Italic" | "Montserrat_700Bold_Italic" | "Montserrat_800ExtraBold_Italic" | "Montserrat_900Black_Italic";
98
- type FontWeightKey = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
99
145
 
100
146
  type StyleProps = Partial<SpacingProps & ColorProps & ShadowProps & BorderProps & TypographyProps & FlexProps & DimensionProps>;
101
147
  type StylePropKey = keyof StyleProps;
102
148
 
103
- type SpaceSizesKeys = "none" | "auto" | "xxs" | "xs" | "mxs" | "sm" | "msm" | "md" | "lg" | "xl" | "xxl";
104
- type Space = Record<SpaceSizesKeys, DimensionValue>;
105
- type FontSizesKeys = "xxs" | "xs" | "xsm" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "huge" | "massive";
106
- type FontSizes = Record<FontSizesKeys, number>;
107
- type LineHeightKeys = "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
108
- type LineHeights = Record<LineHeightKeys, string>;
109
- type LetterSpacingKey = "tightest" | "tighter" | "tight" | "normal" | "wide" | "wider" | "widest" | "ultraWide";
110
- type LetterSpacings = Record<LetterSpacingKey, number>;
111
- type BorderSizeKey = "sm" | "md" | "lg" | "xl" | "xxl";
112
- type BorderSizes = Record<BorderSizeKey, number>;
113
- type RadiusKey = "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "round";
114
- type Radii = Record<RadiusKey, number>;
115
- type RadiusDrawnKey = "drawn1" | "drawn2" | "drawn3" | "drawn4" | "drawn5" | "drawn6";
116
- type RadiiDrawn = Record<RadiusDrawnKey, string>;
117
- type RadiusBlobKey = "blob1" | "blob2" | "blob3" | "blob4" | "blob5";
118
- type RadiiBlob = Record<RadiusBlobKey, string>;
119
- type RadiusConditionalKey = "conditional1" | "conditional2" | "conditional3" | "conditional4" | "conditional5" | "conditional6";
120
- type RadiiConditional = Record<RadiusConditionalKey, string>;
121
- type NeutralColorKey = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
122
- type NeutralColors = Record<NeutralColorKey, string>;
149
+ type ButtonSizeTokens = Record<ComponentSize, {
150
+ height: number;
151
+ paddingVertical: number;
152
+ paddingHorizontal: number;
153
+ fontSize: number;
154
+ }>;
155
+ type IconButtonSizeTokens = Record<ComponentSize, {
156
+ size: number;
157
+ padding: number;
158
+ }>;
159
+ type ButtonVariantTokens = Record<ComponentVariant, {
160
+ backgroundColor: string;
161
+ borderColor: string;
162
+ color: string;
163
+ disabledBackgroundColor: string;
164
+ disabledBorderColor: string;
165
+ disabledColor: string;
166
+ }>;
167
+ type IconButtonVariantTokens = Record<ComponentVariant, {
168
+ backgroundColor: string;
169
+ borderColor: string;
170
+ color: string;
171
+ disabledBackgroundColor: string;
172
+ disabledBorderColor: string;
173
+ disabledColor: string;
174
+ }>;
175
+ interface ButtonTokens {
176
+ borderWidth: number;
177
+ borderRadius: number;
178
+ sizes: ButtonSizeTokens;
179
+ variants: ButtonVariantTokens;
180
+ }
181
+ interface IconButtonTokens {
182
+ borderWidth: number;
183
+ borderRadius: number;
184
+ sizes: IconButtonSizeTokens;
185
+ variants: IconButtonVariantTokens;
186
+ }
187
+
188
+ interface ControlAddonTokens {
189
+ marginHorizontal: number;
190
+ hitSlop: number;
191
+ iconColor: string;
192
+ errorIconColor: string;
193
+ disabledIconColor: string;
194
+ }
195
+ type ControlContainerSizeTokens = Record<ComponentSize, {
196
+ height: number;
197
+ paddingHorizontal: number;
198
+ }>;
199
+ type ControlContainerVariantTokens = Record<ComponentVariant, {
200
+ backgroundColor: string;
201
+ borderColor: string;
202
+ errorBorderColor: string;
203
+ disabledBackgroundColor: string;
204
+ disabledBorderColor: string;
205
+ }>;
206
+ interface ControlContainerTokens {
207
+ borderWidth: number;
208
+ borderRadius: number;
209
+ disabledOpacity: number;
210
+ sizes: ControlContainerSizeTokens;
211
+ variants: ControlContainerVariantTokens;
212
+ }
213
+ interface ControlErrorTokens {
214
+ marginTop: number;
215
+ color: string;
216
+ fontSize: number;
217
+ }
218
+ type ControlInputSizeTokens = Record<ComponentSize, {
219
+ fontSize: number;
220
+ }>;
221
+ type ControlInputVariantTokens = Record<ComponentVariant, {
222
+ color: string;
223
+ placeholderColor: string;
224
+ disabledColor: string;
225
+ disabledPlaceholderColor: string;
226
+ errorColor: string;
227
+ errorPlaceholderColor: string;
228
+ }>;
229
+ interface ControlInputTokens {
230
+ flex: number;
231
+ fontFamily: string;
232
+ paddingHorizontal: number;
233
+ sizes: ControlInputSizeTokens;
234
+ variants: ControlInputVariantTokens;
235
+ }
236
+ interface ControlLabelTokens {
237
+ marginBottom: number;
238
+ fontSize: number;
239
+ color: string;
240
+ disabledColor: string;
241
+ errorColor: string;
242
+ }
243
+
244
+ interface DataStateDetailsTokens {
245
+ gap: number;
246
+ iconSize: number;
247
+ iconColor: string;
248
+ }
249
+ interface DataStateActionsFooterTokens {
250
+ gap: number;
251
+ }
252
+ interface DataStateContentTokens {
253
+ zIndex: number;
254
+ }
255
+ interface DataStateLoadingTokens {
256
+ transitionDuration: number;
257
+ loaderZIndex: number;
258
+ }
259
+ interface DataStateTokens {
260
+ details: DataStateDetailsTokens;
261
+ actionsFooter: DataStateActionsFooterTokens;
262
+ content: DataStateContentTokens;
263
+ loading: DataStateLoadingTokens;
264
+ }
265
+
266
+ interface DatetimePickerCalendarTokens {
267
+ dayNamesMarginBottom: number;
268
+ weeksGap: number;
269
+ }
270
+ interface DatetimePickerDayTokens {
271
+ size: number;
272
+ borderRadius: number;
273
+ color: string;
274
+ outsideMonthColor: string;
275
+ selectedBackgroundColor: string;
276
+ selectedColor: string;
277
+ rangeBackgroundColor: string;
278
+ rangeColor: string;
279
+ }
280
+ interface DatetimePickerFlyoutActionsTokens {
281
+ gap: number;
282
+ buttonsGap: number;
283
+ clearColor: string;
284
+ }
285
+ interface DatetimePickerQuickDateOptionsTokens {
286
+ gap: number;
287
+ }
288
+ interface DatetimePickerVisibleDateSelectTokens {
289
+ gap: number;
290
+ }
291
+ interface DatePickerFlyoutTokens {
292
+ gap: number;
293
+ }
294
+ interface DatetimePickerFlyoutTokens {
295
+ gap: number;
296
+ }
297
+ interface DatetimeRangePickerFlyoutTokens {
298
+ gap: number;
299
+ timeInputsGap: number;
300
+ }
301
+ interface DatetimePickerTokens {
302
+ calendar: DatetimePickerCalendarTokens;
303
+ day: DatetimePickerDayTokens;
304
+ datePickerFlyout: DatePickerFlyoutTokens;
305
+ datetimePickerFlyout: DatetimePickerFlyoutTokens;
306
+ datetimeRangePickerFlyout: DatetimeRangePickerFlyoutTokens;
307
+ flyoutActions: DatetimePickerFlyoutActionsTokens;
308
+ quickDateOptions: DatetimePickerQuickDateOptionsTokens;
309
+ visibleDateSelect: DatetimePickerVisibleDateSelectTokens;
310
+ }
311
+
312
+ interface FlyoutHandleTokens {
313
+ containerHeight: number;
314
+ width: `${number}%`;
315
+ height: number;
316
+ borderRadius: number;
317
+ backgroundColor: string;
318
+ }
319
+ interface FlyoutTitleTokens {
320
+ paddingVertical: number;
321
+ paddingHorizontal: number;
322
+ }
323
+ interface FlyoutTokens {
324
+ zIndexBase: number;
325
+ maxHeightRatio: number;
326
+ overlayColor: string;
327
+ overlayVisibleOpacity: number;
328
+ backgroundColor: string;
329
+ contentPaddingHorizontal: number;
330
+ borderRadius: number;
331
+ hiddenOpacity: number;
332
+ title: FlyoutTitleTokens;
333
+ handle: FlyoutHandleTokens;
334
+ }
335
+
336
+ interface SelectOptionTokens {
337
+ padding: number;
338
+ selectedIconColor: string;
339
+ selectedIconVisibleOpacity: number;
340
+ selectedIconHiddenOpacity: number;
341
+ }
342
+ interface SelectTokens {
343
+ option: SelectOptionTokens;
344
+ }
345
+
346
+ interface SkeletonBoneTokens {
347
+ backgroundColor: string;
348
+ borderColor: string;
349
+ initialOpacity: number;
350
+ animatedOpacity: number;
351
+ animationDuration: number;
352
+ }
353
+ interface SkeletonTextTokens {
354
+ alignSelf: "auto" | "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
355
+ textTransform: "none" | "capitalize" | "uppercase" | "lowercase";
356
+ opacity: number;
357
+ }
358
+ interface SkeletonTokens {
359
+ bone: SkeletonBoneTokens;
360
+ text: SkeletonTextTokens;
361
+ }
362
+
363
+ type TagColor = "primary" | "secondary" | "error" | "warning" | "success" | "info";
364
+ type TagSizeTokens = Record<ComponentSize, {
365
+ height: number;
366
+ paddingHorizontal: number;
367
+ minWidth: number;
368
+ fontSize: number;
369
+ }>;
370
+ type TagVariantTokens = Record<ComponentVariant, {
371
+ backgroundColor: string;
372
+ borderColor: string;
373
+ color: string;
374
+ disabledBackgroundColor: string;
375
+ disabledBorderColor: string;
376
+ disabledColor: string;
377
+ }>;
378
+ type TagColorTokens = Record<TagColor, TagVariantTokens>;
379
+ interface TagTokens {
380
+ borderWidth: number;
381
+ borderRadius: number;
382
+ gap: number;
383
+ iconMarginLeft: number;
384
+ sizes: TagSizeTokens;
385
+ colors: TagColorTokens;
386
+ }
387
+
388
+ interface TimePickerColumnTokens {
389
+ width: number;
390
+ height: number;
391
+ gap: number;
392
+ listWidth: number;
393
+ itemHeight: number;
394
+ visibleItems: number;
395
+ verticalPadding: number;
396
+ initialScrollIndexViewOffset: number;
397
+ fontSize: number;
398
+ selectedColor: string;
399
+ color: string;
400
+ selectedFontWeight: number;
401
+ fontWeight: number;
402
+ }
403
+ interface TimePickerFlyoutTokens {
404
+ gap: number;
405
+ }
406
+ interface TimePickerColumnsTokens {
407
+ height: number;
408
+ gap: number;
409
+ indicatorHeight: number;
410
+ indicatorWidth: number;
411
+ indicatorTop: number;
412
+ indicatorBorderRadius: number;
413
+ indicatorBackgroundColor: string;
414
+ }
415
+ interface TimePickerTokens {
416
+ column: TimePickerColumnTokens;
417
+ flyout: TimePickerFlyoutTokens;
418
+ columns: TimePickerColumnsTokens;
419
+ }
123
420
 
124
421
  interface ThemeContextData {
125
- loaded: boolean;
126
422
  theme: AppTheme;
127
- components?: DeepPartial<ComponentsThemes>;
128
423
  }
129
424
  type ColorScheme = "light" | "dark";
425
+ type ColorPair = {
426
+ value: string;
427
+ contrast: string;
428
+ };
130
429
  type ThemeColors = {
131
- primary: string;
132
- secondary: string;
133
- neutral: NeutralColors;
134
- white: string;
135
- black: string;
136
- error: string;
137
- warning: string;
138
- success: string;
139
- info: string;
430
+ primary: ColorPair;
431
+ accent: ColorPair;
432
+ secondary: ColorPair;
433
+ neutral: NeutralColor;
434
+ surface: {
435
+ primary: ColorPair;
436
+ secondary: ColorPair;
437
+ elevated: ColorPair;
438
+ inverse: ColorPair;
439
+ };
140
440
  text: {
141
441
  primary: string;
142
442
  secondary: string;
443
+ tertiary: string;
444
+ inverse: string;
445
+ disabled: string;
143
446
  };
144
- background: {
145
- primary: string;
146
- secondary: string;
447
+ border: {
448
+ subtle: ColorPair;
449
+ default: ColorPair;
450
+ strong: ColorPair;
451
+ focus: ColorPair;
147
452
  };
453
+ feedback: {
454
+ error: ColorPair;
455
+ warning: ColorPair;
456
+ success: ColorPair;
457
+ info: ColorPair;
458
+ };
459
+ overlay: string;
460
+ white: string;
461
+ black: string;
148
462
  } & ExtendedThemeColors;
149
463
  interface ExtendedThemeColors {
150
464
  }
151
465
  interface ComponentsThemes {
152
- typography: Record<TypographyPresetKey, TypographyProps>;
466
+ (theme: PrimitiveThemeTokens): ComponentsTokens;
153
467
  }
154
- interface AppTheme {
468
+ interface ComponentsTokens {
469
+ button: ButtonTokens;
470
+ iconButton: IconButtonTokens;
471
+ tag: TagTokens;
472
+ controlAddon: ControlAddonTokens;
473
+ controlContainer: ControlContainerTokens;
474
+ controlError: ControlErrorTokens;
475
+ controlInput: ControlInputTokens;
476
+ controlLabel: ControlLabelTokens;
477
+ select: SelectTokens;
478
+ datetimePicker: DatetimePickerTokens;
479
+ timePicker: TimePickerTokens;
480
+ flyout: FlyoutTokens;
481
+ skeleton: SkeletonTokens;
482
+ dataState: DataStateTokens;
483
+ }
484
+ interface PrimitiveThemeTokens {
155
485
  colors: ThemeColors;
156
- spacing: Space;
486
+ space: Space;
157
487
  radii: Radii;
158
- borderSize: BorderSizes;
159
- fontWeights: Record<"normal" | "italic", Record<FontWeightKey, string>>;
160
- fontSize: FontSizes;
488
+ borderSize: BorderSize;
489
+ fontFamily: FontFamily;
490
+ fontWeight: FontWeight;
491
+ fontSize: FontSize;
492
+ lineHeight: LineHeight;
493
+ }
494
+ interface AppTheme extends PrimitiveThemeTokens {
495
+ components: ComponentsTokens;
161
496
  }
162
- type CustomComponentsTheme = ((theme: AppTheme) => DeepPartial<ComponentsThemes>) | DeepPartial<ComponentsThemes>;
163
497
 
164
- declare const FontWeightsNormal: Record<FontWeightKey, FontWeightNormal>;
165
- declare const FontWeightsItalic: Record<FontWeightKey, FontWeightItalic>;
498
+ declare const StylePropsSet: Set<keyof SpacingProps | keyof ColorProps | keyof ShadowProps | keyof BorderProps | keyof TypographyProps | keyof FlexProps | keyof DimensionProps>;
499
+ declare const shadowScale: Record<ShadowLevel, ShadowIntensity>;
166
500
 
167
- declare function useBorder(): BorderSizes;
501
+ declare function useBorder(): BorderSize;
168
502
 
169
503
  declare function useColors(): ThemeColors;
170
504
 
171
- declare function useComponentsTheme(): DeepPartial<ComponentsThemes> | undefined;
505
+ declare function useComponentsTokens(): ComponentsTokens;
172
506
 
173
507
  declare function useRadii(): Radii;
174
508
 
@@ -179,31 +513,42 @@ declare function useStyleProps<Props extends object>(props: Props): Partial<Spac
179
513
  declare function useTheme(): AppTheme;
180
514
 
181
515
  type ThemedStyles<T extends StyleSheet.NamedStyles<T>> = T;
182
- type StyledFunction<Props extends object, T extends StyleSheet.NamedStyles<T>> = (theme: AppTheme, props: Props) => ThemedStyles<T>;
183
- declare const useThemedStyles: <Props extends object, T extends StyleSheet.NamedStyles<T>>(styledFunction: StyledFunction<Props, T>, props: Props) => ThemedStyles<T>;
516
+ type StyledFunctionNoProps<T extends StyleSheet.NamedStyles<T>> = (theme: AppTheme) => ThemedStyles<T>;
517
+ type StyledFunctionWithProps<Props extends object, T extends StyleSheet.NamedStyles<T>> = (theme: AppTheme, props: Props) => ThemedStyles<T>;
518
+ declare function useThemedStyles<T extends StyleSheet.NamedStyles<T>>(styledFunction: StyledFunctionNoProps<T>): ThemedStyles<T>;
519
+ declare function useThemedStyles<Props extends object, T extends StyleSheet.NamedStyles<T>>(styledFunction: StyledFunctionWithProps<Props, T>, props: Props, dependencies: readonly unknown[]): ThemedStyles<T>;
520
+ declare function useThemedStyles<Props extends object, T extends StyleSheet.NamedStyles<T>>(styledFunction: StyledFunctionWithProps<Props, T>, props: Props, dependencies: readonly unknown[]): ThemedStyles<T>;
184
521
 
185
522
  interface ThemeProviderProps {
186
523
  scheme?: ColorScheme;
187
524
  theme?: DeepPartial<{
188
- light: AppTheme;
189
- dark: AppTheme;
525
+ light: PrimitiveThemeTokens;
526
+ dark: PrimitiveThemeTokens;
190
527
  }>;
191
- components?: CustomComponentsTheme;
528
+ components?: ((theme: PrimitiveThemeTokens) => DeepPartial<ComponentsTokens>) | DeepPartial<ComponentsTokens>;
192
529
  }
193
530
  declare const ThemeProvider: react.NamedExoticComponent<PropsWithChildren<ThemeProviderProps>>;
194
- declare function useThemeContext(): ThemeContextData;
531
+ declare function useThemeContext(): AppTheme;
195
532
 
196
- declare const DarkTheme: AppTheme;
533
+ declare const DarkTheme: PrimitiveThemeTokens;
197
534
 
198
- declare const LightTheme: AppTheme;
535
+ declare const LightTheme: PrimitiveThemeTokens;
199
536
 
200
537
  declare const SpaceTokens: Space;
201
- declare const BorderSizeTokens: BorderSizes;
538
+ declare const BorderSizeTokens: BorderSize;
202
539
  declare const RadiiTokens: Radii;
203
- declare const FontSizeTokens: FontSizes;
204
- declare const NeutralColorTokens: NeutralColors;
540
+ declare const FontSizeTokens: FontSize;
541
+ declare const LineHeightTokens: LineHeight;
542
+ declare const FontWeightTokens: FontWeight;
543
+ declare const FontFamilyWeightsNormalTokens: Record<FontWeightValue, FontWeightNormal>;
544
+ declare const FontFamilyWeightsItalicTokens: Record<FontWeightValue, FontWeightItalic>;
545
+ declare const FontFamilyTokens: FontFamily;
546
+ declare const NeutralColorTokens: NeutralColor;
547
+ declare const LightColors: ThemeColors;
548
+ declare function createComponentsTokens(tokens: PrimitiveThemeTokens): ComponentsTokens;
205
549
 
206
550
  declare const extractStyleProps: <Props extends object>(props: Props) => StyleProps;
207
551
  declare const createStyleKey: <Props extends object>(props: Props) => string;
552
+ declare const getShadowStyle: (level: ShadowLevel | undefined, position: ShadowPosition | undefined, colors: ThemeColors) => ViewStyle;
208
553
 
209
- export { type AppTheme, type BorderProps, type BorderSizeKey, BorderSizeTokens, type BorderSizes, type ColorProps, type ColorScheme, type ComponentSize, type ComponentsThemes, type CustomComponentsTheme, DarkTheme, type DimensionProps, type ExtendedThemeColors, type FlexProps, FontSizeTokens, type FontSizes, type FontSizesKeys, type FontWeightItalic, type FontWeightKey, type FontWeightNormal, FontWeightsItalic, FontWeightsNormal, type LetterSpacingKey, type LetterSpacings, LightTheme, type LineHeightKeys, type LineHeights, type NeutralColorKey, NeutralColorTokens, type NeutralColors, type Radii, type RadiiBlob, type RadiiConditional, type RadiiDrawn, RadiiTokens, type RadiusBlobKey, type RadiusConditionalKey, type RadiusDrawnKey, type RadiusKey, type ShadowProps, type Space, type SpaceSizesKeys, SpaceTokens, type SpacingProps, type StylePropKey, type StyleProps, StylePropsSet, type ThemeColors, type ThemeContextData, ThemeProvider, type TypographyPresetKey, type TypographyProps, createStyleKey, extractStyleProps, useBorder, useColors, useComponentsTheme, useRadii, useSpace, useStyleProps, useTheme, useThemeContext, useThemedStyles };
554
+ export { type AppTheme, type BorderProps, type BorderSize, type BorderSizeKey, BorderSizeTokens, type ButtonSizeTokens, type ButtonTokens, type ButtonVariantTokens, type ColorPair, type ColorProps, type ColorScheme, type ComponentSize, type ComponentVariant, type ComponentsThemes, type ComponentsTokens, type ControlAddonTokens, type ControlContainerSizeTokens, type ControlContainerTokens, type ControlContainerVariantTokens, type ControlErrorTokens, type ControlInputSizeTokens, type ControlInputTokens, type ControlInputVariantTokens, type ControlLabelTokens, DarkTheme, type DataStateActionsFooterTokens, type DataStateContentTokens, type DataStateDetailsTokens, type DataStateLoadingTokens, type DataStateTokens, type DatePickerFlyoutTokens, type DatetimePickerCalendarTokens, type DatetimePickerDayTokens, type DatetimePickerFlyoutActionsTokens, type DatetimePickerFlyoutTokens, type DatetimePickerQuickDateOptionsTokens, type DatetimePickerTokens, type DatetimePickerVisibleDateSelectTokens, type DatetimeRangePickerFlyoutTokens, type DimensionProps, type ExtendedThemeColors, type FlexProps, type FlyoutHandleTokens, type FlyoutTitleTokens, type FlyoutTokens, type FontFamily, FontFamilyTokens, FontFamilyWeightsItalicTokens, FontFamilyWeightsNormalTokens, type FontSize, FontSizeTokens, type FontWeight, type FontWeightItalic, type FontWeightKeys, type FontWeightNormal, FontWeightTokens, type FontWeightValue, type IconButtonSizeTokens, type IconButtonTokens, type IconButtonVariantTokens, type LetterSpacingKey, type LetterSpacings, LightColors, LightTheme, type LineHeight, LineHeightTokens, type NeutralColor, type NeutralColorKey, NeutralColorTokens, type PrimitiveThemeTokens, type Radii, type RadiiBlob, type RadiiConditional, type RadiiDrawn, RadiiTokens, type RadiusBlobKey, type RadiusConditionalKey, type RadiusDrawnKey, type RadiusKey, type SelectOptionTokens, type SelectTokens, type ShadowIntensity, type ShadowLevel, type ShadowPosition, type ShadowProps, type SkeletonBoneTokens, type SkeletonTextTokens, type SkeletonTokens, type Space, type SpaceSizesKey, SpaceTokens, type SpacingProps, type StylePropKey, type StyleProps, StylePropsSet, type TagColor, type TagColorTokens, type TagSizeTokens, type TagTokens, type TagVariantTokens, type ThemeColors, type ThemeContextData, ThemeProvider, type TimePickerColumnTokens, type TimePickerColumnsTokens, type TimePickerFlyoutTokens, type TimePickerTokens, type TypographyKey, type TypographyPresetKey, type TypographyProps, createComponentsTokens, createStyleKey, extractStyleProps, getShadowStyle, shadowScale, useBorder, useColors, useComponentsTokens, useRadii, useSpace, useStyleProps, useTheme, useThemeContext, useThemedStyles };