@aws-amplify/ui 5.6.0 → 5.6.2

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 (101) hide show
  1. package/dist/esm/helpers/authenticator/utils.mjs +1 -1
  2. package/dist/esm/index.mjs +1 -1
  3. package/dist/esm/utils/index.mjs +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/styles.css +1 -1
  6. package/dist/types/helpers/accountSettings/utils.d.ts +1 -1
  7. package/dist/types/helpers/authenticator/facade.d.ts +5 -5
  8. package/dist/types/helpers/authenticator/utils.d.ts +1 -1
  9. package/dist/types/helpers/utils.d.ts +1 -1
  10. package/dist/types/i18n/dictionaries/authenticator/types.d.ts +2 -2
  11. package/dist/types/i18n/translations.d.ts +2 -2
  12. package/dist/types/machines/authenticator/actions.d.ts +27 -27
  13. package/dist/types/machines/authenticator/actors/resetPassword.d.ts +1 -1
  14. package/dist/types/machines/authenticator/actors/signIn.d.ts +1 -1
  15. package/dist/types/machines/authenticator/index.d.ts +1 -1
  16. package/dist/types/machines/authenticator/signUp.d.ts +1 -1
  17. package/dist/types/theme/breakpoints.d.ts +1 -1
  18. package/dist/types/theme/tokens/borderWidths.d.ts +2 -2
  19. package/dist/types/theme/tokens/colors.d.ts +22 -22
  20. package/dist/types/theme/tokens/components/alert.d.ts +5 -5
  21. package/dist/types/theme/tokens/components/authenticator.d.ts +10 -10
  22. package/dist/types/theme/tokens/components/autocomplete.d.ts +1 -1
  23. package/dist/types/theme/tokens/components/badge.d.ts +6 -6
  24. package/dist/types/theme/tokens/components/button.d.ts +8 -8
  25. package/dist/types/theme/tokens/components/card.d.ts +3 -3
  26. package/dist/types/theme/tokens/components/checkbox.d.ts +6 -6
  27. package/dist/types/theme/tokens/components/checkboxField.d.ts +1 -1
  28. package/dist/types/theme/tokens/components/collection.d.ts +3 -3
  29. package/dist/types/theme/tokens/components/copy.d.ts +1 -1
  30. package/dist/types/theme/tokens/components/dialCodeSelect.d.ts +1 -1
  31. package/dist/types/theme/tokens/components/divider.d.ts +2 -2
  32. package/dist/types/theme/tokens/components/expander.d.ts +5 -5
  33. package/dist/types/theme/tokens/components/field.d.ts +2 -2
  34. package/dist/types/theme/tokens/components/fieldControl.d.ts +6 -6
  35. package/dist/types/theme/tokens/components/fieldGroup.d.ts +1 -1
  36. package/dist/types/theme/tokens/components/fieldMessages.d.ts +1 -1
  37. package/dist/types/theme/tokens/components/fileUploader.d.ts +2 -2
  38. package/dist/types/theme/tokens/components/flex.d.ts +1 -1
  39. package/dist/types/theme/tokens/components/heading.d.ts +3 -3
  40. package/dist/types/theme/tokens/components/highlightMatch.d.ts +1 -1
  41. package/dist/types/theme/tokens/components/icon.d.ts +1 -1
  42. package/dist/types/theme/tokens/components/image.d.ts +1 -1
  43. package/dist/types/theme/tokens/components/inAppMessaging.d.ts +5 -5
  44. package/dist/types/theme/tokens/components/index.d.ts +4 -4
  45. package/dist/types/theme/tokens/components/link.d.ts +2 -2
  46. package/dist/types/theme/tokens/components/liveness.d.ts +3 -3
  47. package/dist/types/theme/tokens/components/loader.d.ts +4 -4
  48. package/dist/types/theme/tokens/components/menu.d.ts +2 -2
  49. package/dist/types/theme/tokens/components/pagination.d.ts +1 -1
  50. package/dist/types/theme/tokens/components/passwordField.d.ts +3 -3
  51. package/dist/types/theme/tokens/components/phoneNumberField.d.ts +1 -1
  52. package/dist/types/theme/tokens/components/placeholder.d.ts +2 -2
  53. package/dist/types/theme/tokens/components/radio.d.ts +2 -2
  54. package/dist/types/theme/tokens/components/radioGroup.d.ts +1 -1
  55. package/dist/types/theme/tokens/components/rating.d.ts +1 -1
  56. package/dist/types/theme/tokens/components/searchField.d.ts +3 -3
  57. package/dist/types/theme/tokens/components/select.d.ts +2 -2
  58. package/dist/types/theme/tokens/components/selectField.d.ts +1 -1
  59. package/dist/types/theme/tokens/components/sliderField.d.ts +3 -3
  60. package/dist/types/theme/tokens/components/stepperField.d.ts +2 -2
  61. package/dist/types/theme/tokens/components/switchField.d.ts +3 -3
  62. package/dist/types/theme/tokens/components/table.d.ts +5 -5
  63. package/dist/types/theme/tokens/components/tabs.d.ts +3 -3
  64. package/dist/types/theme/tokens/components/text.d.ts +4 -4
  65. package/dist/types/theme/tokens/components/textAreaField.d.ts +2 -2
  66. package/dist/types/theme/tokens/components/textField.d.ts +1 -1
  67. package/dist/types/theme/tokens/components/toggleButton.d.ts +2 -2
  68. package/dist/types/theme/tokens/components/toggleButtonGroup.d.ts +2 -2
  69. package/dist/types/theme/tokens/fontSizes.d.ts +2 -2
  70. package/dist/types/theme/tokens/fontWeights.d.ts +2 -2
  71. package/dist/types/theme/tokens/fonts.d.ts +3 -3
  72. package/dist/types/theme/tokens/index.d.ts +6 -6
  73. package/dist/types/theme/tokens/lineHeights.d.ts +2 -2
  74. package/dist/types/theme/tokens/opacities.d.ts +2 -2
  75. package/dist/types/theme/tokens/outlineOffsets.d.ts +2 -2
  76. package/dist/types/theme/tokens/outlineWidths.d.ts +2 -2
  77. package/dist/types/theme/tokens/radii.d.ts +2 -2
  78. package/dist/types/theme/tokens/shadows.d.ts +2 -2
  79. package/dist/types/theme/tokens/space.d.ts +4 -4
  80. package/dist/types/theme/tokens/time.d.ts +2 -2
  81. package/dist/types/theme/tokens/transforms.d.ts +3 -3
  82. package/dist/types/theme/tokens/types/designToken.d.ts +66 -66
  83. package/dist/types/theme/tokens/types/typography.d.ts +1 -1
  84. package/dist/types/theme/types.d.ts +2 -2
  85. package/dist/types/theme/utils.d.ts +3 -3
  86. package/dist/types/types/accountSettings/validator.d.ts +2 -2
  87. package/dist/types/types/authenticator/attributes.d.ts +7 -7
  88. package/dist/types/types/authenticator/form.d.ts +6 -6
  89. package/dist/types/types/authenticator/stateMachine/authMachine.d.ts +6 -3
  90. package/dist/types/types/authenticator/stateMachine/context.d.ts +2 -2
  91. package/dist/types/types/authenticator/stateMachine/event.d.ts +3 -3
  92. package/dist/types/types/authenticator/stateMachine/state.d.ts +6 -6
  93. package/dist/types/types/authenticator/user.d.ts +2 -2
  94. package/dist/types/types/authenticator/validator.d.ts +4 -4
  95. package/dist/types/types/primitives/componentClassName.d.ts +1 -0
  96. package/dist/types/types/primitives/index.d.ts +1 -1
  97. package/dist/types/types/util.d.ts +5 -5
  98. package/dist/types/utils/index.d.ts +18 -1
  99. package/package.json +1 -1
  100. package/dist/esm/utils/classname.mjs +0 -1
  101. package/dist/types/utils/classname.d.ts +0 -19
@@ -2,13 +2,13 @@ import { Properties } from 'csstype';
2
2
  /**
3
3
  * a DesignToken can be either an object with a `value` key of `ValueType` or the `ValueType` itself
4
4
  */
5
- export declare type DesignToken<ValueType = unknown> = {
5
+ export type DesignToken<ValueType = unknown> = {
6
6
  value: ValueType;
7
7
  } | ValueType;
8
8
  /**
9
9
  * A fully setup design token ready to be used in web platform.
10
10
  */
11
- export declare type WebDesignToken<ValueType = unknown> = {
11
+ export type WebDesignToken<ValueType = unknown> = {
12
12
  /**
13
13
  * Name of the design token
14
14
  */
@@ -31,63 +31,63 @@ export declare type WebDesignToken<ValueType = unknown> = {
31
31
  */
32
32
  value: ValueType;
33
33
  };
34
- export declare type AnimationDurationValue = string;
35
- export declare type AnimationTimingFunctionValue = string;
36
- export declare type AlignItemsValue = string;
37
- export declare type AlignContentValue = string;
38
- export declare type BackgroundColorValue = ColorValue;
39
- export declare type BorderColorValue = ColorValue;
40
- export declare type BorderCollapseValue = string;
41
- export declare type BorderRadiusValue = RadiusValue;
42
- export declare type BorderStyleValue = string;
43
- export declare type BorderWidthValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : SpaceValue : SpaceValue;
44
- export declare type BorderValue = string;
45
- export declare type BoxSizingValue = string;
46
- export declare type BoxShadowValue = ShadowValue;
47
- export declare type CaptionSideValue = string;
48
- export declare type ColorValue = string;
49
- export declare type CursorValue = string;
50
- export declare type DisplayValue = string;
51
- export declare type FlexDirectionValue = string;
52
- export declare type FlexValue = string;
53
- export declare type FlexWrapValue = string;
54
- export declare type FontSizeValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
55
- export declare type FontStyleValue = string;
56
- export declare type FontValue = string;
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;
58
- export declare type GapValue = string;
59
- export declare type JustifyContentValue = string;
60
- export declare type LineHeightValue = string | number;
61
- export declare type ObjectFitValue = string;
62
- export declare type OpacityValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
63
- export declare type OutlineOffsetValue = string;
64
- export declare type OutlineWidthValue = string;
65
- export declare type OutlineColorValue = string;
66
- export declare type OutlineStyleValue = string;
67
- export declare type PositionValue = string;
68
- export declare type PointerEventsValue = string;
69
- export declare type RadiusValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
70
- export declare type ShadowValue = {
34
+ export type AnimationDurationValue = string;
35
+ export type AnimationTimingFunctionValue = string;
36
+ export type AlignItemsValue = string;
37
+ export type AlignContentValue = string;
38
+ export type BackgroundColorValue = ColorValue;
39
+ export type BorderColorValue = ColorValue;
40
+ export type BorderCollapseValue = string;
41
+ export type BorderRadiusValue = RadiusValue;
42
+ export type BorderStyleValue = string;
43
+ export type BorderWidthValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : SpaceValue : SpaceValue;
44
+ export type BorderValue = string;
45
+ export type BoxSizingValue = string;
46
+ export type BoxShadowValue = ShadowValue;
47
+ export type CaptionSideValue = string;
48
+ export type ColorValue = string;
49
+ export type CursorValue = string;
50
+ export type DisplayValue = string;
51
+ export type FlexDirectionValue = string;
52
+ export type FlexValue = string;
53
+ export type FlexWrapValue = string;
54
+ export type FontSizeValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
55
+ export type FontStyleValue = string;
56
+ export type FontValue = string;
57
+ export 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;
58
+ export type GapValue = string;
59
+ export type JustifyContentValue = string;
60
+ export type LineHeightValue = string | number;
61
+ export type ObjectFitValue = string;
62
+ export type OpacityValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
63
+ export type OutlineOffsetValue = string;
64
+ export type OutlineWidthValue = string;
65
+ export type OutlineColorValue = string;
66
+ export type OutlineStyleValue = string;
67
+ export type PositionValue = string;
68
+ export type PointerEventsValue = string;
69
+ export type RadiusValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
70
+ export type ShadowValue = {
71
71
  offsetX: string;
72
72
  offsetY: string;
73
73
  blurRadius: string;
74
74
  spreadRadius?: string;
75
75
  color: string;
76
76
  } | string;
77
- export declare type StrokeFilledValue = string;
78
- export declare type StrokeEmptyValue = string;
79
- export declare type StrokeLinecapValue = string;
80
- export declare type StrokeWidthValue = string;
81
- export declare type SpaceValue<Platform extends PlatformKey = unknown> = Platform extends 'react-native' ? string | number : string;
82
- export declare type TextAlignValue = string;
83
- export declare type TimeValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
84
- export declare type TransformValue = string;
85
- export declare type TransitionDurationValue = string;
86
- export declare type TransitionPropertyValue = string;
87
- export declare type TransitionTimingFunctionValue = string;
88
- export declare type VerticalAlignValue = string;
89
- export declare type WhiteSpaceValue = string;
90
- export declare type WordBreakValue = string;
77
+ export type StrokeFilledValue = string;
78
+ export type StrokeEmptyValue = string;
79
+ export type StrokeLinecapValue = string;
80
+ export type StrokeWidthValue = string;
81
+ export type SpaceValue<Platform extends PlatformKey = unknown> = Platform extends 'react-native' ? string | number : string;
82
+ export type TextAlignValue = string;
83
+ export type TimeValue<Platform extends PlatformKey = unknown, Output extends OutputVariantKey = unknown> = Output extends 'required' ? Platform extends 'react-native' ? number : string : string;
84
+ export type TransformValue = string;
85
+ export type TransitionDurationValue = string;
86
+ export type TransitionPropertyValue = string;
87
+ export type TransitionTimingFunctionValue = string;
88
+ export type VerticalAlignValue = string;
89
+ export type WhiteSpaceValue = string;
90
+ export type WordBreakValue = string;
91
91
  /**
92
92
  * Mapping of design token value types to style property keys
93
93
  */
@@ -196,38 +196,38 @@ interface TokenCustomProperties {
196
196
  }
197
197
  interface TokenProperties extends TokenStandardProperties, TokenCustomProperties {
198
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;
199
+ type TokenProperty = keyof TokenProperties;
200
+ type Property = Extract<keyof Properties, TokenProperty> | keyof TokenCustomProperties;
201
+ export type OutputVariantKey = 'default' | 'optional' | 'required' | unknown;
202
202
  /**
203
203
  * Return interface with all types optional for custom theme input
204
204
  */
205
- declare type OptionalDesignTokenProperties<Keys extends Property> = Partial<{
205
+ type OptionalDesignTokenProperties<Keys extends Property> = Partial<{
206
206
  [Key in Keys]?: DesignToken<TokenProperties[Key]>;
207
207
  }>;
208
208
  /**
209
209
  * Return interface with all types required for strict theme output
210
210
  */
211
- declare type RequiredDesignTokenProperties<Keys extends TokenProperty> = {
211
+ type RequiredDesignTokenProperties<Keys extends TokenProperty> = {
212
212
  [Key in Keys]: WebDesignToken<TokenProperties[Key]>;
213
213
  };
214
214
  /**
215
215
  * Return interface with all types required for strict theme output
216
216
  */
217
- declare type DefaultDesignTokenProperties<Keys extends TokenProperty> = Required<{
217
+ type DefaultDesignTokenProperties<Keys extends TokenProperty> = Required<{
218
218
  [Key in Keys]: DesignToken<TokenProperties[Key]>;
219
219
  }>;
220
220
  /**
221
221
  * Utility for creating interfaces for components from supported CSS property keys
222
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>>>;
223
+ export type DesignTokenProperties<Keys extends TokenProperty, Output extends OutputVariantKey = unknown> = Output extends 'required' ? RequiredDesignTokenProperties<Keys> : Output extends 'optional' ? OptionalDesignTokenProperties<Keys> : DefaultDesignTokenProperties<Keys>;
224
+ export type PlatformKey = 'web' | 'react-native' | 'android' | 'ios' | unknown;
225
+ type PropKey = string | number;
226
+ type RequiredTokenValues<PropertyValueKey extends PropKey, PropertyValue, Platform extends PlatformKey = unknown> = Record<PropertyValueKey, Platform extends 'react-native' ? PropertyValue : WebDesignToken<PropertyValue>>;
227
+ type OptionalTokenValues<PropertyValueKey extends PropKey, PropertyValue, Platform extends PlatformKey = unknown> = Partial<Record<PropertyValueKey, DesignToken<PropertyValue>>>;
228
+ type DefaultTokenValues<PropertyValueKey extends PropKey, PropertyValue, Platform extends PlatformKey = unknown> = Required<Record<PropertyValueKey, DesignToken<PropertyValue>>>;
229
229
  /**
230
230
  * Utility for creating token interfaces in `Theme`
231
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>;
232
+ export 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
233
  export {};
@@ -1,2 +1,2 @@
1
1
  import { DesignTokenProperties } from './designToken';
2
- export declare type TypographyTokens<OutputType> = DesignTokenProperties<'fontSize' | 'fontWeight' | 'color', OutputType>;
2
+ export type TypographyTokens<OutputType> = DesignTokenProperties<'fontSize' | 'fontWeight' | 'color', OutputType>;
@@ -15,7 +15,7 @@ export type { SpaceSizes } from './tokens/space';
15
15
  * a set of CSS variables in it. A theme should contain
16
16
  * everything it needs to render
17
17
  */
18
- export declare type Override = SelectorOverride | MediaQueryOverride | BreakpointOverride | ColorModeOverride;
18
+ export type Override = SelectorOverride | MediaQueryOverride | BreakpointOverride | ColorModeOverride;
19
19
  interface BaseOverride {
20
20
  tokens?: PartialDeep<Tokens>;
21
21
  }
@@ -57,7 +57,7 @@ export interface MediaQueryOverride extends BaseOverride {
57
57
  export interface SelectorOverride extends BaseOverride {
58
58
  selector: string;
59
59
  }
60
- declare type ColorMode = 'light' | 'dark';
60
+ type ColorMode = 'light' | 'dark';
61
61
  /**
62
62
  * This creates a color mode override, where the color mode is 'light' or 'dark'.
63
63
  * Note: there is no 'system' here.
@@ -14,16 +14,16 @@ export declare function cssNameTransform({ path }: NameTransformProps): string;
14
14
  */
15
15
  export declare function isDesignToken(value: unknown): value is WebDesignToken;
16
16
  export declare function isShadowTokenObject(value: unknown): value is ShadowValue & object;
17
- declare type SetupTokensProps = {
17
+ type SetupTokensProps = {
18
18
  tokens?: Record<string | number, any>;
19
19
  path?: Array<string>;
20
20
  setupToken: SetupToken;
21
21
  };
22
- export declare type SetupToken<ReturnType = any> = (args: {
22
+ export type SetupToken<ReturnType = any> = (args: {
23
23
  token: BaseDesignToken;
24
24
  path: Array<string>;
25
25
  }) => ReturnType;
26
- declare type BaseDesignToken = {
26
+ type BaseDesignToken = {
27
27
  value: string | number;
28
28
  };
29
29
  /**
@@ -1,5 +1,5 @@
1
- export declare type InputEventType = 'blur' | 'change';
2
- export declare type ValidationMode = 'onBlur' | 'onChange' | 'onTouched';
1
+ export type InputEventType = 'blur' | 'change';
2
+ export type ValidationMode = 'onBlur' | 'onChange' | 'onTouched';
3
3
  export interface ValidatorOptions {
4
4
  validationMode: ValidationMode;
5
5
  validator: (value: string) => boolean;
@@ -1,22 +1,22 @@
1
1
  /** Array of auth fields that we supply defaults with */
2
2
  export declare const signUpFieldsWithDefault: readonly ["birthdate", "email", "family_name", "given_name", "middle_name", "name", "nickname", "phone_number", "preferred_username", "profile", "website"];
3
3
  /** Auth fields that we supply defaults with */
4
- export declare type SignUpFieldsWithDefaults = typeof signUpFieldsWithDefault[number];
4
+ export type SignUpFieldsWithDefaults = typeof signUpFieldsWithDefault[number];
5
5
  /** Array of auth fields that we do not supply defaults with */
6
6
  export declare const signUpFieldsWithoutDefault: readonly ["address", "gender", "locale", "picture", "updated_at", "zoneinfo"];
7
7
  /** Auth fields that we do not supply defaults with */
8
- export declare type SignUpFieldsWithoutDefaults = typeof signUpFieldsWithoutDefault[number];
8
+ export type SignUpFieldsWithoutDefaults = typeof signUpFieldsWithoutDefault[number];
9
9
  /** All known auth fields */
10
- export declare type SignUpAttribute = SignUpFieldsWithDefaults | SignUpFieldsWithoutDefaults;
10
+ export type SignUpAttribute = SignUpFieldsWithDefaults | SignUpFieldsWithoutDefaults;
11
11
  /** Fields that are common in all routes */
12
- export declare type CommonFields = 'username' | 'password' | 'confirm_password';
12
+ export type CommonFields = 'username' | 'password' | 'confirm_password';
13
13
  /** Array of known login mechanisms */
14
14
  export declare const LoginMechanismArray: readonly ["username", "email", "phone_number"];
15
15
  /** Login mechanisms that can be used to sign in */
16
- export declare type LoginMechanism = typeof LoginMechanismArray[number];
16
+ export type LoginMechanism = typeof LoginMechanismArray[number];
17
17
  /** List of social provider Authenticator supports */
18
- export declare type SocialProvider = 'amazon' | 'apple' | 'facebook' | 'google';
18
+ export type SocialProvider = 'amazon' | 'apple' | 'facebook' | 'google';
19
19
  export declare const authFieldsWithDefaults: readonly ["username", "email", "phone_number", "birthdate", "email", "family_name", "given_name", "middle_name", "name", "nickname", "phone_number", "preferred_username", "profile", "website", "confirmation_code", "password", "confirm_password"];
20
20
  /** Input fields that we provide default fields with */
21
- export declare type AuthFieldsWithDefaults = typeof authFieldsWithDefaults[number];
21
+ export type AuthFieldsWithDefaults = typeof authFieldsWithDefaults[number];
22
22
  export declare const isAuthFieldsWithDefaults: (field: string) => field is "birthdate" | "email" | "family_name" | "given_name" | "middle_name" | "name" | "nickname" | "phone_number" | "preferred_username" | "profile" | "website" | "username" | "password" | "confirm_password" | "confirmation_code";
@@ -2,15 +2,15 @@ import { AuthFieldsWithDefaults } from './attributes';
2
2
  /**
3
3
  * Map of each input name to its value
4
4
  */
5
- export declare type AuthFormData = Record<string, string>;
5
+ export type AuthFormData = Record<string, string>;
6
6
  /**
7
7
  * List of routes that support custom formFields
8
8
  */
9
- export declare type FormFieldComponents = 'signIn' | 'signUp' | 'forceNewPassword' | 'confirmResetPassword' | 'confirmSignIn' | 'confirmSignUp' | 'confirmVerifyUser' | 'resetPassword' | 'setupTOTP';
9
+ export type FormFieldComponents = 'signIn' | 'signUp' | 'forceNewPassword' | 'confirmResetPassword' | 'confirmSignIn' | 'confirmSignUp' | 'confirmVerifyUser' | 'resetPassword' | 'setupTOTP';
10
10
  /**
11
11
  * Used to customize form field attributes for each authenticator screen.
12
12
  */
13
- export declare type AuthFormFields = {
13
+ export type AuthFormFields = {
14
14
  [key in FormFieldComponents]?: FormFields;
15
15
  };
16
16
  /**
@@ -54,10 +54,10 @@ export interface LegacyFormFieldOptions extends FormFieldOptions {
54
54
  name: string;
55
55
  }
56
56
  /** Default formField values for each supported auth field */
57
- export declare type DefaultFormFieldOptions = Record<AuthFieldsWithDefaults, FormFieldOptions>;
57
+ export type DefaultFormFieldOptions = Record<AuthFieldsWithDefaults, FormFieldOptions>;
58
58
  /** Ordered list of formFields */
59
- export declare type FormFieldsArray = Array<[string, FormFieldOptions]>;
60
- export declare type PasswordPolicyRules = 'REQUIRES_LOWERCASE' | 'REQUIRES_NUMBERS' | 'REQUIRES_SYMBOLS' | 'REQUIRES_UPPERCASE';
59
+ export type FormFieldsArray = Array<[string, FormFieldOptions]>;
60
+ export type PasswordPolicyRules = 'REQUIRES_LOWERCASE' | 'REQUIRES_NUMBERS' | 'REQUIRES_SYMBOLS' | 'REQUIRES_UPPERCASE';
61
61
  export interface PasswordSettings {
62
62
  passwordPolicyMinLength: number;
63
63
  passwordPolicyCharacters: Array<PasswordPolicyRules>;
@@ -11,13 +11,16 @@ import { HubCapsule } from '@aws-amplify/core';
11
11
  *
12
12
  * TODO: tighten up anys here
13
13
  */
14
- export declare type AuthInterpreter = Interpreter<AuthContext, any, AuthEvent, any, any>;
14
+ export type AuthInterpreter = Interpreter<AuthContext, any, AuthEvent, any, any>;
15
15
  /**
16
16
  * Function type for `send` in `authMachine`
17
17
  */
18
- export declare type AuthMachineSend = AuthInterpreter['send'];
18
+ export type AuthMachineSend = AuthInterpreter['send'];
19
19
  /**
20
20
  * Handles Amplify JS Auth hub events, by forwarding hub events as appropriate
21
21
  * xstate events.
22
22
  */
23
- export declare type AuthMachineHubHandler = (data: HubCapsule, service: AuthInterpreter) => Promise<void>;
23
+ export type AuthMachineHubHandler = (data: HubCapsule, service: AuthInterpreter, options?: {
24
+ onSignIn?: () => void;
25
+ onSignOut?: () => void;
26
+ }) => Promise<void>;
@@ -101,6 +101,6 @@ export interface SignOutContext {
101
101
  /**
102
102
  * Context for actors that have forms
103
103
  */
104
- export declare type ActorContextWithForms = SignInContext | SignUpContext | ResetPasswordContext;
105
- export declare type AuthActorContext = ActorContextWithForms | SignOutContext;
104
+ export type ActorContextWithForms = SignInContext | SignUpContext | ResetPasswordContext;
105
+ export type AuthActorContext = ActorContextWithForms | SignOutContext;
106
106
  export {};
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Events that occur when actors are done
3
3
  */
4
- export declare type InvokeActorEventTypes = 'done.invoke.signInActor' | 'done.invoke.signUpActor' | 'done.invoke.signOutActor' | 'done.invoke.resetPasswordActor';
4
+ export type InvokeActorEventTypes = 'done.invoke.signInActor' | 'done.invoke.signUpActor' | 'done.invoke.signOutActor' | 'done.invoke.resetPasswordActor';
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' | 'AUTO_SIGN_IN' | 'AUTO_SIGN_IN_FAILURE' | 'SIGN_IN' | 'SIGN_OUT' | 'SIGN_UP' | 'SKIP' | 'SUBMIT' | 'INIT' | 'TOKEN_REFRESH' | InvokeActorEventTypes;
8
+ export 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
  */
12
- export declare type AuthEventData = Record<PropertyKey, any>;
12
+ export type AuthEventData = Record<PropertyKey, any>;
13
13
  /** Top-level auth machine event interface */
14
14
  export interface AuthEvent {
15
15
  type: AuthEventTypes;
@@ -2,9 +2,9 @@ import { State } from 'xstate';
2
2
  import { ResetPasswordContext } from '.';
3
3
  import { SignInContext, SignUpContext, SignOutContext, AuthActorContext, AuthContext } from './context';
4
4
  import { AuthEvent } from './event';
5
- export declare type SignInState = State<SignInContext, AuthEvent>;
6
- export declare type SignUpState = State<SignUpContext, AuthEvent>;
7
- export declare type SignOutState = State<SignOutContext, AuthEvent>;
8
- export declare type ResetPasswordState = State<ResetPasswordContext, AuthEvent>;
9
- export declare type AuthActorState = State<AuthActorContext, AuthEvent>;
10
- export declare type AuthMachineState = State<AuthContext, AuthEvent>;
5
+ export type SignInState = State<SignInContext, AuthEvent>;
6
+ export type SignUpState = State<SignUpContext, AuthEvent>;
7
+ export type SignOutState = State<SignOutContext, AuthEvent>;
8
+ export type ResetPasswordState = State<ResetPasswordContext, AuthEvent>;
9
+ export type AuthActorState = State<AuthActorContext, AuthEvent>;
10
+ export type AuthMachineState = State<AuthContext, AuthEvent>;
@@ -1,8 +1,8 @@
1
1
  import { ChallengeName, CognitoUser } from 'amazon-cognito-identity-js';
2
2
  /** Known challenge names */
3
- export declare type AuthChallengeName = ChallengeName;
3
+ export type AuthChallengeName = ChallengeName;
4
4
  /** Contact destinations that we can send user confirmation code to */
5
- export declare type ContactMethod = 'Email' | 'Phone Number';
5
+ export type ContactMethod = 'Email' | 'Phone Number';
6
6
  /** Federated IDPs that Authenticator supports */
7
7
  export declare enum FederatedIdentityProviders {
8
8
  Apple = "SignInWithApple",
@@ -3,13 +3,13 @@ import { AuthFormData } from './form';
3
3
  /**
4
4
  * Maps each input to its validation error, if any
5
5
  */
6
- export declare type ValidationError = Record<string, string | string[]>;
6
+ export type ValidationError = Record<string, string | string[]>;
7
7
  /**
8
8
  * Return type of validator. This is `null` if there are no error, and `ValidationError` otherwise.
9
9
  */
10
- export declare type ValidatorResult = void | null | ValidationError;
11
- export declare type SignInResult = string;
10
+ export type ValidatorResult = void | null | ValidationError;
11
+ export type SignInResult = string;
12
12
  /**
13
13
  * Validates the given formData. This can be synchronous or asynchronous.
14
14
  */
15
- export declare type Validator = (formData: AuthFormData, touchData?: AuthFormData, passwordSettings?: PasswordSettings) => ValidatorResult | Promise<ValidatorResult>;
15
+ export type Validator = (formData: AuthFormData, touchData?: AuthFormData, passwordSettings?: PasswordSettings) => ValidatorResult | Promise<ValidatorResult>;
@@ -161,3 +161,4 @@ export declare enum ComponentClassName {
161
161
  ToggleButtonGroup = "amplify-togglebuttongroup",
162
162
  VisuallyHidden = "amplify-visually-hidden"
163
163
  }
164
+ export type Modifiers = string | number | null;
@@ -1 +1 @@
1
- export { ComponentClassName } from './componentClassName';
1
+ export { ComponentClassName, Modifiers } from './componentClassName';
@@ -1,14 +1,14 @@
1
- export declare type NoInfer<T> = [T][T extends any ? 0 : never];
1
+ export type NoInfer<T> = [T][T extends any ? 0 : never];
2
2
  /**
3
3
  Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
4
4
 
5
5
  @category Type
6
6
  */
7
- declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
7
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
8
8
  /**
9
9
  Matches any primitive, `Date`, or `RegExp` value.
10
10
  */
11
- declare type BuiltIns = Primitive | Date | RegExp;
11
+ type BuiltIns = Primitive | Date | RegExp;
12
12
  /**
13
13
  @see PartialDeep
14
14
  */
@@ -66,7 +66,7 @@ If this is undesirable, you can pass `{recurseIntoArrays: false}` as the second
66
66
  @category Set
67
67
  @category Map
68
68
  */
69
- export declare type PartialDeep<T, Options extends PartialDeepOptions = {}> = T extends BuiltIns ? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends ReadonlyArray<infer ItemType> ? Options['recurseIntoArrays'] extends false ? T : ItemType[] extends T ? readonly ItemType[] extends T ? ReadonlyArray<PartialDeep<ItemType | undefined, Options>> : Array<PartialDeep<ItemType | undefined, Options>> : PartialObjectDeep<T, Options> : PartialObjectDeep<T, Options> : unknown;
69
+ export type PartialDeep<T, Options extends PartialDeepOptions = {}> = T extends BuiltIns ? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends ReadonlyArray<infer ItemType> ? Options['recurseIntoArrays'] extends false ? T : ItemType[] extends T ? readonly ItemType[] extends T ? ReadonlyArray<PartialDeep<ItemType | undefined, Options>> : Array<PartialDeep<ItemType | undefined, Options>> : PartialObjectDeep<T, Options> : PartialObjectDeep<T, Options> : unknown;
70
70
  /**
71
71
  Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
72
72
  */
@@ -90,7 +90,7 @@ interface PartialReadonlySetDeep<T, Options extends PartialDeepOptions> extends
90
90
  /**
91
91
  Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
92
92
  */
93
- declare type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOptions> = {
93
+ type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOptions> = {
94
94
  [KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType], Options>;
95
95
  };
96
96
  export {};
@@ -1,3 +1,4 @@
1
+ import { ComponentClassName, Modifiers } from '../types';
1
2
  /**
2
3
  * Some libraries may not follow Node ES module spec and could be loaded as CommonJS modules,
3
4
  * To ensure the interoperability between ESM and CJS, modules from those libraries have to be loaded via namespace import
@@ -92,4 +93,20 @@ export declare function has(value: unknown, key: string): boolean;
92
93
  * @returns {boolean} whether `value` is a function
93
94
  */
94
95
  export declare function isFunction(value: unknown): value is Function;
95
- export { classNameModifier, classNameModifierByFlag } from './classname';
96
+ /**
97
+ * This helper function creates modifier class names that are used for our flat BEM styling
98
+ * it takes in a base and modifier and returns the modified class if a modifier was passed in and null otherwise
99
+ * @param base The base class of the output
100
+ * @param modifier The modifier to add onto the base
101
+ * @returns the modified class name or empty string
102
+ */
103
+ export declare const classNameModifier: (base: ComponentClassName, modifier?: Modifiers) => string;
104
+ /**
105
+ * This helper function creates modified class names that are used for our flat BEM styling
106
+ * it takes in a base, modifier, and flag and returns the modified class name if the flag is true and null if the flag is false
107
+ * @param base
108
+ * @param modifier
109
+ * @param flag
110
+ * @returns the modified class name or empty string
111
+ */
112
+ export declare const classNameModifierByFlag: (base: ComponentClassName, modifier: Modifiers, flag?: boolean) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui",
3
- "version": "5.6.0",
3
+ "version": "5.6.2",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -1 +0,0 @@
1
- const $=($,o)=>o?`${$}--${o}`:"",o=($,o,t)=>t?`${$}--${o}`:"";export{$ as classNameModifier,o as classNameModifierByFlag};
@@ -1,19 +0,0 @@
1
- import { ComponentClassName } from '../types';
2
- export declare type Modifiers = string | number | null;
3
- /**
4
- * This helper function creates modifier class names that are used for our flat BEM styling
5
- * it takes in a base and modifier and returns the modified class if a modifier was passed in and null otherwise
6
- * @param base The base class of the output
7
- * @param modifier The modifier to add onto the base
8
- * @returns the modified class name or empty string
9
- */
10
- export declare const classNameModifier: (base: ComponentClassName, modifier?: Modifiers) => string;
11
- /**
12
- * This helper function creates modified class names that are used for our flat BEM styling
13
- * it takes in a base, modifier, and flag and returns the modified class name if the flag is true and null if the flag is false
14
- * @param base
15
- * @param modifier
16
- * @param flag
17
- * @returns the modified class name or empty string
18
- */
19
- export declare const classNameModifierByFlag: (base: ComponentClassName, modifier: Modifiers, flag?: boolean) => string;