@aws-amplify/ui-react 6.1.6 → 6.1.8

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.
@@ -3,10 +3,10 @@ import { classNames, ComponentClassName } from '@aws-amplify/ui';
3
3
  import { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';
4
4
  import { Flex } from '../Flex/Flex.mjs';
5
5
 
6
- const ButtonGroupPrimitive = ({ className, children, role = 'group', size: _size, variation: _variation, ...rest }, ref) => (React.createElement(Flex, { className: classNames(ComponentClassName.ButtonGroup, className), role: role, ref: ref, ...rest }, React.Children.map(children, (child) => {
6
+ const ButtonGroupPrimitive = ({ className, children, isDisabled: _isDisabled = false, role = 'group', size: _size, variation: _variation, ...rest }, ref) => (React.createElement(Flex, { className: classNames(ComponentClassName.ButtonGroup, className), role: role, ref: ref, ...rest }, React.Children.map(children, (child) => {
7
7
  if (React.isValidElement(child)) {
8
- const { size = _size, variation = _variation } = child.props;
9
- return React.cloneElement(child, { size, variation });
8
+ const { size = _size, variation = _variation, isDisabled = _isDisabled, } = child.props;
9
+ return React.cloneElement(child, { isDisabled, size, variation });
10
10
  }
11
11
  return child;
12
12
  })));
@@ -15,12 +15,12 @@ import { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';
15
15
  const { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } = sanitizeNamespaceImport(Dropdown);
16
16
  const MENU_TRIGGER_TEST_ID = 'amplify-menu-trigger-test-id';
17
17
  const MENU_ITEMS_GROUP_TEST_ID = 'amplify-menu-items-group-test-id';
18
- const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size, trigger, triggerClassName, ariaLabel, onOpenChange, ...rest }, ref) => {
18
+ const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size, trigger, triggerClassName, ariaLabel, onOpenChange, isDisabled, ...rest }, ref) => {
19
19
  const icons = useIcons('menu');
20
20
  return (React.createElement(DropdownMenu, { onOpenChange: onOpenChange, open: isOpen },
21
- React.createElement(DropdownMenuTrigger, { asChild: true }, trigger ?? (React.createElement(MenuButton, { ariaLabel: ariaLabel, size: size, testId: MENU_TRIGGER_TEST_ID, className: classNames(ComponentClassName.MenuTrigger, triggerClassName) }, icons?.menu ?? React.createElement(IconMenu, null)))),
21
+ React.createElement(DropdownMenuTrigger, { disabled: isDisabled, asChild: true }, trigger ?? (React.createElement(MenuButton, { ariaLabel: ariaLabel, size: size, testId: MENU_TRIGGER_TEST_ID, className: classNames(ComponentClassName.MenuTrigger, triggerClassName) }, icons?.menu ?? React.createElement(IconMenu, null)))),
22
22
  React.createElement(DropdownMenuContent, { align: menuAlign, className: ComponentClassName.MenuWrapper },
23
- React.createElement(ButtonGroup, { className: classNames(ComponentClassName.MenuContent, className), ref: ref, size: size, testId: MENU_ITEMS_GROUP_TEST_ID, ...rest }, children))));
23
+ React.createElement(ButtonGroup, { className: classNames(ComponentClassName.MenuContent, className), ref: ref, isDisabled: isDisabled, size: size, testId: MENU_ITEMS_GROUP_TEST_ID, ...rest }, children))));
24
24
  };
25
25
  /**
26
26
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
@@ -7,10 +7,10 @@ import { primitiveWithForwardRef } from '../utils/primitiveWithForwardRef.mjs';
7
7
  /**
8
8
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
9
9
  */
10
- const MenuButtonPrimitive = ({ ariaLabel, className, children, isDisabled, isLoading, size, style, type = 'button', variation, testId, ...rest }, ref) => {
10
+ const MenuButtonPrimitive = ({ ariaLabel, className, children, isDisabled = false, isLoading, size, style, type = 'button', variation, testId, ...rest }, ref) => {
11
11
  const { propStyles, nonStyleProps } = useStyles(rest, style);
12
12
  const componentClasses = classNames(ComponentClassName.Button, classNameModifier(ComponentClassName.Button, size), classNameModifier(ComponentClassName.Button, variation), className);
13
- return (React.createElement(Button, { ref: ref, className: componentClasses, disabled: isDisabled ?? isLoading, type: type, testId: testId, "aria-label": ariaLabel, style: propStyles, ...nonStyleProps }, children));
13
+ return (React.createElement(Button, { ref: ref, className: componentClasses, disabled: isDisabled || isLoading, isDisabled: isDisabled || isLoading, type: type, testId: testId, "aria-label": ariaLabel, style: propStyles, ...nonStyleProps }, children));
14
14
  };
15
15
  const MenuButton = primitiveWithForwardRef(MenuButtonPrimitive);
16
16
  MenuButton.displayName = 'MenuButton';
@@ -1,3 +1,3 @@
1
- const VERSION = '6.1.6';
1
+ const VERSION = '6.1.8';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -705,10 +705,10 @@ const Breadcrumbs = Object.assign(Field.primitiveWithForwardRef(BreadcrumbsPrimi
705
705
  });
706
706
  Breadcrumbs.displayName = 'Breadcrumbs';
707
707
 
708
- const ButtonGroupPrimitive = ({ className, children, role = 'group', size: _size, variation: _variation, ...rest }, ref) => (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.ButtonGroup, className), role: role, ref: ref, ...rest }, React__namespace.Children.map(children, (child) => {
708
+ const ButtonGroupPrimitive = ({ className, children, isDisabled: _isDisabled = false, role = 'group', size: _size, variation: _variation, ...rest }, ref) => (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.ButtonGroup, className), role: role, ref: ref, ...rest }, React__namespace.Children.map(children, (child) => {
709
709
  if (React__namespace.isValidElement(child)) {
710
- const { size = _size, variation = _variation } = child.props;
711
- return React__namespace.cloneElement(child, { size, variation });
710
+ const { size = _size, variation = _variation, isDisabled = _isDisabled, } = child.props;
711
+ return React__namespace.cloneElement(child, { isDisabled, size, variation });
712
712
  }
713
713
  return child;
714
714
  })));
@@ -1329,10 +1329,10 @@ Image.displayName = 'Image';
1329
1329
  /**
1330
1330
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
1331
1331
  */
1332
- const MenuButtonPrimitive = ({ ariaLabel, className, children, isDisabled, isLoading, size, style, type = 'button', variation, testId, ...rest }, ref) => {
1332
+ const MenuButtonPrimitive = ({ ariaLabel, className, children, isDisabled = false, isLoading, size, style, type = 'button', variation, testId, ...rest }, ref) => {
1333
1333
  const { propStyles, nonStyleProps } = Field.useStyles(rest, style);
1334
1334
  const componentClasses = ui.classNames(ui.ComponentClassName.Button, ui.classNameModifier(ui.ComponentClassName.Button, size), ui.classNameModifier(ui.ComponentClassName.Button, variation), className);
1335
- return (React__namespace.createElement(Field.Button, { ref: ref, className: componentClasses, disabled: isDisabled ?? isLoading, type: type, testId: testId, "aria-label": ariaLabel, style: propStyles, ...nonStyleProps }, children));
1335
+ 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));
1336
1336
  };
1337
1337
  const MenuButton = Field.primitiveWithForwardRef(MenuButtonPrimitive);
1338
1338
  MenuButton.displayName = 'MenuButton';
@@ -1342,12 +1342,12 @@ MenuButton.displayName = 'MenuButton';
1342
1342
  const { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent } = ui.sanitizeNamespaceImport(Dropdown__namespace);
1343
1343
  const MENU_TRIGGER_TEST_ID = 'amplify-menu-trigger-test-id';
1344
1344
  const MENU_ITEMS_GROUP_TEST_ID = 'amplify-menu-items-group-test-id';
1345
- const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size, trigger, triggerClassName, ariaLabel, onOpenChange, ...rest }, ref) => {
1345
+ const MenuPrimitive = ({ menuAlign = 'start', children, className, isOpen, size, trigger, triggerClassName, ariaLabel, onOpenChange, isDisabled, ...rest }, ref) => {
1346
1346
  const icons = Field.useIcons('menu');
1347
1347
  return (React__namespace.createElement(DropdownMenu, { onOpenChange: onOpenChange, open: isOpen },
1348
- React__namespace.createElement(DropdownMenuTrigger, { 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)))),
1348
+ 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)))),
1349
1349
  React__namespace.createElement(DropdownMenuContent, { align: menuAlign, className: ui.ComponentClassName.MenuWrapper },
1350
- React__namespace.createElement(ButtonGroup, { className: ui.classNames(ui.ComponentClassName.MenuContent, className), ref: ref, size: size, testId: MENU_ITEMS_GROUP_TEST_ID, ...rest }, children))));
1350
+ 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))));
1351
1351
  };
1352
1352
  /**
1353
1353
  * [📖 Docs](https://ui.docs.amplify.aws/react/components/menu)
@@ -2383,7 +2383,7 @@ const defaultDeleteUserDisplayText = {
2383
2383
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2384
2384
  };
2385
2385
 
2386
- const VERSION = '6.1.6';
2386
+ const VERSION = '6.1.8';
2387
2387
 
2388
2388
  const logger$2 = ui.getLogger('AccountSettings');
2389
2389
  const getIsDisabled = (formValues, validationError) => {
@@ -718,7 +718,7 @@
718
718
  --amplify-components-link-focus-color: var(--amplify-colors-font-focus);
719
719
  --amplify-components-link-hover-color: var(--amplify-colors-font-hover);
720
720
  --amplify-components-link-visited-color: var(--amplify-colors-font-interactive);
721
- --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-black);
721
+ --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-background-primary);
722
722
  --amplify-components-loader-width: var(--amplify-font-sizes-medium);
723
723
  --amplify-components-loader-height: var(--amplify-font-sizes-medium);
724
724
  --amplify-components-loader-font-size: var(--amplify-font-sizes-xs);
@@ -719,7 +719,7 @@
719
719
  --amplify-components-link-focus-color: var(--amplify-colors-font-focus);
720
720
  --amplify-components-link-hover-color: var(--amplify-colors-font-hover);
721
721
  --amplify-components-link-visited-color: var(--amplify-colors-font-interactive);
722
- --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-black);
722
+ --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-background-primary);
723
723
  --amplify-components-loader-width: var(--amplify-font-sizes-medium);
724
724
  --amplify-components-loader-height: var(--amplify-font-sizes-medium);
725
725
  --amplify-components-loader-font-size: var(--amplify-font-sizes-xs);
package/dist/styles.css CHANGED
@@ -718,7 +718,7 @@
718
718
  --amplify-components-link-focus-color: var(--amplify-colors-font-focus);
719
719
  --amplify-components-link-hover-color: var(--amplify-colors-font-hover);
720
720
  --amplify-components-link-visited-color: var(--amplify-colors-font-interactive);
721
- --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-black);
721
+ --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-background-primary);
722
722
  --amplify-components-loader-width: var(--amplify-font-sizes-medium);
723
723
  --amplify-components-loader-height: var(--amplify-font-sizes-medium);
724
724
  --amplify-components-loader-font-size: var(--amplify-font-sizes-xs);
@@ -719,7 +719,7 @@
719
719
  --amplify-components-link-focus-color: var(--amplify-colors-font-focus);
720
720
  --amplify-components-link-hover-color: var(--amplify-colors-font-hover);
721
721
  --amplify-components-link-visited-color: var(--amplify-colors-font-interactive);
722
- --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-black);
722
+ --amplify-components-liveness-camera-module-background-color: var(--amplify-colors-background-primary);
723
723
  --amplify-components-loader-width: var(--amplify-font-sizes-medium);
724
724
  --amplify-components-loader-height: var(--amplify-font-sizes-medium);
725
725
  --amplify-components-loader-font-size: var(--amplify-font-sizes-xs);
@@ -1 +1 @@
1
- export declare const VERSION = "6.1.6";
1
+ export declare const VERSION = "6.1.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "6.1.6",
3
+ "version": "6.1.8",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -49,8 +49,8 @@
49
49
  "typecheck": "tsc --noEmit"
50
50
  },
51
51
  "dependencies": {
52
- "@aws-amplify/ui": "6.0.12",
53
- "@aws-amplify/ui-react-core": "3.0.12",
52
+ "@aws-amplify/ui": "6.0.13",
53
+ "@aws-amplify/ui-react-core": "3.0.13",
54
54
  "@radix-ui/react-direction": "1.0.0",
55
55
  "@radix-ui/react-dropdown-menu": "1.0.0",
56
56
  "@radix-ui/react-slider": "1.0.0",
@@ -60,7 +60,7 @@
60
60
  "tslib": "^2.5.2"
61
61
  },
62
62
  "peerDependencies": {
63
- "aws-amplify": "^6.0.2",
63
+ "aws-amplify": "^6.0.26",
64
64
  "react": "^16.14.0 || ^17.0 || ^18.0",
65
65
  "react-dom": "^16.14.0 || ^17.0 || ^18.0"
66
66
  },