@aws-amplify/ui-react 6.5.0 → 6.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Field-4b189104.js → Field-CIQvkMkM.js} +25 -106
- package/dist/{ThemeStyle-1fee4302.js → ThemeStyle-CgfvQJ7V.js} +10 -13
- package/dist/esm/components/ThemeProvider/ComponentStyle.mjs +6 -8
- package/dist/esm/components/ThemeProvider/GlobalStyle.mjs +18 -0
- package/dist/esm/components/ThemeProvider/Style.mjs +6 -8
- package/dist/esm/components/ThemeProvider/ThemeStyle.mjs +6 -8
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/primitives/Accordion/AccordionTrigger.mjs +2 -2
- package/dist/esm/primitives/DropZone/DropZone.mjs +1 -1
- package/dist/esm/primitives/Tabs/TabsItem.mjs +2 -2
- package/dist/esm/primitives/shared/responsive/getMediaQueries.mjs +1 -0
- package/dist/esm/primitives/shared/responsive/useBreakpoint.mjs +1 -0
- package/dist/esm/server.mjs +1 -0
- package/dist/esm/version.mjs +1 -1
- package/dist/index.js +295 -297
- package/dist/internal.js +6 -7
- package/dist/server.js +23 -11
- package/dist/types/components/ThemeProvider/ComponentStyle.d.ts +6 -4
- package/dist/types/components/ThemeProvider/GlobalStyle.d.ts +20 -0
- package/dist/types/components/ThemeProvider/Style.d.ts +6 -4
- package/dist/types/components/ThemeProvider/ThemeStyle.d.ts +6 -4
- package/dist/types/internal.d.ts +1 -1
- package/dist/types/primitives/DropZone/DropZoneProvider.d.ts +1 -1
- package/dist/types/primitives/DropZone/types.d.ts +2 -17
- package/dist/types/primitives/shared/responsive/utils.d.ts +1 -1
- package/dist/types/server.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +6 -5
- package/dist/esm/primitives/DropZone/filterAllowedFiles.mjs +0 -34
- package/dist/esm/primitives/DropZone/useDropZone.mjs +0 -65
- package/dist/primitiveWithForwardRef-7e929242.js +0 -36
- package/dist/types/primitives/Card/__test__/Card.test.d.ts +0 -1
- package/dist/types/primitives/DropZone/filterAllowedFiles.d.ts +0 -10
- package/dist/types/primitives/DropZone/useDropZone.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -6,20 +6,19 @@ var React = require('react');
|
|
|
6
6
|
var isEqual = require('lodash/isEqual.js');
|
|
7
7
|
var uiReactCore = require('@aws-amplify/ui-react-core');
|
|
8
8
|
var ui = require('@aws-amplify/ui');
|
|
9
|
-
var Field = require('./Field-
|
|
9
|
+
var Field = require('./Field-CIQvkMkM.js');
|
|
10
10
|
require('aws-amplify/storage');
|
|
11
|
-
var primitiveWithForwardRef = require('./primitiveWithForwardRef-7e929242.js');
|
|
12
11
|
var debounce = require('lodash/debounce.js');
|
|
13
12
|
var Dropdown = require('@radix-ui/react-dropdown-menu');
|
|
14
13
|
var RadixSlider = require('@radix-ui/react-slider');
|
|
15
14
|
var QRCode = require('qrcode');
|
|
16
15
|
var utils = require('aws-amplify/utils');
|
|
17
16
|
var RadixDirection = require('@radix-ui/react-direction');
|
|
18
|
-
var ThemeStyle = require('./ThemeStyle-
|
|
17
|
+
var ThemeStyle = require('./ThemeStyle-CgfvQJ7V.js');
|
|
19
18
|
require('@aws-amplify/core');
|
|
20
19
|
require('aws-amplify/auth');
|
|
21
20
|
|
|
22
|
-
function
|
|
21
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
22
|
|
|
24
23
|
function _interopNamespace(e) {
|
|
25
24
|
if (e && e.__esModule) return e;
|
|
@@ -40,12 +39,11 @@ function _interopNamespace(e) {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
42
|
+
var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
|
|
43
|
+
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
46
44
|
var Dropdown__namespace = /*#__PURE__*/_interopNamespace(Dropdown);
|
|
47
45
|
var RadixSlider__namespace = /*#__PURE__*/_interopNamespace(RadixSlider);
|
|
48
|
-
var QRCode__default = /*#__PURE__*/
|
|
46
|
+
var QRCode__default = /*#__PURE__*/_interopDefault(QRCode);
|
|
49
47
|
var RadixDirection__namespace = /*#__PURE__*/_interopNamespace(RadixDirection);
|
|
50
48
|
|
|
51
49
|
/**
|
|
@@ -93,13 +91,13 @@ const AlertPrimitive = ({ buttonRef, children, className, dismissButtonLabel = F
|
|
|
93
91
|
/**
|
|
94
92
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/alert)
|
|
95
93
|
*/
|
|
96
|
-
const Alert =
|
|
94
|
+
const Alert = Field.primitiveWithForwardRef(AlertPrimitive);
|
|
97
95
|
Alert.displayName = 'Alert';
|
|
98
96
|
|
|
99
97
|
const AutocompleteOptionPrimitive = ({ children, className, isActive, ...rest }, ref) => {
|
|
100
98
|
return (React__namespace.createElement(Field.View, { "aria-selected": isActive, as: "li", role: "option", className: ui.classNames(ui.ComponentClassName.AutocompleteMenuOption, ui.classNameModifierByFlag(ui.ComponentClassName.AutocompleteMenuOption, 'active', isActive), className), ref: ref, ...rest }, children));
|
|
101
99
|
};
|
|
102
|
-
const AutocompleteOption =
|
|
100
|
+
const AutocompleteOption = Field.primitiveWithForwardRef(AutocompleteOptionPrimitive);
|
|
103
101
|
AutocompleteOption.displayName = 'AutocompleteOption';
|
|
104
102
|
|
|
105
103
|
/**
|
|
@@ -141,7 +139,7 @@ const ScrollViewPrimitive = ({ children, className, orientation, autoScroll, ...
|
|
|
141
139
|
/**
|
|
142
140
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/scrollview)
|
|
143
141
|
*/
|
|
144
|
-
const ScrollView =
|
|
142
|
+
const ScrollView = Field.primitiveWithForwardRef(ScrollViewPrimitive);
|
|
145
143
|
ScrollView.displayName = 'ScrollView';
|
|
146
144
|
|
|
147
145
|
const MenuHeader = ({ children }) => {
|
|
@@ -168,7 +166,7 @@ const AutocompleteMenuPrimitive = ({ ariaLabel, children, Header = null, Footer
|
|
|
168
166
|
children.length > 0 ? (React__namespace.createElement(ScrollView, { as: "ul", ariaLabel: ariaLabel, className: ui.ComponentClassName.AutocompleteMenuOptions, id: listboxId, role: "listbox" }, children)) : (React__namespace.createElement(MenuEmpty, null, Empty)),
|
|
169
167
|
React__namespace.createElement(MenuFooter, null, Footer)))));
|
|
170
168
|
};
|
|
171
|
-
const AutocompleteMenu =
|
|
169
|
+
const AutocompleteMenu = Field.primitiveWithForwardRef(AutocompleteMenuPrimitive);
|
|
172
170
|
AutocompleteMenu.displayName = 'AutocompleteMenu';
|
|
173
171
|
|
|
174
172
|
// Source: https://github.com/radix-ui/primitives/blob/7ae63b6cce6ea53ea5d65b6d411894c004b38f47/packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
@@ -411,7 +409,7 @@ const HighlightMatchPrimitive = ({ children, className, query, testId, ...rest }
|
|
|
411
409
|
/**
|
|
412
410
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/highlightmatch)
|
|
413
411
|
*/
|
|
414
|
-
const HighlightMatch =
|
|
412
|
+
const HighlightMatch = Field.primitiveWithForwardRef(HighlightMatchPrimitive);
|
|
415
413
|
HighlightMatch.displayName = 'HighlightMatch';
|
|
416
414
|
|
|
417
415
|
const ariaLabelText = Field.ComponentText.SearchField.searchButtonLabel;
|
|
@@ -419,7 +417,7 @@ const SearchFieldButtonPrimitive = ({ size, ...props }, ref) => {
|
|
|
419
417
|
const icons = Field.useIcons('searchField');
|
|
420
418
|
return (React__namespace.createElement(Field.FieldGroupIconButton, { ariaLabel: ariaLabelText, className: ui.ComponentClassName.SearchFieldSearch, size: size, ref: ref, type: "submit", ...props }, icons?.search ?? React__namespace.createElement(Field.IconSearch, null)));
|
|
421
419
|
};
|
|
422
|
-
const SearchFieldButton =
|
|
420
|
+
const SearchFieldButton = Field.primitiveWithForwardRef(SearchFieldButtonPrimitive);
|
|
423
421
|
SearchFieldButton.displayName = 'SearchFieldButton';
|
|
424
422
|
|
|
425
423
|
const FieldGroupPrimitive = ({ children, className, innerEndComponent, innerStartComponent, orientation = 'horizontal', outerEndComponent, outerStartComponent, variation, ...rest }, ref) => {
|
|
@@ -441,7 +439,7 @@ const FieldGroupPrimitive = ({ children, className, innerEndComponent, innerStar
|
|
|
441
439
|
innerEndComponent && (React__namespace.createElement(Field.View, { className: ui.ComponentClassName.FieldGroupInnerEnd }, innerEndComponent))),
|
|
442
440
|
outerEndComponent && (React__namespace.createElement(Field.View, { className: ui.classNames(ui.ComponentClassName.FieldGroupOuterEnd, ui.classNameModifier(ui.ComponentClassName.FieldGroupOuterEnd, variation)) }, outerEndComponent))));
|
|
443
441
|
};
|
|
444
|
-
const FieldGroup =
|
|
442
|
+
const FieldGroup = Field.primitiveWithForwardRef(FieldGroupPrimitive);
|
|
445
443
|
FieldGroup.displayName = 'FieldGroup';
|
|
446
444
|
|
|
447
445
|
const InputPrimitive = ({ autoComplete, checked, className, defaultChecked, defaultValue, id, isDisabled, isReadOnly, isRequired, size, type = 'text', hasError = false, value, variation, ...rest }, ref) => {
|
|
@@ -449,7 +447,7 @@ const InputPrimitive = ({ autoComplete, checked, className, defaultChecked, defa
|
|
|
449
447
|
const { isFieldsetDisabled } = Field.useFieldset();
|
|
450
448
|
return (React__namespace.createElement(Field.View, { "aria-invalid": hasError, as: "input", autoComplete: autoComplete, checked: checked, className: componentClasses, defaultChecked: defaultChecked, defaultValue: defaultValue, isDisabled: isFieldsetDisabled ? isFieldsetDisabled : isDisabled, id: id, readOnly: isReadOnly, ref: ref, required: isRequired, type: type, value: value, ...rest }));
|
|
451
449
|
};
|
|
452
|
-
const Input =
|
|
450
|
+
const Input = Field.primitiveWithForwardRef(InputPrimitive);
|
|
453
451
|
Input.displayName = 'Input';
|
|
454
452
|
|
|
455
453
|
const isStyleKey = (prop) => {
|
|
@@ -525,7 +523,7 @@ const TextFieldPrimitive = (props, ref) => {
|
|
|
525
523
|
/**
|
|
526
524
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/textfield)
|
|
527
525
|
*/
|
|
528
|
-
const TextField =
|
|
526
|
+
const TextField = Field.primitiveWithForwardRef(TextFieldPrimitive);
|
|
529
527
|
TextField.displayName = 'TextField';
|
|
530
528
|
|
|
531
529
|
const DEFAULT_KEYS = new Set([Field.ESCAPE_KEY, Field.ENTER_KEY]);
|
|
@@ -603,7 +601,7 @@ const SearchFieldPrimitive = ({ autoComplete = 'off', className, isDisabled, cle
|
|
|
603
601
|
/**
|
|
604
602
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/searchfield)
|
|
605
603
|
*/
|
|
606
|
-
const SearchField =
|
|
604
|
+
const SearchField = Field.primitiveWithForwardRef(SearchFieldPrimitive);
|
|
607
605
|
SearchField.displayName = 'SearchField';
|
|
608
606
|
|
|
609
607
|
const AutocompletePrimitive = ({ className, defaultValue, value, isLoading = false, menuSlots = {}, options, optionFilter, onBlur, onChange, onClear, onClick, onSelect, onSubmit, renderOption, testId, ...rest }, ref) => {
|
|
@@ -659,14 +657,14 @@ const AutocompletePrimitive = ({ className, defaultValue, value, isLoading = fal
|
|
|
659
657
|
/**
|
|
660
658
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/autocomplete)
|
|
661
659
|
*/
|
|
662
|
-
const Autocomplete =
|
|
660
|
+
const Autocomplete = Field.primitiveWithForwardRef(AutocompletePrimitive);
|
|
663
661
|
Autocomplete.displayName = 'Autocomplete';
|
|
664
662
|
|
|
665
663
|
const ImagePrimitive = ({ className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: "img", ref: ref, className: ui.classNames(ui.ComponentClassName.Image, className), ...rest }));
|
|
666
664
|
/**
|
|
667
665
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/image)
|
|
668
666
|
*/
|
|
669
|
-
const Image =
|
|
667
|
+
const Image = Field.primitiveWithForwardRef(ImagePrimitive);
|
|
670
668
|
Image.displayName = 'Image';
|
|
671
669
|
|
|
672
670
|
const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src, alt, isLoading, ...rest }, ref) => {
|
|
@@ -680,7 +678,7 @@ const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src
|
|
|
680
678
|
/**
|
|
681
679
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/avatar)
|
|
682
680
|
*/
|
|
683
|
-
const Avatar =
|
|
681
|
+
const Avatar = Field.primitiveWithForwardRef(AvatarPrimitive);
|
|
684
682
|
Avatar.displayName = 'Avatar';
|
|
685
683
|
|
|
686
684
|
const BadgePrimitive = ({ className, children, variation, size, ...rest }, ref) => {
|
|
@@ -690,7 +688,7 @@ const BadgePrimitive = ({ className, children, variation, size, ...rest }, ref)
|
|
|
690
688
|
/**
|
|
691
689
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/badge)
|
|
692
690
|
*/
|
|
693
|
-
const Badge =
|
|
691
|
+
const Badge = Field.primitiveWithForwardRef(BadgePrimitive);
|
|
694
692
|
Badge.displayName = 'Badge';
|
|
695
693
|
|
|
696
694
|
const BreadcrumbItemPrimitive = ({ className, children, as = 'li', ...rest }, ref) => {
|
|
@@ -700,7 +698,7 @@ const BreadcrumbItemPrimitive = ({ className, children, as = 'li', ...rest }, re
|
|
|
700
698
|
/**
|
|
701
699
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
|
|
702
700
|
*/
|
|
703
|
-
const BreadcrumbItem =
|
|
701
|
+
const BreadcrumbItem = Field.primitiveWithForwardRef(BreadcrumbItemPrimitive);
|
|
704
702
|
BreadcrumbItem.displayName = 'Breadcrumbs.Item';
|
|
705
703
|
|
|
706
704
|
const LinkPrimitive = ({ as = 'a', children, className, isExternal, ...rest }, ref) => {
|
|
@@ -709,7 +707,7 @@ const LinkPrimitive = ({ as = 'a', children, className, isExternal, ...rest }, r
|
|
|
709
707
|
/**
|
|
710
708
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/link)
|
|
711
709
|
*/
|
|
712
|
-
const Link =
|
|
710
|
+
const Link = Field.primitiveWithForwardRef(LinkPrimitive);
|
|
713
711
|
Link.displayName = 'Link';
|
|
714
712
|
|
|
715
713
|
const BreadcrumbLinkPrimitive = ({ className, children, href, isCurrent, ...rest }, ref) => {
|
|
@@ -726,7 +724,7 @@ const BreadcrumbLinkPrimitive = ({ className, children, href, isCurrent, ...rest
|
|
|
726
724
|
/**
|
|
727
725
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
|
|
728
726
|
*/
|
|
729
|
-
const BreadcrumbLink =
|
|
727
|
+
const BreadcrumbLink = Field.primitiveWithForwardRef(BreadcrumbLinkPrimitive);
|
|
730
728
|
BreadcrumbLink.displayName = 'Breadcrumbs.Link';
|
|
731
729
|
|
|
732
730
|
const BreadcrumbSeparatorPrimitive = ({ className, children = '/', as = 'span', ...rest }, ref) => {
|
|
@@ -736,7 +734,7 @@ const BreadcrumbSeparatorPrimitive = ({ className, children = '/', as = 'span',
|
|
|
736
734
|
/**
|
|
737
735
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
|
|
738
736
|
*/
|
|
739
|
-
const BreadcrumbSeparator =
|
|
737
|
+
const BreadcrumbSeparator = Field.primitiveWithForwardRef(BreadcrumbSeparatorPrimitive);
|
|
740
738
|
BreadcrumbSeparator.displayName = 'Breadcrumbs.Separator';
|
|
741
739
|
|
|
742
740
|
const BreadcrumbContainerPrimitive = ({ className, children, ...rest }, ref) => {
|
|
@@ -748,7 +746,7 @@ const BreadcrumbContainerPrimitive = ({ className, children, ...rest }, ref) =>
|
|
|
748
746
|
/**
|
|
749
747
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
|
|
750
748
|
*/
|
|
751
|
-
const BreadcrumbContainer =
|
|
749
|
+
const BreadcrumbContainer = Field.primitiveWithForwardRef(BreadcrumbContainerPrimitive);
|
|
752
750
|
BreadcrumbContainer.displayName = 'Breadcrumbs.Container';
|
|
753
751
|
|
|
754
752
|
const BreadcrumbsPrimitive = ({ className, items, separator = React__namespace.createElement(BreadcrumbSeparator, null), ...rest }, ref) => {
|
|
@@ -763,7 +761,7 @@ const BreadcrumbsPrimitive = ({ className, items, separator = React__namespace.c
|
|
|
763
761
|
/**
|
|
764
762
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
|
|
765
763
|
*/
|
|
766
|
-
const Breadcrumbs = Object.assign(
|
|
764
|
+
const Breadcrumbs = Object.assign(Field.primitiveWithForwardRef(BreadcrumbsPrimitive), {
|
|
767
765
|
Item: BreadcrumbItem,
|
|
768
766
|
Link: BreadcrumbLink,
|
|
769
767
|
Separator: BreadcrumbSeparator,
|
|
@@ -781,7 +779,7 @@ const ButtonGroupPrimitive = ({ className, children, isDisabled: _isDisabled = f
|
|
|
781
779
|
/**
|
|
782
780
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/button#buttongroup)
|
|
783
781
|
*/
|
|
784
|
-
const ButtonGroup =
|
|
782
|
+
const ButtonGroup = Field.primitiveWithForwardRef(ButtonGroupPrimitive);
|
|
785
783
|
ButtonGroup.displayName = 'ButtonGroup';
|
|
786
784
|
|
|
787
785
|
const CardPrimitive = ({ className, children, variation, ...rest }, ref) => {
|
|
@@ -790,14 +788,14 @@ const CardPrimitive = ({ className, children, variation, ...rest }, ref) => {
|
|
|
790
788
|
/**
|
|
791
789
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/card)
|
|
792
790
|
*/
|
|
793
|
-
const Card =
|
|
791
|
+
const Card = Field.primitiveWithForwardRef(CardPrimitive);
|
|
794
792
|
Card.displayName = 'Card';
|
|
795
793
|
|
|
796
794
|
const VisuallyHiddenPrimitive = ({ as = 'span', children, className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: as, className: ui.classNames(ui.ComponentClassName.VisuallyHidden, className), ref: ref, ...rest }, children));
|
|
797
795
|
/**
|
|
798
796
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/visuallyhidden)
|
|
799
797
|
*/
|
|
800
|
-
const VisuallyHidden =
|
|
798
|
+
const VisuallyHidden = Field.primitiveWithForwardRef(VisuallyHiddenPrimitive);
|
|
801
799
|
VisuallyHidden.displayName = 'VisuallyHidden';
|
|
802
800
|
|
|
803
801
|
const CheckboxPrimitive = ({ checked: controlledChecked, className, defaultChecked, hasError, isDisabled, isIndeterminate, label, labelHidden, labelPosition, onBlur: _onBlur, onFocus: _onFocus, onChange: _onChange, testId, inputStyles, ..._rest }, ref) => {
|
|
@@ -862,7 +860,7 @@ const CheckboxPrimitive = ({ checked: controlledChecked, className, defaultCheck
|
|
|
862
860
|
}), "data-disabled": shouldBeDisabled, testId: labelTestId }, label)),
|
|
863
861
|
React__namespace.createElement(Field.Flex, { "aria-hidden": "true", as: "span", className: flexClasses, "data-checked": checked, "data-disabled": shouldBeDisabled, "data-focus": focused, "data-error": hasError, testId: buttonTestId, ...inputStyles }, isIndeterminate ? indeterminateIcon : checkedIcon)));
|
|
864
862
|
};
|
|
865
|
-
const Checkbox =
|
|
863
|
+
const Checkbox = Field.primitiveWithForwardRef(CheckboxPrimitive);
|
|
866
864
|
Checkbox.displayName = 'Checkbox';
|
|
867
865
|
|
|
868
866
|
const CheckboxFieldPrimitive = ({ className, errorMessage, hasError = false, labelHidden = false, labelPosition, testId, size, ...rest }, ref) => {
|
|
@@ -874,14 +872,14 @@ const CheckboxFieldPrimitive = ({ className, errorMessage, hasError = false, lab
|
|
|
874
872
|
/**
|
|
875
873
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/checkboxfield)
|
|
876
874
|
*/
|
|
877
|
-
const CheckboxField =
|
|
875
|
+
const CheckboxField = Field.primitiveWithForwardRef(CheckboxFieldPrimitive);
|
|
878
876
|
CheckboxField.displayName = 'CheckboxField';
|
|
879
877
|
|
|
880
878
|
const GridPrimitive = ({ className, children, ...rest }, ref) => (React__namespace.createElement(Field.View, { className: ui.classNames(ui.ComponentClassName.Grid, className), ref: ref, ...rest }, children));
|
|
881
879
|
/**
|
|
882
880
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/grid)
|
|
883
881
|
*/
|
|
884
|
-
const Grid =
|
|
882
|
+
const Grid = Field.primitiveWithForwardRef(GridPrimitive);
|
|
885
883
|
Grid.displayName = 'Grid';
|
|
886
884
|
|
|
887
885
|
const ELLIPSIS = '...';
|
|
@@ -1039,7 +1037,7 @@ const PaginationPrimitive = ({ className, currentPage = 1, totalPages, hasMorePa
|
|
|
1039
1037
|
/**
|
|
1040
1038
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/pagination)
|
|
1041
1039
|
*/
|
|
1042
|
-
const Pagination =
|
|
1040
|
+
const Pagination = Field.primitiveWithForwardRef(PaginationPrimitive);
|
|
1043
1041
|
Pagination.displayName = 'Pagination';
|
|
1044
1042
|
|
|
1045
1043
|
const usePagination = (props) => {
|
|
@@ -1158,7 +1156,7 @@ const DividerPrimitive = ({ className, orientation = 'horizontal', size, label,
|
|
|
1158
1156
|
/**
|
|
1159
1157
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/divider)
|
|
1160
1158
|
*/
|
|
1161
|
-
const Divider =
|
|
1159
|
+
const Divider = Field.primitiveWithForwardRef(DividerPrimitive);
|
|
1162
1160
|
Divider.displayName = 'Divider';
|
|
1163
1161
|
|
|
1164
1162
|
const DropZoneContext = React__namespace.createContext('inactive');
|
|
@@ -1167,14 +1165,14 @@ const DropZoneProvider = ({ value, children, }) => {
|
|
|
1167
1165
|
};
|
|
1168
1166
|
|
|
1169
1167
|
const Container = ({ className, children, testId, isDisabled, onDragEnter, onDragLeave, onDragOver, onDragStart, onDrop, ...rest }, ref) => {
|
|
1170
|
-
const dragState =
|
|
1168
|
+
const dragState = React__namespace["default"].useContext(DropZoneContext);
|
|
1171
1169
|
// Don't add drag event handlers if it is disabled.
|
|
1172
1170
|
const dragProps = isDisabled
|
|
1173
1171
|
? {}
|
|
1174
1172
|
: { onDragEnter, onDragLeave, onDragOver, onDragStart, onDrop };
|
|
1175
|
-
return (
|
|
1173
|
+
return (React__namespace["default"].createElement(Field.View, { ...rest, ...dragProps, isDisabled: isDisabled, className: ui.classNames(className, ui.classNameModifierByFlag(ui.ComponentClassName.DropZone, 'rejected', dragState === 'reject'), ui.classNameModifierByFlag(ui.ComponentClassName.DropZone, 'accepted', dragState === 'accept'), ui.classNameModifierByFlag(ui.ComponentClassName.DropZone, 'disabled', isDisabled), ui.ComponentClassName.DropZone), "data-testid": testId, ref: ref }, children));
|
|
1176
1174
|
};
|
|
1177
|
-
const DropZoneContainer =
|
|
1175
|
+
const DropZoneContainer = Field.primitiveWithForwardRef(Container);
|
|
1178
1176
|
DropZoneContainer.displayName = 'DropZoneContainer';
|
|
1179
1177
|
|
|
1180
1178
|
/**
|
|
@@ -1213,7 +1211,7 @@ const Default = ({ children, }) => {
|
|
|
1213
1211
|
};
|
|
1214
1212
|
|
|
1215
1213
|
const DropZonePrimitive = ({ children, testId, isDisabled, acceptedFileTypes, onDropComplete, ...rest }, ref) => {
|
|
1216
|
-
const { dragState, onDragEnter, onDragLeave, onDragOver, onDragStart, onDrop, } =
|
|
1214
|
+
const { dragState, onDragEnter, onDragLeave, onDragOver, onDragStart, onDrop, } = uiReactCore.useDropZone({
|
|
1217
1215
|
acceptedFileTypes,
|
|
1218
1216
|
onDropComplete,
|
|
1219
1217
|
...rest,
|
|
@@ -1224,7 +1222,7 @@ const DropZonePrimitive = ({ children, testId, isDisabled, acceptedFileTypes, on
|
|
|
1224
1222
|
/**
|
|
1225
1223
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/dropzone)
|
|
1226
1224
|
*/
|
|
1227
|
-
const DropZone = Object.assign(
|
|
1225
|
+
const DropZone = Object.assign(Field.primitiveWithForwardRef(DropZonePrimitive), {
|
|
1228
1226
|
Accepted,
|
|
1229
1227
|
Rejected,
|
|
1230
1228
|
Default,
|
|
@@ -1243,7 +1241,7 @@ const AccordionItemPrimitive = ({ children, className, value, as = 'details', ..
|
|
|
1243
1241
|
/**
|
|
1244
1242
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
|
|
1245
1243
|
*/
|
|
1246
|
-
const AccordionItem =
|
|
1244
|
+
const AccordionItem = Field.primitiveWithForwardRef(AccordionItemPrimitive);
|
|
1247
1245
|
AccordionItem.displayName = 'AccordionItem';
|
|
1248
1246
|
|
|
1249
1247
|
const AccordionContentPrimitive = ({ className, children, ...rest }, ref) => {
|
|
@@ -1252,14 +1250,14 @@ const AccordionContentPrimitive = ({ className, children, ...rest }, ref) => {
|
|
|
1252
1250
|
/**
|
|
1253
1251
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
|
|
1254
1252
|
*/
|
|
1255
|
-
const AccordionContent =
|
|
1253
|
+
const AccordionContent = Field.primitiveWithForwardRef(AccordionContentPrimitive);
|
|
1256
1254
|
AccordionContent.displayName = 'Accordion.Content';
|
|
1257
1255
|
|
|
1258
1256
|
const AccordionTriggerPrimitive = ({ children, className, ...rest }, ref) => {
|
|
1259
1257
|
const context = React__namespace.useContext(AccordionContext);
|
|
1260
1258
|
const value = React__namespace.useContext(AccordionItemContext);
|
|
1261
1259
|
const handleOnClick = (e) => {
|
|
1262
|
-
if (ui.
|
|
1260
|
+
if (ui.isFunction(rest.onClick)) {
|
|
1263
1261
|
rest.onClick(e);
|
|
1264
1262
|
}
|
|
1265
1263
|
if (context?.setValue && value) {
|
|
@@ -1272,7 +1270,7 @@ const AccordionTriggerPrimitive = ({ children, className, ...rest }, ref) => {
|
|
|
1272
1270
|
/**
|
|
1273
1271
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
|
|
1274
1272
|
*/
|
|
1275
|
-
const AccordionTrigger =
|
|
1273
|
+
const AccordionTrigger = Field.primitiveWithForwardRef(AccordionTriggerPrimitive);
|
|
1276
1274
|
AccordionTrigger.displayName = 'Accordion.Trigger';
|
|
1277
1275
|
|
|
1278
1276
|
const AccordionIconPrimitive = ({ className, as = 'span', ...rest }, ref) => {
|
|
@@ -1282,7 +1280,7 @@ const AccordionIconPrimitive = ({ className, as = 'span', ...rest }, ref) => {
|
|
|
1282
1280
|
/**
|
|
1283
1281
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
|
|
1284
1282
|
*/
|
|
1285
|
-
const AccordionIcon =
|
|
1283
|
+
const AccordionIcon = Field.primitiveWithForwardRef(AccordionIconPrimitive);
|
|
1286
1284
|
AccordionIcon.displayName = 'Accordion.Icon';
|
|
1287
1285
|
|
|
1288
1286
|
const AccordionContainerPrimitive = ({ children, className, defaultValue, allowMultiple, preventCollapse, onValueChange, testId, value: controlledValue, ...rest }, ref) => {
|
|
@@ -1324,7 +1322,7 @@ const AccordionContainerPrimitive = ({ children, className, defaultValue, allowM
|
|
|
1324
1322
|
/**
|
|
1325
1323
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
|
|
1326
1324
|
*/
|
|
1327
|
-
const AccordionContainer =
|
|
1325
|
+
const AccordionContainer = Field.primitiveWithForwardRef(AccordionContainerPrimitive);
|
|
1328
1326
|
AccordionContainer.displayName = 'Accordion.Container';
|
|
1329
1327
|
|
|
1330
1328
|
const AccordionPrimitive = ({ items, ...rest }, ref) => {
|
|
@@ -1337,7 +1335,7 @@ const AccordionPrimitive = ({ items, ...rest }, ref) => {
|
|
|
1337
1335
|
/**
|
|
1338
1336
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
|
|
1339
1337
|
*/
|
|
1340
|
-
const Accordion = Object.assign(
|
|
1338
|
+
const Accordion = Object.assign(Field.primitiveWithForwardRef(AccordionPrimitive), {
|
|
1341
1339
|
Container: AccordionContainer,
|
|
1342
1340
|
Content: AccordionContent,
|
|
1343
1341
|
Icon: AccordionIcon,
|
|
@@ -1367,7 +1365,7 @@ const FieldsetPrimitive = ({ children, className, isDisabled, legend, legendHidd
|
|
|
1367
1365
|
/**
|
|
1368
1366
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/fieldset)
|
|
1369
1367
|
*/
|
|
1370
|
-
const Fieldset =
|
|
1368
|
+
const Fieldset = Field.primitiveWithForwardRef(FieldsetPrimitive);
|
|
1371
1369
|
Fieldset.displayName = 'Fieldset';
|
|
1372
1370
|
|
|
1373
1371
|
const headingLevels = {
|
|
@@ -1382,7 +1380,7 @@ const HeadingPrimitive = ({ className, children, isTruncated, level = 6, ...rest
|
|
|
1382
1380
|
/**
|
|
1383
1381
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/heading)
|
|
1384
1382
|
*/
|
|
1385
|
-
const Heading =
|
|
1383
|
+
const Heading = Field.primitiveWithForwardRef(HeadingPrimitive);
|
|
1386
1384
|
Heading.displayName = 'Heading';
|
|
1387
1385
|
|
|
1388
1386
|
/**
|
|
@@ -1393,7 +1391,7 @@ const MenuButtonPrimitive = ({ ariaLabel, className, children, isDisabled = fals
|
|
|
1393
1391
|
const componentClasses = ui.classNames(ui.ComponentClassName.Button, ui.classNameModifier(ui.ComponentClassName.Button, size), ui.classNameModifier(ui.ComponentClassName.Button, variation), className);
|
|
1394
1392
|
return (React__namespace.createElement(Field.Button, { ref: ref, className: componentClasses, disabled: isDisabled || isLoading, isDisabled: isDisabled || isLoading, type: type, testId: testId, "aria-label": ariaLabel, style: propStyles, ...nonStyleProps }, children));
|
|
1395
1393
|
};
|
|
1396
|
-
const MenuButton =
|
|
1394
|
+
const MenuButton = Field.primitiveWithForwardRef(MenuButtonPrimitive);
|
|
1397
1395
|
MenuButton.displayName = 'MenuButton';
|
|
1398
1396
|
|
|
1399
1397
|
// Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
|
|
@@ -1411,7 +1409,7 @@ const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size,
|
|
|
1411
1409
|
/**
|
|
1412
1410
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
|
|
1413
1411
|
*/
|
|
1414
|
-
const Menu =
|
|
1412
|
+
const Menu = Field.primitiveWithForwardRef(MenuPrimitive);
|
|
1415
1413
|
Menu.displayName = 'Menu';
|
|
1416
1414
|
|
|
1417
1415
|
// Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
|
|
@@ -1426,13 +1424,13 @@ const MenuItemPrimitive = ({ children, className, ...rest }, ref) => {
|
|
|
1426
1424
|
React__namespace.createElement(MenuButton, { className: ui.classNames(ui.ComponentClassName.MenuItem, className), testId: MENU_ITEM_TEST_ID, ...rest, variation: "menu" // ensures `menu` variation is not overwritten
|
|
1427
1425
|
}, children)));
|
|
1428
1426
|
};
|
|
1429
|
-
const MenuItem =
|
|
1427
|
+
const MenuItem = Field.primitiveWithForwardRef(MenuItemPrimitive);
|
|
1430
1428
|
MenuItem.displayName = 'MenuItem';
|
|
1431
1429
|
|
|
1432
1430
|
const MessageHeadingPrimitive = ({ children, className, ...rest }, ref) => {
|
|
1433
1431
|
return (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.MessageHeading, className), ref: ref, ...rest }, children));
|
|
1434
1432
|
};
|
|
1435
|
-
const MessageHeading =
|
|
1433
|
+
const MessageHeading = Field.primitiveWithForwardRef(MessageHeadingPrimitive);
|
|
1436
1434
|
MessageHeading.displayName = 'MessageHeading';
|
|
1437
1435
|
|
|
1438
1436
|
const MessageContext = React__namespace.createContext({
|
|
@@ -1461,7 +1459,7 @@ const MessageIconPrimitive = ({ className, ...rest }, ref) => {
|
|
|
1461
1459
|
}
|
|
1462
1460
|
return icon ? (React__namespace.createElement(Field.View, { className: ui.classNames(ui.ComponentClassName.MessageIcon, className), "aria-hidden": "true", ref: ref, ...rest }, icon)) : null;
|
|
1463
1461
|
};
|
|
1464
|
-
const MessageIcon =
|
|
1462
|
+
const MessageIcon = Field.primitiveWithForwardRef(MessageIconPrimitive);
|
|
1465
1463
|
MessageIcon.displayName = 'MessageIcon';
|
|
1466
1464
|
|
|
1467
1465
|
const MessageDismissPrimitive = ({ onDismiss, dismissLabel, hasIcon = true, children, className, ...rest }, ref) => {
|
|
@@ -1477,13 +1475,13 @@ const MessageDismissPrimitive = ({ onDismiss, dismissLabel, hasIcon = true, chil
|
|
|
1477
1475
|
hasIcon ? icons?.close ?? React__namespace.createElement(Field.IconClose, { "aria-hidden": "true" }) : null,
|
|
1478
1476
|
children ? (children) : (React__namespace.createElement(VisuallyHidden, null, dismissLabel ? dismissLabel : Field.ComponentText.Message.dismissLabel))));
|
|
1479
1477
|
};
|
|
1480
|
-
const MessageDismiss =
|
|
1478
|
+
const MessageDismiss = Field.primitiveWithForwardRef(MessageDismissPrimitive);
|
|
1481
1479
|
MessageDismiss.displayName = 'MessageContent';
|
|
1482
1480
|
|
|
1483
1481
|
const MessageContentPrimitive = ({ children, className, ...rest }, ref) => {
|
|
1484
1482
|
return (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.MessageContent, className), ref: ref, ...rest }, children));
|
|
1485
1483
|
};
|
|
1486
|
-
const MessageContent =
|
|
1484
|
+
const MessageContent = Field.primitiveWithForwardRef(MessageContentPrimitive);
|
|
1487
1485
|
MessageContent.displayName = 'MessageContent';
|
|
1488
1486
|
|
|
1489
1487
|
const MessageContainerPrimitive = ({ children, className, colorTheme = 'neutral', variation = 'filled', ...rest }, ref) => {
|
|
@@ -1495,7 +1493,7 @@ const MessageContainerPrimitive = ({ children, className, colorTheme = 'neutral'
|
|
|
1495
1493
|
}), [colorTheme, dismissed]);
|
|
1496
1494
|
return (React__namespace.createElement(MessageContext.Provider, { value: value }, !dismissed ? (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.Message, ui.classNameModifier(ui.ComponentClassName.Message, variation), ui.classNameModifier(ui.ComponentClassName.Message, colorTheme), className), ref: ref, ...rest }, children)) : null));
|
|
1497
1495
|
};
|
|
1498
|
-
const MessageContainer =
|
|
1496
|
+
const MessageContainer = Field.primitiveWithForwardRef(MessageContainerPrimitive);
|
|
1499
1497
|
MessageContainer.displayName = 'MessageContainer';
|
|
1500
1498
|
|
|
1501
1499
|
const MessagePrimitive = ({ children, heading, dismissLabel, isDismissible, onDismiss, hasIcon = true, colorTheme = 'neutral', variation = 'filled', ...rest }, ref) => {
|
|
@@ -1509,7 +1507,7 @@ const MessagePrimitive = ({ children, heading, dismissLabel, isDismissible, onDi
|
|
|
1509
1507
|
/**
|
|
1510
1508
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/message)
|
|
1511
1509
|
*/
|
|
1512
|
-
const Message =
|
|
1510
|
+
const Message = Field.primitiveWithForwardRef(MessagePrimitive);
|
|
1513
1511
|
Message.displayName = 'Message';
|
|
1514
1512
|
|
|
1515
1513
|
const { passwordIsHidden, passwordIsShown, showPassword } = Field.ComponentText.PasswordField;
|
|
@@ -1525,7 +1523,7 @@ const ShowPasswordButtonPrimitive = ({ fieldType, passwordIsHiddenLabel = passwo
|
|
|
1525
1523
|
: passwordIsShownLabel),
|
|
1526
1524
|
icon));
|
|
1527
1525
|
};
|
|
1528
|
-
const ShowPasswordButton =
|
|
1526
|
+
const ShowPasswordButton = Field.primitiveWithForwardRef(ShowPasswordButtonPrimitive);
|
|
1529
1527
|
ShowPasswordButton.displayName = 'ShowPasswordButton';
|
|
1530
1528
|
|
|
1531
1529
|
const PasswordFieldPrimitive = ({ autoComplete = 'current-password', label, className, hideShowPassword = false, passwordIsHiddenLabel, passwordIsShownLabel, showPasswordButtonLabel, showPasswordButtonRef, size, hasError, ...rest }, ref) => {
|
|
@@ -1543,7 +1541,7 @@ const PasswordFieldPrimitive = ({ autoComplete = 'current-password', label, clas
|
|
|
1543
1541
|
/**
|
|
1544
1542
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/passwordfield)
|
|
1545
1543
|
*/
|
|
1546
|
-
const PasswordField =
|
|
1544
|
+
const PasswordField = Field.primitiveWithForwardRef(PasswordFieldPrimitive);
|
|
1547
1545
|
PasswordField.displayName = 'PasswordField';
|
|
1548
1546
|
|
|
1549
1547
|
const SelectPrimitive = ({ autoComplete, className, size, variation, value, defaultValue, hasError, icon, iconColor, children, placeholder, isDisabled, isRequired, isMultiple = false, selectSize = 1, ...rest }, ref) => {
|
|
@@ -1562,7 +1560,7 @@ const SelectPrimitive = ({ autoComplete, className, size, variation, value, defa
|
|
|
1562
1560
|
children),
|
|
1563
1561
|
isExpanded ? null : (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.SelectIcon, ui.classNameModifier(ui.ComponentClassName.SelectIcon, size)), color: iconColor, "aria-hidden": "true" }, icon ?? icons?.expand ?? React__namespace.createElement(Field.IconExpandMore, null)))));
|
|
1564
1562
|
};
|
|
1565
|
-
const Select =
|
|
1563
|
+
const Select = Field.primitiveWithForwardRef(SelectPrimitive);
|
|
1566
1564
|
Select.displayName = 'Select';
|
|
1567
1565
|
|
|
1568
1566
|
const selectFieldChildren = ({ children, options, }) => {
|
|
@@ -1596,7 +1594,7 @@ const SelectFieldPrimitive = (props, ref) => {
|
|
|
1596
1594
|
/**
|
|
1597
1595
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/selectfield)
|
|
1598
1596
|
*/
|
|
1599
|
-
const SelectField =
|
|
1597
|
+
const SelectField = Field.primitiveWithForwardRef(SelectFieldPrimitive);
|
|
1600
1598
|
SelectField.displayName = 'SelectField';
|
|
1601
1599
|
|
|
1602
1600
|
const DialCodeSelectPrimitive = ({ className, dialCodeList, isReadOnly, ...props }, ref) => {
|
|
@@ -1611,7 +1609,7 @@ const DialCodeSelectPrimitive = ({ className, dialCodeList, isReadOnly, ...props
|
|
|
1611
1609
|
*/
|
|
1612
1610
|
, { "aria-disabled": isReadOnly, autoComplete: "tel-country-code", className: ui.classNames(ui.ComponentClassName.CountryCodeSelect, ui.ComponentClassName.DialCodeSelect, className), labelHidden: true, ref: ref, ...props }, dialCodeOptions));
|
|
1613
1611
|
};
|
|
1614
|
-
const DialCodeSelect =
|
|
1612
|
+
const DialCodeSelect = Field.primitiveWithForwardRef(DialCodeSelectPrimitive);
|
|
1615
1613
|
DialCodeSelect.displayName = 'DialCodeSelect';
|
|
1616
1614
|
|
|
1617
1615
|
const PhoneNumberFieldPrimitive = ({ autoComplete = 'tel-national', className, defaultDialCode, dialCodeLabel = Field.ComponentText.PhoneNumberField.countryCodeLabel, dialCodeList, dialCodeName, dialCodeRef, hasError, isDisabled, isReadOnly, onDialCodeChange, onInput, size, variation, ...rest }, ref) => {
|
|
@@ -1620,7 +1618,7 @@ const PhoneNumberFieldPrimitive = ({ autoComplete = 'tel-national', className, d
|
|
|
1620
1618
|
/**
|
|
1621
1619
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/phonenumberfield)
|
|
1622
1620
|
*/
|
|
1623
|
-
const PhoneNumberField =
|
|
1621
|
+
const PhoneNumberField = Field.primitiveWithForwardRef(PhoneNumberFieldPrimitive);
|
|
1624
1622
|
PhoneNumberField.displayName = 'PhoneNumberField';
|
|
1625
1623
|
|
|
1626
1624
|
const PlaceholderPrimitive = ({ className, children, isLoaded, size, ...rest }, ref) => {
|
|
@@ -1632,11 +1630,11 @@ const PlaceholderPrimitive = ({ className, children, isLoaded, size, ...rest },
|
|
|
1632
1630
|
/**
|
|
1633
1631
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/placeholder)
|
|
1634
1632
|
*/
|
|
1635
|
-
const Placeholder =
|
|
1633
|
+
const Placeholder = Field.primitiveWithForwardRef(PlaceholderPrimitive);
|
|
1636
1634
|
Placeholder.displayName = 'Placeholder';
|
|
1637
1635
|
|
|
1638
1636
|
const defaultValue = { name: 'default' };
|
|
1639
|
-
const RadioGroupContext =
|
|
1637
|
+
const RadioGroupContext = React__namespace["default"].createContext(defaultValue);
|
|
1640
1638
|
const useRadioGroupContext = () => {
|
|
1641
1639
|
return React.useContext(RadioGroupContext);
|
|
1642
1640
|
};
|
|
@@ -1659,7 +1657,7 @@ const RadioPrimitive = ({ children, className, id, isDisabled = false, testId, v
|
|
|
1659
1657
|
React__namespace.createElement(Input, { checked: checked, className: ui.classNames(ui.ComponentClassName.VisuallyHidden, ui.ComponentClassName.RadioInput), defaultChecked: defaultChecked, hasError: hasError, id: id, isDisabled: shouldBeDisabled, isReadOnly: isReadOnly, isRequired: isRequired, onChange: onChange, ref: ref, type: "radio", name: name, value: value, ...rest }),
|
|
1660
1658
|
React__namespace.createElement(Field.Flex, { "aria-hidden": "true", as: "span", className: ui.classNames(ui.ComponentClassName.RadioButton, ui.classNameModifier(ui.ComponentClassName.RadioButton, size)), testId: testId })));
|
|
1661
1659
|
};
|
|
1662
|
-
const Radio =
|
|
1660
|
+
const Radio = Field.primitiveWithForwardRef(RadioPrimitive);
|
|
1663
1661
|
Radio.displayName = 'Radio';
|
|
1664
1662
|
|
|
1665
1663
|
const RadioGroupFieldPrimitive = ({ children, className, defaultValue, descriptiveText, errorMessage, hasError = false, id, isDisabled, isRequired, isReadOnly, legend, legendHidden = false, labelPosition, onChange, name, size, testId, value, variation, ...rest }, ref) => {
|
|
@@ -1705,7 +1703,7 @@ const RadioGroupFieldPrimitive = ({ children, className, defaultValue, descripti
|
|
|
1705
1703
|
/**
|
|
1706
1704
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/radiogroupfield)
|
|
1707
1705
|
*/
|
|
1708
|
-
const RadioGroupField =
|
|
1706
|
+
const RadioGroupField = Field.primitiveWithForwardRef(RadioGroupFieldPrimitive);
|
|
1709
1707
|
RadioGroupField.displayName = 'RadioGroupField';
|
|
1710
1708
|
|
|
1711
1709
|
const isIconFilled = (currentIconIndex, ratingValue) => {
|
|
@@ -1765,7 +1763,7 @@ const RatingPrimitive = ({ className, emptyColor, emptyIcon, fillColor, icon, ma
|
|
|
1765
1763
|
/**
|
|
1766
1764
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/rating)
|
|
1767
1765
|
*/
|
|
1768
|
-
const Rating =
|
|
1766
|
+
const Rating = Field.primitiveWithForwardRef(RatingPrimitive);
|
|
1769
1767
|
Rating.displayName = 'Rating';
|
|
1770
1768
|
|
|
1771
1769
|
// Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
|
|
@@ -1830,7 +1828,7 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
|
|
|
1830
1828
|
/**
|
|
1831
1829
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/sliderfield)
|
|
1832
1830
|
*/
|
|
1833
|
-
const SliderField =
|
|
1831
|
+
const SliderField = Field.primitiveWithForwardRef(SliderFieldPrimitive);
|
|
1834
1832
|
SliderField.displayName = 'SliderField';
|
|
1835
1833
|
|
|
1836
1834
|
const getCorrectSteppingValue = ({ max, min, step, value, }) => {
|
|
@@ -1980,7 +1978,7 @@ const StepperFieldPrimitive = (props, ref) => {
|
|
|
1980
1978
|
/**
|
|
1981
1979
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/stepperfield)
|
|
1982
1980
|
*/
|
|
1983
|
-
const StepperField =
|
|
1981
|
+
const StepperField = Field.primitiveWithForwardRef(StepperFieldPrimitive);
|
|
1984
1982
|
StepperField.displayName = 'StepperField';
|
|
1985
1983
|
|
|
1986
1984
|
const useSwitch = (props) => {
|
|
@@ -2037,7 +2035,7 @@ const SwitchFieldPrimitive = ({ className, defaultChecked, id, isChecked, isDisa
|
|
|
2037
2035
|
/**
|
|
2038
2036
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/switchfield)
|
|
2039
2037
|
*/
|
|
2040
|
-
const SwitchField =
|
|
2038
|
+
const SwitchField = Field.primitiveWithForwardRef(SwitchFieldPrimitive);
|
|
2041
2039
|
SwitchField.displayName = 'SwitchField';
|
|
2042
2040
|
|
|
2043
2041
|
const TablePrimitive = ({ caption, children, className, highlightOnHover = false, size, variation, ...rest }, ref) => {
|
|
@@ -2049,29 +2047,29 @@ const TablePrimitive = ({ caption, children, className, highlightOnHover = false
|
|
|
2049
2047
|
/**
|
|
2050
2048
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/table)
|
|
2051
2049
|
*/
|
|
2052
|
-
const Table =
|
|
2050
|
+
const Table = Field.primitiveWithForwardRef(TablePrimitive);
|
|
2053
2051
|
Table.displayName = 'Table';
|
|
2054
2052
|
|
|
2055
2053
|
const TableBodyPrimitive = ({ children, className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: "tbody", className: ui.classNames(ui.ComponentClassName.TableBody, className), ref: ref, ...rest }, children));
|
|
2056
|
-
const TableBody =
|
|
2054
|
+
const TableBody = Field.primitiveWithForwardRef(TableBodyPrimitive);
|
|
2057
2055
|
TableBody.displayName = 'TableBody';
|
|
2058
2056
|
|
|
2059
2057
|
const TableCellPrimitive = ({ as: asElementTag = 'td', children, className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: asElementTag, className: ui.classNames(asElementTag === 'td'
|
|
2060
2058
|
? ui.ComponentClassName.TableTd
|
|
2061
2059
|
: ui.ComponentClassName.TableTh, className), ref: ref, ...rest }, children));
|
|
2062
|
-
const TableCell =
|
|
2060
|
+
const TableCell = Field.primitiveWithForwardRef(TableCellPrimitive);
|
|
2063
2061
|
TableCell.displayName = 'TableCell';
|
|
2064
2062
|
|
|
2065
2063
|
const TableFootPrimitive = ({ children, className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: "tfoot", className: ui.classNames(ui.ComponentClassName.TableFoot, className), ref: ref, ...rest }, children));
|
|
2066
|
-
const TableFoot =
|
|
2064
|
+
const TableFoot = Field.primitiveWithForwardRef(TableFootPrimitive);
|
|
2067
2065
|
TableFoot.displayName = 'TableFoot';
|
|
2068
2066
|
|
|
2069
2067
|
const TableHeadPrimitive = ({ children, className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: "thead", className: ui.classNames(ui.ComponentClassName.TableHead, className), ref: ref, ...rest }, children));
|
|
2070
|
-
const TableHead =
|
|
2068
|
+
const TableHead = Field.primitiveWithForwardRef(TableHeadPrimitive);
|
|
2071
2069
|
TableHead.displayName = 'TableHead';
|
|
2072
2070
|
|
|
2073
2071
|
const TableRowPrimitive = ({ children, className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: "tr", className: ui.classNames(ui.ComponentClassName.TableRow, className), ref: ref, ...rest }, children));
|
|
2074
|
-
const TableRow =
|
|
2072
|
+
const TableRow = Field.primitiveWithForwardRef(TableRowPrimitive);
|
|
2075
2073
|
TableRow.displayName = 'TableRow';
|
|
2076
2074
|
|
|
2077
2075
|
const TabsContext = React__namespace.createContext({
|
|
@@ -2091,7 +2089,7 @@ const TabsItemPrimitive = ({ className, value, children, onClick, as = 'button',
|
|
|
2091
2089
|
}
|
|
2092
2090
|
const isActive = activeTab === value;
|
|
2093
2091
|
const handleOnClick = (e) => {
|
|
2094
|
-
if (ui.
|
|
2092
|
+
if (ui.isFunction(onClick)) {
|
|
2095
2093
|
onClick?.(e);
|
|
2096
2094
|
}
|
|
2097
2095
|
setActiveTab(value);
|
|
@@ -2101,7 +2099,7 @@ const TabsItemPrimitive = ({ className, value, children, onClick, as = 'button',
|
|
|
2101
2099
|
/**
|
|
2102
2100
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
|
|
2103
2101
|
*/
|
|
2104
|
-
const TabsItem =
|
|
2102
|
+
const TabsItem = Field.primitiveWithForwardRef(TabsItemPrimitive);
|
|
2105
2103
|
TabsItem.displayName = 'Tabs.Item';
|
|
2106
2104
|
|
|
2107
2105
|
const isValidTab = (child) => React__namespace.isValidElement(child);
|
|
@@ -2179,7 +2177,7 @@ const TabListPrimitive = ({ className, children, indicatorPosition, spacing, rol
|
|
|
2179
2177
|
/**
|
|
2180
2178
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
|
|
2181
2179
|
*/
|
|
2182
|
-
const TabList =
|
|
2180
|
+
const TabList = Field.primitiveWithForwardRef(TabListPrimitive);
|
|
2183
2181
|
TabList.displayName = 'Tabs.List';
|
|
2184
2182
|
|
|
2185
2183
|
const TabPanelPrimitive = ({ className, value, children, role = 'tabpanel', ...rest }, ref) => {
|
|
@@ -2195,7 +2193,7 @@ const TabPanelPrimitive = ({ className, value, children, role = 'tabpanel', ...r
|
|
|
2195
2193
|
/**
|
|
2196
2194
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
|
|
2197
2195
|
*/
|
|
2198
|
-
const TabPanel =
|
|
2196
|
+
const TabPanel = Field.primitiveWithForwardRef(TabPanelPrimitive);
|
|
2199
2197
|
TabPanel.displayName = 'Tabs.Panel';
|
|
2200
2198
|
|
|
2201
2199
|
const TabsContainerPrimitive = ({ children, defaultValue, className, value: controlledValue, onValueChange, isLazy, ...rest }, ref) => {
|
|
@@ -2225,7 +2223,7 @@ const TabsContainerPrimitive = ({ children, defaultValue, className, value: cont
|
|
|
2225
2223
|
/**
|
|
2226
2224
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
|
|
2227
2225
|
*/
|
|
2228
|
-
const TabsContainer =
|
|
2226
|
+
const TabsContainer = Field.primitiveWithForwardRef(TabsContainerPrimitive);
|
|
2229
2227
|
TabsContainer.displayName = 'Tabs.Container';
|
|
2230
2228
|
|
|
2231
2229
|
const TabsPrimitive = ({ items, indicatorPosition, justifyContent, spacing, ...rest }, ref) => {
|
|
@@ -2236,7 +2234,7 @@ const TabsPrimitive = ({ items, indicatorPosition, justifyContent, spacing, ...r
|
|
|
2236
2234
|
/**
|
|
2237
2235
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
|
|
2238
2236
|
*/
|
|
2239
|
-
const Tabs = Object.assign(
|
|
2237
|
+
const Tabs = Object.assign(Field.primitiveWithForwardRef(TabsPrimitive), {
|
|
2240
2238
|
Item: TabsItem,
|
|
2241
2239
|
List: TabList,
|
|
2242
2240
|
Panel: TabPanel,
|
|
@@ -2249,7 +2247,7 @@ const TextAreaPrimitive = ({ className, isDisabled, isReadOnly, isRequired, size
|
|
|
2249
2247
|
const { isFieldsetDisabled } = Field.useFieldset();
|
|
2250
2248
|
return (React__namespace.createElement(Field.View, { "aria-invalid": hasError, as: "textarea", className: componentClasses, disabled: isFieldsetDisabled ? isFieldsetDisabled : isDisabled, readOnly: isReadOnly, ref: ref, required: isRequired, ...rest }));
|
|
2251
2249
|
};
|
|
2252
|
-
const TextArea =
|
|
2250
|
+
const TextArea = Field.primitiveWithForwardRef(TextAreaPrimitive);
|
|
2253
2251
|
TextArea.displayName = 'TextArea';
|
|
2254
2252
|
|
|
2255
2253
|
// Updates the height of a <textarea> when the value changes.
|
|
@@ -2286,7 +2284,7 @@ const AutoresizeTextAreaPrimitive = ({ value, ...rest }, externalRef) => {
|
|
|
2286
2284
|
});
|
|
2287
2285
|
return React__namespace.createElement(TextArea, { ...rest, ref: composedRef, value: value });
|
|
2288
2286
|
};
|
|
2289
|
-
const AutoresizeTextArea =
|
|
2287
|
+
const AutoresizeTextArea = Field.primitiveWithForwardRef(AutoresizeTextAreaPrimitive);
|
|
2290
2288
|
AutoresizeTextArea.displayName = 'AutoresizeTextArea';
|
|
2291
2289
|
|
|
2292
2290
|
const DEFAULT_ROW_COUNT = 3;
|
|
@@ -2314,7 +2312,7 @@ const TextAreaFieldPrimitive = (props, ref) => {
|
|
|
2314
2312
|
/**
|
|
2315
2313
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/textareafield)
|
|
2316
2314
|
*/
|
|
2317
|
-
const TextAreaField =
|
|
2315
|
+
const TextAreaField = Field.primitiveWithForwardRef(TextAreaFieldPrimitive);
|
|
2318
2316
|
TextAreaField.displayName = 'TextAreaField';
|
|
2319
2317
|
|
|
2320
2318
|
const useToggleButton = ({ isPressed, defaultPressed, onClick, onChange, value, }) => {
|
|
@@ -2350,7 +2348,7 @@ const ToggleButtonPrimitive = ({ className, children, defaultPressed = false, is
|
|
|
2350
2348
|
/**
|
|
2351
2349
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/togglebutton)
|
|
2352
2350
|
*/
|
|
2353
|
-
const ToggleButton =
|
|
2351
|
+
const ToggleButton = Field.primitiveWithForwardRef(ToggleButtonPrimitive);
|
|
2354
2352
|
ToggleButton.displayName = 'ToggleButton';
|
|
2355
2353
|
|
|
2356
2354
|
const useToggleButtonGroup = ({ onChange, value, isExclusive = false, isSelectionRequired = false, }) => {
|
|
@@ -2410,12 +2408,12 @@ const ToggleButtonGroupPrimitive = ({ children, className, isExclusive, isSelect
|
|
|
2410
2408
|
/**
|
|
2411
2409
|
* [📖 Docs](https://ui.docs.amplify.aws/react/components/togglebutton#togglebuttongroup)
|
|
2412
2410
|
*/
|
|
2413
|
-
const ToggleButtonGroup =
|
|
2411
|
+
const ToggleButtonGroup = Field.primitiveWithForwardRef(ToggleButtonGroupPrimitive);
|
|
2414
2412
|
ToggleButtonGroup.displayName = 'ToggleButtonGroup';
|
|
2415
2413
|
|
|
2416
2414
|
var index$1 = /*#__PURE__*/Object.freeze({
|
|
2417
2415
|
__proto__: null,
|
|
2418
|
-
|
|
2416
|
+
Accordion: Accordion,
|
|
2419
2417
|
Alert: Alert,
|
|
2420
2418
|
Autocomplete: Autocomplete,
|
|
2421
2419
|
Avatar: Avatar,
|
|
@@ -2426,9 +2424,10 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
2426
2424
|
Card: Card,
|
|
2427
2425
|
CheckboxField: CheckboxField,
|
|
2428
2426
|
Collection: Collection,
|
|
2427
|
+
ComponentPropsToStylePropsMap: Field.ComponentPropsToStylePropsMap,
|
|
2428
|
+
ComponentPropsToStylePropsMapKeys: Field.ComponentPropsToStylePropsMapKeys,
|
|
2429
2429
|
Divider: Divider,
|
|
2430
2430
|
DropZone: DropZone,
|
|
2431
|
-
Accordion: Accordion,
|
|
2432
2431
|
FieldGroupIcon: Field.FieldGroupIcon,
|
|
2433
2432
|
FieldGroupIconButton: Field.FieldGroupIconButton,
|
|
2434
2433
|
Fieldset: Fieldset,
|
|
@@ -2437,6 +2436,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
2437
2436
|
Heading: Heading,
|
|
2438
2437
|
HighlightMatch: HighlightMatch,
|
|
2439
2438
|
Icon: Field.Icon,
|
|
2439
|
+
IconsProvider: IconsProvider,
|
|
2440
2440
|
Image: Image,
|
|
2441
2441
|
Input: Input,
|
|
2442
2442
|
Label: Field.Label,
|
|
@@ -2459,6 +2459,12 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
2459
2459
|
SliderField: SliderField,
|
|
2460
2460
|
StepperField: StepperField,
|
|
2461
2461
|
SwitchField: SwitchField,
|
|
2462
|
+
Table: Table,
|
|
2463
|
+
TableBody: TableBody,
|
|
2464
|
+
TableCell: TableCell,
|
|
2465
|
+
TableFoot: TableFoot,
|
|
2466
|
+
TableHead: TableHead,
|
|
2467
|
+
TableRow: TableRow,
|
|
2462
2468
|
Tabs: Tabs,
|
|
2463
2469
|
Text: Field.Text,
|
|
2464
2470
|
TextAreaField: TextAreaField,
|
|
@@ -2467,15 +2473,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
2467
2473
|
ToggleButtonGroup: ToggleButtonGroup,
|
|
2468
2474
|
View: Field.View,
|
|
2469
2475
|
VisuallyHidden: VisuallyHidden,
|
|
2470
|
-
|
|
2471
|
-
TableBody: TableBody,
|
|
2472
|
-
TableCell: TableCell,
|
|
2473
|
-
TableFoot: TableFoot,
|
|
2474
|
-
TableHead: TableHead,
|
|
2475
|
-
TableRow: TableRow,
|
|
2476
|
-
usePagination: usePagination,
|
|
2477
|
-
ComponentPropsToStylePropsMap: Field.ComponentPropsToStylePropsMap,
|
|
2478
|
-
ComponentPropsToStylePropsMapKeys: Field.ComponentPropsToStylePropsMapKeys
|
|
2476
|
+
usePagination: usePagination
|
|
2479
2477
|
});
|
|
2480
2478
|
|
|
2481
2479
|
var ComponentClassName;
|
|
@@ -2488,19 +2486,19 @@ const ValidationErrors = ({ errors, id, dataAttr, }) => {
|
|
|
2488
2486
|
if (!(errors?.length > 0))
|
|
2489
2487
|
return null;
|
|
2490
2488
|
const dataAttrProp = dataAttr ? { [dataAttr]: true } : {};
|
|
2491
|
-
return (
|
|
2492
|
-
return (
|
|
2489
|
+
return (React__namespace["default"].createElement(Field.View, { ...dataAttrProp, id: id }, errors.map((error) => {
|
|
2490
|
+
return (React__namespace["default"].createElement(Field.Text, { key: error, role: "alert", variation: "error" }, ui.translate(error)));
|
|
2493
2491
|
})));
|
|
2494
2492
|
};
|
|
2495
2493
|
|
|
2496
2494
|
const DefaultErrorMessage = (props) => {
|
|
2497
|
-
return
|
|
2495
|
+
return React__namespace["default"].createElement(Alert, { variation: "error", ...props });
|
|
2498
2496
|
};
|
|
2499
2497
|
|
|
2500
2498
|
const DefaultPasswordField = ({ fieldValidationErrors, label, ...rest }) => {
|
|
2501
|
-
return (
|
|
2502
|
-
|
|
2503
|
-
fieldValidationErrors ? (
|
|
2499
|
+
return (React__namespace["default"].createElement(React__namespace["default"].Fragment, null,
|
|
2500
|
+
React__namespace["default"].createElement(PasswordField, { ...rest, label: label }),
|
|
2501
|
+
fieldValidationErrors ? (React__namespace["default"].createElement(ValidationErrors, { errors: fieldValidationErrors })) : null));
|
|
2504
2502
|
};
|
|
2505
2503
|
const DEFAULTS$1 = {
|
|
2506
2504
|
CurrentPasswordField: DefaultPasswordField,
|
|
@@ -2523,7 +2521,7 @@ const defaultDeleteUserDisplayText = {
|
|
|
2523
2521
|
warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
|
|
2524
2522
|
};
|
|
2525
2523
|
|
|
2526
|
-
const VERSION = '6.5.
|
|
2524
|
+
const VERSION = '6.5.2';
|
|
2527
2525
|
|
|
2528
2526
|
const logger$2 = ui.getLogger('AccountSettings');
|
|
2529
2527
|
const getIsDisabled = (formValues, validationError) => {
|
|
@@ -2537,13 +2535,13 @@ const getIsDisabled = (formValues, validationError) => {
|
|
|
2537
2535
|
return arePasswordsInvalid;
|
|
2538
2536
|
};
|
|
2539
2537
|
function ChangePassword({ components, displayText: overrideDisplayText, onError, onSuccess, validators, }) {
|
|
2540
|
-
const [errorMessage, setErrorMessage] =
|
|
2541
|
-
const [formValues, setFormValues] =
|
|
2542
|
-
const [validationError, setValidationError] =
|
|
2543
|
-
const blurredFields =
|
|
2538
|
+
const [errorMessage, setErrorMessage] = React__namespace["default"].useState(null);
|
|
2539
|
+
const [formValues, setFormValues] = React__namespace["default"].useState({});
|
|
2540
|
+
const [validationError, setValidationError] = React__namespace["default"].useState({});
|
|
2541
|
+
const blurredFields = React__namespace["default"].useRef([]);
|
|
2544
2542
|
const { user, isLoading } = Field.useAuth();
|
|
2545
2543
|
const isDisabled = getIsDisabled(formValues, validationError);
|
|
2546
|
-
const passwordValidators =
|
|
2544
|
+
const passwordValidators = React__namespace["default"].useMemo(() => {
|
|
2547
2545
|
return validators ?? ui.getDefaultPasswordValidators();
|
|
2548
2546
|
}, [validators]);
|
|
2549
2547
|
uiReactCore.useSetUserAgent({
|
|
@@ -2555,7 +2553,7 @@ function ChangePassword({ components, displayText: overrideDisplayText, onError,
|
|
|
2555
2553
|
* Note that formValues and other states are passed in as props so that
|
|
2556
2554
|
* it does not depend on whether or not those states have been updated yet
|
|
2557
2555
|
*/
|
|
2558
|
-
const validateNewPassword =
|
|
2556
|
+
const validateNewPassword = React__namespace["default"].useCallback(({ formValues, eventType }) => {
|
|
2559
2557
|
const { newPassword } = formValues;
|
|
2560
2558
|
const hasBlurred = blurredFields.current.includes('newPassword');
|
|
2561
2559
|
return ui.runFieldValidators({
|
|
@@ -2565,7 +2563,7 @@ function ChangePassword({ components, displayText: overrideDisplayText, onError,
|
|
|
2565
2563
|
hasBlurred,
|
|
2566
2564
|
});
|
|
2567
2565
|
}, [passwordValidators]);
|
|
2568
|
-
const validateConfirmPassword =
|
|
2566
|
+
const validateConfirmPassword = React__namespace["default"].useCallback(({ formValues, eventType }) => {
|
|
2569
2567
|
const { newPassword, confirmPassword } = formValues;
|
|
2570
2568
|
const hasBlurred = blurredFields.current.includes('confirmPassword');
|
|
2571
2569
|
const confirmPasswordValidators = ui.getDefaultConfirmPasswordValidators(newPassword);
|
|
@@ -2576,7 +2574,7 @@ function ChangePassword({ components, displayText: overrideDisplayText, onError,
|
|
|
2576
2574
|
hasBlurred,
|
|
2577
2575
|
});
|
|
2578
2576
|
}, []);
|
|
2579
|
-
const runValidation =
|
|
2577
|
+
const runValidation = React__namespace["default"].useCallback((param) => {
|
|
2580
2578
|
const passwordErrors = validateNewPassword(param);
|
|
2581
2579
|
const confirmPasswordErrors = validateConfirmPassword(param);
|
|
2582
2580
|
const newValidationError = {
|
|
@@ -2595,7 +2593,7 @@ function ChangePassword({ components, displayText: overrideDisplayText, onError,
|
|
|
2595
2593
|
};
|
|
2596
2594
|
const { confirmPasswordFieldLabel, currentPasswordFieldLabel, newPasswordFieldLabel, updatePasswordButtonText, } = displayText;
|
|
2597
2595
|
/* Subcomponents */
|
|
2598
|
-
const { CurrentPasswordField, NewPasswordField, ConfirmPasswordField, SubmitButton, ErrorMessage, } =
|
|
2596
|
+
const { CurrentPasswordField, NewPasswordField, ConfirmPasswordField, SubmitButton, ErrorMessage, } = React__namespace["default"].useMemo(() => ({ ...DEFAULTS$1, ...(components ?? {}) }), [components]);
|
|
2599
2597
|
/* Event Handlers */
|
|
2600
2598
|
const handleChange = (event) => {
|
|
2601
2599
|
event.preventDefault();
|
|
@@ -2644,13 +2642,13 @@ function ChangePassword({ components, displayText: overrideDisplayText, onError,
|
|
|
2644
2642
|
logger$2.warn('<ChangePassword /> requires user to be authenticated.');
|
|
2645
2643
|
return null;
|
|
2646
2644
|
}
|
|
2647
|
-
return (
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
errorMessage ?
|
|
2645
|
+
return (React__namespace["default"].createElement(Field.View, { as: "form", className: ComponentClassName.ChangePassword, onSubmit: handleSubmit },
|
|
2646
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
2647
|
+
React__namespace["default"].createElement(CurrentPasswordField, { autoComplete: "current-password", isRequired: true, label: currentPasswordFieldLabel, name: "currentPassword", onBlur: handleBlur, onChange: handleChange }),
|
|
2648
|
+
React__namespace["default"].createElement(NewPasswordField, { autoComplete: "new-password", fieldValidationErrors: validationError?.newPassword, isRequired: true, label: newPasswordFieldLabel, name: "newPassword", onBlur: handleBlur, onChange: handleChange }),
|
|
2649
|
+
React__namespace["default"].createElement(ConfirmPasswordField, { autoComplete: "new-password", fieldValidationErrors: validationError?.confirmPassword, isRequired: true, label: confirmPasswordFieldLabel, name: "confirmPassword", onBlur: handleBlur, onChange: handleChange }),
|
|
2650
|
+
React__namespace["default"].createElement(SubmitButton, { isDisabled: isDisabled, type: "submit" }, updatePasswordButtonText),
|
|
2651
|
+
errorMessage ? React__namespace["default"].createElement(ErrorMessage, null, errorMessage) : null)));
|
|
2654
2652
|
}
|
|
2655
2653
|
ChangePassword.CurrentPasswordField = DEFAULTS$1.CurrentPasswordField;
|
|
2656
2654
|
ChangePassword.NewPasswordField = DEFAULTS$1.NewPasswordField;
|
|
@@ -2665,14 +2663,14 @@ const DefaultWarningView = ({ displayText: overrideDisplayText, isDisabled, onCa
|
|
|
2665
2663
|
...overrideDisplayText,
|
|
2666
2664
|
};
|
|
2667
2665
|
const { cancelButtonText, confirmDeleteButtonText, warningText } = displayText;
|
|
2668
|
-
return (
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
};
|
|
2675
|
-
const DefaultDeleteButton = (props) => (
|
|
2666
|
+
return (React__namespace["default"].createElement(Card, null,
|
|
2667
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
2668
|
+
React__namespace["default"].createElement(Field.Text, { color: "font.error" }, warningText),
|
|
2669
|
+
React__namespace["default"].createElement(Field.Flex, null,
|
|
2670
|
+
React__namespace["default"].createElement(Field.Button, { variation: "link", onClick: onCancel, isDisabled: isDisabled }, cancelButtonText),
|
|
2671
|
+
React__namespace["default"].createElement(Field.Button, { variation: "destructive", onClick: onConfirm, isDisabled: isDisabled }, confirmDeleteButtonText)))));
|
|
2672
|
+
};
|
|
2673
|
+
const DefaultDeleteButton = (props) => (React__namespace["default"].createElement(Field.Button, { ...props, variation: "warning" }));
|
|
2676
2674
|
const DEFAULTS = {
|
|
2677
2675
|
ErrorMessage: DefaultErrorMessage,
|
|
2678
2676
|
DeleteButton: DefaultDeleteButton,
|
|
@@ -2681,8 +2679,8 @@ const DEFAULTS = {
|
|
|
2681
2679
|
|
|
2682
2680
|
const logger$1 = ui.getLogger('AccountSettings');
|
|
2683
2681
|
function DeleteUser({ components, displayText: overrideDisplayText, handleDelete, onError, onSuccess, }) {
|
|
2684
|
-
const [state, setState] =
|
|
2685
|
-
const [errorMessage, setErrorMessage] =
|
|
2682
|
+
const [state, setState] = React__namespace["default"].useState('IDLE');
|
|
2683
|
+
const [errorMessage, setErrorMessage] = React__namespace["default"].useState(null);
|
|
2686
2684
|
uiReactCore.useSetUserAgent({
|
|
2687
2685
|
componentName: 'DeleteUser',
|
|
2688
2686
|
packageName: 'react',
|
|
@@ -2696,12 +2694,12 @@ function DeleteUser({ components, displayText: overrideDisplayText, handleDelete
|
|
|
2696
2694
|
const { deleteAccountButtonText } = displayText;
|
|
2697
2695
|
const { user, isLoading } = Field.useAuth();
|
|
2698
2696
|
// subcomponents
|
|
2699
|
-
const { ErrorMessage, DeleteButton, WarningView } =
|
|
2697
|
+
const { ErrorMessage, DeleteButton, WarningView } = React__namespace["default"].useMemo(() => ({ ...DEFAULTS, ...(components ?? {}) }), [components]);
|
|
2700
2698
|
const startConfirmation = (event) => {
|
|
2701
2699
|
event.preventDefault();
|
|
2702
2700
|
setState('CONFIRMATION');
|
|
2703
2701
|
};
|
|
2704
|
-
const runDeleteUser =
|
|
2702
|
+
const runDeleteUser = React__namespace["default"].useCallback(async () => {
|
|
2705
2703
|
if (!user) {
|
|
2706
2704
|
return;
|
|
2707
2705
|
}
|
|
@@ -2732,10 +2730,10 @@ function DeleteUser({ components, displayText: overrideDisplayText, handleDelete
|
|
|
2732
2730
|
}
|
|
2733
2731
|
}, [errorMessage, handleDelete, onError, onSuccess, user]);
|
|
2734
2732
|
// called when end user cancels account deletion confirmation
|
|
2735
|
-
const handleCancel =
|
|
2733
|
+
const handleCancel = React__namespace["default"].useCallback(() => {
|
|
2736
2734
|
setState('IDLE');
|
|
2737
2735
|
}, []);
|
|
2738
|
-
const handleConfirmDelete =
|
|
2736
|
+
const handleConfirmDelete = React__namespace["default"].useCallback(() => {
|
|
2739
2737
|
runDeleteUser();
|
|
2740
2738
|
}, [runDeleteUser]);
|
|
2741
2739
|
// Return null if Auth.getgetCurrentUser is still in progress
|
|
@@ -2751,10 +2749,10 @@ function DeleteUser({ components, displayText: overrideDisplayText, handleDelete
|
|
|
2751
2749
|
if (state === 'DONE') {
|
|
2752
2750
|
return null;
|
|
2753
2751
|
}
|
|
2754
|
-
return (
|
|
2755
|
-
|
|
2756
|
-
state === 'CONFIRMATION' || state === 'DELETING' ? (
|
|
2757
|
-
errorMessage ?
|
|
2752
|
+
return (React__namespace["default"].createElement(Field.Flex, { className: ComponentClassName.DeleteUser, direction: "column" },
|
|
2753
|
+
React__namespace["default"].createElement(DeleteButton, { isDisabled: state === 'CONFIRMATION' || state === 'DELETING', onClick: startConfirmation }, deleteAccountButtonText),
|
|
2754
|
+
state === 'CONFIRMATION' || state === 'DELETING' ? (React__namespace["default"].createElement(WarningView, { displayText: displayText, isDisabled: state === 'DELETING', onCancel: handleCancel, onConfirm: handleConfirmDelete })) : null,
|
|
2755
|
+
errorMessage ? React__namespace["default"].createElement(ErrorMessage, null, errorMessage) : null));
|
|
2758
2756
|
}
|
|
2759
2757
|
DeleteUser.ErrorMessage = DEFAULTS.ErrorMessage;
|
|
2760
2758
|
DeleteUser.DeleteButton = DEFAULTS.DeleteButton;
|
|
@@ -2786,11 +2784,11 @@ function RouteContainer({ children, className, variation = 'default', }) {
|
|
|
2786
2784
|
const {
|
|
2787
2785
|
// @ts-ignore
|
|
2788
2786
|
components: { Header, Footer }, } = useCustomComponents();
|
|
2789
|
-
return (
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2787
|
+
return (React__namespace["default"].createElement(Field.View, { className: className, "data-amplify-authenticator": "", "data-variation": variation },
|
|
2788
|
+
React__namespace["default"].createElement(Field.View, { "data-amplify-container": "" },
|
|
2789
|
+
React__namespace["default"].createElement(Header, null),
|
|
2790
|
+
React__namespace["default"].createElement(Field.View, { "data-amplify-router": "", "data-amplify-router-content": hasTabs(route) ? undefined : '' }, children),
|
|
2791
|
+
React__namespace["default"].createElement(Footer, null))));
|
|
2794
2792
|
}
|
|
2795
2793
|
|
|
2796
2794
|
const getFormDataFromEvent = (event) => {
|
|
@@ -2825,7 +2823,7 @@ function useFormHandlers() {
|
|
|
2825
2823
|
|
|
2826
2824
|
const RemoteErrorMessage = () => {
|
|
2827
2825
|
const { error } = uiReactCore.useAuthenticator((context) => [context.error]);
|
|
2828
|
-
return (
|
|
2826
|
+
return (React__namespace["default"].createElement(React__namespace["default"].Fragment, null, error ? (React__namespace["default"].createElement(Alert, { variation: "error", isDismissible: true }, ui.translate(error))) : null));
|
|
2829
2827
|
};
|
|
2830
2828
|
|
|
2831
2829
|
function FormField({ autocomplete: autoComplete, dialCode, name, type, ...props }) {
|
|
@@ -2876,23 +2874,23 @@ function ConfirmSignUp({ className, variation, }) {
|
|
|
2876
2874
|
ConfirmSignUp: { Header = ConfirmSignUp.Header, Footer = ConfirmSignUp.Footer, }, }, } = useCustomComponents();
|
|
2877
2875
|
return (
|
|
2878
2876
|
// TODO Automatically add these namespaces again from `useAmplify`
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2877
|
+
React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation },
|
|
2878
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-confirmsignup": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
2879
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
2880
|
+
React__namespace["default"].createElement(Header, null),
|
|
2881
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
2882
|
+
React__namespace["default"].createElement(Field.Text, { className: "amplify-authenticator__subtitle" }, getDeliveryMessageText(codeDeliveryDetails)),
|
|
2883
|
+
React__namespace["default"].createElement(FormFields, null),
|
|
2884
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null),
|
|
2885
|
+
React__namespace["default"].createElement(Field.Button, { variation: "primary", isDisabled: isPending, type: "submit", loadingText: getConfirmingText$1(), isLoading: isPending }, getConfirmText$1()),
|
|
2886
|
+
React__namespace["default"].createElement(Field.Button, { onClick: resendCode, type: "button" }, getResendCodeText$1())),
|
|
2887
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
2890
2888
|
}
|
|
2891
2889
|
const DefaultHeader = () => {
|
|
2892
2890
|
const { codeDeliveryDetails } = uiReactCore.useAuthenticator((context) => [
|
|
2893
2891
|
context.codeDeliveryDetails,
|
|
2894
2892
|
]);
|
|
2895
|
-
return (
|
|
2893
|
+
return (React__namespace["default"].createElement(Heading, { level: 4 }, getDeliveryMethodText(codeDeliveryDetails)));
|
|
2896
2894
|
};
|
|
2897
2895
|
ConfirmSignUp.Header = DefaultHeader;
|
|
2898
2896
|
ConfirmSignUp.Footer = function Footer() {
|
|
@@ -2910,21 +2908,21 @@ const ForceNewPassword = ({ className, variation, }) => {
|
|
|
2910
2908
|
const { components: {
|
|
2911
2909
|
// @ts-ignore
|
|
2912
2910
|
ForceNewPassword: { FormFields = ForceNewPassword.FormFields, Header = ForceNewPassword.Header, Footer = ForceNewPassword.Footer, }, }, } = useCustomComponents();
|
|
2913
|
-
return (
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2911
|
+
return (React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation },
|
|
2912
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-forcenewpassword": "", method: "post", onChange: handleChange, onSubmit: handleSubmit, onBlur: handleBlur },
|
|
2913
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
2914
|
+
React__namespace["default"].createElement(Header, null),
|
|
2915
|
+
React__namespace["default"].createElement(FormFields, null),
|
|
2916
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null),
|
|
2917
|
+
React__namespace["default"].createElement(Field.Button, { isDisabled: isPending, type: "submit", variation: "primary", isLoading: isPending, loadingText: getChangingText() }, getChangePasswordText()),
|
|
2918
|
+
React__namespace["default"].createElement(Field.Button, { onClick: toSignIn, type: "button", variation: "link", size: "small" }, getBackToSignInText$2()),
|
|
2919
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
2922
2920
|
};
|
|
2923
2921
|
ForceNewPassword.FormFields = function FormFields$1() {
|
|
2924
|
-
return
|
|
2922
|
+
return React__namespace["default"].createElement(FormFields, null);
|
|
2925
2923
|
};
|
|
2926
2924
|
ForceNewPassword.Header = function Header() {
|
|
2927
|
-
return
|
|
2925
|
+
return React__namespace["default"].createElement(Heading, { level: 4 }, getChangePasswordText());
|
|
2928
2926
|
};
|
|
2929
2927
|
ForceNewPassword.Footer = function Footer() {
|
|
2930
2928
|
return null;
|
|
@@ -2936,9 +2934,9 @@ const ConfirmSignInFooter = () => {
|
|
|
2936
2934
|
context.isPending,
|
|
2937
2935
|
context.toSignIn,
|
|
2938
2936
|
]);
|
|
2939
|
-
return (
|
|
2940
|
-
|
|
2941
|
-
|
|
2937
|
+
return (React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
2938
|
+
React__namespace["default"].createElement(Field.Button, { isDisabled: isPending, type: "submit", variation: "primary", isLoading: isPending, loadingText: getConfirmingText() }, getConfirmText()),
|
|
2939
|
+
React__namespace["default"].createElement(Field.Button, { onClick: toSignIn, type: "button", variation: "link", size: "small" }, getBackToSignInText$1())));
|
|
2942
2940
|
};
|
|
2943
2941
|
|
|
2944
2942
|
const logger = new utils.ConsoleLogger('SetupTotp-logger');
|
|
@@ -3021,34 +3019,34 @@ const TwoButtonSubmitFooter = (props) => {
|
|
|
3021
3019
|
return;
|
|
3022
3020
|
}
|
|
3023
3021
|
};
|
|
3024
|
-
const defaultSubmitText = isPending ? (
|
|
3022
|
+
const defaultSubmitText = isPending ? (React__namespace["default"].createElement(React__namespace["default"].Fragment, null,
|
|
3025
3023
|
getSubmittingText(),
|
|
3026
|
-
"\u2026")) : (
|
|
3024
|
+
"\u2026")) : (React__namespace["default"].createElement(React__namespace["default"].Fragment, null, getSubmitText()));
|
|
3027
3025
|
const submitText = submitButtonText ?? defaultSubmitText;
|
|
3028
|
-
return (
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3026
|
+
return (React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
3027
|
+
React__namespace["default"].createElement(Field.Button, { variation: "primary", isDisabled: isPending, type: "submit" }, submitText),
|
|
3028
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column", alignItems: "center" },
|
|
3029
|
+
React__namespace["default"].createElement(Field.Button, { onClick: onClick, type: "button", variation: "link", size: "small" }, cancelButtonText))));
|
|
3032
3030
|
};
|
|
3033
3031
|
|
|
3034
3032
|
const AppleIcon = () => {
|
|
3035
|
-
return (
|
|
3036
|
-
|
|
3033
|
+
return (React__namespace["default"].createElement("svg", { "aria-label": "Apple icon", className: "amplify-icon federated-sign-in-icon", fill: "#000", preserveAspectRatio: "xMidYMid", stroke: "#000", strokeWidth: "0", viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg" },
|
|
3034
|
+
React__namespace["default"].createElement("path", { d: "M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z" })));
|
|
3037
3035
|
};
|
|
3038
3036
|
const GoogleIcon = () => {
|
|
3039
|
-
return (
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3037
|
+
return (React__namespace["default"].createElement("svg", { "aria-label": "Google icon", className: "amplify-icon federated-sign-in-icon", viewBox: "0 0 256 262", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid" },
|
|
3038
|
+
React__namespace["default"].createElement("path", { d: "M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027", fill: "#4285F4" }),
|
|
3039
|
+
React__namespace["default"].createElement("path", { d: "M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1", fill: "#34A853" }),
|
|
3040
|
+
React__namespace["default"].createElement("path", { d: "M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782", fill: "#FBBC05" }),
|
|
3041
|
+
React__namespace["default"].createElement("path", { d: "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251", fill: "#EB4335" })));
|
|
3044
3042
|
};
|
|
3045
3043
|
const FacebookIcon = () => {
|
|
3046
|
-
return (
|
|
3044
|
+
return (React__namespace["default"].createElement(Field.Icon, { className: "federated-sign-in-icon", ariaLabel: "Facebook icon", viewBox: { minX: 0, minY: 0, width: 279, height: 538 }, pathData: "M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z", fill: "#1877F2" }));
|
|
3047
3045
|
};
|
|
3048
3046
|
const AmazonIcon = () => {
|
|
3049
|
-
return (
|
|
3050
|
-
|
|
3051
|
-
|
|
3047
|
+
return (React__namespace["default"].createElement("svg", { "aria-label": "Amazon icon", className: "amplify-icon federated-sign-in-icon", viewBox: "0 0 243 264", xmlns: "http://www.w3.org/2000/svg", preserveAspectRatio: "xMidYMid" },
|
|
3048
|
+
React__namespace["default"].createElement("path", { d: "M230.826 208.039C227.468 203.683 208.551 205.982 200.056 206.998C197.471 207.321 197.076 205.042 199.407 203.405C214.475 192.665 239.201 195.766 242.082 199.364C244.966 202.982 241.337 228.071 227.173 240.049C225.001 241.888 222.93 240.904 223.898 238.468C227.077 230.431 234.205 212.419 230.826 208.039ZM123.769 264C71.0234 264 39.0764 241.955 14.7853 217.542C9.97339 212.706 3.71799 206.296 0.311513 200.691C-1.09773 198.372 2.59096 195.022 5.04421 196.844C35.239 219.268 79.1012 239.538 122.53 239.538C151.82 239.538 188.046 227.47 217.669 214.868C222.147 212.966 222.147 219.18 221.512 221.061C221.183 222.032 206.515 236.221 186.247 247.047C167.304 257.166 143.397 264 123.769 264Z", fill: "#F2541B" }),
|
|
3049
|
+
React__namespace["default"].createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M142.943 111.185C142.943 124.756 143.268 136.054 136.406 148.123C130.856 157.913 122.027 163.95 112.222 163.95C98.8288 163.95 90.9806 153.772 90.9806 138.693C90.9806 109.036 117.677 103.647 142.943 103.647V111.185ZM178.166 196.081C175.858 198.15 171.635 198.22 169.914 196.894C157.974 187.684 149.89 173.688 149.89 173.688C130.706 193.156 117.127 199 92.2879 199C62.8772 199 40 180.905 40 144.729C40 116.461 55.3552 97.2408 77.2563 87.823C96.2094 79.5256 122.684 78.0173 142.943 75.7517C142.943 75.7517 144.633 53.933 138.699 45.9806C134.098 39.8163 126.272 36.9329 119.089 36.9329C106.127 36.8829 93.61 43.9051 91.1262 57.4188C90.4136 61.2829 87.5533 64.5261 84.54 64.206L51.0823 60.5922C48.5156 60.2951 45.0381 57.6639 45.8636 53.3081C53.644 12.3684 90.7373 0 123.989 0C140.983 0 163.21 4.51651 176.608 17.3349C193.597 33.1648 191.969 54.2755 191.969 77.2722V131.51C191.969 147.835 198.768 154.987 205.151 163.775C207.376 166.953 207.886 170.714 205.04 173.032C197.902 178.999 178.166 196.081 178.166 196.081Z", fill: "#F2541B" })));
|
|
3052
3050
|
};
|
|
3053
3051
|
const FederatedSignInButton = (props) => {
|
|
3054
3052
|
const { icon, provider, text } = props;
|
|
@@ -3059,20 +3057,20 @@ const FederatedSignInButton = (props) => {
|
|
|
3059
3057
|
};
|
|
3060
3058
|
let iconComponent;
|
|
3061
3059
|
if (icon === 'facebook') {
|
|
3062
|
-
iconComponent =
|
|
3060
|
+
iconComponent = React__namespace["default"].createElement(FacebookIcon, null);
|
|
3063
3061
|
}
|
|
3064
3062
|
else if (icon === 'google') {
|
|
3065
|
-
iconComponent =
|
|
3063
|
+
iconComponent = React__namespace["default"].createElement(GoogleIcon, null);
|
|
3066
3064
|
}
|
|
3067
3065
|
else if (icon === 'amazon') {
|
|
3068
|
-
iconComponent =
|
|
3066
|
+
iconComponent = React__namespace["default"].createElement(AmazonIcon, null);
|
|
3069
3067
|
}
|
|
3070
3068
|
else if (icon === 'apple') {
|
|
3071
|
-
iconComponent =
|
|
3069
|
+
iconComponent = React__namespace["default"].createElement(AppleIcon, null);
|
|
3072
3070
|
}
|
|
3073
|
-
return (
|
|
3071
|
+
return (React__namespace["default"].createElement(Field.Button, { onClick: handleClick, className: "federated-sign-in-button", gap: "1rem" },
|
|
3074
3072
|
iconComponent,
|
|
3075
|
-
|
|
3073
|
+
React__namespace["default"].createElement(Field.Text, { as: "span" }, text)));
|
|
3076
3074
|
};
|
|
3077
3075
|
|
|
3078
3076
|
const { getSignInWithFederationText, getOrText } = ui.authenticatorTextUtil;
|
|
@@ -3082,23 +3080,23 @@ function FederatedSignIn() {
|
|
|
3082
3080
|
// @ts-ignore
|
|
3083
3081
|
return null;
|
|
3084
3082
|
}
|
|
3085
|
-
return (
|
|
3083
|
+
return (React__namespace["default"].createElement(Field.Flex, { direction: "column", padding: `0 0 1rem 0`, className: "federated-sign-in-container" },
|
|
3086
3084
|
socialProviders.map((provider) => {
|
|
3087
3085
|
switch (provider) {
|
|
3088
3086
|
case 'amazon':
|
|
3089
|
-
return (
|
|
3087
|
+
return (React__namespace["default"].createElement(FederatedSignInButton, { icon: "amazon", key: provider, provider: ui.FederatedIdentityProviders.Amazon, text: getSignInWithFederationText(route, provider) }));
|
|
3090
3088
|
case 'apple':
|
|
3091
|
-
return (
|
|
3089
|
+
return (React__namespace["default"].createElement(FederatedSignInButton, { icon: "apple", key: provider, provider: ui.FederatedIdentityProviders.Apple, text: getSignInWithFederationText(route, provider) }));
|
|
3092
3090
|
case 'facebook':
|
|
3093
|
-
return (
|
|
3091
|
+
return (React__namespace["default"].createElement(FederatedSignInButton, { icon: "facebook", key: provider, provider: ui.FederatedIdentityProviders.Facebook, text: getSignInWithFederationText(route, provider) }));
|
|
3094
3092
|
case 'google':
|
|
3095
|
-
return (
|
|
3093
|
+
return (React__namespace["default"].createElement(FederatedSignInButton, { icon: "google", key: provider, provider: ui.FederatedIdentityProviders.Google, text: getSignInWithFederationText(route, provider) }));
|
|
3096
3094
|
default:
|
|
3097
3095
|
// eslint-disable-next-line no-console
|
|
3098
3096
|
console.error(`Authenticator does not support ${provider}. Please open an issue: https://github.com/aws-amplify/amplify-ui/issues/choose`);
|
|
3099
3097
|
}
|
|
3100
3098
|
}),
|
|
3101
|
-
|
|
3099
|
+
React__namespace["default"].createElement(Divider, { size: "small", label: getOrText() })));
|
|
3102
3100
|
}
|
|
3103
3101
|
|
|
3104
3102
|
const { getSignInText, getSigningInText, getForgotPasswordText } = ui.authenticatorTextUtil;
|
|
@@ -3108,25 +3106,25 @@ function SignIn() {
|
|
|
3108
3106
|
const { components: {
|
|
3109
3107
|
// @ts-ignore
|
|
3110
3108
|
SignIn: { Header = SignIn.Header, Footer = SignIn.Footer }, }, } = useCustomComponents();
|
|
3111
|
-
return (
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3109
|
+
return (React__namespace["default"].createElement(Field.View, null,
|
|
3110
|
+
React__namespace["default"].createElement(Header, null),
|
|
3111
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-signin": "", method: "post", onSubmit: handleSubmit, onChange: handleChange },
|
|
3112
|
+
React__namespace["default"].createElement(FederatedSignIn, null),
|
|
3113
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
3114
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
3115
|
+
React__namespace["default"].createElement(VisuallyHidden, null,
|
|
3116
|
+
React__namespace["default"].createElement("legend", null, getSignInText())),
|
|
3117
|
+
React__namespace["default"].createElement(FormFields, null)),
|
|
3118
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null),
|
|
3119
|
+
React__namespace["default"].createElement(Field.Button, { isDisabled: isPending, type: "submit", variation: "primary", isLoading: isPending, loadingText: getSigningInText() }, getSignInText()),
|
|
3120
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
3123
3121
|
}
|
|
3124
3122
|
const DefaultFooter = () => {
|
|
3125
3123
|
const { toForgotPassword } = uiReactCore.useAuthenticator((context) => [
|
|
3126
3124
|
context.toForgotPassword,
|
|
3127
3125
|
]);
|
|
3128
|
-
return (
|
|
3129
|
-
|
|
3126
|
+
return (React__namespace["default"].createElement(Field.View, { "data-amplify-footer": "" },
|
|
3127
|
+
React__namespace["default"].createElement(Field.Button, { onClick: toForgotPassword, size: "small", variation: "link" }, getForgotPasswordText())));
|
|
3130
3128
|
};
|
|
3131
3129
|
SignIn.Footer = DefaultFooter;
|
|
3132
3130
|
SignIn.Header = function Header() {
|
|
@@ -3144,23 +3142,23 @@ function SignUp() {
|
|
|
3144
3142
|
const { components: {
|
|
3145
3143
|
// @ts-ignore
|
|
3146
3144
|
SignUp: { Header = SignUp.Header, FormFields = SignUp.FormFields, Footer = SignUp.Footer, }, }, } = useCustomComponents();
|
|
3147
|
-
return (
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3145
|
+
return (React__namespace["default"].createElement(Field.View, null,
|
|
3146
|
+
React__namespace["default"].createElement(Header, null),
|
|
3147
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-signup": "", method: "post", onChange: handleChange, onSubmit: handleSubmit, onBlur: handleBlur },
|
|
3148
|
+
React__namespace["default"].createElement(FederatedSignIn, null),
|
|
3149
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
3150
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
3151
|
+
React__namespace["default"].createElement(FormFields, null),
|
|
3152
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null)),
|
|
3153
|
+
React__namespace["default"].createElement(Field.Button, { isDisabled: hasValidationErrors || isPending, isFullWidth: true, type: "submit", variation: "primary", isLoading: isPending, loadingText: getCreatingAccountText() }, getCreateAccountText()),
|
|
3154
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
3157
3155
|
}
|
|
3158
3156
|
SignUp.Header = function Header() {
|
|
3159
3157
|
// @ts-ignore
|
|
3160
3158
|
return null;
|
|
3161
3159
|
};
|
|
3162
3160
|
SignUp.FormFields = function FormFields$1() {
|
|
3163
|
-
return
|
|
3161
|
+
return React__namespace["default"].createElement(FormFields, null);
|
|
3164
3162
|
};
|
|
3165
3163
|
SignUp.Footer = function Footer() {
|
|
3166
3164
|
// @ts-ignore
|
|
@@ -3174,14 +3172,14 @@ const SignInSignUpTabs = ({ className, hideSignUp, variation, }) => {
|
|
|
3174
3172
|
context.toSignIn,
|
|
3175
3173
|
context.toSignUp,
|
|
3176
3174
|
]);
|
|
3177
|
-
return (
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3175
|
+
return (React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation }, hideSignUp ? (React__namespace["default"].createElement(Field.View, { "data-amplify-router-content": "" }, route === 'signIn' && React__namespace["default"].createElement(SignIn, null))) : (React__namespace["default"].createElement(Tabs.Container, { value: route, isLazy: true, onValueChange: () => (route === 'signIn' ? toSignUp() : toSignIn()) },
|
|
3176
|
+
React__namespace["default"].createElement(Tabs.List, { spacing: "equal", indicatorPosition: "top" },
|
|
3177
|
+
React__namespace["default"].createElement(Tabs.Item, { value: "signIn" }, getSignInTabText()),
|
|
3178
|
+
React__namespace["default"].createElement(Tabs.Item, { value: "signUp" }, getSignUpTabText())),
|
|
3179
|
+
React__namespace["default"].createElement(Tabs.Panel, { value: "signIn", "data-amplify-router-content": "" },
|
|
3180
|
+
React__namespace["default"].createElement(SignIn, null)),
|
|
3181
|
+
React__namespace["default"].createElement(Tabs.Panel, { value: "signUp", "data-amplify-router-content": "" },
|
|
3182
|
+
React__namespace["default"].createElement(SignUp, null))))));
|
|
3185
3183
|
};
|
|
3186
3184
|
|
|
3187
3185
|
const { getAccountRecoveryInfoText: getAccountRecoveryInfoText$1, getSkipText: getSkipText$1 } = ui.authenticatorTextUtil;
|
|
@@ -3191,18 +3189,18 @@ const ConfirmVerifyUser = ({ className, variation, }) => {
|
|
|
3191
3189
|
const { components: {
|
|
3192
3190
|
// @ts-ignore
|
|
3193
3191
|
ConfirmVerifyUser: { Header = ConfirmVerifyUser.Header, Footer = ConfirmVerifyUser.Footer, }, }, } = useCustomComponents();
|
|
3194
|
-
return (
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3192
|
+
return (React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation },
|
|
3193
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-confirmverifyuser": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
3194
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
3195
|
+
React__namespace["default"].createElement(Header, null),
|
|
3196
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
3197
|
+
React__namespace["default"].createElement(FormFields, null)),
|
|
3198
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null),
|
|
3199
|
+
React__namespace["default"].createElement(TwoButtonSubmitFooter, { cancelButtonText: getSkipText$1(), cancelButtonSendType: "SKIP" }),
|
|
3200
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
3203
3201
|
};
|
|
3204
3202
|
ConfirmVerifyUser.Header = function Header() {
|
|
3205
|
-
return
|
|
3203
|
+
return React__namespace["default"].createElement(Heading, { level: 3 }, getAccountRecoveryInfoText$1());
|
|
3206
3204
|
};
|
|
3207
3205
|
ConfirmVerifyUser.Footer = function Footer() {
|
|
3208
3206
|
return null;
|
|
@@ -3212,7 +3210,7 @@ const { getSkipText, getVerifyText, getVerifyContactText, getAccountRecoveryInfo
|
|
|
3212
3210
|
const generateRadioGroup = (attributes) => {
|
|
3213
3211
|
return Object.entries(attributes).map(([key, value], index) => {
|
|
3214
3212
|
const verificationType = ui.defaultFormFieldOptions[key].label;
|
|
3215
|
-
return (
|
|
3213
|
+
return (React__namespace["default"].createElement(Radio, { name: "unverifiedAttr", value: key, key: key, defaultChecked: index === 0 },
|
|
3216
3214
|
ui.translate(verificationType),
|
|
3217
3215
|
":",
|
|
3218
3216
|
' ',
|
|
@@ -3228,19 +3226,19 @@ const VerifyUser = ({ className, variation, }) => {
|
|
|
3228
3226
|
unverifiedUserAttributes,
|
|
3229
3227
|
]);
|
|
3230
3228
|
const { handleChange, handleSubmit } = useFormHandlers();
|
|
3231
|
-
const footerSubmitText = isPending ? (
|
|
3232
|
-
const verificationRadioGroup = (
|
|
3233
|
-
return (
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3229
|
+
const footerSubmitText = isPending ? (React__namespace["default"].createElement(React__namespace["default"].Fragment, null, "Verifying\u2026")) : (React__namespace["default"].createElement(React__namespace["default"].Fragment, null, getVerifyText()));
|
|
3230
|
+
const verificationRadioGroup = (React__namespace["default"].createElement(RadioGroupField, { legend: getVerifyContactText(), name: "verify_context", isDisabled: isPending, legendHidden: true }, generateRadioGroup(unverifiedUserAttributes)));
|
|
3231
|
+
return (React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation },
|
|
3232
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-verifyuser": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
3233
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
3234
|
+
React__namespace["default"].createElement(Header, null),
|
|
3237
3235
|
verificationRadioGroup,
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3236
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null),
|
|
3237
|
+
React__namespace["default"].createElement(TwoButtonSubmitFooter, { cancelButtonText: getSkipText(), cancelButtonSendType: "SKIP", submitButtonText: footerSubmitText }),
|
|
3238
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
3241
3239
|
};
|
|
3242
3240
|
VerifyUser.Header = function Header() {
|
|
3243
|
-
return
|
|
3241
|
+
return React__namespace["default"].createElement(Heading, { level: 3 }, getAccountRecoveryInfoText());
|
|
3244
3242
|
};
|
|
3245
3243
|
VerifyUser.Footer = function Footer() {
|
|
3246
3244
|
// @ts-ignore
|
|
@@ -3254,21 +3252,21 @@ const ConfirmSignIn = ({ className, variation, }) => {
|
|
|
3254
3252
|
const { components: {
|
|
3255
3253
|
// @ts-ignore
|
|
3256
3254
|
ConfirmSignIn: { Header = ConfirmSignIn.Header, Footer = ConfirmSignIn.Footer, }, }, } = useCustomComponents();
|
|
3257
|
-
return (
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3255
|
+
return (React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation },
|
|
3256
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-confirmsignin": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
3257
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
3258
|
+
React__namespace["default"].createElement(Header, null),
|
|
3259
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
3260
|
+
React__namespace["default"].createElement(FormFields, null),
|
|
3261
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null)),
|
|
3262
|
+
React__namespace["default"].createElement(ConfirmSignInFooter, null),
|
|
3263
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
3266
3264
|
};
|
|
3267
3265
|
function Header() {
|
|
3268
3266
|
const { challengeName } = uiReactCore.useAuthenticator(({ challengeName }) => [
|
|
3269
3267
|
challengeName,
|
|
3270
3268
|
]);
|
|
3271
|
-
return
|
|
3269
|
+
return React__namespace["default"].createElement(Heading, { level: 3 }, getChallengeText(challengeName));
|
|
3272
3270
|
}
|
|
3273
3271
|
ConfirmSignIn.Header = Header;
|
|
3274
3272
|
ConfirmSignIn.Footer = function Footer() {
|
|
@@ -3283,19 +3281,19 @@ const ConfirmResetPassword = ({ className, variation, }) => {
|
|
|
3283
3281
|
const { components: {
|
|
3284
3282
|
// @ts-ignore
|
|
3285
3283
|
ConfirmResetPassword: { Header = ConfirmResetPassword.Header, Footer = ConfirmResetPassword.Footer, }, }, } = useCustomComponents();
|
|
3286
|
-
return (
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3284
|
+
return (React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation },
|
|
3285
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-confirmresetpassword": "", method: "post", onSubmit: handleSubmit, onChange: handleChange, onBlur: handleBlur },
|
|
3286
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
3287
|
+
React__namespace["default"].createElement(Header, null),
|
|
3288
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
3289
|
+
React__namespace["default"].createElement(FormFields, null)),
|
|
3290
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null),
|
|
3291
|
+
React__namespace["default"].createElement(TwoButtonSubmitFooter, { cancelButtonSendType: "RESEND", cancelButtonText: getResendCodeText() }),
|
|
3292
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
3295
3293
|
};
|
|
3296
3294
|
ConfirmResetPassword.Header = function Header() {
|
|
3297
3295
|
const headerText = getResetYourPasswordText$1();
|
|
3298
|
-
return
|
|
3296
|
+
return React__namespace["default"].createElement(Heading, { level: 3 }, headerText);
|
|
3299
3297
|
};
|
|
3300
3298
|
ConfirmResetPassword.Footer = function Footer() {
|
|
3301
3299
|
// @ts-ignore
|
|
@@ -3309,20 +3307,20 @@ const ForgotPassword = ({ className, variation, }) => {
|
|
|
3309
3307
|
const { components: {
|
|
3310
3308
|
// @ts-ignore
|
|
3311
3309
|
ForgotPassword: { Header = ForgotPassword.Header, Footer = ForgotPassword.Footer, }, }, } = useCustomComponents();
|
|
3312
|
-
return (
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3310
|
+
return (React__namespace["default"].createElement(RouteContainer, { className: className, variation: variation },
|
|
3311
|
+
React__namespace["default"].createElement("form", { "data-amplify-form": "", "data-amplify-authenticator-forgotpassword": "", method: "post", onChange: handleChange, onSubmit: handleSubmit },
|
|
3312
|
+
React__namespace["default"].createElement(Field.Flex, { as: "fieldset", direction: "column", isDisabled: isPending },
|
|
3313
|
+
React__namespace["default"].createElement(Header, null),
|
|
3314
|
+
React__namespace["default"].createElement(Field.Flex, { direction: "column" },
|
|
3315
|
+
React__namespace["default"].createElement(FormFields, null)),
|
|
3316
|
+
React__namespace["default"].createElement(RemoteErrorMessage, null),
|
|
3317
|
+
React__namespace["default"].createElement(TwoButtonSubmitFooter, { cancelButtonText: getBackToSignInText(), cancelButtonSendType: "SIGN_IN", submitButtonText: isPending ? (React__namespace["default"].createElement(React__namespace["default"].Fragment, null,
|
|
3320
3318
|
getSendingText(),
|
|
3321
|
-
"\u2026")) : (
|
|
3322
|
-
|
|
3319
|
+
"\u2026")) : (React__namespace["default"].createElement(React__namespace["default"].Fragment, null, getSendCodeText())) }),
|
|
3320
|
+
React__namespace["default"].createElement(Footer, null)))));
|
|
3323
3321
|
};
|
|
3324
3322
|
ForgotPassword.Header = function Header() {
|
|
3325
|
-
return
|
|
3323
|
+
return React__namespace["default"].createElement(Heading, { level: 3 }, getResetYourPasswordText());
|
|
3326
3324
|
};
|
|
3327
3325
|
ForgotPassword.Footer = function Footer() {
|
|
3328
3326
|
// @ts-ignore
|
|
@@ -3370,7 +3368,7 @@ const getRouteComponent = (route) => {
|
|
|
3370
3368
|
function Router({ className, hideSignUp, variation, }) {
|
|
3371
3369
|
const { route } = uiReactCore.useAuthenticator(({ route }) => [route]);
|
|
3372
3370
|
const RouterChildren = React.useMemo(() => getRouteComponent(route), [route]);
|
|
3373
|
-
return (
|
|
3371
|
+
return (React__namespace["default"].createElement(RouterChildren, { className: className,
|
|
3374
3372
|
// @ts-ignore
|
|
3375
3373
|
hideSignUp: isSignInOrSignUpRoute(route) ? hideSignUp : undefined, variation: variation }));
|
|
3376
3374
|
}
|
|
@@ -3488,7 +3486,7 @@ Authenticator.ForceNewPassword = ForceNewPassword;
|
|
|
3488
3486
|
function withAuthenticator(Component, options = {}) {
|
|
3489
3487
|
const { variation = 'modal' } = options;
|
|
3490
3488
|
return function WrappedWithAuthenticator(props) {
|
|
3491
|
-
return (
|
|
3489
|
+
return (React__namespace["default"].createElement(Authenticator, { variation: variation, ...options }, (withAuthenticatorProps) => (React__namespace["default"].createElement(Component, { ...props, ...withAuthenticatorProps }))));
|
|
3492
3490
|
};
|
|
3493
3491
|
}
|
|
3494
3492
|
|
|
@@ -3510,28 +3508,28 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
3510
3508
|
__proto__: null,
|
|
3511
3509
|
AccountSettings: AccountSettings,
|
|
3512
3510
|
Authenticator: Authenticator,
|
|
3513
|
-
|
|
3511
|
+
ThemeProvider: ThemeProvider,
|
|
3514
3512
|
useAuthenticator: uiReactCore.useAuthenticator,
|
|
3515
|
-
|
|
3513
|
+
withAuthenticator: withAuthenticator
|
|
3516
3514
|
});
|
|
3517
3515
|
|
|
3518
|
-
Object.defineProperty(exports,
|
|
3516
|
+
Object.defineProperty(exports, "useAuthenticator", {
|
|
3519
3517
|
enumerable: true,
|
|
3520
3518
|
get: function () { return uiReactCore.useAuthenticator; }
|
|
3521
3519
|
});
|
|
3522
|
-
Object.defineProperty(exports,
|
|
3520
|
+
Object.defineProperty(exports, "createTheme", {
|
|
3523
3521
|
enumerable: true,
|
|
3524
3522
|
get: function () { return ui.createTheme; }
|
|
3525
3523
|
});
|
|
3526
|
-
Object.defineProperty(exports,
|
|
3524
|
+
Object.defineProperty(exports, "defaultDarkModeOverride", {
|
|
3527
3525
|
enumerable: true,
|
|
3528
3526
|
get: function () { return ui.defaultDarkModeOverride; }
|
|
3529
3527
|
});
|
|
3530
|
-
Object.defineProperty(exports,
|
|
3528
|
+
Object.defineProperty(exports, "defaultTheme", {
|
|
3531
3529
|
enumerable: true,
|
|
3532
3530
|
get: function () { return ui.defaultTheme; }
|
|
3533
3531
|
});
|
|
3534
|
-
Object.defineProperty(exports,
|
|
3532
|
+
Object.defineProperty(exports, "translations", {
|
|
3535
3533
|
enumerable: true,
|
|
3536
3534
|
get: function () { return ui.translations; }
|
|
3537
3535
|
});
|