@aws-amplify/ui-react 6.8.1 → 6.9.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.
Files changed (66) hide show
  1. package/dist/esm/PrimitiveCatalog.mjs +28 -13
  2. package/dist/esm/components/ThemeProvider/ThemeProvider.mjs +2 -5
  3. package/dist/esm/primitives/DropZone/DropZoneChildren.mjs +3 -7
  4. package/dist/esm/primitives/Menu/Menu.mjs +2 -5
  5. package/dist/esm/primitives/Menu/MenuItem.mjs +2 -5
  6. package/dist/esm/primitives/SliderField/SliderField.mjs +7 -12
  7. package/dist/esm/version.mjs +1 -1
  8. package/dist/index.js +21 -42
  9. package/dist/internal.js +28 -13
  10. package/dist/types/components/AccountSettings/ChangePassword/ChangePassword.d.ts +2 -2
  11. package/dist/types/components/AccountSettings/DeleteUser/DeleteUser.d.ts +2 -2
  12. package/dist/types/components/Authenticator/Authenticator.d.ts +13 -13
  13. package/dist/types/components/Authenticator/ConfirmSignIn/ConfirmSignIn.d.ts +2 -2
  14. package/dist/types/components/Authenticator/ConfirmSignUp/ConfirmSignUp.d.ts +2 -2
  15. package/dist/types/components/Authenticator/FederatedSignIn/FederatedSignIn.d.ts +2 -2
  16. package/dist/types/components/Authenticator/FederatedSignIn/FederatedSignInButtons/FederatedSignInButton.d.ts +2 -2
  17. package/dist/types/components/Authenticator/ForceNewPassword/ForceNewPassword.d.ts +5 -5
  18. package/dist/types/components/Authenticator/ForgotPassword/ConfirmResetPassword.d.ts +4 -4
  19. package/dist/types/components/Authenticator/ForgotPassword/ForgotPassword.d.ts +4 -4
  20. package/dist/types/components/Authenticator/RouteContainer/RouteContainer.d.ts +2 -2
  21. package/dist/types/components/Authenticator/RouteContainer/types.d.ts +0 -1
  22. package/dist/types/components/Authenticator/Router/Router.d.ts +2 -2
  23. package/dist/types/components/Authenticator/SetupTotp/SetupTotp.d.ts +4 -4
  24. package/dist/types/components/Authenticator/SignIn/SignIn.d.ts +2 -2
  25. package/dist/types/components/Authenticator/SignUp/SignUp.d.ts +3 -3
  26. package/dist/types/components/Authenticator/VerifyUser/ConfirmVerifyUser.d.ts +2 -2
  27. package/dist/types/components/Authenticator/VerifyUser/VerifyUser.d.ts +4 -4
  28. package/dist/types/components/Authenticator/hooks/useCustomComponents/defaultComponents.d.ts +3 -4
  29. package/dist/types/components/Authenticator/shared/ConfirmSignInFooter.d.ts +2 -2
  30. package/dist/types/components/Authenticator/shared/ConfirmationCodeInput.d.ts +2 -2
  31. package/dist/types/components/Authenticator/shared/FormField.d.ts +2 -2
  32. package/dist/types/components/Authenticator/shared/FormFields.d.ts +2 -2
  33. package/dist/types/components/Authenticator/shared/RemoteErrorMessage.d.ts +2 -2
  34. package/dist/types/components/Authenticator/shared/SignInSignUpTabs.d.ts +2 -2
  35. package/dist/types/components/Authenticator/shared/TwoButtonSubmitFooter.d.ts +3 -3
  36. package/dist/types/components/Authenticator/withAuthenticator.d.ts +1 -1
  37. package/dist/types/components/FilterChildren/FilterChildren.d.ts +1 -1
  38. package/dist/types/components/ThemeProvider/ComponentStyle.d.ts +1 -1
  39. package/dist/types/components/ThemeProvider/GlobalStyle.d.ts +1 -1
  40. package/dist/types/components/ThemeProvider/Style.d.ts +1 -1
  41. package/dist/types/components/ThemeProvider/ThemeProvider.d.ts +1 -1
  42. package/dist/types/components/ThemeProvider/ThemeStyle.d.ts +1 -1
  43. package/dist/types/components/shared/ValidationErrors.d.ts +2 -2
  44. package/dist/types/primitives/Alert/AlertIcon.d.ts +2 -2
  45. package/dist/types/primitives/Collection/Collection.d.ts +2 -2
  46. package/dist/types/primitives/DropZone/DropZone.d.ts +4 -4
  47. package/dist/types/primitives/DropZone/DropZoneChildren.d.ts +10 -9
  48. package/dist/types/primitives/DropZone/DropZoneProvider.d.ts +1 -1
  49. package/dist/types/primitives/Icon/context/IconsProvider.d.ts +1 -1
  50. package/dist/types/primitives/Icon/icons/types.d.ts +1 -2
  51. package/dist/types/primitives/Pagination/usePaginationItems.d.ts +2 -2
  52. package/dist/types/primitives/types/autocomplete.d.ts +1 -1
  53. package/dist/types/primitives/types/button.d.ts +0 -1
  54. package/dist/types/primitives/types/collection.d.ts +2 -2
  55. package/dist/types/primitives/types/field.d.ts +0 -1
  56. package/dist/types/primitives/types/fieldGroup.d.ts +0 -1
  57. package/dist/types/primitives/types/image.d.ts +0 -1
  58. package/dist/types/primitives/types/label.d.ts +0 -1
  59. package/dist/types/primitives/types/rating.d.ts +2 -3
  60. package/dist/types/primitives/types/style.d.ts +0 -1
  61. package/dist/types/primitives/types/switchField.d.ts +0 -1
  62. package/dist/types/primitives/types/textArea.d.ts +0 -1
  63. package/dist/types/primitives/types/view.d.ts +20 -28
  64. package/dist/types/primitives/utils/primitiveWithForwardRef.d.ts +2 -1
  65. package/dist/types/version.d.ts +1 -1
  66. package/package.json +9 -10
@@ -1407,6 +1407,9 @@ const PrimitiveCatalog = {
1407
1407
  "role": {
1408
1408
  "type": "string"
1409
1409
  },
1410
+ "ref": {
1411
+ "type": "string"
1412
+ },
1410
1413
  "key": {
1411
1414
  "type": "string"
1412
1415
  }
@@ -3683,6 +3686,9 @@ const PrimitiveCatalog = {
3683
3686
  "role": {
3684
3687
  "type": "string"
3685
3688
  },
3689
+ "ref": {
3690
+ "type": "string"
3691
+ },
3686
3692
  "key": {
3687
3693
  "type": "string"
3688
3694
  }
@@ -3933,6 +3939,9 @@ const PrimitiveCatalog = {
3933
3939
  "role": {
3934
3940
  "type": "string"
3935
3941
  },
3942
+ "ref": {
3943
+ "type": "string"
3944
+ },
3936
3945
  "key": {
3937
3946
  "type": "string"
3938
3947
  }
@@ -9450,9 +9459,8 @@ const PrimitiveCatalog = {
9450
9459
  "defaultValue": {
9451
9460
  "type": "string"
9452
9461
  },
9453
- "placeholder": {
9454
- "type": "string",
9455
- "priority": true
9462
+ "enterKeyHint": {
9463
+ "type": "string"
9456
9464
  },
9457
9465
  "inputMode": {
9458
9466
  "type": "string"
@@ -9536,9 +9544,6 @@ const PrimitiveCatalog = {
9536
9544
  "hasError": {
9537
9545
  "type": "boolean"
9538
9546
  },
9539
- "enterKeyHint": {
9540
- "type": "string"
9541
- },
9542
9547
  "isReadOnly": {
9543
9548
  "type": "boolean"
9544
9549
  },
@@ -9548,12 +9553,19 @@ const PrimitiveCatalog = {
9548
9553
  "name": {
9549
9554
  "type": "string"
9550
9555
  },
9556
+ "placeholder": {
9557
+ "type": "string",
9558
+ "priority": true
9559
+ },
9551
9560
  "countryCodeLabel": {
9552
9561
  "type": "string"
9553
9562
  },
9554
9563
  "countryCodeName": {
9555
9564
  "type": "string"
9556
9565
  },
9566
+ "ref": {
9567
+ "type": "string"
9568
+ },
9557
9569
  "key": {
9558
9570
  "type": "string"
9559
9571
  },
@@ -9596,6 +9608,9 @@ const PrimitiveCatalog = {
9596
9608
  "accessKey": {
9597
9609
  "type": "string"
9598
9610
  },
9611
+ "autoCapitalize": {
9612
+ "type": "string"
9613
+ },
9599
9614
  "autoFocus": {
9600
9615
  "type": "boolean"
9601
9616
  },
@@ -9656,9 +9671,6 @@ const PrimitiveCatalog = {
9656
9671
  "vocab": {
9657
9672
  "type": "string"
9658
9673
  },
9659
- "autoCapitalize": {
9660
- "type": "string"
9661
- },
9662
9674
  "autoCorrect": {
9663
9675
  "type": "string"
9664
9676
  },
@@ -10762,7 +10774,7 @@ const PrimitiveCatalog = {
10762
10774
  "defaultChecked": {
10763
10775
  "type": "boolean"
10764
10776
  },
10765
- "placeholder": {
10777
+ "enterKeyHint": {
10766
10778
  "type": "string"
10767
10779
  },
10768
10780
  "inputMode": {
@@ -10780,14 +10792,14 @@ const PrimitiveCatalog = {
10780
10792
  "hasError": {
10781
10793
  "type": "boolean"
10782
10794
  },
10783
- "enterKeyHint": {
10784
- "type": "string"
10785
- },
10786
10795
  "isReadOnly": {
10787
10796
  "type": "boolean"
10788
10797
  },
10789
10798
  "isRequired": {
10790
10799
  "type": "boolean"
10800
+ },
10801
+ "placeholder": {
10802
+ "type": "string"
10791
10803
  }
10792
10804
  }
10793
10805
  },
@@ -13339,6 +13351,9 @@ const PrimitiveCatalog = {
13339
13351
  "role": {
13340
13352
  "type": "string"
13341
13353
  },
13354
+ "ref": {
13355
+ "type": "string"
13356
+ },
13342
13357
  "key": {
13343
13358
  "type": "string"
13344
13359
  }
@@ -1,12 +1,9 @@
1
1
  import * as React from 'react';
2
- import * as RadixDirection from '@radix-ui/react-direction';
3
- import { sanitizeNamespaceImport, createTheme } from '@aws-amplify/ui';
2
+ import { DirectionProvider } from '@radix-ui/react-direction';
3
+ import { createTheme } from '@aws-amplify/ui';
4
4
  import { ThemeContext } from './ThemeContext.mjs';
5
5
  import { ThemeStyle } from './ThemeStyle.mjs';
6
6
 
7
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
8
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
9
- const { DirectionProvider } = sanitizeNamespaceImport(RadixDirection);
10
7
  /**
11
8
  * [📖 Docs](https://ui.docs.amplify.aws/react/theming)
12
9
  */
@@ -1,14 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { DropZoneContext } from './DropZoneProvider.mjs';
3
3
 
4
- /**
5
- * These are syntactic sugar components that make it easy to compose children
6
- * in DropZone without having to expose the DropZoneContext.
7
- */
8
4
  /**
9
5
  * This component renders when the user is dragging ONLY accepted files on the DropZone.
10
6
  */
11
- const Accepted = ({ children, }) => {
7
+ const Accepted = ({ children }) => {
12
8
  const dragState = React.useContext(DropZoneContext);
13
9
  if (!dragState) {
14
10
  throw new Error('`DropZone.Accept` must be used inside a DropZone');
@@ -18,7 +14,7 @@ const Accepted = ({ children, }) => {
18
14
  /**
19
15
  * This component renders when the user is dragging ANY rejected files on the DropZone.
20
16
  */
21
- const Rejected = ({ children, }) => {
17
+ const Rejected = ({ children }) => {
22
18
  const dragState = React.useContext(DropZoneContext);
23
19
  if (!dragState) {
24
20
  throw new Error('`DropZone.Rejected` must be used inside a DropZone');
@@ -28,7 +24,7 @@ const Rejected = ({ children, }) => {
28
24
  /**
29
25
  * This component renders by default when the user is not dragging.
30
26
  */
31
- const Default = ({ children, }) => {
27
+ const Default = ({ children }) => {
32
28
  const dragState = React.useContext(DropZoneContext);
33
29
  if (!dragState) {
34
30
  throw new Error('`DropZone.Default` must be used inside a DropZone');
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { sanitizeNamespaceImport, classNames, ComponentClassName } from '@aws-amplify/ui';
3
- import * as Dropdown from '@radix-ui/react-dropdown-menu';
2
+ import { classNames, ComponentClassName } from '@aws-amplify/ui';
3
+ import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } from '@radix-ui/react-dropdown-menu';
4
4
  import { ButtonGroup } from '../ButtonGroup/ButtonGroup.mjs';
5
5
  import '../Icon/Icon.mjs';
6
6
  import '../Icon/context/IconsContext.mjs';
@@ -10,9 +10,6 @@ import { IconMenu } from '../Icon/icons/IconMenu.mjs';
10
10
  import { MenuButton } from './MenuButton.mjs';
11
11
  import { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';
12
12
 
13
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
14
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
15
- const { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } = sanitizeNamespaceImport(Dropdown);
16
13
  const MENU_TRIGGER_TEST_ID = 'amplify-menu-trigger-test-id';
17
14
  const MENU_ITEMS_GROUP_TEST_ID = 'amplify-menu-items-group-test-id';
18
15
  const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size, trigger, triggerClassName, ariaLabel, onOpenChange, isDisabled, ...rest }, ref) => {
@@ -1,12 +1,9 @@
1
1
  import * as React from 'react';
2
- import { sanitizeNamespaceImport, classNames, ComponentClassName } from '@aws-amplify/ui';
3
- import * as Dropdown from '@radix-ui/react-dropdown-menu';
2
+ import { classNames, ComponentClassName } from '@aws-amplify/ui';
3
+ import { DropdownMenuItem } from '@radix-ui/react-dropdown-menu';
4
4
  import { MenuButton } from './MenuButton.mjs';
5
5
  import { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';
6
6
 
7
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
8
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
9
- const { DropdownMenuItem } = sanitizeNamespaceImport(Dropdown);
10
7
  const MENU_ITEM_TEST_ID = 'amplify-menu-item-test-id';
11
8
  /**
12
9
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
@@ -1,5 +1,5 @@
1
- import { sanitizeNamespaceImport, isFunction, classNames, ComponentClassName, classNameModifier, classNameModifierByFlag } from '@aws-amplify/ui';
2
- import * as RadixSlider from '@radix-ui/react-slider';
1
+ import { isFunction, classNames, ComponentClassName, classNameModifier, classNameModifierByFlag } from '@aws-amplify/ui';
2
+ import { Root, Track, Range, Thumb } from '@radix-ui/react-slider';
3
3
  import * as React from 'react';
4
4
  import '../Field/FieldClearButton.mjs';
5
5
  import { FieldDescription } from '../Field/FieldDescription.mjs';
@@ -17,9 +17,6 @@ import { createSpaceSeparatedIds } from '../utils/createSpaceSeparatedIds.mjs';
17
17
  import { DESCRIPTION_SUFFIX, ERROR_SUFFIX } from '../../helpers/constants.mjs';
18
18
  import { getUniqueComponentId } from '../utils/getUniqueComponentId.mjs';
19
19
 
20
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
21
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
22
- const { Range, Root, Thumb, Track } = sanitizeNamespaceImport(RadixSlider);
23
20
  const SLIDER_LABEL_TEST_ID = 'slider-label';
24
21
  const SLIDER_ROOT_TEST_ID = 'slider-root';
25
22
  const SLIDER_TRACK_TEST_ID = 'slider-track';
@@ -48,12 +45,10 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
48
45
  onChange(value[0]);
49
46
  }
50
47
  }, [onChange]);
51
- const renderedValue = React.useMemo(() => {
52
- const formattedValue = isFunction(formatValue)
53
- ? formatValue(currentValue)
54
- : currentValue;
55
- return typeof formatValue === 'string' ? (React.createElement(View, { as: "span" }, formattedValue)) : (formattedValue);
56
- }, [currentValue, formatValue]);
48
+ const realValue = isControlled ? value : currentValue;
49
+ const formattedValue = isFunction(formatValue)
50
+ ? formatValue(realValue)
51
+ : realValue;
57
52
  const isVertical = orientation === 'vertical';
58
53
  const componentClasses = classNames(ComponentClassName.SliderFieldTrack, classNameModifier(ComponentClassName.SliderFieldTrack, orientation), classNameModifier(ComponentClassName.SliderFieldTrack, size));
59
54
  const rootComponentClasses = classNames(ComponentClassName.SliderFieldRoot, classNameModifier(ComponentClassName.SliderFieldRoot, orientation), classNameModifier(ComponentClassName.SliderFieldRoot, size), classNameModifierByFlag(ComponentClassName.SliderFieldRoot, 'disabled', disabled), className);
@@ -64,7 +59,7 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
64
59
  className: classNames(ComponentClassName.Field, classNameModifier(ComponentClassName.Field, size), ComponentClassName.SliderField), testId: testId, ...styleProps },
65
60
  React.createElement(Label, { className: ComponentClassName.SliderFieldLabel, id: stableId, testId: SLIDER_LABEL_TEST_ID, visuallyHidden: labelHidden },
66
61
  React.createElement(View, { as: "span" }, label),
67
- !isValueHidden ? renderedValue : null),
62
+ !isValueHidden ? (typeof formatValue === 'string' ? (React.createElement(View, { as: "span" }, formattedValue)) : (formattedValue)) : null),
68
63
  React.createElement(FieldDescription, { id: descriptionId, labelHidden: labelHidden, descriptiveText: descriptiveText }),
69
64
  React.createElement(FieldGroup, { className: ComponentClassName.SliderFieldGroup, id: fieldId, orientation: orientation, outerStartComponent: outerStartComponent, outerEndComponent: outerEndComponent },
70
65
  React.createElement(Root, { className: rootComponentClasses, "data-testid": SLIDER_ROOT_TEST_ID, disabled: disabled, defaultValue: defaultValues, onValueChange: onValueChange, orientation: orientation, ref: ref, value: values, ...rest },
@@ -1,3 +1,3 @@
1
- const VERSION = '6.8.1';
1
+ const VERSION = '6.9.1';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@ var ui = require('@aws-amplify/ui');
9
9
  var Field = require('./Field-DbA9eYRa.js');
10
10
  require('aws-amplify/storage');
11
11
  var debounce = require('lodash/debounce.js');
12
- var Dropdown = require('@radix-ui/react-dropdown-menu');
13
- var RadixSlider = require('@radix-ui/react-slider');
12
+ var reactDropdownMenu = require('@radix-ui/react-dropdown-menu');
13
+ var reactSlider = require('@radix-ui/react-slider');
14
14
  var QRCode = require('qrcode');
15
15
  var utils = require('aws-amplify/utils');
16
- var RadixDirection = require('@radix-ui/react-direction');
16
+ var reactDirection = require('@radix-ui/react-direction');
17
17
  var ThemeStyle = require('./ThemeStyle-DA2-Clfz.js');
18
18
  require('@aws-amplify/core');
19
19
  require('aws-amplify/auth');
@@ -41,10 +41,7 @@ function _interopNamespace(e) {
41
41
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
42
42
  var isEqual__default = /*#__PURE__*/_interopDefault(isEqual);
43
43
  var debounce__default = /*#__PURE__*/_interopDefault(debounce);
44
- var Dropdown__namespace = /*#__PURE__*/_interopNamespace(Dropdown);
45
- var RadixSlider__namespace = /*#__PURE__*/_interopNamespace(RadixSlider);
46
44
  var QRCode__default = /*#__PURE__*/_interopDefault(QRCode);
47
- var RadixDirection__namespace = /*#__PURE__*/_interopNamespace(RadixDirection);
48
45
 
49
46
  /**
50
47
  * [📖 Docs](https://ui.docs.amplify.aws/react/theming/responsive#usebreakpointvalue)
@@ -1135,14 +1132,10 @@ const Container = ({ className, children, testId, isDisabled, onDragEnter, onDra
1135
1132
  const DropZoneContainer = Field.primitiveWithForwardRef(Container);
1136
1133
  DropZoneContainer.displayName = 'DropZoneContainer';
1137
1134
 
1138
- /**
1139
- * These are syntactic sugar components that make it easy to compose children
1140
- * in DropZone without having to expose the DropZoneContext.
1141
- */
1142
1135
  /**
1143
1136
  * This component renders when the user is dragging ONLY accepted files on the DropZone.
1144
1137
  */
1145
- const Accepted = ({ children, }) => {
1138
+ const Accepted = ({ children }) => {
1146
1139
  const dragState = React__namespace.useContext(DropZoneContext);
1147
1140
  if (!dragState) {
1148
1141
  throw new Error('`DropZone.Accept` must be used inside a DropZone');
@@ -1152,7 +1145,7 @@ const Accepted = ({ children, }) => {
1152
1145
  /**
1153
1146
  * This component renders when the user is dragging ANY rejected files on the DropZone.
1154
1147
  */
1155
- const Rejected = ({ children, }) => {
1148
+ const Rejected = ({ children }) => {
1156
1149
  const dragState = React__namespace.useContext(DropZoneContext);
1157
1150
  if (!dragState) {
1158
1151
  throw new Error('`DropZone.Rejected` must be used inside a DropZone');
@@ -1162,7 +1155,7 @@ const Rejected = ({ children, }) => {
1162
1155
  /**
1163
1156
  * This component renders by default when the user is not dragging.
1164
1157
  */
1165
- const Default = ({ children, }) => {
1158
+ const Default = ({ children }) => {
1166
1159
  const dragState = React__namespace.useContext(DropZoneContext);
1167
1160
  if (!dragState) {
1168
1161
  throw new Error('`DropZone.Default` must be used inside a DropZone');
@@ -1354,16 +1347,13 @@ const MenuButtonPrimitive = ({ ariaLabel, className, children, isDisabled = fals
1354
1347
  const MenuButton = Field.primitiveWithForwardRef(MenuButtonPrimitive);
1355
1348
  MenuButton.displayName = 'MenuButton';
1356
1349
 
1357
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
1358
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
1359
- const { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } = ui.sanitizeNamespaceImport(Dropdown__namespace);
1360
1350
  const MENU_TRIGGER_TEST_ID = 'amplify-menu-trigger-test-id';
1361
1351
  const MENU_ITEMS_GROUP_TEST_ID = 'amplify-menu-items-group-test-id';
1362
1352
  const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size, trigger, triggerClassName, ariaLabel, onOpenChange, isDisabled, ...rest }, ref) => {
1363
1353
  const icons = Field.useIcons('menu');
1364
- return (React__namespace.createElement(DropdownMenu, { onOpenChange: onOpenChange, open: isOpen },
1365
- React__namespace.createElement(DropdownMenuTrigger, { disabled: isDisabled, asChild: true }, trigger ?? (React__namespace.createElement(MenuButton, { ariaLabel: ariaLabel, size: size, testId: MENU_TRIGGER_TEST_ID, className: ui.classNames(ui.ComponentClassName.MenuTrigger, triggerClassName) }, icons?.menu ?? React__namespace.createElement(Field.IconMenu, null)))),
1366
- React__namespace.createElement(DropdownMenuContent, { align: menuAlign, className: ui.ComponentClassName.MenuWrapper },
1354
+ return (React__namespace.createElement(reactDropdownMenu.DropdownMenu, { onOpenChange: onOpenChange, open: isOpen },
1355
+ React__namespace.createElement(reactDropdownMenu.DropdownMenuTrigger, { disabled: isDisabled, asChild: true }, trigger ?? (React__namespace.createElement(MenuButton, { ariaLabel: ariaLabel, size: size, testId: MENU_TRIGGER_TEST_ID, className: ui.classNames(ui.ComponentClassName.MenuTrigger, triggerClassName) }, icons?.menu ?? React__namespace.createElement(Field.IconMenu, null)))),
1356
+ React__namespace.createElement(reactDropdownMenu.DropdownMenuContent, { align: menuAlign, className: ui.ComponentClassName.MenuWrapper },
1367
1357
  React__namespace.createElement(ButtonGroup, { className: ui.classNames(ui.ComponentClassName.MenuContent, className), ref: ref, isDisabled: isDisabled, size: size, testId: MENU_ITEMS_GROUP_TEST_ID, ...rest }, children))));
1368
1358
  };
1369
1359
  /**
@@ -1372,15 +1362,12 @@ const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size,
1372
1362
  const Menu = Field.primitiveWithForwardRef(MenuPrimitive);
1373
1363
  Menu.displayName = 'Menu';
1374
1364
 
1375
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
1376
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
1377
- const { DropdownMenuItem } = ui.sanitizeNamespaceImport(Dropdown__namespace);
1378
1365
  const MENU_ITEM_TEST_ID = 'amplify-menu-item-test-id';
1379
1366
  /**
1380
1367
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
1381
1368
  */
1382
1369
  const MenuItemPrimitive = ({ children, className, ...rest }, ref) => {
1383
- return (React__namespace.createElement(DropdownMenuItem, { asChild: true, ref: ref },
1370
+ return (React__namespace.createElement(reactDropdownMenu.DropdownMenuItem, { asChild: true, ref: ref },
1384
1371
  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
1385
1372
  }, children)));
1386
1373
  };
@@ -1731,9 +1718,6 @@ const RatingPrimitive = ({ className, emptyColor, emptyIcon, fillColor, icon, ma
1731
1718
  const Rating = Field.primitiveWithForwardRef(RatingPrimitive);
1732
1719
  Rating.displayName = 'Rating';
1733
1720
 
1734
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
1735
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
1736
- const { Range, Root, Thumb, Track } = ui.sanitizeNamespaceImport(RadixSlider__namespace);
1737
1721
  const SLIDER_LABEL_TEST_ID = 'slider-label';
1738
1722
  const SLIDER_ROOT_TEST_ID = 'slider-root';
1739
1723
  const SLIDER_TRACK_TEST_ID = 'slider-track';
@@ -1762,12 +1746,10 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
1762
1746
  onChange(value[0]);
1763
1747
  }
1764
1748
  }, [onChange]);
1765
- const renderedValue = React__namespace.useMemo(() => {
1766
- const formattedValue = ui.isFunction(formatValue)
1767
- ? formatValue(currentValue)
1768
- : currentValue;
1769
- return typeof formatValue === 'string' ? (React__namespace.createElement(Field.View, { as: "span" }, formattedValue)) : (formattedValue);
1770
- }, [currentValue, formatValue]);
1749
+ const realValue = isControlled ? value : currentValue;
1750
+ const formattedValue = ui.isFunction(formatValue)
1751
+ ? formatValue(realValue)
1752
+ : realValue;
1771
1753
  const isVertical = orientation === 'vertical';
1772
1754
  const componentClasses = ui.classNames(ui.ComponentClassName.SliderFieldTrack, ui.classNameModifier(ui.ComponentClassName.SliderFieldTrack, orientation), ui.classNameModifier(ui.ComponentClassName.SliderFieldTrack, size));
1773
1755
  const rootComponentClasses = ui.classNames(ui.ComponentClassName.SliderFieldRoot, ui.classNameModifier(ui.ComponentClassName.SliderFieldRoot, orientation), ui.classNameModifier(ui.ComponentClassName.SliderFieldRoot, size), ui.classNameModifierByFlag(ui.ComponentClassName.SliderFieldRoot, 'disabled', disabled), className);
@@ -1778,16 +1760,16 @@ const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, desc
1778
1760
  className: ui.classNames(ui.ComponentClassName.Field, ui.classNameModifier(ui.ComponentClassName.Field, size), ui.ComponentClassName.SliderField), testId: testId, ...styleProps },
1779
1761
  React__namespace.createElement(Field.Label, { className: ui.ComponentClassName.SliderFieldLabel, id: stableId, testId: SLIDER_LABEL_TEST_ID, visuallyHidden: labelHidden },
1780
1762
  React__namespace.createElement(Field.View, { as: "span" }, label),
1781
- !isValueHidden ? renderedValue : null),
1763
+ !isValueHidden ? (typeof formatValue === 'string' ? (React__namespace.createElement(Field.View, { as: "span" }, formattedValue)) : (formattedValue)) : null),
1782
1764
  React__namespace.createElement(Field.FieldDescription, { id: descriptionId, labelHidden: labelHidden, descriptiveText: descriptiveText }),
1783
1765
  React__namespace.createElement(FieldGroup, { className: ui.ComponentClassName.SliderFieldGroup, id: fieldId, orientation: orientation, outerStartComponent: outerStartComponent, outerEndComponent: outerEndComponent },
1784
- React__namespace.createElement(Root, { className: rootComponentClasses, "data-testid": SLIDER_ROOT_TEST_ID, disabled: disabled, defaultValue: defaultValues, onValueChange: onValueChange, orientation: orientation, ref: ref, value: values, ...rest },
1785
- React__namespace.createElement(Track, { className: componentClasses, "data-testid": SLIDER_TRACK_TEST_ID, style: {
1766
+ React__namespace.createElement(reactSlider.Root, { className: rootComponentClasses, "data-testid": SLIDER_ROOT_TEST_ID, disabled: disabled, defaultValue: defaultValues, onValueChange: onValueChange, orientation: orientation, ref: ref, value: values, ...rest },
1767
+ React__namespace.createElement(reactSlider.Track, { className: componentClasses, "data-testid": SLIDER_TRACK_TEST_ID, style: {
1786
1768
  backgroundColor: String(emptyTrackColor),
1787
1769
  [`${isVertical ? 'width' : 'height'}`]: trackSize,
1788
1770
  } },
1789
- React__namespace.createElement(Range, { className: ui.classNames(ui.ComponentClassName.SliderFieldRange, ui.classNameModifier(ui.ComponentClassName.SliderFieldRange, orientation), ui.classNameModifierByFlag(ui.ComponentClassName.SliderFieldRange, 'disabled', disabled)), "data-testid": SLIDER_RANGE_TEST_ID, style: { backgroundColor: String(filledTrackColor) } })),
1790
- React__namespace.createElement(Thumb, { "aria-describedby": ariaDescribedBy, "aria-labelledby": stableId, "aria-valuetext": ariaValuetext, className: ui.classNames(ui.ComponentClassName.SliderFieldThumb, ui.classNameModifier(ui.ComponentClassName.SliderFieldThumb, size), ui.classNameModifierByFlag(ui.ComponentClassName.SliderFieldThumb, 'disabled', disabled)), style: { backgroundColor: String(thumbColor) } }))),
1771
+ React__namespace.createElement(reactSlider.Range, { className: ui.classNames(ui.ComponentClassName.SliderFieldRange, ui.classNameModifier(ui.ComponentClassName.SliderFieldRange, orientation), ui.classNameModifierByFlag(ui.ComponentClassName.SliderFieldRange, 'disabled', disabled)), "data-testid": SLIDER_RANGE_TEST_ID, style: { backgroundColor: String(filledTrackColor) } })),
1772
+ React__namespace.createElement(reactSlider.Thumb, { "aria-describedby": ariaDescribedBy, "aria-labelledby": stableId, "aria-valuetext": ariaValuetext, className: ui.classNames(ui.ComponentClassName.SliderFieldThumb, ui.classNameModifier(ui.ComponentClassName.SliderFieldThumb, size), ui.classNameModifierByFlag(ui.ComponentClassName.SliderFieldThumb, 'disabled', disabled)), style: { backgroundColor: String(thumbColor) } }))),
1791
1773
  React__namespace.createElement(Field.FieldErrorMessage, { id: errorId, hasError: hasError, errorMessage: errorMessage })));
1792
1774
  };
1793
1775
  /**
@@ -2487,7 +2469,7 @@ const defaultDeleteUserDisplayText = {
2487
2469
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2488
2470
  };
2489
2471
 
2490
- const VERSION = '6.8.1';
2472
+ const VERSION = '6.9.1';
2491
2473
 
2492
2474
  const logger$2 = ui.getLogger('AccountSettings');
2493
2475
  const getIsDisabled = (formValues, validationError) => {
@@ -3460,16 +3442,13 @@ function withAuthenticator(Component, options = {}) {
3460
3442
  };
3461
3443
  }
3462
3444
 
3463
- // Radix packages don't support ESM in Node, in some scenarios(e.g. SSR)
3464
- // We have to use namespace import and sanitize it to ensure the interoperablity between ESM and CJS
3465
- const { DirectionProvider } = ui.sanitizeNamespaceImport(RadixDirection__namespace);
3466
3445
  /**
3467
3446
  * [📖 Docs](https://ui.docs.amplify.aws/react/theming)
3468
3447
  */
3469
3448
  function ThemeProvider({ children, colorMode, direction = 'ltr', nonce, theme, }) {
3470
3449
  const value = React__namespace.useMemo(() => ({ theme: ui.createTheme(theme), colorMode }), [theme, colorMode]);
3471
3450
  return (React__namespace.createElement(Field.ThemeContext.Provider, { value: value },
3472
- React__namespace.createElement(DirectionProvider, { dir: direction },
3451
+ React__namespace.createElement(reactDirection.DirectionProvider, { dir: direction },
3473
3452
  React__namespace.createElement("div", { "data-amplify-theme": value.theme.name, "data-amplify-color-mode": colorMode, dir: direction }, children),
3474
3453
  theme ? React__namespace.createElement(ThemeStyle.ThemeStyle, { theme: value.theme, nonce: nonce }) : null)));
3475
3454
  }
package/dist/internal.js CHANGED
@@ -1630,6 +1630,9 @@ const PrimitiveCatalog = {
1630
1630
  "role": {
1631
1631
  "type": "string"
1632
1632
  },
1633
+ "ref": {
1634
+ "type": "string"
1635
+ },
1633
1636
  "key": {
1634
1637
  "type": "string"
1635
1638
  }
@@ -3906,6 +3909,9 @@ const PrimitiveCatalog = {
3906
3909
  "role": {
3907
3910
  "type": "string"
3908
3911
  },
3912
+ "ref": {
3913
+ "type": "string"
3914
+ },
3909
3915
  "key": {
3910
3916
  "type": "string"
3911
3917
  }
@@ -4156,6 +4162,9 @@ const PrimitiveCatalog = {
4156
4162
  "role": {
4157
4163
  "type": "string"
4158
4164
  },
4165
+ "ref": {
4166
+ "type": "string"
4167
+ },
4159
4168
  "key": {
4160
4169
  "type": "string"
4161
4170
  }
@@ -9673,9 +9682,8 @@ const PrimitiveCatalog = {
9673
9682
  "defaultValue": {
9674
9683
  "type": "string"
9675
9684
  },
9676
- "placeholder": {
9677
- "type": "string",
9678
- "priority": true
9685
+ "enterKeyHint": {
9686
+ "type": "string"
9679
9687
  },
9680
9688
  "inputMode": {
9681
9689
  "type": "string"
@@ -9759,9 +9767,6 @@ const PrimitiveCatalog = {
9759
9767
  "hasError": {
9760
9768
  "type": "boolean"
9761
9769
  },
9762
- "enterKeyHint": {
9763
- "type": "string"
9764
- },
9765
9770
  "isReadOnly": {
9766
9771
  "type": "boolean"
9767
9772
  },
@@ -9771,12 +9776,19 @@ const PrimitiveCatalog = {
9771
9776
  "name": {
9772
9777
  "type": "string"
9773
9778
  },
9779
+ "placeholder": {
9780
+ "type": "string",
9781
+ "priority": true
9782
+ },
9774
9783
  "countryCodeLabel": {
9775
9784
  "type": "string"
9776
9785
  },
9777
9786
  "countryCodeName": {
9778
9787
  "type": "string"
9779
9788
  },
9789
+ "ref": {
9790
+ "type": "string"
9791
+ },
9780
9792
  "key": {
9781
9793
  "type": "string"
9782
9794
  },
@@ -9819,6 +9831,9 @@ const PrimitiveCatalog = {
9819
9831
  "accessKey": {
9820
9832
  "type": "string"
9821
9833
  },
9834
+ "autoCapitalize": {
9835
+ "type": "string"
9836
+ },
9822
9837
  "autoFocus": {
9823
9838
  "type": "boolean"
9824
9839
  },
@@ -9879,9 +9894,6 @@ const PrimitiveCatalog = {
9879
9894
  "vocab": {
9880
9895
  "type": "string"
9881
9896
  },
9882
- "autoCapitalize": {
9883
- "type": "string"
9884
- },
9885
9897
  "autoCorrect": {
9886
9898
  "type": "string"
9887
9899
  },
@@ -10985,7 +10997,7 @@ const PrimitiveCatalog = {
10985
10997
  "defaultChecked": {
10986
10998
  "type": "boolean"
10987
10999
  },
10988
- "placeholder": {
11000
+ "enterKeyHint": {
10989
11001
  "type": "string"
10990
11002
  },
10991
11003
  "inputMode": {
@@ -11003,14 +11015,14 @@ const PrimitiveCatalog = {
11003
11015
  "hasError": {
11004
11016
  "type": "boolean"
11005
11017
  },
11006
- "enterKeyHint": {
11007
- "type": "string"
11008
- },
11009
11018
  "isReadOnly": {
11010
11019
  "type": "boolean"
11011
11020
  },
11012
11021
  "isRequired": {
11013
11022
  "type": "boolean"
11023
+ },
11024
+ "placeholder": {
11025
+ "type": "string"
11014
11026
  }
11015
11027
  }
11016
11028
  },
@@ -13562,6 +13574,9 @@ const PrimitiveCatalog = {
13562
13574
  "role": {
13563
13575
  "type": "string"
13564
13576
  },
13577
+ "ref": {
13578
+ "type": "string"
13579
+ },
13565
13580
  "key": {
13566
13581
  "type": "string"
13567
13582
  }
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ChangePasswordProps } from './types';
3
- declare function ChangePassword({ components, displayText: overrideDisplayText, onError, onSuccess, validators, }: ChangePasswordProps): JSX.Element | null;
3
+ declare function ChangePassword({ components, displayText: overrideDisplayText, onError, onSuccess, validators, }: ChangePasswordProps): React.JSX.Element | null;
4
4
  declare namespace ChangePassword {
5
5
  var CurrentPasswordField: import("../types").PasswordFieldComponent;
6
6
  var NewPasswordField: import("../types").PasswordFieldComponent;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { DeleteUserProps } from './types';
3
- declare function DeleteUser({ components, displayText: overrideDisplayText, handleDelete, onError, onSuccess, }: DeleteUserProps): JSX.Element | null;
3
+ declare function DeleteUser({ components, displayText: overrideDisplayText, handleDelete, onError, onSuccess, }: DeleteUserProps): React.JSX.Element | null;
4
4
  declare namespace DeleteUser {
5
5
  var ErrorMessage: import("../types").ErrorMessageComponent;
6
6
  var DeleteButton: import("../types").ButtonComponent;
@@ -9,7 +9,7 @@ export type AuthenticatorProps = Partial<Omit<AuthenticatorMachineOptions, 'form
9
9
  children: React.ReactNode | ((props: {
10
10
  signOut?: SignOut;
11
11
  user?: AuthUser;
12
- }) => JSX.Element);
12
+ }) => React.JSX.Element);
13
13
  formFields: {
14
14
  [key in FormFieldComponents]?: {
15
15
  [field_name: string]: ReactFormFieldOptions;
@@ -28,30 +28,30 @@ interface ReactFormFieldOptions extends FormFieldOptions {
28
28
  /** Desired HTML maxLength type */
29
29
  maxLength?: number;
30
30
  }
31
- export declare function AuthenticatorInternal({ children, className, components: customComponents, formFields, hideSignUp, initialState, loginMechanisms, passwordSettings, signUpAttributes, services, socialProviders, variation, }: AuthenticatorProps): JSX.Element;
31
+ export declare function AuthenticatorInternal({ children, className, components: customComponents, formFields, hideSignUp, initialState, loginMechanisms, passwordSettings, signUpAttributes, services, socialProviders, variation, }: AuthenticatorProps): React.JSX.Element;
32
32
  /**
33
33
  * [📖 Docs](https://ui.docs.amplify.aws/react/connected-components/authenticator)
34
34
  */
35
- export declare function Authenticator(props: AuthenticatorProps): JSX.Element;
35
+ export declare function Authenticator(props: AuthenticatorProps): React.JSX.Element;
36
36
  export declare namespace Authenticator {
37
37
  var Provider: typeof import("@aws-amplify/ui-react-core").AuthenticatorProvider;
38
38
  var ForgotPassword: {
39
- ({ className, variation, }: import("./RouteContainer").RouteProps): JSX.Element;
40
- Header(): JSX.Element;
41
- Footer(): JSX.Element;
39
+ ({ className, variation, }: import("./RouteContainer").RouteProps): React.JSX.Element;
40
+ Header(): React.JSX.Element;
41
+ Footer(): React.JSX.Element;
42
42
  };
43
43
  var SetupTotp: {
44
- ({ className, variation, }: import("./RouteContainer").RouteProps): JSX.Element;
45
- Header(): JSX.Element;
46
- Footer(): JSX.Element;
44
+ ({ className, variation, }: import("./RouteContainer").RouteProps): React.JSX.Element;
45
+ Header(): React.JSX.Element;
46
+ Footer(): React.JSX.Element;
47
47
  };
48
48
  var SignIn: typeof import("./SignIn").SignIn;
49
49
  var SignUp: typeof import("./SignUp").SignUp;
50
50
  var ForceNewPassword: {
51
- ({ className, variation, }: import("./RouteContainer").RouteProps): JSX.Element;
52
- FormFields(): JSX.Element | null;
53
- Header(): JSX.Element | null;
54
- Footer(): JSX.Element | null;
51
+ ({ className, variation, }: import("./RouteContainer").RouteProps): React.JSX.Element;
52
+ FormFields(): React.JSX.Element | null;
53
+ Header(): React.JSX.Element | null;
54
+ Footer(): React.JSX.Element | null;
55
55
  };
56
56
  }
57
57
  export {};
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { RouteProps } from '../RouteContainer';
3
3
  export declare const ConfirmSignIn: {
4
- ({ className, variation, }: RouteProps): JSX.Element;
4
+ ({ className, variation, }: RouteProps): React.JSX.Element;
5
5
  Header: typeof Header;
6
- Footer(): JSX.Element;
6
+ Footer(): React.JSX.Element;
7
7
  };
8
8
  declare function Header(): React.JSX.Element;
9
9
  export {};