@aws-amplify/ui-react 5.3.2 → 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/Field-6c0e096a.js +1174 -0
- package/dist/esm/PrimitiveCatalog.mjs +16255 -1
- package/dist/esm/components/AccountSettings/AccountSettings.mjs +6 -1
- package/dist/esm/components/AccountSettings/ChangePassword/ChangePassword.mjs +209 -1
- package/dist/esm/components/AccountSettings/ChangePassword/defaults.mjs +77 -1
- package/dist/esm/components/AccountSettings/DeleteUser/DeleteUser.mjs +156 -1
- package/dist/esm/components/AccountSettings/DeleteUser/defaults.mjs +85 -1
- package/dist/esm/components/AccountSettings/constants.mjs +7 -1
- package/dist/esm/components/AccountSettings/shared/Defaults.mjs +66 -1
- package/dist/esm/components/AccountSettings/utils/displayText.mjs +14 -0
- package/dist/esm/components/Authenticator/Authenticator.mjs +74 -1
- package/dist/esm/components/Authenticator/ConfirmSignIn/ConfirmSignIn.mjs +42 -1
- package/dist/esm/components/Authenticator/ConfirmSignUp/ConfirmSignUp.mjs +51 -1
- package/dist/esm/components/Authenticator/FederatedSignIn/FederatedSignIn.mjs +34 -1
- package/dist/esm/components/Authenticator/FederatedSignIn/FederatedSignInButtons/FederatedSignInButton.mjs +54 -1
- package/dist/esm/components/Authenticator/ForceNewPassword/ForceNewPassword.mjs +43 -1
- package/dist/esm/components/Authenticator/ForgotPassword/ConfirmResetPassword.mjs +39 -0
- package/dist/esm/components/Authenticator/ForgotPassword/ForgotPassword.mjs +40 -0
- package/dist/esm/components/Authenticator/RouteContainer/RouteContainer.mjs +26 -1
- package/dist/esm/components/Authenticator/Router/Router.mjs +63 -1
- package/dist/esm/components/Authenticator/SetupTotp/SetupTotp.mjs +76 -0
- package/dist/esm/components/Authenticator/SignIn/SignIn.mjs +47 -1
- package/dist/esm/components/Authenticator/SignUp/SignUp.mjs +46 -1
- package/dist/esm/components/Authenticator/VerifyUser/ConfirmVerifyUser.mjs +37 -1
- package/dist/esm/components/Authenticator/VerifyUser/VerifyUser.mjs +59 -1
- package/dist/esm/components/Authenticator/hooks/useCustomComponents/defaultComponents.mjs +62 -1
- package/dist/esm/components/Authenticator/hooks/useCustomComponents/useCustomComponents.mjs +14 -1
- package/dist/esm/components/Authenticator/hooks/useFormHandlers/useFormHandlers.mjs +30 -1
- package/dist/esm/components/Authenticator/shared/ConfirmSignInFooter.mjs +18 -1
- package/dist/esm/components/Authenticator/shared/FormField.mjs +35 -1
- package/dist/esm/components/Authenticator/shared/FormFields.mjs +15 -1
- package/dist/esm/components/Authenticator/shared/RemoteErrorMessage.mjs +11 -1
- package/dist/esm/components/Authenticator/shared/SignInSignUpTabs.mjs +27 -1
- package/dist/esm/components/Authenticator/shared/TwoButtonSubmitFooter.mjs +35 -1
- package/dist/esm/components/Authenticator/utils.mjs +3 -1
- package/dist/esm/components/Authenticator/withAuthenticator.mjs +14 -1
- package/dist/esm/components/ThemeProvider/ThemeContext.mjs +8 -0
- package/dist/esm/components/ThemeProvider/ThemeProvider.mjs +23 -1
- package/dist/esm/components/index.mjs +5 -1
- package/dist/esm/components/shared/ValidationErrors.mjs +15 -1
- package/dist/esm/helpers/utils.mjs +6 -1
- package/dist/esm/hooks/useAuth.mjs +73 -1
- package/dist/esm/hooks/useBreakpointValue.mjs +29 -1
- package/dist/esm/hooks/useComposeRefsCallback.mjs +20 -1
- package/dist/esm/hooks/useDeprecationWarning.mjs +15 -1
- package/dist/esm/hooks/useStorageURL.mjs +40 -1
- package/dist/esm/hooks/useTheme.mjs +23 -1
- package/dist/esm/hooks/useThemeBreakpoint.mjs +19 -1
- package/dist/esm/index.mjs +71 -1
- package/dist/esm/internal.mjs +32 -1
- package/dist/esm/primitives/Accordion/Accordion.mjs +28 -0
- package/dist/esm/primitives/Accordion/AccordionContainer.mjs +49 -0
- package/dist/esm/primitives/Accordion/AccordionContent.mjs +15 -0
- package/dist/esm/primitives/Accordion/AccordionContext.mjs +6 -0
- package/dist/esm/primitives/Accordion/AccordionIcon.mjs +20 -0
- package/dist/esm/primitives/Accordion/AccordionItem.mjs +19 -0
- package/dist/esm/primitives/Accordion/AccordionTrigger.mjs +27 -0
- package/dist/esm/primitives/Alert/Alert.mjs +36 -1
- package/dist/esm/primitives/Alert/AlertIcon.mjs +36 -1
- package/dist/esm/primitives/Autocomplete/Autocomplete.mjs +67 -1
- package/dist/esm/primitives/Autocomplete/AutocompleteMenu.mjs +36 -1
- package/dist/esm/primitives/Autocomplete/AutocompleteOption.mjs +12 -1
- package/dist/esm/primitives/Autocomplete/useAutocomplete.mjs +188 -1
- package/dist/esm/primitives/Badge/Badge.mjs +16 -1
- package/dist/esm/primitives/Breadcrumbs/BreadcrumbContainer.mjs +18 -1
- package/dist/esm/primitives/Breadcrumbs/BreadcrumbItem.mjs +16 -1
- package/dist/esm/primitives/Breadcrumbs/BreadcrumbLink.mjs +24 -1
- package/dist/esm/primitives/Breadcrumbs/BreadcrumbSeparator.mjs +16 -1
- package/dist/esm/primitives/Breadcrumbs/Breadcrumbs.mjs +28 -1
- package/dist/esm/primitives/Button/Button.mjs +33 -1
- package/dist/esm/primitives/ButtonGroup/ButtonGroup.mjs +19 -1
- package/dist/esm/primitives/Card/Card.mjs +15 -1
- package/dist/esm/primitives/Checkbox/Checkbox.mjs +84 -1
- package/dist/esm/primitives/CheckboxField/CheckboxField.mjs +24 -1
- package/dist/esm/primitives/Collection/Collection.mjs +58 -1
- package/dist/esm/primitives/Collection/utils.mjs +30 -1
- package/dist/esm/primitives/Divider/Divider.mjs +16 -1
- package/dist/esm/primitives/DropZone/DropZone.mjs +27 -1
- package/dist/esm/primitives/DropZone/DropZoneChildren.mjs +39 -1
- package/dist/esm/primitives/DropZone/DropZoneContainer.mjs +18 -1
- package/dist/esm/primitives/DropZone/DropZoneProvider.mjs +8 -1
- package/dist/esm/primitives/DropZone/filterAllowedFiles.mjs +34 -1
- package/dist/esm/primitives/DropZone/useDropZone.mjs +65 -1
- package/dist/esm/primitives/Field/Field.mjs +20 -1
- package/dist/esm/primitives/Field/FieldClearButton.mjs +21 -1
- package/dist/esm/primitives/Field/FieldDescription.mjs +11 -1
- package/dist/esm/primitives/Field/FieldErrorMessage.mjs +10 -1
- package/dist/esm/primitives/FieldGroup/FieldGroup.mjs +29 -1
- package/dist/esm/primitives/FieldGroupIcon/FieldGroupIcon.mjs +12 -1
- package/dist/esm/primitives/FieldGroupIcon/FieldGroupIconButton.mjs +11 -1
- package/dist/esm/primitives/Fieldset/Fieldset.mjs +33 -1
- package/dist/esm/primitives/Fieldset/useFieldset.mjs +13 -1
- package/dist/esm/primitives/Flex/Flex.mjs +13 -1
- package/dist/esm/primitives/Grid/Grid.mjs +13 -1
- package/dist/esm/primitives/Heading/Heading.mjs +21 -1
- package/dist/esm/primitives/HighlightMatch/HighlightMatch.mjs +28 -1
- package/dist/esm/primitives/Icon/Icon.mjs +36 -1
- package/dist/esm/primitives/Icon/context/IconsContext.mjs +5 -1
- package/dist/esm/primitives/Icon/context/IconsProvider.mjs +8 -1
- package/dist/esm/primitives/Icon/context/useIcons.mjs +12 -1
- package/dist/esm/primitives/Icon/icons/IconAdd.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconCheck.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconCheckCircle.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconCheckCircleOutline.mjs +13 -1
- package/dist/esm/primitives/Icon/icons/IconChevronLeft.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconChevronRight.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconClose.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconEdit.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconError.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconExpandMore.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconFile.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconIndeterminate.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconInfo.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconMenu.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconRemove.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconSearch.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconStar.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconUpload.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconVisibility.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconVisibilityOff.mjs +15 -1
- package/dist/esm/primitives/Icon/icons/IconWarning.mjs +15 -1
- package/dist/esm/primitives/Image/Image.mjs +13 -1
- package/dist/esm/primitives/Input/Input.mjs +15 -1
- package/dist/esm/primitives/Label/Label.mjs +14 -1
- package/dist/esm/primitives/Link/Link.mjs +15 -1
- package/dist/esm/primitives/Loader/Loader.mjs +56 -1
- package/dist/esm/primitives/Menu/Menu.mjs +31 -1
- package/dist/esm/primitives/Menu/MenuButton.mjs +18 -1
- package/dist/esm/primitives/Menu/MenuItem.mjs +22 -1
- package/dist/esm/primitives/Message/Message.mjs +23 -1
- package/dist/esm/primitives/Message/MessageContainer.mjs +19 -1
- package/dist/esm/primitives/Message/MessageContent.mjs +12 -1
- package/dist/esm/primitives/Message/MessageDismiss.mjs +28 -1
- package/dist/esm/primitives/Message/MessageHeading.mjs +12 -1
- package/dist/esm/primitives/Message/MessageIcon.mjs +35 -1
- package/dist/esm/primitives/Message/useMessage.mjs +9 -1
- package/dist/esm/primitives/Pagination/Pagination.mjs +31 -1
- package/dist/esm/primitives/Pagination/PaginationItem.mjs +48 -1
- package/dist/esm/primitives/Pagination/usePagination.mjs +41 -1
- package/dist/esm/primitives/Pagination/usePaginationItems.mjs +39 -1
- package/dist/esm/primitives/Pagination/useRange.mjs +72 -1
- package/dist/esm/primitives/PasswordField/PasswordField.mjs +25 -1
- package/dist/esm/primitives/PasswordField/ShowPasswordButton.mjs +30 -1
- package/dist/esm/primitives/PhoneNumberField/DialCodeSelect.mjs +21 -0
- package/dist/esm/primitives/PhoneNumberField/PhoneNumberField.mjs +17 -1
- package/dist/esm/primitives/Placeholder/Placeholder.mjs +18 -1
- package/dist/esm/primitives/Radio/Radio.mjs +31 -1
- package/dist/esm/primitives/RadioGroupField/RadioGroupField.mjs +55 -1
- package/dist/esm/primitives/RadioGroupField/context.mjs +9 -1
- package/dist/esm/primitives/Rating/Rating.mjs +44 -1
- package/dist/esm/primitives/Rating/RatingIcon.mjs +11 -1
- package/dist/esm/primitives/Rating/RatingMixedIcon.mjs +13 -1
- package/dist/esm/primitives/Rating/utils.mjs +18 -1
- package/dist/esm/primitives/ScrollView/ScrollView.mjs +13 -1
- package/dist/esm/primitives/SearchField/SearchField.mjs +38 -1
- package/dist/esm/primitives/SearchField/SearchFieldButton.mjs +21 -1
- package/dist/esm/primitives/SearchField/useSearchField.mjs +64 -1
- package/dist/esm/primitives/Select/Select.mjs +31 -1
- package/dist/esm/primitives/SelectField/SelectField.mjs +42 -1
- package/dist/esm/primitives/SliderField/SliderField.mjs +77 -1
- package/dist/esm/primitives/StepperField/StepperField.mjs +60 -1
- package/dist/esm/primitives/StepperField/useStepper.mjs +113 -1
- package/dist/esm/primitives/SwitchField/SwitchField.mjs +48 -1
- package/dist/esm/primitives/SwitchField/useSwitch.mjs +30 -1
- package/dist/esm/primitives/Table/Table.mjs +18 -1
- package/dist/esm/primitives/Table/TableBody.mjs +10 -1
- package/dist/esm/primitives/Table/TableCell.mjs +12 -1
- package/dist/esm/primitives/Table/TableFoot.mjs +10 -1
- package/dist/esm/primitives/Table/TableHead.mjs +10 -1
- package/dist/esm/primitives/Table/TableRow.mjs +10 -1
- package/dist/esm/primitives/Tabs/Tabs.mjs +24 -1
- package/dist/esm/primitives/Tabs/TabsContainer.mjs +35 -0
- package/dist/esm/primitives/Tabs/TabsContext.mjs +8 -0
- package/dist/esm/primitives/Tabs/TabsItem.mjs +24 -0
- package/dist/esm/primitives/Tabs/TabsList.mjs +85 -0
- package/dist/esm/primitives/Tabs/TabsPanel.mjs +19 -0
- package/dist/esm/primitives/Text/Text.mjs +16 -1
- package/dist/esm/primitives/TextArea/TextArea.mjs +15 -1
- package/dist/esm/primitives/TextAreaField/TextAreaField.mjs +36 -1
- package/dist/esm/primitives/TextField/TextField.mjs +34 -1
- package/dist/esm/primitives/ToggleButton/ToggleButton.mjs +24 -1
- package/dist/esm/primitives/ToggleButton/useToggleButton.mjs +23 -1
- package/dist/esm/primitives/ToggleButtonGroup/ToggleButtonGroup.mjs +35 -1
- package/dist/esm/primitives/ToggleButtonGroup/useToggleButtonGroup.mjs +36 -1
- package/dist/esm/primitives/View/View.mjs +23 -1
- package/dist/esm/primitives/VisuallyHidden/VisuallyHidden.mjs +13 -1
- package/dist/esm/primitives/index.mjs +63 -1
- package/dist/esm/primitives/shared/constants.mjs +98 -1
- package/dist/esm/primitives/shared/getStyleValue.mjs +25 -1
- package/dist/esm/primitives/shared/responsive/getMediaQueries.mjs +29 -1
- package/dist/esm/primitives/shared/responsive/useBreakpoint.mjs +39 -1
- package/dist/esm/primitives/shared/responsive/utils.mjs +51 -1
- package/dist/esm/primitives/shared/styleUtils.mjs +122 -1
- package/dist/esm/primitives/shared/utils.mjs +60 -1
- package/dist/esm/primitives/types/style.mjs +104 -1
- package/dist/esm/primitives/types/theme.mjs +7 -1
- package/dist/esm/primitives/utils/getTestId.mjs +3 -1
- package/dist/esm/primitives/utils/primitiveWithForwardRef.mjs +14 -0
- package/dist/esm/primitives/utils/splitPrimitiveProps.mjs +36 -1
- package/dist/esm/primitives/utils/useLayoutEffect.mjs +13 -1
- package/dist/esm/primitives/utils/useStableId.mjs +34 -1
- package/dist/esm/version.mjs +3 -1
- package/dist/index.js +3485 -1
- package/dist/internal.js +16403 -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 +299 -685
- package/dist/styles.layer.css +6115 -0
- package/dist/types/components/AccountSettings/ChangePassword/ChangePassword.d.ts +6 -6
- package/dist/types/components/AccountSettings/ChangePassword/types.d.ts +3 -0
- package/dist/types/components/AccountSettings/DeleteUser/DeleteUser.d.ts +3 -3
- package/dist/types/components/AccountSettings/DeleteUser/types.d.ts +7 -2
- package/dist/types/components/AccountSettings/utils/displayText.d.ts +18 -0
- package/dist/types/components/AccountSettings/utils/index.d.ts +1 -0
- package/dist/types/components/Authenticator/Authenticator.d.ts +4 -3
- package/dist/types/components/Authenticator/ConfirmSignIn/ConfirmSignIn.d.ts +2 -2
- package/dist/types/components/Authenticator/ConfirmSignUp/ConfirmSignUp.d.ts +2 -2
- package/dist/types/components/Authenticator/{ResetPassword → ForgotPassword}/index.d.ts +1 -1
- package/dist/types/components/Authenticator/{SetupTOTP/SetupTOTP.d.ts → SetupTotp/SetupTotp.d.ts} +1 -1
- package/dist/types/components/Authenticator/SetupTotp/index.d.ts +1 -0
- package/dist/types/components/Authenticator/SignIn/SignIn.d.ts +2 -2
- package/dist/types/components/Authenticator/SignUp/SignUp.d.ts +2 -2
- package/dist/types/components/Authenticator/VerifyUser/ConfirmVerifyUser.d.ts +2 -2
- package/dist/types/components/Authenticator/hooks/useCustomComponents/defaultComponents.d.ts +1 -1
- package/dist/types/components/Authenticator/withAuthenticator.d.ts +2 -2
- package/dist/types/components/ThemeProvider/ThemeContext.d.ts +6 -0
- package/dist/types/components/ThemeProvider/ThemeProvider.d.ts +1 -2
- package/dist/types/components/ThemeProvider/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/useAuth.d.ts +2 -2
- package/dist/types/hooks/useStorageURL.d.ts +2 -6
- package/dist/types/hooks/useTheme.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/internal.d.ts +0 -12
- package/dist/types/primitives/Accordion/Accordion.d.ts +19 -0
- package/dist/types/primitives/Accordion/AccordionContainer.d.ts +8 -0
- package/dist/types/primitives/Accordion/AccordionContent.d.ts +9 -0
- package/dist/types/primitives/Accordion/AccordionContext.d.ts +9 -0
- package/dist/types/primitives/Accordion/AccordionIcon.d.ts +9 -0
- package/dist/types/primitives/Accordion/AccordionItem.d.ts +6 -0
- package/dist/types/primitives/Accordion/AccordionTrigger.d.ts +9 -0
- package/dist/types/primitives/Accordion/index.d.ts +2 -0
- package/dist/types/primitives/Accordion/types.d.ts +49 -0
- package/dist/types/primitives/Alert/AlertIcon.d.ts +5 -2
- package/dist/types/primitives/Breadcrumbs/BreadcrumbItem.d.ts +1 -1
- package/dist/types/primitives/DropZone/DropZoneChildren.d.ts +10 -3
- package/dist/types/primitives/Icon/context/IconsContext.d.ts +1 -1
- package/dist/types/primitives/PhoneNumberField/DialCodeSelect.d.ts +2 -0
- package/dist/types/primitives/StepperField/useStepper.d.ts +1 -1
- package/dist/types/primitives/Tabs/Tabs.d.ts +14 -3
- package/dist/types/primitives/Tabs/TabsContainer.d.ts +6 -0
- package/dist/types/primitives/Tabs/TabsContext.d.ts +7 -0
- package/dist/types/primitives/Tabs/TabsItem.d.ts +6 -0
- package/dist/types/primitives/Tabs/TabsList.d.ts +6 -0
- package/dist/types/primitives/Tabs/TabsPanel.d.ts +6 -0
- package/dist/types/primitives/Tabs/index.d.ts +2 -1
- package/dist/types/primitives/Tabs/types.d.ts +93 -0
- package/dist/types/primitives/components.d.ts +2 -2
- package/dist/types/primitives/index.d.ts +0 -1
- package/dist/types/primitives/shared/constants.d.ts +0 -6
- package/dist/types/primitives/shared/responsive/utils.d.ts +1 -1
- package/dist/types/primitives/shared/styleUtils.d.ts +2 -2
- package/dist/types/primitives/types/collection.d.ts +2 -2
- package/dist/types/primitives/types/fieldset.d.ts +1 -1
- package/dist/types/primitives/types/index.d.ts +0 -3
- package/dist/types/primitives/types/radioGroupField.d.ts +2 -1
- package/dist/types/primitives/types/view.d.ts +32 -2
- package/dist/types/primitives/utils/primitiveWithForwardRef.d.ts +11 -0
- package/package.json +13 -45
- package/dist/Field-94e428ed.js +0 -1
- package/dist/esm/components/Authenticator/ResetPassword/ConfirmResetPassword.mjs +0 -1
- package/dist/esm/components/Authenticator/ResetPassword/ResetPassword.mjs +0 -1
- package/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.mjs +0 -1
- package/dist/esm/components/Storage/FileUploader/FileUploader.mjs +0 -1
- package/dist/esm/components/Storage/FileUploader/UploadDropZone/UploadDropZone.mjs +0 -1
- package/dist/esm/components/Storage/FileUploader/UploadPreviewer/UploadPreviewer.mjs +0 -1
- package/dist/esm/components/Storage/FileUploader/UploadTracker/UploadMessage.mjs +0 -1
- package/dist/esm/components/Storage/FileUploader/UploadTracker/UploadTracker.mjs +0 -1
- package/dist/esm/components/Storage/FileUploader/hooks/useFileUploader/useFileUploader.mjs +0 -1
- package/dist/esm/components/Storage/FileUploader/types.mjs +0 -1
- package/dist/esm/components/ThemeProvider/AmplifyContext.mjs +0 -1
- package/dist/esm/helpers/constants.mjs +0 -1
- package/dist/esm/hooks/actions/constants.mjs +0 -1
- package/dist/esm/hooks/actions/shared/types.mjs +0 -1
- package/dist/esm/hooks/actions/shared/useTypeCastFields.mjs +0 -1
- package/dist/esm/hooks/actions/useAuthSignOutAction.mjs +0 -1
- package/dist/esm/hooks/actions/useDataStoreCreateAction.mjs +0 -1
- package/dist/esm/hooks/actions/useDataStoreDeleteAction.mjs +0 -1
- package/dist/esm/hooks/actions/useDataStoreUpdateAction.mjs +0 -1
- package/dist/esm/hooks/actions/useNavigateAction.mjs +0 -1
- package/dist/esm/hooks/actions/useStateMutationAction.mjs +0 -1
- package/dist/esm/hooks/useAmplify.mjs +0 -1
- package/dist/esm/hooks/useDataStore.mjs +0 -1
- package/dist/esm/primitives/Expander/Expander.mjs +0 -1
- package/dist/esm/primitives/Expander/ExpanderItem.mjs +0 -1
- package/dist/esm/primitives/PhoneNumberField/CountryCodeSelect.mjs +0 -1
- package/dist/esm/primitives/shared/datastore.mjs +0 -1
- package/dist/esm/studio/findChildOverrides.mjs +0 -1
- package/dist/esm/studio/getOverrideProps.mjs +0 -1
- package/dist/esm/studio/getOverridesFromVariants.mjs +0 -1
- package/dist/esm/studio/mergeVariantsAndOverrides.mjs +0 -1
- package/dist/styles.js +0 -2
- package/dist/types/components/Authenticator/SetupTOTP/index.d.ts +0 -1
- package/dist/types/components/Storage/FileUploader/FileUploader.d.ts +0 -3
- package/dist/types/components/Storage/FileUploader/UploadDropZone/UploadDropZone.d.ts +0 -3
- package/dist/types/components/Storage/FileUploader/UploadDropZone/index.d.ts +0 -1
- package/dist/types/components/Storage/FileUploader/UploadPreviewer/UploadPreviewer.d.ts +0 -3
- package/dist/types/components/Storage/FileUploader/UploadPreviewer/index.d.ts +0 -1
- package/dist/types/components/Storage/FileUploader/UploadTracker/UploadMessage.d.ts +0 -3
- package/dist/types/components/Storage/FileUploader/UploadTracker/UploadTracker.d.ts +0 -3
- package/dist/types/components/Storage/FileUploader/UploadTracker/index.d.ts +0 -1
- package/dist/types/components/Storage/FileUploader/hooks/index.d.ts +0 -1
- package/dist/types/components/Storage/FileUploader/hooks/useFileUploader/index.d.ts +0 -2
- package/dist/types/components/Storage/FileUploader/hooks/useFileUploader/types.d.ts +0 -18
- package/dist/types/components/Storage/FileUploader/hooks/useFileUploader/useFileUploader.d.ts +0 -9
- package/dist/types/components/Storage/FileUploader/index.d.ts +0 -1
- package/dist/types/components/Storage/FileUploader/types.d.ts +0 -91
- package/dist/types/components/Storage/index.d.ts +0 -1
- package/dist/types/components/ThemeProvider/AmplifyContext.d.ts +0 -6
- package/dist/types/hooks/actions/constants.d.ts +0 -39
- package/dist/types/hooks/actions/shared/types.d.ts +0 -27
- package/dist/types/hooks/actions/shared/useTypeCastFields.d.ts +0 -15
- package/dist/types/hooks/actions/testModels/model.d.ts +0 -25
- package/dist/types/hooks/actions/testModels/schema.d.ts +0 -2
- package/dist/types/hooks/actions/testModels/todo.d.ts +0 -13
- package/dist/types/hooks/actions/useAuthSignOutAction.d.ts +0 -9
- package/dist/types/hooks/actions/useDataStoreCreateAction.d.ts +0 -9
- package/dist/types/hooks/actions/useDataStoreDeleteAction.d.ts +0 -10
- package/dist/types/hooks/actions/useDataStoreUpdateAction.d.ts +0 -10
- package/dist/types/hooks/actions/useNavigateAction.d.ts +0 -15
- package/dist/types/hooks/actions/useStateMutationAction.d.ts +0 -10
- package/dist/types/hooks/useAmplify.d.ts +0 -6
- package/dist/types/hooks/useDataStore.d.ts +0 -18
- package/dist/types/primitives/Expander/Expander.d.ts +0 -6
- package/dist/types/primitives/Expander/ExpanderItem.d.ts +0 -7
- package/dist/types/primitives/Expander/index.d.ts +0 -2
- package/dist/types/primitives/Menu/__tests_/menu.test.d.ts +0 -1
- package/dist/types/primitives/PhoneNumberField/CountryCodeSelect.d.ts +0 -2
- package/dist/types/primitives/Rating/__test__/Rating.test.d.ts +0 -1
- package/dist/types/primitives/Rating/__test__/utils.test.d.ts +0 -1
- package/dist/types/primitives/Text/__test__/Text.test.d.ts +0 -1
- package/dist/types/primitives/shared/datastore.d.ts +0 -7
- package/dist/types/primitives/shared/index.d.ts +0 -1
- package/dist/types/primitives/shared/types.d.ts +0 -15
- package/dist/types/primitives/types/datastore.d.ts +0 -31
- package/dist/types/primitives/types/expander.d.ts +0 -51
- package/dist/types/primitives/types/tabs.d.ts +0 -63
- package/dist/types/studio/findChildOverrides.d.ts +0 -18
- package/dist/types/studio/getOverrideProps.d.ts +0 -18
- package/dist/types/studio/getOverridesFromVariants.d.ts +0 -20
- package/dist/types/studio/index.d.ts +0 -5
- package/dist/types/studio/mergeVariantsAndOverrides.d.ts +0 -18
- package/dist/types/studio/types.d.ts +0 -18
- package/dist/types/styles.d.ts +0 -1
- /package/dist/types/components/Authenticator/{ResetPassword → ForgotPassword}/ConfirmResetPassword.d.ts +0 -0
- /package/dist/types/components/Authenticator/{ResetPassword/ResetPassword.d.ts → ForgotPassword/ForgotPassword.d.ts} +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import QRCode from 'qrcode';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ConsoleLogger } from 'aws-amplify/utils';
|
|
4
|
+
import { authenticatorTextUtil, getTotpCodeURL } from '@aws-amplify/ui';
|
|
5
|
+
import { Flex } from '../../../primitives/Flex/Flex.mjs';
|
|
6
|
+
import { Heading } from '../../../primitives/Heading/Heading.mjs';
|
|
7
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
8
|
+
import { useCustomComponents } from '../hooks/useCustomComponents/useCustomComponents.mjs';
|
|
9
|
+
import { useFormHandlers } from '../hooks/useFormHandlers/useFormHandlers.mjs';
|
|
10
|
+
import { ConfirmSignInFooter } from '../shared/ConfirmSignInFooter.mjs';
|
|
11
|
+
import { RemoteErrorMessage } from '../shared/RemoteErrorMessage.mjs';
|
|
12
|
+
import { FormFields } from '../shared/FormFields.mjs';
|
|
13
|
+
import { RouteContainer } from '../RouteContainer/RouteContainer.mjs';
|
|
14
|
+
|
|
15
|
+
const logger = new ConsoleLogger('SetupTotp-logger');
|
|
16
|
+
const { getSetupTotpText, getCopiedText, getLoadingText } = authenticatorTextUtil;
|
|
17
|
+
const SetupTotp = ({ className, variation, }) => {
|
|
18
|
+
const { totpSecretCode, isPending, username, QRFields } = useAuthenticator((context) => [context.isPending, context.totpSecretCode, context.username]);
|
|
19
|
+
const { handleChange, handleSubmit } = useFormHandlers();
|
|
20
|
+
const { components: {
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
SetupTotp: { Header = SetupTotp.Header, Footer = SetupTotp.Footer }, }, } = useCustomComponents();
|
|
23
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
24
|
+
const [qrCode, setQrCode] = React.useState();
|
|
25
|
+
const [copyTextLabel, setCopyTextLabel] = React.useState('COPY');
|
|
26
|
+
const { totpIssuer = 'AWSCognito', totpUsername = username } = QRFields ?? {};
|
|
27
|
+
const generateQRCode = React.useCallback(async () => {
|
|
28
|
+
try {
|
|
29
|
+
const totpCode = getTotpCodeURL(totpIssuer, totpUsername, totpSecretCode);
|
|
30
|
+
const qrCodeImageSource = await QRCode.toDataURL(totpCode);
|
|
31
|
+
setQrCode(qrCodeImageSource);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
logger.error(error);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
setIsLoading(false);
|
|
38
|
+
}
|
|
39
|
+
}, [totpIssuer, totpUsername, totpSecretCode]);
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
if (!qrCode) {
|
|
42
|
+
generateQRCode();
|
|
43
|
+
}
|
|
44
|
+
}, [generateQRCode, qrCode]);
|
|
45
|
+
const copyText = () => {
|
|
46
|
+
navigator.clipboard.writeText(totpSecretCode);
|
|
47
|
+
setCopyTextLabel(getCopiedText());
|
|
48
|
+
};
|
|
49
|
+
return (React.createElement(RouteContainer, { className: className, variation: variation },
|
|
50
|
+
React.createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-setup-totp": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
51
|
+
React.createElement(Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
52
|
+
React.createElement(Header, null),
|
|
53
|
+
React.createElement(Flex, { direction: "column" },
|
|
54
|
+
isLoading ? (React.createElement("p", null,
|
|
55
|
+
getLoadingText(),
|
|
56
|
+
"\u2026")) : (React.createElement("img", { "data-amplify-qrcode": true, src: qrCode, alt: "qr code", width: "228", height: "228" })),
|
|
57
|
+
React.createElement(Flex, { "data-amplify-copy": true },
|
|
58
|
+
React.createElement("div", null, totpSecretCode),
|
|
59
|
+
React.createElement(Flex, { "data-amplify-copy-svg": true, onClick: copyText },
|
|
60
|
+
React.createElement("div", { "data-amplify-copy-tooltip": true }, copyTextLabel),
|
|
61
|
+
React.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" },
|
|
62
|
+
React.createElement("path", { d: "M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z" })))),
|
|
63
|
+
React.createElement(FormFields, null),
|
|
64
|
+
React.createElement(RemoteErrorMessage, null)),
|
|
65
|
+
React.createElement(ConfirmSignInFooter, null),
|
|
66
|
+
React.createElement(Footer, null)))));
|
|
67
|
+
};
|
|
68
|
+
SetupTotp.Header = function Header() {
|
|
69
|
+
return React.createElement(Heading, { level: 3 }, getSetupTotpText());
|
|
70
|
+
};
|
|
71
|
+
SetupTotp.Footer = function Footer() {
|
|
72
|
+
// @ts-ignore
|
|
73
|
+
return null;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { SetupTotp };
|
|
@@ -1 +1,47 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
+
import { Button } from '../../../primitives/Button/Button.mjs';
|
|
4
|
+
import { Flex } from '../../../primitives/Flex/Flex.mjs';
|
|
5
|
+
import { View } from '../../../primitives/View/View.mjs';
|
|
6
|
+
import { VisuallyHidden } from '../../../primitives/VisuallyHidden/VisuallyHidden.mjs';
|
|
7
|
+
import { FederatedSignIn } from '../FederatedSignIn/FederatedSignIn.mjs';
|
|
8
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
9
|
+
import { useCustomComponents } from '../hooks/useCustomComponents/useCustomComponents.mjs';
|
|
10
|
+
import { useFormHandlers } from '../hooks/useFormHandlers/useFormHandlers.mjs';
|
|
11
|
+
import { RemoteErrorMessage } from '../shared/RemoteErrorMessage.mjs';
|
|
12
|
+
import { FormFields } from '../shared/FormFields.mjs';
|
|
13
|
+
|
|
14
|
+
const { getSignInText, getSigningInText, getForgotPasswordText } = authenticatorTextUtil;
|
|
15
|
+
function SignIn() {
|
|
16
|
+
const { isPending } = useAuthenticator((context) => [context.isPending]);
|
|
17
|
+
const { handleChange, handleSubmit } = useFormHandlers();
|
|
18
|
+
const { components: {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
SignIn: { Header = SignIn.Header, Footer = SignIn.Footer }, }, } = useCustomComponents();
|
|
21
|
+
return (React__default.createElement(View, null,
|
|
22
|
+
React__default.createElement(Header, null),
|
|
23
|
+
React__default.createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-signin": "", method: "post", onSubmit: handleSubmit, onChange: handleChange },
|
|
24
|
+
React__default.createElement(FederatedSignIn, null),
|
|
25
|
+
React__default.createElement(Flex, { direction: "column" },
|
|
26
|
+
React__default.createElement(Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
27
|
+
React__default.createElement(VisuallyHidden, null,
|
|
28
|
+
React__default.createElement("legend", null, getSignInText())),
|
|
29
|
+
React__default.createElement(FormFields, null)),
|
|
30
|
+
React__default.createElement(RemoteErrorMessage, null),
|
|
31
|
+
React__default.createElement(Button, { isDisabled: isPending, isFullWidth: true, type: "submit", variation: "primary", isLoading: isPending, loadingText: getSigningInText() }, getSignInText()))),
|
|
32
|
+
React__default.createElement(Footer, null)));
|
|
33
|
+
}
|
|
34
|
+
const DefaultFooter = () => {
|
|
35
|
+
const { toForgotPassword } = useAuthenticator((context) => [
|
|
36
|
+
context.toForgotPassword,
|
|
37
|
+
]);
|
|
38
|
+
return (React__default.createElement(View, { "data-amplify-footer": "" },
|
|
39
|
+
React__default.createElement(Button, { fontWeight: "normal", onClick: toForgotPassword, size: "small", variation: "link" }, getForgotPasswordText())));
|
|
40
|
+
};
|
|
41
|
+
SignIn.Footer = DefaultFooter;
|
|
42
|
+
SignIn.Header = function Header() {
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { SignIn };
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
+
import { Button } from '../../../primitives/Button/Button.mjs';
|
|
4
|
+
import { Flex } from '../../../primitives/Flex/Flex.mjs';
|
|
5
|
+
import { View } from '../../../primitives/View/View.mjs';
|
|
6
|
+
import { FederatedSignIn } from '../FederatedSignIn/FederatedSignIn.mjs';
|
|
7
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
8
|
+
import { useCustomComponents } from '../hooks/useCustomComponents/useCustomComponents.mjs';
|
|
9
|
+
import { useFormHandlers } from '../hooks/useFormHandlers/useFormHandlers.mjs';
|
|
10
|
+
import { RemoteErrorMessage } from '../shared/RemoteErrorMessage.mjs';
|
|
11
|
+
import { FormFields } from '../shared/FormFields.mjs';
|
|
12
|
+
|
|
13
|
+
const { getCreateAccountText, getCreatingAccountText } = authenticatorTextUtil;
|
|
14
|
+
function SignUp() {
|
|
15
|
+
const { hasValidationErrors, isPending } = useAuthenticator((context) => [
|
|
16
|
+
context.hasValidationErrors,
|
|
17
|
+
context.isPending,
|
|
18
|
+
]);
|
|
19
|
+
const { handleChange, handleBlur, handleSubmit } = useFormHandlers();
|
|
20
|
+
const { components: {
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
SignUp: { Header = SignUp.Header, FormFields = SignUp.FormFields, Footer = SignUp.Footer, }, }, } = useCustomComponents();
|
|
23
|
+
return (React__default.createElement(View, null,
|
|
24
|
+
React__default.createElement(Header, null),
|
|
25
|
+
React__default.createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-signup": "", method: "post", onChange: handleChange, onSubmit: handleSubmit, onBlur: handleBlur },
|
|
26
|
+
React__default.createElement(FederatedSignIn, null),
|
|
27
|
+
React__default.createElement(Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
28
|
+
React__default.createElement(Flex, { direction: "column" },
|
|
29
|
+
React__default.createElement(FormFields, null),
|
|
30
|
+
React__default.createElement(RemoteErrorMessage, null)),
|
|
31
|
+
React__default.createElement(Button, { isDisabled: hasValidationErrors || isPending, isFullWidth: true, type: "submit", variation: "primary", isLoading: isPending, loadingText: getCreatingAccountText() }, getCreateAccountText()))),
|
|
32
|
+
React__default.createElement(Footer, null)));
|
|
33
|
+
}
|
|
34
|
+
SignUp.Header = function Header() {
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
SignUp.FormFields = function FormFields$1() {
|
|
39
|
+
return React__default.createElement(FormFields, null);
|
|
40
|
+
};
|
|
41
|
+
SignUp.Footer = function Footer() {
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { SignUp };
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
+
import { Flex } from '../../../primitives/Flex/Flex.mjs';
|
|
4
|
+
import { Heading } from '../../../primitives/Heading/Heading.mjs';
|
|
5
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
6
|
+
import { useCustomComponents } from '../hooks/useCustomComponents/useCustomComponents.mjs';
|
|
7
|
+
import { useFormHandlers } from '../hooks/useFormHandlers/useFormHandlers.mjs';
|
|
8
|
+
import { RemoteErrorMessage } from '../shared/RemoteErrorMessage.mjs';
|
|
9
|
+
import { TwoButtonSubmitFooter } from '../shared/TwoButtonSubmitFooter.mjs';
|
|
10
|
+
import { FormFields } from '../shared/FormFields.mjs';
|
|
11
|
+
import { RouteContainer } from '../RouteContainer/RouteContainer.mjs';
|
|
12
|
+
|
|
13
|
+
const { getAccountRecoveryInfoText, getSkipText } = authenticatorTextUtil;
|
|
14
|
+
const ConfirmVerifyUser = ({ className, variation, }) => {
|
|
15
|
+
const { isPending } = useAuthenticator((context) => [context.isPending]);
|
|
16
|
+
const { handleChange, handleSubmit } = useFormHandlers();
|
|
17
|
+
const { components: {
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
ConfirmVerifyUser: { Header = ConfirmVerifyUser.Header, Footer = ConfirmVerifyUser.Footer, }, }, } = useCustomComponents();
|
|
20
|
+
return (React__default.createElement(RouteContainer, { className: className, variation: variation },
|
|
21
|
+
React__default.createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-confirmverifyuser": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
22
|
+
React__default.createElement(Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
23
|
+
React__default.createElement(Header, null),
|
|
24
|
+
React__default.createElement(Flex, { direction: "column" },
|
|
25
|
+
React__default.createElement(FormFields, null)),
|
|
26
|
+
React__default.createElement(RemoteErrorMessage, null),
|
|
27
|
+
React__default.createElement(TwoButtonSubmitFooter, { cancelButtonText: getSkipText(), cancelButtonSendType: "SKIP" }),
|
|
28
|
+
React__default.createElement(Footer, null)))));
|
|
29
|
+
};
|
|
30
|
+
ConfirmVerifyUser.Header = function Header() {
|
|
31
|
+
return React__default.createElement(Heading, { level: 3 }, getAccountRecoveryInfoText());
|
|
32
|
+
};
|
|
33
|
+
ConfirmVerifyUser.Footer = function Footer() {
|
|
34
|
+
return null;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { ConfirmVerifyUser };
|
|
@@ -1 +1,59 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { authenticatorTextUtil, defaultFormFieldOptions, translate, censorPhoneNumber, censorAllButFirstAndLast } from '@aws-amplify/ui';
|
|
3
|
+
import { Flex } from '../../../primitives/Flex/Flex.mjs';
|
|
4
|
+
import { Heading } from '../../../primitives/Heading/Heading.mjs';
|
|
5
|
+
import { Radio } from '../../../primitives/Radio/Radio.mjs';
|
|
6
|
+
import { RadioGroupField } from '../../../primitives/RadioGroupField/RadioGroupField.mjs';
|
|
7
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
8
|
+
import { useCustomComponents } from '../hooks/useCustomComponents/useCustomComponents.mjs';
|
|
9
|
+
import { useFormHandlers } from '../hooks/useFormHandlers/useFormHandlers.mjs';
|
|
10
|
+
import { RemoteErrorMessage } from '../shared/RemoteErrorMessage.mjs';
|
|
11
|
+
import { TwoButtonSubmitFooter } from '../shared/TwoButtonSubmitFooter.mjs';
|
|
12
|
+
import { RouteContainer } from '../RouteContainer/RouteContainer.mjs';
|
|
13
|
+
|
|
14
|
+
const { getSkipText, getVerifyText, getVerifyContactText, getAccountRecoveryInfoText, } = authenticatorTextUtil;
|
|
15
|
+
const censorContactInformation = (type, value) => {
|
|
16
|
+
const translated = translate(type);
|
|
17
|
+
let newVal = value;
|
|
18
|
+
if (type === 'Phone Number') {
|
|
19
|
+
newVal = censorPhoneNumber(value);
|
|
20
|
+
}
|
|
21
|
+
else if (type === 'Email') {
|
|
22
|
+
const splitEmail = value.split('@');
|
|
23
|
+
const censoredName = censorAllButFirstAndLast(splitEmail[0]);
|
|
24
|
+
newVal = `${censoredName}@${splitEmail[1]}`;
|
|
25
|
+
}
|
|
26
|
+
return `${translated}: ${newVal}`;
|
|
27
|
+
};
|
|
28
|
+
const generateRadioGroup = (attributes) => {
|
|
29
|
+
return Object.entries(attributes).map(([key, value]) => (React__default.createElement(Radio, { name: "unverifiedAttr", value: key, key: key }, censorContactInformation(defaultFormFieldOptions[key].label, value))));
|
|
30
|
+
};
|
|
31
|
+
const VerifyUser = ({ className, variation, }) => {
|
|
32
|
+
const { components: {
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
VerifyUser: { Header = VerifyUser.Header, Footer = VerifyUser.Footer }, }, } = useCustomComponents();
|
|
35
|
+
const { isPending, unverifiedUserAttributes } = useAuthenticator(({ isPending, unverifiedUserAttributes }) => [
|
|
36
|
+
isPending,
|
|
37
|
+
unverifiedUserAttributes,
|
|
38
|
+
]);
|
|
39
|
+
const { handleChange, handleSubmit } = useFormHandlers();
|
|
40
|
+
const footerSubmitText = isPending ? (React__default.createElement(React__default.Fragment, null, "Verifying\u2026")) : (React__default.createElement(React__default.Fragment, null, getVerifyText()));
|
|
41
|
+
const verificationRadioGroup = (React__default.createElement(RadioGroupField, { legend: getVerifyContactText(), name: "verify_context", isDisabled: isPending, legendHidden: true }, generateRadioGroup(unverifiedUserAttributes)));
|
|
42
|
+
return (React__default.createElement(RouteContainer, { className: className, variation: variation },
|
|
43
|
+
React__default.createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-verifyuser": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
44
|
+
React__default.createElement(Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
45
|
+
React__default.createElement(Header, null),
|
|
46
|
+
verificationRadioGroup,
|
|
47
|
+
React__default.createElement(RemoteErrorMessage, null),
|
|
48
|
+
React__default.createElement(TwoButtonSubmitFooter, { cancelButtonText: getSkipText(), cancelButtonSendType: "SKIP", submitButtonText: footerSubmitText }),
|
|
49
|
+
React__default.createElement(Footer, null)))));
|
|
50
|
+
};
|
|
51
|
+
VerifyUser.Header = function Header() {
|
|
52
|
+
return React__default.createElement(Heading, { level: 3 }, getAccountRecoveryInfoText());
|
|
53
|
+
};
|
|
54
|
+
VerifyUser.Footer = function Footer() {
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
return null;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { VerifyUser };
|
|
@@ -1 +1,62 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { SignIn } from '../../SignIn/SignIn.mjs';
|
|
2
|
+
import { SignUp } from '../../SignUp/SignUp.mjs';
|
|
3
|
+
import { ConfirmSignUp } from '../../ConfirmSignUp/ConfirmSignUp.mjs';
|
|
4
|
+
import { ForceNewPassword } from '../../ForceNewPassword/ForceNewPassword.mjs';
|
|
5
|
+
import { SetupTotp } from '../../SetupTotp/SetupTotp.mjs';
|
|
6
|
+
import { ConfirmSignIn } from '../../ConfirmSignIn/ConfirmSignIn.mjs';
|
|
7
|
+
import { ConfirmVerifyUser } from '../../VerifyUser/ConfirmVerifyUser.mjs';
|
|
8
|
+
import { VerifyUser } from '../../VerifyUser/VerifyUser.mjs';
|
|
9
|
+
import { ConfirmResetPassword } from '../../ForgotPassword/ConfirmResetPassword.mjs';
|
|
10
|
+
import { ResetPassword } from '../../ForgotPassword/ForgotPassword.mjs';
|
|
11
|
+
|
|
12
|
+
const defaultComponents = {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
Header: () => null,
|
|
15
|
+
SignIn: {
|
|
16
|
+
Header: SignIn.Header,
|
|
17
|
+
Footer: SignIn.Footer,
|
|
18
|
+
},
|
|
19
|
+
SignUp: {
|
|
20
|
+
Header: SignUp.Header,
|
|
21
|
+
FormFields: SignUp.FormFields,
|
|
22
|
+
Footer: SignUp.Footer,
|
|
23
|
+
},
|
|
24
|
+
ConfirmSignUp: {
|
|
25
|
+
Header: ConfirmSignUp.Header,
|
|
26
|
+
Footer: ConfirmSignUp.Footer,
|
|
27
|
+
},
|
|
28
|
+
SetupTotp: {
|
|
29
|
+
Header: SetupTotp.Header,
|
|
30
|
+
Footer: SetupTotp.Footer,
|
|
31
|
+
},
|
|
32
|
+
ConfirmResetPassword: {
|
|
33
|
+
Header: ConfirmResetPassword.Header,
|
|
34
|
+
Footer: ConfirmResetPassword.Footer,
|
|
35
|
+
},
|
|
36
|
+
ConfirmSignIn: {
|
|
37
|
+
Header: ConfirmSignIn.Header,
|
|
38
|
+
Footer: ConfirmSignIn.Footer,
|
|
39
|
+
},
|
|
40
|
+
VerifyUser: {
|
|
41
|
+
Header: VerifyUser.Header,
|
|
42
|
+
Footer: VerifyUser.Footer,
|
|
43
|
+
},
|
|
44
|
+
ConfirmVerifyUser: {
|
|
45
|
+
Header: ConfirmVerifyUser.Header,
|
|
46
|
+
// @ts-ignore
|
|
47
|
+
Footer: ConfirmVerifyUser.Footer,
|
|
48
|
+
},
|
|
49
|
+
ForceNewPassword: {
|
|
50
|
+
Header: ForceNewPassword.Header,
|
|
51
|
+
Footer: ForceNewPassword.Footer,
|
|
52
|
+
FormFields: ForceNewPassword.FormFields,
|
|
53
|
+
},
|
|
54
|
+
ResetPassword: {
|
|
55
|
+
Header: ResetPassword.Header,
|
|
56
|
+
Footer: ResetPassword.Footer,
|
|
57
|
+
},
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
Footer: () => null,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { defaultComponents };
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const CustomComponentsContext =
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
React.createContext(null);
|
|
6
|
+
const useCustomComponents = () => {
|
|
7
|
+
const context = React.useContext(CustomComponentsContext);
|
|
8
|
+
if (!context) {
|
|
9
|
+
throw new Error('`useCustomComponents` cannot be used outside of a `CustomComponentsContext.Provider`');
|
|
10
|
+
}
|
|
11
|
+
return context;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { CustomComponentsContext, useCustomComponents };
|
|
@@ -1 +1,30 @@
|
|
|
1
|
-
import{useCallback
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { getFormDataFromEvent } from '../../../../helpers/utils.mjs';
|
|
3
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
4
|
+
|
|
5
|
+
function useFormHandlers() {
|
|
6
|
+
const { submitForm, updateBlur, updateForm } = useAuthenticator((context) => [
|
|
7
|
+
context.submitForm,
|
|
8
|
+
context.updateBlur,
|
|
9
|
+
context.updateForm,
|
|
10
|
+
]);
|
|
11
|
+
const handleBlur = useCallback(({ target: { name } }) => {
|
|
12
|
+
updateBlur({ name });
|
|
13
|
+
}, [updateBlur]);
|
|
14
|
+
// @TODO: align multiple input type handling with react docs example for 3.0 release
|
|
15
|
+
// example: https://reactjs.org/docs/forms.html#handling-multiple-inputs
|
|
16
|
+
const handleChange = useCallback(({ target: { checked, name, type, value }, }) => {
|
|
17
|
+
const isUncheckedCheckbox = type === 'checkbox' && !checked;
|
|
18
|
+
updateForm({
|
|
19
|
+
name,
|
|
20
|
+
value: isUncheckedCheckbox ? undefined : value,
|
|
21
|
+
});
|
|
22
|
+
}, [updateForm]);
|
|
23
|
+
const handleSubmit = useCallback((event) => {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
submitForm(getFormDataFromEvent(event));
|
|
26
|
+
}, [submitForm]);
|
|
27
|
+
return { handleBlur, handleChange, handleSubmit };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { useFormHandlers };
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
4
|
+
import { Button } from '../../../primitives/Button/Button.mjs';
|
|
5
|
+
import { Flex } from '../../../primitives/Flex/Flex.mjs';
|
|
6
|
+
|
|
7
|
+
const { getConfirmText, getConfirmingText, getBackToSignInText } = authenticatorTextUtil;
|
|
8
|
+
const ConfirmSignInFooter = () => {
|
|
9
|
+
const { isPending, toSignIn } = useAuthenticator((context) => [
|
|
10
|
+
context.isPending,
|
|
11
|
+
context.toSignIn,
|
|
12
|
+
]);
|
|
13
|
+
return (React__default.createElement(Flex, { direction: "column" },
|
|
14
|
+
React__default.createElement(Button, { isDisabled: isPending, type: "submit", variation: "primary", fontWeight: "normal", isLoading: isPending, loadingText: getConfirmingText() }, getConfirmText()),
|
|
15
|
+
React__default.createElement(Button, { onClick: toSignIn, type: "button", variation: "link", fontWeight: "normal", size: "small" }, getBackToSignInText())));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { ConfirmSignInFooter };
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getErrors } from '@aws-amplify/ui';
|
|
3
|
+
import { PasswordField } from '../../../primitives/PasswordField/PasswordField.mjs';
|
|
4
|
+
import { PhoneNumberField } from '../../../primitives/PhoneNumberField/PhoneNumberField.mjs';
|
|
5
|
+
import { TextField } from '../../../primitives/TextField/TextField.mjs';
|
|
6
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
7
|
+
import { useStableId } from '../../../primitives/utils/useStableId.mjs';
|
|
8
|
+
import { ValidationErrors } from '../../shared/ValidationErrors.mjs';
|
|
9
|
+
|
|
10
|
+
function FormField({ autocomplete: autoComplete, dialCode, name, type, ...props }) {
|
|
11
|
+
const { validationErrors } = useAuthenticator(({ validationErrors }) => [
|
|
12
|
+
validationErrors,
|
|
13
|
+
]);
|
|
14
|
+
const errors = React.useMemo(() => getErrors(validationErrors[name]), [name, validationErrors]);
|
|
15
|
+
const hasError = errors?.length > 0;
|
|
16
|
+
const errorId = useStableId();
|
|
17
|
+
const ariaDescribedBy = hasError ? errorId : undefined;
|
|
18
|
+
if (type === 'tel') {
|
|
19
|
+
return (React.createElement(React.Fragment, null,
|
|
20
|
+
React.createElement(PhoneNumberField, { ...props, name: name, defaultDialCode: dialCode, dialCodeName: "country_code", autoComplete: autoComplete, hasError: hasError, "aria-describedby": ariaDescribedBy }),
|
|
21
|
+
React.createElement(ValidationErrors, { dataAttr: "data-amplify-sign-up-errors", errors: errors, id: errorId })));
|
|
22
|
+
}
|
|
23
|
+
else if (type === 'password') {
|
|
24
|
+
return (React.createElement(React.Fragment, null,
|
|
25
|
+
React.createElement(PasswordField, { ...props, name: name, autoComplete: autoComplete, hasError: hasError, "aria-describedby": ariaDescribedBy }),
|
|
26
|
+
React.createElement(ValidationErrors, { dataAttr: "data-amplify-sign-up-errors", errors: errors, id: errorId })));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return (React.createElement(React.Fragment, null,
|
|
30
|
+
React.createElement(TextField, { ...props, name: name, autoComplete: autoComplete, hasError: hasError, type: type, "aria-describedby": ariaDescribedBy }),
|
|
31
|
+
React.createElement(ValidationErrors, { dataAttr: "data-amplify-sign-up-errors", errors: errors, id: errorId })));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { FormField };
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FormField } from './FormField.mjs';
|
|
3
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
4
|
+
|
|
5
|
+
function FormFields() {
|
|
6
|
+
const { fields } = useAuthenticator(({ route }) => [route]);
|
|
7
|
+
const formFields = React.useRef(fields.map((field, index) => (React.createElement(FormField
|
|
8
|
+
// use index for key, field order is static
|
|
9
|
+
, {
|
|
10
|
+
// use index for key, field order is static
|
|
11
|
+
key: index, ...field })))).current;
|
|
12
|
+
return React.createElement(React.Fragment, null, formFields);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { FormFields };
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { translate } from '@aws-amplify/ui';
|
|
3
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
4
|
+
import { Alert } from '../../../primitives/Alert/Alert.mjs';
|
|
5
|
+
|
|
6
|
+
const RemoteErrorMessage = () => {
|
|
7
|
+
const { error } = useAuthenticator((context) => [context.error]);
|
|
8
|
+
return (React__default.createElement(React__default.Fragment, null, error ? (React__default.createElement(Alert, { variation: "error", isDismissible: true }, translate(error))) : null));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { RemoteErrorMessage };
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
4
|
+
import { Tabs } from '../../../primitives/Tabs/Tabs.mjs';
|
|
5
|
+
import { View } from '../../../primitives/View/View.mjs';
|
|
6
|
+
import { SignIn } from '../SignIn/SignIn.mjs';
|
|
7
|
+
import { SignUp } from '../SignUp/SignUp.mjs';
|
|
8
|
+
import { RouteContainer } from '../RouteContainer/RouteContainer.mjs';
|
|
9
|
+
|
|
10
|
+
const { getSignInTabText, getSignUpTabText } = authenticatorTextUtil;
|
|
11
|
+
const SignInSignUpTabs = ({ className, hideSignUp, variation, }) => {
|
|
12
|
+
const { route, toSignIn, toSignUp } = useAuthenticator((context) => [
|
|
13
|
+
context.route,
|
|
14
|
+
context.toSignIn,
|
|
15
|
+
context.toSignUp,
|
|
16
|
+
]);
|
|
17
|
+
return (React__default.createElement(RouteContainer, { className: className, variation: variation }, hideSignUp ? (React__default.createElement(View, { "data-amplify-router-content": "" }, route === 'signIn' && React__default.createElement(SignIn, null))) : (React__default.createElement(Tabs.Container, { value: route, isLazy: true, onValueChange: () => (route === 'signIn' ? toSignUp() : toSignIn()) },
|
|
18
|
+
React__default.createElement(Tabs.List, { spacing: "equal", indicatorPosition: "top" },
|
|
19
|
+
React__default.createElement(Tabs.Item, { value: "signIn" }, getSignInTabText()),
|
|
20
|
+
React__default.createElement(Tabs.Item, { value: "signUp" }, getSignUpTabText())),
|
|
21
|
+
React__default.createElement(Tabs.Panel, { value: "signIn", "data-amplify-router-content": "" },
|
|
22
|
+
React__default.createElement(SignIn, null)),
|
|
23
|
+
React__default.createElement(Tabs.Panel, { value: "signUp", "data-amplify-router-content": "" },
|
|
24
|
+
React__default.createElement(SignUp, null))))));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { SignInSignUpTabs };
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { authenticatorTextUtil } from '@aws-amplify/ui';
|
|
3
|
+
import { useAuthenticator } from '@aws-amplify/ui-react-core';
|
|
4
|
+
import { Button } from '../../../primitives/Button/Button.mjs';
|
|
5
|
+
import { Flex } from '../../../primitives/Flex/Flex.mjs';
|
|
6
|
+
|
|
7
|
+
const { getSubmitText, getSubmittingText } = authenticatorTextUtil;
|
|
8
|
+
const TwoButtonSubmitFooter = (props) => {
|
|
9
|
+
const { cancelButtonSendType, cancelButtonText, submitButtonText } = props;
|
|
10
|
+
const { isPending, resendCode, skipVerification, toSignIn } = useAuthenticator((context) => [context.isPending]);
|
|
11
|
+
const onClick = () => {
|
|
12
|
+
switch (cancelButtonSendType) {
|
|
13
|
+
case 'SKIP':
|
|
14
|
+
skipVerification();
|
|
15
|
+
break;
|
|
16
|
+
case 'RESEND':
|
|
17
|
+
resendCode();
|
|
18
|
+
break;
|
|
19
|
+
case 'SIGN_IN':
|
|
20
|
+
toSignIn();
|
|
21
|
+
break;
|
|
22
|
+
default:
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const defaultSubmitText = isPending ? (React__default.createElement(React__default.Fragment, null,
|
|
27
|
+
getSubmittingText(),
|
|
28
|
+
"\u2026")) : (React__default.createElement(React__default.Fragment, null, getSubmitText()));
|
|
29
|
+
const submitText = submitButtonText ?? defaultSubmitText;
|
|
30
|
+
return (React__default.createElement(Flex, { direction: "column" },
|
|
31
|
+
React__default.createElement(Button, { fontWeight: "normal", variation: "primary", isDisabled: isPending, type: "submit" }, submitText),
|
|
32
|
+
React__default.createElement(Button, { onClick: onClick, type: "button", variation: "link", fontWeight: "normal", size: "small" }, cancelButtonText)));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { TwoButtonSubmitFooter };
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { Authenticator } from './Authenticator.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* [📖 Docs](https://ui.docs.amplify.aws/react/connected-components/authenticator)
|
|
6
|
+
*/
|
|
7
|
+
function withAuthenticator(Component, options = {}) {
|
|
8
|
+
const { variation = 'modal' } = options;
|
|
9
|
+
return function WrappedWithAuthenticator(props) {
|
|
10
|
+
return (React__default.createElement(Authenticator, { variation: variation, ...options }, (withAuthenticatorProps) => (React__default.createElement(Component, { ...props, ...withAuthenticatorProps }))));
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { withAuthenticator };
|