@aws-amplify/ui-react 6.1.7 → 6.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Field-e99a3ed1.js → Field-1f747369.js} +14 -0
- package/dist/esm/internal.mjs +1 -0
- package/dist/esm/primitives/ButtonGroup/ButtonGroup.mjs +3 -3
- package/dist/esm/primitives/Menu/Menu.mjs +3 -3
- package/dist/esm/primitives/Menu/MenuButton.mjs +2 -2
- package/dist/esm/version.mjs +1 -1
- package/dist/index.js +11 -23
- package/dist/internal.js +2 -1
- package/dist/types/internal.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var core = require('@aws-amplify/core');
|
|
5
5
|
var auth = require('aws-amplify/auth');
|
|
6
|
+
var uiReactCore = require('@aws-amplify/ui-react-core');
|
|
6
7
|
var ui = require('@aws-amplify/ui');
|
|
7
8
|
|
|
8
9
|
function _interopNamespace(e) {
|
|
@@ -339,6 +340,18 @@ const useBreakpoint = ({ breakpoints, defaultBreakpoint, }) => {
|
|
|
339
340
|
return breakpoint;
|
|
340
341
|
};
|
|
341
342
|
|
|
343
|
+
/**
|
|
344
|
+
* Logs a deprecation warning `message` to the console.
|
|
345
|
+
*/
|
|
346
|
+
const useDeprecationWarning = ({ message, shouldWarn: _shouldWarn, }) => {
|
|
347
|
+
const shouldWarn = _shouldWarn &&
|
|
348
|
+
// show message on builds without Node `process` polyfill
|
|
349
|
+
// or with process.env.NODE_ENV not production
|
|
350
|
+
(typeof process === 'undefined' ||
|
|
351
|
+
(process && process.env.NODE_ENV !== 'production'));
|
|
352
|
+
uiReactCore.useDeprecationWarning({ message, shouldWarn });
|
|
353
|
+
};
|
|
354
|
+
|
|
342
355
|
/**
|
|
343
356
|
* @internal May be removed in a future version
|
|
344
357
|
* Maps from component style props to React `style` props
|
|
@@ -1176,6 +1189,7 @@ exports.strHasLength = strHasLength;
|
|
|
1176
1189
|
exports.useAuth = useAuth;
|
|
1177
1190
|
exports.useBreakpoint = useBreakpoint;
|
|
1178
1191
|
exports.useColorMode = useColorMode;
|
|
1192
|
+
exports.useDeprecationWarning = useDeprecationWarning;
|
|
1179
1193
|
exports.useDropZone = useDropZone;
|
|
1180
1194
|
exports.useFieldset = useFieldset;
|
|
1181
1195
|
exports.useIcons = useIcons;
|
package/dist/esm/internal.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { useAuth } from './hooks/useAuth.mjs';
|
|
2
2
|
export { useStorageURL } from './hooks/useStorageURL.mjs';
|
|
3
3
|
export { useThemeBreakpoint } from './hooks/useThemeBreakpoint.mjs';
|
|
4
|
+
export { useDeprecationWarning } from './hooks/useDeprecationWarning.mjs';
|
|
4
5
|
export { useColorMode } from './hooks/useTheme.mjs';
|
|
5
6
|
export { FilterChildren } from './components/FilterChildren/FilterChildren.mjs';
|
|
6
7
|
export { AlertIcon } from './primitives/Alert/AlertIcon.mjs';
|
|
@@ -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
|
|
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';
|
package/dist/esm/version.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var isEqual = require('lodash/isEqual.js');
|
|
7
7
|
var uiReactCore = require('@aws-amplify/ui-react-core');
|
|
8
8
|
var ui = require('@aws-amplify/ui');
|
|
9
|
-
var Field = require('./Field-
|
|
9
|
+
var Field = require('./Field-1f747369.js');
|
|
10
10
|
require('aws-amplify/storage');
|
|
11
11
|
var debounce = require('lodash/debounce.js');
|
|
12
12
|
var Dropdown = require('@radix-ui/react-dropdown-menu');
|
|
@@ -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
|
|
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.
|
|
2386
|
+
const VERSION = '6.1.9';
|
|
2387
2387
|
|
|
2388
2388
|
const logger$2 = ui.getLogger('AccountSettings');
|
|
2389
2389
|
const getIsDisabled = (formValues, validationError) => {
|
|
@@ -2622,18 +2622,6 @@ DeleteUser.WarningView = DEFAULTS.WarningView;
|
|
|
2622
2622
|
|
|
2623
2623
|
var AccountSettings = { ChangePassword, DeleteUser };
|
|
2624
2624
|
|
|
2625
|
-
/**
|
|
2626
|
-
* Logs a deprecation warning `message` to the console.
|
|
2627
|
-
*/
|
|
2628
|
-
const useDeprecationWarning = ({ message, shouldWarn: _shouldWarn, }) => {
|
|
2629
|
-
const shouldWarn = _shouldWarn &&
|
|
2630
|
-
// show message on builds without Node `process` polyfill
|
|
2631
|
-
// or with process.env.NODE_ENV not production
|
|
2632
|
-
(typeof process === 'undefined' ||
|
|
2633
|
-
(process && process.env.NODE_ENV !== 'production'));
|
|
2634
|
-
uiReactCore.useDeprecationWarning({ message, shouldWarn });
|
|
2635
|
-
};
|
|
2636
|
-
|
|
2637
2625
|
const CustomComponentsContext =
|
|
2638
2626
|
// @ts-ignore
|
|
2639
2627
|
React__namespace.createContext(null);
|
|
@@ -3301,7 +3289,7 @@ const defaultComponents = {
|
|
|
3301
3289
|
// Once the `Provider` is removed from the `Authenticator` component and exported as
|
|
3302
3290
|
// `AuthenticatorProvider`, this component should be renamed to `Authenticator`.
|
|
3303
3291
|
function AuthenticatorInternal({ children, className, components: customComponents, formFields, hideSignUp, initialState, loginMechanisms, passwordSettings, signUpAttributes, services, socialProviders, variation, }) {
|
|
3304
|
-
useDeprecationWarning({
|
|
3292
|
+
Field.useDeprecationWarning({
|
|
3305
3293
|
message: 'The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.',
|
|
3306
3294
|
// shouldWarn: !!passwordSettings,
|
|
3307
3295
|
/**
|
package/dist/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Field = require('./Field-
|
|
5
|
+
var Field = require('./Field-1f747369.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var Storage = require('aws-amplify/storage');
|
|
8
8
|
var ui = require('@aws-amplify/ui');
|
|
@@ -16402,6 +16402,7 @@ exports.IconVisibilityOff = Field.IconVisibilityOff;
|
|
|
16402
16402
|
exports.IconWarning = Field.IconWarning;
|
|
16403
16403
|
exports.useAuth = Field.useAuth;
|
|
16404
16404
|
exports.useColorMode = Field.useColorMode;
|
|
16405
|
+
exports.useDeprecationWarning = Field.useDeprecationWarning;
|
|
16405
16406
|
exports.useDropZone = Field.useDropZone;
|
|
16406
16407
|
exports.useIcons = Field.useIcons;
|
|
16407
16408
|
exports.FilterChildren = FilterChildren;
|
package/dist/types/internal.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './hooks/useAuth';
|
|
2
2
|
export * from './hooks/useStorageURL';
|
|
3
3
|
export * from './hooks/useThemeBreakpoint';
|
|
4
|
+
export { useDeprecationWarning } from './hooks/useDeprecationWarning';
|
|
4
5
|
export { useColorMode } from './hooks/useTheme';
|
|
5
6
|
export * from './components/FilterChildren';
|
|
6
7
|
export { AlertIcon } from './primitives/Alert/AlertIcon';
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "6.1.
|
|
1
|
+
export declare const VERSION = "6.1.9";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.9",
|
|
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.
|
|
53
|
-
"@aws-amplify/ui-react-core": "3.0.
|
|
52
|
+
"@aws-amplify/ui": "6.0.14",
|
|
53
|
+
"@aws-amplify/ui-react-core": "3.0.14",
|
|
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
|
|
63
|
+
"aws-amplify": "^6.2.0",
|
|
64
64
|
"react": "^16.14.0 || ^17.0 || ^18.0",
|
|
65
65
|
"react-dom": "^16.14.0 || ^17.0 || ^18.0"
|
|
66
66
|
},
|