@aws-amplify/ui 5.8.1 → 6.0.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/accountSettings/utils.mjs +33 -1
- package/dist/esm/helpers/accountSettings/validator.mjs +120 -1
- package/dist/esm/helpers/authenticator/actor.mjs +20 -1
- package/dist/esm/helpers/authenticator/constants.mjs +144 -1
- package/dist/esm/helpers/authenticator/defaultAuthHubHandler.mjs +52 -0
- package/dist/esm/helpers/authenticator/facade.mjs +137 -1
- package/dist/esm/helpers/authenticator/form.mjs +43 -1
- package/dist/esm/helpers/authenticator/formFields/defaults.mjs +132 -1
- package/dist/esm/helpers/authenticator/formFields/formFields.mjs +62 -1
- package/dist/esm/helpers/authenticator/formFields/utils.mjs +35 -0
- package/dist/esm/helpers/authenticator/getRoute.mjs +47 -0
- package/dist/esm/helpers/authenticator/textUtil.mjs +112 -1
- package/dist/esm/helpers/authenticator/utils.mjs +38 -1
- package/dist/esm/helpers/utils.mjs +5 -1
- package/dist/esm/i18n/country-dial-codes.mjs +210 -1
- package/dist/esm/i18n/dictionaries/authenticator/de.mjs +87 -1
- package/dist/esm/i18n/dictionaries/authenticator/defaultTexts.mjs +83 -1
- package/dist/esm/i18n/dictionaries/authenticator/en.mjs +74 -1
- package/dist/esm/i18n/dictionaries/authenticator/es.mjs +83 -1
- package/dist/esm/i18n/dictionaries/authenticator/fr.mjs +92 -1
- package/dist/esm/i18n/dictionaries/authenticator/he.mjs +54 -1
- package/dist/esm/i18n/dictionaries/authenticator/id.mjs +96 -1
- package/dist/esm/i18n/dictionaries/authenticator/it.mjs +82 -1
- package/dist/esm/i18n/dictionaries/authenticator/ja.mjs +86 -1
- package/dist/esm/i18n/dictionaries/authenticator/kr.mjs +71 -1
- package/dist/esm/i18n/dictionaries/authenticator/nb.mjs +95 -1
- package/dist/esm/i18n/dictionaries/authenticator/nl.mjs +67 -1
- package/dist/esm/i18n/dictionaries/authenticator/pl.mjs +71 -1
- package/dist/esm/i18n/dictionaries/authenticator/pt.mjs +61 -1
- package/dist/esm/i18n/dictionaries/authenticator/ru.mjs +61 -1
- package/dist/esm/i18n/dictionaries/authenticator/sv.mjs +82 -1
- package/dist/esm/i18n/dictionaries/authenticator/tr.mjs +76 -1
- package/dist/esm/i18n/dictionaries/authenticator/ua.mjs +84 -1
- package/dist/esm/i18n/dictionaries/authenticator/zh.mjs +74 -1
- package/dist/esm/i18n/dictionaries/index.mjs +47 -1
- package/dist/esm/i18n/translations.mjs +67 -1
- package/dist/esm/index.mjs +28 -1
- package/dist/esm/machines/authenticator/actions.mjs +188 -1
- package/dist/esm/machines/authenticator/actors/forgotPassword.mjs +184 -0
- package/dist/esm/machines/authenticator/actors/signIn.mjs +328 -1
- package/dist/esm/machines/authenticator/actors/signOut.mjs +28 -1
- package/dist/esm/machines/authenticator/actors/signUp.mjs +295 -0
- package/dist/esm/machines/authenticator/actors/verifyUserAttributes.mjs +106 -0
- package/dist/esm/machines/authenticator/defaultServices.mjs +102 -1
- package/dist/esm/machines/authenticator/guards.mjs +70 -0
- package/dist/esm/machines/authenticator/index.mjs +368 -1
- package/dist/esm/machines/authenticator/utils.mjs +71 -0
- package/dist/esm/theme/breakpoints.mjs +14 -1
- package/dist/esm/theme/createTheme.mjs +156 -1
- package/dist/esm/theme/defaultDarkModeOverride.mjs +128 -1
- package/dist/esm/theme/defaultTheme.mjs +10 -1
- package/dist/esm/theme/tokens/borderWidths.mjs +7 -1
- package/dist/esm/theme/tokens/colors.mjs +166 -1
- package/dist/esm/theme/tokens/components/accordion.mjs +47 -0
- package/dist/esm/theme/tokens/components/alert.mjs +35 -1
- package/dist/esm/theme/tokens/components/authenticator.mjs +39 -1
- package/dist/esm/theme/tokens/components/autocomplete.mjs +42 -1
- package/dist/esm/theme/tokens/components/badge.mjs +44 -1
- package/dist/esm/theme/tokens/components/breadcrumbs.mjs +34 -1
- package/dist/esm/theme/tokens/components/button.mjs +685 -1
- package/dist/esm/theme/tokens/components/card.mjs +27 -1
- package/dist/esm/theme/tokens/components/checkbox.mjs +87 -1
- package/dist/esm/theme/tokens/components/checkboxField.mjs +8 -1
- package/dist/esm/theme/tokens/components/collection.mjs +72 -1
- package/dist/esm/theme/tokens/components/copy.mjs +18 -1
- package/dist/esm/theme/tokens/components/dialCodeSelect.mjs +7 -1
- package/dist/esm/theme/tokens/components/divider.mjs +22 -1
- package/dist/esm/theme/tokens/components/dropZone.mjs +46 -1
- package/dist/esm/theme/tokens/components/field.mjs +20 -1
- package/dist/esm/theme/tokens/components/fieldControl.mjs +131 -1
- package/dist/esm/theme/tokens/components/fieldGroup.mjs +11 -1
- package/dist/esm/theme/tokens/components/fieldMessages.mjs +13 -1
- package/dist/esm/theme/tokens/components/fieldset.mjs +40 -1
- package/dist/esm/theme/tokens/components/flex.mjs +9 -1
- package/dist/esm/theme/tokens/components/heading.mjs +30 -1
- package/dist/esm/theme/tokens/components/highlightMatch.mjs +7 -1
- package/dist/esm/theme/tokens/components/icon.mjs +6 -1
- package/dist/esm/theme/tokens/components/image.mjs +8 -1
- package/dist/esm/theme/tokens/components/inAppMessaging.mjs +23 -1
- package/dist/esm/theme/tokens/components/index.mjs +111 -1
- package/dist/esm/theme/tokens/components/input.mjs +12 -1
- package/dist/esm/theme/tokens/components/link.mjs +9 -1
- package/dist/esm/theme/tokens/components/liveness.mjs +7 -1
- package/dist/esm/theme/tokens/components/loader.mjs +42 -1
- package/dist/esm/theme/tokens/components/menu.mjs +27 -1
- package/dist/esm/theme/tokens/components/message.mjs +102 -1
- package/dist/esm/theme/tokens/components/pagination.mjs +40 -1
- package/dist/esm/theme/tokens/components/passwordField.mjs +38 -1
- package/dist/esm/theme/tokens/components/phoneNumberField.mjs +10 -1
- package/dist/esm/theme/tokens/components/placeholder.mjs +18 -1
- package/dist/esm/theme/tokens/components/radio.mjs +67 -1
- package/dist/esm/theme/tokens/components/radioGroup.mjs +19 -1
- package/dist/esm/theme/tokens/components/rating.mjs +9 -1
- package/dist/esm/theme/tokens/components/searchField.mjs +39 -1
- package/dist/esm/theme/tokens/components/select.mjs +63 -1
- package/dist/esm/theme/tokens/components/selectField.mjs +16 -1
- package/dist/esm/theme/tokens/components/sliderField.mjs +70 -1
- package/dist/esm/theme/tokens/components/stepperField.mjs +33 -1
- package/dist/esm/theme/tokens/components/storagemanager.mjs +97 -1
- package/dist/esm/theme/tokens/components/switchField.mjs +61 -1
- package/dist/esm/theme/tokens/components/table.mjs +105 -1
- package/dist/esm/theme/tokens/components/tabs.mjs +59 -1
- package/dist/esm/theme/tokens/components/text.mjs +28 -1
- package/dist/esm/theme/tokens/components/textAreaField.mjs +11 -1
- package/dist/esm/theme/tokens/components/textField.mjs +12 -1
- package/dist/esm/theme/tokens/components/toggleButton.mjs +96 -1
- package/dist/esm/theme/tokens/components/toggleButtonGroup.mjs +7 -1
- package/dist/esm/theme/tokens/fontSizes.mjs +14 -1
- package/dist/esm/theme/tokens/fontWeights.mjs +13 -1
- package/dist/esm/theme/tokens/fonts.mjs +19 -1
- package/dist/esm/theme/tokens/index.mjs +65 -1
- package/dist/esm/theme/tokens/lineHeights.mjs +7 -1
- package/dist/esm/theme/tokens/opacities.mjs +15 -1
- package/dist/esm/theme/tokens/outlineOffsets.mjs +7 -1
- package/dist/esm/theme/tokens/outlineWidths.mjs +7 -1
- package/dist/esm/theme/tokens/radii.mjs +11 -1
- package/dist/esm/theme/tokens/shadows.mjs +28 -1
- package/dist/esm/theme/tokens/space.mjs +29 -1
- package/dist/esm/theme/tokens/time.mjs +7 -1
- package/dist/esm/theme/tokens/transforms.mjs +10 -1
- package/dist/esm/theme/utils.mjs +81 -1
- package/dist/esm/types/authenticator/attributes.mjs +41 -1
- package/dist/esm/types/authenticator/user.mjs +18 -1
- package/dist/esm/types/authenticator/utils.mjs +5 -1
- package/dist/esm/types/primitives/componentClassName.mjs +164 -1
- package/dist/esm/utils/classNames.mjs +39 -0
- package/dist/esm/utils/setUserAgent/constants.mjs +43 -0
- package/dist/esm/utils/setUserAgent/setUserAgent.mjs +65 -0
- package/dist/esm/utils/utils.mjs +227 -0
- package/dist/esm/validators/index.mjs +19 -1
- package/dist/index.js +8396 -1
- package/dist/styles/StorageManager.css +138 -0
- package/dist/styles/StorageManager.layer.css +140 -0
- package/dist/styles/_fieldControl.css +0 -0
- package/dist/styles/_fieldControl.layer.css +3 -0
- package/dist/styles/accordion.css +64 -0
- package/dist/styles/accordion.layer.css +66 -0
- package/dist/styles/alert.css +44 -0
- package/dist/styles/alert.layer.css +46 -0
- package/dist/styles/authenticator.css +72 -0
- package/dist/styles/authenticator.layer.css +74 -0
- package/dist/styles/autocomplete.css +48 -0
- package/dist/styles/autocomplete.layer.css +50 -0
- package/dist/styles/badge.css +35 -0
- package/dist/styles/badge.layer.css +37 -0
- package/dist/styles/base.css +1491 -0
- package/dist/styles/base.layer.css +1493 -0
- package/dist/styles/breadcrumbs.css +40 -0
- package/dist/styles/breadcrumbs.layer.css +42 -0
- package/dist/styles/button.css +1122 -0
- package/dist/styles/button.layer.css +1124 -0
- package/dist/styles/card.css +26 -0
- package/dist/styles/card.layer.css +28 -0
- package/dist/styles/checkbox.css +95 -0
- package/dist/styles/checkbox.layer.css +97 -0
- package/dist/styles/checkboxField.css +6 -0
- package/dist/styles/checkboxField.layer.css +8 -0
- package/dist/styles/collection.css +70 -0
- package/dist/styles/collection.layer.css +72 -0
- package/dist/styles/copy.css +27 -0
- package/dist/styles/copy.layer.css +29 -0
- package/dist/styles/dialCodeSelect.css +3 -0
- package/dist/styles/dialCodeSelect.layer.css +5 -0
- package/dist/styles/divider.css +47 -0
- package/dist/styles/divider.layer.css +49 -0
- package/dist/styles/dropZone.css +45 -0
- package/dist/styles/dropZone.layer.css +47 -0
- package/dist/styles/field.css +17 -0
- package/dist/styles/field.layer.css +19 -0
- package/dist/styles/fieldGroup.css +130 -0
- package/dist/styles/fieldGroup.layer.css +132 -0
- package/dist/styles/fieldMessages.css +10 -0
- package/dist/styles/fieldMessages.layer.css +12 -0
- package/dist/styles/fieldModifiers.css +15 -0
- package/dist/styles/fieldModifiers.layer.css +17 -0
- package/dist/styles/fieldset.css +37 -0
- package/dist/styles/fieldset.layer.css +39 -0
- package/dist/styles/flex.css +8 -0
- package/dist/styles/flex.layer.css +10 -0
- package/dist/styles/grid.css +3 -0
- package/dist/styles/grid.layer.css +5 -0
- package/dist/styles/heading.css +40 -0
- package/dist/styles/heading.layer.css +42 -0
- package/dist/styles/highlightMatch.css +3 -0
- package/dist/styles/highlightMatch.layer.css +5 -0
- package/dist/styles/icon.css +14 -0
- package/dist/styles/icon.layer.css +16 -0
- package/dist/styles/image.css +9 -0
- package/dist/styles/image.layer.css +11 -0
- package/dist/styles/inAppMessaging.css +179 -0
- package/dist/styles/inAppMessaging.layer.css +181 -0
- package/dist/styles/input.css +83 -0
- package/dist/styles/input.layer.css +85 -0
- package/dist/styles/link.css +26 -0
- package/dist/styles/link.layer.css +28 -0
- package/dist/styles/liveness.css +374 -0
- package/dist/styles/liveness.layer.css +376 -0
- package/dist/styles/loader.css +108 -0
- package/dist/styles/loader.layer.css +110 -0
- package/dist/styles/menu.css +54 -0
- package/dist/styles/menu.layer.css +56 -0
- package/dist/styles/message.css +111 -0
- package/dist/styles/message.layer.css +113 -0
- package/dist/styles/pagination.css +41 -0
- package/dist/styles/pagination.layer.css +43 -0
- package/dist/styles/passwordField.css +49 -0
- package/dist/styles/passwordField.layer.css +51 -0
- package/dist/styles/phoneNumberField.css +30 -0
- package/dist/styles/phoneNumberField.layer.css +32 -0
- package/dist/styles/placeholder.css +31 -0
- package/dist/styles/placeholder.layer.css +33 -0
- package/dist/styles/radio.css +82 -0
- package/dist/styles/radio.layer.css +84 -0
- package/dist/styles/radioGroupField.css +25 -0
- package/dist/styles/radioGroupField.layer.css +27 -0
- package/dist/styles/radiogroup.css +5 -0
- package/dist/styles/radiogroup.layer.css +7 -0
- package/dist/styles/rating.css +33 -0
- package/dist/styles/rating.layer.css +35 -0
- package/dist/styles/reset.css +76 -0
- package/dist/styles/reset.layer.css +78 -0
- package/dist/styles/scrollView.css +4 -0
- package/dist/styles/scrollView.layer.css +6 -0
- package/dist/styles/searchField.css +29 -0
- package/dist/styles/searchField.layer.css +31 -0
- package/dist/styles/select.css +128 -0
- package/dist/styles/select.layer.css +130 -0
- package/dist/styles/selectField.css +18 -0
- package/dist/styles/selectField.layer.css +20 -0
- package/dist/styles/sliderField.css +143 -0
- package/dist/styles/sliderField.layer.css +145 -0
- package/dist/styles/stepperField.css +77 -0
- package/dist/styles/stepperField.layer.css +79 -0
- package/dist/styles/switchField.css +76 -0
- package/dist/styles/switchField.layer.css +78 -0
- package/dist/styles/table.css +146 -0
- package/dist/styles/table.layer.css +148 -0
- package/dist/styles/tabs.css +87 -0
- package/dist/styles/tabs.layer.css +89 -0
- package/dist/styles/text.css +40 -0
- package/dist/styles/text.layer.css +42 -0
- package/dist/styles/textArea.css +71 -0
- package/dist/styles/textArea.layer.css +73 -0
- package/dist/styles/textAreaField.css +12 -0
- package/dist/styles/textAreaField.layer.css +14 -0
- package/dist/styles/textField.css +14 -0
- package/dist/styles/textField.layer.css +16 -0
- package/dist/styles/toggleButton.css +280 -0
- package/dist/styles/toggleButton.layer.css +282 -0
- package/dist/styles/toggleButtonGroup.css +31 -0
- package/dist/styles/toggleButtonGroup.layer.css +33 -0
- package/dist/styles/visuallyHidden.css +12 -0
- package/dist/styles/visuallyHidden.layer.css +14 -0
- package/dist/styles.css +298 -684
- package/dist/styles.layer.css +6115 -0
- package/dist/theme.css +93 -156
- package/dist/types/helpers/accountSettings/utils.d.ts +1 -3
- package/dist/types/helpers/authenticator/actor.d.ts +1 -1
- package/dist/types/helpers/authenticator/constants.d.ts +5 -0
- package/dist/types/helpers/authenticator/defaultAuthHubHandler.d.ts +15 -0
- package/dist/types/helpers/authenticator/facade.d.ts +35 -6
- package/dist/types/helpers/authenticator/formFields/defaults.d.ts +3 -1
- package/dist/types/helpers/authenticator/formFields/formFields.d.ts +2 -1
- package/dist/types/helpers/authenticator/formFields/index.d.ts +1 -1
- package/dist/types/helpers/authenticator/formFields/{util.d.ts → utils.d.ts} +2 -0
- package/dist/types/helpers/authenticator/getRoute.d.ts +2 -0
- package/dist/types/helpers/authenticator/index.d.ts +2 -1
- package/dist/types/helpers/authenticator/textUtil.d.ts +8 -7
- package/dist/types/{types/authenticator/stateMachine/authMachine.d.ts → helpers/authenticator/types.d.ts} +5 -5
- package/dist/types/helpers/authenticator/utils.d.ts +0 -25
- package/dist/types/helpers/index.d.ts +0 -1
- package/dist/types/helpers/utils.d.ts +2 -2
- package/dist/types/i18n/translations.d.ts +2 -3
- package/dist/types/machines/authenticator/actions.d.ts +4 -62
- package/dist/types/machines/authenticator/actors/{resetPassword.d.ts → forgotPassword.d.ts} +3 -3
- package/dist/types/machines/authenticator/actors/index.d.ts +3 -1
- package/dist/types/machines/authenticator/actors/signIn.d.ts +3 -3
- package/dist/types/machines/authenticator/actors/signOut.d.ts +2 -2
- package/dist/types/machines/authenticator/{signUp.d.ts → actors/signUp.d.ts} +3 -3
- package/dist/types/machines/authenticator/actors/verifyUserAttributes.d.ts +5 -0
- package/dist/types/machines/authenticator/defaultServices.d.ts +208 -28
- package/dist/types/machines/authenticator/getAuthenticatorConfig.d.ts +14 -0
- package/dist/types/machines/authenticator/guards.d.ts +4 -0
- package/dist/types/machines/authenticator/index.d.ts +4 -2
- package/dist/types/machines/authenticator/types.d.ts +125 -0
- package/dist/types/machines/authenticator/utils.d.ts +7 -0
- package/dist/types/machines/index.d.ts +1 -0
- package/dist/types/theme/tokens/borderWidths.d.ts +2 -2
- package/dist/types/theme/tokens/colors.d.ts +7 -9
- package/dist/types/theme/tokens/components/accordion.d.ts +12 -0
- package/dist/types/theme/tokens/components/index.d.ts +2 -4
- package/dist/types/theme/tokens/components/radioGroup.d.ts +1 -1
- package/dist/types/theme/tokens/components/storagemanager.d.ts +18 -3
- package/dist/types/theme/tokens/components/tabs.d.ts +4 -3
- package/dist/types/theme/tokens/fontSizes.d.ts +2 -2
- package/dist/types/theme/tokens/fontWeights.d.ts +2 -2
- package/dist/types/theme/tokens/fonts.d.ts +2 -2
- package/dist/types/theme/tokens/lineHeights.d.ts +2 -2
- package/dist/types/theme/tokens/opacities.d.ts +2 -2
- package/dist/types/theme/tokens/outlineOffsets.d.ts +2 -2
- package/dist/types/theme/tokens/outlineWidths.d.ts +2 -2
- package/dist/types/theme/tokens/radii.d.ts +2 -2
- package/dist/types/theme/tokens/shadows.d.ts +2 -2
- package/dist/types/theme/tokens/space.d.ts +2 -2
- package/dist/types/theme/tokens/time.d.ts +2 -2
- package/dist/types/theme/tokens/types/designToken.d.ts +12 -6
- package/dist/types/theme/types.d.ts +5 -1
- package/dist/types/types/authenticator/attributes.d.ts +10 -4
- package/dist/types/types/authenticator/form.d.ts +7 -6
- package/dist/types/types/authenticator/index.d.ts +0 -1
- package/dist/types/types/authenticator/user.d.ts +3 -29
- package/dist/types/types/authenticator/validator.d.ts +2 -2
- package/dist/types/types/displayText.d.ts +84 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/primitives/componentClassName.d.ts +162 -180
- package/dist/types/types/util.d.ts +0 -5
- package/dist/types/utils/classNames.d.ts +4 -0
- package/dist/types/utils/index.d.ts +3 -135
- package/dist/types/utils/setUserAgent/constants.d.ts +7 -0
- package/dist/types/utils/setUserAgent/index.d.ts +1 -0
- package/dist/types/utils/setUserAgent/setUserAgent.d.ts +19 -0
- package/dist/types/utils/utils.d.ts +147 -0
- package/dist/types/validators/index.d.ts +2 -2
- package/package.json +5 -19
- package/dist/esm/helpers/authenticator/context.mjs +0 -1
- package/dist/esm/helpers/authenticator/formFields/util.mjs +0 -1
- package/dist/esm/helpers/storage/fileUploader/utils/uploader.mjs +0 -1
- package/dist/esm/machines/authenticator/actors/resetPassword.mjs +0 -1
- package/dist/esm/machines/authenticator/signUp.mjs +0 -1
- package/dist/esm/theme/tokens/components/expander.mjs +0 -1
- package/dist/esm/theme/tokens/components/fileUploader.mjs +0 -1
- package/dist/esm/utils/index.mjs +0 -1
- package/dist/types/helpers/authenticator/context.d.ts +0 -13
- package/dist/types/helpers/storage/fileUploader/index.d.ts +0 -1
- package/dist/types/helpers/storage/fileUploader/utils/index.d.ts +0 -1
- package/dist/types/helpers/storage/fileUploader/utils/uploader.d.ts +0 -28
- package/dist/types/helpers/storage/index.d.ts +0 -1
- package/dist/types/theme/tokens/components/expander.d.ts +0 -22
- package/dist/types/theme/tokens/components/fileUploader.d.ts +0 -23
- package/dist/types/types/authenticator/stateMachine/context.d.ts +0 -109
- package/dist/types/types/authenticator/stateMachine/event.d.ts +0 -17
- package/dist/types/types/authenticator/stateMachine/index.d.ts +0 -4
- package/dist/types/types/authenticator/stateMachine/state.d.ts +0 -10
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type PackageName = 'angular' | 'react' | 'react-auth' | 'react-geo' | 'react-liveness' | 'react-native' | 'react-native-auth' | 'react-notifications' | 'react-storage' | 'vue';
|
|
2
|
+
export type ComponentName = 'Authenticator' | 'ChangePassword' | 'DeleteUser' | 'FaceLivenessDetector' | 'InAppMessaging' | 'LocationSearch' | 'MapView' | 'StorageManager' | 'StorageImage';
|
|
3
|
+
export type Version = `${string}.${string}.${string}`;
|
|
4
|
+
export interface SetUserAgentOptions {
|
|
5
|
+
componentName: ComponentName;
|
|
6
|
+
packageName: PackageName;
|
|
7
|
+
version: Version;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // set user agent options
|
|
13
|
+
* const clear = setUserAgent(input);
|
|
14
|
+
*
|
|
15
|
+
* // clear user agent options
|
|
16
|
+
* clear();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const setUserAgent: ({ componentName, packageName, version, }: SetUserAgentOptions) => (() => void);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Modifiers } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Some libraries may not follow Node ES module spec and could be loaded as CommonJS modules,
|
|
4
|
+
* To ensure the interoperability between ESM and CJS, modules from those libraries have to be loaded via namespace import
|
|
5
|
+
* And sanitized by the function below because unlike ESM namespace, CJS namespace set `module.exports` object on the `default` key
|
|
6
|
+
* https://nodejs.org/api/esm.html#interoperability-with-commonjs
|
|
7
|
+
*/
|
|
8
|
+
export declare const sanitizeNamespaceImport: <T>(namespaceModule: T) => T;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if `value` is an Object (non-primitive, non-array, non-function)
|
|
11
|
+
* Will return false for Arrays and functions
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* @param {unknown} value The value to check
|
|
15
|
+
* @returns {boolean} Returns `true` if `value` is an object, `false` otherwise
|
|
16
|
+
*/
|
|
17
|
+
export declare function isObject(value: unknown): value is object;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if `value` is a string primitive or object
|
|
20
|
+
*
|
|
21
|
+
* @param {unknown} value The value to check
|
|
22
|
+
* @returns {boolean} Returns `true` if `value` is a string, `false` otherwise
|
|
23
|
+
*/
|
|
24
|
+
export declare function isString(value: unknown): value is string;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if `value` is a Map
|
|
27
|
+
*
|
|
28
|
+
* @param {unknown} value The value to check
|
|
29
|
+
* @returns {boolean} Returns `true` if `value` is a Map, `false` otherwise
|
|
30
|
+
*/
|
|
31
|
+
export declare function isMap(value: unknown): value is Map<unknown, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if `value` is a Set
|
|
34
|
+
*
|
|
35
|
+
* @param {unknown} value The value to check
|
|
36
|
+
* @returns {boolean} Returns `true` if `value` is a Set, `false` otherwise
|
|
37
|
+
*/
|
|
38
|
+
export declare function isSet<T>(value: unknown): value is Set<T>;
|
|
39
|
+
/**
|
|
40
|
+
* Checks if `value` is undefined
|
|
41
|
+
*
|
|
42
|
+
* @param {unknown} value The value to check
|
|
43
|
+
* @returns {boolean} Returns `true` if `value` is undefined, `false` otherwise
|
|
44
|
+
*/
|
|
45
|
+
export declare function isUndefined(value: unknown): value is undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if `value` is nullish
|
|
48
|
+
*
|
|
49
|
+
* @param {unknown} value The value to check
|
|
50
|
+
* @returns {boolean} Returns `true` if `value` is nullish, `false` otherwise
|
|
51
|
+
*/
|
|
52
|
+
export declare function isNil(value: unknown): value is null | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if `value` is empty
|
|
55
|
+
*
|
|
56
|
+
* @param {unknown} value The value to check
|
|
57
|
+
* @returns {boolean} Returns `true` if `value` is empty, `false` otherwise
|
|
58
|
+
*/
|
|
59
|
+
export declare function isEmpty<T>(value: T): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Checks if all members of the `values` param are empty arrays
|
|
62
|
+
*
|
|
63
|
+
* @param {unknown} value The values to check
|
|
64
|
+
* @returns {boolean} Returns `true` if all members of `values` are empty, `false` otherwise
|
|
65
|
+
*/
|
|
66
|
+
export declare function areEmptyArrays<T>(...values: T[]): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Checks if `value` is an empty object
|
|
69
|
+
*
|
|
70
|
+
* @param {unknown} value The value to check
|
|
71
|
+
* @returns {boolean} Returns `true` if `value` is empty, `false` otherwise
|
|
72
|
+
*/
|
|
73
|
+
export declare function isEmptyObject<T>(value: T): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Checks if all members of the `values` param are empty objects
|
|
76
|
+
*
|
|
77
|
+
* @param {unknown} values The values to check
|
|
78
|
+
* @returns {boolean} Returns `true` if all members of the `values` param are empty, `false` otherwise
|
|
79
|
+
*/
|
|
80
|
+
export declare function areEmptyObjects<T>(...values: T[]): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Capitalizes `value` and its return type
|
|
83
|
+
*
|
|
84
|
+
* @param {string} value string to capitalize
|
|
85
|
+
* @returns {string} capitalized string
|
|
86
|
+
*/
|
|
87
|
+
export declare function capitalize<T extends string>(value: T): Capitalize<T>;
|
|
88
|
+
/**
|
|
89
|
+
* Checks if `key` is a direct property of `value`
|
|
90
|
+
*
|
|
91
|
+
* @param {unknown} value `object` potentially containing property
|
|
92
|
+
* @param {string} key property key
|
|
93
|
+
* @returns whether `key` param is a property of the `obj` param
|
|
94
|
+
*/
|
|
95
|
+
export declare function has(value: unknown, key: string): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Checks if `value` is a function
|
|
98
|
+
*
|
|
99
|
+
* @param {unknown} value param to check
|
|
100
|
+
* @returns {boolean} whether `value` is a function
|
|
101
|
+
*/
|
|
102
|
+
export declare function isFunction(value: unknown): value is Function;
|
|
103
|
+
/**
|
|
104
|
+
* This helper function creates modifier class names that are used for our flat BEM styling
|
|
105
|
+
* it takes in a base and modifier and returns the modified class if a modifier was passed in and null otherwise
|
|
106
|
+
* @param base The base class of the output
|
|
107
|
+
* @param modifier The modifier to add onto the base
|
|
108
|
+
* @returns the modified class name or empty string
|
|
109
|
+
*/
|
|
110
|
+
export declare const classNameModifier: (base: string, modifier?: Modifiers) => string;
|
|
111
|
+
/**
|
|
112
|
+
* This helper function creates modified class names that are used for our flat BEM styling
|
|
113
|
+
* 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
|
|
114
|
+
* @param base
|
|
115
|
+
* @param modifier
|
|
116
|
+
* @param flag
|
|
117
|
+
* @returns the modified class name or empty string
|
|
118
|
+
*/
|
|
119
|
+
export declare const classNameModifierByFlag: (base: string, modifier: Modifiers, flag?: boolean) => string;
|
|
120
|
+
/**
|
|
121
|
+
* `isFunction` but types the param with its function signature
|
|
122
|
+
*
|
|
123
|
+
* @param {unknown} value param to check
|
|
124
|
+
* @returns {boolean} whether `value` is a function
|
|
125
|
+
*/
|
|
126
|
+
export declare function isTypedFunction<T extends (...args: any[]) => any>(value: unknown): value is T;
|
|
127
|
+
/**
|
|
128
|
+
* Similar to `Array.join`, with an optional callback/template param
|
|
129
|
+
* for formatting returned string values
|
|
130
|
+
*
|
|
131
|
+
* @param {string[]} values string array
|
|
132
|
+
* @param {(value: string) => string} template callback format param
|
|
133
|
+
* @returns formatted string array
|
|
134
|
+
*/
|
|
135
|
+
export declare function templateJoin(values: string[], template: (value: string) => string): string;
|
|
136
|
+
/**
|
|
137
|
+
* A function that does nothing
|
|
138
|
+
*
|
|
139
|
+
* @param {any[]} _ accepts any parameters
|
|
140
|
+
* @returns nothing
|
|
141
|
+
*/
|
|
142
|
+
export declare function noop(..._: any[]): void;
|
|
143
|
+
/**
|
|
144
|
+
* @param {string} groupName name of group
|
|
145
|
+
* @param events string values related to group
|
|
146
|
+
*/
|
|
147
|
+
export declare function groupLog(groupName: string, ...events: any[]): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuthFormData, PasswordSettings, Validator } from '../types';
|
|
2
|
-
export declare const runValidators: (formData: AuthFormData, touchData:
|
|
1
|
+
import { AuthFormData, AuthTouchData, PasswordSettings, Validator } from '../types';
|
|
2
|
+
export declare const runValidators: (formData: AuthFormData, touchData: AuthTouchData, passwordSettings: PasswordSettings, validators: Validator[]) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"lint": "yarn typecheck",
|
|
41
41
|
"prebuild": "rimraf dist",
|
|
42
42
|
"test": "jest",
|
|
43
|
-
"test:ci": "yarn test && yarn check:esm",
|
|
44
43
|
"test:watch": "yarn test --watch",
|
|
45
44
|
"typecheck": "tsc --noEmit"
|
|
46
45
|
},
|
|
@@ -48,10 +47,10 @@
|
|
|
48
47
|
"csstype": "^3.1.1",
|
|
49
48
|
"lodash": "4.17.21",
|
|
50
49
|
"style-dictionary": "3.7.1",
|
|
51
|
-
"tslib": "2.
|
|
50
|
+
"tslib": "^2.5.2"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
|
-
"aws-amplify": "^
|
|
53
|
+
"aws-amplify": "^6.0.2",
|
|
55
54
|
"xstate": "^4.33.6"
|
|
56
55
|
},
|
|
57
56
|
"peerDependenciesMeta": {
|
|
@@ -60,24 +59,11 @@
|
|
|
60
59
|
}
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
|
-
"@rollup/plugin-typescript": "^8.3.1",
|
|
64
|
-
"@types/jest": "^26.0.23",
|
|
65
62
|
"@types/lodash": "^4.14.170",
|
|
66
63
|
"@types/webpack-env": "^1.16.2",
|
|
67
|
-
"@typescript-eslint/parser": "^5.20.0",
|
|
68
64
|
"autoprefixer": "^10.3.1",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"glob": "^7.1.7",
|
|
72
|
-
"globcat": "^1.3.4",
|
|
73
|
-
"jest": "^27.0.4",
|
|
74
|
-
"postcss": "^8.3.6",
|
|
75
|
-
"rimraf": "^3.0.2",
|
|
76
|
-
"rollup": "^2.70.0",
|
|
77
|
-
"rollup-plugin-node-externals": "^4.1.1",
|
|
78
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
79
|
-
"sass": "^1.35.2",
|
|
80
|
-
"ts-jest": "^27.0.3"
|
|
65
|
+
"postcss": "^8.4.31",
|
|
66
|
+
"sass": "^1.35.2"
|
|
81
67
|
},
|
|
82
68
|
"sideEffects": [
|
|
83
69
|
"dist/**/*.css"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"../../types/authenticator/user.mjs";import{LoginMechanismArray as t}from"../../types/authenticator/attributes.mjs";import"../../types/primitives/componentClassName.mjs";const i=t=>{var i;const s=null===(i=null==t?void 0:t.context.config)||void 0===i?void 0:i.loginMechanisms,[n]=null!=s?s:["username"];return n},s=i=>{var s;const n=(null===(s=i.config)||void 0===s?void 0:s.loginMechanisms).filter((i=>t.includes(i))),[o,...e]=n;return{primaryAlias:o,secondaryAliases:e}};export{s as getConfiguredAliases,i as getPrimaryAlias};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{translate as e}from"../../../i18n/translations.mjs";const r=r=>{const o=Object.assign({},r);for(const[t,s]of Object.entries(r)){const{label:r,placeholder:n}=s;o[t]=Object.assign(Object.assign({},s),{label:r?e(r):void 0,placeholder:n?e(n):void 0})}return o},o=e=>Object.entries(e).sort(((e,r)=>(e[1].order||Number.MAX_VALUE)-(r[1].order||Number.MAX_VALUE))).filter((e=>void 0!==e[1]));export{r as applyTranslation,o as sortFormFields};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__rest as e}from"tslib";import{Storage as r}from"aws-amplify";import{translate as t}from"../../../../i18n/translations.mjs";function l(t){var{file:l,fileName:a,level:o="private",progressCallback:s,errorCallback:i,completeCallback:n,isResumable:p=!1,provider:c}=t,b=e(t,["file","fileName","level","progressCallback","errorCallback","completeCallback","isResumable","provider"]);const m=l.type||"binary/octet-stream";return!0===p?r.put(a,l,Object.assign({level:o,resumable:p,progressCallback:s,errorCallback:i,completeCallback:n,contentType:m,provider:c},b)):r.put(a,l,Object.assign({level:o,resumable:!1,progressCallback:s,contentType:m,provider:c},b)).then(n,i)}function a(e,r=!1,t=1){const l=r?1e3:1024;if(Math.abs(e)<l)return e+" B";const a=r?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let o=-1;const s=Math.pow(10,t);do{e/=l,++o}while(Math.round(Math.abs(e)*s)/s>=l&&o<a.length-1);return e.toFixed(t)+" "+a[o]}const o=(e,r)=>e&&r.size>e?t("File size must be below ")+a(e,!0):null,s=(e,r)=>e.filter((e=>{const t=e.name||"",l=(e.type||"").toLowerCase(),a=l.replace(/\/.*$/,"");return r.some((e=>{const r=e.trim().toLowerCase();return"."===r.charAt(0)?t.toLowerCase().endsWith(r):r.endsWith("/*")?a===r.replace(/\/.*$/,""):l===r}))})),i=(e,r)=>{const t=e.split(".").pop();return r.split(".").pop()===t};export{o as checkMaxSize,a as humanFileSize,i as isValidExtension,s as returnAcceptedFiles,l as uploadFile};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as e}from"tslib";import{createMachine as r,sendUpdate as t}from"xstate";import{runValidators as s}from"../../../validators/index.mjs";import{clearError as a,clearFormValues as o,clearTouched as n,clearUsername as i,clearValidationError as d,handleInput as l,handleSubmit as c,handleBlur as m,resendCode as u,setFieldErrors as p,setRemoteError as g,setUsername as v}from"../actions.mjs";import{defaultServices as E}from"../defaultServices.mjs";function f({services:f}){return r({id:"resetPasswordActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{target:"confirmResetPassword",cond:"shouldAutoConfirmReset",actions:"resendCode"},{target:"resetPassword"}]},resetPassword:{initial:"edit",exit:["clearFormValues","clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"}}},submit:{tags:["pending"],entry:["sendUpdate","setUsername","clearError"],invoke:{src:"resetPassword",onDone:{target:"#resetPasswordActor.confirmResetPassword"},onError:{actions:["setRemoteError"],target:"edit"}}}}},confirmResetPassword:{type:"parallel",exit:["clearFormValues","clearError","clearUsername","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateFields",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submission:{initial:"idle",states:{idle:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"},RESEND:"resendCode",CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"}}},validate:{entry:"sendUpdate",invoke:{src:"validateFields",onDone:{target:"pending",actions:"clearValidationError"},onError:{target:"idle",actions:"setFieldErrors"}}},resendCode:{tags:["pending"],entry:["clearError","sendUpdate"],invoke:{src:"resetPassword",onDone:{target:"idle"},onError:{actions:"setRemoteError",target:"idle"}}},pending:{tags:["pending"],entry:["clearError","sendUpdate"],invoke:{src:"confirmResetPassword",onDone:{actions:"clearUsername",target:"#resetPasswordActor.resolved"},onError:{actions:"setRemoteError",target:"idle"}}}}}}},resolved:{type:"final"}}},{actions:{clearError:a,clearFormValues:o,clearTouched:n,clearUsername:i,clearValidationError:d,handleInput:l,handleSubmit:c,handleBlur:m,resendCode:u,setFieldErrors:p,setRemoteError:g,setUsername:v,sendUpdate:t()},guards:{shouldAutoConfirmReset:(e,r)=>!(!e.intent||"confirmPasswordReset"!==e.intent)},services:{resetPassword(r){return e(this,void 0,void 0,(function*(){const{username:e}=r;return f.handleForgotPassword(e)}))},confirmResetPassword(r){return e(this,void 0,void 0,(function*(){const{username:e}=r,{confirmation_code:t,password:s}=r.formValues;return f.handleForgotPasswordSubmit({username:e,code:t,password:s})}))},validateFields(r,t){return e(this,void 0,void 0,(function*(){return s(r.formValues,r.touched,r.passwordSettings,[E.validateFormPassword,E.validateConfirmPassword])}))}}})}export{f as resetPasswordActor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__awaiter as e}from"tslib";import{Auth as t}from"aws-amplify";import n from"lodash/get.js";import r from"lodash/pickBy.js";import{createMachine as i,sendUpdate as a,assign as s}from"xstate";import{runValidators as o}from"../../validators/index.mjs";import{clearError as d,clearFormValues as l,clearTouched as c,clearValidationError as u,handleInput as m,handleSubmit as p,handleBlur as g,parsePhoneNumber as f,setCredentials as U,setFieldErrors as v,setRemoteError as S,setCodeDeliveryDetails as h,setUser as E}from"./actions.mjs";function y({services:y}){return i({id:"signUpActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{target:"confirmSignUp",cond:"shouldInitConfirmSignUp"},{target:"signUp"}]},signUp:{type:"parallel",exit:["clearError","clearFormValues","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateSignUp",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submission:{initial:"idle",states:{idle:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"},FEDERATED_SIGN_IN:"federatedSignIn"}},federatedSignIn:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"federatedSignIn",onDone:"#signUpActor.resolved",onError:{actions:"setRemoteError"}}},validate:{entry:"sendUpdate",invoke:{src:"validateSignUp",onDone:{target:"pending",actions:"clearValidationError"},onError:{target:"idle",actions:"setFieldErrors"}}},pending:{tags:["pending"],entry:["parsePhoneNumber","sendUpdate","clearError"],invoke:{src:"signUp",onDone:[{cond:"shouldSkipConfirm",target:"skipConfirm",actions:["setUser","setCredentials"]},{target:"resolved",actions:["setUser","setCredentials","setCodeDeliveryDetails"]}],onError:{target:"idle",actions:"setRemoteError"}}},skipConfirm:{always:{target:"#signUpActor.resolved",actions:"setAutoSignInIntent"}},resolved:{type:"final",always:"#signUpActor.confirmSignUp"}}}}},confirmSignUp:{initial:"edit",states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"},RESEND:"resend"}},resend:{tags:["pending"],entry:"sendUpdate",invoke:{src:"resendConfirmationCode",onDone:{target:"edit"},onError:[{target:"#signUpActor.resolved",actions:"setAutoSignInIntent",cond:"isUserAlreadyConfirmed"},{target:"edit",actions:"setRemoteError"}]}},submit:{tags:["pending"],entry:["sendUpdate","clearError"],invoke:{src:"confirmSignUp",onDone:{target:"#signUpActor.resolved",actions:"setAutoSignInIntent"},onError:{target:"edit",actions:"setRemoteError"}}}}},resolved:{type:"final",data:(e,t)=>{const{username:r,password:i}=e.authAttributes;return{user:n(t,"data.user")||e.user,authAttributes:{username:r,password:i},intent:e.intent}}}}},{guards:{isUserAlreadyConfirmed:(e,t)=>"User is already confirmed."===t.data.message,shouldInitConfirmSignUp:e=>e.intent&&"confirmSignUp"===e.intent,shouldSkipConfirm:(e,t)=>t.data.userConfirmed},actions:{clearError:d,clearFormValues:l,clearTouched:c,clearValidationError:u,handleInput:m,handleSubmit:p,handleBlur:g,parsePhoneNumber:f,setCredentials:U,setFieldErrors:v,setRemoteError:S,setCodeDeliveryDetails:h,setUser:E,sendUpdate:a(),setAutoSignInIntent:s({intent:e=>"confirmSignUp"===(null==e?void 0:e.intent)?"autoSignInSubmit":"autoSignIn"})},services:{confirmSignUp(t,r){return e(this,void 0,void 0,(function*(){const{user:e,authAttributes:r,formValues:i}=t,{confirmation_code:a}=i,s=n(e,"username")||n(r,"username");return yield y.handleConfirmSignUp({username:s,code:a})}))},resendConfirmationCode(r,i){return e(this,void 0,void 0,(function*(){const{user:e,authAttributes:i}=r,a=n(e,"username")||n(i,"username");return t.resendSignUp(a)}))},federatedSignIn(n,r){return e(this,void 0,void 0,(function*(){const{provider:e}=r.data;return yield t.federatedSignIn({provider:e})}))},signUp(t,n){return e(this,void 0,void 0,(function*(){const{formValues:e,loginMechanisms:n}=t,[i="username"]=n,{[i]:a,password:s}=e,o=r(e,((e,t)=>{switch(t){case"address":case"birthdate":case"email":case"family_name":case"gender":case"given_name":case"locale":case"middle_name":case"name":case"nickname":case"phone_number":case"picture":case"preferred_username":case"profile":case"updated_at":case"website":case"zoneinfo":return!0;default:return t.startsWith("custom:")}}));return yield y.handleSignUp({username:a,password:s,attributes:o})}))},validateSignUp(t,n){return e(this,void 0,void 0,(function*(){return o(t.formValues,t.touched,t.passwordSettings,[y.validateFormPassword,y.validateConfirmPassword,y.validatePreferredUsername,y.validateCustomSignUp])}))}}})}export{y as createSignUpMachine};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a={display:{value:"block"},backgroundColor:{value:"{colors.background.primary.value}"},borderRadius:{value:"{radii.medium.value}"},boxShadow:{value:"{shadows.large.value}"},width:{value:"100%"},item:{marginTop:{value:"1px"},boxShadow:{value:"{shadows.small.value}"},borderBottomLeftRadius:{value:"{radii.medium.value}"},borderBottomRightRadius:{value:"{radii.medium.value}"},borderTopLeftRadius:{value:"{radii.medium.value}"},borderTopRightRadius:{value:"{radii.medium.value}"},borderStartStartRadius:{value:"{radii.medium.value}"},borderStartEndRadius:{value:"{radii.medium.value}"},borderEndStartRadius:{value:"{radii.medium.value}"},borderEndEndRadius:{value:"{radii.medium.value}"},_focus:{boxShadow:{value:{offsetX:"0",offsetY:"0",blurRadius:"0",spreadRadius:"2px",color:"{colors.border.focus.value}"}}}},header:{boxShadow:{value:{offsetX:"0",offsetY:"1px",blurRadius:"0",color:"{colors.overlay.20.value}"}}},trigger:{minHeight:{value:"3rem"},paddingInlineStart:{value:"{space.large.value}"},paddingInlineEnd:{value:"{space.large.value}"},alignItems:{value:"center"},justifyContent:{value:"space-between"},_hover:{backgroundColor:{value:"{colors.overlay.10.value}"}}},content:{paddingInlineStart:{value:"{space.large.value}"},paddingInlineEnd:{value:"{space.large.value}"},text:{color:{value:"{colors.font.secondary.value}"},paddingBlockStart:{value:"{space.medium.value}"},paddingBlockEnd:{value:"{space.medium.value}"}},_open:{animationDuration:{value:"{time.medium.value}"},animationTimingFunction:{value:"cubic-bezier(0.87, 0, 0.13, 1)"}},_closed:{animationDuration:{value:"{time.medium.value}"},animationTimingFunction:{value:"cubic-bezier(0.87, 0, 0.13, 1)"}}},icon:{transitionDuration:{value:"{time.medium.value}"},transitionTimingFunction:{value:"cubic-bezier(0.87, 0, 0.13, 1)"}}};export{a as expander};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e={dropzone:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"dashed"},borderWidth:{value:"{borderWidths.small}"},gap:{value:"{space.small}"},paddingBlock:{value:"{space.xl}"},paddingInline:{value:"{space.large}"},textAlign:{value:"center"},_active:{backgroundColor:{value:"{colors.brand.primary.10}"},borderRadius:{value:"{components.fileuploader.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.fileuploader.dropzone.borderStyle}"},borderWidth:{value:"{borderWidths.medium}"}},icon:{color:{value:"{colors.border.primary}"},fontSize:{value:"{fontSizes.xxl}"}},text:{color:{value:"{colors.font.tertiary}"},fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"}}},file:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},paddingBlock:{value:"{space.xs}"},paddingInline:{value:"{space.small}"},gap:{value:"{space.small}"},alignItems:{value:"baseline"},name:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},size:{fontSize:{value:"{fontSizes.small}"},fontWeight:{value:"{fontWeights.normal}"},color:{value:"{colors.font.tertiary}"}},image:{width:{value:"{space.xxl}"},height:{value:"{space.xxl}"},backgroundColor:{value:"{colors.background.secondary}"},color:{value:"{colors.font.tertiary}"},borderRadius:{value:"{radii.small}"}}},loader:{strokeLinecap:{value:"round"},strokeEmpty:{value:"{colors.border.secondary}"},strokeFilled:{value:"{components.loader.strokeFilled}"},strokeWidth:{value:"{borderWidths.large}"}},previewer:{backgroundColor:{value:"{colors.background.primary}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},borderRadius:{value:"{radii.small}"},paddingBlock:{value:"{space.zero}"},paddingInline:{value:"{space.zero}"},maxHeight:{value:"40rem"},maxWidth:{value:"auto"},text:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},body:{paddingBlock:{value:"{space.medium}"},paddingInline:{value:"{space.medium}"},gap:{value:"{space.small}"}},footer:{borderColor:{value:"{colors.border.secondary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},paddingBlock:{value:"{space.medium}"},paddingInline:{value:"{space.medium}"},justifyContent:{value:"space-between"}}}};export{e as fileuploader};
|
package/dist/esm/utils/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=t=>{var n;const r=Object.assign({default:void 0},t);return null!==(n=r.default)&&void 0!==n?n:r};function n(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}function r(t){return"string"==typeof t||"object"==typeof t&&"[object String]"===Object.prototype.toString.call(t)}function e(t){return n(t)&&"[object Map]"===Object.prototype.toString.call(t)}function o(t){return n(t)&&"[object Set]"===Object.prototype.toString.call(t)}function u(t){return void 0===t}function c(t){return null==t}function i(t){if(null==t)return!0;if(n(t)&&(e(t)||o(t)))return!t.size;if(n(t)&&(r(t)||Array.isArray(t)))return!t.length;for(const n in t)if(s(t,n))return!1;return!0}function f(t){return Array.isArray(t)&&i(t)}function l(...t){return t.every(f)}function a(t){return n(t)&&i(t)}function p(...t){return t.every(a)}function y(t){return r(t)?t.charAt(0).toUpperCase()+t.slice(1):""}function s(t,n){return null!=t&&Object.prototype.hasOwnProperty.call(t,n)}function b(t){return"function"==typeof t}const j=(t,n)=>n?`${t}--${n}`:"",g=(t,n,r)=>r?`${t}--${n}`:"";function A(t){return b(t)}function d(t,n){return t.reduce(((t,e)=>`${t}${r(e)?n(e):""}`),"")}function v(...t){}export{l as areEmptyArrays,p as areEmptyObjects,y as capitalize,j as classNameModifier,g as classNameModifierByFlag,s as has,i as isEmpty,b as isFunction,e as isMap,c as isNil,n as isObject,o as isSet,r as isString,A as isTypedFunction,u as isUndefined,v as noop,t as sanitizeNamespaceImport,d as templateJoin};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains helpers that process authenticator state machine context
|
|
3
|
-
*/
|
|
4
|
-
import { AuthContext, AuthMachineState } from '../../types';
|
|
5
|
-
export declare const getPrimaryAlias: (state: AuthMachineState) => "email" | "phone_number" | "username";
|
|
6
|
-
/**
|
|
7
|
-
* Given xstate context from AuthMachine, returns the primaryAlias and
|
|
8
|
-
* secondaryAliases.
|
|
9
|
-
*/
|
|
10
|
-
export declare const getConfiguredAliases: (context: AuthContext) => {
|
|
11
|
-
primaryAlias: "email" | "phone_number" | "username";
|
|
12
|
-
secondaryAliases: ("email" | "phone_number" | "username")[];
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { uploadFile, humanFileSize, checkMaxSize, returnAcceptedFiles, isValidExtension, } from './uploader';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { StorageAccessLevel, PutResult } from '@aws-amplify/storage';
|
|
2
|
-
export declare function uploadFile({ file, fileName, level, progressCallback, errorCallback, completeCallback, isResumable, provider, ...rest }: {
|
|
3
|
-
file: File;
|
|
4
|
-
fileName: string;
|
|
5
|
-
level: StorageAccessLevel;
|
|
6
|
-
isResumable?: boolean;
|
|
7
|
-
progressCallback: (progress: {
|
|
8
|
-
loaded: number;
|
|
9
|
-
total: number;
|
|
10
|
-
}) => void;
|
|
11
|
-
errorCallback: (error: string) => void;
|
|
12
|
-
completeCallback: (event: PutResult) => void;
|
|
13
|
-
provider?: string;
|
|
14
|
-
}): Promise<any>;
|
|
15
|
-
/**
|
|
16
|
-
* Format bytes as human-readable text.
|
|
17
|
-
*
|
|
18
|
-
* @param bytes Number of bytes.
|
|
19
|
-
* @param si True to use metric (SI) units, aka powers of 1000. False to use
|
|
20
|
-
* binary (IEC), aka powers of 1024.
|
|
21
|
-
* @param dp Number of decimal places to display.
|
|
22
|
-
*
|
|
23
|
-
* @return Formatted string.
|
|
24
|
-
*/
|
|
25
|
-
export declare function humanFileSize(bytes: number, si?: boolean, dp?: number): string;
|
|
26
|
-
export declare const checkMaxSize: (maxSize: number, file: File) => string | null;
|
|
27
|
-
export declare const returnAcceptedFiles: (files: File[], acceptedFileTypes: string[]) => File[];
|
|
28
|
-
export declare const isValidExtension: (fileName: string, fileName2: string) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './fileUploader';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DesignTokenProperties, OutputVariantKey } from '../types/designToken';
|
|
2
|
-
type ExpanderItemTokens<Output> = DesignTokenProperties<'marginTop' | 'boxShadow' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderStartStartRadius' | 'borderStartEndRadius' | 'borderEndStartRadius' | 'borderEndEndRadius', Output> & {
|
|
3
|
-
_focus?: DesignTokenProperties<'boxShadow', Output>;
|
|
4
|
-
};
|
|
5
|
-
type ExpanderTriggerTokens<Output> = DesignTokenProperties<'minHeight' | 'paddingInlineStart' | 'paddingInlineEnd' | 'alignItems' | 'justifyContent', Output> & {
|
|
6
|
-
_hover?: DesignTokenProperties<'backgroundColor', Output>;
|
|
7
|
-
};
|
|
8
|
-
type ExpanderContentStateTokens<Output> = DesignTokenProperties<'animationDuration' | 'animationTimingFunction', Output>;
|
|
9
|
-
type ExpanderContentTokens<Output> = DesignTokenProperties<'paddingInlineStart' | 'paddingInlineEnd', Output> & {
|
|
10
|
-
text?: DesignTokenProperties<'color' | 'paddingBlockStart' | 'paddingBlockEnd', Output>;
|
|
11
|
-
_open?: ExpanderContentStateTokens<Output>;
|
|
12
|
-
_closed?: ExpanderContentStateTokens<Output>;
|
|
13
|
-
};
|
|
14
|
-
export type ExpanderTokens<Output extends OutputVariantKey> = DesignTokenProperties<'display' | 'backgroundColor' | 'borderRadius' | 'boxShadow' | 'width', Output> & {
|
|
15
|
-
content?: ExpanderContentTokens<Output>;
|
|
16
|
-
header?: DesignTokenProperties<'boxShadow', Output>;
|
|
17
|
-
item?: ExpanderItemTokens<Output>;
|
|
18
|
-
trigger?: ExpanderTriggerTokens<Output>;
|
|
19
|
-
icon?: DesignTokenProperties<'transitionDuration' | 'transitionTimingFunction', Output>;
|
|
20
|
-
};
|
|
21
|
-
export declare const expander: Required<ExpanderTokens<'default'>>;
|
|
22
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { DesignTokenProperties, OutputVariantKey } from '../types/designToken';
|
|
2
|
-
import { TypographyTokens } from '../types/typography';
|
|
3
|
-
type BaseDropZoneTokens<OutputType> = DesignTokenProperties<'backgroundColor' | 'borderWidth' | 'borderStyle' | 'borderColor' | 'borderRadius', OutputType>;
|
|
4
|
-
export interface FileUploaderTokens<OutputType extends OutputVariantKey> {
|
|
5
|
-
dropzone?: DesignTokenProperties<'gap' | 'paddingBlock' | 'paddingInline' | 'textAlign', OutputType> & BaseDropZoneTokens<OutputType> & {
|
|
6
|
-
_active?: BaseDropZoneTokens<OutputType>;
|
|
7
|
-
icon?: DesignTokenProperties<'fontSize' | 'color', OutputType>;
|
|
8
|
-
text?: TypographyTokens<OutputType>;
|
|
9
|
-
};
|
|
10
|
-
file?: DesignTokenProperties<'alignItems' | 'backgroundColor' | 'borderColor' | 'borderRadius' | 'borderStyle' | 'borderWidth' | 'gap' | 'paddingBlock' | 'paddingInline', OutputType> & {
|
|
11
|
-
name?: TypographyTokens<OutputType>;
|
|
12
|
-
size?: TypographyTokens<OutputType>;
|
|
13
|
-
image?: DesignTokenProperties<'backgroundColor' | 'borderRadius' | 'color' | 'height' | 'width', OutputType>;
|
|
14
|
-
};
|
|
15
|
-
loader?: DesignTokenProperties<'strokeWidth' | 'strokeFilled' | 'strokeEmpty' | 'strokeLinecap', OutputType>;
|
|
16
|
-
previewer?: DesignTokenProperties<'backgroundColor' | 'borderColor' | 'borderRadius' | 'borderStyle' | 'borderWidth' | 'maxHeight' | 'maxWidth' | 'paddingBlock' | 'paddingInline', OutputType> & {
|
|
17
|
-
text?: TypographyTokens<OutputType>;
|
|
18
|
-
body?: DesignTokenProperties<'gap' | 'paddingInline' | 'paddingBlock', OutputType>;
|
|
19
|
-
footer?: DesignTokenProperties<'borderColor' | 'borderStyle' | 'borderWidth' | 'justifyContent' | 'paddingBlock' | 'paddingInline', OutputType>;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare const fileuploader: Required<FileUploaderTokens<'default'>>;
|
|
23
|
-
export {};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from '../validator';
|
|
2
|
-
import { AuthFormData, AuthFormFields } from '../form';
|
|
3
|
-
import { AuthChallengeName, AmplifyUser, UnverifiedContactMethods } from '../user';
|
|
4
|
-
import { CodeDeliveryDetails as CognitoCodeDeliveryDetails } from 'amazon-cognito-identity-js';
|
|
5
|
-
import { LoginMechanism, SignUpAttribute, SocialProvider } from '../attributes';
|
|
6
|
-
import { defaultServices } from '../../../machines/authenticator/defaultServices';
|
|
7
|
-
import { PasswordSettings } from '..';
|
|
8
|
-
/**
|
|
9
|
-
* Data that actor returns when they are done and reach the final state
|
|
10
|
-
*/
|
|
11
|
-
export interface ActorDoneData {
|
|
12
|
-
/** Any auth form values that needs to be persisted between the actors */
|
|
13
|
-
authAttributes?: AuthFormData;
|
|
14
|
-
/** String that indicates where authMachine should next transition to */
|
|
15
|
-
intent?: string;
|
|
16
|
-
/** User returned by the actor it's done */
|
|
17
|
-
user?: AmplifyUser;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Context interface for the top-level machine
|
|
21
|
-
*/
|
|
22
|
-
export interface AuthContext {
|
|
23
|
-
/** Reference to the spawned actor */
|
|
24
|
-
actorRef?: any;
|
|
25
|
-
config?: {
|
|
26
|
-
loginMechanisms?: LoginMechanism[];
|
|
27
|
-
signUpAttributes?: SignUpAttribute[];
|
|
28
|
-
socialProviders?: SocialProvider[];
|
|
29
|
-
formFields?: AuthFormFields;
|
|
30
|
-
initialState?: 'signIn' | 'signUp' | 'resetPassword';
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated The `passwordSettings` property has been deprecated and will be removed in a future major version of Amplify UI.
|
|
33
|
-
*/
|
|
34
|
-
passwordSettings?: PasswordSettings;
|
|
35
|
-
};
|
|
36
|
-
services?: Partial<typeof defaultServices>;
|
|
37
|
-
user?: AmplifyUser;
|
|
38
|
-
username?: string;
|
|
39
|
-
password?: string;
|
|
40
|
-
code?: string;
|
|
41
|
-
mfaType?: 'SMS_MFA' | 'SOFTWARE_TOKEN_MFA';
|
|
42
|
-
actorDoneData?: Omit<ActorDoneData, 'user'>;
|
|
43
|
-
hasSetup?: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface CodeDeliveryDetails extends CognitoCodeDeliveryDetails {
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Base context for all actors that have auth forms associated
|
|
49
|
-
*/
|
|
50
|
-
interface BaseFormContext {
|
|
51
|
-
/** Any user attributes set that needs to persist between states */
|
|
52
|
-
authAttributes?: Record<string, any>;
|
|
53
|
-
/** Current challengeName issued by Cognnito */
|
|
54
|
-
challengeName?: AuthChallengeName;
|
|
55
|
-
/** Required attributes for form submission */
|
|
56
|
-
requiredAttributes?: Array<string>;
|
|
57
|
-
/** Maps each input name to tis value */
|
|
58
|
-
formValues?: AuthFormData;
|
|
59
|
-
/** Input (names) that has been blurred at least ones */
|
|
60
|
-
touched?: AuthFormData;
|
|
61
|
-
/** String that indicates where authMachine should next transition to */
|
|
62
|
-
intent?: string;
|
|
63
|
-
/** Error returned from remote service / API */
|
|
64
|
-
remoteError?: string;
|
|
65
|
-
/** Current user inteface the actor is working with */
|
|
66
|
-
user?: AmplifyUser;
|
|
67
|
-
/** Maps each input to its validation error, if any */
|
|
68
|
-
validationError?: ValidationError;
|
|
69
|
-
/** Maps each password validation rule */
|
|
70
|
-
passwordSettings?: PasswordSettings;
|
|
71
|
-
/** Denotes where a confirmation code has been sent to */
|
|
72
|
-
codeDeliveryDetails?: CodeDeliveryDetails;
|
|
73
|
-
/** Default country code for all phone number fields. */
|
|
74
|
-
country_code?: string;
|
|
75
|
-
/** TOTP secret code */
|
|
76
|
-
totpSecretCode?: string;
|
|
77
|
-
}
|
|
78
|
-
export interface SignInContext extends BaseFormContext {
|
|
79
|
-
loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
|
|
80
|
-
socialProviders: Required<AuthContext>['config']['socialProviders'];
|
|
81
|
-
formFields?: AuthFormFields;
|
|
82
|
-
attributeToVerify?: string;
|
|
83
|
-
redirectIntent?: string;
|
|
84
|
-
unverifiedContactMethods?: UnverifiedContactMethods;
|
|
85
|
-
}
|
|
86
|
-
export interface SignUpContext extends BaseFormContext {
|
|
87
|
-
loginMechanisms: Required<AuthContext>['config']['loginMechanisms'];
|
|
88
|
-
socialProviders: Required<AuthContext>['config']['socialProviders'];
|
|
89
|
-
formFields: AuthFormFields;
|
|
90
|
-
unverifiedContactMethods?: UnverifiedContactMethods;
|
|
91
|
-
}
|
|
92
|
-
export interface ResetPasswordContext extends BaseFormContext {
|
|
93
|
-
username?: string;
|
|
94
|
-
unverifiedContactMethods?: UnverifiedContactMethods;
|
|
95
|
-
formFields?: AuthFormFields;
|
|
96
|
-
}
|
|
97
|
-
export interface SignOutContext {
|
|
98
|
-
authAttributes?: Record<string, any>;
|
|
99
|
-
challengeName?: AuthChallengeName;
|
|
100
|
-
unverifiedContactMethods?: UnverifiedContactMethods;
|
|
101
|
-
user?: AmplifyUser;
|
|
102
|
-
formFields?: AuthFormFields;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Context for actors that have forms
|
|
106
|
-
*/
|
|
107
|
-
export type ActorContextWithForms = SignInContext | SignUpContext | ResetPasswordContext;
|
|
108
|
-
export type AuthActorContext = ActorContextWithForms | SignOutContext;
|
|
109
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Events that occur when actors are done
|
|
3
|
-
*/
|
|
4
|
-
export type InvokeActorEventTypes = 'done.invoke.signInActor' | 'done.invoke.signUpActor' | 'done.invoke.signOutActor' | 'done.invoke.resetPasswordActor';
|
|
5
|
-
/**
|
|
6
|
-
* All known explicit events for xstate
|
|
7
|
-
*/
|
|
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
|
-
/**
|
|
10
|
-
* Data payload for auth events
|
|
11
|
-
*/
|
|
12
|
-
export type AuthEventData = Record<PropertyKey, any>;
|
|
13
|
-
/** Top-level auth machine event interface */
|
|
14
|
-
export interface AuthEvent {
|
|
15
|
-
type: AuthEventTypes;
|
|
16
|
-
data?: AuthEventData;
|
|
17
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { State } from 'xstate';
|
|
2
|
-
import { ResetPasswordContext } from '.';
|
|
3
|
-
import { SignInContext, SignUpContext, SignOutContext, AuthActorContext, AuthContext } from './context';
|
|
4
|
-
import { AuthEvent } from './event';
|
|
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>;
|