@cloudscape-design/components 3.0.357 → 3.0.359
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/alert/actions-wrapper/index.d.ts +16 -0
- package/alert/actions-wrapper/index.d.ts.map +1 -0
- package/alert/actions-wrapper/index.js +22 -0
- package/alert/actions-wrapper/index.js.map +1 -0
- package/alert/actions-wrapper/styles.css.js +6 -0
- package/alert/actions-wrapper/styles.scoped.css +17 -0
- package/alert/actions-wrapper/styles.selectors.js +7 -0
- package/alert/internal.d.ts.map +1 -1
- package/alert/internal.js +11 -5
- package/alert/internal.js.map +1 -1
- package/alert/styles.css.js +25 -24
- package/alert/styles.scoped.css +40 -39
- package/alert/styles.selectors.js +25 -24
- package/app-layout/runtime-api.d.ts +1 -1
- package/app-layout/runtime-api.d.ts.map +1 -1
- package/app-layout/runtime-api.js +6 -20
- package/app-layout/runtime-api.js.map +1 -1
- package/button-dropdown/item-element/styles.css.js +15 -14
- package/button-dropdown/item-element/styles.scoped.css +18 -18
- package/button-dropdown/item-element/styles.selectors.js +15 -14
- package/cards/index.d.ts.map +1 -1
- package/cards/index.js +10 -7
- package/cards/index.js.map +1 -1
- package/container/internal.d.ts +1 -2
- package/container/internal.d.ts.map +1 -1
- package/container/internal.js +2 -3
- package/container/internal.js.map +1 -1
- package/file-upload/dropzone/index.d.ts +1 -1
- package/file-upload/dropzone/index.d.ts.map +1 -1
- package/file-upload/dropzone/index.js +10 -4
- package/file-upload/dropzone/index.js.map +1 -1
- package/file-upload/internal.js +1 -1
- package/file-upload/internal.js.map +1 -1
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +11 -7
- package/flashbar/flash.js.map +1 -1
- package/flashbar/styles.css.js +47 -46
- package/flashbar/styles.scoped.css +146 -145
- package/flashbar/styles.selectors.js +47 -46
- package/header/internal.d.ts.map +1 -1
- package/header/internal.js +5 -0
- package/header/internal.js.map +1 -1
- package/internal/context/collection-label-context.d.ts +7 -0
- package/internal/context/collection-label-context.d.ts.map +1 -0
- package/internal/context/collection-label-context.js +5 -0
- package/internal/context/collection-label-context.js.map +1 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/internal/plugins/api.d.ts +16 -1
- package/internal/plugins/api.d.ts.map +1 -1
- package/internal/plugins/api.js +22 -5
- package/internal/plugins/api.js.map +1 -1
- package/internal/plugins/controllers/action-buttons.d.ts +25 -0
- package/internal/plugins/controllers/action-buttons.d.ts.map +1 -0
- package/internal/plugins/controllers/action-buttons.js +29 -0
- package/internal/plugins/controllers/action-buttons.js.map +1 -0
- package/internal/plugins/{drawers-controller.d.ts → controllers/drawers.d.ts} +3 -4
- package/internal/plugins/controllers/drawers.d.ts.map +1 -0
- package/internal/plugins/{drawers-controller.js → controllers/drawers.js} +7 -12
- package/internal/plugins/controllers/drawers.js.map +1 -0
- package/internal/plugins/helpers/index.d.ts +3 -0
- package/internal/plugins/helpers/index.d.ts.map +1 -0
- package/internal/plugins/helpers/index.js +5 -0
- package/internal/plugins/helpers/index.js.map +1 -0
- package/internal/plugins/helpers/runtime-content-wrapper.d.ts +8 -0
- package/internal/plugins/helpers/runtime-content-wrapper.d.ts.map +1 -0
- package/internal/plugins/helpers/runtime-content-wrapper.js +14 -0
- package/internal/plugins/helpers/runtime-content-wrapper.js.map +1 -0
- package/internal/plugins/helpers/use-discovered-action.d.ts +8 -0
- package/internal/plugins/helpers/use-discovered-action.d.ts.map +1 -0
- package/internal/plugins/helpers/use-discovered-action.js +24 -0
- package/internal/plugins/helpers/use-discovered-action.js.map +1 -0
- package/internal/plugins/helpers/utils.d.ts +5 -0
- package/internal/plugins/helpers/utils.d.ts.map +1 -0
- package/internal/plugins/helpers/utils.js +12 -0
- package/internal/plugins/helpers/utils.js.map +1 -0
- package/package.json +1 -1
- package/split-panel/styles.css.js +56 -56
- package/split-panel/styles.scoped.css +80 -78
- package/split-panel/styles.selectors.js +56 -56
- package/table/interfaces.d.ts +2 -3
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +15 -3
- package/table/internal.js.map +1 -1
- package/table/table-role/table-role-helper.d.ts +1 -0
- package/table/table-role/table-role-helper.d.ts.map +1 -1
- package/table/table-role/table-role-helper.js +1 -0
- package/table/table-role/table-role-helper.js.map +1 -1
- package/table/tools-header.d.ts.map +1 -1
- package/table/tools-header.js +10 -2
- package/table/tools-header.js.map +1 -1
- package/test-utils/dom/alert/index.js +1 -1
- package/test-utils/dom/alert/index.js.map +1 -1
- package/test-utils/dom/flashbar/flash.js +1 -1
- package/test-utils/dom/flashbar/flash.js.map +1 -1
- package/test-utils/selectors/alert/index.js +1 -1
- package/test-utils/selectors/alert/index.js.map +1 -1
- package/test-utils/selectors/flashbar/flash.js +1 -1
- package/test-utils/selectors/flashbar/flash.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/internal/plugins/drawers-controller.d.ts.map +0 -1
- package/internal/plugins/drawers-controller.js.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InternalButtonProps } from '../../button/internal';
|
|
3
|
+
interface ActionsWrapperProps {
|
|
4
|
+
className: string;
|
|
5
|
+
testUtilClasses: {
|
|
6
|
+
actionSlot: string;
|
|
7
|
+
actionButton: string;
|
|
8
|
+
};
|
|
9
|
+
action: React.ReactNode;
|
|
10
|
+
discoveredActions: Array<React.ReactNode>;
|
|
11
|
+
buttonText: React.ReactNode;
|
|
12
|
+
onButtonClick: InternalButtonProps['onClick'];
|
|
13
|
+
}
|
|
14
|
+
export declare function ActionsWrapper({ className, testUtilClasses, action, discoveredActions, buttonText, onButtonClick, }: ActionsWrapperProps): JSX.Element | null;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["alert/actions-wrapper/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAuB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAkB5E,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,iBAAiB,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,aAAa,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;CAC/C;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,eAAe,EACf,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,aAAa,GACd,EAAE,mBAAmB,sBAYrB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import styles from './styles.css.js';
|
|
6
|
+
import InternalButton from '../../button/internal';
|
|
7
|
+
function createActionButton(testUtilClasses, action, buttonText, onButtonClick) {
|
|
8
|
+
if (!action && buttonText) {
|
|
9
|
+
action = (React.createElement(InternalButton, { className: testUtilClasses.actionButton, onClick: onButtonClick, formAction: "none" }, buttonText));
|
|
10
|
+
}
|
|
11
|
+
return action ? React.createElement("div", { className: testUtilClasses.actionSlot }, action) : null;
|
|
12
|
+
}
|
|
13
|
+
export function ActionsWrapper({ className, testUtilClasses, action, discoveredActions, buttonText, onButtonClick, }) {
|
|
14
|
+
const actionButton = createActionButton(testUtilClasses, action, buttonText, onButtonClick);
|
|
15
|
+
if (!actionButton && discoveredActions.length === 0) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return (React.createElement("div", { className: clsx(styles.root, className) },
|
|
19
|
+
actionButton,
|
|
20
|
+
discoveredActions));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["alert/actions-wrapper/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAuC,MAAM,uBAAuB,CAAC;AAE5E,SAAS,kBAAkB,CACzB,eAAuD,EACvD,MAAuB,EACvB,UAA2B,EAC3B,aAA6C;IAE7C,IAAI,CAAC,MAAM,IAAI,UAAU,EAAE;QACzB,MAAM,GAAG,CACP,oBAAC,cAAc,IAAC,SAAS,EAAE,eAAe,CAAC,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAC,MAAM,IAC/F,UAAU,CACI,CAClB,CAAC;KACH;IACD,OAAO,MAAM,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAE,eAAe,CAAC,UAAU,IAAG,MAAM,CAAO,CAAC,CAAC,CAAC,IAAI,CAAC;AACpF,CAAC;AAWD,MAAM,UAAU,cAAc,CAAC,EAC7B,SAAS,EACT,eAAe,EACf,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,aAAa,GACO;IACpB,MAAM,YAAY,GAAG,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IAC5F,IAAI,CAAC,YAAY,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE;QACnD,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC;QACzC,YAAY;QACZ,iBAAiB,CACd,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport styles from './styles.css.js';\nimport InternalButton, { InternalButtonProps } from '../../button/internal';\n\nfunction createActionButton(\n testUtilClasses: ActionsWrapperProps['testUtilClasses'],\n action: React.ReactNode,\n buttonText: React.ReactNode,\n onButtonClick: InternalButtonProps['onClick']\n) {\n if (!action && buttonText) {\n action = (\n <InternalButton className={testUtilClasses.actionButton} onClick={onButtonClick} formAction=\"none\">\n {buttonText}\n </InternalButton>\n );\n }\n return action ? <div className={testUtilClasses.actionSlot}>{action}</div> : null;\n}\n\ninterface ActionsWrapperProps {\n className: string;\n testUtilClasses: { actionSlot: string; actionButton: string };\n action: React.ReactNode;\n discoveredActions: Array<React.ReactNode>;\n buttonText: React.ReactNode;\n onButtonClick: InternalButtonProps['onClick'];\n}\n\nexport function ActionsWrapper({\n className,\n testUtilClasses,\n action,\n discoveredActions,\n buttonText,\n onButtonClick,\n}: ActionsWrapperProps) {\n const actionButton = createActionButton(testUtilClasses, action, buttonText, onButtonClick);\n if (!actionButton && discoveredActions.length === 0) {\n return null;\n }\n\n return (\n <div className={clsx(styles.root, className)}>\n {actionButton}\n {discoveredActions}\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/*
|
|
6
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
.awsui_root_37gf8_14wux_9:not(#\9) {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
gap: var(--space-xs-zb16t3, 8px);
|
|
14
|
+
}
|
|
15
|
+
.awsui_root_37gf8_14wux_9 > :not(#\9):empty {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
package/alert/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAYtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAYtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAqBlF,QAAA,MAAM,aAAa;;qEAqGlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/alert/internal.js
CHANGED
|
@@ -16,12 +16,16 @@ import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
|
16
16
|
import { useInternalI18n } from '../i18n/context';
|
|
17
17
|
import { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';
|
|
18
18
|
import { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';
|
|
19
|
+
import { createUseDiscoveredAction } from '../internal/plugins/helpers';
|
|
20
|
+
import { awsuiPluginsInternal } from '../internal/plugins/api';
|
|
21
|
+
import { ActionsWrapper } from './actions-wrapper';
|
|
19
22
|
const typeToIcon = {
|
|
20
23
|
error: 'status-negative',
|
|
21
24
|
warning: 'status-warning',
|
|
22
25
|
success: 'status-positive',
|
|
23
26
|
info: 'status-info',
|
|
24
27
|
};
|
|
28
|
+
const useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered);
|
|
25
29
|
const InternalAlert = React.forwardRef((_a, ref) => {
|
|
26
30
|
var { type, statusIconAriaLabel, visible = true, dismissible, dismissAriaLabel, children, header, buttonText, action, onDismiss, onButtonClick, __internalRootRef = null } = _a, rest = __rest(_a, ["type", "statusIconAriaLabel", "visible", "dismissible", "dismissAriaLabel", "children", "header", "buttonText", "action", "onDismiss", "onButtonClick", "__internalRootRef"]);
|
|
27
31
|
const baseProps = getBaseProps(rest);
|
|
@@ -32,8 +36,7 @@ const InternalAlert = React.forwardRef((_a, ref) => {
|
|
|
32
36
|
const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);
|
|
33
37
|
const isRefresh = useVisualRefresh();
|
|
34
38
|
const size = isRefresh ? 'normal' : header && children ? 'big' : 'normal';
|
|
35
|
-
const
|
|
36
|
-
const hasAction = Boolean(action || buttonText);
|
|
39
|
+
const { discoveredActions, headerRef, contentRef } = useDiscoveredAction(type);
|
|
37
40
|
const analyticsAttributes = {
|
|
38
41
|
[DATA_ATTR_ANALYTICS_ALERT]: type,
|
|
39
42
|
};
|
|
@@ -47,9 +50,12 @@ const InternalAlert = React.forwardRef((_a, ref) => {
|
|
|
47
50
|
React.createElement(InternalIcon, { name: typeToIcon[type], size: size })),
|
|
48
51
|
React.createElement("div", { className: styles.body },
|
|
49
52
|
React.createElement("div", { className: clsx(styles.message, styles.text) },
|
|
50
|
-
header && React.createElement("div", { className: styles.header }, header),
|
|
51
|
-
React.createElement("div", { className: styles.content }, children)))),
|
|
52
|
-
|
|
53
|
+
header && (React.createElement("div", { className: styles.header, ref: headerRef }, header)),
|
|
54
|
+
React.createElement("div", { className: styles.content, ref: contentRef }, children)))),
|
|
55
|
+
React.createElement(ActionsWrapper, { className: styles.action, testUtilClasses: {
|
|
56
|
+
actionSlot: styles['action-slot'],
|
|
57
|
+
actionButton: styles['action-button'],
|
|
58
|
+
}, action: action, discoveredActions: discoveredActions, buttonText: buttonText, onButtonClick: () => fireNonCancelableEvent(onButtonClick) })),
|
|
53
59
|
dismissible && (React.createElement("div", { className: styles.dismiss },
|
|
54
60
|
React.createElement(InternalButton, { className: styles['dismiss-button'], variant: "icon", iconName: "close", formAction: "none", ariaLabel: i18n('dismissAriaLabel', dismissAriaLabel), onClick: () => fireNonCancelableEvent(onDismiss) }))))))));
|
|
55
61
|
});
|
package/alert/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["alert/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC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AE,CAAC,sBAAsB,CAAC,aAAa,CAAC,GAC1D,CACE;oBACL,WAAW,IAAI,CACd,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO;wBAC5B,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,OAAO,EAAC,MAAM,EACd,QAAQ,EAAC,OAAO,EAChB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,EACrD,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,CAAC,GAChD,CACE,CACP,CACG,CACQ,CACmB,CACjC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../button/internal';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport VisualContext from '../internal/components/visual-context';\nimport styles from './styles.css.js';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { AlertProps } from './interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\nimport { useInternalI18n } from '../i18n/context';\nimport { DATA_ATTR_ANALYTICS_ALERT } from '../internal/analytics/selectors';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { createUseDiscoveredAction } from '../internal/plugins/helpers';\nimport { awsuiPluginsInternal } from '../internal/plugins/api';\nimport { ActionsWrapper } from './actions-wrapper';\n\nconst typeToIcon: Record<AlertProps.Type, IconProps['name']> = {\n error: 'status-negative',\n warning: 'status-warning',\n success: 'status-positive',\n info: 'status-info',\n};\n\ntype InternalAlertProps = SomeRequired<AlertProps, 'type'> & InternalBaseComponentProps;\n\nconst useDiscoveredAction = createUseDiscoveredAction(awsuiPluginsInternal.alert.onActionRegistered);\n\nconst InternalAlert = React.forwardRef(\n (\n {\n type,\n statusIconAriaLabel,\n visible = true,\n dismissible,\n dismissAriaLabel,\n children,\n header,\n buttonText,\n action,\n onDismiss,\n onButtonClick,\n __internalRootRef = null,\n ...rest\n }: InternalAlertProps,\n ref: React.Ref<AlertProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('alert');\n\n const focusRef = useRef<HTMLDivElement>(null);\n useForwardFocus(ref, focusRef);\n\n const [breakpoint, breakpointRef] = useContainerBreakpoints(['xs']);\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n const size = isRefresh ? 'normal' : header && children ? 'big' : 'normal';\n\n const { discoveredActions, headerRef, contentRef } = useDiscoveredAction(type);\n\n const analyticsAttributes = {\n [DATA_ATTR_ANALYTICS_ALERT]: type,\n };\n\n return (\n <div\n {...baseProps}\n {...analyticsAttributes}\n aria-hidden={!visible}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n styles[`breakpoint-${breakpoint}`]\n )}\n ref={mergedRef}\n >\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <VisualContext contextName=\"alert\">\n <div className={clsx(styles.alert, styles[`type-${type}`], styles[`icon-size-${size}`])}>\n <div className={styles['alert-mobile-block']}>\n <div className={styles['alert-focus-wrapper']} tabIndex={-1} ref={focusRef}>\n <div className={clsx(styles.icon, styles.text)} role=\"img\" aria-label={statusIconAriaLabel}>\n <InternalIcon name={typeToIcon[type]} size={size} />\n </div>\n <div className={styles.body}>\n <div className={clsx(styles.message, styles.text)}>\n {header && (\n <div className={styles.header} ref={headerRef}>\n {header}\n </div>\n )}\n <div className={styles.content} ref={contentRef}>\n {children}\n </div>\n </div>\n </div>\n </div>\n <ActionsWrapper\n className={styles.action}\n testUtilClasses={{\n actionSlot: styles['action-slot'],\n actionButton: styles['action-button'],\n }}\n action={action}\n discoveredActions={discoveredActions}\n buttonText={buttonText}\n onButtonClick={() => fireNonCancelableEvent(onButtonClick)}\n />\n </div>\n {dismissible && (\n <div className={styles.dismiss}>\n <InternalButton\n className={styles['dismiss-button']}\n variant=\"icon\"\n iconName=\"close\"\n formAction=\"none\"\n ariaLabel={i18n('dismissAriaLabel', dismissAriaLabel)}\n onClick={() => fireNonCancelableEvent(onDismiss)}\n />\n </div>\n )}\n </div>\n </VisualContext>\n </LinkDefaultVariantContext.Provider>\n </div>\n );\n }\n);\n\nexport default InternalAlert;\n"]}
|
package/alert/styles.css.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"alert": "
|
|
5
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
6
|
-
"root": "
|
|
7
|
-
"hidden": "
|
|
8
|
-
"body": "
|
|
9
|
-
"header": "
|
|
10
|
-
"action": "
|
|
11
|
-
"action-
|
|
12
|
-
"
|
|
13
|
-
"alert-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"icon-size-
|
|
20
|
-
"icon-size-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"dismiss
|
|
24
|
-
"
|
|
25
|
-
"type-
|
|
26
|
-
"type-
|
|
27
|
-
"type-
|
|
4
|
+
"alert": "awsui_alert_mx3cw_1xp9u_93",
|
|
5
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_1xp9u_1",
|
|
6
|
+
"root": "awsui_root_mx3cw_1xp9u_119",
|
|
7
|
+
"hidden": "awsui_hidden_mx3cw_1xp9u_135",
|
|
8
|
+
"body": "awsui_body_mx3cw_1xp9u_161",
|
|
9
|
+
"header": "awsui_header_mx3cw_1xp9u_167",
|
|
10
|
+
"action": "awsui_action_mx3cw_1xp9u_171",
|
|
11
|
+
"action-slot": "awsui_action-slot_mx3cw_1xp9u_176",
|
|
12
|
+
"action-button": "awsui_action-button_mx3cw_1xp9u_177",
|
|
13
|
+
"alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_1xp9u_181",
|
|
14
|
+
"alert-mobile-block": "awsui_alert-mobile-block_mx3cw_1xp9u_207",
|
|
15
|
+
"text": "awsui_text_mx3cw_1xp9u_212",
|
|
16
|
+
"icon": "awsui_icon_mx3cw_1xp9u_216",
|
|
17
|
+
"message": "awsui_message_mx3cw_1xp9u_219",
|
|
18
|
+
"breakpoint-default": "awsui_breakpoint-default_mx3cw_1xp9u_224",
|
|
19
|
+
"icon-size-medium": "awsui_icon-size-medium_mx3cw_1xp9u_230",
|
|
20
|
+
"icon-size-big": "awsui_icon-size-big_mx3cw_1xp9u_233",
|
|
21
|
+
"icon-size-normal": "awsui_icon-size-normal_mx3cw_1xp9u_236",
|
|
22
|
+
"content": "awsui_content_mx3cw_1xp9u_246",
|
|
23
|
+
"dismiss": "awsui_dismiss_mx3cw_1xp9u_250",
|
|
24
|
+
"dismiss-button": "awsui_dismiss-button_mx3cw_1xp9u_256",
|
|
25
|
+
"type-error": "awsui_type-error_mx3cw_1xp9u_264",
|
|
26
|
+
"type-warning": "awsui_type-warning_mx3cw_1xp9u_272",
|
|
27
|
+
"type-success": "awsui_type-success_mx3cw_1xp9u_280",
|
|
28
|
+
"type-info": "awsui_type-info_mx3cw_1xp9u_288"
|
|
28
29
|
};
|
|
29
30
|
|
package/alert/styles.scoped.css
CHANGED
|
@@ -90,10 +90,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
94
|
-
animation: awsui_awsui-motion-fade-
|
|
93
|
+
.awsui_alert_mx3cw_1xp9u_93:not(#\9) {
|
|
94
|
+
animation: awsui_awsui-motion-fade-in_mx3cw_1xp9u_1 var(--motion-duration-show-paced-q2lo2h, 180ms) var(--motion-easing-show-paced-ne2o0s, ease-out);
|
|
95
95
|
}
|
|
96
|
-
@keyframes awsui_awsui-motion-fade-
|
|
96
|
+
@keyframes awsui_awsui-motion-fade-in_mx3cw_1xp9u_1 {
|
|
97
97
|
from {
|
|
98
98
|
opacity: 0.2;
|
|
99
99
|
}
|
|
@@ -102,12 +102,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
@media (prefers-reduced-motion: reduce) {
|
|
105
|
-
.
|
|
105
|
+
.awsui_alert_mx3cw_1xp9u_93:not(#\9) {
|
|
106
106
|
animation: none;
|
|
107
107
|
transition: none;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
.awsui-motion-disabled .
|
|
110
|
+
.awsui-motion-disabled .awsui_alert_mx3cw_1xp9u_93:not(#\9), .awsui-mode-entering .awsui_alert_mx3cw_1xp9u_93:not(#\9) {
|
|
111
111
|
animation: none;
|
|
112
112
|
transition: none;
|
|
113
113
|
}
|
|
@@ -116,7 +116,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
116
116
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
117
117
|
SPDX-License-Identifier: Apache-2.0
|
|
118
118
|
*/
|
|
119
|
-
.
|
|
119
|
+
.awsui_root_mx3cw_1xp9u_119:not(#\9) {
|
|
120
120
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
121
121
|
border-collapse: separate;
|
|
122
122
|
border-spacing: 0;
|
|
@@ -158,11 +158,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
158
158
|
overflow: hidden;
|
|
159
159
|
display: block;
|
|
160
160
|
}
|
|
161
|
-
.
|
|
161
|
+
.awsui_root_mx3cw_1xp9u_119.awsui_hidden_mx3cw_1xp9u_135:not(#\9) {
|
|
162
162
|
display: none;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
.
|
|
165
|
+
.awsui_alert_mx3cw_1xp9u_93:not(#\9) {
|
|
166
166
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
167
167
|
border-collapse: separate;
|
|
168
168
|
border-spacing: 0;
|
|
@@ -210,40 +210,41 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
210
210
|
background-color: var(--color-background-container-content-4un1ap, #ffffff);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
.
|
|
213
|
+
.awsui_body_mx3cw_1xp9u_161:not(#\9) {
|
|
214
214
|
display: flex;
|
|
215
215
|
flex: 1 1 0%;
|
|
216
216
|
min-width: 0;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
.
|
|
219
|
+
.awsui_header_mx3cw_1xp9u_167:not(#\9) {
|
|
220
220
|
font-weight: 700;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
.
|
|
223
|
+
.awsui_action_mx3cw_1xp9u_171:not(#\9) {
|
|
224
224
|
white-space: nowrap;
|
|
225
225
|
margin-left: var(--space-alert-action-left-ea9czk, 12px);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
.awsui_action-
|
|
228
|
+
.awsui_action-slot_mx3cw_1xp9u_176:not(#\9),
|
|
229
|
+
.awsui_action-button_mx3cw_1xp9u_177:not(#\9) {
|
|
229
230
|
/* used in test-utils */
|
|
230
231
|
}
|
|
231
232
|
|
|
232
|
-
.awsui_alert-focus-
|
|
233
|
+
.awsui_alert-focus-wrapper_mx3cw_1xp9u_181:not(#\9) {
|
|
233
234
|
display: flex;
|
|
234
235
|
flex: 1 1 0%;
|
|
235
236
|
}
|
|
236
|
-
.awsui_alert-focus-
|
|
237
|
+
.awsui_alert-focus-wrapper_mx3cw_1xp9u_181:not(#\9):focus {
|
|
237
238
|
outline: none;
|
|
238
239
|
}
|
|
239
|
-
body[data-awsui-focus-visible=true] .awsui_alert-focus-
|
|
240
|
+
body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_1xp9u_181:not(#\9):focus {
|
|
240
241
|
position: relative;
|
|
241
242
|
}
|
|
242
|
-
body[data-awsui-focus-visible=true] .awsui_alert-focus-
|
|
243
|
+
body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_1xp9u_181:not(#\9):focus {
|
|
243
244
|
outline: 2px dotted transparent;
|
|
244
245
|
outline-offset: calc(var(--space-button-focus-outline-gutter-cqfd0c, 4px) - 1px);
|
|
245
246
|
}
|
|
246
|
-
body[data-awsui-focus-visible=true] .awsui_alert-focus-
|
|
247
|
+
body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_1xp9u_181:not(#\9):focus::before {
|
|
247
248
|
content: " ";
|
|
248
249
|
display: block;
|
|
249
250
|
position: absolute;
|
|
@@ -255,91 +256,91 @@ body[data-awsui-focus-visible=true] .awsui_alert-focus-wrapper_mx3cw_1kx9t_180:n
|
|
|
255
256
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
256
257
|
}
|
|
257
258
|
|
|
258
|
-
.awsui_alert-mobile-
|
|
259
|
+
.awsui_alert-mobile-block_mx3cw_1xp9u_207:not(#\9) {
|
|
259
260
|
display: flex;
|
|
260
261
|
flex: 1 1 0%;
|
|
261
262
|
}
|
|
262
263
|
|
|
263
|
-
.
|
|
264
|
+
.awsui_text_mx3cw_1xp9u_212:not(#\9) {
|
|
264
265
|
padding: var(--border-field-width-09w7vk, 2px) 0;
|
|
265
266
|
margin: var(--space-scaled-xxs-7597g1, 4px) var(--space-xxs-p8yyaw, 4px);
|
|
266
267
|
}
|
|
267
|
-
.
|
|
268
|
+
.awsui_text_mx3cw_1xp9u_212.awsui_icon_mx3cw_1xp9u_216:not(#\9) {
|
|
268
269
|
margin-left: 0;
|
|
269
270
|
}
|
|
270
|
-
.
|
|
271
|
+
.awsui_text_mx3cw_1xp9u_212.awsui_message_mx3cw_1xp9u_219:not(#\9) {
|
|
271
272
|
margin-right: var(--space-alert-message-right-knlb6u, 4px);
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
/* stylelint-disable selector-max-type */
|
|
275
|
-
.
|
|
276
|
+
.awsui_root_mx3cw_1xp9u_119.awsui_breakpoint-default_mx3cw_1xp9u_224 > div > .awsui_alert_mx3cw_1xp9u_93 > .awsui_alert-mobile-block_mx3cw_1xp9u_207:not(#\9) {
|
|
276
277
|
display: block;
|
|
277
278
|
}
|
|
278
|
-
.
|
|
279
|
+
.awsui_root_mx3cw_1xp9u_119.awsui_breakpoint-default_mx3cw_1xp9u_224 > div > .awsui_alert_mx3cw_1xp9u_93 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_action_mx3cw_1xp9u_171:not(#\9) {
|
|
279
280
|
margin-bottom: var(--space-xxs-p8yyaw, 4px);
|
|
280
281
|
}
|
|
281
|
-
.
|
|
282
|
+
.awsui_root_mx3cw_1xp9u_119.awsui_breakpoint-default_mx3cw_1xp9u_224 > div > .awsui_alert_mx3cw_1xp9u_93.awsui_icon-size-medium_mx3cw_1xp9u_230 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_action_mx3cw_1xp9u_171:not(#\9) {
|
|
282
283
|
margin-left: calc(var(--size-icon-medium-y9xuoq, 20px) + var(--space-xs-zb16t3, 8px));
|
|
283
284
|
}
|
|
284
|
-
.
|
|
285
|
+
.awsui_root_mx3cw_1xp9u_119.awsui_breakpoint-default_mx3cw_1xp9u_224 > div > .awsui_alert_mx3cw_1xp9u_93.awsui_icon-size-big_mx3cw_1xp9u_233 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_action_mx3cw_1xp9u_171:not(#\9) {
|
|
285
286
|
margin-left: calc(var(--size-icon-big-zkdryd, 32px) + var(--space-xs-zb16t3, 8px));
|
|
286
287
|
}
|
|
287
|
-
.
|
|
288
|
+
.awsui_root_mx3cw_1xp9u_119.awsui_breakpoint-default_mx3cw_1xp9u_224 > div > .awsui_alert_mx3cw_1xp9u_93.awsui_icon-size-normal_mx3cw_1xp9u_236 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_action_mx3cw_1xp9u_171:not(#\9) {
|
|
288
289
|
margin-left: calc(var(--size-icon-normal-0m1722, 16px) + var(--space-xs-zb16t3, 8px));
|
|
289
290
|
}
|
|
290
291
|
|
|
291
292
|
/* stylelint-enable selector-max-type */
|
|
292
|
-
.
|
|
293
|
+
.awsui_message_mx3cw_1xp9u_219:not(#\9) {
|
|
293
294
|
flex: 1 1 0%;
|
|
294
295
|
min-width: 0;
|
|
295
296
|
}
|
|
296
297
|
|
|
297
|
-
.
|
|
298
|
+
.awsui_content_mx3cw_1xp9u_246:not(#\9) {
|
|
298
299
|
/* used in test-utils */
|
|
299
300
|
}
|
|
300
301
|
|
|
301
|
-
.
|
|
302
|
+
.awsui_dismiss_mx3cw_1xp9u_250:not(#\9) {
|
|
302
303
|
flex: 0 0 auto;
|
|
303
304
|
margin-right: calc(-1 * var(--space-xxs-p8yyaw, 4px));
|
|
304
305
|
margin-left: var(--space-s-34lx8l, 12px);
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
.awsui_dismiss-
|
|
308
|
+
.awsui_dismiss-button_mx3cw_1xp9u_256:not(#\9) {
|
|
308
309
|
/* used in test-utils */
|
|
309
310
|
}
|
|
310
311
|
|
|
311
|
-
.
|
|
312
|
+
.awsui_icon_mx3cw_1xp9u_216:not(#\9) {
|
|
312
313
|
flex: 0 0 auto;
|
|
313
314
|
}
|
|
314
315
|
|
|
315
|
-
.awsui_type-
|
|
316
|
+
.awsui_type-error_mx3cw_1xp9u_264:not(#\9) {
|
|
316
317
|
border-color: var(--color-border-status-error-dj6icm, #d91515);
|
|
317
318
|
background-color: var(--color-background-status-error-pbprvn, #fff7f7);
|
|
318
319
|
}
|
|
319
|
-
.awsui_type-
|
|
320
|
+
.awsui_type-error_mx3cw_1xp9u_264 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_alert-focus-wrapper_mx3cw_1xp9u_181 > .awsui_icon_mx3cw_1xp9u_216:not(#\9) {
|
|
320
321
|
color: var(--color-text-status-error-wdvepn, #d91515);
|
|
321
322
|
}
|
|
322
323
|
|
|
323
|
-
.awsui_type-
|
|
324
|
+
.awsui_type-warning_mx3cw_1xp9u_272:not(#\9) {
|
|
324
325
|
border-color: var(--color-border-status-warning-52glov, #8d6605);
|
|
325
326
|
background-color: var(--color-background-status-warning-oor4hw, #fffce9);
|
|
326
327
|
}
|
|
327
|
-
.awsui_type-
|
|
328
|
+
.awsui_type-warning_mx3cw_1xp9u_272 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_alert-focus-wrapper_mx3cw_1xp9u_181 > .awsui_icon_mx3cw_1xp9u_216:not(#\9) {
|
|
328
329
|
color: var(--color-text-status-warning-yik8vi, #8d6605);
|
|
329
330
|
}
|
|
330
331
|
|
|
331
|
-
.awsui_type-
|
|
332
|
+
.awsui_type-success_mx3cw_1xp9u_280:not(#\9) {
|
|
332
333
|
border-color: var(--color-border-status-success-wmgb40, #037f0c);
|
|
333
334
|
background-color: var(--color-background-status-success-jp14wa, #f2fcf3);
|
|
334
335
|
}
|
|
335
|
-
.awsui_type-
|
|
336
|
+
.awsui_type-success_mx3cw_1xp9u_280 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_alert-focus-wrapper_mx3cw_1xp9u_181 > .awsui_icon_mx3cw_1xp9u_216:not(#\9) {
|
|
336
337
|
color: var(--color-text-status-success-bpiyjm, #037f0c);
|
|
337
338
|
}
|
|
338
339
|
|
|
339
|
-
.awsui_type-
|
|
340
|
+
.awsui_type-info_mx3cw_1xp9u_288:not(#\9) {
|
|
340
341
|
border-color: var(--color-border-status-info-8upc6f, #0972d3);
|
|
341
342
|
background-color: var(--color-background-status-info-mvnbre, #f2f8fd);
|
|
342
343
|
}
|
|
343
|
-
.awsui_type-
|
|
344
|
+
.awsui_type-info_mx3cw_1xp9u_288 > .awsui_alert-mobile-block_mx3cw_1xp9u_207 > .awsui_alert-focus-wrapper_mx3cw_1xp9u_181 > .awsui_icon_mx3cw_1xp9u_216:not(#\9) {
|
|
344
345
|
color: var(--color-text-status-info-ahz8zp, #0972d3);
|
|
345
346
|
}
|
|
@@ -2,29 +2,30 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"alert": "
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"root": "
|
|
8
|
-
"hidden": "
|
|
9
|
-
"body": "
|
|
10
|
-
"header": "
|
|
11
|
-
"action": "
|
|
12
|
-
"action-
|
|
13
|
-
"
|
|
14
|
-
"alert-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"icon-size-
|
|
21
|
-
"icon-size-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"dismiss
|
|
25
|
-
"
|
|
26
|
-
"type-
|
|
27
|
-
"type-
|
|
28
|
-
"type-
|
|
5
|
+
"alert": "awsui_alert_mx3cw_1xp9u_93",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_mx3cw_1xp9u_1",
|
|
7
|
+
"root": "awsui_root_mx3cw_1xp9u_119",
|
|
8
|
+
"hidden": "awsui_hidden_mx3cw_1xp9u_135",
|
|
9
|
+
"body": "awsui_body_mx3cw_1xp9u_161",
|
|
10
|
+
"header": "awsui_header_mx3cw_1xp9u_167",
|
|
11
|
+
"action": "awsui_action_mx3cw_1xp9u_171",
|
|
12
|
+
"action-slot": "awsui_action-slot_mx3cw_1xp9u_176",
|
|
13
|
+
"action-button": "awsui_action-button_mx3cw_1xp9u_177",
|
|
14
|
+
"alert-focus-wrapper": "awsui_alert-focus-wrapper_mx3cw_1xp9u_181",
|
|
15
|
+
"alert-mobile-block": "awsui_alert-mobile-block_mx3cw_1xp9u_207",
|
|
16
|
+
"text": "awsui_text_mx3cw_1xp9u_212",
|
|
17
|
+
"icon": "awsui_icon_mx3cw_1xp9u_216",
|
|
18
|
+
"message": "awsui_message_mx3cw_1xp9u_219",
|
|
19
|
+
"breakpoint-default": "awsui_breakpoint-default_mx3cw_1xp9u_224",
|
|
20
|
+
"icon-size-medium": "awsui_icon-size-medium_mx3cw_1xp9u_230",
|
|
21
|
+
"icon-size-big": "awsui_icon-size-big_mx3cw_1xp9u_233",
|
|
22
|
+
"icon-size-normal": "awsui_icon-size-normal_mx3cw_1xp9u_236",
|
|
23
|
+
"content": "awsui_content_mx3cw_1xp9u_246",
|
|
24
|
+
"dismiss": "awsui_dismiss_mx3cw_1xp9u_250",
|
|
25
|
+
"dismiss-button": "awsui_dismiss-button_mx3cw_1xp9u_256",
|
|
26
|
+
"type-error": "awsui_type-error_mx3cw_1xp9u_264",
|
|
27
|
+
"type-warning": "awsui_type-warning_mx3cw_1xp9u_272",
|
|
28
|
+
"type-success": "awsui_type-success_mx3cw_1xp9u_280",
|
|
29
|
+
"type-info": "awsui_type-info_mx3cw_1xp9u_288"
|
|
29
30
|
};
|
|
30
31
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DrawerConfig as RuntimeDrawerConfig } from '../internal/plugins/drawers
|
|
1
|
+
import { DrawerConfig as RuntimeDrawerConfig } from '../internal/plugins/controllers/drawers';
|
|
2
2
|
import { DrawerItem } from './drawer/interfaces';
|
|
3
3
|
export interface DrawersLayout {
|
|
4
4
|
before: Array<DrawerItem>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-api.d.ts","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime-api.d.ts","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAkBxF"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import React
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
const container = ref.current;
|
|
9
|
-
mountContent(container);
|
|
10
|
-
return () => unmountContent(container);
|
|
11
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
|
-
}, []);
|
|
13
|
-
return React.createElement("div", { ref: ref });
|
|
14
|
-
}
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { RuntimeContentWrapper } from '../internal/plugins/helpers';
|
|
6
|
+
import { sortByPriority } from '../internal/plugins/helpers/utils';
|
|
15
7
|
export function convertRuntimeDrawers(drawers) {
|
|
16
8
|
const converted = drawers.map((_a) => {
|
|
17
9
|
var { mountContent, unmountContent, trigger } = _a, runtimeDrawer = __rest(_a, ["mountContent", "unmountContent", "trigger"]);
|
|
@@ -21,16 +13,10 @@ export function convertRuntimeDrawers(drawers) {
|
|
|
21
13
|
React.createElement("span", { dangerouslySetInnerHTML: { __html: trigger.iconSvg } })),
|
|
22
14
|
}, content: (React.createElement(RuntimeContentWrapper, { key: runtimeDrawer.id, mountContent: mountContent, unmountContent: unmountContent })) }));
|
|
23
15
|
});
|
|
24
|
-
|
|
25
|
-
var _a, _b;
|
|
26
|
-
if (b.orderPriority !== a.orderPriority) {
|
|
27
|
-
return Math.sign(((_a = b.orderPriority) !== null && _a !== void 0 ? _a : 0) - ((_b = a.orderPriority) !== null && _b !== void 0 ? _b : 0));
|
|
28
|
-
}
|
|
29
|
-
return b.id < a.id ? 1 : -1;
|
|
30
|
-
});
|
|
16
|
+
const sorted = sortByPriority(converted);
|
|
31
17
|
return {
|
|
32
|
-
before:
|
|
33
|
-
after:
|
|
18
|
+
before: sorted.filter(item => { var _a; return ((_a = item.orderPriority) !== null && _a !== void 0 ? _a : 0) > 0; }),
|
|
19
|
+
after: sorted.filter(item => { var _a; return ((_a = item.orderPriority) !== null && _a !== void 0 ? _a : 0) <= 0; }),
|
|
34
20
|
};
|
|
35
21
|
}
|
|
36
22
|
//# sourceMappingURL=runtime-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-api.js","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"runtime-api.js","sourceRoot":"lib/default/","sources":["app-layout/runtime-api.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAOnE,MAAM,UAAU,qBAAqB,CAAC,OAAmC;IACvE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAA2D,EAAE,EAAE;YAA/D,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,OAAoB,EAAf,aAAa,cAAzD,6CAA2D,CAAF;QAAO,OAAA,iCAC1F,aAAa,KAChB,OAAO,EAAE;gBACP,OAAO,EAAE;gBACP,2CAA2C;gBAC3C,8BAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,GAAI,CAC/D;aACF,EACD,OAAO,EAAE,CACP,oBAAC,qBAAqB,IAAC,GAAG,EAAE,aAAa,CAAC,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,GAAI,CAC7G,IACD,CAAA;KAAA,CAAC,CAAC;IACJ,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC;QAC5D,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,IAAI,CAAC,CAAA,EAAA,CAAC;KAC7D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { DrawerConfig as RuntimeDrawerConfig } from '../internal/plugins/controllers/drawers';\nimport { RuntimeContentWrapper } from '../internal/plugins/helpers';\nimport { DrawerItem } from './drawer/interfaces';\nimport { sortByPriority } from '../internal/plugins/helpers/utils';\n\nexport interface DrawersLayout {\n before: Array<DrawerItem>;\n after: Array<DrawerItem>;\n}\n\nexport function convertRuntimeDrawers(drawers: Array<RuntimeDrawerConfig>): DrawersLayout {\n const converted = drawers.map(({ mountContent, unmountContent, trigger, ...runtimeDrawer }) => ({\n ...runtimeDrawer,\n trigger: {\n iconSvg: (\n // eslint-disable-next-line react/no-danger\n <span dangerouslySetInnerHTML={{ __html: trigger.iconSvg }} />\n ),\n },\n content: (\n <RuntimeContentWrapper key={runtimeDrawer.id} mountContent={mountContent} unmountContent={unmountContent} />\n ),\n }));\n const sorted = sortByPriority(converted);\n return {\n before: sorted.filter(item => (item.orderPriority ?? 0) > 0),\n after: sorted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n"]}
|