@aws-amplify/ui 5.0.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/textUtil.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/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/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/index.js +1 -1
- package/dist/styles.css +982 -986
- package/dist/theme.css +983 -989
- package/dist/types/helpers/authenticator/textUtil.d.ts +5 -2
- package/dist/types/i18n/dictionaries/authenticator/defaultTexts.d.ts +2 -0
- package/dist/types/i18n/dictionaries/index.d.ts +2 -0
- package/dist/types/i18n/translations.d.ts +2 -0
- 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 +12 -27
- package/dist/types/theme/tokens/components/index.d.ts +58 -49
- 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/user.d.ts +7 -0
- package/dist/types/types/authenticator/utils.d.ts +1 -0
- package/package.json +8 -6
- package/dist/esm/theme/tokens/types/designToken.js +0 -1
- package/dist/types/theme/tokens/types/scales.d.ts +0 -13
|
@@ -1,53 +1,63 @@
|
|
|
1
|
-
import { BorderWidths
|
|
2
|
-
import { Colors
|
|
3
|
-
import { ComponentTokens } from './components';
|
|
4
|
-
import { Fonts
|
|
5
|
-
import { FontSizes
|
|
6
|
-
import { FontWeights
|
|
7
|
-
import { LineHeights
|
|
8
|
-
import { Opacities
|
|
9
|
-
import { OutlineOffsets
|
|
10
|
-
import { OutlineWidths
|
|
11
|
-
import { Radii
|
|
12
|
-
import { Shadows
|
|
13
|
-
import { Space
|
|
14
|
-
import { Time
|
|
15
|
-
import { Transforms
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
radii
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export declare const
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 =
|
|
14
|
-
|
|
15
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
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 {};
|
|
@@ -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 {};
|
|
@@ -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;
|