@aws-amplify/ui 4.1.0 → 5.1.0

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 (110) hide show
  1. package/dist/esm/helpers/authenticator/constants.js +1 -1
  2. package/dist/esm/helpers/authenticator/facade.js +1 -1
  3. package/dist/esm/helpers/authenticator/textUtil.js +1 -0
  4. package/dist/esm/helpers/authenticator/utils.js +1 -1
  5. package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.js +1 -1
  6. package/dist/esm/i18n/dictionaries/authenticator/en.js +1 -1
  7. package/dist/esm/index.js +1 -1
  8. package/dist/esm/machines/authenticator/actors/signIn.js +1 -1
  9. package/dist/esm/machines/authenticator/defaultServices.js +1 -1
  10. package/dist/esm/machines/authenticator/index.js +1 -1
  11. package/dist/esm/machines/authenticator/signUp.js +1 -1
  12. package/dist/esm/theme/createTheme.js +1 -1
  13. package/dist/esm/theme/defaultDarkModeOverride.js +1 -1
  14. package/dist/esm/theme/tokens/components/fieldControl.js +1 -1
  15. package/dist/esm/theme/tokens/components/inAppMessaging.js +1 -0
  16. package/dist/esm/theme/tokens/components/index.js +1 -1
  17. package/dist/esm/theme/tokens/index.js +1 -1
  18. package/dist/esm/theme/utils.js +1 -1
  19. package/dist/esm/types/authenticator/user.js +1 -1
  20. package/dist/esm/types/authenticator/utils.js +1 -0
  21. package/dist/esm/types/primitives/componentClassName.js +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/styles.css +1164 -977
  24. package/dist/theme.css +983 -978
  25. package/dist/types/helpers/authenticator/facade.d.ts +1 -1
  26. package/dist/types/helpers/authenticator/index.d.ts +1 -0
  27. package/dist/types/helpers/authenticator/textUtil.d.ts +47 -0
  28. package/dist/types/helpers/authenticator/utils.d.ts +7 -3
  29. package/dist/types/i18n/dictionaries/authenticator/defaultTexts.d.ts +2 -1
  30. package/dist/types/i18n/dictionaries/index.d.ts +2 -1
  31. package/dist/types/i18n/translations.d.ts +2 -1
  32. package/dist/types/machines/authenticator/defaultServices.d.ts +2 -1
  33. package/dist/types/theme/createTheme.d.ts +2 -2
  34. package/dist/types/theme/defaultDarkModeOverride.d.ts +2 -0
  35. package/dist/types/theme/defaultTheme.d.ts +2 -2
  36. package/dist/types/theme/index.d.ts +3 -2
  37. package/dist/types/theme/tokens/borderWidths.d.ts +5 -19
  38. package/dist/types/theme/tokens/colors.d.ts +36 -75
  39. package/dist/types/theme/tokens/components/alert.d.ts +14 -27
  40. package/dist/types/theme/tokens/components/authenticator.d.ts +26 -46
  41. package/dist/types/theme/tokens/components/autocomplete.d.ts +12 -41
  42. package/dist/types/theme/tokens/components/badge.d.ts +15 -28
  43. package/dist/types/theme/tokens/components/button.d.ts +39 -82
  44. package/dist/types/theme/tokens/components/card.d.ts +7 -14
  45. package/dist/types/theme/tokens/components/checkbox.d.ts +27 -80
  46. package/dist/types/theme/tokens/components/checkboxField.d.ts +3 -8
  47. package/dist/types/theme/tokens/components/collection.d.ts +20 -28
  48. package/dist/types/theme/tokens/components/copy.d.ts +8 -20
  49. package/dist/types/theme/tokens/components/dialCodeSelect.d.ts +3 -5
  50. package/dist/types/theme/tokens/components/divider.d.ts +8 -20
  51. package/dist/types/theme/tokens/components/expander.d.ts +21 -68
  52. package/dist/types/theme/tokens/components/field.d.ts +8 -16
  53. package/dist/types/theme/tokens/components/fieldControl.d.ts +22 -71
  54. package/dist/types/theme/tokens/components/fieldGroup.d.ts +6 -14
  55. package/dist/types/theme/tokens/components/fieldMessages.d.ts +6 -16
  56. package/dist/types/theme/tokens/components/flex.d.ts +3 -9
  57. package/dist/types/theme/tokens/components/heading.d.ts +5 -16
  58. package/dist/types/theme/tokens/components/highlightMatch.d.ts +5 -9
  59. package/dist/types/theme/tokens/components/icon.d.ts +3 -6
  60. package/dist/types/theme/tokens/components/image.d.ts +3 -8
  61. package/dist/types/theme/tokens/components/inAppMessaging.d.ts +13 -0
  62. package/dist/types/theme/tokens/components/index.d.ts +59 -48
  63. package/dist/types/theme/tokens/components/link.d.ts +4 -12
  64. package/dist/types/theme/tokens/components/loader.d.ts +14 -39
  65. package/dist/types/theme/tokens/components/menu.d.ts +8 -26
  66. package/dist/types/theme/tokens/components/pagination.d.ts +12 -48
  67. package/dist/types/theme/tokens/components/passwordField.d.ts +12 -14
  68. package/dist/types/theme/tokens/components/phoneNumberField.d.ts +4 -9
  69. package/dist/types/theme/tokens/components/placeholder.d.ts +8 -14
  70. package/dist/types/theme/tokens/components/radio.d.ts +21 -72
  71. package/dist/types/theme/tokens/components/radioGroup.d.ts +8 -17
  72. package/dist/types/theme/tokens/components/rating.d.ts +9 -19
  73. package/dist/types/theme/tokens/components/searchField.d.ts +12 -15
  74. package/dist/types/theme/tokens/components/select.d.ts +11 -35
  75. package/dist/types/theme/tokens/components/selectField.d.ts +6 -14
  76. package/dist/types/theme/tokens/components/sliderField.d.ts +20 -61
  77. package/dist/types/theme/tokens/components/stepperField.d.ts +11 -23
  78. package/dist/types/theme/tokens/components/switchField.d.ts +20 -54
  79. package/dist/types/theme/tokens/components/table.d.ts +24 -60
  80. package/dist/types/theme/tokens/components/tabs.d.ts +12 -43
  81. package/dist/types/theme/tokens/components/text.d.ts +6 -15
  82. package/dist/types/theme/tokens/components/textAreaField.d.ts +6 -10
  83. package/dist/types/theme/tokens/components/textField.d.ts +5 -12
  84. package/dist/types/theme/tokens/components/toggleButton.d.ts +30 -115
  85. package/dist/types/theme/tokens/components/toggleButtonGroup.d.ts +5 -7
  86. package/dist/types/theme/tokens/fontSizes.d.ts +5 -17
  87. package/dist/types/theme/tokens/fontWeights.d.ts +5 -16
  88. package/dist/types/theme/tokens/fonts.d.ts +7 -12
  89. package/dist/types/theme/tokens/index.d.ts +58 -48
  90. package/dist/types/theme/tokens/lineHeights.d.ts +5 -10
  91. package/dist/types/theme/tokens/opacities.d.ts +5 -18
  92. package/dist/types/theme/tokens/outlineOffsets.d.ts +5 -10
  93. package/dist/types/theme/tokens/outlineWidths.d.ts +5 -10
  94. package/dist/types/theme/tokens/radii.d.ts +5 -14
  95. package/dist/types/theme/tokens/shadows.d.ts +5 -10
  96. package/dist/types/theme/tokens/space.d.ts +8 -25
  97. package/dist/types/theme/tokens/time.d.ts +5 -10
  98. package/dist/types/theme/tokens/transforms.d.ts +7 -13
  99. package/dist/types/theme/tokens/types/designToken.d.ts +161 -20
  100. package/dist/types/theme/types.d.ts +7 -8
  101. package/dist/types/theme/utils.d.ts +30 -2
  102. package/dist/types/types/authenticator/index.d.ts +1 -0
  103. package/dist/types/types/authenticator/stateMachine/authMachine.d.ts +5 -1
  104. package/dist/types/types/authenticator/stateMachine/event.d.ts +1 -1
  105. package/dist/types/types/authenticator/user.d.ts +7 -0
  106. package/dist/types/types/authenticator/utils.d.ts +1 -0
  107. package/dist/types/types/primitives/componentClassName.d.ts +1 -0
  108. package/package.json +9 -6
  109. package/dist/esm/theme/tokens/types/designToken.js +0 -1
  110. package/dist/types/theme/tokens/types/scales.d.ts +0 -13
@@ -1,116 +1,31 @@
1
- import { BackgroundColorValue, BorderColorValue, BorderWidthValue, BoxShadowValue, ColorValue, DesignToken } from '../types/designToken';
2
- interface ToggleButtonHoverTokens {
3
- backgroundColor: DesignToken<BackgroundColorValue>;
4
- }
5
- interface ToggleButtonActiveTokens {
6
- backgroundColor: DesignToken<BackgroundColorValue>;
7
- }
8
- interface ToggleButtonFocusTokens {
9
- borderColor: DesignToken<BorderColorValue>;
10
- color: DesignToken<ColorValue>;
11
- }
12
- interface ToggleButtonDisabledTokens {
13
- backgroundColor: DesignToken<BackgroundColorValue>;
14
- borderColor: DesignToken<BorderColorValue>;
15
- color: DesignToken<ColorValue>;
16
- }
17
- interface ToggleButtonPressedTokens {
18
- borderColor: DesignToken<BorderColorValue>;
19
- color: DesignToken<ColorValue>;
20
- backgroundColor: DesignToken<BackgroundColorValue>;
21
- _hover: ToggleButtonPressedHoverTokens;
22
- }
23
- interface ToggleButtonPressedHoverTokens {
24
- backgroundColor: DesignToken<BackgroundColorValue>;
25
- }
26
- interface ToggleButtonPrimaryTokens {
27
- backgroundColor: DesignToken<BackgroundColorValue>;
28
- borderWidth: DesignToken<BorderWidthValue>;
29
- _focus: ToggleButtonPrimaryFocusTokens;
30
- _hover: ToggleButtonPrimaryHoverTokens;
31
- _disabled: ToggleButtonPrimaryDisabledTokens;
32
- _pressed: ToggleButtonPrimaryPressedTokens;
33
- }
34
- interface ToggleButtonPrimaryFocusTokens {
35
- borderColor: DesignToken<BorderColorValue>;
36
- backgroundColor: DesignToken<BackgroundColorValue>;
37
- boxShadow: DesignToken<BoxShadowValue>;
38
- color: DesignToken<ColorValue>;
39
- }
40
- interface ToggleButtonPrimaryHoverTokens {
41
- backgroundColor: DesignToken<BackgroundColorValue>;
42
- color: DesignToken<ColorValue>;
43
- }
44
- interface ToggleButtonPrimaryDisabledTokens {
45
- borderColor: DesignToken<BorderColorValue>;
46
- backgroundColor: DesignToken<BackgroundColorValue>;
47
- color: DesignToken<ColorValue>;
48
- }
49
- interface ToggleButtonPrimaryDisabledTokens {
50
- color: DesignToken<ColorValue>;
51
- }
52
- interface ToggleButtonPrimaryPressedTokens {
53
- backgroundColor: DesignToken<BackgroundColorValue>;
54
- borderColor: DesignToken<BorderColorValue>;
55
- color: DesignToken<ColorValue>;
56
- _focus: TogglButtonPrimaryPressedFocusTokens;
57
- _hover: TogglButtonPrimaryPressedHoverTokens;
58
- }
59
- interface TogglButtonPrimaryPressedFocusTokens {
60
- backgroundColor: DesignToken<BackgroundColorValue>;
61
- borderColor: DesignToken<BorderColorValue>;
62
- color: DesignToken<ColorValue>;
63
- }
64
- interface TogglButtonPrimaryPressedHoverTokens {
65
- backgroundColor: DesignToken<BackgroundColorValue>;
66
- borderColor: DesignToken<BorderColorValue>;
67
- boxShadow: DesignToken<BoxShadowValue>;
68
- color: DesignToken<ColorValue>;
69
- }
70
- interface ToggleButtonLinkTokens {
71
- backgroundColor: DesignToken<BackgroundColorValue>;
72
- color: DesignToken<ColorValue>;
73
- _hover: ToggleButtonLinkHoverTokens;
74
- _focus: ToggleButtonLinkFocusTokens;
75
- _disabled: ToggleButtonLinkDisabledTokens;
76
- _pressed: ToggleButtonLinkPressedTokens;
77
- }
78
- interface ToggleButtonLinkHoverTokens {
79
- backgroundColor: DesignToken<BackgroundColorValue>;
80
- color: DesignToken<ColorValue>;
81
- }
82
- interface ToggleButtonLinkFocusTokens {
83
- backgroundColor: DesignToken<BackgroundColorValue>;
84
- color: DesignToken<ColorValue>;
85
- }
86
- interface ToggleButtonLinkDisabledTokens {
87
- backgroundColor: DesignToken<BackgroundColorValue>;
88
- color: DesignToken<ColorValue>;
89
- }
90
- interface ToggleButtonLinkPressedTokens {
91
- backgroundColor: DesignToken<BackgroundColorValue>;
92
- color: DesignToken<ColorValue>;
93
- _focus: ToggleButtonLinkPressedFocusTokens;
94
- _hover: ToggleButtonLinkPressedHoverTokens;
95
- }
96
- interface ToggleButtonLinkPressedFocusTokens {
97
- color: DesignToken<ColorValue>;
98
- backgroundColor: DesignToken<BackgroundColorValue>;
99
- }
100
- interface ToggleButtonLinkPressedHoverTokens {
101
- color: DesignToken<ColorValue>;
102
- backgroundColor: DesignToken<BackgroundColorValue>;
103
- }
104
- export interface ToggleButtonTokens {
105
- borderColor: DesignToken<BorderColorValue>;
106
- color: DesignToken<ColorValue>;
107
- _hover: ToggleButtonHoverTokens;
108
- _focus: ToggleButtonFocusTokens;
109
- _active: ToggleButtonActiveTokens;
110
- _disabled: ToggleButtonDisabledTokens;
111
- _pressed: ToggleButtonPressedTokens;
112
- primary: ToggleButtonPrimaryTokens;
113
- link: ToggleButtonLinkTokens;
114
- }
115
- export declare const togglebutton: ToggleButtonTokens;
1
+ import { DesignTokenProperties, OutputVariantKey } from '../types/designToken';
2
+ declare type ToggleButtonStateTokens<Output> = DesignTokenProperties<'backgroundColor' | 'color', Output>;
3
+ export declare type ToggleButtonTokens<Output extends OutputVariantKey> = DesignTokenProperties<'borderColor' | 'color', Output> & {
4
+ _hover?: DesignTokenProperties<'backgroundColor', Output>;
5
+ _focus?: DesignTokenProperties<'borderColor' | 'color', Output>;
6
+ _active?: DesignTokenProperties<'backgroundColor', Output>;
7
+ _disabled?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'color', Output>;
8
+ _pressed?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'color', Output> & {
9
+ _hover?: DesignTokenProperties<'backgroundColor', Output>;
10
+ };
11
+ primary?: DesignTokenProperties<'backgroundColor' | 'borderWidth', Output> & {
12
+ _focus?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'boxShadow' | 'color', Output>;
13
+ _hover?: DesignTokenProperties<'backgroundColor' | 'color', Output>;
14
+ _disabled?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'color', Output>;
15
+ _pressed?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'color', Output> & {
16
+ _focus?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'color', Output>;
17
+ _hover?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'boxShadow' | 'color', Output>;
18
+ };
19
+ };
20
+ link?: DesignTokenProperties<'backgroundColor' | 'color'> & {
21
+ _hover?: ToggleButtonStateTokens<Output>;
22
+ _focus?: ToggleButtonStateTokens<Output>;
23
+ _disabled?: ToggleButtonStateTokens<Output>;
24
+ _pressed?: ToggleButtonStateTokens<Output> & {
25
+ _hover?: ToggleButtonStateTokens<Output>;
26
+ _focus?: ToggleButtonStateTokens<Output>;
27
+ };
28
+ };
29
+ };
30
+ export declare const togglebutton: Required<ToggleButtonTokens<'default'>>;
116
31
  export {};
@@ -1,7 +1,5 @@
1
- import { AlignContentValue, AlignItemsValue, DesignToken, JustifyContentValue } from '../types/designToken';
2
- export interface ToggleButtonGroupTokens {
3
- alignItems: DesignToken<AlignItemsValue>;
4
- alignContent: DesignToken<AlignContentValue>;
5
- justifyContent: DesignToken<JustifyContentValue>;
6
- }
7
- export declare const togglebuttongroup: ToggleButtonGroupTokens;
1
+ import { DesignTokenProperties, OutputVariantKey } from '../types/designToken';
2
+ declare type ToggleButtonGroupTokenKey = 'alignItems' | 'alignContent' | 'justifyContent';
3
+ export declare type ToggleButtonGroupTokens<Output extends OutputVariantKey> = DesignTokenProperties<ToggleButtonGroupTokenKey, Output>;
4
+ export declare const togglebuttongroup: Required<ToggleButtonGroupTokens<'default'>>;
5
+ export {};
@@ -1,17 +1,5 @@
1
- import { DesignToken, WebDesignToken, FontSizeValue } from './types/designToken';
2
- export declare type FontSizes = {
3
- xxxs: DesignToken<FontSizeValue>;
4
- xxs: DesignToken<FontSizeValue>;
5
- xs: DesignToken<FontSizeValue>;
6
- small: DesignToken<FontSizeValue>;
7
- medium: DesignToken<FontSizeValue>;
8
- large: DesignToken<FontSizeValue>;
9
- xl: DesignToken<FontSizeValue>;
10
- xxl: DesignToken<FontSizeValue>;
11
- xxxl: DesignToken<FontSizeValue>;
12
- xxxxl: DesignToken<FontSizeValue>;
13
- };
14
- export declare type WebFontSizes = {
15
- [Property in keyof FontSizes]: WebDesignToken<FontSizeValue>;
16
- };
17
- export declare const fontSizes: FontSizes;
1
+ import { DesignTokenValues, FontSizeValue, OutputVariantKey } from './types/designToken';
2
+ declare type FontSize = 'xxxs' | 'xxs' | 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' | 'xxxl' | 'xxxxl';
3
+ export declare type FontSizes<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<FontSize, FontSizeValue<Platform, Output>, Output, Platform>;
4
+ export declare const fontSizes: FontSizes<'default'>;
5
+ export {};
@@ -1,16 +1,5 @@
1
- import { DesignToken, WebDesignToken, FontWeightValue } from './types/designToken';
2
- export declare type FontWeights = {
3
- hairline: DesignToken<FontWeightValue>;
4
- thin: DesignToken<FontWeightValue>;
5
- light: DesignToken<FontWeightValue>;
6
- normal: DesignToken<FontWeightValue>;
7
- medium: DesignToken<FontWeightValue>;
8
- semibold: DesignToken<FontWeightValue>;
9
- bold: DesignToken<FontWeightValue>;
10
- extrabold: DesignToken<FontWeightValue>;
11
- black: DesignToken<FontWeightValue>;
12
- };
13
- export declare type WebFontWeights = {
14
- [Property in keyof FontWeights]: WebDesignToken<FontWeightValue>;
15
- };
16
- export declare const fontWeights: FontWeights;
1
+ import { DesignTokenValues, FontWeightValue, OutputVariantKey } from './types/designToken';
2
+ declare type FontWeight = 'hairline' | 'thin' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
3
+ export declare type FontWeights<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<FontWeight, FontWeightValue<Platform, Output>, Output, Platform>;
4
+ export declare const fontWeights: FontWeights<'default'>;
5
+ export {};
@@ -1,13 +1,8 @@
1
- import { DesignToken, WebDesignToken, FontValue } from './types/designToken';
2
- export declare type Fonts = {
3
- default: {
4
- variable: DesignToken<FontValue>;
5
- static: DesignToken<FontValue>;
6
- };
1
+ import { DesignTokenValues, FontValue, OutputVariantKey } from './types/designToken';
2
+ declare type FontVariant = 'variable' | 'static';
3
+ declare type BaseFonts<Output extends OutputVariantKey = unknown, Platform = unknown> = {
4
+ default?: DesignTokenValues<FontVariant, FontValue, Output, Platform>;
7
5
  };
8
- export interface WebFonts {
9
- default: {
10
- [Property in keyof Fonts['default']]: WebDesignToken<FontValue>;
11
- };
12
- }
13
- export declare const fonts: Fonts;
6
+ export declare type Fonts<Output extends OutputVariantKey = unknown, Platform = unknown> = Output extends 'required' | 'default' ? Required<BaseFonts<Output, Platform>> : BaseFonts<Output, Platform>;
7
+ export declare const fonts: Fonts<'default'>;
8
+ export {};
@@ -1,53 +1,63 @@
1
- import { BorderWidths, WebBorderWidths } from './borderWidths';
2
- import { Colors, WebColors } from './colors';
3
- import { ComponentTokens } from './components';
4
- import { Fonts, WebFonts } from './fonts';
5
- import { FontSizes, WebFontSizes } from './fontSizes';
6
- import { FontWeights, WebFontWeights } from './fontWeights';
7
- import { LineHeights, WebLineHeights } from './lineHeights';
8
- import { Opacities, WebOpacities } from './opacities';
9
- import { OutlineOffsets, WebOutlineOffsets } from './outlineOffsets';
10
- import { OutlineWidths, WebOutlineWidths } from './outlineWidths';
11
- import { Radii, WebRadii } from './radii';
12
- import { Shadows, WebShadows } from './shadows';
13
- import { Space, WebSpace } from './space';
14
- import { Time, WebTime } from './time';
15
- import { Transforms, WebTransforms } from './transforms';
16
- export interface Tokens {
17
- components: ComponentTokens;
18
- borderWidths: BorderWidths;
19
- colors: Colors;
20
- fonts: Fonts;
21
- fontSizes: FontSizes;
22
- fontWeights: FontWeights;
23
- lineHeights: LineHeights;
24
- opacities: Opacities;
25
- outlineOffsets: OutlineOffsets;
26
- outlineWidths: OutlineWidths;
27
- radii: Radii;
28
- shadows: Shadows;
29
- space: Space;
30
- time: Time;
31
- transforms: Transforms;
1
+ import { BorderWidths } from './borderWidths';
2
+ import { Colors } from './colors';
3
+ import { ComponentTokens, DefaultComponentTokens, WebComponentTokens } from './components';
4
+ import { Fonts } from './fonts';
5
+ import { FontSizes } from './fontSizes';
6
+ import { FontWeights } from './fontWeights';
7
+ import { LineHeights } from './lineHeights';
8
+ import { Opacities } from './opacities';
9
+ import { OutlineOffsets } from './outlineOffsets';
10
+ import { OutlineWidths } from './outlineWidths';
11
+ import { Radii } from './radii';
12
+ import { Shadows } from './shadows';
13
+ import { Space } from './space';
14
+ import { Time } from './time';
15
+ import { Transforms } from './transforms';
16
+ import { OutputVariantKey } from './types/designToken';
17
+ /**
18
+ * Used for custom themes
19
+ */
20
+ interface BaseTokens<Output extends OutputVariantKey = unknown> {
21
+ borderWidths?: BorderWidths<Output>;
22
+ colors?: Colors<Output>;
23
+ fonts?: Fonts<Output>;
24
+ fontSizes?: FontSizes<Output>;
25
+ fontWeights?: FontWeights<Output>;
26
+ lineHeights?: LineHeights<Output>;
27
+ opacities?: Opacities<Output>;
28
+ outlineOffsets?: OutlineOffsets<Output>;
29
+ outlineWidths?: OutlineWidths<Output>;
30
+ radii?: Radii<Output>;
31
+ shadows?: Shadows<Output>;
32
+ space?: Space<Output>;
33
+ time?: Time<Output>;
34
+ transforms?: Transforms<Output>;
32
35
  }
36
+ export declare type Tokens = BaseTokens<'optional'> & {
37
+ components?: ComponentTokens;
38
+ };
39
+ export declare type DefaultTokens = Required<BaseTokens<'default'>> & {
40
+ components: DefaultComponentTokens;
41
+ };
33
42
  /**
34
43
  * The fully setup theme tokens. It has the same shape as Tokens
35
44
  * but each token has added fields.
36
45
  */
37
- export interface WebTokens extends Tokens {
38
- borderWidths: WebBorderWidths;
39
- colors: WebColors;
40
- fonts: WebFonts;
41
- fontSizes: WebFontSizes;
42
- fontWeights: WebFontWeights;
43
- lineHeights: WebLineHeights;
44
- opacities: WebOpacities;
45
- outlineOffsets: WebOutlineOffsets;
46
- outlineWidths: WebOutlineWidths;
47
- radii: WebRadii;
48
- shadows: WebShadows;
49
- space: WebSpace;
50
- time: WebTime;
51
- transform: WebTransforms;
52
- }
53
- export declare const tokens: Tokens;
46
+ export declare type WebTokens = Required<BaseTokens<'required'>> & {
47
+ components: WebComponentTokens;
48
+ };
49
+ declare type ReactNative = 'react-native';
50
+ declare type BaseReactNativeTokens<Output extends OutputVariantKey = unknown> = {
51
+ colors?: Colors<Output, ReactNative>;
52
+ borderWidths?: BorderWidths<Output, ReactNative>;
53
+ fontSizes?: Omit<FontSizes<Output, ReactNative>, 'xxxs' | 'xxxxl'>;
54
+ fontWeights?: FontWeights<Output, ReactNative>;
55
+ opacities?: Opacities<Output, ReactNative>;
56
+ radii?: Radii<Output, ReactNative>;
57
+ space?: Omit<Space<Output, ReactNative>, 'xxxs' | 'relative' | 'zero'>;
58
+ time?: Time<Output, ReactNative>;
59
+ };
60
+ export declare type ReactNativeTokens<Output extends OutputVariantKey> = Output extends 'required' | 'default' ? Required<BaseReactNativeTokens<Output>> : BaseReactNativeTokens<Output>;
61
+ export declare const tokens: DefaultTokens;
62
+ export declare const reactNativeTokens: ReactNativeTokens<'default'>;
63
+ export {};
@@ -1,10 +1,5 @@
1
- import { DesignToken, WebDesignToken, LineHeightValue } from './types/designToken';
2
- export declare type LineHeights = {
3
- small: DesignToken<LineHeightValue>;
4
- medium: DesignToken<LineHeightValue>;
5
- large: DesignToken<LineHeightValue>;
6
- };
7
- export declare type WebLineHeights = {
8
- [Property in keyof LineHeights]: WebDesignToken<LineHeightValue>;
9
- };
10
- export declare const lineHeights: LineHeights;
1
+ import { DesignTokenValues, LineHeightValue, OutputVariantKey } from './types/designToken';
2
+ declare type LineHeightSize = 'small' | 'medium' | 'large';
3
+ export declare type LineHeights<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<LineHeightSize, LineHeightValue, Output, Platform>;
4
+ export declare const lineHeights: LineHeights<'default'>;
5
+ export {};
@@ -1,18 +1,5 @@
1
- import { DesignToken, WebDesignToken, OpacityValue } from './types/designToken';
2
- export declare type Opacities = {
3
- 0: DesignToken<OpacityValue>;
4
- 10: DesignToken<OpacityValue>;
5
- 20: DesignToken<OpacityValue>;
6
- 30: DesignToken<OpacityValue>;
7
- 40: DesignToken<OpacityValue>;
8
- 50: DesignToken<OpacityValue>;
9
- 60: DesignToken<OpacityValue>;
10
- 70: DesignToken<OpacityValue>;
11
- 80: DesignToken<OpacityValue>;
12
- 90: DesignToken<OpacityValue>;
13
- 100: DesignToken<OpacityValue>;
14
- };
15
- export declare type WebOpacities = {
16
- [Property in keyof Opacities]: WebDesignToken<OpacityValue>;
17
- };
18
- export declare const opacities: Opacities;
1
+ import { DesignTokenValues, OpacityValue, OutputVariantKey } from './types/designToken';
2
+ declare type OpacityScale = 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;
3
+ export declare type Opacities<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<OpacityScale, OpacityValue<Platform, Output>, Output, Platform>;
4
+ export declare const opacities: Opacities<'default'>;
5
+ export {};
@@ -1,10 +1,5 @@
1
- import { DesignToken, WebDesignToken, OutlineOffsetValue } from './types/designToken';
2
- export declare type OutlineOffsets = {
3
- small: DesignToken<OutlineOffsetValue>;
4
- medium: DesignToken<OutlineOffsetValue>;
5
- large: DesignToken<OutlineOffsetValue>;
6
- };
7
- export declare type WebOutlineOffsets = {
8
- [Property in keyof OutlineOffsets]: WebDesignToken<OutlineOffsetValue>;
9
- };
10
- export declare const outlineOffsets: OutlineOffsets;
1
+ import { DesignTokenValues, OutlineOffsetValue, OutputVariantKey } from './types/designToken';
2
+ declare type OutlineOffsetSize = 'small' | 'medium' | 'large';
3
+ export declare type OutlineOffsets<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<OutlineOffsetSize, OutlineOffsetValue, Output, Platform>;
4
+ export declare const outlineOffsets: OutlineOffsets<'default'>;
5
+ export {};
@@ -1,10 +1,5 @@
1
- import { DesignToken, WebDesignToken, OutlineWidthValue } from './types/designToken';
2
- export declare type OutlineWidths = {
3
- small: DesignToken<OutlineWidthValue>;
4
- medium: DesignToken<OutlineWidthValue>;
5
- large: DesignToken<OutlineWidthValue>;
6
- };
7
- export declare type WebOutlineWidths = {
8
- [Property in keyof OutlineWidths]: WebDesignToken<OutlineWidthValue>;
9
- };
10
- export declare const outlineWidths: OutlineWidths;
1
+ import { DesignTokenValues, OutlineWidthValue, OutputVariantKey } from './types/designToken';
2
+ declare type OutlineWidthSize = 'small' | 'medium' | 'large';
3
+ export declare type OutlineWidths<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<OutlineWidthSize, OutlineWidthValue, Output, Platform>;
4
+ export declare const outlineWidths: OutlineWidths<'default'>;
5
+ export {};
@@ -1,14 +1,5 @@
1
- import { DesignToken, WebDesignToken, RadiusValue } from './types/designToken';
2
- export declare type Radii = {
3
- xs: DesignToken<RadiusValue>;
4
- small: DesignToken<RadiusValue>;
5
- medium: DesignToken<RadiusValue>;
6
- large: DesignToken<RadiusValue>;
7
- xl: DesignToken<RadiusValue>;
8
- xxl: DesignToken<RadiusValue>;
9
- xxxl: DesignToken<RadiusValue>;
10
- };
11
- export declare type WebRadii = {
12
- [Property in keyof Radii]: WebDesignToken<RadiusValue>;
13
- };
14
- export declare const radii: Radii;
1
+ import { DesignTokenValues, OutputVariantKey, RadiusValue } from './types/designToken';
2
+ declare type RadiusSize = 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' | 'xxxl';
3
+ export declare type Radii<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<RadiusSize, RadiusValue<Platform, Output>, Output, Platform>;
4
+ export declare const radii: Radii<'default'>;
5
+ export {};
@@ -1,10 +1,5 @@
1
- import { DesignToken, WebDesignToken, ShadowValue } from './types/designToken';
2
- export declare type Shadows = {
3
- small: DesignToken<ShadowValue>;
4
- medium: DesignToken<ShadowValue>;
5
- large: DesignToken<ShadowValue>;
6
- };
7
- export declare type WebShadows = {
8
- [Property in keyof Shadows]: WebDesignToken<ShadowValue>;
9
- };
10
- export declare const shadows: Shadows;
1
+ import { DesignTokenValues, OutputVariantKey, ShadowValue } from './types/designToken';
2
+ declare type ShadowSize = 'small' | 'medium' | 'large';
3
+ export declare type Shadows<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<ShadowSize, ShadowValue, Output, Platform>;
4
+ export declare const shadows: Shadows<'default'>;
5
+ export {};
@@ -1,26 +1,9 @@
1
- import { DesignToken, WebDesignToken, SpaceValue } from './types/designToken';
2
- export declare type SpaceSizes = {
3
- xxxs: DesignToken<SpaceValue>;
4
- xxs: DesignToken<SpaceValue>;
5
- xs: DesignToken<SpaceValue>;
6
- small: DesignToken<SpaceValue>;
7
- medium: DesignToken<SpaceValue>;
8
- large: DesignToken<SpaceValue>;
9
- xl: DesignToken<SpaceValue>;
10
- xxl: DesignToken<SpaceValue>;
11
- xxxl: DesignToken<SpaceValue>;
1
+ import { DesignTokenValues, OutputVariantKey, SpaceValue } from './types/designToken';
2
+ declare type SpaceSize = 'xxxs' | 'xxs' | 'xs' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' | 'xxxl';
3
+ export declare type SpaceSizes<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<SpaceSize | 'zero', SpaceValue<Platform>, Output, Platform>;
4
+ declare type BaseSpace<Output extends OutputVariantKey = unknown, Platform = unknown> = SpaceSizes<Output, Platform> & {
5
+ relative?: DesignTokenValues<SpaceSize | 'full', SpaceValue, Output, Platform>;
12
6
  };
13
- export declare type Space = SpaceSizes & {
14
- zero: DesignToken<SpaceValue>;
15
- relative: SpaceSizes & {
16
- full: DesignToken<SpaceValue>;
17
- };
18
- };
19
- export declare type WebSpace = {
20
- [Property in keyof Omit<Space, 'relative'>]: WebDesignToken<SpaceValue>;
21
- } & {
22
- relative: {
23
- [Property in keyof Space['relative']]: WebDesignToken<SpaceValue>;
24
- };
25
- };
26
- export declare const space: Space;
7
+ export declare type Space<Output extends OutputVariantKey = unknown, Platform = unknown> = Output extends 'required' | 'default' ? Required<BaseSpace<Output, Platform>> : BaseSpace<Output, Platform>;
8
+ export declare const space: Space<'default'>;
9
+ export {};
@@ -1,10 +1,5 @@
1
- import { DesignToken, WebDesignToken, TimeValue } from './types/designToken';
2
- export declare type Time = {
3
- short: DesignToken<TimeValue>;
4
- medium: DesignToken<TimeValue>;
5
- long: DesignToken<TimeValue>;
6
- };
7
- export declare type WebTime = {
8
- [Property in keyof Time]: WebDesignToken<TimeValue>;
9
- };
10
- export declare const time: Time;
1
+ import { DesignTokenValues, OutputVariantKey, TimeValue } from './types/designToken';
2
+ declare type Duration = 'short' | 'medium' | 'long';
3
+ export declare type Time<Output extends OutputVariantKey = unknown, Platform = unknown> = DesignTokenValues<Duration, TimeValue<Platform, Output>, Output, Platform>;
4
+ export declare const time: Time<'default'>;
5
+ export {};
@@ -1,14 +1,8 @@
1
- import { DesignToken, WebDesignToken, TransformValue } from './types/designToken';
2
- export declare type Transforms = {
3
- slideX: {
4
- small: DesignToken<TransformValue>;
5
- medium: DesignToken<TransformValue>;
6
- large: DesignToken<TransformValue>;
7
- };
1
+ import { DesignTokenValues, OutputVariantKey, TransformValue } from './types/designToken';
2
+ declare type TransformSize = 'small' | 'medium' | 'large';
3
+ export declare type BaseTransforms<Output extends OutputVariantKey = unknown, Platform = unknown> = {
4
+ slideX?: DesignTokenValues<TransformSize, TransformValue, Output, Platform>;
8
5
  };
9
- export declare type WebTransforms = {
10
- slideX: {
11
- [Property in keyof Transforms['slideX']]: WebDesignToken<TransformValue>;
12
- };
13
- };
14
- export declare const transforms: Transforms;
6
+ export declare type Transforms<Output extends OutputVariantKey = unknown, Platform = unknown> = Output extends 'required' | 'default' ? Required<BaseTransforms<Output, Platform>> : BaseTransforms<Output, Platform>;
7
+ export declare const transforms: Transforms<'default'>;
8
+ export {};