@cloudscape-design/components 3.0.1155 → 3.0.1156
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/anchor-navigation/styles.css.js +8 -8
- package/anchor-navigation/styles.scoped.css +21 -21
- package/anchor-navigation/styles.selectors.js +8 -8
- package/app-layout/visual-refresh/styles.css.js +86 -86
- package/app-layout/visual-refresh/styles.scoped.css +164 -163
- package/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +30 -30
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +84 -81
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +30 -30
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -1
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -28
- package/attribute-editor/styles.selectors.js +15 -15
- package/box/styles.css.js +192 -192
- package/box/styles.scoped.css +241 -241
- package/box/styles.selectors.js +192 -192
- package/breadcrumb-group/item/styles.css.js +7 -7
- package/breadcrumb-group/item/styles.scoped.css +28 -28
- package/breadcrumb-group/item/styles.selectors.js +7 -7
- package/button/styles.css.js +22 -22
- package/button/styles.scoped.css +78 -78
- package/button/styles.selectors.js +22 -22
- package/button-dropdown/item-element/styles.css.js +20 -20
- package/button-dropdown/item-element/styles.scoped.css +35 -35
- package/button-dropdown/item-element/styles.selectors.js +20 -20
- package/cards/styles.css.js +39 -39
- package/cards/styles.scoped.css +51 -51
- package/cards/styles.selectors.js +39 -39
- package/code-editor/styles.css.js +33 -33
- package/code-editor/styles.scoped.css +139 -139
- package/code-editor/styles.selectors.js +33 -33
- package/drawer/implementation.d.ts +1 -0
- package/drawer/implementation.d.ts.map +1 -1
- package/drawer/implementation.js +13 -4
- package/drawer/implementation.js.map +1 -1
- package/drawer/interfaces.d.ts +7 -0
- package/drawer/interfaces.d.ts.map +1 -1
- package/drawer/interfaces.js.map +1 -1
- package/drawer/styles.css.js +12 -8
- package/drawer/styles.scoped.css +35 -13
- package/drawer/styles.selectors.js +12 -8
- package/drawer/use-sticky-footer.d.ts +11 -0
- package/drawer/use-sticky-footer.d.ts.map +1 -0
- package/drawer/use-sticky-footer.js +35 -0
- package/drawer/use-sticky-footer.js.map +1 -0
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +75 -75
- package/help-panel/styles.selectors.js +6 -6
- package/icon/styles.css.js +39 -39
- package/icon/styles.scoped.css +87 -87
- package/icon/styles.selectors.js +39 -39
- package/internal/base-component/styles.scoped.css +62 -50
- package/internal/components/button-trigger/styles.css.js +13 -13
- package/internal/components/button-trigger/styles.scoped.css +29 -29
- package/internal/components/button-trigger/styles.selectors.js +13 -13
- package/internal/components/cartesian-chart/styles.css.js +28 -28
- package/internal/components/cartesian-chart/styles.scoped.css +33 -33
- package/internal/components/cartesian-chart/styles.selectors.js +28 -28
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/styles/tokens.js +8 -8
- package/internal/generated/theming/index.cjs +24 -24
- package/internal/generated/theming/index.js +24 -24
- package/internal/hooks/use-portal-mode-classes/index.d.ts +3 -1
- package/internal/hooks/use-portal-mode-classes/index.d.ts.map +1 -1
- package/internal/hooks/use-portal-mode-classes/index.js +2 -2
- package/internal/hooks/use-portal-mode-classes/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/key-value-pairs/styles.css.js +8 -8
- package/key-value-pairs/styles.scoped.css +10 -10
- package/key-value-pairs/styles.selectors.js +8 -8
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +91 -91
- package/link/styles.selectors.js +20 -20
- package/package.json +1 -1
- package/popover/internal.js +1 -1
- package/popover/internal.js.map +1 -1
- package/popover/styles.css.js +57 -57
- package/popover/styles.scoped.css +87 -87
- package/popover/styles.selectors.js +57 -57
- package/progress-bar/styles.css.js +19 -19
- package/progress-bar/styles.scoped.css +31 -31
- package/progress-bar/styles.selectors.js +19 -19
- package/side-navigation/styles.css.js +30 -30
- package/side-navigation/styles.scoped.css +47 -47
- package/side-navigation/styles.selectors.js +30 -30
- package/split-panel/icons/styles.css.js +22 -22
- package/split-panel/icons/styles.scoped.css +25 -25
- package/split-panel/icons/styles.selectors.js +22 -22
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +13 -13
- package/tag-editor/styles.selectors.js +3 -3
- package/test-utils/dom/drawer/index.d.ts +1 -0
- package/test-utils/dom/drawer/index.js +3 -0
- package/test-utils/dom/drawer/index.js.map +1 -1
- package/test-utils/selectors/drawer/index.d.ts +1 -0
- package/test-utils/selectors/drawer/index.js +3 -0
- package/test-utils/selectors/drawer/index.js.map +1 -1
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +66 -66
- package/text-content/styles.selectors.js +1 -1
- package/token/styles.css.js +14 -14
- package/token/styles.scoped.css +29 -29
- package/token/styles.selectors.js +14 -14
- package/tutorial-panel/components/tutorial-list/styles.css.js +18 -18
- package/tutorial-panel/components/tutorial-list/styles.scoped.css +28 -28
- package/tutorial-panel/components/tutorial-list/styles.selectors.js +18 -18
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"code-editor-refresh": "awsui_code-editor-
|
|
6
|
-
"code-editor": "awsui_code-
|
|
7
|
-
"pane": "
|
|
8
|
-
"pane__close-container": "awsui_pane__close-
|
|
9
|
-
"pane__list": "
|
|
10
|
-
"pane__table": "
|
|
11
|
-
"pane__item": "
|
|
12
|
-
"pane__cell": "
|
|
13
|
-
"pane__item--highlighted": "awsui_pane__item--
|
|
14
|
-
"pane__location": "
|
|
15
|
-
"pane__description": "
|
|
16
|
-
"focus-lock": "awsui_focus-
|
|
17
|
-
"editor": "
|
|
18
|
-
"editor-refresh": "awsui_editor-
|
|
19
|
-
"status-bar": "awsui_status-
|
|
20
|
-
"status-bar-with-hidden-pane": "awsui_status-bar-with-hidden-
|
|
21
|
-
"status-bar__left": "awsui_status-
|
|
22
|
-
"status-bar__right": "awsui_status-
|
|
23
|
-
"status-bar__language-mode": "awsui_status-bar__language-
|
|
24
|
-
"status-bar__cursor-position": "awsui_status-bar__cursor-
|
|
25
|
-
"status-bar__cog-button": "awsui_status-bar__cog-
|
|
26
|
-
"tab-list": "awsui_tab-
|
|
27
|
-
"tab-button": "awsui_tab-
|
|
28
|
-
"tab-button--refresh": "awsui_tab-button--
|
|
29
|
-
"tab-button--warnings": "awsui_tab-button--
|
|
30
|
-
"tab-button--active": "awsui_tab-button--
|
|
31
|
-
"tab-button--disabled": "awsui_tab-button--
|
|
32
|
-
"tab-button--divider": "awsui_tab-button--
|
|
33
|
-
"tab-button--errors": "awsui_tab-button--
|
|
34
|
-
"count": "
|
|
35
|
-
"text": "
|
|
36
|
-
"loading-screen": "awsui_loading-
|
|
37
|
-
"error-screen": "awsui_error-
|
|
5
|
+
"code-editor-refresh": "awsui_code-editor-refresh_1gl9c_gqn4w_158",
|
|
6
|
+
"code-editor": "awsui_code-editor_1gl9c_gqn4w_158",
|
|
7
|
+
"pane": "awsui_pane_1gl9c_gqn4w_496",
|
|
8
|
+
"pane__close-container": "awsui_pane__close-container_1gl9c_gqn4w_507",
|
|
9
|
+
"pane__list": "awsui_pane__list_1gl9c_gqn4w_512",
|
|
10
|
+
"pane__table": "awsui_pane__table_1gl9c_gqn4w_519",
|
|
11
|
+
"pane__item": "awsui_pane__item_1gl9c_gqn4w_525",
|
|
12
|
+
"pane__cell": "awsui_pane__cell_1gl9c_gqn4w_525",
|
|
13
|
+
"pane__item--highlighted": "awsui_pane__item--highlighted_1gl9c_gqn4w_539",
|
|
14
|
+
"pane__location": "awsui_pane__location_1gl9c_gqn4w_560",
|
|
15
|
+
"pane__description": "awsui_pane__description_1gl9c_gqn4w_560",
|
|
16
|
+
"focus-lock": "awsui_focus-lock_1gl9c_gqn4w_575",
|
|
17
|
+
"editor": "awsui_editor_1gl9c_gqn4w_619",
|
|
18
|
+
"editor-refresh": "awsui_editor-refresh_1gl9c_gqn4w_649",
|
|
19
|
+
"status-bar": "awsui_status-bar_1gl9c_gqn4w_654",
|
|
20
|
+
"status-bar-with-hidden-pane": "awsui_status-bar-with-hidden-pane_1gl9c_gqn4w_663",
|
|
21
|
+
"status-bar__left": "awsui_status-bar__left_1gl9c_gqn4w_667",
|
|
22
|
+
"status-bar__right": "awsui_status-bar__right_1gl9c_gqn4w_674",
|
|
23
|
+
"status-bar__language-mode": "awsui_status-bar__language-mode_1gl9c_gqn4w_678",
|
|
24
|
+
"status-bar__cursor-position": "awsui_status-bar__cursor-position_1gl9c_gqn4w_678",
|
|
25
|
+
"status-bar__cog-button": "awsui_status-bar__cog-button_1gl9c_gqn4w_684",
|
|
26
|
+
"tab-list": "awsui_tab-list_1gl9c_gqn4w_689",
|
|
27
|
+
"tab-button": "awsui_tab-button_1gl9c_gqn4w_694",
|
|
28
|
+
"tab-button--refresh": "awsui_tab-button--refresh_1gl9c_gqn4w_727",
|
|
29
|
+
"tab-button--warnings": "awsui_tab-button--warnings_1gl9c_gqn4w_730",
|
|
30
|
+
"tab-button--active": "awsui_tab-button--active_1gl9c_gqn4w_739",
|
|
31
|
+
"tab-button--disabled": "awsui_tab-button--disabled_1gl9c_gqn4w_755",
|
|
32
|
+
"tab-button--divider": "awsui_tab-button--divider_1gl9c_gqn4w_788",
|
|
33
|
+
"tab-button--errors": "awsui_tab-button--errors_1gl9c_gqn4w_795",
|
|
34
|
+
"count": "awsui_count_1gl9c_gqn4w_804",
|
|
35
|
+
"text": "awsui_text_1gl9c_gqn4w_807",
|
|
36
|
+
"loading-screen": "awsui_loading-screen_1gl9c_gqn4w_829",
|
|
37
|
+
"error-screen": "awsui_error-screen_1gl9c_gqn4w_830"
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/drawer/implementation.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/drawer/implementation.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAIlF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAK3C,KAAK,mBAAmB,GAAG,WAAW,GAAG,0BAA0B,CAAC;AAEpE,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,GAAG,SAAS,EACb,EAAE,mBAAmB,eAqErB;AAED,eAAO,MAAM,sBAAsB,mFAAkD,CAAC"}
|
package/drawer/implementation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useRef } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useRuntimeDrawerContext } from '../app-layout/runtime-drawer/use-runtime-drawer-context';
|
|
6
6
|
import { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';
|
|
@@ -9,24 +9,33 @@ import { getBaseProps } from '../internal/base-component';
|
|
|
9
9
|
import { createWidgetizedComponent } from '../internal/widgets';
|
|
10
10
|
import InternalLiveRegion from '../live-region/internal';
|
|
11
11
|
import InternalStatusIndicator from '../status-indicator/internal';
|
|
12
|
+
import { useStickyFooter } from './use-sticky-footer';
|
|
12
13
|
import styles from './styles.css.js';
|
|
13
|
-
export function DrawerImplementation({ header, children, loading, i18nStrings, disableContentPaddings, __internalRootRef, headerActions, ...restProps }) {
|
|
14
|
+
export function DrawerImplementation({ header, footer, children, loading, i18nStrings, disableContentPaddings, __internalRootRef, headerActions, ...restProps }) {
|
|
14
15
|
const baseProps = getBaseProps(restProps);
|
|
15
16
|
const isToolbar = useAppLayoutToolbarDesignEnabled();
|
|
16
17
|
const i18n = useInternalI18n('drawer');
|
|
17
18
|
const containerProps = {
|
|
18
19
|
...baseProps,
|
|
19
|
-
className: clsx(baseProps.className, styles.drawer, isToolbar && styles['with-toolbar']),
|
|
20
|
+
className: clsx(baseProps.className, styles.drawer, isToolbar && styles['with-toolbar'], !!footer && styles['with-footer']),
|
|
20
21
|
};
|
|
22
|
+
const footerRef = useRef(null);
|
|
21
23
|
const runtimeDrawerContext = useRuntimeDrawerContext({ rootRef: __internalRootRef });
|
|
22
24
|
const hasAdditioalDrawerAction = !!(runtimeDrawerContext === null || runtimeDrawerContext === void 0 ? void 0 : runtimeDrawerContext.isExpandable);
|
|
25
|
+
const { isSticky: isFooterSticky } = useStickyFooter({
|
|
26
|
+
drawerRef: __internalRootRef,
|
|
27
|
+
footerRef,
|
|
28
|
+
});
|
|
23
29
|
return loading ? (React.createElement("div", { ...containerProps, className: clsx(containerProps.className, styles['content-with-paddings']), ref: __internalRootRef },
|
|
24
30
|
React.createElement(InternalStatusIndicator, { type: "loading" },
|
|
25
31
|
React.createElement(InternalLiveRegion, { tagName: "span" }, i18n('i18nStrings.loadingText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loadingText))))) : (React.createElement("div", { ...containerProps, ref: __internalRootRef },
|
|
26
32
|
header && (React.createElement("div", { className: clsx(styles.header, runtimeDrawerContext && styles['with-runtime-context'], hasAdditioalDrawerAction && styles['with-additional-action']) },
|
|
27
33
|
header,
|
|
28
34
|
headerActions && React.createElement("div", { className: styles['header-actions'] }, headerActions))),
|
|
29
|
-
React.createElement("div", { className: clsx(styles['test-utils-drawer-content'], !disableContentPaddings && styles['content-with-paddings']) }, children)
|
|
35
|
+
React.createElement("div", { className: clsx(styles['test-utils-drawer-content'], styles.content, !disableContentPaddings && styles['content-with-paddings']) }, children),
|
|
36
|
+
footer && (React.createElement("div", { ref: footerRef, className: clsx(styles.footer, {
|
|
37
|
+
[styles['is-sticky']]: isFooterSticky,
|
|
38
|
+
}) }, footer))));
|
|
30
39
|
}
|
|
31
40
|
export const createWidgetizedDrawer = createWidgetizedComponent(DrawerImplementation);
|
|
32
41
|
//# sourceMappingURL=implementation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/drawer/implementation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/drawer/implementation.tsx"],"names":[],"mappings":"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","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { RefObject, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useRuntimeDrawerContext } from '../app-layout/runtime-drawer/use-runtime-drawer-context';\nimport { useAppLayoutToolbarDesignEnabled } from '../app-layout/utils/feature-flags';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport InternalLiveRegion from '../live-region/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { DrawerProps } from './interfaces';\nimport { useStickyFooter } from './use-sticky-footer';\n\nimport styles from './styles.css.js';\n\ntype DrawerInternalProps = DrawerProps & InternalBaseComponentProps;\n\nexport function DrawerImplementation({\n header,\n footer,\n children,\n loading,\n i18nStrings,\n disableContentPaddings,\n __internalRootRef,\n headerActions,\n ...restProps\n}: DrawerInternalProps) {\n const baseProps = getBaseProps(restProps);\n const isToolbar = useAppLayoutToolbarDesignEnabled();\n const i18n = useInternalI18n('drawer');\n const containerProps = {\n ...baseProps,\n className: clsx(\n baseProps.className,\n styles.drawer,\n isToolbar && styles['with-toolbar'],\n !!footer && styles['with-footer']\n ),\n };\n const footerRef = useRef<HTMLDivElement>(null);\n\n const runtimeDrawerContext = useRuntimeDrawerContext({ rootRef: __internalRootRef as RefObject<HTMLElement> });\n const hasAdditioalDrawerAction = !!runtimeDrawerContext?.isExpandable;\n const { isSticky: isFooterSticky } = useStickyFooter({\n drawerRef: __internalRootRef as RefObject<HTMLElement>,\n footerRef,\n });\n\n return loading ? (\n <div\n {...containerProps}\n className={clsx(containerProps.className, styles['content-with-paddings'])}\n ref={__internalRootRef}\n >\n <InternalStatusIndicator type=\"loading\">\n <InternalLiveRegion tagName=\"span\">\n {i18n('i18nStrings.loadingText', i18nStrings?.loadingText)}\n </InternalLiveRegion>\n </InternalStatusIndicator>\n </div>\n ) : (\n <div {...containerProps} ref={__internalRootRef}>\n {header && (\n <div\n className={clsx(\n styles.header,\n runtimeDrawerContext && styles['with-runtime-context'],\n hasAdditioalDrawerAction && styles['with-additional-action']\n )}\n >\n {header}\n {headerActions && <div className={styles['header-actions']}>{headerActions}</div>}\n </div>\n )}\n <div\n className={clsx(\n styles['test-utils-drawer-content'],\n styles.content,\n !disableContentPaddings && styles['content-with-paddings']\n )}\n >\n {children}\n </div>\n {footer && (\n <div\n ref={footerRef}\n className={clsx(styles.footer, {\n [styles['is-sticky']]: isFooterSticky,\n })}\n >\n {footer}\n </div>\n )}\n </div>\n );\n}\n\nexport const createWidgetizedDrawer = createWidgetizedComponent(DrawerImplementation);\n"]}
|
package/drawer/interfaces.d.ts
CHANGED
|
@@ -29,6 +29,13 @@ export interface DrawerProps extends BaseComponentProps {
|
|
|
29
29
|
* Actions for the header. Available only if you specify the `header` property.
|
|
30
30
|
*/
|
|
31
31
|
headerActions?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Sticky footer content that remains visible at the bottom during scroll.
|
|
34
|
+
*
|
|
35
|
+
* Automatically becomes non-sticky when scrollable content area is too small
|
|
36
|
+
* to ensure content remains accessible (not covered by the footer).
|
|
37
|
+
*/
|
|
38
|
+
footer?: React.ReactNode;
|
|
32
39
|
}
|
|
33
40
|
interface I18nStrings {
|
|
34
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/drawer/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/drawer/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEhC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,UAAU,WAAW;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/drawer/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/drawer/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 { BaseComponentProps } from '../internal/base-component';\n\nexport interface DrawerProps extends BaseComponentProps {\n /**\n * Header of the drawer.\n *\n * It should contain the only `h2` used in the drawer.\n */\n header?: React.ReactNode;\n\n /**\n * Main content of the drawer.\n *\n */\n children?: React.ReactNode;\n\n /**\n * Renders the drawer in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Determines whether the drawer content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: I18nStrings;\n\n /**\n * Actions for the header. Available only if you specify the `header` property.\n */\n headerActions?: React.ReactNode;\n}\n\ninterface I18nStrings {\n /**\n Specifies the text that's displayed when the panel is in a loading state.\n */\n loadingText?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/drawer/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 { BaseComponentProps } from '../internal/base-component';\n\nexport interface DrawerProps extends BaseComponentProps {\n /**\n * Header of the drawer.\n *\n * It should contain the only `h2` used in the drawer.\n */\n header?: React.ReactNode;\n\n /**\n * Main content of the drawer.\n *\n */\n children?: React.ReactNode;\n\n /**\n * Renders the drawer in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Determines whether the drawer content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: I18nStrings;\n\n /**\n * Actions for the header. Available only if you specify the `header` property.\n */\n headerActions?: React.ReactNode;\n\n /**\n * Sticky footer content that remains visible at the bottom during scroll.\n *\n * Automatically becomes non-sticky when scrollable content area is too small\n * to ensure content remains accessible (not covered by the footer).\n */\n footer?: React.ReactNode;\n}\n\ninterface I18nStrings {\n /**\n Specifies the text that's displayed when the panel is in a loading state.\n */\n loadingText?: string;\n}\n"]}
|
package/drawer/styles.css.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"drawer": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"with-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
4
|
+
"drawer": "awsui_drawer_1sxt8_1gt83_189",
|
|
5
|
+
"with-footer": "awsui_with-footer_1sxt8_1gt83_221",
|
|
6
|
+
"content": "awsui_content_1sxt8_1gt83_226",
|
|
7
|
+
"header": "awsui_header_1sxt8_1gt83_230",
|
|
8
|
+
"with-additional-action": "awsui_with-additional-action_1sxt8_1gt83_247",
|
|
9
|
+
"with-runtime-context": "awsui_with-runtime-context_1sxt8_1gt83_255",
|
|
10
|
+
"with-toolbar": "awsui_with-toolbar_1sxt8_1gt83_258",
|
|
11
|
+
"header-actions": "awsui_header-actions_1sxt8_1gt83_277",
|
|
12
|
+
"content-with-paddings": "awsui_content-with-paddings_1sxt8_1gt83_283",
|
|
13
|
+
"footer": "awsui_footer_1sxt8_1gt83_290",
|
|
14
|
+
"is-sticky": "awsui_is-sticky_1sxt8_1gt83_296",
|
|
15
|
+
"test-utils-drawer-content": "awsui_test-utils-drawer-content_1sxt8_1gt83_304"
|
|
12
16
|
};
|
|
13
17
|
|
package/drawer/styles.scoped.css
CHANGED
|
@@ -186,7 +186,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
186
186
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
187
187
|
SPDX-License-Identifier: Apache-2.0
|
|
188
188
|
*/
|
|
189
|
-
.
|
|
189
|
+
.awsui_drawer_1sxt8_1gt83_189:not(#\9) {
|
|
190
190
|
border-collapse: separate;
|
|
191
191
|
border-spacing: 0;
|
|
192
192
|
box-sizing: border-box;
|
|
@@ -218,8 +218,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
218
218
|
-moz-osx-font-smoothing: auto;
|
|
219
219
|
word-wrap: break-word;
|
|
220
220
|
}
|
|
221
|
+
.awsui_drawer_1sxt8_1gt83_189.awsui_with-footer_1sxt8_1gt83_221:not(#\9) {
|
|
222
|
+
display: flex;
|
|
223
|
+
flex-direction: column;
|
|
224
|
+
min-block-size: 100%;
|
|
225
|
+
}
|
|
226
|
+
.awsui_drawer_1sxt8_1gt83_189.awsui_with-footer_1sxt8_1gt83_221 > .awsui_content_1sxt8_1gt83_226:not(#\9) {
|
|
227
|
+
flex: 1;
|
|
228
|
+
}
|
|
221
229
|
|
|
222
|
-
.
|
|
230
|
+
.awsui_header_1sxt8_1gt83_230:not(#\9) {
|
|
223
231
|
font-size: var(--font-panel-header-size-33h9j8, 18px);
|
|
224
232
|
letter-spacing: var(--letter-spacing-heading-m-29ewnk, -0.01em);
|
|
225
233
|
line-height: var(--font-panel-header-line-height-8xb2qj, 22px);
|
|
@@ -236,7 +244,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
236
244
|
/* stylelint-enable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
237
245
|
}
|
|
238
246
|
@media (min-width: 689px) {
|
|
239
|
-
.
|
|
247
|
+
.awsui_header_1sxt8_1gt83_230.awsui_with-additional-action_1sxt8_1gt83_247:not(#\9) {
|
|
240
248
|
/*
|
|
241
249
|
this padding is needed when the drawer renders inside a runtime drawer and the runtime drawer has an additional action
|
|
242
250
|
on the right (or left in rtl). in this case this padding ensures that the drawer's content does not overlap with runtime actions
|
|
@@ -244,18 +252,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
244
252
|
padding-inline: var(--space-panel-side-left-u1m3s9, 28px) calc(var(--space-xxxl-aut1u7, 40px) + var(--space-scaled-xxl-6wgq96, 32px));
|
|
245
253
|
}
|
|
246
254
|
}
|
|
247
|
-
.
|
|
255
|
+
.awsui_header_1sxt8_1gt83_230.awsui_with-runtime-context_1sxt8_1gt83_255:not(#\9) {
|
|
248
256
|
padding-block: 14px;
|
|
249
257
|
}
|
|
250
|
-
.awsui_with-
|
|
258
|
+
.awsui_with-toolbar_1sxt8_1gt83_258 > .awsui_header_1sxt8_1gt83_230:not(#\9) {
|
|
251
259
|
border-color: transparent;
|
|
252
260
|
margin-block-end: 0px;
|
|
253
261
|
}
|
|
254
|
-
.
|
|
255
|
-
.
|
|
256
|
-
.
|
|
257
|
-
.
|
|
258
|
-
.
|
|
262
|
+
.awsui_header_1sxt8_1gt83_230 h2:not(#\9),
|
|
263
|
+
.awsui_header_1sxt8_1gt83_230 h3:not(#\9),
|
|
264
|
+
.awsui_header_1sxt8_1gt83_230 h4:not(#\9),
|
|
265
|
+
.awsui_header_1sxt8_1gt83_230 h5:not(#\9),
|
|
266
|
+
.awsui_header_1sxt8_1gt83_230 h6:not(#\9) {
|
|
259
267
|
font-size: var(--font-panel-header-size-33h9j8, 18px);
|
|
260
268
|
letter-spacing: var(--letter-spacing-heading-m-29ewnk, -0.01em);
|
|
261
269
|
line-height: var(--font-panel-header-line-height-8xb2qj, 22px);
|
|
@@ -266,19 +274,33 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
266
274
|
margin-block: 0;
|
|
267
275
|
}
|
|
268
276
|
|
|
269
|
-
.awsui_header-
|
|
277
|
+
.awsui_header-actions_1sxt8_1gt83_277:not(#\9) {
|
|
270
278
|
display: inline-flex;
|
|
271
279
|
align-items: flex-start;
|
|
272
280
|
z-index: 1;
|
|
273
281
|
}
|
|
274
282
|
|
|
275
|
-
.awsui_content-with-
|
|
283
|
+
.awsui_content-with-paddings_1sxt8_1gt83_283:not(#\9):not(:empty) {
|
|
276
284
|
padding-block-start: var(--space-panel-content-top-qvd1dr, 20px);
|
|
277
285
|
padding-inline-start: var(--space-panel-side-left-u1m3s9, 28px);
|
|
278
286
|
padding-inline-end: var(--space-panel-side-right-8wwirc, 24px);
|
|
279
287
|
padding-block-end: var(--space-panel-content-bottom-24c6lu, 40px);
|
|
280
288
|
}
|
|
281
289
|
|
|
282
|
-
.
|
|
290
|
+
.awsui_footer_1sxt8_1gt83_290:not(#\9) {
|
|
291
|
+
background-color: var(--color-background-container-content-6u8rvp, #ffffff);
|
|
292
|
+
border-block-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-panel-header-ygztvl, #c6c6cd);
|
|
293
|
+
padding-block: var(--space-panel-content-top-qvd1dr, 20px);
|
|
294
|
+
padding-inline: var(--space-panel-side-left-u1m3s9, 28px) var(--space-panel-side-right-8wwirc, 24px);
|
|
295
|
+
}
|
|
296
|
+
.awsui_footer_1sxt8_1gt83_290.awsui_is-sticky_1sxt8_1gt83_296:not(#\9) {
|
|
297
|
+
position: sticky;
|
|
298
|
+
inset-block-end: 0;
|
|
299
|
+
inset-inline-start: 0;
|
|
300
|
+
inset-inline-end: 0;
|
|
301
|
+
z-index: 810;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.awsui_test-utils-drawer-content_1sxt8_1gt83_304:not(#\9) {
|
|
283
305
|
/* used in test-utils */
|
|
284
306
|
}
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"drawer": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"with-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
5
|
+
"drawer": "awsui_drawer_1sxt8_1gt83_189",
|
|
6
|
+
"with-footer": "awsui_with-footer_1sxt8_1gt83_221",
|
|
7
|
+
"content": "awsui_content_1sxt8_1gt83_226",
|
|
8
|
+
"header": "awsui_header_1sxt8_1gt83_230",
|
|
9
|
+
"with-additional-action": "awsui_with-additional-action_1sxt8_1gt83_247",
|
|
10
|
+
"with-runtime-context": "awsui_with-runtime-context_1sxt8_1gt83_255",
|
|
11
|
+
"with-toolbar": "awsui_with-toolbar_1sxt8_1gt83_258",
|
|
12
|
+
"header-actions": "awsui_header-actions_1sxt8_1gt83_277",
|
|
13
|
+
"content-with-paddings": "awsui_content-with-paddings_1sxt8_1gt83_283",
|
|
14
|
+
"footer": "awsui_footer_1sxt8_1gt83_290",
|
|
15
|
+
"is-sticky": "awsui_is-sticky_1sxt8_1gt83_296",
|
|
16
|
+
"test-utils-drawer-content": "awsui_test-utils-drawer-content_1sxt8_1gt83_304"
|
|
13
17
|
};
|
|
14
18
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare const MINIMUM_SCROLLABLE_SPACE = 148;
|
|
3
|
+
export declare function useStickyFooter({
|
|
4
|
+
drawerRef,
|
|
5
|
+
footerRef
|
|
6
|
+
}: {
|
|
7
|
+
drawerRef: RefObject<HTMLElement>;
|
|
8
|
+
footerRef: RefObject<HTMLElement>;
|
|
9
|
+
}): {
|
|
10
|
+
isSticky: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-footer.d.ts","sourceRoot":"","sources":["../../../src/drawer/use-sticky-footer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAA0C,MAAM,OAAO,CAAC;AAM1E,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAG5C,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,SAAS,GACV,EAAE;IACD,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAClC,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACnC;;EAoCA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { useCallback, useLayoutEffect, useState } from 'react';
|
|
4
|
+
import { throttle } from '../internal/utils/throttle';
|
|
5
|
+
// Minimum scrollable space is the space other than the sticky content, for instance for a sticky footer it's the
|
|
6
|
+
// the space other than that, which would be drawer height minus footer height.
|
|
7
|
+
export const MINIMUM_SCROLLABLE_SPACE = 148;
|
|
8
|
+
const STICKY_STATE_CHECK_THROTTLE_DELAY = 100; // every tenth of a second
|
|
9
|
+
export function useStickyFooter({ drawerRef, footerRef, }) {
|
|
10
|
+
const [isSticky, setIsSticky] = useState(true);
|
|
11
|
+
const checkStickyState = throttle(useCallback(() => {
|
|
12
|
+
if (!drawerRef.current || !footerRef.current) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const parentElement = drawerRef.current.parentElement;
|
|
16
|
+
const parentElementHeight = parentElement === null || parentElement === void 0 ? void 0 : parentElement.getBoundingClientRect().height;
|
|
17
|
+
const drawerHeight = drawerRef.current.getBoundingClientRect().height;
|
|
18
|
+
const effectiveHeight = Math.min(parentElementHeight !== null && parentElementHeight !== void 0 ? parentElementHeight : drawerHeight, drawerHeight);
|
|
19
|
+
// take minimum of drawer and parent height
|
|
20
|
+
const footerHeight = footerRef.current.getBoundingClientRect().height;
|
|
21
|
+
const scrollableHeight = effectiveHeight - footerHeight;
|
|
22
|
+
const hasEnoughSpace = scrollableHeight >= MINIMUM_SCROLLABLE_SPACE;
|
|
23
|
+
setIsSticky(hasEnoughSpace);
|
|
24
|
+
}, [footerRef, drawerRef]), STICKY_STATE_CHECK_THROTTLE_DELAY);
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
window.addEventListener('resize', checkStickyState);
|
|
27
|
+
checkStickyState();
|
|
28
|
+
return () => {
|
|
29
|
+
window.removeEventListener('resize', checkStickyState);
|
|
30
|
+
checkStickyState.cancel();
|
|
31
|
+
};
|
|
32
|
+
}, [checkStickyState]);
|
|
33
|
+
return { isSticky };
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=use-sticky-footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-footer.js","sourceRoot":"","sources":["../../../src/drawer/use-sticky-footer.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAa,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,iHAAiH;AACjH,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAC5C,MAAM,iCAAiC,GAAG,GAAG,CAAC,CAAC,0BAA0B;AAEzE,MAAM,UAAU,eAAe,CAAC,EAC9B,SAAS,EACT,SAAS,GAIV;IACC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE/C,MAAM,gBAAgB,GAAG,QAAQ,CAC/B,WAAW,CAAC,GAAG,EAAE;QACf,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YAC7C,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC;QACtD,MAAM,mBAAmB,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,qBAAqB,GAAG,MAAM,CAAC;QAC1E,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QACtE,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,aAAnB,mBAAmB,cAAnB,mBAAmB,GAAI,YAAY,EAAE,YAAY,CAAC,CAAC;QAEpF,2CAA2C;QAC3C,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QAEtE,MAAM,gBAAgB,GAAG,eAAe,GAAG,YAAY,CAAC;QACxD,MAAM,cAAc,GAAG,gBAAgB,IAAI,wBAAwB,CAAC;QAEpE,WAAW,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,EAC1B,iCAAiC,CAClC,CAAC;IAEF,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QACpD,gBAAgB,EAAE,CAAC;QAEnB,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;YACvD,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,EAAE,QAAQ,EAAE,CAAC;AACtB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { RefObject, useCallback, useLayoutEffect, useState } from 'react';\n\nimport { throttle } from '../internal/utils/throttle';\n\n// Minimum scrollable space is the space other than the sticky content, for instance for a sticky footer it's the\n// the space other than that, which would be drawer height minus footer height.\nexport const MINIMUM_SCROLLABLE_SPACE = 148;\nconst STICKY_STATE_CHECK_THROTTLE_DELAY = 100; // every tenth of a second\n\nexport function useStickyFooter({\n drawerRef,\n footerRef,\n}: {\n drawerRef: RefObject<HTMLElement>;\n footerRef: RefObject<HTMLElement>;\n}) {\n const [isSticky, setIsSticky] = useState(true);\n\n const checkStickyState = throttle(\n useCallback(() => {\n if (!drawerRef.current || !footerRef.current) {\n return;\n }\n\n const parentElement = drawerRef.current.parentElement;\n const parentElementHeight = parentElement?.getBoundingClientRect().height;\n const drawerHeight = drawerRef.current.getBoundingClientRect().height;\n const effectiveHeight = Math.min(parentElementHeight ?? drawerHeight, drawerHeight);\n\n // take minimum of drawer and parent height\n const footerHeight = footerRef.current.getBoundingClientRect().height;\n\n const scrollableHeight = effectiveHeight - footerHeight;\n const hasEnoughSpace = scrollableHeight >= MINIMUM_SCROLLABLE_SPACE;\n\n setIsSticky(hasEnoughSpace);\n }, [footerRef, drawerRef]),\n STICKY_STATE_CHECK_THROTTLE_DELAY\n );\n\n useLayoutEffect(() => {\n window.addEventListener('resize', checkStickyState);\n checkStickyState();\n\n return () => {\n window.removeEventListener('resize', checkStickyState);\n checkStickyState.cancel();\n };\n }, [checkStickyState]);\n\n return { isSticky };\n}\n"]}
|
package/help-panel/styles.css.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"help-panel": "awsui_help-
|
|
5
|
-
"loading": "
|
|
6
|
-
"header": "
|
|
7
|
-
"with-toolbar": "awsui_with-
|
|
8
|
-
"content": "
|
|
9
|
-
"footer": "
|
|
4
|
+
"help-panel": "awsui_help-panel_1d237_1drha_181",
|
|
5
|
+
"loading": "awsui_loading_1d237_1drha_348",
|
|
6
|
+
"header": "awsui_header_1d237_1drha_353",
|
|
7
|
+
"with-toolbar": "awsui_with-toolbar_1d237_1drha_371",
|
|
8
|
+
"content": "awsui_content_1d237_1drha_390",
|
|
9
|
+
"footer": "awsui_footer_1d237_1drha_441"
|
|
10
10
|
};
|
|
11
11
|
|