@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.
- package/dist/esm/helpers/authenticator/constants.js +1 -1
- package/dist/esm/helpers/authenticator/facade.js +1 -1
- package/dist/esm/helpers/authenticator/textUtil.js +1 -0
- package/dist/esm/helpers/authenticator/utils.js +1 -1
- package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.js +1 -1
- package/dist/esm/i18n/dictionaries/authenticator/en.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/machines/authenticator/actors/signIn.js +1 -1
- package/dist/esm/machines/authenticator/defaultServices.js +1 -1
- package/dist/esm/machines/authenticator/index.js +1 -1
- package/dist/esm/machines/authenticator/signUp.js +1 -1
- package/dist/esm/theme/createTheme.js +1 -1
- package/dist/esm/theme/defaultDarkModeOverride.js +1 -1
- package/dist/esm/theme/tokens/components/fieldControl.js +1 -1
- package/dist/esm/theme/tokens/components/inAppMessaging.js +1 -0
- package/dist/esm/theme/tokens/components/index.js +1 -1
- package/dist/esm/theme/tokens/index.js +1 -1
- package/dist/esm/theme/utils.js +1 -1
- package/dist/esm/types/authenticator/user.js +1 -1
- package/dist/esm/types/authenticator/utils.js +1 -0
- package/dist/esm/types/primitives/componentClassName.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1164 -977
- package/dist/theme.css +983 -978
- package/dist/types/helpers/authenticator/facade.d.ts +1 -1
- package/dist/types/helpers/authenticator/index.d.ts +1 -0
- package/dist/types/helpers/authenticator/textUtil.d.ts +47 -0
- package/dist/types/helpers/authenticator/utils.d.ts +7 -3
- package/dist/types/i18n/dictionaries/authenticator/defaultTexts.d.ts +2 -1
- package/dist/types/i18n/dictionaries/index.d.ts +2 -1
- package/dist/types/i18n/translations.d.ts +2 -1
- package/dist/types/machines/authenticator/defaultServices.d.ts +2 -1
- package/dist/types/theme/createTheme.d.ts +2 -2
- package/dist/types/theme/defaultDarkModeOverride.d.ts +2 -0
- package/dist/types/theme/defaultTheme.d.ts +2 -2
- package/dist/types/theme/index.d.ts +3 -2
- package/dist/types/theme/tokens/borderWidths.d.ts +5 -19
- package/dist/types/theme/tokens/colors.d.ts +36 -75
- package/dist/types/theme/tokens/components/alert.d.ts +14 -27
- package/dist/types/theme/tokens/components/authenticator.d.ts +26 -46
- package/dist/types/theme/tokens/components/autocomplete.d.ts +12 -41
- package/dist/types/theme/tokens/components/badge.d.ts +15 -28
- package/dist/types/theme/tokens/components/button.d.ts +39 -82
- package/dist/types/theme/tokens/components/card.d.ts +7 -14
- package/dist/types/theme/tokens/components/checkbox.d.ts +27 -80
- package/dist/types/theme/tokens/components/checkboxField.d.ts +3 -8
- package/dist/types/theme/tokens/components/collection.d.ts +20 -28
- package/dist/types/theme/tokens/components/copy.d.ts +8 -20
- package/dist/types/theme/tokens/components/dialCodeSelect.d.ts +3 -5
- package/dist/types/theme/tokens/components/divider.d.ts +8 -20
- package/dist/types/theme/tokens/components/expander.d.ts +21 -68
- package/dist/types/theme/tokens/components/field.d.ts +8 -16
- package/dist/types/theme/tokens/components/fieldControl.d.ts +22 -71
- package/dist/types/theme/tokens/components/fieldGroup.d.ts +6 -14
- package/dist/types/theme/tokens/components/fieldMessages.d.ts +6 -16
- package/dist/types/theme/tokens/components/flex.d.ts +3 -9
- package/dist/types/theme/tokens/components/heading.d.ts +5 -16
- package/dist/types/theme/tokens/components/highlightMatch.d.ts +5 -9
- package/dist/types/theme/tokens/components/icon.d.ts +3 -6
- package/dist/types/theme/tokens/components/image.d.ts +3 -8
- package/dist/types/theme/tokens/components/inAppMessaging.d.ts +13 -0
- package/dist/types/theme/tokens/components/index.d.ts +59 -48
- package/dist/types/theme/tokens/components/link.d.ts +4 -12
- package/dist/types/theme/tokens/components/loader.d.ts +14 -39
- package/dist/types/theme/tokens/components/menu.d.ts +8 -26
- package/dist/types/theme/tokens/components/pagination.d.ts +12 -48
- package/dist/types/theme/tokens/components/passwordField.d.ts +12 -14
- package/dist/types/theme/tokens/components/phoneNumberField.d.ts +4 -9
- package/dist/types/theme/tokens/components/placeholder.d.ts +8 -14
- package/dist/types/theme/tokens/components/radio.d.ts +21 -72
- package/dist/types/theme/tokens/components/radioGroup.d.ts +8 -17
- package/dist/types/theme/tokens/components/rating.d.ts +9 -19
- package/dist/types/theme/tokens/components/searchField.d.ts +12 -15
- package/dist/types/theme/tokens/components/select.d.ts +11 -35
- package/dist/types/theme/tokens/components/selectField.d.ts +6 -14
- package/dist/types/theme/tokens/components/sliderField.d.ts +20 -61
- package/dist/types/theme/tokens/components/stepperField.d.ts +11 -23
- package/dist/types/theme/tokens/components/switchField.d.ts +20 -54
- package/dist/types/theme/tokens/components/table.d.ts +24 -60
- package/dist/types/theme/tokens/components/tabs.d.ts +12 -43
- package/dist/types/theme/tokens/components/text.d.ts +6 -15
- package/dist/types/theme/tokens/components/textAreaField.d.ts +6 -10
- package/dist/types/theme/tokens/components/textField.d.ts +5 -12
- package/dist/types/theme/tokens/components/toggleButton.d.ts +30 -115
- package/dist/types/theme/tokens/components/toggleButtonGroup.d.ts +5 -7
- package/dist/types/theme/tokens/fontSizes.d.ts +5 -17
- package/dist/types/theme/tokens/fontWeights.d.ts +5 -16
- package/dist/types/theme/tokens/fonts.d.ts +7 -12
- package/dist/types/theme/tokens/index.d.ts +58 -48
- package/dist/types/theme/tokens/lineHeights.d.ts +5 -10
- package/dist/types/theme/tokens/opacities.d.ts +5 -18
- package/dist/types/theme/tokens/outlineOffsets.d.ts +5 -10
- package/dist/types/theme/tokens/outlineWidths.d.ts +5 -10
- package/dist/types/theme/tokens/radii.d.ts +5 -14
- package/dist/types/theme/tokens/shadows.d.ts +5 -10
- package/dist/types/theme/tokens/space.d.ts +8 -25
- package/dist/types/theme/tokens/time.d.ts +5 -10
- package/dist/types/theme/tokens/transforms.d.ts +7 -13
- package/dist/types/theme/tokens/types/designToken.d.ts +161 -20
- package/dist/types/theme/types.d.ts +7 -8
- package/dist/types/theme/utils.d.ts +30 -2
- package/dist/types/types/authenticator/index.d.ts +1 -0
- package/dist/types/types/authenticator/stateMachine/authMachine.d.ts +5 -1
- package/dist/types/types/authenticator/stateMachine/event.d.ts +1 -1
- package/dist/types/types/authenticator/user.d.ts +7 -0
- package/dist/types/types/authenticator/utils.d.ts +1 -0
- package/dist/types/types/primitives/componentClassName.d.ts +1 -0
- package/package.json +9 -6
- package/dist/esm/theme/tokens/types/designToken.js +0 -1
- package/dist/types/theme/tokens/types/scales.d.ts +0 -13
|
@@ -1,21 +1,14 @@
|
|
|
1
|
+
import { Properties } from 'csstype';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Used in the React component style props.
|
|
4
|
-
*
|
|
5
|
-
* @param arg - thing to test if it is a design token or not
|
|
6
|
-
* @returns boolean
|
|
3
|
+
* a DesignToken can be either an object with a `value` key of `ValueType` or the `ValueType` itself
|
|
7
4
|
*/
|
|
8
|
-
export declare
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export declare type DesignToken<ValueType = any> = {
|
|
5
|
+
export declare type DesignToken<ValueType = unknown> = {
|
|
13
6
|
value: ValueType;
|
|
14
|
-
};
|
|
7
|
+
} | ValueType;
|
|
15
8
|
/**
|
|
16
9
|
* A fully setup design token ready to be used in web platform.
|
|
17
10
|
*/
|
|
18
|
-
export declare type WebDesignToken<ValueType =
|
|
11
|
+
export declare type WebDesignToken<ValueType = unknown> = {
|
|
19
12
|
/**
|
|
20
13
|
* Name of the design token
|
|
21
14
|
*/
|
|
@@ -33,7 +26,11 @@ export declare type WebDesignToken<ValueType = any> = {
|
|
|
33
26
|
* `var(--amplify-colors-font-primary)`
|
|
34
27
|
*/
|
|
35
28
|
toString(): string;
|
|
36
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Token `ValueType`
|
|
31
|
+
*/
|
|
32
|
+
value: ValueType;
|
|
33
|
+
};
|
|
37
34
|
export declare type AnimationDurationValue = string;
|
|
38
35
|
export declare type AnimationTimingFunctionValue = string;
|
|
39
36
|
export declare type AlignItemsValue = string;
|
|
@@ -43,7 +40,7 @@ export declare type BorderColorValue = ColorValue;
|
|
|
43
40
|
export declare type BorderCollapseValue = string;
|
|
44
41
|
export declare type BorderRadiusValue = RadiusValue;
|
|
45
42
|
export declare type BorderStyleValue = string;
|
|
46
|
-
export declare type BorderWidthValue = SpaceValue;
|
|
43
|
+
export declare type BorderWidthValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : SpaceValue : SpaceValue;
|
|
47
44
|
export declare type BorderValue = string;
|
|
48
45
|
export declare type BoxSizingValue = string;
|
|
49
46
|
export declare type BoxShadowValue = ShadowValue;
|
|
@@ -54,22 +51,22 @@ export declare type DisplayValue = string;
|
|
|
54
51
|
export declare type FlexDirectionValue = string;
|
|
55
52
|
export declare type FlexValue = string;
|
|
56
53
|
export declare type FlexWrapValue = string;
|
|
57
|
-
export declare type FontSizeValue = string;
|
|
54
|
+
export declare type FontSizeValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
|
|
58
55
|
export declare type FontStyleValue = string;
|
|
59
56
|
export declare type FontValue = string;
|
|
60
|
-
export declare type FontWeightValue = string | number;
|
|
57
|
+
export declare type FontWeightValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' : string | number : string | number;
|
|
61
58
|
export declare type GapValue = string;
|
|
62
59
|
export declare type JustifyContentValue = string;
|
|
63
60
|
export declare type LineHeightValue = string | number;
|
|
64
61
|
export declare type ObjectFitValue = string;
|
|
65
|
-
export declare type OpacityValue = string;
|
|
62
|
+
export declare type OpacityValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
|
|
66
63
|
export declare type OutlineOffsetValue = string;
|
|
67
64
|
export declare type OutlineWidthValue = string;
|
|
68
65
|
export declare type OutlineColorValue = string;
|
|
69
66
|
export declare type OutlineStyleValue = string;
|
|
70
67
|
export declare type PositionValue = string;
|
|
71
68
|
export declare type PointerEventsValue = string;
|
|
72
|
-
export declare type RadiusValue = string;
|
|
69
|
+
export declare type RadiusValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
|
|
73
70
|
export declare type ShadowValue = {
|
|
74
71
|
offsetX: string;
|
|
75
72
|
offsetY: string;
|
|
@@ -80,9 +77,10 @@ export declare type ShadowValue = {
|
|
|
80
77
|
export declare type StrokeFilledValue = string;
|
|
81
78
|
export declare type StrokeEmptyValue = string;
|
|
82
79
|
export declare type StrokeLinecapValue = string;
|
|
83
|
-
export declare type
|
|
80
|
+
export declare type StrokeWidthValue = string;
|
|
81
|
+
export declare type SpaceValue<Platform extends PlatformKey = unknown> = Platform extends 'react-native' ? string | number : string;
|
|
84
82
|
export declare type TextAlignValue = string;
|
|
85
|
-
export declare type TimeValue = string;
|
|
83
|
+
export declare type TimeValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
|
|
86
84
|
export declare type TransformValue = string;
|
|
87
85
|
export declare type TransitionDurationValue = string;
|
|
88
86
|
export declare type TransitionPropertyValue = string;
|
|
@@ -90,3 +88,146 @@ export declare type TransitionTimingFunctionValue = string;
|
|
|
90
88
|
export declare type VerticalAlignValue = string;
|
|
91
89
|
export declare type WhiteSpaceValue = string;
|
|
92
90
|
export declare type WordBreakValue = string;
|
|
91
|
+
/**
|
|
92
|
+
* Mapping of design token value types to style property keys
|
|
93
|
+
*/
|
|
94
|
+
interface TokenStandardProperties {
|
|
95
|
+
animationDuration: AnimationDurationValue;
|
|
96
|
+
animationTimingFunction: AnimationTimingFunctionValue;
|
|
97
|
+
alignItems: AlignItemsValue;
|
|
98
|
+
alignContent: AlignContentValue;
|
|
99
|
+
backgroundColor: BackgroundColorValue;
|
|
100
|
+
borderBlockEnd: BorderValue;
|
|
101
|
+
borderBlockEndColor: ColorValue;
|
|
102
|
+
borderBlockStart: BorderValue;
|
|
103
|
+
borderCollapse: BorderCollapseValue;
|
|
104
|
+
borderColor: BorderColorValue;
|
|
105
|
+
borderInlineEnd: BorderValue;
|
|
106
|
+
borderInlineStart: BorderValue;
|
|
107
|
+
borderRadius: BorderRadiusValue;
|
|
108
|
+
borderStyle: BorderStyleValue;
|
|
109
|
+
borderWidth: BorderWidthValue;
|
|
110
|
+
border: BorderValue;
|
|
111
|
+
bottom: SpaceValue;
|
|
112
|
+
boxSizing: BoxSizingValue;
|
|
113
|
+
boxShadow: BoxShadowValue;
|
|
114
|
+
captionSide: CaptionSideValue;
|
|
115
|
+
color: ColorValue;
|
|
116
|
+
cursor: CursorValue;
|
|
117
|
+
display: DisplayValue;
|
|
118
|
+
fill: DesignToken<ColorValue>;
|
|
119
|
+
flexDirection: FlexDirectionValue;
|
|
120
|
+
flex: FlexValue;
|
|
121
|
+
flexWrap: FlexWrapValue;
|
|
122
|
+
fontStyle: FontStyleValue;
|
|
123
|
+
font: FontValue;
|
|
124
|
+
fontSize: FontSizeValue;
|
|
125
|
+
fontWeight: FontWeightValue;
|
|
126
|
+
gap: GapValue;
|
|
127
|
+
height: SpaceValue;
|
|
128
|
+
justifyContent: JustifyContentValue;
|
|
129
|
+
left: SpaceValue;
|
|
130
|
+
lineHeight: LineHeightValue;
|
|
131
|
+
margin: SpaceValue;
|
|
132
|
+
marginLeft: SpaceValue;
|
|
133
|
+
marginRight: SpaceValue;
|
|
134
|
+
marginBlockStart: SpaceValue;
|
|
135
|
+
maxHeight: SpaceValue;
|
|
136
|
+
maxWidth: SpaceValue;
|
|
137
|
+
minHeight: SpaceValue;
|
|
138
|
+
minWidth: SpaceValue;
|
|
139
|
+
objectFit: ObjectFitValue;
|
|
140
|
+
objectPosition: PositionValue;
|
|
141
|
+
opacity: OpacityValue;
|
|
142
|
+
outlineOffset: OutlineOffsetValue;
|
|
143
|
+
outlineWidth: OutlineWidthValue;
|
|
144
|
+
outlineColor: OutlineColorValue;
|
|
145
|
+
outlineStyle: OutlineStyleValue;
|
|
146
|
+
padding: SpaceValue;
|
|
147
|
+
paddingBlock: SpaceValue;
|
|
148
|
+
paddingBlockEnd: SpaceValue;
|
|
149
|
+
paddingBlockStart: SpaceValue;
|
|
150
|
+
paddingBottom: SpaceValue;
|
|
151
|
+
paddingInline: SpaceValue;
|
|
152
|
+
paddingInlineEnd: SpaceValue;
|
|
153
|
+
paddingInlineStart: SpaceValue;
|
|
154
|
+
paddingLeft: SpaceValue;
|
|
155
|
+
paddingRight: SpaceValue;
|
|
156
|
+
paddingTop: SpaceValue;
|
|
157
|
+
pointerEvents: PointerEventsValue;
|
|
158
|
+
position: PositionValue;
|
|
159
|
+
right: SpaceValue;
|
|
160
|
+
strokeLinecap: StrokeLinecapValue;
|
|
161
|
+
strokeWidth: StrokeWidthValue;
|
|
162
|
+
textAlign: TextAlignValue;
|
|
163
|
+
top: SpaceValue;
|
|
164
|
+
transform: TransformValue;
|
|
165
|
+
transitionDuration: TransitionDurationValue;
|
|
166
|
+
transitionProperty: TransitionPropertyValue;
|
|
167
|
+
transitionTimingFunction: TransitionTimingFunctionValue;
|
|
168
|
+
verticalAlign: VerticalAlignValue;
|
|
169
|
+
whiteSpace: WhiteSpaceValue;
|
|
170
|
+
width: SpaceValue;
|
|
171
|
+
wordBreak: WordBreakValue;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Custom style tokens with non-css property names
|
|
175
|
+
*/
|
|
176
|
+
interface TokenCustomProperties {
|
|
177
|
+
borderBottomLeftRadius: RadiusValue;
|
|
178
|
+
borderBottomRightRadius: RadiusValue;
|
|
179
|
+
borderEndEndRadius: RadiusValue;
|
|
180
|
+
borderEndStartRadius: RadiusValue;
|
|
181
|
+
borderStartEndRadius: RadiusValue;
|
|
182
|
+
borderStartStartRadius: RadiusValue;
|
|
183
|
+
borderTopLeftRadius: RadiusValue;
|
|
184
|
+
borderTopRightRadius: RadiusValue;
|
|
185
|
+
duration: TimeValue;
|
|
186
|
+
endColor: ColorValue;
|
|
187
|
+
marginTop: SpaceValue;
|
|
188
|
+
paddingHorizontal: SpaceValue;
|
|
189
|
+
paddingVertical: SpaceValue;
|
|
190
|
+
shadow: ShadowValue;
|
|
191
|
+
size: SpaceValue;
|
|
192
|
+
startColor: ColorValue;
|
|
193
|
+
strokeEmpty: StrokeEmptyValue;
|
|
194
|
+
strokeFilled: StrokeFilledValue;
|
|
195
|
+
time: TimeValue;
|
|
196
|
+
}
|
|
197
|
+
interface TokenProperties extends TokenStandardProperties, TokenCustomProperties {
|
|
198
|
+
}
|
|
199
|
+
declare type TokenProperty = keyof TokenProperties;
|
|
200
|
+
declare type Property = Extract<keyof Properties, TokenProperty> | keyof TokenCustomProperties;
|
|
201
|
+
export declare type OutputVariantKey = 'default' | 'optional' | 'required' | unknown;
|
|
202
|
+
/**
|
|
203
|
+
* Return interface with all types optional for custom theme input
|
|
204
|
+
*/
|
|
205
|
+
declare type OptionalDesignTokenProperties<Keys extends Property> = Partial<{
|
|
206
|
+
[Key in Keys]?: DesignToken<TokenProperties[Key]>;
|
|
207
|
+
}>;
|
|
208
|
+
/**
|
|
209
|
+
* Return interface with all types required for strict theme output
|
|
210
|
+
*/
|
|
211
|
+
declare type RequiredDesignTokenProperties<Keys extends TokenProperty> = {
|
|
212
|
+
[Key in Keys]: WebDesignToken<TokenProperties[Key]>;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Return interface with all types required for strict theme output
|
|
216
|
+
*/
|
|
217
|
+
declare type DefaultDesignTokenProperties<Keys extends TokenProperty> = Required<{
|
|
218
|
+
[Key in Keys]: DesignToken<TokenProperties[Key]>;
|
|
219
|
+
}>;
|
|
220
|
+
/**
|
|
221
|
+
* Utility for creating interfaces for components from supported CSS property keys
|
|
222
|
+
*/
|
|
223
|
+
export declare type DesignTokenProperties<Keys extends TokenProperty, Output extends OutputVariantKey = unknown> = Output extends 'required' ? RequiredDesignTokenProperties<Keys> : Output extends 'optional' ? OptionalDesignTokenProperties<Keys> : DefaultDesignTokenProperties<Keys>;
|
|
224
|
+
export declare type PlatformKey = 'web' | 'react-native' | 'android' | 'ios' | unknown;
|
|
225
|
+
declare type PropKey = string | number;
|
|
226
|
+
declare type RequiredTokenValues<PropertyValueKey extends PropKey, PropertyValue, Platform extends PlatformKey = unknown> = Record<PropertyValueKey, Platform extends 'react-native' ? PropertyValue : WebDesignToken<PropertyValue>>;
|
|
227
|
+
declare type OptionalTokenValues<PropertyValueKey extends PropKey, PropertyValue, Platform extends PlatformKey = unknown> = Partial<Record<PropertyValueKey, DesignToken<PropertyValue>>>;
|
|
228
|
+
declare type DefaultTokenValues<PropertyValueKey extends PropKey, PropertyValue, Platform extends PlatformKey = unknown> = Required<Record<PropertyValueKey, DesignToken<PropertyValue>>>;
|
|
229
|
+
/**
|
|
230
|
+
* Utility for creating token interfaces in `Theme`
|
|
231
|
+
*/
|
|
232
|
+
export declare type DesignTokenValues<PropertyValueKey extends PropKey, PropertyValue, Output extends OutputVariantKey = unknown, Platform extends PlatformKey = unknown> = Output extends 'required' ? RequiredTokenValues<PropertyValueKey, PropertyValue, Platform> : Output extends 'optional' ? OptionalTokenValues<PropertyValueKey, PropertyValue, Platform> : DefaultTokenValues<PropertyValueKey, PropertyValue, Platform>;
|
|
233
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PartialDeep } from 'type-fest';
|
|
2
|
-
import { Tokens, WebTokens } from './tokens';
|
|
2
|
+
import { DefaultTokens, Tokens, WebTokens } from './tokens';
|
|
3
3
|
import { Breakpoints } from './breakpoints';
|
|
4
4
|
export * from './tokens/types/designToken';
|
|
5
5
|
export type { FontSizes } from './tokens/fontSizes';
|
|
@@ -87,7 +87,7 @@ export interface Theme {
|
|
|
87
87
|
* multiple themes on a page.
|
|
88
88
|
*/
|
|
89
89
|
name: string;
|
|
90
|
-
tokens?:
|
|
90
|
+
tokens?: Tokens;
|
|
91
91
|
breakpoints?: PartialDeep<Breakpoints>;
|
|
92
92
|
/**
|
|
93
93
|
* Overrides allow you to change design tokens in different contexts, like
|
|
@@ -98,19 +98,18 @@ export interface Theme {
|
|
|
98
98
|
overrides?: Array<Override>;
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
|
-
* A
|
|
101
|
+
* A DefaultTheme has all tokens and breakpoints required
|
|
102
102
|
*/
|
|
103
|
-
export interface
|
|
104
|
-
tokens:
|
|
103
|
+
export interface DefaultTheme extends Pick<Theme, 'name' | 'overrides'> {
|
|
104
|
+
tokens: DefaultTokens;
|
|
105
105
|
breakpoints: Breakpoints;
|
|
106
|
-
overrides?: Array<Override>;
|
|
107
106
|
}
|
|
108
107
|
/**
|
|
109
108
|
* WebTheme is a fully built theme that has cssText based
|
|
110
109
|
* on the design tokens and all design tokens have added fields
|
|
111
110
|
* to be used in Javascript/Typescript.
|
|
112
111
|
*/
|
|
113
|
-
export interface WebTheme extends
|
|
114
|
-
tokens: WebTokens;
|
|
112
|
+
export interface WebTheme extends Pick<Theme, 'breakpoints' | 'name' | 'overrides'> {
|
|
115
113
|
cssText: string;
|
|
114
|
+
tokens: WebTokens;
|
|
116
115
|
}
|
|
@@ -1,8 +1,36 @@
|
|
|
1
|
-
import { DesignToken } from './tokens/types/designToken';
|
|
1
|
+
import { DesignToken, WebDesignToken } from './tokens/types/designToken';
|
|
2
2
|
export declare const CSS_VARIABLE_PREFIX = "amplify";
|
|
3
|
-
export declare function cssValue(token: DesignToken
|
|
3
|
+
export declare function cssValue(token: DesignToken<{
|
|
4
|
+
value: unknown;
|
|
5
|
+
}>): unknown;
|
|
4
6
|
interface NameTransformProps {
|
|
5
7
|
path?: Array<string>;
|
|
6
8
|
}
|
|
7
9
|
export declare function cssNameTransform({ path }: NameTransformProps): string;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to test if something is a design token or not.
|
|
12
|
+
* Used in the React component style props.
|
|
13
|
+
*
|
|
14
|
+
* @param value - thing to test if it is a design token or not
|
|
15
|
+
* @returns boolean
|
|
16
|
+
*/
|
|
17
|
+
export declare function isDesignToken(value: unknown): value is WebDesignToken;
|
|
18
|
+
declare type SetupTokensProps = {
|
|
19
|
+
tokens: Record<string | number, any>;
|
|
20
|
+
path?: Array<string>;
|
|
21
|
+
setupToken: SetupToken;
|
|
22
|
+
};
|
|
23
|
+
export declare type SetupToken<ReturnType = any> = (args: {
|
|
24
|
+
token: BaseDesignToken;
|
|
25
|
+
path: Array<string>;
|
|
26
|
+
}) => ReturnType;
|
|
27
|
+
declare type BaseDesignToken = {
|
|
28
|
+
value: string | number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Recursive function that will walk down the token object
|
|
32
|
+
* and perform the setupToken function on each token.
|
|
33
|
+
* Similar to what Style Dictionary does.
|
|
34
|
+
*/
|
|
35
|
+
export declare function setupTokens({ tokens, path, setupToken, }: SetupTokensProps): any;
|
|
8
36
|
export {};
|
|
@@ -16,4 +16,8 @@ export declare type AuthInterpreter = Interpreter<AuthContext, any, AuthEvent, a
|
|
|
16
16
|
* Function type for `send` in `authMachine`
|
|
17
17
|
*/
|
|
18
18
|
export declare type AuthMachineSend = AuthInterpreter['send'];
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Handles Amplify JS Auth hub events, by forwarding hub events as appropriate
|
|
21
|
+
* xstate events.
|
|
22
|
+
*/
|
|
23
|
+
export declare type AuthMachineHubHandler = (data: HubCapsule, service: AuthInterpreter) => Promise<void>;
|
|
@@ -5,7 +5,7 @@ export declare type InvokeActorEventTypes = 'done.invoke.signInActor' | 'done.in
|
|
|
5
5
|
/**
|
|
6
6
|
* All known explicit events for xstate
|
|
7
7
|
*/
|
|
8
|
-
export declare type AuthEventTypes = 'CHANGE' | 'BLUR' | 'FEDERATED_SIGN_IN' | 'RESEND' | 'RESET_PASSWORD' | 'SIGN_IN' | 'SIGN_OUT' | 'SIGN_UP' | 'SKIP' | 'SUBMIT' | 'INIT' | 'TOKEN_REFRESH' | InvokeActorEventTypes;
|
|
8
|
+
export declare type AuthEventTypes = 'CHANGE' | 'BLUR' | 'FEDERATED_SIGN_IN' | 'RESEND' | 'RESET_PASSWORD' | 'AUTO_SIGN_IN' | 'AUTO_SIGN_IN_FAILURE' | 'SIGN_IN' | 'SIGN_OUT' | 'SIGN_UP' | 'SKIP' | 'SUBMIT' | 'INIT' | 'TOKEN_REFRESH' | InvokeActorEventTypes;
|
|
9
9
|
/**
|
|
10
10
|
* Data payload for auth events
|
|
11
11
|
*/
|
|
@@ -30,6 +30,13 @@ export interface AmplifyUser extends CognitoUser {
|
|
|
30
30
|
*/
|
|
31
31
|
export interface CognitoUserAmplify extends AmplifyUser {
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Cognito user contact method types that have not been verified as valid
|
|
35
|
+
*/
|
|
36
|
+
export declare enum UnverifiedContactMethodType {
|
|
37
|
+
Email = "email",
|
|
38
|
+
PhoneNumber = "phone_number"
|
|
39
|
+
}
|
|
33
40
|
/**
|
|
34
41
|
* Cognito user contact methods that have not been verified as valid
|
|
35
42
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isUnverifiedContactMethodType: (value: string) => boolean;
|
|
@@ -67,6 +67,7 @@ export declare enum ComponentClassName {
|
|
|
67
67
|
LoaderDeterminate = "amplify-loader--determinate",
|
|
68
68
|
LoaderPercentageText = "amplify-loader__percentage-text",
|
|
69
69
|
MenuContent = "amplify-menu-content",
|
|
70
|
+
MenuContentWrapper = "amplify-menu-content-wrapper",
|
|
70
71
|
MenuItem = "amplify-menu-content__item",
|
|
71
72
|
MenuTrigger = "amplify-menu-trigger",
|
|
72
73
|
Pagination = "amplify-pagination",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
"import": "./dist/esm/index.js",
|
|
9
9
|
"require": "./dist/index.js"
|
|
10
10
|
},
|
|
11
|
+
"./package.json": "./package.json",
|
|
11
12
|
"./styles.css": "./dist/styles.css",
|
|
12
|
-
"./theme.css": "./dist/theme.css"
|
|
13
|
+
"./theme.css": "./dist/theme.css",
|
|
14
|
+
"./tokens.ts": "./dist/react-native/tokens.ts"
|
|
13
15
|
},
|
|
14
16
|
"browser": {
|
|
15
17
|
"./styles.css": "./dist/styles.css",
|
|
@@ -28,11 +30,10 @@
|
|
|
28
30
|
],
|
|
29
31
|
"scripts": {
|
|
30
32
|
"prebuild": "rimraf dist",
|
|
31
|
-
"build": "yarn build:
|
|
32
|
-
"build:css": "./scripts/generateCSS.
|
|
33
|
+
"build": "yarn build:css && yarn build:js",
|
|
34
|
+
"build:css": "ts-node --transpile-only ./scripts/generateCSS.ts",
|
|
33
35
|
"build:js": "rollup --config",
|
|
34
36
|
"build:dev:js": "tsup",
|
|
35
|
-
"build:sd": "ts-node --transpile-only sd.config.ts",
|
|
36
37
|
"clean": "rimraf dist node_modules",
|
|
37
38
|
"dev": "yarn build:sd && yarn build:css && yarn build:dev:js --watch",
|
|
38
39
|
"dev:build": "yarn build:sd && yarn build:css && yarn build:dev:js",
|
|
@@ -40,12 +41,13 @@
|
|
|
40
41
|
"test": "jest"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
44
|
+
"csstype": "^3.1.1",
|
|
43
45
|
"lodash": "4.17.21",
|
|
44
46
|
"style-dictionary": "3.7.0",
|
|
45
47
|
"tslib": "2.4.0"
|
|
46
48
|
},
|
|
47
49
|
"peerDependencies": {
|
|
48
|
-
"aws-amplify": "
|
|
50
|
+
"aws-amplify": ">= 5.0.1",
|
|
49
51
|
"xstate": "^4.33.6"
|
|
50
52
|
},
|
|
51
53
|
"peerDependenciesMeta": {
|
|
@@ -58,6 +60,7 @@
|
|
|
58
60
|
"@types/jest": "^26.0.23",
|
|
59
61
|
"@types/lodash": "^4.14.170",
|
|
60
62
|
"@types/webpack-env": "^1.16.2",
|
|
63
|
+
"@typescript-eslint/parser": "^5.20.0",
|
|
61
64
|
"autoprefixer": "^10.3.1",
|
|
62
65
|
"fs-extra": "^10.0.0",
|
|
63
66
|
"glob": "^7.1.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return"object"==typeof e&&e.hasOwnProperty("value")}export{e as isDesignToken};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DesignToken, ColorValue } from './designToken';
|
|
2
|
-
export interface OrdinalScale<DesignTokenType = DesignToken<ColorValue>> {
|
|
3
|
-
primary: DesignTokenType;
|
|
4
|
-
secondary: DesignTokenType;
|
|
5
|
-
tertiary: DesignTokenType;
|
|
6
|
-
quaternary?: DesignTokenType;
|
|
7
|
-
}
|
|
8
|
-
export interface OrdinalVariation<DesignTokenType = DesignToken<ColorValue>> {
|
|
9
|
-
info: DesignTokenType;
|
|
10
|
-
warning: DesignTokenType;
|
|
11
|
-
error: DesignTokenType;
|
|
12
|
-
success: DesignTokenType;
|
|
13
|
-
}
|