@cloudscape-design/components 3.0.1392 → 3.0.1394
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/styles.css.js +27 -27
- package/alert/styles.scoped.css +43 -43
- package/alert/styles.selectors.js +27 -27
- package/badge/styles.css.js +10 -10
- package/badge/styles.scoped.css +11 -11
- package/badge/styles.selectors.js +10 -10
- package/button/styles.css.js +23 -23
- package/button/styles.scoped.css +71 -71
- package/button/styles.selectors.js +23 -23
- package/checkbox/styles.css.js +3 -3
- package/checkbox/styles.scoped.css +8 -8
- package/checkbox/styles.selectors.js +3 -3
- package/dropdown/styles.css.js +20 -20
- package/dropdown/styles.scoped.css +38 -38
- package/dropdown/styles.selectors.js +20 -20
- package/input/internal.d.ts.map +1 -1
- package/input/internal.js +3 -4
- package/input/internal.js.map +1 -1
- package/input/styles.css.js +36 -34
- package/input/styles.scoped.css +89 -79
- package/input/styles.selectors.js +36 -34
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/button-trigger/index.d.ts +2 -2
- package/internal/components/button-trigger/index.d.ts.map +1 -1
- package/internal/components/button-trigger/index.js +3 -2
- package/internal/components/button-trigger/index.js.map +1 -1
- package/internal/components/button-trigger/styles.css.js +21 -19
- package/internal/components/button-trigger/styles.scoped.css +49 -39
- package/internal/components/button-trigger/styles.selectors.js +21 -19
- package/internal/components/control-group/grouped-control-styles.d.ts +12 -0
- package/internal/components/control-group/grouped-control-styles.d.ts.map +1 -0
- package/internal/components/control-group/grouped-control-styles.js +14 -0
- package/internal/components/control-group/grouped-control-styles.js.map +1 -0
- package/internal/components/control-group/index.d.ts +3 -0
- package/internal/components/control-group/index.d.ts.map +1 -1
- package/internal/components/control-group/index.js +5 -5
- package/internal/components/control-group/index.js.map +1 -1
- package/internal/components/control-group/styles.css.js +8 -4
- package/internal/components/control-group/styles.scoped.css +13 -4
- package/internal/components/control-group/styles.selectors.js +8 -4
- package/internal/components/focus-lock/index.d.ts +6 -0
- package/internal/components/focus-lock/index.d.ts.map +1 -1
- package/internal/components/focus-lock/index.js +8 -3
- package/internal/components/focus-lock/index.js.map +1 -1
- package/internal/context/control-group-context.d.ts +6 -0
- package/internal/context/control-group-context.d.ts.map +1 -1
- package/internal/context/control-group-context.js +3 -1
- package/internal/context/control-group-context.js.map +1 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/key-value-pairs/styles.css.js +8 -8
- package/key-value-pairs/styles.scoped.css +16 -11
- package/key-value-pairs/styles.selectors.js +8 -8
- package/link/styles.css.js +21 -21
- package/link/styles.scoped.css +73 -73
- package/link/styles.selectors.js +21 -21
- package/manifest.json +2 -2
- package/modal/index.d.ts +1 -0
- package/modal/index.d.ts.map +1 -1
- package/modal/index.js +6 -5
- package/modal/index.js.map +1 -1
- package/modal/interfaces.d.ts +7 -0
- package/modal/interfaces.d.ts.map +1 -1
- package/modal/interfaces.js.map +1 -1
- package/modal/internal.js +23 -6
- package/modal/internal.js.map +1 -1
- package/modal/styles.css.js +32 -31
- package/modal/styles.scoped.css +49 -46
- package/modal/styles.selectors.js +32 -31
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +7 -3
- package/multiselect/internal.js.map +1 -1
- package/package.json +1 -1
- package/prompt-input/styles.css.js +26 -26
- package/prompt-input/styles.scoped.css +57 -53
- package/prompt-input/styles.selectors.js +26 -26
- package/radio-button/styles.css.js +1 -1
- package/radio-button/styles.scoped.css +2 -2
- package/radio-button/styles.selectors.js +1 -1
- package/segmented-control/internal-segmented-control.d.ts +3 -3
- package/segmented-control/internal-segmented-control.d.ts.map +1 -1
- package/segmented-control/internal-segmented-control.js +8 -5
- package/segmented-control/internal-segmented-control.js.map +1 -1
- package/segmented-control/internal.d.ts.map +1 -1
- package/segmented-control/internal.js +4 -6
- package/segmented-control/internal.js.map +1 -1
- package/segmented-control/segment.d.ts +1 -0
- package/segmented-control/segment.d.ts.map +1 -1
- package/segmented-control/segment.js +2 -2
- package/segmented-control/segment.js.map +1 -1
- package/segmented-control/styles.css.js +26 -21
- package/segmented-control/styles.scoped.css +75 -43
- package/segmented-control/styles.selectors.js +26 -21
- package/select/internal.js +2 -2
- package/select/internal.js.map +1 -1
- package/select/parts/trigger.d.ts +2 -2
- package/select/parts/trigger.d.ts.map +1 -1
- package/select/parts/trigger.js +2 -2
- package/select/parts/trigger.js.map +1 -1
- package/space-between/internal.d.ts.map +1 -1
- package/space-between/internal.js +2 -1
- package/space-between/internal.js.map +1 -1
- package/space-between/styles.css.js +24 -23
- package/space-between/styles.scoped.css +29 -24
- package/space-between/styles.selectors.js +24 -23
- package/steps/styles.css.js +17 -17
- package/steps/styles.scoped.css +35 -35
- package/steps/styles.selectors.js +17 -17
- package/toggle/styles.css.js +10 -10
- package/toggle/styles.scoped.css +20 -20
- package/toggle/styles.selectors.js +10 -10
package/modal/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/modal/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { PortalProps } from '@cloudscape-design/component-toolkit/internal';\n\nimport { FlowType } from '../types/analytics';\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface BaseModalProps {\n /**\n * Use this property to specify a different dynamic modal root for the dialog.\n * The function will be called when a user clicks on the trigger button.\n */\n getModalRoot?: PortalProps['getContainer'];\n\n /**\n * Use this property when `getModalRoot` is used to clean up the modal root\n * element after a user closes the dialog. The function receives the return value\n * of the most recent getModalRoot call as an argument.\n */\n removeModalRoot?: PortalProps['removeContainer'];\n}\n\nexport interface ModalProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies the width of the modal. When provided, takes precedence over the `size` property.\n * If the specified width exceeds available viewport space, the modal will use the maximum available space.\n * The minimum width is 320px (equivalent to the `small` size).\n */\n width?: number;\n\n /**\n * Specifies the height of the modal. When provided, the modal content becomes scrollable if it exceeds the specified height.\n * If the specified height exceeds available viewport space, the modal will use the maximum available space.\n * To make sure the content is accessible, the component will apply a minimum height of 60px for the content area,\n * plus the header height and the footer height.\n */\n height?: number;\n\n /**\n * Sets the width of the modal. `max` uses variable width up to the\n * largest size allowed by the design guidelines. Other sizes have fixed widths:\n * `small` (320px), `medium` (600px), `large` (820px), `x-large` (1024px), `xx-large` (1280px).\n */\n size?: ModalProps.Size;\n /**\n * Controls the vertical positioning of the modal.\n *\n * - `center` (default) - The modal is vertically centered in the viewport and re-centers\n * when content height changes. Use for dialogs with static, predictable content.\n *\n * - `top` - The modal anchors at fixed distance and grows downward\n * as content expands. Use when the content changes dynamically to prevent disruptive\n * vertical repositioning that can cause users to lose context.\n */\n position?: ModalProps.Position;\n /**\n * Determines whether the modal is displayed on the screen. Modals are hidden by default.\n * Set this property to `true` to show them.\n */\n visible: boolean;\n /**\n * Adds an `aria-label` to the close button, for accessibility.\n * @i18n\n */\n closeAriaLabel?: string;\n /**\n * Specifies a title for the modal. Although this can be empty, we suggest that you always provide a title.\n */\n header?: React.ReactNode;\n /**\n * Body of the modal.\n */\n children?: React.ReactNode;\n /**\n * Specifies a footer for the modal. If empty, the footer isn't displayed.\n */\n footer?: React.ReactNode;\n /**\n * Determines whether the modal content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n /**\n * Called when a user closes the modal by using the close icon button,\n * clicking outside of the modal, or pressing ESC.\n * The event detail contains the `reason`, which can be any of the following:\n * `['closeButton', 'overlay', 'keyboard']`.\n */\n onDismiss?: NonCancelableEventHandler<ModalProps.DismissDetail>;\n /**\n * Specifies the HTML element where the modal is rendered.\n * If neither `modalRoot` or `getModalRoot` properties are provided, the modal will\n * render to an element under `document.body`.\n */\n modalRoot?: HTMLElement;\n\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * * `resourceType` - Identifies the type of resource represented by the flow. **Note:** This API is currently experimental.\n * @analytics\n */\n analyticsMetadata?: ModalProps.AnalyticsMetadata;\n}\n\nexport namespace ModalProps {\n export type Size = 'small' | 'medium' | 'large' | 'x-large' | 'xx-large' | 'max';\n export type Position = 'center' | 'top';\n\n export interface DismissDetail {\n reason: string;\n }\n\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: FlowType;\n resourceType?: string;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/modal/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { PortalProps } from '@cloudscape-design/component-toolkit/internal';\n\nimport { FlowType } from '../types/analytics';\nimport { BaseComponentProps } from '../types/base-component';\nimport { NonCancelableEventHandler } from '../types/events';\n\nexport interface BaseModalProps {\n /**\n * Use this property to specify a different dynamic modal root for the dialog.\n * The function will be called when a user clicks on the trigger button.\n */\n getModalRoot?: PortalProps['getContainer'];\n\n /**\n * Use this property when `getModalRoot` is used to clean up the modal root\n * element after a user closes the dialog. The function receives the return value\n * of the most recent getModalRoot call as an argument.\n */\n removeModalRoot?: PortalProps['removeContainer'];\n}\n\nexport interface ModalProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies the width of the modal. When provided, takes precedence over the `size` property.\n * If the specified width exceeds available viewport space, the modal will use the maximum available space.\n * The minimum width is 320px (equivalent to the `small` size).\n */\n width?: number;\n\n /**\n * Specifies the height of the modal. When provided, the modal content becomes scrollable if it exceeds the specified height.\n * If the specified height exceeds available viewport space, the modal will use the maximum available space.\n * To make sure the content is accessible, the component will apply a minimum height of 60px for the content area,\n * plus the header height and the footer height.\n */\n height?: number;\n\n /**\n * Sets the width of the modal. `max` uses variable width up to the\n * largest size allowed by the design guidelines. Other sizes have fixed widths:\n * `small` (320px), `medium` (600px), `large` (820px), `x-large` (1024px), `xx-large` (1280px).\n */\n size?: ModalProps.Size;\n /**\n * Controls the vertical positioning of the modal.\n *\n * - `center` (default) - The modal is vertically centered in the viewport and re-centers\n * when content height changes. Use for dialogs with static, predictable content.\n *\n * - `top` - The modal anchors at fixed distance and grows downward\n * as content expands. Use when the content changes dynamically to prevent disruptive\n * vertical repositioning that can cause users to lose context.\n */\n position?: ModalProps.Position;\n /**\n * Determines whether the close button is displayed in the header.\n * When set to `true`, the close button isn't rendered, and the user resolves\n * the modal by choosing one of the actions in the footer.\n * ESC and clicks outside the modal still call `onDismiss`.\n */\n hideDismissButton?: boolean;\n /**\n * Determines whether the modal is displayed on the screen. Modals are hidden by default.\n * Set this property to `true` to show them.\n */\n visible: boolean;\n /**\n * Adds an `aria-label` to the close button, for accessibility.\n * @i18n\n */\n closeAriaLabel?: string;\n /**\n * Specifies a title for the modal. Although this can be empty, we suggest that you always provide a title.\n */\n header?: React.ReactNode;\n /**\n * Body of the modal.\n */\n children?: React.ReactNode;\n /**\n * Specifies a footer for the modal. If empty, the footer isn't displayed.\n */\n footer?: React.ReactNode;\n /**\n * Determines whether the modal content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n /**\n * Called when a user closes the modal by using the close icon button,\n * clicking outside of the modal, or pressing ESC.\n * The event detail contains the `reason`, which can be any of the following:\n * `['closeButton', 'overlay', 'keyboard']`.\n */\n onDismiss?: NonCancelableEventHandler<ModalProps.DismissDetail>;\n /**\n * Specifies the HTML element where the modal is rendered.\n * If neither `modalRoot` or `getModalRoot` properties are provided, the modal will\n * render to an element under `document.body`.\n */\n modalRoot?: HTMLElement;\n\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * * `resourceType` - Identifies the type of resource represented by the flow. **Note:** This API is currently experimental.\n * @analytics\n */\n analyticsMetadata?: ModalProps.AnalyticsMetadata;\n}\n\nexport namespace ModalProps {\n export type Size = 'small' | 'medium' | 'large' | 'x-large' | 'xx-large' | 'max';\n export type Position = 'center' | 'top';\n\n export interface DismissDetail {\n reason: string;\n }\n\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: FlowType;\n resourceType?: string;\n }\n}\n"]}
|
package/modal/internal.js
CHANGED
|
@@ -44,7 +44,7 @@ export default function InternalModal({ modalRoot, getModalRoot, removeModalRoot
|
|
|
44
44
|
}
|
|
45
45
|
// Separate component to prevent the Portal from getting in the way of refs, as it needs extra cycles to render the inner components.
|
|
46
46
|
// useContainerQuery needs its targeted element to exist on the first render in order to work properly.
|
|
47
|
-
function PortaledModal({ size, visible, header, children, footer, disableContentPaddings, position = 'center', onButtonClick = () => { }, onDismiss, width, height, __internalRootRef, __injectAnalyticsComponentMetadata, __funnelProps, __funnelStepProps, __subStepRef, __subStepFunnelProps, referrerId, ...rest }) {
|
|
47
|
+
function PortaledModal({ size, hideDismissButton = false, visible, header, children, footer, disableContentPaddings, position = 'center', onButtonClick = () => { }, onDismiss, width, height, __internalRootRef, __injectAnalyticsComponentMetadata, __funnelProps, __funnelStepProps, __subStepRef, __subStepFunnelProps, referrerId, ...rest }) {
|
|
48
48
|
var _a;
|
|
49
49
|
const instanceUniqueId = useUniqueId();
|
|
50
50
|
const headerId = `${rest.id || instanceUniqueId}-header`;
|
|
@@ -54,6 +54,7 @@ function PortaledModal({ size, visible, header, children, footer, disableContent
|
|
|
54
54
|
const closeAriaLabel = i18n('closeAriaLabel', rest.closeAriaLabel);
|
|
55
55
|
const refObject = useRef(null);
|
|
56
56
|
const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef);
|
|
57
|
+
const dialogRef = useRef(null);
|
|
57
58
|
const isRefresh = useVisualRefresh();
|
|
58
59
|
const baseProps = getBaseProps(rest);
|
|
59
60
|
const analyticsComponentMetadata = {
|
|
@@ -122,6 +123,13 @@ function PortaledModal({ size, visible, header, children, footer, disableContent
|
|
|
122
123
|
const dismiss = (reason) => fireNonCancelableEvent(onDismiss, { reason });
|
|
123
124
|
const onOverlayMouseDown = (event) => {
|
|
124
125
|
lastMouseDownElementRef.current = event.target;
|
|
126
|
+
// The overlay can't hold focus, so pressing it would blur whatever is focused inside the
|
|
127
|
+
// dialog and leave focus on the document body. That takes focus out of the dialog, which
|
|
128
|
+
// breaks focus containment and stops ESC from reaching the handler on the dialog element.
|
|
129
|
+
// Preventing the default action keeps focus where it is.
|
|
130
|
+
if (event.target === refObject.current) {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
}
|
|
125
133
|
};
|
|
126
134
|
const onOverlayClick = (event) => {
|
|
127
135
|
const overlay = refObject.current;
|
|
@@ -140,7 +148,13 @@ function PortaledModal({ size, visible, header, children, footer, disableContent
|
|
|
140
148
|
// to detect when the user has scrolled to the bottom.
|
|
141
149
|
const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver();
|
|
142
150
|
const headerTextRef = useRef(null);
|
|
151
|
+
const headingTagRef = useRef(null);
|
|
143
152
|
const { subStepRef } = useFunnelSubStep();
|
|
153
|
+
// Without a dismiss button there is no predictable first focusable element, so focus the
|
|
154
|
+
// heading to announce what the modal is about. When no header is given, fall back to the
|
|
155
|
+
// dialog.
|
|
156
|
+
const hasHeader = header !== undefined && header !== null && header !== false && header !== '';
|
|
157
|
+
const autoFocusTarget = hideDismissButton ? (hasHeader ? headingTagRef : dialogRef) : undefined;
|
|
144
158
|
const { footerRef, headerRef, hasCustomHeight, hasCustomWidth, dialogCustomStyles, footerHeight } = useModalDimensions({
|
|
145
159
|
height,
|
|
146
160
|
width,
|
|
@@ -153,15 +167,18 @@ function PortaledModal({ size, visible, header, children, footer, disableContent
|
|
|
153
167
|
componentLoadingCount,
|
|
154
168
|
emitTimeToContentReadyInModal,
|
|
155
169
|
} },
|
|
156
|
-
React.createElement("div", { ...baseProps, ...__funnelProps, ...__funnelStepProps, className: clsx(styles.root, { [styles.hidden]: !visible }, baseProps.className, isRefresh && styles.refresh), role: "dialog", "aria-labelledby": headerId, onMouseDown: onOverlayMouseDown, onClick: onOverlayClick, ref: mergedRef, style: footerHeight ? { scrollPaddingBottom: footerHeight } : undefined, "data-awsui-referrer-id": ((_a = subStepRef.current) === null || _a === void 0 ? void 0 : _a.id) || referrerId },
|
|
157
|
-
React.createElement(FocusLock, { disabled: !visible, autoFocus: true, restoreFocus: true, className: clsx(styles['focus-lock'], styles[`position-${position}`]) },
|
|
158
|
-
React.createElement("div", { className: clsx(styles.dialog, !hasCustomWidth && styles[size], styles[`breakpoint-${breakpoint}`], isRefresh && styles.refresh, hasCustomWidth && styles['custom-width'], hasCustomHeight && styles['custom-height']), style: dialogCustomStyles, onKeyDown: escKeyHandler,
|
|
170
|
+
React.createElement("div", { ...baseProps, ...__funnelProps, ...__funnelStepProps, className: clsx(styles.root, { [styles.hidden]: !visible }, hideDismissButton && styles['hide-dismiss-button'], baseProps.className, isRefresh && styles.refresh), role: "dialog", "aria-labelledby": headerId, onMouseDown: onOverlayMouseDown, onClick: onOverlayClick, ref: mergedRef, style: footerHeight ? { scrollPaddingBottom: footerHeight } : undefined, "data-awsui-referrer-id": ((_a = subStepRef.current) === null || _a === void 0 ? void 0 : _a.id) || referrerId },
|
|
171
|
+
React.createElement(FocusLock, { disabled: !visible, autoFocus: true, restoreFocus: true, autoFocusTarget: autoFocusTarget, className: clsx(styles['focus-lock'], styles[`position-${position}`]) },
|
|
172
|
+
React.createElement("div", { className: clsx(styles.dialog, !hasCustomWidth && styles[size], styles[`breakpoint-${breakpoint}`], isRefresh && styles.refresh, hasCustomWidth && styles['custom-width'], hasCustomHeight && styles['custom-height']), ref: dialogRef, style: dialogCustomStyles, onKeyDown: escKeyHandler,
|
|
173
|
+
// Keeps the dialog focusable so that clicking a non-focusable area inside it moves
|
|
174
|
+
// focus to the dialog rather than the document body.
|
|
175
|
+
tabIndex: -1, ...metadataAttribute },
|
|
159
176
|
React.createElement("div", { className: clsx(styles.container, hasCustomHeight && styles['custom-height-container']) },
|
|
160
177
|
React.createElement("div", { ref: headerRef, className: clsx(styles.header, analyticsSelectors.header) },
|
|
161
|
-
React.createElement(InternalHeader, { variant: "h2", __disableActionsWrapping: true, actions: React.createElement("div", { ...getAnalyticsMetadataAttribute({
|
|
178
|
+
React.createElement(InternalHeader, { variant: "h2", __disableActionsWrapping: true, __headingTagRef: headingTagRef, __headingTagTabIndex: -1, actions: hideDismissButton ? undefined : (React.createElement("div", { ...getAnalyticsMetadataAttribute({
|
|
162
179
|
action: 'dismiss',
|
|
163
180
|
}) },
|
|
164
|
-
React.createElement(InternalButton, { ariaLabel: closeAriaLabel, className: styles['dismiss-control'], variant: "modal-dismiss", iconName: "close", formAction: "none", onClick: onCloseButtonClick })) },
|
|
181
|
+
React.createElement(InternalButton, { ariaLabel: closeAriaLabel, className: styles['dismiss-control'], variant: "modal-dismiss", iconName: "close", formAction: "none", onClick: onCloseButtonClick }))) },
|
|
165
182
|
React.createElement("span", { ref: headerTextRef, id: headerId, className: styles['header--text'] }, header))),
|
|
166
183
|
React.createElement(BuiltInErrorBoundary, { wrapper: content => React.createElement(InternalBox, { padding: { bottom: 'm', horizontal: 'l' } }, content) },
|
|
167
184
|
React.createElement("div", { ref: __subStepRef, ...__subStepFunnelProps, className: clsx(styles.content, { [styles['no-paddings']]: disableContentPaddings }, hasCustomHeight && styles['custom-height-content']), ...(hasCustomHeight && {
|
package/modal/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACl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,EAAE,CAAC;4CACX,IAAI,EAAE,QAAQ;4CACd,iBAAiB,EAAE,QAAQ;yCAC5B,CAAC;wCAED,QAAQ;wCACT,6BAAK,GAAG,EAAE,iBAAiB,GAAI,CAC3B;oCACL,MAAM,IAAI,CACT,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;wCACvD,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,WAAW,IAAI,eAAe,CAAC,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAE5F,MAAM,CACH,CACiB,CAC1B,CACoB,CACnB,CACF,CACI,CACR,CACgB,CACF,CACW,CACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { Portal, useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalBox from '../box/internal';\nimport { InternalButton } from '../button/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport InternalHeader from '../header/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { PerformanceMetrics } from '../internal/analytics';\nimport {\n FunnelNameSelectorContext,\n FunnelStepContextValue,\n FunnelSubStepContextValue,\n} from '../internal/analytics/context/analytics-context';\nimport { FunnelProps, useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport FocusLock from '../internal/components/focus-lock';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { ModalContext } from '../internal/context/modal-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useIntersectionObserver } from '../internal/hooks/use-intersection-observer';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { SomeRequired } from '../internal/types';\nimport {\n GeneratedAnalyticsMetadataModalComponent,\n GeneratedAnalyticsMetadataModalDismiss,\n} from './analytics-metadata/interfaces';\nimport { disableBodyScrolling, enableBodyScrolling } from './body-scroll';\nimport { ModalProps } from './interfaces';\nimport { useModalDimensions } from './use-modal-dimensions';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport function InternalModalAsFunnel(props: InternalModalProps) {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const onButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n <InternalModal\n __funnelProps={funnelProps}\n __funnelStepProps={funnelStepProps}\n __subStepRef={subStepRef}\n __subStepFunnelProps={funnelSubStepProps}\n onButtonClick={onButtonClick}\n {...props}\n />\n );\n}\n\ntype InternalModalProps = SomeRequired<ModalProps, 'size'> &\n InternalBaseComponentProps & {\n __funnelProps?: FunnelProps;\n __funnelStepProps?: FunnelStepContextValue['funnelStepProps'];\n __subStepRef?: FunnelSubStepContextValue['subStepRef'];\n __subStepFunnelProps?: FunnelSubStepContextValue['funnelSubStepProps'];\n __injectAnalyticsComponentMetadata?: boolean;\n onButtonClick?: ButtonContextProps['onClick'];\n referrerId?: string;\n width?: number;\n height?: number;\n };\n\nexport default function InternalModal({ modalRoot, getModalRoot, removeModalRoot, ...rest }: InternalModalProps) {\n return (\n <Portal container={modalRoot} getContainer={getModalRoot} removeContainer={removeModalRoot}>\n <PortaledModal {...rest} />\n </Portal>\n );\n}\n\ntype PortaledModalProps = Omit<InternalModalProps, 'modalRoot' | 'getModalRoot' | 'removeModalRoot'>;\n\n// Separate component to prevent the Portal from getting in the way of refs, as it needs extra cycles to render the inner components.\n// useContainerQuery needs its targeted element to exist on the first render in order to work properly.\nfunction PortaledModal({\n size,\n visible,\n header,\n children,\n footer,\n disableContentPaddings,\n position = 'center',\n onButtonClick = () => {},\n onDismiss,\n width,\n height,\n __internalRootRef,\n __injectAnalyticsComponentMetadata,\n __funnelProps,\n __funnelStepProps,\n __subStepRef,\n __subStepFunnelProps,\n referrerId,\n ...rest\n}: PortaledModalProps) {\n const instanceUniqueId = useUniqueId();\n const headerId = `${rest.id || instanceUniqueId}-header`;\n const lastMouseDownElementRef = useRef<HTMLElement | null>(null);\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n\n const i18n = useInternalI18n('modal');\n const closeAriaLabel = i18n('closeAriaLabel', rest.closeAriaLabel);\n\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef);\n\n const isRefresh = useVisualRefresh();\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataModalComponent = {\n name: 'awsui.Modal',\n label: `.${analyticsSelectors.header} h2`,\n };\n const metadataAttribute = __injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })\n : {};\n const loadStartTime = useRef<number>(0);\n const loadCompleteTime = useRef<number>(0);\n const componentLoadingCount = useRef<number>(0);\n const performanceMetricLogged = useRef<boolean>(false);\n\n // enable body scroll and restore focus if unmounting while visible\n useEffect(() => {\n return () => {\n enableBodyScrolling();\n };\n }, []);\n\n const resetModalPerformanceData = () => {\n loadStartTime.current = performance.now();\n loadCompleteTime.current = 0;\n performanceMetricLogged.current = false;\n };\n\n const emitTimeToContentReadyInModal = (loadCompleteTime: number) => {\n if (\n componentLoadingCount.current === 0 &&\n loadStartTime.current &&\n loadStartTime.current !== 0 &&\n !performanceMetricLogged.current\n ) {\n const timeToContentReadyInModal = loadCompleteTime - loadStartTime.current;\n PerformanceMetrics.modalPerformanceData({\n timeToContentReadyInModal,\n instanceIdentifier: instanceUniqueId,\n componentIdentifier: headerTextRef.current?.textContent || '',\n });\n performanceMetricLogged.current = true;\n }\n };\n\n const MODAL_READY_TIMEOUT = 100;\n /**\n * This useEffect is triggered when the visible attribute of modal changes.\n * When modal becomes visible, modal performance metrics are reset marking the beginning loading process.\n * To ensure that the modal component ready metric is always emitted, a setTimeout is implemented.\n * This setTimeout automatically emits the component ready metric after a specified duration.\n */\n useEffect(() => {\n if (visible) {\n disableBodyScrolling();\n resetModalPerformanceData();\n setTimeout(() => {\n emitTimeToContentReadyInModal(loadStartTime.current);\n }, MODAL_READY_TIMEOUT);\n } else {\n enableBodyScrolling();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible]);\n\n // Because we hide the element with styles (and not actually detach it from DOM), we need to scroll to top\n useEffect(() => {\n if (visible && refObject.current) {\n refObject.current.scrollTop = 0;\n }\n }, [visible]);\n\n const dismiss = (reason: string) => fireNonCancelableEvent(onDismiss, { reason });\n\n const onOverlayMouseDown = (event: React.MouseEvent) => {\n lastMouseDownElementRef.current = event.target as HTMLElement;\n };\n const onOverlayClick = (event: React.MouseEvent) => {\n const overlay = refObject.current;\n const lastClicked = lastMouseDownElementRef.current;\n\n if (event.target === overlay && lastClicked === overlay) {\n dismiss('overlay');\n }\n };\n const onCloseButtonClick = () => dismiss('closeButton');\n const escKeyHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n dismiss('keyboard');\n }\n };\n\n // We use an empty div element at the end of the content slot as a sentinel\n // to detect when the user has scrolled to the bottom.\n const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver();\n\n const headerTextRef = useRef<HTMLSpanElement>(null);\n const { subStepRef } = useFunnelSubStep();\n\n const { footerRef, headerRef, hasCustomHeight, hasCustomWidth, dialogCustomStyles, footerHeight } =\n useModalDimensions({\n height,\n width,\n hasFooter: !!footer,\n });\n\n return (\n <FunnelNameSelectorContext.Provider value={`.${styles['header--text']}`}>\n <ResetContextsForModal>\n <ModalContext.Provider\n value={{\n isInModal: true,\n componentLoadingCount,\n emitTimeToContentReadyInModal,\n }}\n >\n <div\n {...baseProps}\n {...__funnelProps}\n {...__funnelStepProps}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n baseProps.className,\n isRefresh && styles.refresh\n )}\n role=\"dialog\"\n aria-labelledby={headerId}\n onMouseDown={onOverlayMouseDown}\n onClick={onOverlayClick}\n ref={mergedRef}\n style={footerHeight ? { scrollPaddingBottom: footerHeight } : undefined}\n data-awsui-referrer-id={subStepRef.current?.id || referrerId}\n >\n <FocusLock\n disabled={!visible}\n autoFocus={true}\n restoreFocus={true}\n className={clsx(styles['focus-lock'], styles[`position-${position}`])}\n >\n <div\n className={clsx(\n styles.dialog,\n !hasCustomWidth && styles[size],\n styles[`breakpoint-${breakpoint}`],\n isRefresh && styles.refresh,\n hasCustomWidth && styles['custom-width'],\n hasCustomHeight && styles['custom-height']\n )}\n style={dialogCustomStyles}\n onKeyDown={escKeyHandler}\n {...metadataAttribute}\n >\n <div className={clsx(styles.container, hasCustomHeight && styles['custom-height-container'])}>\n <div ref={headerRef} className={clsx(styles.header, analyticsSelectors.header)}>\n <InternalHeader\n variant=\"h2\"\n __disableActionsWrapping={true}\n actions={\n <div\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataModalDismiss>)}\n >\n <InternalButton\n ariaLabel={closeAriaLabel}\n className={styles['dismiss-control']}\n variant=\"modal-dismiss\"\n iconName=\"close\"\n formAction=\"none\"\n onClick={onCloseButtonClick}\n />\n </div>\n }\n >\n <span ref={headerTextRef} id={headerId} className={styles['header--text']}>\n {header}\n </span>\n </InternalHeader>\n </div>\n <BuiltInErrorBoundary\n wrapper={content => <InternalBox padding={{ bottom: 'm', horizontal: 'l' }}>{content}</InternalBox>}\n >\n <div\n ref={__subStepRef}\n {...__subStepFunnelProps}\n className={clsx(\n styles.content,\n { [styles['no-paddings']]: disableContentPaddings },\n hasCustomHeight && styles['custom-height-content']\n )}\n {...(hasCustomHeight && {\n tabIndex: 0,\n role: 'region',\n 'aria-labelledby': headerId,\n })}\n >\n {children}\n <div ref={stickySentinelRef} />\n </div>\n {footer && (\n <ButtonContext.Provider value={{ onClick: onButtonClick }}>\n <div\n ref={footerRef}\n className={clsx(styles.footer, (footerStuck || hasCustomHeight) && styles['footer--rounded'])}\n >\n {footer}\n </div>\n </ButtonContext.Provider>\n )}\n </BuiltInErrorBoundary>\n </div>\n </div>\n </FocusLock>\n </div>\n </ModalContext.Provider>\n </ResetContextsForModal>\n </FunnelNameSelectorContext.Provider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/modal/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,yBAAyB,GAG1B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAA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AE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IACtE,MAAM,CACF,CACQ,CACb;gCACN,oBAAC,oBAAoB,IACnB,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,oBAAC,WAAW,IAAC,OAAO,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,IAAG,OAAO,CAAe;oCAEnG,6BACE,GAAG,EAAE,YAAY,KACb,oBAAoB,EACxB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO,EACd,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,sBAAsB,EAAE,EACnD,eAAe,IAAI,MAAM,CAAC,uBAAuB,CAAC,CACnD,KACG,CAAC,eAAe,IAAI;4CACtB,QAAQ,EAAE,CAAC;4CACX,IAAI,EAAE,QAAQ;4CACd,iBAAiB,EAAE,QAAQ;yCAC5B,CAAC;wCAED,QAAQ;wCACT,6BAAK,GAAG,EAAE,iBAAiB,GAAI,CAC3B;oCACL,MAAM,IAAI,CACT,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;wCACvD,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,WAAW,IAAI,eAAe,CAAC,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAE5F,MAAM,CACH,CACiB,CAC1B,CACoB,CACnB,CACF,CACI,CACR,CACgB,CACF,CACW,CACtC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { Portal, useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalBox from '../box/internal';\nimport { InternalButton } from '../button/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport InternalHeader from '../header/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { PerformanceMetrics } from '../internal/analytics';\nimport {\n FunnelNameSelectorContext,\n FunnelStepContextValue,\n FunnelSubStepContextValue,\n} from '../internal/analytics/context/analytics-context';\nimport { FunnelProps, useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport { getBaseProps } from '../internal/base-component';\nimport FocusLock from '../internal/components/focus-lock';\nimport { ButtonContext, ButtonContextProps } from '../internal/context/button-context';\nimport { ModalContext } from '../internal/context/modal-context';\nimport ResetContextsForModal from '../internal/context/reset-contexts-for-modal';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useIntersectionObserver } from '../internal/hooks/use-intersection-observer';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { KeyCode } from '../internal/keycode';\nimport { SomeRequired } from '../internal/types';\nimport {\n GeneratedAnalyticsMetadataModalComponent,\n GeneratedAnalyticsMetadataModalDismiss,\n} from './analytics-metadata/interfaces';\nimport { disableBodyScrolling, enableBodyScrolling } from './body-scroll';\nimport { ModalProps } from './interfaces';\nimport { useModalDimensions } from './use-modal-dimensions';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport function InternalModalAsFunnel(props: InternalModalProps) {\n const { funnelProps, funnelSubmit, funnelNextOrSubmitAttempt } = useFunnel();\n const { funnelStepProps } = useFunnelStep();\n const { subStepRef, funnelSubStepProps } = useFunnelSubStep();\n const onButtonClick: ButtonContextProps['onClick'] = ({ variant }) => {\n if (variant === 'primary') {\n funnelNextOrSubmitAttempt();\n funnelSubmit();\n }\n };\n\n return (\n <InternalModal\n __funnelProps={funnelProps}\n __funnelStepProps={funnelStepProps}\n __subStepRef={subStepRef}\n __subStepFunnelProps={funnelSubStepProps}\n onButtonClick={onButtonClick}\n {...props}\n />\n );\n}\n\ntype InternalModalProps = SomeRequired<ModalProps, 'size'> &\n InternalBaseComponentProps & {\n __funnelProps?: FunnelProps;\n __funnelStepProps?: FunnelStepContextValue['funnelStepProps'];\n __subStepRef?: FunnelSubStepContextValue['subStepRef'];\n __subStepFunnelProps?: FunnelSubStepContextValue['funnelSubStepProps'];\n __injectAnalyticsComponentMetadata?: boolean;\n onButtonClick?: ButtonContextProps['onClick'];\n referrerId?: string;\n width?: number;\n height?: number;\n };\n\nexport default function InternalModal({ modalRoot, getModalRoot, removeModalRoot, ...rest }: InternalModalProps) {\n return (\n <Portal container={modalRoot} getContainer={getModalRoot} removeContainer={removeModalRoot}>\n <PortaledModal {...rest} />\n </Portal>\n );\n}\n\ntype PortaledModalProps = Omit<InternalModalProps, 'modalRoot' | 'getModalRoot' | 'removeModalRoot'>;\n\n// Separate component to prevent the Portal from getting in the way of refs, as it needs extra cycles to render the inner components.\n// useContainerQuery needs its targeted element to exist on the first render in order to work properly.\nfunction PortaledModal({\n size,\n hideDismissButton = false,\n visible,\n header,\n children,\n footer,\n disableContentPaddings,\n position = 'center',\n onButtonClick = () => {},\n onDismiss,\n width,\n height,\n __internalRootRef,\n __injectAnalyticsComponentMetadata,\n __funnelProps,\n __funnelStepProps,\n __subStepRef,\n __subStepFunnelProps,\n referrerId,\n ...rest\n}: PortaledModalProps) {\n const instanceUniqueId = useUniqueId();\n const headerId = `${rest.id || instanceUniqueId}-header`;\n const lastMouseDownElementRef = useRef<HTMLElement | null>(null);\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n\n const i18n = useInternalI18n('modal');\n const closeAriaLabel = i18n('closeAriaLabel', rest.closeAriaLabel);\n\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(breakpointsRef, refObject, __internalRootRef);\n const dialogRef = useRef<HTMLDivElement>(null);\n\n const isRefresh = useVisualRefresh();\n\n const baseProps = getBaseProps(rest);\n\n const analyticsComponentMetadata: GeneratedAnalyticsMetadataModalComponent = {\n name: 'awsui.Modal',\n label: `.${analyticsSelectors.header} h2`,\n };\n const metadataAttribute = __injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: analyticsComponentMetadata })\n : {};\n const loadStartTime = useRef<number>(0);\n const loadCompleteTime = useRef<number>(0);\n const componentLoadingCount = useRef<number>(0);\n const performanceMetricLogged = useRef<boolean>(false);\n\n // enable body scroll and restore focus if unmounting while visible\n useEffect(() => {\n return () => {\n enableBodyScrolling();\n };\n }, []);\n\n const resetModalPerformanceData = () => {\n loadStartTime.current = performance.now();\n loadCompleteTime.current = 0;\n performanceMetricLogged.current = false;\n };\n\n const emitTimeToContentReadyInModal = (loadCompleteTime: number) => {\n if (\n componentLoadingCount.current === 0 &&\n loadStartTime.current &&\n loadStartTime.current !== 0 &&\n !performanceMetricLogged.current\n ) {\n const timeToContentReadyInModal = loadCompleteTime - loadStartTime.current;\n PerformanceMetrics.modalPerformanceData({\n timeToContentReadyInModal,\n instanceIdentifier: instanceUniqueId,\n componentIdentifier: headerTextRef.current?.textContent || '',\n });\n performanceMetricLogged.current = true;\n }\n };\n\n const MODAL_READY_TIMEOUT = 100;\n /**\n * This useEffect is triggered when the visible attribute of modal changes.\n * When modal becomes visible, modal performance metrics are reset marking the beginning loading process.\n * To ensure that the modal component ready metric is always emitted, a setTimeout is implemented.\n * This setTimeout automatically emits the component ready metric after a specified duration.\n */\n useEffect(() => {\n if (visible) {\n disableBodyScrolling();\n resetModalPerformanceData();\n setTimeout(() => {\n emitTimeToContentReadyInModal(loadStartTime.current);\n }, MODAL_READY_TIMEOUT);\n } else {\n enableBodyScrolling();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible]);\n\n // Because we hide the element with styles (and not actually detach it from DOM), we need to scroll to top\n useEffect(() => {\n if (visible && refObject.current) {\n refObject.current.scrollTop = 0;\n }\n }, [visible]);\n\n const dismiss = (reason: string) => fireNonCancelableEvent(onDismiss, { reason });\n\n const onOverlayMouseDown = (event: React.MouseEvent) => {\n lastMouseDownElementRef.current = event.target as HTMLElement;\n // The overlay can't hold focus, so pressing it would blur whatever is focused inside the\n // dialog and leave focus on the document body. That takes focus out of the dialog, which\n // breaks focus containment and stops ESC from reaching the handler on the dialog element.\n // Preventing the default action keeps focus where it is.\n if (event.target === refObject.current) {\n event.preventDefault();\n }\n };\n const onOverlayClick = (event: React.MouseEvent) => {\n const overlay = refObject.current;\n const lastClicked = lastMouseDownElementRef.current;\n\n if (event.target === overlay && lastClicked === overlay) {\n dismiss('overlay');\n }\n };\n const onCloseButtonClick = () => dismiss('closeButton');\n const escKeyHandler = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n dismiss('keyboard');\n }\n };\n\n // We use an empty div element at the end of the content slot as a sentinel\n // to detect when the user has scrolled to the bottom.\n const { ref: stickySentinelRef, isIntersecting: footerStuck } = useIntersectionObserver();\n\n const headerTextRef = useRef<HTMLSpanElement>(null);\n const headingTagRef = useRef<HTMLHeadingElement | null>(null);\n const { subStepRef } = useFunnelSubStep();\n\n // Without a dismiss button there is no predictable first focusable element, so focus the\n // heading to announce what the modal is about. When no header is given, fall back to the\n // dialog.\n const hasHeader = header !== undefined && header !== null && header !== false && header !== '';\n const autoFocusTarget = hideDismissButton ? (hasHeader ? headingTagRef : dialogRef) : undefined;\n\n const { footerRef, headerRef, hasCustomHeight, hasCustomWidth, dialogCustomStyles, footerHeight } =\n useModalDimensions({\n height,\n width,\n hasFooter: !!footer,\n });\n\n return (\n <FunnelNameSelectorContext.Provider value={`.${styles['header--text']}`}>\n <ResetContextsForModal>\n <ModalContext.Provider\n value={{\n isInModal: true,\n componentLoadingCount,\n emitTimeToContentReadyInModal,\n }}\n >\n <div\n {...baseProps}\n {...__funnelProps}\n {...__funnelStepProps}\n className={clsx(\n styles.root,\n { [styles.hidden]: !visible },\n hideDismissButton && styles['hide-dismiss-button'],\n baseProps.className,\n isRefresh && styles.refresh\n )}\n role=\"dialog\"\n aria-labelledby={headerId}\n onMouseDown={onOverlayMouseDown}\n onClick={onOverlayClick}\n ref={mergedRef}\n style={footerHeight ? { scrollPaddingBottom: footerHeight } : undefined}\n data-awsui-referrer-id={subStepRef.current?.id || referrerId}\n >\n <FocusLock\n disabled={!visible}\n autoFocus={true}\n restoreFocus={true}\n autoFocusTarget={autoFocusTarget}\n className={clsx(styles['focus-lock'], styles[`position-${position}`])}\n >\n <div\n className={clsx(\n styles.dialog,\n !hasCustomWidth && styles[size],\n styles[`breakpoint-${breakpoint}`],\n isRefresh && styles.refresh,\n hasCustomWidth && styles['custom-width'],\n hasCustomHeight && styles['custom-height']\n )}\n ref={dialogRef}\n style={dialogCustomStyles}\n onKeyDown={escKeyHandler}\n // Keeps the dialog focusable so that clicking a non-focusable area inside it moves\n // focus to the dialog rather than the document body.\n tabIndex={-1}\n {...metadataAttribute}\n >\n <div className={clsx(styles.container, hasCustomHeight && styles['custom-height-container'])}>\n <div ref={headerRef} className={clsx(styles.header, analyticsSelectors.header)}>\n <InternalHeader\n variant=\"h2\"\n __disableActionsWrapping={true}\n __headingTagRef={headingTagRef}\n __headingTagTabIndex={-1}\n actions={\n hideDismissButton ? undefined : (\n <div\n {...getAnalyticsMetadataAttribute({\n action: 'dismiss',\n } as Partial<GeneratedAnalyticsMetadataModalDismiss>)}\n >\n <InternalButton\n ariaLabel={closeAriaLabel}\n className={styles['dismiss-control']}\n variant=\"modal-dismiss\"\n iconName=\"close\"\n formAction=\"none\"\n onClick={onCloseButtonClick}\n />\n </div>\n )\n }\n >\n <span ref={headerTextRef} id={headerId} className={styles['header--text']}>\n {header}\n </span>\n </InternalHeader>\n </div>\n <BuiltInErrorBoundary\n wrapper={content => <InternalBox padding={{ bottom: 'm', horizontal: 'l' }}>{content}</InternalBox>}\n >\n <div\n ref={__subStepRef}\n {...__subStepFunnelProps}\n className={clsx(\n styles.content,\n { [styles['no-paddings']]: disableContentPaddings },\n hasCustomHeight && styles['custom-height-content']\n )}\n {...(hasCustomHeight && {\n tabIndex: 0,\n role: 'region',\n 'aria-labelledby': headerId,\n })}\n >\n {children}\n <div ref={stickySentinelRef} />\n </div>\n {footer && (\n <ButtonContext.Provider value={{ onClick: onButtonClick }}>\n <div\n ref={footerRef}\n className={clsx(styles.footer, (footerStuck || hasCustomHeight) && styles['footer--rounded'])}\n >\n {footer}\n </div>\n </ButtonContext.Provider>\n )}\n </BuiltInErrorBoundary>\n </div>\n </div>\n </FocusLock>\n </div>\n </ModalContext.Provider>\n </ResetContextsForModal>\n </FunnelNameSelectorContext.Provider>\n );\n}\n"]}
|
package/modal/styles.css.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"dialog": "
|
|
5
|
-
"modal-slide-up": "awsui_modal-slide-
|
|
6
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
7
|
-
"refresh": "
|
|
8
|
-
"awsui-motion-scale-popup": "awsui_awsui-motion-scale-
|
|
9
|
-
"root": "
|
|
10
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"position-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"header
|
|
31
|
-
"
|
|
32
|
-
"footer
|
|
33
|
-
"
|
|
34
|
-
"
|
|
4
|
+
"dialog": "awsui_dialog_1d2i7_187ae_25",
|
|
5
|
+
"modal-slide-up": "awsui_modal-slide-up_1d2i7_187ae_1",
|
|
6
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1d2i7_187ae_1",
|
|
7
|
+
"refresh": "awsui_refresh_1d2i7_187ae_48",
|
|
8
|
+
"awsui-motion-scale-popup": "awsui_awsui-motion-scale-popup_1d2i7_187ae_1",
|
|
9
|
+
"root": "awsui_root_1d2i7_187ae_81",
|
|
10
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_1d2i7_187ae_1",
|
|
11
|
+
"hide-dismiss-button": "awsui_hide-dismiss-button_1d2i7_187ae_158",
|
|
12
|
+
"hidden": "awsui_hidden_1d2i7_187ae_161",
|
|
13
|
+
"focus-lock": "awsui_focus-lock_1d2i7_187ae_165",
|
|
14
|
+
"position-top": "awsui_position-top_1d2i7_187ae_173",
|
|
15
|
+
"position-center": "awsui_position-center_1d2i7_187ae_176",
|
|
16
|
+
"small": "awsui_small_1d2i7_187ae_190",
|
|
17
|
+
"medium": "awsui_medium_1d2i7_187ae_193",
|
|
18
|
+
"large": "awsui_large_1d2i7_187ae_196",
|
|
19
|
+
"x-large": "awsui_x-large_1d2i7_187ae_199",
|
|
20
|
+
"xx-large": "awsui_xx-large_1d2i7_187ae_202",
|
|
21
|
+
"custom-width": "awsui_custom-width_1d2i7_187ae_205",
|
|
22
|
+
"max": "awsui_max_1d2i7_187ae_208",
|
|
23
|
+
"breakpoint-xs": "awsui_breakpoint-xs_1d2i7_187ae_208",
|
|
24
|
+
"custom-height": "awsui_custom-height_1d2i7_187ae_213",
|
|
25
|
+
"container": "awsui_container_1d2i7_187ae_218",
|
|
26
|
+
"custom-height-container": "awsui_custom-height-container_1d2i7_187ae_258",
|
|
27
|
+
"content": "awsui_content_1d2i7_187ae_264",
|
|
28
|
+
"no-paddings": "awsui_no-paddings_1d2i7_187ae_269",
|
|
29
|
+
"custom-height-content": "awsui_custom-height-content_1d2i7_187ae_273",
|
|
30
|
+
"header": "awsui_header_1d2i7_187ae_278",
|
|
31
|
+
"header--text": "awsui_header--text_1d2i7_187ae_290",
|
|
32
|
+
"footer": "awsui_footer_1d2i7_187ae_294",
|
|
33
|
+
"footer--rounded": "awsui_footer--rounded_1d2i7_187ae_303",
|
|
34
|
+
"dismiss-control": "awsui_dismiss-control_1d2i7_187ae_315",
|
|
35
|
+
"modal-open": "awsui_modal-open_1d2i7_187ae_319"
|
|
35
36
|
};
|
|
36
37
|
|
package/modal/styles.scoped.css
CHANGED
|
@@ -14,7 +14,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
14
14
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
15
15
|
SPDX-License-Identifier: Apache-2.0
|
|
16
16
|
*/
|
|
17
|
-
@keyframes awsui_modal-slide-
|
|
17
|
+
@keyframes awsui_modal-slide-up_1d2i7_187ae_1 {
|
|
18
18
|
0% {
|
|
19
19
|
transform: translate(0, 10px);
|
|
20
20
|
}
|
|
@@ -22,12 +22,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
22
22
|
transform: translate(0, 0);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
.
|
|
26
|
-
animation: awsui_modal-slide-
|
|
25
|
+
.awsui_dialog_1d2i7_187ae_25:not(#\9) {
|
|
26
|
+
animation: awsui_modal-slide-up_1d2i7_187ae_1 var(--motion-duration-slow-8cu00l, 180ms) ease-out, awsui_awsui-motion-fade-in-0_1d2i7_187ae_1 var(--motion-duration-slow-8cu00l, 180ms) ease-out;
|
|
27
27
|
animation-delay: var(--motion-duration-fast-yb0m8k, 90ms);
|
|
28
28
|
animation-fill-mode: both;
|
|
29
29
|
}
|
|
30
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
30
|
+
@keyframes awsui_awsui-motion-fade-in-0_1d2i7_187ae_1 {
|
|
31
31
|
from {
|
|
32
32
|
opacity: 0;
|
|
33
33
|
}
|
|
@@ -36,22 +36,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
@media (prefers-reduced-motion: reduce) {
|
|
39
|
-
.
|
|
39
|
+
.awsui_dialog_1d2i7_187ae_25:not(#\9) {
|
|
40
40
|
animation: none;
|
|
41
41
|
transition: none;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
.awsui-motion-disabled .
|
|
44
|
+
.awsui-motion-disabled .awsui_dialog_1d2i7_187ae_25:not(#\9), .awsui-mode-entering .awsui_dialog_1d2i7_187ae_25:not(#\9) {
|
|
45
45
|
animation: none;
|
|
46
46
|
transition: none;
|
|
47
47
|
}
|
|
48
|
-
.
|
|
49
|
-
animation: awsui_awsui-motion-scale-
|
|
48
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_refresh_1d2i7_187ae_48:not(#\9) {
|
|
49
|
+
animation: awsui_awsui-motion-scale-popup_1d2i7_187ae_1, awsui_awsui-motion-fade-in-0_1d2i7_187ae_1;
|
|
50
50
|
animation-duration: var(--motion-duration-refresh-only-fast-y8f250, 115ms);
|
|
51
51
|
animation-timing-function: var(--motion-easing-refresh-only-a-b2p95e, cubic-bezier(0, 0, 0, 1));
|
|
52
52
|
animation-fill-mode: both;
|
|
53
53
|
}
|
|
54
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
54
|
+
@keyframes awsui_awsui-motion-fade-in-0_1d2i7_187ae_1 {
|
|
55
55
|
from {
|
|
56
56
|
opacity: 0;
|
|
57
57
|
}
|
|
@@ -59,7 +59,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
59
59
|
opacity: 1;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
@keyframes awsui_awsui-motion-scale-
|
|
62
|
+
@keyframes awsui_awsui-motion-scale-popup_1d2i7_187ae_1 {
|
|
63
63
|
0% {
|
|
64
64
|
transform: scale(0.95);
|
|
65
65
|
}
|
|
@@ -68,21 +68,21 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
@media (prefers-reduced-motion: reduce) {
|
|
71
|
-
.
|
|
71
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_refresh_1d2i7_187ae_48:not(#\9) {
|
|
72
72
|
animation: none;
|
|
73
73
|
transition: none;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
.awsui-motion-disabled .
|
|
76
|
+
.awsui-motion-disabled .awsui_dialog_1d2i7_187ae_25.awsui_refresh_1d2i7_187ae_48:not(#\9), .awsui-mode-entering .awsui_dialog_1d2i7_187ae_25.awsui_refresh_1d2i7_187ae_48:not(#\9) {
|
|
77
77
|
animation: none;
|
|
78
78
|
transition: none;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.
|
|
82
|
-
animation: awsui_awsui-motion-fade-
|
|
81
|
+
.awsui_root_1d2i7_187ae_81:not(#\9) {
|
|
82
|
+
animation: awsui_awsui-motion-fade-in_1d2i7_187ae_1 var(--motion-duration-extra-slow-bzo8np, 270ms) ease-out;
|
|
83
83
|
animation-fill-mode: both;
|
|
84
84
|
}
|
|
85
|
-
@keyframes awsui_awsui-motion-fade-
|
|
85
|
+
@keyframes awsui_awsui-motion-fade-in_1d2i7_187ae_1 {
|
|
86
86
|
from {
|
|
87
87
|
opacity: 0.2;
|
|
88
88
|
}
|
|
@@ -91,30 +91,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
@media (prefers-reduced-motion: reduce) {
|
|
94
|
-
.
|
|
94
|
+
.awsui_root_1d2i7_187ae_81:not(#\9) {
|
|
95
95
|
animation: none;
|
|
96
96
|
transition: none;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
.awsui-motion-disabled .
|
|
99
|
+
.awsui-motion-disabled .awsui_root_1d2i7_187ae_81:not(#\9), .awsui-mode-entering .awsui_root_1d2i7_187ae_81:not(#\9) {
|
|
100
100
|
animation: none;
|
|
101
101
|
transition: none;
|
|
102
102
|
}
|
|
103
|
-
.
|
|
103
|
+
.awsui_root_1d2i7_187ae_81.awsui_refresh_1d2i7_187ae_48:not(#\9) {
|
|
104
104
|
animation-duration: var(--motion-duration-refresh-only-fast-y8f250, 115ms);
|
|
105
105
|
}
|
|
106
106
|
@media (prefers-reduced-motion: reduce) {
|
|
107
|
-
.
|
|
107
|
+
.awsui_root_1d2i7_187ae_81.awsui_refresh_1d2i7_187ae_48:not(#\9) {
|
|
108
108
|
animation: none;
|
|
109
109
|
transition: none;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
.awsui-motion-disabled .
|
|
112
|
+
.awsui-motion-disabled .awsui_root_1d2i7_187ae_81.awsui_refresh_1d2i7_187ae_48:not(#\9), .awsui-mode-entering .awsui_root_1d2i7_187ae_81.awsui_refresh_1d2i7_187ae_48:not(#\9) {
|
|
113
113
|
animation: none;
|
|
114
114
|
transition: none;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
.
|
|
117
|
+
.awsui_root_1d2i7_187ae_81:not(#\9) {
|
|
118
118
|
border-collapse: separate;
|
|
119
119
|
border-spacing: 0;
|
|
120
120
|
box-sizing: border-box;
|
|
@@ -155,11 +155,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
155
155
|
overflow: auto;
|
|
156
156
|
cursor: pointer;
|
|
157
157
|
}
|
|
158
|
-
.
|
|
158
|
+
.awsui_root_1d2i7_187ae_81.awsui_hide-dismiss-button_1d2i7_187ae_158:not(#\9) {
|
|
159
|
+
cursor: default;
|
|
160
|
+
}
|
|
161
|
+
.awsui_root_1d2i7_187ae_81.awsui_hidden_1d2i7_187ae_161:not(#\9) {
|
|
159
162
|
display: none;
|
|
160
163
|
}
|
|
161
164
|
|
|
162
|
-
.awsui_focus-
|
|
165
|
+
.awsui_focus-lock_1d2i7_187ae_165:not(#\9) {
|
|
163
166
|
align-self: flex-start;
|
|
164
167
|
margin-inline: auto;
|
|
165
168
|
padding-block: var(--space-s-kll7oj, 12px);
|
|
@@ -167,14 +170,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
167
170
|
z-index: 5000;
|
|
168
171
|
pointer-events: none;
|
|
169
172
|
}
|
|
170
|
-
.awsui_focus-
|
|
173
|
+
.awsui_focus-lock_1d2i7_187ae_165.awsui_position-top_1d2i7_187ae_173:not(#\9) {
|
|
171
174
|
margin-block-start: 0;
|
|
172
175
|
}
|
|
173
|
-
.awsui_focus-
|
|
176
|
+
.awsui_focus-lock_1d2i7_187ae_165.awsui_position-center_1d2i7_187ae_176:not(#\9) {
|
|
174
177
|
margin-block: auto;
|
|
175
178
|
}
|
|
176
179
|
|
|
177
|
-
.
|
|
180
|
+
.awsui_dialog_1d2i7_187ae_25:not(#\9) {
|
|
178
181
|
position: static;
|
|
179
182
|
inset-block-start: 0;
|
|
180
183
|
transform: translate(0, 0);
|
|
@@ -184,35 +187,35 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
184
187
|
z-index: 5000;
|
|
185
188
|
pointer-events: all;
|
|
186
189
|
}
|
|
187
|
-
.
|
|
190
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_small_1d2i7_187ae_190:not(#\9) {
|
|
188
191
|
max-inline-size: 320px;
|
|
189
192
|
}
|
|
190
|
-
.
|
|
193
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_medium_1d2i7_187ae_193:not(#\9) {
|
|
191
194
|
max-inline-size: 600px;
|
|
192
195
|
}
|
|
193
|
-
.
|
|
196
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_large_1d2i7_187ae_196:not(#\9) {
|
|
194
197
|
max-inline-size: 820px;
|
|
195
198
|
}
|
|
196
|
-
.
|
|
199
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_x-large_1d2i7_187ae_199:not(#\9) {
|
|
197
200
|
max-inline-size: 1024px;
|
|
198
201
|
}
|
|
199
|
-
.
|
|
202
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_xx-large_1d2i7_187ae_202:not(#\9) {
|
|
200
203
|
max-inline-size: 1280px;
|
|
201
204
|
}
|
|
202
|
-
.
|
|
205
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_custom-width_1d2i7_187ae_205:not(#\9) {
|
|
203
206
|
max-inline-size: var(--awsui-modal-custom-width-ka4djm);
|
|
204
207
|
}
|
|
205
|
-
.
|
|
208
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_max_1d2i7_187ae_208.awsui_breakpoint-xs_1d2i7_187ae_208:not(#\9) {
|
|
206
209
|
max-inline-size: calc(100vw - (8 * 10px + var(--space-xxxl-pjngik, 40px)));
|
|
207
210
|
margin-block: auto;
|
|
208
211
|
margin-inline: auto;
|
|
209
212
|
}
|
|
210
|
-
.
|
|
213
|
+
.awsui_dialog_1d2i7_187ae_25.awsui_custom-height_1d2i7_187ae_213:not(#\9) {
|
|
211
214
|
block-size: var(--awsui-modal-custom-height-ka4djm);
|
|
212
215
|
max-block-size: calc(100vh - 2 * var(--space-s-kll7oj, 12px));
|
|
213
216
|
}
|
|
214
217
|
|
|
215
|
-
.
|
|
218
|
+
.awsui_container_1d2i7_187ae_218:not(#\9) {
|
|
216
219
|
border-collapse: separate;
|
|
217
220
|
border-spacing: 0;
|
|
218
221
|
box-sizing: border-box;
|
|
@@ -252,27 +255,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
252
255
|
border-end-end-radius: var(--border-radius-container-33hhdh, 16px);
|
|
253
256
|
box-shadow: var(--shadow-modal-gdc1ov, 0px 4px 20px 1px rgba(0, 7, 22, 0.1));
|
|
254
257
|
}
|
|
255
|
-
.
|
|
258
|
+
.awsui_container_1d2i7_187ae_218.awsui_custom-height-container_1d2i7_187ae_258:not(#\9) {
|
|
256
259
|
display: flex;
|
|
257
260
|
flex-direction: column;
|
|
258
261
|
block-size: 100%;
|
|
259
262
|
}
|
|
260
263
|
|
|
261
|
-
.
|
|
264
|
+
.awsui_content_1d2i7_187ae_264:not(#\9) {
|
|
262
265
|
padding-block-start: var(--space-container-content-top-ryubqz, 4px);
|
|
263
266
|
padding-block-end: var(--space-modal-content-bottom-i4wk4i, 16px);
|
|
264
267
|
padding-inline: var(--space-modal-horizontal-f789j4, 20px);
|
|
265
268
|
}
|
|
266
|
-
.
|
|
269
|
+
.awsui_content_1d2i7_187ae_264.awsui_no-paddings_1d2i7_187ae_269:not(#\9) {
|
|
267
270
|
padding-block: 0;
|
|
268
271
|
padding-inline: 0;
|
|
269
272
|
}
|
|
270
|
-
.
|
|
273
|
+
.awsui_content_1d2i7_187ae_264.awsui_custom-height-content_1d2i7_187ae_273:not(#\9) {
|
|
271
274
|
flex-grow: 1;
|
|
272
275
|
overflow-y: auto;
|
|
273
276
|
}
|
|
274
277
|
|
|
275
|
-
.
|
|
278
|
+
.awsui_header_1d2i7_187ae_278:not(#\9) {
|
|
276
279
|
padding-block-start: var(--space-container-header-top-3txhx4, 12px);
|
|
277
280
|
padding-block-end: var(--space-container-header-bottom-9elagw, 8px);
|
|
278
281
|
padding-inline: var(--space-modal-horizontal-f789j4, 20px);
|
|
@@ -284,11 +287,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
284
287
|
border-end-end-radius: 0;
|
|
285
288
|
}
|
|
286
289
|
|
|
287
|
-
.awsui_header--
|
|
290
|
+
.awsui_header--text_1d2i7_187ae_290:not(#\9) {
|
|
288
291
|
/* used in test-utils */
|
|
289
292
|
}
|
|
290
293
|
|
|
291
|
-
.
|
|
294
|
+
.awsui_footer_1d2i7_187ae_294:not(#\9) {
|
|
292
295
|
border-block-start: var(--border-divider-section-width-dlkb8v, 1px) solid var(--color-border-divider-default-diwd4w, #c6c6cd);
|
|
293
296
|
padding-block: var(--space-scaled-s-2crg2b, 12px);
|
|
294
297
|
padding-inline: var(--space-container-horizontal-quy5ai, 20px);
|
|
@@ -297,23 +300,23 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
297
300
|
inset-block-end: 0;
|
|
298
301
|
z-index: 800;
|
|
299
302
|
}
|
|
300
|
-
.awsui_footer--
|
|
303
|
+
.awsui_footer--rounded_1d2i7_187ae_303:not(#\9) {
|
|
301
304
|
border-start-start-radius: 0;
|
|
302
305
|
border-start-end-radius: 0;
|
|
303
306
|
border-end-start-radius: var(--border-radius-container-33hhdh, 16px);
|
|
304
307
|
border-end-end-radius: var(--border-radius-container-33hhdh, 16px);
|
|
305
308
|
}
|
|
306
|
-
.
|
|
309
|
+
.awsui_footer_1d2i7_187ae_294:not(#\9):after {
|
|
307
310
|
content: "";
|
|
308
311
|
display: table;
|
|
309
312
|
clear: both;
|
|
310
313
|
}
|
|
311
314
|
|
|
312
|
-
.awsui_dismiss-
|
|
315
|
+
.awsui_dismiss-control_1d2i7_187ae_315:not(#\9) {
|
|
313
316
|
/* used in test-utils */
|
|
314
317
|
}
|
|
315
318
|
|
|
316
|
-
.awsui_modal-
|
|
319
|
+
.awsui_modal-open_1d2i7_187ae_319:not(#\9) {
|
|
317
320
|
overflow: hidden;
|
|
318
321
|
/*
|
|
319
322
|
* When padding-right is added to account for scrollbar being turned
|