@aws-amplify/ui-react 6.5.0 → 6.5.1

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.
@@ -5,7 +5,6 @@ var core = require('@aws-amplify/core');
5
5
  var auth = require('aws-amplify/auth');
6
6
  var uiReactCore = require('@aws-amplify/ui-react-core');
7
7
  var ui = require('@aws-amplify/ui');
8
- var primitiveWithForwardRef = require('./primitiveWithForwardRef-7e929242.js');
9
8
 
10
9
  function _interopNamespace(e) {
11
10
  if (e && e.__esModule) return e;
@@ -636,6 +635,17 @@ const useStyles = (props, style) => {
636
635
  }), [propStyles, style, breakpoints, breakpoint, tokens]);
637
636
  };
638
637
 
638
+ /**
639
+ * Updates the return type for primitives wrapped in `React.forwardRef` to
640
+ * `React.ReactElement`. In React 18 the return type of `React.ExoticComponent`
641
+ * was changed from `React.ReactElement` to `React.ReactNode`, which breaks
642
+ * clients using React 16 and 17.
643
+ *
644
+ * @param primitive UI Primitive to be wrapped with `React.forwardRef`
645
+ * @returns ForwaredRef wrapped UI Primitive
646
+ */
647
+ const primitiveWithForwardRef = (primitive) => React__namespace.forwardRef(primitive);
648
+
639
649
  const ViewPrimitive = ({ as = 'div', children, testId, ariaLabel, isDisabled, style, inert, ...rest }, ref) => {
640
650
  const { propStyles, nonStyleProps } = useStyles(rest, style);
641
651
  return React__namespace.createElement(as, {
@@ -651,7 +661,7 @@ const ViewPrimitive = ({ as = 'div', children, testId, ariaLabel, isDisabled, st
651
661
  /**
652
662
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/view)
653
663
  */
654
- const View = primitiveWithForwardRef.primitiveWithForwardRef(ViewPrimitive);
664
+ const View = primitiveWithForwardRef(ViewPrimitive);
655
665
  View.displayName = 'View';
656
666
 
657
667
  const defaultViewBox = { minX: 0, minY: 0, width: 24, height: 24 };
@@ -681,7 +691,7 @@ as = 'svg', fill = 'currentColor', pathData, viewBox = defaultViewBox, children,
681
691
  /**
682
692
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/icon)
683
693
  */
684
- const Icon = primitiveWithForwardRef.primitiveWithForwardRef(IconPrimitive);
694
+ const Icon = primitiveWithForwardRef(IconPrimitive);
685
695
  Icon.displayName = 'Icon';
686
696
 
687
697
  const IconsContext = React__namespace.createContext({});
@@ -994,7 +1004,7 @@ function useDropZone({ onDropComplete, onDragEnter: _onDragEnter, onDragLeave: _
994
1004
  const FieldGroupIconPrimitive = ({ className, children, isVisible = true, excludeFromTabOrder = false, ...rest }, ref) => {
995
1005
  return isVisible ? (React__namespace.createElement(View, { className: ui.classNames(ui.ComponentClassName.FieldGroupIcon, className), ref: ref, tabIndex: excludeFromTabOrder ? -1 : undefined, ...rest }, children)) : null;
996
1006
  };
997
- const FieldGroupIcon = primitiveWithForwardRef.primitiveWithForwardRef(FieldGroupIconPrimitive);
1007
+ const FieldGroupIcon = primitiveWithForwardRef(FieldGroupIconPrimitive);
998
1008
  FieldGroupIcon.displayName = 'FieldGroupIcon';
999
1009
 
1000
1010
  const FieldsetContext = React__namespace.createContext({
@@ -1011,7 +1021,7 @@ const FlexPrimitive = ({ className, children, ...rest }, ref) => (React__namespa
1011
1021
  /**
1012
1022
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/flex)
1013
1023
  */
1014
- const Flex = primitiveWithForwardRef.primitiveWithForwardRef(FlexPrimitive);
1024
+ const Flex = primitiveWithForwardRef(FlexPrimitive);
1015
1025
  Flex.displayName = 'Flex';
1016
1026
 
1017
1027
  const LINEAR_EMPTY = 'linear-empty';
@@ -1061,7 +1071,7 @@ const LoaderPrimitive = ({ className, filledColor, emptyColor, size, variation,
1061
1071
  /**
1062
1072
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/loader)
1063
1073
  */
1064
- const Loader = primitiveWithForwardRef.primitiveWithForwardRef(LoaderPrimitive);
1074
+ const Loader = primitiveWithForwardRef(LoaderPrimitive);
1065
1075
  Loader.displayName = 'Loader';
1066
1076
 
1067
1077
  // These variations support colorThemes. 'undefined' accounts for our
@@ -1085,11 +1095,11 @@ const ButtonPrimitive = ({ className, children, colorTheme, isFullWidth = false,
1085
1095
  /**
1086
1096
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/button)
1087
1097
  */
1088
- const Button = primitiveWithForwardRef.primitiveWithForwardRef(ButtonPrimitive);
1098
+ const Button = primitiveWithForwardRef(ButtonPrimitive);
1089
1099
  Button.displayName = 'Button';
1090
1100
 
1091
1101
  const FieldGroupIconButtonPrimitive = ({ children, className, ...rest }, ref) => (React__namespace.createElement(FieldGroupIcon, { as: Button, className: ui.classNames(ui.ComponentClassName.FieldGroupIconButton, className), ref: ref, ...rest }, children));
1092
- const FieldGroupIconButton = primitiveWithForwardRef.primitiveWithForwardRef(FieldGroupIconButtonPrimitive);
1102
+ const FieldGroupIconButton = primitiveWithForwardRef(FieldGroupIconButtonPrimitive);
1093
1103
  FieldGroupIconButton.displayName = 'FieldGroupIconButton';
1094
1104
 
1095
1105
  const ariaLabelText = ComponentText.Fields.clearButtonLabel;
@@ -1097,7 +1107,7 @@ const FieldClearButtonPrimitive = ({ ariaLabel = ariaLabelText, size, ...rest },
1097
1107
  const icons = useIcons('field');
1098
1108
  return (React__namespace.createElement(FieldGroupIconButton, { ariaLabel: ariaLabel, size: size, ref: ref, ...rest }, icons?.clear ?? React__namespace.createElement(IconClose, null)));
1099
1109
  };
1100
- const FieldClearButton = primitiveWithForwardRef.primitiveWithForwardRef(FieldClearButtonPrimitive);
1110
+ const FieldClearButton = primitiveWithForwardRef(FieldClearButtonPrimitive);
1101
1111
  FieldClearButton.displayName = 'FieldClearButton';
1102
1112
 
1103
1113
  const TextPrimitive = ({ as = 'p', className, children, isTruncated, variation, ...rest }, ref) => {
@@ -1107,7 +1117,7 @@ const TextPrimitive = ({ as = 'p', className, children, isTruncated, variation,
1107
1117
  /**
1108
1118
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/text)
1109
1119
  */
1110
- const Text = primitiveWithForwardRef.primitiveWithForwardRef(TextPrimitive);
1120
+ const Text = primitiveWithForwardRef(TextPrimitive);
1111
1121
  Text.displayName = 'Text';
1112
1122
 
1113
1123
  const QA_FIELD_DESCRIPTION = 'qa-field-description';
@@ -1126,7 +1136,7 @@ const LabelPrimitive = ({ children, className, visuallyHidden, ...rest }, ref) =
1126
1136
  [ui.ComponentClassName.VisuallyHidden]: visuallyHidden,
1127
1137
  }), ref: ref, ...rest }, children));
1128
1138
  };
1129
- const Label = primitiveWithForwardRef.primitiveWithForwardRef(LabelPrimitive);
1139
+ const Label = primitiveWithForwardRef(LabelPrimitive);
1130
1140
  Label.displayName = 'Label';
1131
1141
 
1132
1142
  const FieldPrimitive = (props, ref) => {
@@ -1137,7 +1147,7 @@ const FieldPrimitive = (props, ref) => {
1137
1147
  children,
1138
1148
  errorMessage ? (React__namespace.createElement(FieldErrorMessage, { hasError: hasError, errorMessage: errorMessage })) : null));
1139
1149
  };
1140
- const Field = primitiveWithForwardRef.primitiveWithForwardRef(FieldPrimitive);
1150
+ const Field = primitiveWithForwardRef(FieldPrimitive);
1141
1151
  Field.displayName = 'Field';
1142
1152
 
1143
1153
  exports.ARROW_DOWN = ARROW_DOWN;
@@ -1185,6 +1195,7 @@ exports.View = View;
1185
1195
  exports.getConsecutiveIntArray = getConsecutiveIntArray;
1186
1196
  exports.getStyleValue = getStyleValue;
1187
1197
  exports.getValueAtCurrentBreakpoint = getValueAtCurrentBreakpoint;
1198
+ exports.primitiveWithForwardRef = primitiveWithForwardRef;
1188
1199
  exports.strHasLength = strHasLength;
1189
1200
  exports.useAuth = useAuth;
1190
1201
  exports.useBreakpoint = useBreakpoint;
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var primitiveWithForwardRef = require('./primitiveWithForwardRef-7e929242.js');
5
4
 
6
5
  function _interopNamespace(e) {
7
6
  if (e && e.__esModule) return e;
@@ -23,7 +22,11 @@ function _interopNamespace(e) {
23
22
 
24
23
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
25
24
 
26
- const StylePrimitive = ({ cssText, ...rest }, ref) => {
25
+ /**
26
+ * @experimental
27
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
28
+ */
29
+ const Style = ({ cssText, ...rest }) => {
27
30
  /*
28
31
  Only inject theme CSS variables if given a theme.
29
32
  The CSS file users import already has the default theme variables in it.
@@ -72,28 +75,22 @@ const StylePrimitive = ({ cssText, ...rest }, ref) => {
72
75
  if (cssText === undefined || /<\/style/i.test(cssText)) {
73
76
  return null;
74
77
  }
75
- return (React__namespace.createElement("style", { ...rest, ref: ref,
78
+ return (React__namespace.createElement("style", { ...rest,
76
79
  // eslint-disable-next-line react/no-danger
77
80
  dangerouslySetInnerHTML: { __html: cssText } }));
78
81
  };
82
+ Style.displayName = 'Style';
83
+
79
84
  /**
80
85
  * @experimental
81
86
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
82
87
  */
83
- const Style = primitiveWithForwardRef.primitiveWithForwardRef(StylePrimitive);
84
- Style.displayName = 'Style';
85
-
86
- const ThemeStylePrimitive = ({ theme, nonce, ...rest }, ref) => {
88
+ const ThemeStyle = ({ theme, ...rest }) => {
87
89
  if (!theme)
88
90
  return null;
89
91
  const { name, cssText } = theme;
90
- return (React__namespace.createElement(Style, { ...rest, ref: ref, cssText: cssText, nonce: nonce, id: `amplify-theme-${name}` }));
92
+ return React__namespace.createElement(Style, { ...rest, cssText: cssText, id: `amplify-theme-${name}` });
91
93
  };
92
- /**
93
- * @experimental
94
- * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
95
- */
96
- const ThemeStyle = primitiveWithForwardRef.primitiveWithForwardRef(ThemeStylePrimitive);
97
94
  ThemeStyle.displayName = 'ThemeStyle';
98
95
 
99
96
  exports.Style = Style;
@@ -1,9 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { createComponentCSS } from '@aws-amplify/ui';
3
- import { primitiveWithForwardRef } from '../../primitives/utils/primitiveWithForwardRef.mjs';
4
3
  import { Style } from './Style.mjs';
5
4
 
6
- const ComponentStylePrimitive = ({ theme, componentThemes = [], ...rest }, ref) => {
5
+ /**
6
+ * @experimental
7
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
8
+ */
9
+ const ComponentStyle = ({ theme, componentThemes = [], ...rest }) => {
7
10
  if (!theme || !componentThemes.length) {
8
11
  return null;
9
12
  }
@@ -11,13 +14,8 @@ const ComponentStylePrimitive = ({ theme, componentThemes = [], ...rest }, ref)
11
14
  theme,
12
15
  components: componentThemes,
13
16
  });
14
- return React.createElement(Style, { ...rest, ref: ref, cssText: cssText });
17
+ return React.createElement(Style, { ...rest, cssText: cssText });
15
18
  };
16
- /**
17
- * @experimental
18
- * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
19
- */
20
- const ComponentStyle = primitiveWithForwardRef(ComponentStylePrimitive);
21
19
  ComponentStyle.displayName = 'ComponentStyle';
22
20
 
23
21
  export { ComponentStyle };
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { createGlobalCSS } from '@aws-amplify/ui';
3
+ import { Style } from './Style.mjs';
4
+
5
+ /**
6
+ * @experimental
7
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
8
+ */
9
+ const GlobalStyle = ({ styles, ...rest }) => {
10
+ if (!styles) {
11
+ return null;
12
+ }
13
+ const cssText = createGlobalCSS(styles);
14
+ return React.createElement(Style, { ...rest, cssText: cssText });
15
+ };
16
+ GlobalStyle.displayName = 'GlobalStyle';
17
+
18
+ export { GlobalStyle };
@@ -1,7 +1,10 @@
1
1
  import * as React from 'react';
2
- import { primitiveWithForwardRef } from '../../primitives/utils/primitiveWithForwardRef.mjs';
3
2
 
4
- const StylePrimitive = ({ cssText, ...rest }, ref) => {
3
+ /**
4
+ * @experimental
5
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
6
+ */
7
+ const Style = ({ cssText, ...rest }) => {
5
8
  /*
6
9
  Only inject theme CSS variables if given a theme.
7
10
  The CSS file users import already has the default theme variables in it.
@@ -50,15 +53,10 @@ const StylePrimitive = ({ cssText, ...rest }, ref) => {
50
53
  if (cssText === undefined || /<\/style/i.test(cssText)) {
51
54
  return null;
52
55
  }
53
- return (React.createElement("style", { ...rest, ref: ref,
56
+ return (React.createElement("style", { ...rest,
54
57
  // eslint-disable-next-line react/no-danger
55
58
  dangerouslySetInnerHTML: { __html: cssText } }));
56
59
  };
57
- /**
58
- * @experimental
59
- * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
60
- */
61
- const Style = primitiveWithForwardRef(StylePrimitive);
62
60
  Style.displayName = 'Style';
63
61
 
64
62
  export { Style };
@@ -1,18 +1,16 @@
1
1
  import * as React from 'react';
2
- import { primitiveWithForwardRef } from '../../primitives/utils/primitiveWithForwardRef.mjs';
3
2
  import { Style } from './Style.mjs';
4
3
 
5
- const ThemeStylePrimitive = ({ theme, nonce, ...rest }, ref) => {
6
- if (!theme)
7
- return null;
8
- const { name, cssText } = theme;
9
- return (React.createElement(Style, { ...rest, ref: ref, cssText: cssText, nonce: nonce, id: `amplify-theme-${name}` }));
10
- };
11
4
  /**
12
5
  * @experimental
13
6
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
14
7
  */
15
- const ThemeStyle = primitiveWithForwardRef(ThemeStylePrimitive);
8
+ const ThemeStyle = ({ theme, ...rest }) => {
9
+ if (!theme)
10
+ return null;
11
+ const { name, cssText } = theme;
12
+ return React.createElement(Style, { ...rest, cssText: cssText, id: `amplify-theme-${name}` });
13
+ };
16
14
  ThemeStyle.displayName = 'ThemeStyle';
17
15
 
18
16
  export { ThemeStyle };
@@ -1,3 +1,4 @@
1
1
  export { ThemeStyle } from './components/ThemeProvider/ThemeStyle.mjs';
2
2
  export { ComponentStyle } from './components/ThemeProvider/ComponentStyle.mjs';
3
+ export { GlobalStyle } from './components/ThemeProvider/GlobalStyle.mjs';
3
4
  export { createComponentClasses, createTheme, defaultDarkModeOverride, defaultTheme, defineComponentTheme } from '@aws-amplify/ui';
@@ -1,3 +1,3 @@
1
- const VERSION = '6.5.0';
1
+ const VERSION = '6.5.1';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -6,16 +6,15 @@ 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-4b189104.js');
9
+ var Field = require('./Field-3db91851.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-1fee4302.js');
17
+ var ThemeStyle = require('./ThemeStyle-7d5abbc4.js');
19
18
  require('@aws-amplify/core');
20
19
  require('aws-amplify/auth');
21
20
 
@@ -93,13 +92,13 @@ const AlertPrimitive = ({ buttonRef, children, className, dismissButtonLabel = F
93
92
  /**
94
93
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/alert)
95
94
  */
96
- const Alert = primitiveWithForwardRef.primitiveWithForwardRef(AlertPrimitive);
95
+ const Alert = Field.primitiveWithForwardRef(AlertPrimitive);
97
96
  Alert.displayName = 'Alert';
98
97
 
99
98
  const AutocompleteOptionPrimitive = ({ children, className, isActive, ...rest }, ref) => {
100
99
  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
100
  };
102
- const AutocompleteOption = primitiveWithForwardRef.primitiveWithForwardRef(AutocompleteOptionPrimitive);
101
+ const AutocompleteOption = Field.primitiveWithForwardRef(AutocompleteOptionPrimitive);
103
102
  AutocompleteOption.displayName = 'AutocompleteOption';
104
103
 
105
104
  /**
@@ -141,7 +140,7 @@ const ScrollViewPrimitive = ({ children, className, orientation, autoScroll, ...
141
140
  /**
142
141
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/scrollview)
143
142
  */
144
- const ScrollView = primitiveWithForwardRef.primitiveWithForwardRef(ScrollViewPrimitive);
143
+ const ScrollView = Field.primitiveWithForwardRef(ScrollViewPrimitive);
145
144
  ScrollView.displayName = 'ScrollView';
146
145
 
147
146
  const MenuHeader = ({ children }) => {
@@ -168,7 +167,7 @@ const AutocompleteMenuPrimitive = ({ ariaLabel, children, Header = null, Footer
168
167
  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
168
  React__namespace.createElement(MenuFooter, null, Footer)))));
170
169
  };
171
- const AutocompleteMenu = primitiveWithForwardRef.primitiveWithForwardRef(AutocompleteMenuPrimitive);
170
+ const AutocompleteMenu = Field.primitiveWithForwardRef(AutocompleteMenuPrimitive);
172
171
  AutocompleteMenu.displayName = 'AutocompleteMenu';
173
172
 
174
173
  // Source: https://github.com/radix-ui/primitives/blob/7ae63b6cce6ea53ea5d65b6d411894c004b38f47/packages/react/use-layout-effect/src/useLayoutEffect.tsx
@@ -411,7 +410,7 @@ const HighlightMatchPrimitive = ({ children, className, query, testId, ...rest }
411
410
  /**
412
411
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/highlightmatch)
413
412
  */
414
- const HighlightMatch = primitiveWithForwardRef.primitiveWithForwardRef(HighlightMatchPrimitive);
413
+ const HighlightMatch = Field.primitiveWithForwardRef(HighlightMatchPrimitive);
415
414
  HighlightMatch.displayName = 'HighlightMatch';
416
415
 
417
416
  const ariaLabelText = Field.ComponentText.SearchField.searchButtonLabel;
@@ -419,7 +418,7 @@ const SearchFieldButtonPrimitive = ({ size, ...props }, ref) => {
419
418
  const icons = Field.useIcons('searchField');
420
419
  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
420
  };
422
- const SearchFieldButton = primitiveWithForwardRef.primitiveWithForwardRef(SearchFieldButtonPrimitive);
421
+ const SearchFieldButton = Field.primitiveWithForwardRef(SearchFieldButtonPrimitive);
423
422
  SearchFieldButton.displayName = 'SearchFieldButton';
424
423
 
425
424
  const FieldGroupPrimitive = ({ children, className, innerEndComponent, innerStartComponent, orientation = 'horizontal', outerEndComponent, outerStartComponent, variation, ...rest }, ref) => {
@@ -441,7 +440,7 @@ const FieldGroupPrimitive = ({ children, className, innerEndComponent, innerStar
441
440
  innerEndComponent && (React__namespace.createElement(Field.View, { className: ui.ComponentClassName.FieldGroupInnerEnd }, innerEndComponent))),
442
441
  outerEndComponent && (React__namespace.createElement(Field.View, { className: ui.classNames(ui.ComponentClassName.FieldGroupOuterEnd, ui.classNameModifier(ui.ComponentClassName.FieldGroupOuterEnd, variation)) }, outerEndComponent))));
443
442
  };
444
- const FieldGroup = primitiveWithForwardRef.primitiveWithForwardRef(FieldGroupPrimitive);
443
+ const FieldGroup = Field.primitiveWithForwardRef(FieldGroupPrimitive);
445
444
  FieldGroup.displayName = 'FieldGroup';
446
445
 
447
446
  const InputPrimitive = ({ autoComplete, checked, className, defaultChecked, defaultValue, id, isDisabled, isReadOnly, isRequired, size, type = 'text', hasError = false, value, variation, ...rest }, ref) => {
@@ -449,7 +448,7 @@ const InputPrimitive = ({ autoComplete, checked, className, defaultChecked, defa
449
448
  const { isFieldsetDisabled } = Field.useFieldset();
450
449
  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
450
  };
452
- const Input = primitiveWithForwardRef.primitiveWithForwardRef(InputPrimitive);
451
+ const Input = Field.primitiveWithForwardRef(InputPrimitive);
453
452
  Input.displayName = 'Input';
454
453
 
455
454
  const isStyleKey = (prop) => {
@@ -525,7 +524,7 @@ const TextFieldPrimitive = (props, ref) => {
525
524
  /**
526
525
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/textfield)
527
526
  */
528
- const TextField = primitiveWithForwardRef.primitiveWithForwardRef(TextFieldPrimitive);
527
+ const TextField = Field.primitiveWithForwardRef(TextFieldPrimitive);
529
528
  TextField.displayName = 'TextField';
530
529
 
531
530
  const DEFAULT_KEYS = new Set([Field.ESCAPE_KEY, Field.ENTER_KEY]);
@@ -603,7 +602,7 @@ const SearchFieldPrimitive = ({ autoComplete = 'off', className, isDisabled, cle
603
602
  /**
604
603
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/searchfield)
605
604
  */
606
- const SearchField = primitiveWithForwardRef.primitiveWithForwardRef(SearchFieldPrimitive);
605
+ const SearchField = Field.primitiveWithForwardRef(SearchFieldPrimitive);
607
606
  SearchField.displayName = 'SearchField';
608
607
 
609
608
  const AutocompletePrimitive = ({ className, defaultValue, value, isLoading = false, menuSlots = {}, options, optionFilter, onBlur, onChange, onClear, onClick, onSelect, onSubmit, renderOption, testId, ...rest }, ref) => {
@@ -659,14 +658,14 @@ const AutocompletePrimitive = ({ className, defaultValue, value, isLoading = fal
659
658
  /**
660
659
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/autocomplete)
661
660
  */
662
- const Autocomplete = primitiveWithForwardRef.primitiveWithForwardRef(AutocompletePrimitive);
661
+ const Autocomplete = Field.primitiveWithForwardRef(AutocompletePrimitive);
663
662
  Autocomplete.displayName = 'Autocomplete';
664
663
 
665
664
  const ImagePrimitive = ({ className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: "img", ref: ref, className: ui.classNames(ui.ComponentClassName.Image, className), ...rest }));
666
665
  /**
667
666
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/image)
668
667
  */
669
- const Image = primitiveWithForwardRef.primitiveWithForwardRef(ImagePrimitive);
668
+ const Image = Field.primitiveWithForwardRef(ImagePrimitive);
670
669
  Image.displayName = 'Image';
671
670
 
672
671
  const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src, alt, isLoading, ...rest }, ref) => {
@@ -680,7 +679,7 @@ const AvatarPrimitive = ({ className, children, variation, colorTheme, size, src
680
679
  /**
681
680
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/avatar)
682
681
  */
683
- const Avatar = primitiveWithForwardRef.primitiveWithForwardRef(AvatarPrimitive);
682
+ const Avatar = Field.primitiveWithForwardRef(AvatarPrimitive);
684
683
  Avatar.displayName = 'Avatar';
685
684
 
686
685
  const BadgePrimitive = ({ className, children, variation, size, ...rest }, ref) => {
@@ -690,7 +689,7 @@ const BadgePrimitive = ({ className, children, variation, size, ...rest }, ref)
690
689
  /**
691
690
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/badge)
692
691
  */
693
- const Badge = primitiveWithForwardRef.primitiveWithForwardRef(BadgePrimitive);
692
+ const Badge = Field.primitiveWithForwardRef(BadgePrimitive);
694
693
  Badge.displayName = 'Badge';
695
694
 
696
695
  const BreadcrumbItemPrimitive = ({ className, children, as = 'li', ...rest }, ref) => {
@@ -700,7 +699,7 @@ const BreadcrumbItemPrimitive = ({ className, children, as = 'li', ...rest }, re
700
699
  /**
701
700
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
702
701
  */
703
- const BreadcrumbItem = primitiveWithForwardRef.primitiveWithForwardRef(BreadcrumbItemPrimitive);
702
+ const BreadcrumbItem = Field.primitiveWithForwardRef(BreadcrumbItemPrimitive);
704
703
  BreadcrumbItem.displayName = 'Breadcrumbs.Item';
705
704
 
706
705
  const LinkPrimitive = ({ as = 'a', children, className, isExternal, ...rest }, ref) => {
@@ -709,7 +708,7 @@ const LinkPrimitive = ({ as = 'a', children, className, isExternal, ...rest }, r
709
708
  /**
710
709
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/link)
711
710
  */
712
- const Link = primitiveWithForwardRef.primitiveWithForwardRef(LinkPrimitive);
711
+ const Link = Field.primitiveWithForwardRef(LinkPrimitive);
713
712
  Link.displayName = 'Link';
714
713
 
715
714
  const BreadcrumbLinkPrimitive = ({ className, children, href, isCurrent, ...rest }, ref) => {
@@ -726,7 +725,7 @@ const BreadcrumbLinkPrimitive = ({ className, children, href, isCurrent, ...rest
726
725
  /**
727
726
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
728
727
  */
729
- const BreadcrumbLink = primitiveWithForwardRef.primitiveWithForwardRef(BreadcrumbLinkPrimitive);
728
+ const BreadcrumbLink = Field.primitiveWithForwardRef(BreadcrumbLinkPrimitive);
730
729
  BreadcrumbLink.displayName = 'Breadcrumbs.Link';
731
730
 
732
731
  const BreadcrumbSeparatorPrimitive = ({ className, children = '/', as = 'span', ...rest }, ref) => {
@@ -736,7 +735,7 @@ const BreadcrumbSeparatorPrimitive = ({ className, children = '/', as = 'span',
736
735
  /**
737
736
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
738
737
  */
739
- const BreadcrumbSeparator = primitiveWithForwardRef.primitiveWithForwardRef(BreadcrumbSeparatorPrimitive);
738
+ const BreadcrumbSeparator = Field.primitiveWithForwardRef(BreadcrumbSeparatorPrimitive);
740
739
  BreadcrumbSeparator.displayName = 'Breadcrumbs.Separator';
741
740
 
742
741
  const BreadcrumbContainerPrimitive = ({ className, children, ...rest }, ref) => {
@@ -748,7 +747,7 @@ const BreadcrumbContainerPrimitive = ({ className, children, ...rest }, ref) =>
748
747
  /**
749
748
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
750
749
  */
751
- const BreadcrumbContainer = primitiveWithForwardRef.primitiveWithForwardRef(BreadcrumbContainerPrimitive);
750
+ const BreadcrumbContainer = Field.primitiveWithForwardRef(BreadcrumbContainerPrimitive);
752
751
  BreadcrumbContainer.displayName = 'Breadcrumbs.Container';
753
752
 
754
753
  const BreadcrumbsPrimitive = ({ className, items, separator = React__namespace.createElement(BreadcrumbSeparator, null), ...rest }, ref) => {
@@ -763,7 +762,7 @@ const BreadcrumbsPrimitive = ({ className, items, separator = React__namespace.c
763
762
  /**
764
763
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/breadcrumbs)
765
764
  */
766
- const Breadcrumbs = Object.assign(primitiveWithForwardRef.primitiveWithForwardRef(BreadcrumbsPrimitive), {
765
+ const Breadcrumbs = Object.assign(Field.primitiveWithForwardRef(BreadcrumbsPrimitive), {
767
766
  Item: BreadcrumbItem,
768
767
  Link: BreadcrumbLink,
769
768
  Separator: BreadcrumbSeparator,
@@ -781,7 +780,7 @@ const ButtonGroupPrimitive = ({ className, children, isDisabled: _isDisabled = f
781
780
  /**
782
781
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/button#buttongroup)
783
782
  */
784
- const ButtonGroup = primitiveWithForwardRef.primitiveWithForwardRef(ButtonGroupPrimitive);
783
+ const ButtonGroup = Field.primitiveWithForwardRef(ButtonGroupPrimitive);
785
784
  ButtonGroup.displayName = 'ButtonGroup';
786
785
 
787
786
  const CardPrimitive = ({ className, children, variation, ...rest }, ref) => {
@@ -790,14 +789,14 @@ const CardPrimitive = ({ className, children, variation, ...rest }, ref) => {
790
789
  /**
791
790
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/card)
792
791
  */
793
- const Card = primitiveWithForwardRef.primitiveWithForwardRef(CardPrimitive);
792
+ const Card = Field.primitiveWithForwardRef(CardPrimitive);
794
793
  Card.displayName = 'Card';
795
794
 
796
795
  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
796
  /**
798
797
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/visuallyhidden)
799
798
  */
800
- const VisuallyHidden = primitiveWithForwardRef.primitiveWithForwardRef(VisuallyHiddenPrimitive);
799
+ const VisuallyHidden = Field.primitiveWithForwardRef(VisuallyHiddenPrimitive);
801
800
  VisuallyHidden.displayName = 'VisuallyHidden';
802
801
 
803
802
  const CheckboxPrimitive = ({ checked: controlledChecked, className, defaultChecked, hasError, isDisabled, isIndeterminate, label, labelHidden, labelPosition, onBlur: _onBlur, onFocus: _onFocus, onChange: _onChange, testId, inputStyles, ..._rest }, ref) => {
@@ -862,7 +861,7 @@ const CheckboxPrimitive = ({ checked: controlledChecked, className, defaultCheck
862
861
  }), "data-disabled": shouldBeDisabled, testId: labelTestId }, label)),
863
862
  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
863
  };
865
- const Checkbox = primitiveWithForwardRef.primitiveWithForwardRef(CheckboxPrimitive);
864
+ const Checkbox = Field.primitiveWithForwardRef(CheckboxPrimitive);
866
865
  Checkbox.displayName = 'Checkbox';
867
866
 
868
867
  const CheckboxFieldPrimitive = ({ className, errorMessage, hasError = false, labelHidden = false, labelPosition, testId, size, ...rest }, ref) => {
@@ -874,14 +873,14 @@ const CheckboxFieldPrimitive = ({ className, errorMessage, hasError = false, lab
874
873
  /**
875
874
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/checkboxfield)
876
875
  */
877
- const CheckboxField = primitiveWithForwardRef.primitiveWithForwardRef(CheckboxFieldPrimitive);
876
+ const CheckboxField = Field.primitiveWithForwardRef(CheckboxFieldPrimitive);
878
877
  CheckboxField.displayName = 'CheckboxField';
879
878
 
880
879
  const GridPrimitive = ({ className, children, ...rest }, ref) => (React__namespace.createElement(Field.View, { className: ui.classNames(ui.ComponentClassName.Grid, className), ref: ref, ...rest }, children));
881
880
  /**
882
881
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/grid)
883
882
  */
884
- const Grid = primitiveWithForwardRef.primitiveWithForwardRef(GridPrimitive);
883
+ const Grid = Field.primitiveWithForwardRef(GridPrimitive);
885
884
  Grid.displayName = 'Grid';
886
885
 
887
886
  const ELLIPSIS = '...';
@@ -1039,7 +1038,7 @@ const PaginationPrimitive = ({ className, currentPage = 1, totalPages, hasMorePa
1039
1038
  /**
1040
1039
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/pagination)
1041
1040
  */
1042
- const Pagination = primitiveWithForwardRef.primitiveWithForwardRef(PaginationPrimitive);
1041
+ const Pagination = Field.primitiveWithForwardRef(PaginationPrimitive);
1043
1042
  Pagination.displayName = 'Pagination';
1044
1043
 
1045
1044
  const usePagination = (props) => {
@@ -1158,7 +1157,7 @@ const DividerPrimitive = ({ className, orientation = 'horizontal', size, label,
1158
1157
  /**
1159
1158
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/divider)
1160
1159
  */
1161
- const Divider = primitiveWithForwardRef.primitiveWithForwardRef(DividerPrimitive);
1160
+ const Divider = Field.primitiveWithForwardRef(DividerPrimitive);
1162
1161
  Divider.displayName = 'Divider';
1163
1162
 
1164
1163
  const DropZoneContext = React__namespace.createContext('inactive');
@@ -1174,7 +1173,7 @@ const Container = ({ className, children, testId, isDisabled, onDragEnter, onDra
1174
1173
  : { onDragEnter, onDragLeave, onDragOver, onDragStart, onDrop };
1175
1174
  return (React__default["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
1175
  };
1177
- const DropZoneContainer = primitiveWithForwardRef.primitiveWithForwardRef(Container);
1176
+ const DropZoneContainer = Field.primitiveWithForwardRef(Container);
1178
1177
  DropZoneContainer.displayName = 'DropZoneContainer';
1179
1178
 
1180
1179
  /**
@@ -1224,7 +1223,7 @@ const DropZonePrimitive = ({ children, testId, isDisabled, acceptedFileTypes, on
1224
1223
  /**
1225
1224
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/dropzone)
1226
1225
  */
1227
- const DropZone = Object.assign(primitiveWithForwardRef.primitiveWithForwardRef(DropZonePrimitive), {
1226
+ const DropZone = Object.assign(Field.primitiveWithForwardRef(DropZonePrimitive), {
1228
1227
  Accepted,
1229
1228
  Rejected,
1230
1229
  Default,
@@ -1243,7 +1242,7 @@ const AccordionItemPrimitive = ({ children, className, value, as = 'details', ..
1243
1242
  /**
1244
1243
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
1245
1244
  */
1246
- const AccordionItem = primitiveWithForwardRef.primitiveWithForwardRef(AccordionItemPrimitive);
1245
+ const AccordionItem = Field.primitiveWithForwardRef(AccordionItemPrimitive);
1247
1246
  AccordionItem.displayName = 'AccordionItem';
1248
1247
 
1249
1248
  const AccordionContentPrimitive = ({ className, children, ...rest }, ref) => {
@@ -1252,7 +1251,7 @@ const AccordionContentPrimitive = ({ className, children, ...rest }, ref) => {
1252
1251
  /**
1253
1252
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
1254
1253
  */
1255
- const AccordionContent = primitiveWithForwardRef.primitiveWithForwardRef(AccordionContentPrimitive);
1254
+ const AccordionContent = Field.primitiveWithForwardRef(AccordionContentPrimitive);
1256
1255
  AccordionContent.displayName = 'Accordion.Content';
1257
1256
 
1258
1257
  const AccordionTriggerPrimitive = ({ children, className, ...rest }, ref) => {
@@ -1272,7 +1271,7 @@ const AccordionTriggerPrimitive = ({ children, className, ...rest }, ref) => {
1272
1271
  /**
1273
1272
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
1274
1273
  */
1275
- const AccordionTrigger = primitiveWithForwardRef.primitiveWithForwardRef(AccordionTriggerPrimitive);
1274
+ const AccordionTrigger = Field.primitiveWithForwardRef(AccordionTriggerPrimitive);
1276
1275
  AccordionTrigger.displayName = 'Accordion.Trigger';
1277
1276
 
1278
1277
  const AccordionIconPrimitive = ({ className, as = 'span', ...rest }, ref) => {
@@ -1282,7 +1281,7 @@ const AccordionIconPrimitive = ({ className, as = 'span', ...rest }, ref) => {
1282
1281
  /**
1283
1282
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
1284
1283
  */
1285
- const AccordionIcon = primitiveWithForwardRef.primitiveWithForwardRef(AccordionIconPrimitive);
1284
+ const AccordionIcon = Field.primitiveWithForwardRef(AccordionIconPrimitive);
1286
1285
  AccordionIcon.displayName = 'Accordion.Icon';
1287
1286
 
1288
1287
  const AccordionContainerPrimitive = ({ children, className, defaultValue, allowMultiple, preventCollapse, onValueChange, testId, value: controlledValue, ...rest }, ref) => {
@@ -1324,7 +1323,7 @@ const AccordionContainerPrimitive = ({ children, className, defaultValue, allowM
1324
1323
  /**
1325
1324
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
1326
1325
  */
1327
- const AccordionContainer = primitiveWithForwardRef.primitiveWithForwardRef(AccordionContainerPrimitive);
1326
+ const AccordionContainer = Field.primitiveWithForwardRef(AccordionContainerPrimitive);
1328
1327
  AccordionContainer.displayName = 'Accordion.Container';
1329
1328
 
1330
1329
  const AccordionPrimitive = ({ items, ...rest }, ref) => {
@@ -1337,7 +1336,7 @@ const AccordionPrimitive = ({ items, ...rest }, ref) => {
1337
1336
  /**
1338
1337
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/accordion)
1339
1338
  */
1340
- const Accordion = Object.assign(primitiveWithForwardRef.primitiveWithForwardRef(AccordionPrimitive), {
1339
+ const Accordion = Object.assign(Field.primitiveWithForwardRef(AccordionPrimitive), {
1341
1340
  Container: AccordionContainer,
1342
1341
  Content: AccordionContent,
1343
1342
  Icon: AccordionIcon,
@@ -1367,7 +1366,7 @@ const FieldsetPrimitive = ({ children, className, isDisabled, legend, legendHidd
1367
1366
  /**
1368
1367
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/fieldset)
1369
1368
  */
1370
- const Fieldset = primitiveWithForwardRef.primitiveWithForwardRef(FieldsetPrimitive);
1369
+ const Fieldset = Field.primitiveWithForwardRef(FieldsetPrimitive);
1371
1370
  Fieldset.displayName = 'Fieldset';
1372
1371
 
1373
1372
  const headingLevels = {
@@ -1382,7 +1381,7 @@ const HeadingPrimitive = ({ className, children, isTruncated, level = 6, ...rest
1382
1381
  /**
1383
1382
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/heading)
1384
1383
  */
1385
- const Heading = primitiveWithForwardRef.primitiveWithForwardRef(HeadingPrimitive);
1384
+ const Heading = Field.primitiveWithForwardRef(HeadingPrimitive);
1386
1385
  Heading.displayName = 'Heading';
1387
1386
 
1388
1387
  /**
@@ -1393,7 +1392,7 @@ const MenuButtonPrimitive = ({ ariaLabel, className, children, isDisabled = fals
1393
1392
  const componentClasses = ui.classNames(ui.ComponentClassName.Button, ui.classNameModifier(ui.ComponentClassName.Button, size), ui.classNameModifier(ui.ComponentClassName.Button, variation), className);
1394
1393
  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
1394
  };
1396
- const MenuButton = primitiveWithForwardRef.primitiveWithForwardRef(MenuButtonPrimitive);
1395
+ const MenuButton = Field.primitiveWithForwardRef(MenuButtonPrimitive);
1397
1396
  MenuButton.displayName = 'MenuButton';
1398
1397
 
1399
1398
  // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
@@ -1411,7 +1410,7 @@ const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size,
1411
1410
  /**
1412
1411
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
1413
1412
  */
1414
- const Menu = primitiveWithForwardRef.primitiveWithForwardRef(MenuPrimitive);
1413
+ const Menu = Field.primitiveWithForwardRef(MenuPrimitive);
1415
1414
  Menu.displayName = 'Menu';
1416
1415
 
1417
1416
  // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
@@ -1426,13 +1425,13 @@ const MenuItemPrimitive = ({ children, className, ...rest }, ref) => {
1426
1425
  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
1426
  }, children)));
1428
1427
  };
1429
- const MenuItem = primitiveWithForwardRef.primitiveWithForwardRef(MenuItemPrimitive);
1428
+ const MenuItem = Field.primitiveWithForwardRef(MenuItemPrimitive);
1430
1429
  MenuItem.displayName = 'MenuItem';
1431
1430
 
1432
1431
  const MessageHeadingPrimitive = ({ children, className, ...rest }, ref) => {
1433
1432
  return (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.MessageHeading, className), ref: ref, ...rest }, children));
1434
1433
  };
1435
- const MessageHeading = primitiveWithForwardRef.primitiveWithForwardRef(MessageHeadingPrimitive);
1434
+ const MessageHeading = Field.primitiveWithForwardRef(MessageHeadingPrimitive);
1436
1435
  MessageHeading.displayName = 'MessageHeading';
1437
1436
 
1438
1437
  const MessageContext = React__namespace.createContext({
@@ -1461,7 +1460,7 @@ const MessageIconPrimitive = ({ className, ...rest }, ref) => {
1461
1460
  }
1462
1461
  return icon ? (React__namespace.createElement(Field.View, { className: ui.classNames(ui.ComponentClassName.MessageIcon, className), "aria-hidden": "true", ref: ref, ...rest }, icon)) : null;
1463
1462
  };
1464
- const MessageIcon = primitiveWithForwardRef.primitiveWithForwardRef(MessageIconPrimitive);
1463
+ const MessageIcon = Field.primitiveWithForwardRef(MessageIconPrimitive);
1465
1464
  MessageIcon.displayName = 'MessageIcon';
1466
1465
 
1467
1466
  const MessageDismissPrimitive = ({ onDismiss, dismissLabel, hasIcon = true, children, className, ...rest }, ref) => {
@@ -1477,13 +1476,13 @@ const MessageDismissPrimitive = ({ onDismiss, dismissLabel, hasIcon = true, chil
1477
1476
  hasIcon ? icons?.close ?? React__namespace.createElement(Field.IconClose, { "aria-hidden": "true" }) : null,
1478
1477
  children ? (children) : (React__namespace.createElement(VisuallyHidden, null, dismissLabel ? dismissLabel : Field.ComponentText.Message.dismissLabel))));
1479
1478
  };
1480
- const MessageDismiss = primitiveWithForwardRef.primitiveWithForwardRef(MessageDismissPrimitive);
1479
+ const MessageDismiss = Field.primitiveWithForwardRef(MessageDismissPrimitive);
1481
1480
  MessageDismiss.displayName = 'MessageContent';
1482
1481
 
1483
1482
  const MessageContentPrimitive = ({ children, className, ...rest }, ref) => {
1484
1483
  return (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.MessageContent, className), ref: ref, ...rest }, children));
1485
1484
  };
1486
- const MessageContent = primitiveWithForwardRef.primitiveWithForwardRef(MessageContentPrimitive);
1485
+ const MessageContent = Field.primitiveWithForwardRef(MessageContentPrimitive);
1487
1486
  MessageContent.displayName = 'MessageContent';
1488
1487
 
1489
1488
  const MessageContainerPrimitive = ({ children, className, colorTheme = 'neutral', variation = 'filled', ...rest }, ref) => {
@@ -1495,7 +1494,7 @@ const MessageContainerPrimitive = ({ children, className, colorTheme = 'neutral'
1495
1494
  }), [colorTheme, dismissed]);
1496
1495
  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
1496
  };
1498
- const MessageContainer = primitiveWithForwardRef.primitiveWithForwardRef(MessageContainerPrimitive);
1497
+ const MessageContainer = Field.primitiveWithForwardRef(MessageContainerPrimitive);
1499
1498
  MessageContainer.displayName = 'MessageContainer';
1500
1499
 
1501
1500
  const MessagePrimitive = ({ children, heading, dismissLabel, isDismissible, onDismiss, hasIcon = true, colorTheme = 'neutral', variation = 'filled', ...rest }, ref) => {
@@ -1509,7 +1508,7 @@ const MessagePrimitive = ({ children, heading, dismissLabel, isDismissible, onDi
1509
1508
  /**
1510
1509
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/message)
1511
1510
  */
1512
- const Message = primitiveWithForwardRef.primitiveWithForwardRef(MessagePrimitive);
1511
+ const Message = Field.primitiveWithForwardRef(MessagePrimitive);
1513
1512
  Message.displayName = 'Message';
1514
1513
 
1515
1514
  const { passwordIsHidden, passwordIsShown, showPassword } = Field.ComponentText.PasswordField;
@@ -1525,7 +1524,7 @@ const ShowPasswordButtonPrimitive = ({ fieldType, passwordIsHiddenLabel = passwo
1525
1524
  : passwordIsShownLabel),
1526
1525
  icon));
1527
1526
  };
1528
- const ShowPasswordButton = primitiveWithForwardRef.primitiveWithForwardRef(ShowPasswordButtonPrimitive);
1527
+ const ShowPasswordButton = Field.primitiveWithForwardRef(ShowPasswordButtonPrimitive);
1529
1528
  ShowPasswordButton.displayName = 'ShowPasswordButton';
1530
1529
 
1531
1530
  const PasswordFieldPrimitive = ({ autoComplete = 'current-password', label, className, hideShowPassword = false, passwordIsHiddenLabel, passwordIsShownLabel, showPasswordButtonLabel, showPasswordButtonRef, size, hasError, ...rest }, ref) => {
@@ -1543,7 +1542,7 @@ const PasswordFieldPrimitive = ({ autoComplete = 'current-password', label, clas
1543
1542
  /**
1544
1543
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/passwordfield)
1545
1544
  */
1546
- const PasswordField = primitiveWithForwardRef.primitiveWithForwardRef(PasswordFieldPrimitive);
1545
+ const PasswordField = Field.primitiveWithForwardRef(PasswordFieldPrimitive);
1547
1546
  PasswordField.displayName = 'PasswordField';
1548
1547
 
1549
1548
  const SelectPrimitive = ({ autoComplete, className, size, variation, value, defaultValue, hasError, icon, iconColor, children, placeholder, isDisabled, isRequired, isMultiple = false, selectSize = 1, ...rest }, ref) => {
@@ -1562,7 +1561,7 @@ const SelectPrimitive = ({ autoComplete, className, size, variation, value, defa
1562
1561
  children),
1563
1562
  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
1563
  };
1565
- const Select = primitiveWithForwardRef.primitiveWithForwardRef(SelectPrimitive);
1564
+ const Select = Field.primitiveWithForwardRef(SelectPrimitive);
1566
1565
  Select.displayName = 'Select';
1567
1566
 
1568
1567
  const selectFieldChildren = ({ children, options, }) => {
@@ -1596,7 +1595,7 @@ const SelectFieldPrimitive = (props, ref) => {
1596
1595
  /**
1597
1596
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/selectfield)
1598
1597
  */
1599
- const SelectField = primitiveWithForwardRef.primitiveWithForwardRef(SelectFieldPrimitive);
1598
+ const SelectField = Field.primitiveWithForwardRef(SelectFieldPrimitive);
1600
1599
  SelectField.displayName = 'SelectField';
1601
1600
 
1602
1601
  const DialCodeSelectPrimitive = ({ className, dialCodeList, isReadOnly, ...props }, ref) => {
@@ -1611,7 +1610,7 @@ const DialCodeSelectPrimitive = ({ className, dialCodeList, isReadOnly, ...props
1611
1610
  */
1612
1611
  , { "aria-disabled": isReadOnly, autoComplete: "tel-country-code", className: ui.classNames(ui.ComponentClassName.CountryCodeSelect, ui.ComponentClassName.DialCodeSelect, className), labelHidden: true, ref: ref, ...props }, dialCodeOptions));
1613
1612
  };
1614
- const DialCodeSelect = primitiveWithForwardRef.primitiveWithForwardRef(DialCodeSelectPrimitive);
1613
+ const DialCodeSelect = Field.primitiveWithForwardRef(DialCodeSelectPrimitive);
1615
1614
  DialCodeSelect.displayName = 'DialCodeSelect';
1616
1615
 
1617
1616
  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 +1619,7 @@ const PhoneNumberFieldPrimitive = ({ autoComplete = 'tel-national', className, d
1620
1619
  /**
1621
1620
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/phonenumberfield)
1622
1621
  */
1623
- const PhoneNumberField = primitiveWithForwardRef.primitiveWithForwardRef(PhoneNumberFieldPrimitive);
1622
+ const PhoneNumberField = Field.primitiveWithForwardRef(PhoneNumberFieldPrimitive);
1624
1623
  PhoneNumberField.displayName = 'PhoneNumberField';
1625
1624
 
1626
1625
  const PlaceholderPrimitive = ({ className, children, isLoaded, size, ...rest }, ref) => {
@@ -1632,7 +1631,7 @@ const PlaceholderPrimitive = ({ className, children, isLoaded, size, ...rest },
1632
1631
  /**
1633
1632
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/placeholder)
1634
1633
  */
1635
- const Placeholder = primitiveWithForwardRef.primitiveWithForwardRef(PlaceholderPrimitive);
1634
+ const Placeholder = Field.primitiveWithForwardRef(PlaceholderPrimitive);
1636
1635
  Placeholder.displayName = 'Placeholder';
1637
1636
 
1638
1637
  const defaultValue = { name: 'default' };
@@ -1659,7 +1658,7 @@ const RadioPrimitive = ({ children, className, id, isDisabled = false, testId, v
1659
1658
  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
1659
  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
1660
  };
1662
- const Radio = primitiveWithForwardRef.primitiveWithForwardRef(RadioPrimitive);
1661
+ const Radio = Field.primitiveWithForwardRef(RadioPrimitive);
1663
1662
  Radio.displayName = 'Radio';
1664
1663
 
1665
1664
  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 +1704,7 @@ const RadioGroupFieldPrimitive = ({ children, className, defaultValue, descripti
1705
1704
  /**
1706
1705
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/radiogroupfield)
1707
1706
  */
1708
- const RadioGroupField = primitiveWithForwardRef.primitiveWithForwardRef(RadioGroupFieldPrimitive);
1707
+ const RadioGroupField = Field.primitiveWithForwardRef(RadioGroupFieldPrimitive);
1709
1708
  RadioGroupField.displayName = 'RadioGroupField';
1710
1709
 
1711
1710
  const isIconFilled = (currentIconIndex, ratingValue) => {
@@ -1765,7 +1764,7 @@ const RatingPrimitive = ({ className, emptyColor, emptyIcon, fillColor, icon, ma
1765
1764
  /**
1766
1765
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/rating)
1767
1766
  */
1768
- const Rating = primitiveWithForwardRef.primitiveWithForwardRef(RatingPrimitive);
1767
+ const Rating = Field.primitiveWithForwardRef(RatingPrimitive);
1769
1768
  Rating.displayName = 'Rating';
1770
1769
 
1771
1770
  // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
@@ -1830,7 +1829,7 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
1830
1829
  /**
1831
1830
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/sliderfield)
1832
1831
  */
1833
- const SliderField = primitiveWithForwardRef.primitiveWithForwardRef(SliderFieldPrimitive);
1832
+ const SliderField = Field.primitiveWithForwardRef(SliderFieldPrimitive);
1834
1833
  SliderField.displayName = 'SliderField';
1835
1834
 
1836
1835
  const getCorrectSteppingValue = ({ max, min, step, value, }) => {
@@ -1980,7 +1979,7 @@ const StepperFieldPrimitive = (props, ref) => {
1980
1979
  /**
1981
1980
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/stepperfield)
1982
1981
  */
1983
- const StepperField = primitiveWithForwardRef.primitiveWithForwardRef(StepperFieldPrimitive);
1982
+ const StepperField = Field.primitiveWithForwardRef(StepperFieldPrimitive);
1984
1983
  StepperField.displayName = 'StepperField';
1985
1984
 
1986
1985
  const useSwitch = (props) => {
@@ -2037,7 +2036,7 @@ const SwitchFieldPrimitive = ({ className, defaultChecked, id, isChecked, isDisa
2037
2036
  /**
2038
2037
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/switchfield)
2039
2038
  */
2040
- const SwitchField = primitiveWithForwardRef.primitiveWithForwardRef(SwitchFieldPrimitive);
2039
+ const SwitchField = Field.primitiveWithForwardRef(SwitchFieldPrimitive);
2041
2040
  SwitchField.displayName = 'SwitchField';
2042
2041
 
2043
2042
  const TablePrimitive = ({ caption, children, className, highlightOnHover = false, size, variation, ...rest }, ref) => {
@@ -2049,29 +2048,29 @@ const TablePrimitive = ({ caption, children, className, highlightOnHover = false
2049
2048
  /**
2050
2049
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/table)
2051
2050
  */
2052
- const Table = primitiveWithForwardRef.primitiveWithForwardRef(TablePrimitive);
2051
+ const Table = Field.primitiveWithForwardRef(TablePrimitive);
2053
2052
  Table.displayName = 'Table';
2054
2053
 
2055
2054
  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 = primitiveWithForwardRef.primitiveWithForwardRef(TableBodyPrimitive);
2055
+ const TableBody = Field.primitiveWithForwardRef(TableBodyPrimitive);
2057
2056
  TableBody.displayName = 'TableBody';
2058
2057
 
2059
2058
  const TableCellPrimitive = ({ as: asElementTag = 'td', children, className, ...rest }, ref) => (React__namespace.createElement(Field.View, { as: asElementTag, className: ui.classNames(asElementTag === 'td'
2060
2059
  ? ui.ComponentClassName.TableTd
2061
2060
  : ui.ComponentClassName.TableTh, className), ref: ref, ...rest }, children));
2062
- const TableCell = primitiveWithForwardRef.primitiveWithForwardRef(TableCellPrimitive);
2061
+ const TableCell = Field.primitiveWithForwardRef(TableCellPrimitive);
2063
2062
  TableCell.displayName = 'TableCell';
2064
2063
 
2065
2064
  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 = primitiveWithForwardRef.primitiveWithForwardRef(TableFootPrimitive);
2065
+ const TableFoot = Field.primitiveWithForwardRef(TableFootPrimitive);
2067
2066
  TableFoot.displayName = 'TableFoot';
2068
2067
 
2069
2068
  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 = primitiveWithForwardRef.primitiveWithForwardRef(TableHeadPrimitive);
2069
+ const TableHead = Field.primitiveWithForwardRef(TableHeadPrimitive);
2071
2070
  TableHead.displayName = 'TableHead';
2072
2071
 
2073
2072
  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 = primitiveWithForwardRef.primitiveWithForwardRef(TableRowPrimitive);
2073
+ const TableRow = Field.primitiveWithForwardRef(TableRowPrimitive);
2075
2074
  TableRow.displayName = 'TableRow';
2076
2075
 
2077
2076
  const TabsContext = React__namespace.createContext({
@@ -2101,7 +2100,7 @@ const TabsItemPrimitive = ({ className, value, children, onClick, as = 'button',
2101
2100
  /**
2102
2101
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
2103
2102
  */
2104
- const TabsItem = primitiveWithForwardRef.primitiveWithForwardRef(TabsItemPrimitive);
2103
+ const TabsItem = Field.primitiveWithForwardRef(TabsItemPrimitive);
2105
2104
  TabsItem.displayName = 'Tabs.Item';
2106
2105
 
2107
2106
  const isValidTab = (child) => React__namespace.isValidElement(child);
@@ -2179,7 +2178,7 @@ const TabListPrimitive = ({ className, children, indicatorPosition, spacing, rol
2179
2178
  /**
2180
2179
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
2181
2180
  */
2182
- const TabList = primitiveWithForwardRef.primitiveWithForwardRef(TabListPrimitive);
2181
+ const TabList = Field.primitiveWithForwardRef(TabListPrimitive);
2183
2182
  TabList.displayName = 'Tabs.List';
2184
2183
 
2185
2184
  const TabPanelPrimitive = ({ className, value, children, role = 'tabpanel', ...rest }, ref) => {
@@ -2195,7 +2194,7 @@ const TabPanelPrimitive = ({ className, value, children, role = 'tabpanel', ...r
2195
2194
  /**
2196
2195
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
2197
2196
  */
2198
- const TabPanel = primitiveWithForwardRef.primitiveWithForwardRef(TabPanelPrimitive);
2197
+ const TabPanel = Field.primitiveWithForwardRef(TabPanelPrimitive);
2199
2198
  TabPanel.displayName = 'Tabs.Panel';
2200
2199
 
2201
2200
  const TabsContainerPrimitive = ({ children, defaultValue, className, value: controlledValue, onValueChange, isLazy, ...rest }, ref) => {
@@ -2225,7 +2224,7 @@ const TabsContainerPrimitive = ({ children, defaultValue, className, value: cont
2225
2224
  /**
2226
2225
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
2227
2226
  */
2228
- const TabsContainer = primitiveWithForwardRef.primitiveWithForwardRef(TabsContainerPrimitive);
2227
+ const TabsContainer = Field.primitiveWithForwardRef(TabsContainerPrimitive);
2229
2228
  TabsContainer.displayName = 'Tabs.Container';
2230
2229
 
2231
2230
  const TabsPrimitive = ({ items, indicatorPosition, justifyContent, spacing, ...rest }, ref) => {
@@ -2236,7 +2235,7 @@ const TabsPrimitive = ({ items, indicatorPosition, justifyContent, spacing, ...r
2236
2235
  /**
2237
2236
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/tabs)
2238
2237
  */
2239
- const Tabs = Object.assign(primitiveWithForwardRef.primitiveWithForwardRef(TabsPrimitive), {
2238
+ const Tabs = Object.assign(Field.primitiveWithForwardRef(TabsPrimitive), {
2240
2239
  Item: TabsItem,
2241
2240
  List: TabList,
2242
2241
  Panel: TabPanel,
@@ -2249,7 +2248,7 @@ const TextAreaPrimitive = ({ className, isDisabled, isReadOnly, isRequired, size
2249
2248
  const { isFieldsetDisabled } = Field.useFieldset();
2250
2249
  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
2250
  };
2252
- const TextArea = primitiveWithForwardRef.primitiveWithForwardRef(TextAreaPrimitive);
2251
+ const TextArea = Field.primitiveWithForwardRef(TextAreaPrimitive);
2253
2252
  TextArea.displayName = 'TextArea';
2254
2253
 
2255
2254
  // Updates the height of a <textarea> when the value changes.
@@ -2286,7 +2285,7 @@ const AutoresizeTextAreaPrimitive = ({ value, ...rest }, externalRef) => {
2286
2285
  });
2287
2286
  return React__namespace.createElement(TextArea, { ...rest, ref: composedRef, value: value });
2288
2287
  };
2289
- const AutoresizeTextArea = primitiveWithForwardRef.primitiveWithForwardRef(AutoresizeTextAreaPrimitive);
2288
+ const AutoresizeTextArea = Field.primitiveWithForwardRef(AutoresizeTextAreaPrimitive);
2290
2289
  AutoresizeTextArea.displayName = 'AutoresizeTextArea';
2291
2290
 
2292
2291
  const DEFAULT_ROW_COUNT = 3;
@@ -2314,7 +2313,7 @@ const TextAreaFieldPrimitive = (props, ref) => {
2314
2313
  /**
2315
2314
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/textareafield)
2316
2315
  */
2317
- const TextAreaField = primitiveWithForwardRef.primitiveWithForwardRef(TextAreaFieldPrimitive);
2316
+ const TextAreaField = Field.primitiveWithForwardRef(TextAreaFieldPrimitive);
2318
2317
  TextAreaField.displayName = 'TextAreaField';
2319
2318
 
2320
2319
  const useToggleButton = ({ isPressed, defaultPressed, onClick, onChange, value, }) => {
@@ -2350,7 +2349,7 @@ const ToggleButtonPrimitive = ({ className, children, defaultPressed = false, is
2350
2349
  /**
2351
2350
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/togglebutton)
2352
2351
  */
2353
- const ToggleButton = primitiveWithForwardRef.primitiveWithForwardRef(ToggleButtonPrimitive);
2352
+ const ToggleButton = Field.primitiveWithForwardRef(ToggleButtonPrimitive);
2354
2353
  ToggleButton.displayName = 'ToggleButton';
2355
2354
 
2356
2355
  const useToggleButtonGroup = ({ onChange, value, isExclusive = false, isSelectionRequired = false, }) => {
@@ -2410,7 +2409,7 @@ const ToggleButtonGroupPrimitive = ({ children, className, isExclusive, isSelect
2410
2409
  /**
2411
2410
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/togglebutton#togglebuttongroup)
2412
2411
  */
2413
- const ToggleButtonGroup = primitiveWithForwardRef.primitiveWithForwardRef(ToggleButtonGroupPrimitive);
2412
+ const ToggleButtonGroup = Field.primitiveWithForwardRef(ToggleButtonGroupPrimitive);
2414
2413
  ToggleButtonGroup.displayName = 'ToggleButtonGroup';
2415
2414
 
2416
2415
  var index$1 = /*#__PURE__*/Object.freeze({
@@ -2523,7 +2522,7 @@ const defaultDeleteUserDisplayText = {
2523
2522
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2524
2523
  };
2525
2524
 
2526
- const VERSION = '6.5.0';
2525
+ const VERSION = '6.5.1';
2527
2526
 
2528
2527
  const logger$2 = ui.getLogger('AccountSettings');
2529
2528
  const getIsDisabled = (formValues, validationError) => {
package/dist/internal.js CHANGED
@@ -2,14 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Field = require('./Field-4b189104.js');
5
+ var Field = require('./Field-3db91851.js');
6
6
  var React = require('react');
7
7
  var Storage = require('aws-amplify/storage');
8
8
  var ui = require('@aws-amplify/ui');
9
9
  var uiReactCore = require('@aws-amplify/ui-react-core');
10
10
  require('@aws-amplify/core');
11
11
  require('aws-amplify/auth');
12
- require('./primitiveWithForwardRef-7e929242.js');
13
12
 
14
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
14
 
package/dist/server.js CHANGED
@@ -2,10 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ThemeStyle = require('./ThemeStyle-1fee4302.js');
5
+ var ThemeStyle = require('./ThemeStyle-7d5abbc4.js');
6
6
  var React = require('react');
7
7
  var ui = require('@aws-amplify/ui');
8
- var primitiveWithForwardRef = require('./primitiveWithForwardRef-7e929242.js');
9
8
 
10
9
  function _interopNamespace(e) {
11
10
  if (e && e.__esModule) return e;
@@ -27,7 +26,11 @@ function _interopNamespace(e) {
27
26
 
28
27
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
28
 
30
- const ComponentStylePrimitive = ({ theme, componentThemes = [], ...rest }, ref) => {
29
+ /**
30
+ * @experimental
31
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
32
+ */
33
+ const ComponentStyle = ({ theme, componentThemes = [], ...rest }) => {
31
34
  if (!theme || !componentThemes.length) {
32
35
  return null;
33
36
  }
@@ -35,14 +38,22 @@ const ComponentStylePrimitive = ({ theme, componentThemes = [], ...rest }, ref)
35
38
  theme,
36
39
  components: componentThemes,
37
40
  });
38
- return React__namespace.createElement(ThemeStyle.Style, { ...rest, ref: ref, cssText: cssText });
41
+ return React__namespace.createElement(ThemeStyle.Style, { ...rest, cssText: cssText });
39
42
  };
43
+ ComponentStyle.displayName = 'ComponentStyle';
44
+
40
45
  /**
41
46
  * @experimental
42
47
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
43
48
  */
44
- const ComponentStyle = primitiveWithForwardRef.primitiveWithForwardRef(ComponentStylePrimitive);
45
- ComponentStyle.displayName = 'ComponentStyle';
49
+ const GlobalStyle = ({ styles, ...rest }) => {
50
+ if (!styles) {
51
+ return null;
52
+ }
53
+ const cssText = ui.createGlobalCSS(styles);
54
+ return React__namespace.createElement(ThemeStyle.Style, { ...rest, cssText: cssText });
55
+ };
56
+ GlobalStyle.displayName = 'GlobalStyle';
46
57
 
47
58
  exports.ThemeStyle = ThemeStyle.ThemeStyle;
48
59
  Object.defineProperty(exports, 'createComponentClasses', {
@@ -66,3 +77,4 @@ Object.defineProperty(exports, 'defineComponentTheme', {
66
77
  get: function () { return ui.defineComponentTheme; }
67
78
  });
68
79
  exports.ComponentStyle = ComponentStyle;
80
+ exports.GlobalStyle = GlobalStyle;
@@ -1,7 +1,7 @@
1
+ import * as React from 'react';
1
2
  import { WebTheme } from '@aws-amplify/ui';
2
- import { BaseComponentProps, ElementType, ForwardRefPrimitive, PrimitiveProps } from '../../primitives/types';
3
3
  import { BaseComponentTheme } from '@aws-amplify/ui';
4
- interface BaseComponentStyleProps extends BaseComponentProps {
4
+ interface ComponentStyleProps extends React.ComponentProps<'style'> {
5
5
  /**
6
6
  * Provide a server generated nonce which matches your CSP `style-src` rule.
7
7
  * This will be attached to the generated <style> tag.
@@ -11,10 +11,12 @@ interface BaseComponentStyleProps extends BaseComponentProps {
11
11
  theme: Pick<WebTheme, 'name' | 'breakpoints' | 'tokens'>;
12
12
  componentThemes: BaseComponentTheme[];
13
13
  }
14
- export type ComponentStyleProps<Element extends ElementType = 'style'> = PrimitiveProps<BaseComponentStyleProps, Element>;
15
14
  /**
16
15
  * @experimental
17
16
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
18
17
  */
19
- export declare const ComponentStyle: ForwardRefPrimitive<BaseComponentStyleProps, 'style'>;
18
+ export declare const ComponentStyle: {
19
+ ({ theme, componentThemes, ...rest }: ComponentStyleProps): JSX.Element | null;
20
+ displayName: string;
21
+ };
20
22
  export {};
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { createGlobalCSS } from '@aws-amplify/ui';
3
+ interface GlobalStyleProps extends React.ComponentProps<'style'> {
4
+ /**
5
+ * Provide a server generated nonce which matches your CSP `style-src` rule.
6
+ * This will be attached to the generated <style> tag.
7
+ * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/style-src
8
+ */
9
+ nonce?: string;
10
+ styles: Parameters<typeof createGlobalCSS>[0];
11
+ }
12
+ /**
13
+ * @experimental
14
+ * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
15
+ */
16
+ export declare const GlobalStyle: {
17
+ ({ styles, ...rest }: GlobalStyleProps): JSX.Element | null;
18
+ displayName: string;
19
+ };
20
+ export {};
@@ -1,11 +1,13 @@
1
- import { BaseComponentProps, ElementType, ForwardRefPrimitive, PrimitiveProps } from '../../primitives/types';
2
- interface BaseStyleProps extends BaseComponentProps {
1
+ import * as React from 'react';
2
+ interface StyleProps extends React.ComponentProps<'style'> {
3
3
  cssText?: string;
4
4
  }
5
- export type StyleProps<Element extends ElementType = 'style'> = PrimitiveProps<BaseStyleProps, Element>;
6
5
  /**
7
6
  * @experimental
8
7
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
9
8
  */
10
- export declare const Style: ForwardRefPrimitive<BaseStyleProps, 'style'>;
9
+ export declare const Style: {
10
+ ({ cssText, ...rest }: StyleProps): JSX.Element | null;
11
+ displayName: string;
12
+ };
11
13
  export {};
@@ -1,6 +1,6 @@
1
+ import * as React from 'react';
1
2
  import { WebTheme } from '@aws-amplify/ui';
2
- import { BaseComponentProps, ElementType, ForwardRefPrimitive, PrimitiveProps } from '../../primitives/types';
3
- interface BaseStyleThemeProps extends BaseComponentProps {
3
+ interface ThemeStyleProps extends React.ComponentProps<'style'> {
4
4
  /**
5
5
  * Provide a server generated nonce which matches your CSP `style-src` rule.
6
6
  * This will be attached to the generated <style> tag.
@@ -9,10 +9,12 @@ interface BaseStyleThemeProps extends BaseComponentProps {
9
9
  nonce?: string;
10
10
  theme?: WebTheme;
11
11
  }
12
- export type ThemeStyleProps<Element extends ElementType = 'style'> = PrimitiveProps<BaseStyleThemeProps, Element>;
13
12
  /**
14
13
  * @experimental
15
14
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/theme)
16
15
  */
17
- export declare const ThemeStyle: ForwardRefPrimitive<BaseStyleThemeProps, 'style'>;
16
+ export declare const ThemeStyle: {
17
+ ({ theme, ...rest }: ThemeStyleProps): JSX.Element | null;
18
+ displayName: string;
19
+ };
18
20
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Breakpoint, Breakpoints, ValueBreakpoints } from '../../types/responsive';
2
2
  export declare const getValueAtCurrentBreakpoint: <Value = string | number>({ breakpoint, breakpoints, values, }: {
3
- values: Partial<Record<"small" | "large" | "medium" | "xl" | "xxl" | "base", Value>> | Value[];
3
+ values: Partial<Record<"base" | "small" | "large" | "medium" | "xl" | "xxl", Value>> | Value[];
4
4
  breakpoint: Breakpoint;
5
5
  breakpoints: Breakpoints;
6
6
  }) => string | number | Value | null;
@@ -1,3 +1,4 @@
1
1
  export { ThemeStyle } from './components/ThemeProvider/ThemeStyle';
2
2
  export { ComponentStyle } from './components/ThemeProvider/ComponentStyle';
3
+ export { GlobalStyle } from './components/ThemeProvider/GlobalStyle';
3
4
  export { createTheme, defineComponentTheme, createComponentClasses, defaultTheme, defaultDarkModeOverride, } from '@aws-amplify/ui';
@@ -1 +1 @@
1
- export declare const VERSION = "6.5.0";
1
+ export declare const VERSION = "6.5.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -55,8 +55,8 @@
55
55
  "typecheck": "tsc --noEmit"
56
56
  },
57
57
  "dependencies": {
58
- "@aws-amplify/ui": "6.6.0",
59
- "@aws-amplify/ui-react-core": "3.0.24",
58
+ "@aws-amplify/ui": "6.6.1",
59
+ "@aws-amplify/ui-react-core": "3.0.25",
60
60
  "@radix-ui/react-direction": "1.0.0",
61
61
  "@radix-ui/react-dropdown-menu": "1.0.0",
62
62
  "@radix-ui/react-slider": "1.0.0",
@@ -66,7 +66,8 @@
66
66
  "tslib": "^2.5.2"
67
67
  },
68
68
  "peerDependencies": {
69
- "aws-amplify": "^6.3.2",
69
+ "@aws-amplify/core": "^6.4.0",
70
+ "aws-amplify": "^6.6.0",
70
71
  "react": "^16.14.0 || ^17.0 || ^18.0",
71
72
  "react-dom": "^16.14.0 || ^17.0 || ^18.0"
72
73
  },
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
-
5
- function _interopNamespace(e) {
6
- if (e && e.__esModule) return e;
7
- var n = Object.create(null);
8
- if (e) {
9
- Object.keys(e).forEach(function (k) {
10
- if (k !== 'default') {
11
- var d = Object.getOwnPropertyDescriptor(e, k);
12
- Object.defineProperty(n, k, d.get ? d : {
13
- enumerable: true,
14
- get: function () { return e[k]; }
15
- });
16
- }
17
- });
18
- }
19
- n["default"] = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
24
-
25
- /**
26
- * Updates the return type for primitives wrapped in `React.forwardRef` to
27
- * `React.ReactElement`. In React 18 the return type of `React.ExoticComponent`
28
- * was changed from `React.ReactElement` to `React.ReactNode`, which breaks
29
- * clients using React 16 and 17.
30
- *
31
- * @param primitive UI Primitive to be wrapped with `React.forwardRef`
32
- * @returns ForwaredRef wrapped UI Primitive
33
- */
34
- const primitiveWithForwardRef = (primitive) => React__namespace.forwardRef(primitive);
35
-
36
- exports.primitiveWithForwardRef = primitiveWithForwardRef;
@@ -1 +0,0 @@
1
- export {};