@cloudscape-design/components 3.0.246 → 3.0.248
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/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/drawer/index.d.ts +3 -21
- package/app-layout/drawer/index.d.ts.map +1 -1
- package/app-layout/drawer/index.js +25 -5
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/drawer/interfaces.d.ts +84 -0
- package/app-layout/drawer/interfaces.d.ts.map +1 -0
- package/app-layout/drawer/interfaces.js +2 -0
- package/app-layout/drawer/interfaces.js.map +1 -0
- package/app-layout/drawer/resizable-drawer.d.ts +4 -0
- package/app-layout/drawer/resizable-drawer.d.ts.map +1 -0
- package/app-layout/drawer/resizable-drawer.js +51 -0
- package/app-layout/drawer/resizable-drawer.js.map +1 -0
- package/app-layout/drawer/styles.css.js +10 -5
- package/app-layout/drawer/styles.scoped.css +46 -10
- package/app-layout/drawer/styles.selectors.js +10 -5
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +142 -17
- package/app-layout/index.js.map +1 -1
- package/app-layout/mobile-toolbar/index.d.ts +10 -1
- package/app-layout/mobile-toolbar/index.d.ts.map +1 -1
- package/app-layout/mobile-toolbar/index.js +3 -2
- package/app-layout/mobile-toolbar/index.js.map +1 -1
- package/app-layout/mobile-toolbar/styles.css.js +5 -4
- package/app-layout/mobile-toolbar/styles.scoped.css +11 -7
- package/app-layout/mobile-toolbar/styles.selectors.js +5 -4
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/test-classes/styles.css.js +18 -13
- package/app-layout/test-classes/styles.scoped.css +33 -13
- package/app-layout/test-classes/styles.selectors.js +18 -13
- package/app-layout/toggles/index.d.ts.map +1 -1
- package/app-layout/toggles/index.js +2 -2
- package/app-layout/toggles/index.js.map +1 -1
- package/app-layout/toggles/interfaces.d.ts +3 -1
- package/app-layout/toggles/interfaces.d.ts.map +1 -1
- package/app-layout/toggles/interfaces.js.map +1 -1
- package/app-layout/utils/use-drawer-focus-control.d.ts +21 -0
- package/app-layout/utils/use-drawer-focus-control.d.ts.map +1 -0
- package/app-layout/utils/use-drawer-focus-control.js +65 -0
- package/app-layout/utils/use-drawer-focus-control.js.map +1 -0
- package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
- package/app-layout/visual-refresh/app-bar.js +8 -6
- package/app-layout/visual-refresh/app-bar.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts +13 -6
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +107 -52
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/drawers.d.ts +47 -0
- package/app-layout/visual-refresh/drawers.d.ts.map +1 -0
- package/app-layout/visual-refresh/drawers.js +127 -0
- package/app-layout/visual-refresh/drawers.js.map +1 -0
- package/app-layout/visual-refresh/header.js +2 -2
- package/app-layout/visual-refresh/header.js.map +1 -1
- package/app-layout/visual-refresh/index.d.ts.map +1 -1
- package/app-layout/visual-refresh/index.js +3 -1
- package/app-layout/visual-refresh/index.js.map +1 -1
- package/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/app-layout/visual-refresh/layout.js +5 -42
- package/app-layout/visual-refresh/layout.js.map +1 -1
- package/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/app-layout/visual-refresh/main.js +2 -3
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/navigation.js +2 -2
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
- package/app-layout/visual-refresh/notifications.js +2 -2
- package/app-layout/visual-refresh/notifications.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +2 -2
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +71 -61
- package/app-layout/visual-refresh/styles.scoped.css +437 -229
- package/app-layout/visual-refresh/styles.selectors.js +71 -61
- package/app-layout/visual-refresh/tools.d.ts.map +1 -1
- package/app-layout/visual-refresh/tools.js +7 -3
- package/app-layout/visual-refresh/tools.js.map +1 -1
- package/app-layout/visual-refresh/trigger-button.d.ts +4 -3
- package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
- package/app-layout/visual-refresh/trigger-button.js +5 -4
- package/app-layout/visual-refresh/trigger-button.js.map +1 -1
- package/area-chart/internal.js +1 -1
- package/area-chart/internal.js.map +1 -1
- package/flashbar/styles.css.js +45 -45
- package/flashbar/styles.scoped.css +169 -169
- package/flashbar/styles.selectors.js +45 -45
- package/internal/base-component/styles.scoped.css +24 -0
- package/internal/context/app-layout-context.d.ts +0 -1
- package/internal/context/app-layout-context.d.ts.map +1 -1
- package/internal/context/app-layout-context.js.map +1 -1
- package/internal/context/dynamic-overlap-context.d.ts +3 -0
- package/internal/context/dynamic-overlap-context.d.ts.map +1 -0
- package/internal/context/dynamic-overlap-context.js +5 -0
- package/internal/context/dynamic-overlap-context.js.map +1 -0
- package/internal/environment.js +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +31 -30
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/generated/styles/tokens.d.ts +2 -0
- package/internal/generated/styles/tokens.js +2 -0
- package/internal/generated/theming/index.cjs +140 -0
- package/internal/generated/theming/index.js +140 -0
- package/internal/hooks/use-dynamic-overlap/index.js +7 -7
- package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/mixed-line-bar-chart/internal.js +1 -1
- package/mixed-line-bar-chart/internal.js.map +1 -1
- package/package.json +1 -1
- package/pie-chart/index.js +1 -1
- package/pie-chart/index.js.map +1 -1
- package/space-between/internal.js +1 -1
- package/space-between/internal.js.map +1 -1
- package/space-between/styles.css.js +20 -28
- package/space-between/styles.scoped.css +37 -101
- package/space-between/styles.selectors.js +20 -28
- package/test-utils/dom/button/index.js +1 -6
- package/test-utils/dom/button/index.js.map +1 -1
- package/test-utils/dom/flashbar/index.d.ts +5 -1
- package/test-utils/dom/flashbar/index.js +7 -0
- package/test-utils/dom/flashbar/index.js.map +1 -1
- package/test-utils/selectors/flashbar/index.d.ts +5 -1
- package/test-utils/selectors/flashbar/index.js +7 -0
- package/test-utils/selectors/flashbar/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/wizard/interfaces.d.ts +4 -0
- package/wizard/interfaces.d.ts.map +1 -1
- package/wizard/interfaces.js.map +1 -1
- package/wizard/wizard-actions.d.ts +2 -1
- package/wizard/wizard-actions.d.ts.map +1 -1
- package/wizard/wizard-actions.js +2 -2
- package/wizard/wizard-actions.js.map +1 -1
- package/wizard/wizard-form.d.ts.map +1 -1
- package/wizard/wizard-form.js +1 -1
- package/wizard/wizard-form.js.map +1 -1
|
@@ -2,66 +2,76 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"appbar": "
|
|
6
|
-
"appbar-nav": "awsui_appbar-
|
|
7
|
-
"breadcrumbs": "
|
|
8
|
-
"appbar-tools": "awsui_appbar-
|
|
9
|
-
"
|
|
10
|
-
"has-
|
|
11
|
-
"has-
|
|
12
|
-
"has-
|
|
13
|
-
"
|
|
14
|
-
"content-type-
|
|
15
|
-
"content-type-
|
|
16
|
-
"
|
|
17
|
-
"background": "
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"has-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"is-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"split-panel
|
|
39
|
-
"
|
|
40
|
-
"content-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
5
|
+
"appbar": "awsui_appbar_hyvsj_nghum_93",
|
|
6
|
+
"appbar-nav": "awsui_appbar-nav_hyvsj_nghum_117",
|
|
7
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_nghum_121",
|
|
8
|
+
"appbar-tools": "awsui_appbar-tools_hyvsj_nghum_125",
|
|
9
|
+
"drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_nghum_126",
|
|
10
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_nghum_167",
|
|
11
|
+
"has-notifications-content": "awsui_has-notifications-content_hyvsj_nghum_175",
|
|
12
|
+
"has-header": "awsui_has-header_hyvsj_nghum_181",
|
|
13
|
+
"has-dynamic-overlap-height": "awsui_has-dynamic-overlap-height_hyvsj_nghum_181",
|
|
14
|
+
"content-type-wizard": "awsui_content-type-wizard_hyvsj_nghum_182",
|
|
15
|
+
"content-type-cards": "awsui_content-type-cards_hyvsj_nghum_185",
|
|
16
|
+
"content-type-table": "awsui_content-type-table_hyvsj_nghum_186",
|
|
17
|
+
"has-sticky-background": "awsui_has-sticky-background_hyvsj_nghum_189",
|
|
18
|
+
"background": "awsui_background_hyvsj_nghum_224",
|
|
19
|
+
"notifications-appbar-header": "awsui_notifications-appbar-header_hyvsj_nghum_227",
|
|
20
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_nghum_240",
|
|
21
|
+
"overlap": "awsui_overlap_hyvsj_nghum_246",
|
|
22
|
+
"drawers-container": "awsui_drawers-container_hyvsj_nghum_270",
|
|
23
|
+
"has-open-drawer": "awsui_has-open-drawer_hyvsj_nghum_282",
|
|
24
|
+
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_nghum_312",
|
|
25
|
+
"has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_nghum_330",
|
|
26
|
+
"drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_nghum_362",
|
|
27
|
+
"drawer": "awsui_drawer_hyvsj_nghum_126",
|
|
28
|
+
"drawer-close-button": "awsui_drawer-close-button_hyvsj_nghum_406",
|
|
29
|
+
"drawer-content": "awsui_drawer-content_hyvsj_nghum_410",
|
|
30
|
+
"is-drawer-open": "awsui_is-drawer-open_hyvsj_nghum_415",
|
|
31
|
+
"content": "awsui_content_hyvsj_nghum_182",
|
|
32
|
+
"layout": "awsui_layout_hyvsj_nghum_517",
|
|
33
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_nghum_600",
|
|
34
|
+
"content-type-dashboard": "awsui_content-type-dashboard_hyvsj_nghum_615",
|
|
35
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_nghum_642",
|
|
36
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_nghum_645",
|
|
37
|
+
"has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_nghum_649",
|
|
38
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_nghum_663",
|
|
39
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_nghum_663",
|
|
40
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_nghum_675",
|
|
41
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_nghum_678",
|
|
42
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_nghum_693",
|
|
43
|
+
"container": "awsui_container_hyvsj_nghum_701",
|
|
44
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_nghum_727",
|
|
45
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_nghum_732",
|
|
46
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_nghum_735",
|
|
47
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_nghum_735",
|
|
48
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_nghum_735",
|
|
49
|
+
"content-type-default": "awsui_content-type-default_hyvsj_nghum_755",
|
|
50
|
+
"content-type-form": "awsui_content-type-form_hyvsj_nghum_755",
|
|
51
|
+
"unfocusable": "awsui_unfocusable_hyvsj_nghum_796",
|
|
52
|
+
"navigation-container": "awsui_navigation-container_hyvsj_nghum_806",
|
|
53
|
+
"show-navigation": "awsui_show-navigation_hyvsj_nghum_841",
|
|
54
|
+
"animating": "awsui_animating_hyvsj_nghum_863",
|
|
55
|
+
"showButtons": "awsui_showButtons_hyvsj_nghum_1",
|
|
56
|
+
"navigation": "awsui_navigation_hyvsj_nghum_806",
|
|
57
|
+
"openNavigation": "awsui_openNavigation_hyvsj_nghum_1",
|
|
58
|
+
"animated-content": "awsui_animated-content_hyvsj_nghum_924",
|
|
59
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_nghum_933",
|
|
60
|
+
"notifications": "awsui_notifications_hyvsj_nghum_227",
|
|
61
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_nghum_1000",
|
|
62
|
+
"position-bottom": "awsui_position-bottom_hyvsj_nghum_1046",
|
|
63
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_nghum_1",
|
|
64
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_nghum_1075",
|
|
65
|
+
"position-side": "awsui_position-side_hyvsj_nghum_1103",
|
|
66
|
+
"openSplitPanelSide": "awsui_openSplitPanelSide_hyvsj_nghum_1",
|
|
67
|
+
"tools-container": "awsui_tools-container_hyvsj_nghum_1140",
|
|
68
|
+
"tools": "awsui_tools_hyvsj_nghum_1140",
|
|
69
|
+
"openTools": "awsui_openTools_hyvsj_nghum_1",
|
|
70
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_nghum_1225",
|
|
71
|
+
"hide-tools": "awsui_hide-tools_hyvsj_nghum_1235",
|
|
72
|
+
"show-tools": "awsui_show-tools_hyvsj_nghum_1247",
|
|
73
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_nghum_1225",
|
|
74
|
+
"trigger": "awsui_trigger_hyvsj_nghum_1314",
|
|
75
|
+
"selected": "awsui_selected_hyvsj_nghum_1353"
|
|
66
76
|
};
|
|
67
77
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,sBAiIrD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,OAAO,WAU/E"}
|
|
@@ -19,14 +19,18 @@ import customCssProps from '../../internal/generated/custom-css-properties';
|
|
|
19
19
|
* split panel in large viewports;
|
|
20
20
|
*/
|
|
21
21
|
export default function Tools({ children }) {
|
|
22
|
-
const { ariaLabels, handleSplitPanelClick, handleToolsClick, hasDefaultToolsWidth,
|
|
22
|
+
const { ariaLabels, drawers, handleSplitPanelClick, handleToolsClick, hasDefaultToolsWidth, hasDrawerViewportOverlay, isMobile, isNavigationOpen, isSplitPanelOpen, isToolsOpen, loseToolsFocus, navigationHide, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, tools, toolsHide, toolsRefs, toolsWidth, } = useAppLayoutInternals();
|
|
23
23
|
const hasSplitPanel = getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);
|
|
24
24
|
const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);
|
|
25
25
|
const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);
|
|
26
|
-
|
|
26
|
+
const isUnfocusable = hasDrawerViewportOverlay && isNavigationOpen && !navigationHide;
|
|
27
|
+
/**
|
|
28
|
+
* If the drawers property is defined the Tools and SplitPanel will be mounted and rendered
|
|
29
|
+
* by the Drawers component.
|
|
30
|
+
*/
|
|
31
|
+
if ((toolsHide && !hasSplitPanel) || drawers) {
|
|
27
32
|
return null;
|
|
28
33
|
}
|
|
29
|
-
const isUnfocusable = isMobile && isAnyPanelOpen && isNavigationOpen && !navigationHide;
|
|
30
34
|
return (React.createElement(Transition, { in: isToolsOpen !== null && isToolsOpen !== void 0 ? isToolsOpen : false }, (state, transitionEventsRef) => {
|
|
31
35
|
var _a, _b, _c;
|
|
32
36
|
return (React.createElement("div", { className: clsx(styles['tools-container'], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAA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I,CAAC,QAAQ,EAAE;QACb,mDAAmD;QACnD,IAAI,aAAa,IAAI,CAAC,SAAS,EAAE;YAC/B,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,mCAAmC;QACnC,IAAI,aAAa,IAAI,CAAC,gBAAgB,IAAI,SAAS,EAAE;YACnD,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,6BAA6B;QAC7B,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n isNavigationOpen,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n splitPanelDisplayed,\n tools,\n toolsHide,\n toolsWidth,\n isAnyPanelOpen,\n navigationHide,\n toolsRefs,\n loseToolsFocus,\n splitPanelPosition,\n splitPanelToggle,\n splitPanelRefs,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n\n if (toolsHide && !hasSplitPanel) {\n return null;\n }\n\n const isUnfocusable = isMobile && isAnyPanelOpen && isNavigationOpen && !navigationHide;\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(styles['show-tools'], {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanelDisplayed: boolean, splitPanelPosition: string) {\n return splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAA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,gBAAgB,IAAI,SAAS,EAAE;YACnD,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,6BAA6B;QAC7B,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n drawers,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n hasDrawerViewportOverlay,\n isMobile,\n isNavigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n loseToolsFocus,\n navigationHide,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsHide,\n toolsRefs,\n toolsWidth,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n const isUnfocusable = hasDrawerViewportOverlay && isNavigationOpen && !navigationHide;\n\n /**\n * If the drawers property is defined the Tools and SplitPanel will be mounted and rendered\n * by the Drawers component.\n */\n if ((toolsHide && !hasSplitPanel) || drawers) {\n return null;\n }\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(styles['show-tools'], {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanelDisplayed: boolean, splitPanelPosition: string) {\n return splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonProps } from '../../button/interfaces';
|
|
3
3
|
import { IconProps } from '../../icon/interfaces';
|
|
4
|
-
interface TriggerButtonProps {
|
|
4
|
+
export interface TriggerButtonProps {
|
|
5
5
|
ariaLabel?: string;
|
|
6
|
-
|
|
6
|
+
className?: string;
|
|
7
|
+
iconName?: IconProps.Name;
|
|
8
|
+
iconSvg?: React.ReactNode;
|
|
7
9
|
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
8
10
|
selected?: boolean;
|
|
9
|
-
className?: string;
|
|
10
11
|
}
|
|
11
12
|
declare const _default: React.ForwardRefExoticComponent<TriggerButtonProps & React.RefAttributes<ButtonProps.Ref>>;
|
|
12
13
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-button.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,
|
|
1
|
+
{"version":3,"file":"trigger-button.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;AA4BD,wBAA+C"}
|
|
@@ -4,11 +4,12 @@ import React from 'react';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import Icon from '../../icon/internal';
|
|
6
6
|
import styles from './styles.css.js';
|
|
7
|
-
function TriggerButton({ ariaLabel, iconName, onClick, selected = false
|
|
8
|
-
return (React.createElement("button", { "aria-
|
|
7
|
+
function TriggerButton({ ariaLabel, className, iconName, iconSvg, onClick, selected = false }, ref) {
|
|
8
|
+
return (React.createElement("button", { "aria-expanded": false, "aria-haspopup": true, "aria-label": ariaLabel, className: clsx(styles.trigger, {
|
|
9
9
|
[styles.selected]: selected,
|
|
10
|
-
}, className), onClick: onClick, type: "button"
|
|
11
|
-
React.createElement(Icon, { name: iconName })
|
|
10
|
+
}, className), onClick: onClick, ref: ref, type: "button" },
|
|
11
|
+
iconName && !iconSvg && React.createElement(Icon, { name: iconName }),
|
|
12
|
+
iconSvg));
|
|
12
13
|
}
|
|
13
14
|
export default React.forwardRef(TriggerButton);
|
|
14
15
|
//# sourceMappingURL=trigger-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-button.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"trigger-button.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAarC,SAAS,aAAa,CACpB,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,EAAsB,EAC1F,GAA+B;IAE/B,OAAO,CACL,iDACiB,KAAK,mBACL,IAAI,gBACP,SAAS,EACrB,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,OAAO,EACd;YACE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;SAC5B,EACD,SAAS,CACV,EACD,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAmC,EACxC,IAAI,EAAC,QAAQ;QAEZ,QAAQ,IAAI,CAAC,OAAO,IAAI,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,GAAI;QAChD,OAAO,CACD,CACV,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport Icon from '../../icon/internal';\nimport styles from './styles.css.js';\nimport { ButtonProps } from '../../button/interfaces';\nimport { IconProps } from '../../icon/interfaces';\n\nexport interface TriggerButtonProps {\n ariaLabel?: string;\n className?: string;\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n selected?: boolean;\n}\n\nfunction TriggerButton(\n { ariaLabel, className, iconName, iconSvg, onClick, selected = false }: TriggerButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n) {\n return (\n <button\n aria-expanded={false}\n aria-haspopup={true}\n aria-label={ariaLabel}\n className={clsx(\n styles.trigger,\n {\n [styles.selected]: selected,\n },\n className\n )}\n onClick={onClick}\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n >\n {iconName && !iconSvg && <Icon name={iconName} />}\n {iconSvg}\n </button>\n );\n}\n\nexport default React.forwardRef(TriggerButton);\n"]}
|
package/area-chart/internal.js
CHANGED
|
@@ -56,7 +56,7 @@ export default function InternalAreaChart(_a) {
|
|
|
56
56
|
visibleData: visibleSeries,
|
|
57
57
|
statusType,
|
|
58
58
|
});
|
|
59
|
-
const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch);
|
|
59
|
+
const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter);
|
|
60
60
|
const showLegend = !hideLegend && !isEmpty && statusType === 'finished';
|
|
61
61
|
const reserveLegendSpace = !showChart && !hideLegend;
|
|
62
62
|
const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["area-chart/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,oBAAoB,EAAE,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,eAAe,MAAM,sDAAsD,CAAC;AACnF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAShE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAqC,EA+BlD;QA/BkD,EAC5E,MAAM,EACN,UAAU,EACV,UAAU,EACV,OAAO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,SAAS,EAAE,QAAQ,EACnB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,GACxB,CACH,CACG;QAEL,UAAU,IAAI,CACb,oBAAC,WAAW,IAAC,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;YAC/B,oBAAC,eAAe,IACd,gBAAgB,EAAE,YAAY,EAC9B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,CAAC,eAAe,GACtC,CACU,CACf,CACG,CACP,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, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { isDevelopment } from '../internal/is-development';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalBox from '../box/internal';\nimport ChartStatusContainer, { getChartStatus } from '../internal/components/chart-status-container';\n\nimport AreaChartFilter from './elements/area-chart-filter';\nimport AreaChartLegend from './elements/area-chart-legend';\nimport { AreaChartProps } from './interfaces';\nimport InternalSpaceBetween from '../space-between/internal';\nimport ChartContainer from './chart-container';\nimport cartesianStyles from '../internal/components/cartesian-chart/styles.css.js';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useChartModel from './model/use-chart-model';\nimport useFilterProps from './model/use-filter-props';\nimport useHighlightProps from './model/use-highlight-props';\nimport { isSeriesValid } from './model/utils';\nimport { warnOnce } from '../internal/logging';\nimport { nodeContains } from '../internal/utils/dom';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\n\ntype InternalAreaChartProps<T extends AreaChartProps.DataTypes> = SomeRequired<\n AreaChartProps<T>,\n 'height' | 'xScaleType' | 'yScaleType' | 'statusType' | 'detailPopoverSize' | 'i18nStrings'\n> &\n InternalBaseComponentProps;\n\nexport default function InternalAreaChart<T extends AreaChartProps.DataTypes>({\n height,\n xScaleType,\n yScaleType,\n xDomain,\n yDomain,\n highlightedSeries: controlledHighlightedSeries,\n visibleSeries: controlledVisibleSeries,\n series: externalSeries,\n onFilterChange: controlledOnVisibleChange,\n onHighlightChange: controlledOnHighlightChange,\n i18nStrings,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n xTitle,\n yTitle,\n hideFilter,\n additionalFilters,\n hideLegend,\n legendTitle,\n statusType,\n detailPopoverSize,\n empty,\n noMatch,\n errorText,\n loadingText,\n recoveryText,\n onRecoveryClick,\n __internalRootRef = null,\n ...props\n}: InternalAreaChartProps<T>) {\n const baseProps = getBaseProps(props);\n const containerRef = useRef<HTMLDivElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n if (isDevelopment) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!isSeriesValid(externalSeries)) {\n warnOnce(\n 'AreaChart',\n \"The `series` property violates the component's constraints: all `area` \" +\n 'series must have `data` arrays of the same length and with the same x-values.'\n );\n }\n }, [externalSeries]);\n }\n\n const [width, setWidth] = useState(0);\n const [visibleSeries, setVisibleSeries] = useFilterProps(\n externalSeries,\n controlledVisibleSeries,\n controlledOnVisibleChange\n );\n const [highlightedSeries, setHighlightedSeries] = useHighlightProps(\n externalSeries,\n controlledHighlightedSeries,\n controlledOnHighlightChange\n );\n const model = useChartModel({\n externalSeries,\n visibleSeries,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n popoverRef,\n });\n\n const { isEmpty, isNoMatch, showChart } = getChartStatus({\n externalData: externalSeries,\n visibleData: visibleSeries,\n statusType,\n });\n const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch);\n const showLegend = !hideLegend && !isEmpty && statusType === 'finished';\n const reserveLegendSpace = !showChart && !hideLegend;\n const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters);\n\n useEffect(() => {\n const onKeyDown = model.handlers.onDocumentKeyDown;\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [model.handlers.onDocumentKeyDown]);\n\n const onBlur = (event: React.FocusEvent) => {\n if (event.relatedTarget && !nodeContains(containerRef.current, event.relatedTarget)) {\n model.handlers.onContainerBlur();\n }\n };\n\n const mergedRef = useMergeRefs(containerRef, __internalRootRef);\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={mergedRef} onBlur={onBlur}>\n {showFilters && (\n <InternalBox className={cartesianStyles['filter-container']} margin={{ bottom: 'l' }}>\n <InternalSpaceBetween\n size=\"l\"\n direction=\"horizontal\"\n className={clsx({ [styles['has-default-filter']]: !hideFilter })}\n >\n {!hideFilter && (\n <AreaChartFilter\n model={model}\n filterLabel={i18nStrings.filterLabel}\n filterPlaceholder={i18nStrings.filterPlaceholder}\n filterSelectedAriaLabel={i18nStrings.filterSelectedAriaLabel}\n />\n )}\n {additionalFilters}\n </InternalSpaceBetween>\n </InternalBox>\n )}\n\n <div\n className={clsx(styles.content, {\n [styles['content--reserve-filter']]: reserveFilterSpace,\n [styles['content--reserve-legend']]: reserveLegendSpace,\n })}\n style={{ minHeight: height }}\n >\n <ChartStatusContainer\n isEmpty={isEmpty}\n isNoMatch={isNoMatch}\n showChart={showChart}\n statusType={statusType}\n empty={empty}\n noMatch={noMatch}\n loadingText={loadingText}\n errorText={errorText}\n recoveryText={recoveryText}\n onRecoveryClick={onRecoveryClick}\n />\n {showChart && (\n <ChartContainer\n model={model}\n autoWidth={setWidth}\n detailPopoverSize={detailPopoverSize}\n xTitle={xTitle}\n yTitle={yTitle}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n i18nStrings={i18nStrings}\n />\n )}\n </div>\n\n {showLegend && (\n <InternalBox margin={{ top: 'm' }}>\n <AreaChartLegend\n plotContainerRef={containerRef}\n model={model}\n legendTitle={legendTitle}\n ariaLabel={i18nStrings.legendAriaLabel}\n />\n </InternalBox>\n )}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["area-chart/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,oBAAoB,EAAE,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAErG,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,eAAe,MAAM,sDAAsD,CAAC;AACnF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,iBAAiB,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAShE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAqC,EA+BlD;QA/BkD,EAC5E,M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EAAE,eAAe,GAChC;YACD,SAAS,IAAI,CACZ,oBAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,EACnB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,GACxB,CACH,CACG;QAEL,UAAU,IAAI,CACb,oBAAC,WAAW,IAAC,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;YAC/B,oBAAC,eAAe,IACd,gBAAgB,EAAE,YAAY,EAC9B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,CAAC,eAAe,GACtC,CACU,CACf,CACG,CACP,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, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { isDevelopment } from '../internal/is-development';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalBox from '../box/internal';\nimport ChartStatusContainer, { getChartStatus } from '../internal/components/chart-status-container';\n\nimport AreaChartFilter from './elements/area-chart-filter';\nimport AreaChartLegend from './elements/area-chart-legend';\nimport { AreaChartProps } from './interfaces';\nimport InternalSpaceBetween from '../space-between/internal';\nimport ChartContainer from './chart-container';\nimport cartesianStyles from '../internal/components/cartesian-chart/styles.css.js';\nimport styles from './styles.css.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useChartModel from './model/use-chart-model';\nimport useFilterProps from './model/use-filter-props';\nimport useHighlightProps from './model/use-highlight-props';\nimport { isSeriesValid } from './model/utils';\nimport { warnOnce } from '../internal/logging';\nimport { nodeContains } from '../internal/utils/dom';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { SomeRequired } from '../internal/types';\n\ntype InternalAreaChartProps<T extends AreaChartProps.DataTypes> = SomeRequired<\n AreaChartProps<T>,\n 'height' | 'xScaleType' | 'yScaleType' | 'statusType' | 'detailPopoverSize' | 'i18nStrings'\n> &\n InternalBaseComponentProps;\n\nexport default function InternalAreaChart<T extends AreaChartProps.DataTypes>({\n height,\n xScaleType,\n yScaleType,\n xDomain,\n yDomain,\n highlightedSeries: controlledHighlightedSeries,\n visibleSeries: controlledVisibleSeries,\n series: externalSeries,\n onFilterChange: controlledOnVisibleChange,\n onHighlightChange: controlledOnHighlightChange,\n i18nStrings,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n xTitle,\n yTitle,\n hideFilter,\n additionalFilters,\n hideLegend,\n legendTitle,\n statusType,\n detailPopoverSize,\n empty,\n noMatch,\n errorText,\n loadingText,\n recoveryText,\n onRecoveryClick,\n __internalRootRef = null,\n ...props\n}: InternalAreaChartProps<T>) {\n const baseProps = getBaseProps(props);\n const containerRef = useRef<HTMLDivElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n if (isDevelopment) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!isSeriesValid(externalSeries)) {\n warnOnce(\n 'AreaChart',\n \"The `series` property violates the component's constraints: all `area` \" +\n 'series must have `data` arrays of the same length and with the same x-values.'\n );\n }\n }, [externalSeries]);\n }\n\n const [width, setWidth] = useState(0);\n const [visibleSeries, setVisibleSeries] = useFilterProps(\n externalSeries,\n controlledVisibleSeries,\n controlledOnVisibleChange\n );\n const [highlightedSeries, setHighlightedSeries] = useHighlightProps(\n externalSeries,\n controlledHighlightedSeries,\n controlledOnHighlightChange\n );\n const model = useChartModel({\n externalSeries,\n visibleSeries,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n popoverRef,\n });\n\n const { isEmpty, isNoMatch, showChart } = getChartStatus({\n externalData: externalSeries,\n visibleData: visibleSeries,\n statusType,\n });\n const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter);\n const showLegend = !hideLegend && !isEmpty && statusType === 'finished';\n const reserveLegendSpace = !showChart && !hideLegend;\n const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters);\n\n useEffect(() => {\n const onKeyDown = model.handlers.onDocumentKeyDown;\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [model.handlers.onDocumentKeyDown]);\n\n const onBlur = (event: React.FocusEvent) => {\n if (event.relatedTarget && !nodeContains(containerRef.current, event.relatedTarget)) {\n model.handlers.onContainerBlur();\n }\n };\n\n const mergedRef = useMergeRefs(containerRef, __internalRootRef);\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={mergedRef} onBlur={onBlur}>\n {showFilters && (\n <InternalBox className={cartesianStyles['filter-container']} margin={{ bottom: 'l' }}>\n <InternalSpaceBetween\n size=\"l\"\n direction=\"horizontal\"\n className={clsx({ [styles['has-default-filter']]: !hideFilter })}\n >\n {!hideFilter && (\n <AreaChartFilter\n model={model}\n filterLabel={i18nStrings.filterLabel}\n filterPlaceholder={i18nStrings.filterPlaceholder}\n filterSelectedAriaLabel={i18nStrings.filterSelectedAriaLabel}\n />\n )}\n {additionalFilters}\n </InternalSpaceBetween>\n </InternalBox>\n )}\n\n <div\n className={clsx(styles.content, {\n [styles['content--reserve-filter']]: reserveFilterSpace,\n [styles['content--reserve-legend']]: reserveLegendSpace,\n })}\n style={{ minHeight: height }}\n >\n <ChartStatusContainer\n isEmpty={isEmpty}\n isNoMatch={isNoMatch}\n showChart={showChart}\n statusType={statusType}\n empty={empty}\n noMatch={noMatch}\n loadingText={loadingText}\n errorText={errorText}\n recoveryText={recoveryText}\n onRecoveryClick={onRecoveryClick}\n />\n {showChart && (\n <ChartContainer\n model={model}\n autoWidth={setWidth}\n detailPopoverSize={detailPopoverSize}\n xTitle={xTitle}\n yTitle={yTitle}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n i18nStrings={i18nStrings}\n />\n )}\n </div>\n\n {showLegend && (\n <InternalBox margin={{ top: 'm' }}>\n <AreaChartLegend\n plotContainerRef={containerRef}\n model={model}\n legendTitle={legendTitle}\n ariaLabel={i18nStrings.legendAriaLabel}\n />\n </InternalBox>\n )}\n </div>\n );\n}\n"]}
|
package/flashbar/styles.css.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"flash-with-motion": "awsui_flash-with-
|
|
5
|
-
"enter": "
|
|
6
|
-
"flash-body": "awsui_flash-
|
|
7
|
-
"flash-message": "awsui_flash-
|
|
8
|
-
"flash-header": "awsui_flash-
|
|
9
|
-
"flash-content": "awsui_flash-
|
|
10
|
-
"action-button-wrapper": "awsui_action-button-
|
|
11
|
-
"dismiss-button-wrapper": "awsui_dismiss-button-
|
|
12
|
-
"flash-icon": "awsui_flash-
|
|
13
|
-
"entering": "
|
|
14
|
-
"entered": "
|
|
15
|
-
"exiting": "
|
|
16
|
-
"stack": "
|
|
17
|
-
"animation-running": "awsui_animation-
|
|
18
|
-
"item": "
|
|
19
|
-
"flash-list-item": "awsui_flash-list-
|
|
20
|
-
"notification-bar": "awsui_notification-
|
|
21
|
-
"collapsed": "
|
|
22
|
-
"animation-ready": "awsui_animation-
|
|
23
|
-
"expanded-only": "awsui_expanded-
|
|
24
|
-
"expanded": "
|
|
25
|
-
"flash": "
|
|
26
|
-
"collapsible": "
|
|
27
|
-
"short-list": "awsui_short-
|
|
28
|
-
"visual-refresh": "awsui_visual-
|
|
29
|
-
"status": "
|
|
30
|
-
"header": "
|
|
31
|
-
"item-count": "awsui_item-
|
|
32
|
-
"button": "
|
|
33
|
-
"type-count": "awsui_type-
|
|
34
|
-
"count-number": "awsui_count-
|
|
35
|
-
"icon": "
|
|
36
|
-
"floating": "
|
|
37
|
-
"flashbar": "
|
|
38
|
-
"flash-refresh": "awsui_flash-
|
|
39
|
-
"flash-list": "awsui_flash-
|
|
40
|
-
"flash-focus-container": "awsui_flash-focus-
|
|
41
|
-
"flash-text": "awsui_flash-
|
|
42
|
-
"dismiss-button": "awsui_dismiss-
|
|
43
|
-
"breakpoint-default": "awsui_breakpoint-
|
|
44
|
-
"action-button": "awsui_action-
|
|
45
|
-
"flash-type-success": "awsui_flash-type-
|
|
46
|
-
"flash-type-error": "awsui_flash-type-
|
|
47
|
-
"flash-type-warning": "awsui_flash-type-
|
|
48
|
-
"flash-type-info": "awsui_flash-type-
|
|
4
|
+
"flash-with-motion": "awsui_flash-with-motion_1q84n_kln9a_93",
|
|
5
|
+
"enter": "awsui_enter_1q84n_kln9a_93",
|
|
6
|
+
"flash-body": "awsui_flash-body_1q84n_kln9a_107",
|
|
7
|
+
"flash-message": "awsui_flash-message_1q84n_kln9a_107",
|
|
8
|
+
"flash-header": "awsui_flash-header_1q84n_kln9a_107",
|
|
9
|
+
"flash-content": "awsui_flash-content_1q84n_kln9a_108",
|
|
10
|
+
"action-button-wrapper": "awsui_action-button-wrapper_1q84n_kln9a_109",
|
|
11
|
+
"dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_kln9a_110",
|
|
12
|
+
"flash-icon": "awsui_flash-icon_1q84n_kln9a_133",
|
|
13
|
+
"entering": "awsui_entering_1q84n_kln9a_146",
|
|
14
|
+
"entered": "awsui_entered_1q84n_kln9a_167",
|
|
15
|
+
"exiting": "awsui_exiting_1q84n_kln9a_272",
|
|
16
|
+
"stack": "awsui_stack_1q84n_kln9a_294",
|
|
17
|
+
"animation-running": "awsui_animation-running_1q84n_kln9a_294",
|
|
18
|
+
"item": "awsui_item_1q84n_kln9a_294",
|
|
19
|
+
"flash-list-item": "awsui_flash-list-item_1q84n_kln9a_295",
|
|
20
|
+
"notification-bar": "awsui_notification-bar_1q84n_kln9a_296",
|
|
21
|
+
"collapsed": "awsui_collapsed_1q84n_kln9a_316",
|
|
22
|
+
"animation-ready": "awsui_animation-ready_1q84n_kln9a_316",
|
|
23
|
+
"expanded-only": "awsui_expanded-only_1q84n_kln9a_316",
|
|
24
|
+
"expanded": "awsui_expanded_1q84n_kln9a_316",
|
|
25
|
+
"flash": "awsui_flash_1q84n_kln9a_93",
|
|
26
|
+
"collapsible": "awsui_collapsible_1q84n_kln9a_380",
|
|
27
|
+
"short-list": "awsui_short-list_1q84n_kln9a_386",
|
|
28
|
+
"visual-refresh": "awsui_visual-refresh_1q84n_kln9a_386",
|
|
29
|
+
"status": "awsui_status_1q84n_kln9a_603",
|
|
30
|
+
"header": "awsui_header_1q84n_kln9a_603",
|
|
31
|
+
"item-count": "awsui_item-count_1q84n_kln9a_604",
|
|
32
|
+
"button": "awsui_button_1q84n_kln9a_605",
|
|
33
|
+
"type-count": "awsui_type-count_1q84n_kln9a_640",
|
|
34
|
+
"count-number": "awsui_count-number_1q84n_kln9a_640",
|
|
35
|
+
"icon": "awsui_icon_1q84n_kln9a_674",
|
|
36
|
+
"floating": "awsui_floating_1q84n_kln9a_712",
|
|
37
|
+
"flashbar": "awsui_flashbar_1q84n_kln9a_720",
|
|
38
|
+
"flash-refresh": "awsui_flash-refresh_1q84n_kln9a_766",
|
|
39
|
+
"flash-list": "awsui_flash-list_1q84n_kln9a_295",
|
|
40
|
+
"flash-focus-container": "awsui_flash-focus-container_1q84n_kln9a_785",
|
|
41
|
+
"flash-text": "awsui_flash-text_1q84n_kln9a_812",
|
|
42
|
+
"dismiss-button": "awsui_dismiss-button_1q84n_kln9a_110",
|
|
43
|
+
"breakpoint-default": "awsui_breakpoint-default_1q84n_kln9a_853",
|
|
44
|
+
"action-button": "awsui_action-button_1q84n_kln9a_109",
|
|
45
|
+
"flash-type-success": "awsui_flash-type-success_1q84n_kln9a_866",
|
|
46
|
+
"flash-type-error": "awsui_flash-type-error_1q84n_kln9a_870",
|
|
47
|
+
"flash-type-warning": "awsui_flash-type-warning_1q84n_kln9a_874",
|
|
48
|
+
"flash-type-info": "awsui_flash-type-info_1q84n_kln9a_878"
|
|
49
49
|
};
|
|
50
50
|
|