@cloudscape-design/components 3.0.360 → 3.0.362
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/index.d.ts.map +1 -1
- package/app-layout/index.js +4 -5
- package/app-layout/index.js.map +1 -1
- package/app-layout/utils/use-content-width.js +1 -1
- package/app-layout/utils/use-content-width.js.map +1 -1
- package/app-layout/utils/use-observed-element.js +1 -1
- package/app-layout/utils/use-observed-element.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +69 -69
- package/app-layout/visual-refresh/styles.scoped.css +169 -169
- package/app-layout/visual-refresh/styles.selectors.js +69 -69
- package/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/area-chart/model/use-chart-model.js +2 -2
- package/area-chart/model/use-chart-model.js.map +1 -1
- package/area-chart/styles.css.js +6 -6
- package/area-chart/styles.scoped.css +10 -10
- package/area-chart/styles.selectors.js +6 -6
- package/attribute-editor/styles.css.js +14 -14
- package/attribute-editor/styles.scoped.css +25 -25
- package/attribute-editor/styles.selectors.js +14 -14
- package/button-dropdown/category-elements/styles.css.js +13 -13
- package/button-dropdown/category-elements/styles.scoped.css +27 -27
- package/button-dropdown/category-elements/styles.selectors.js +13 -13
- package/button-dropdown/item-element/styles.css.js +15 -15
- package/button-dropdown/item-element/styles.scoped.css +19 -19
- package/button-dropdown/item-element/styles.selectors.js +15 -15
- package/button-dropdown/styles.css.js +14 -14
- package/button-dropdown/styles.scoped.css +22 -22
- package/button-dropdown/styles.selectors.js +14 -14
- package/code-editor/listeners.js +2 -2
- package/code-editor/listeners.js.map +1 -1
- package/code-editor/resizable-box/index.js +2 -2
- package/code-editor/resizable-box/index.js.map +1 -1
- package/code-editor/styles.css.js +32 -32
- package/code-editor/styles.scoped.css +130 -130
- package/code-editor/styles.selectors.js +32 -32
- package/collection-preferences/content-display/styles.css.js +11 -11
- package/collection-preferences/content-display/styles.scoped.css +18 -18
- package/collection-preferences/content-display/styles.selectors.js +11 -11
- package/collection-preferences/styles.css.js +37 -37
- package/collection-preferences/styles.scoped.css +47 -47
- package/collection-preferences/styles.selectors.js +37 -37
- package/column-layout/flexible-column-layout/styles.css.js +5 -5
- package/column-layout/flexible-column-layout/styles.scoped.css +5 -5
- package/column-layout/flexible-column-layout/styles.selectors.js +5 -5
- package/column-layout/styles.css.js +13 -13
- package/column-layout/styles.scoped.css +46 -46
- package/column-layout/styles.selectors.js +13 -13
- package/container/styles.css.js +28 -28
- package/container/styles.scoped.css +55 -55
- package/container/styles.selectors.js +28 -28
- package/date-range-picker/styles.css.js +38 -38
- package/date-range-picker/styles.scoped.css +47 -47
- package/date-range-picker/styles.selectors.js +38 -38
- package/expandable-section/styles.css.js +29 -29
- package/expandable-section/styles.scoped.css +66 -66
- package/expandable-section/styles.selectors.js +29 -29
- package/form-field/styles.css.js +19 -19
- package/form-field/styles.scoped.css +30 -30
- package/form-field/styles.selectors.js +19 -19
- package/help-panel/styles.css.js +4 -4
- package/help-panel/styles.scoped.css +66 -66
- package/help-panel/styles.selectors.js +4 -4
- package/internal/base-component/styles.scoped.css +81 -57
- package/internal/components/dark-ribbon/index.js +2 -2
- package/internal/components/dark-ribbon/index.js.map +1 -1
- package/internal/components/dropdown-footer/styles.css.js +3 -3
- package/internal/components/dropdown-footer/styles.scoped.css +4 -4
- package/internal/components/dropdown-footer/styles.selectors.js +3 -3
- package/internal/components/options-list/index.d.ts.map +1 -1
- package/internal/components/options-list/index.js +2 -2
- package/internal/components/options-list/index.js.map +1 -1
- package/internal/components/selectable-item/styles.css.js +16 -16
- package/internal/components/selectable-item/styles.scoped.css +31 -31
- package/internal/components/selectable-item/styles.selectors.js +16 -16
- package/internal/components/token-list/styles.css.js +9 -9
- package/internal/components/token-list/styles.scoped.css +22 -22
- package/internal/components/token-list/styles.selectors.js +9 -9
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.js +1 -1
- package/internal/generated/theming/index.cjs +25 -23
- package/internal/generated/theming/index.js +25 -23
- package/internal/hooks/container-queries/index.d.ts +0 -1
- package/internal/hooks/container-queries/index.d.ts.map +1 -1
- package/internal/hooks/container-queries/index.js +0 -1
- package/internal/hooks/container-queries/index.js.map +1 -1
- package/internal/hooks/container-queries/use-height-measure.js +1 -1
- package/internal/hooks/container-queries/use-height-measure.js.map +1 -1
- package/internal/hooks/use-dynamic-overlap/index.js +1 -1
- package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
- package/internal/hooks/use-mobile/index.js +1 -1
- package/internal/hooks/use-mobile/index.js.map +1 -1
- package/internal/hooks/use-mouse-down-target.js +1 -1
- package/internal/hooks/use-mouse-down-target.js.map +1 -1
- package/internal/hooks/use-mutation-observer/index.d.ts.map +1 -1
- package/internal/hooks/use-mutation-observer/index.js +2 -3
- package/internal/hooks/use-mutation-observer/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/modal/styles.css.js +23 -23
- package/modal/styles.scoped.css +39 -39
- package/modal/styles.selectors.js +23 -23
- package/package.json +1 -1
- package/pie-chart/labels.js +1 -1
- package/pie-chart/labels.js.map +1 -1
- package/pie-chart/styles.css.js +27 -27
- package/pie-chart/styles.scoped.css +43 -43
- package/pie-chart/styles.selectors.js +27 -27
- package/popover/container.d.ts.map +1 -1
- package/popover/container.js +1 -1
- package/popover/container.js.map +1 -1
- package/property-filter/styles.css.js +29 -29
- package/property-filter/styles.scoped.css +33 -33
- package/property-filter/styles.selectors.js +29 -29
- package/s3-resource-selector/s3-in-context/styles.css.js +7 -7
- package/s3-resource-selector/s3-in-context/styles.scoped.css +10 -10
- package/s3-resource-selector/s3-in-context/styles.selectors.js +7 -7
- package/s3-resource-selector/s3-in-context/use-versions-fetch.d.ts.map +1 -1
- package/s3-resource-selector/s3-in-context/use-versions-fetch.js +2 -2
- package/s3-resource-selector/s3-in-context/use-versions-fetch.js.map +1 -1
- package/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/basic-table.js +2 -2
- package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
- package/side-navigation/styles.css.js +28 -28
- package/side-navigation/styles.scoped.css +43 -43
- package/side-navigation/styles.selectors.js +28 -28
- package/split-panel/bottom.js +1 -1
- package/split-panel/bottom.js.map +1 -1
- package/split-panel/styles.css.js +56 -56
- package/split-panel/styles.scoped.css +85 -85
- package/split-panel/styles.selectors.js +56 -56
- package/table/body-cell/click-away.js +2 -2
- package/table/body-cell/click-away.js.map +1 -1
- package/table/body-cell/styles.css.js +28 -28
- package/table/body-cell/styles.scoped.css +76 -76
- package/table/body-cell/styles.selectors.js +28 -28
- package/table/header-cell/styles.css.js +24 -24
- package/table/header-cell/styles.scoped.css +43 -43
- package/table/header-cell/styles.selectors.js +24 -24
- package/table/resizer/index.js +3 -3
- package/table/resizer/index.js.map +1 -1
- package/table/sticky-columns/use-sticky-columns.d.ts.map +1 -1
- package/table/sticky-columns/use-sticky-columns.js +2 -3
- package/table/sticky-columns/use-sticky-columns.js.map +1 -1
- package/table/sticky-scrollbar/styles.css.js +6 -6
- package/table/sticky-scrollbar/styles.scoped.css +9 -9
- package/table/sticky-scrollbar/styles.selectors.js +6 -6
- package/table/styles.css.js +34 -34
- package/table/styles.scoped.css +42 -42
- package/table/styles.selectors.js +34 -34
- package/table/use-sticky-header.js +1 -1
- package/table/use-sticky-header.js.map +1 -1
- package/tabs/styles.css.js +21 -21
- package/tabs/styles.scoped.css +46 -46
- package/tabs/styles.selectors.js +21 -21
- package/tag-editor/index.d.ts.map +1 -1
- package/tag-editor/index.js +6 -6
- package/tag-editor/index.js.map +1 -1
- package/tiles/styles.css.js +29 -29
- package/tiles/styles.scoped.css +73 -73
- package/tiles/styles.selectors.js +29 -29
- package/top-navigation/1.0-beta/styles.css.js +25 -25
- package/top-navigation/1.0-beta/styles.scoped.css +43 -43
- package/top-navigation/1.0-beta/styles.selectors.js +25 -25
- package/top-navigation/styles.css.js +47 -47
- package/top-navigation/styles.scoped.css +73 -73
- package/top-navigation/styles.selectors.js +47 -47
- package/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
- package/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +23 -23
- package/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
- 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
- package/wizard/styles.css.js +31 -31
- package/wizard/styles.scoped.css +63 -63
- package/wizard/styles.selectors.js +31 -31
- package/internal/hooks/container-queries/use-resize-observer.d.ts +0 -21
- package/internal/hooks/container-queries/use-resize-observer.d.ts.map +0 -1
- package/internal/hooks/container-queries/use-resize-observer.js +0 -54
- package/internal/hooks/container-queries/use-resize-observer.js.map +0 -1
- package/internal/hooks/container-queries/utils.d.ts +0 -4
- package/internal/hooks/container-queries/utils.d.ts.map +0 -1
- package/internal/hooks/container-queries/utils.js +0 -10
- package/internal/hooks/container-queries/utils.js.map +0 -1
- package/internal/hooks/use-singleton-handler/index.d.ts +0 -11
- package/internal/hooks/use-singleton-handler/index.d.ts.map +0 -1
- package/internal/hooks/use-singleton-handler/index.js +0 -45
- package/internal/hooks/use-singleton-handler/index.js.map +0 -1
- package/internal/hooks/use-stable-event-handler/index.d.ts +0 -10
- package/internal/hooks/use-stable-event-handler/index.d.ts.map +0 -1
- package/internal/hooks/use-stable-event-handler/index.js +0 -19
- package/internal/hooks/use-stable-event-handler/index.js.map +0 -1
|
@@ -2,74 +2,74 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"background": "
|
|
6
|
-
"scrolling-background": "awsui_scrolling-
|
|
7
|
-
"sticky-background": "awsui_sticky-
|
|
8
|
-
"has-sticky-notifications": "awsui_has-sticky-
|
|
9
|
-
"breadcrumbs": "
|
|
10
|
-
"has-sticky-background": "awsui_has-sticky-
|
|
11
|
-
"drawers-container": "awsui_drawers-
|
|
12
|
-
"has-open-drawer": "awsui_has-open-
|
|
13
|
-
"disable-body-scroll": "awsui_disable-body-
|
|
14
|
-
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-
|
|
15
|
-
"has-multiple-triggers": "awsui_has-multiple-
|
|
16
|
-
"drawers-trigger-content": "awsui_drawers-trigger-
|
|
17
|
-
"drawers-trigger": "awsui_drawers-
|
|
18
|
-
"drawer": "
|
|
19
|
-
"drawer-close-button": "awsui_drawer-close-
|
|
20
|
-
"drawer-content": "awsui_drawer-
|
|
21
|
-
"drawer-slider": "awsui_drawer-
|
|
22
|
-
"is-drawer-open": "awsui_is-drawer-
|
|
23
|
-
"content": "
|
|
24
|
-
"layout": "
|
|
25
|
-
"has-max-content-width": "awsui_has-max-content-
|
|
26
|
-
"content-type-dashboard": "awsui_content-type-
|
|
27
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
28
|
-
"has-content-gap-left": "awsui_has-content-gap-
|
|
29
|
-
"has-content-gap-right": "awsui_has-content-gap-
|
|
30
|
-
"content-first-child-notifications": "awsui_content-first-child-
|
|
31
|
-
"has-breadcrumbs": "awsui_has-
|
|
32
|
-
"content-first-child-header": "awsui_content-first-child-
|
|
33
|
-
"has-header": "awsui_has-
|
|
34
|
-
"content-first-child-main": "awsui_content-first-child-
|
|
35
|
-
"disable-content-paddings": "awsui_disable-content-
|
|
36
|
-
"has-split-panel": "awsui_has-split-
|
|
37
|
-
"split-panel-position-bottom": "awsui_split-panel-position-
|
|
38
|
-
"block-body-scroll": "awsui_block-body-
|
|
39
|
-
"unfocusable": "
|
|
40
|
-
"container": "
|
|
41
|
-
"is-navigation-open": "awsui_is-navigation-
|
|
42
|
-
"is-tools-open": "awsui_is-tools-
|
|
43
|
-
"is-split-panel-open": "awsui_is-split-panel-
|
|
44
|
-
"split-panel-position-side": "awsui_split-panel-position-
|
|
45
|
-
"mobile-toolbar": "awsui_mobile-
|
|
46
|
-
"mobile-toolbar-nav": "awsui_mobile-toolbar-
|
|
47
|
-
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-
|
|
48
|
-
"mobile-toolbar-tools": "awsui_mobile-toolbar-
|
|
49
|
-
"navigation-container": "awsui_navigation-
|
|
50
|
-
"show-navigation": "awsui_show-
|
|
51
|
-
"animating": "
|
|
52
|
-
"showButtons": "
|
|
53
|
-
"navigation": "
|
|
54
|
-
"openNavigation": "
|
|
55
|
-
"animated-content": "awsui_animated-
|
|
56
|
-
"hide-navigation": "awsui_hide-
|
|
57
|
-
"notifications": "
|
|
58
|
-
"sticky-notifications": "awsui_sticky-
|
|
59
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
60
|
-
"position-bottom": "awsui_position-
|
|
61
|
-
"openSplitPanelBottom": "
|
|
62
|
-
"split-panel-side": "awsui_split-panel-
|
|
63
|
-
"position-side": "awsui_position-
|
|
64
|
-
"openSplitPanelSide": "
|
|
65
|
-
"tools-container": "awsui_tools-
|
|
66
|
-
"tools": "
|
|
67
|
-
"openTools": "
|
|
68
|
-
"has-tools-form-persistence": "awsui_has-tools-form-
|
|
69
|
-
"hide-tools": "awsui_hide-
|
|
70
|
-
"show-tools": "awsui_show-
|
|
71
|
-
"has-tools-form": "awsui_has-tools-
|
|
72
|
-
"trigger": "
|
|
73
|
-
"selected": "
|
|
5
|
+
"background": "awsui_background_hyvsj_li5wi_93",
|
|
6
|
+
"scrolling-background": "awsui_scrolling-background_hyvsj_li5wi_96",
|
|
7
|
+
"sticky-background": "awsui_sticky-background_hyvsj_li5wi_102",
|
|
8
|
+
"has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_li5wi_110",
|
|
9
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_li5wi_123",
|
|
10
|
+
"has-sticky-background": "awsui_has-sticky-background_hyvsj_li5wi_133",
|
|
11
|
+
"drawers-container": "awsui_drawers-container_hyvsj_li5wi_145",
|
|
12
|
+
"has-open-drawer": "awsui_has-open-drawer_hyvsj_li5wi_157",
|
|
13
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_li5wi_191",
|
|
14
|
+
"drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_li5wi_196",
|
|
15
|
+
"has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_li5wi_215",
|
|
16
|
+
"drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_li5wi_247",
|
|
17
|
+
"drawers-trigger": "awsui_drawers-trigger_hyvsj_li5wi_247",
|
|
18
|
+
"drawer": "awsui_drawer_hyvsj_li5wi_145",
|
|
19
|
+
"drawer-close-button": "awsui_drawer-close-button_hyvsj_li5wi_297",
|
|
20
|
+
"drawer-content": "awsui_drawer-content_hyvsj_li5wi_302",
|
|
21
|
+
"drawer-slider": "awsui_drawer-slider_hyvsj_li5wi_307",
|
|
22
|
+
"is-drawer-open": "awsui_is-drawer-open_hyvsj_li5wi_314",
|
|
23
|
+
"content": "awsui_content_hyvsj_li5wi_339",
|
|
24
|
+
"layout": "awsui_layout_hyvsj_li5wi_360",
|
|
25
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_li5wi_443",
|
|
26
|
+
"content-type-dashboard": "awsui_content-type-dashboard_hyvsj_li5wi_458",
|
|
27
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_li5wi_475",
|
|
28
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_li5wi_507",
|
|
29
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_li5wi_510",
|
|
30
|
+
"content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_li5wi_520",
|
|
31
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_li5wi_523",
|
|
32
|
+
"content-first-child-header": "awsui_content-first-child-header_hyvsj_li5wi_526",
|
|
33
|
+
"has-header": "awsui_has-header_hyvsj_li5wi_526",
|
|
34
|
+
"content-first-child-main": "awsui_content-first-child-main_hyvsj_li5wi_547",
|
|
35
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_li5wi_547",
|
|
36
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_li5wi_590",
|
|
37
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_li5wi_590",
|
|
38
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_li5wi_606",
|
|
39
|
+
"unfocusable": "awsui_unfocusable_hyvsj_li5wi_611",
|
|
40
|
+
"container": "awsui_container_hyvsj_li5wi_621",
|
|
41
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_li5wi_646",
|
|
42
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_li5wi_649",
|
|
43
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_li5wi_649",
|
|
44
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_li5wi_649",
|
|
45
|
+
"mobile-toolbar": "awsui_mobile-toolbar_hyvsj_li5wi_658",
|
|
46
|
+
"mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_li5wi_674",
|
|
47
|
+
"mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_li5wi_678",
|
|
48
|
+
"mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_li5wi_682",
|
|
49
|
+
"navigation-container": "awsui_navigation-container_hyvsj_li5wi_691",
|
|
50
|
+
"show-navigation": "awsui_show-navigation_hyvsj_li5wi_735",
|
|
51
|
+
"animating": "awsui_animating_hyvsj_li5wi_757",
|
|
52
|
+
"showButtons": "awsui_showButtons_hyvsj_li5wi_1",
|
|
53
|
+
"navigation": "awsui_navigation_hyvsj_li5wi_691",
|
|
54
|
+
"openNavigation": "awsui_openNavigation_hyvsj_li5wi_1",
|
|
55
|
+
"animated-content": "awsui_animated-content_hyvsj_li5wi_819",
|
|
56
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_li5wi_828",
|
|
57
|
+
"notifications": "awsui_notifications_hyvsj_li5wi_838",
|
|
58
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_li5wi_844",
|
|
59
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_li5wi_861",
|
|
60
|
+
"position-bottom": "awsui_position-bottom_hyvsj_li5wi_907",
|
|
61
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_li5wi_1",
|
|
62
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_li5wi_936",
|
|
63
|
+
"position-side": "awsui_position-side_hyvsj_li5wi_964",
|
|
64
|
+
"openSplitPanelSide": "awsui_openSplitPanelSide_hyvsj_li5wi_1",
|
|
65
|
+
"tools-container": "awsui_tools-container_hyvsj_li5wi_1001",
|
|
66
|
+
"tools": "awsui_tools_hyvsj_li5wi_1001",
|
|
67
|
+
"openTools": "awsui_openTools_hyvsj_li5wi_1",
|
|
68
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_li5wi_1096",
|
|
69
|
+
"hide-tools": "awsui_hide-tools_hyvsj_li5wi_1106",
|
|
70
|
+
"show-tools": "awsui_show-tools_hyvsj_li5wi_1118",
|
|
71
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_li5wi_1096",
|
|
72
|
+
"trigger": "awsui_trigger_hyvsj_li5wi_1183",
|
|
73
|
+
"selected": "awsui_selected_hyvsj_li5wi_1222"
|
|
74
74
|
};
|
|
75
75
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chart-model.d.ts","sourceRoot":"lib/default/","sources":["area-chart/model/use-chart-model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAc,EAA8B,SAAS,EAAc,MAAM,OAAO,CAAC;AAKjF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,U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EACxE,SAAS,EACT,cAAc,EAAE,SAAS,EACzB,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,MAAM,EAAE,cAAc,EACtB,KAAK,EACL,UAAU,GACX,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CA2TvC"}
|
|
@@ -5,10 +5,10 @@ import { KeyCode } from '../../internal/keycode';
|
|
|
5
5
|
import computeChartProps from './compute-chart-props';
|
|
6
6
|
import createSeriesDecorator from './create-series-decorator';
|
|
7
7
|
import InteractionsStore from './interactions-store';
|
|
8
|
-
import { useStableEventHandler } from '../../internal/hooks/use-stable-event-handler';
|
|
9
8
|
import { throttle } from '../../internal/utils/throttle';
|
|
10
9
|
import { useReaction } from '../async-store';
|
|
11
10
|
import { useHeightMeasure } from '../../internal/hooks/container-queries/use-height-measure';
|
|
11
|
+
import { useStableCallback } from '@cloudscape-design/component-toolkit/internal';
|
|
12
12
|
const MAX_HOVER_MARGIN = 6;
|
|
13
13
|
const SVG_HOVER_THROTTLE = 25;
|
|
14
14
|
const POPOVER_DEADZONE = 12;
|
|
@@ -22,7 +22,7 @@ export default function useChartModel({ fitHeight, externalSeries: allSeries, vi
|
|
|
22
22
|
const plotMeasureRef = useRef(null);
|
|
23
23
|
const hasVisibleSeries = series.length > 0;
|
|
24
24
|
const height = (_a = useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries])) !== null && _a !== void 0 ? _a : explicitHeight;
|
|
25
|
-
const stableSetVisibleSeries =
|
|
25
|
+
const stableSetVisibleSeries = useStableCallback(setVisibleSeries);
|
|
26
26
|
const model = useMemo(() => {
|
|
27
27
|
// Compute scales, ticks and two-dimensional plots.
|
|
28
28
|
const computed = computeChartProps({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chart-model.js","sourceRoot":"lib/default/","sources":["area-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AAK,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IAExF,uEAAuE;IACvE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE;YACpE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;SACvD;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE/B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AreaChartProps } from '../interfaces';\nimport React, { useEffect, useMemo, useRef, RefObject, MouseEvent } from 'react';\nimport { findClosest, circleIndex } from './utils';\n\nimport { nodeContains } from '../../internal/utils/dom';\nimport { KeyCode } from '../../internal/keycode';\nimport { XDomain, XScaleType, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport computeChartProps from './compute-chart-props';\nimport createSeriesDecorator from './create-series-decorator';\nimport InteractionsStore from './interactions-store';\nimport { useStableEventHandler } from '../../internal/hooks/use-stable-event-handler';\nimport { ChartModel } from './index';\nimport { ChartPlotRef } from '../../internal/components/chart-plot';\nimport { throttle } from '../../internal/utils/throttle';\nimport { useReaction } from '../async-store';\nimport { useHeightMeasure } from '../../internal/hooks/container-queries/use-height-measure';\n\nconst MAX_HOVER_MARGIN = 6;\nconst SVG_HOVER_THROTTLE = 25;\nconst POPOVER_DEADZONE = 12;\n\nexport interface UseChartModelProps<T extends AreaChartProps.DataTypes> {\n fitHeight?: boolean;\n externalSeries: readonly AreaChartProps.Series<T>[];\n visibleSeries: readonly AreaChartProps.Series<T>[];\n setVisibleSeries: (series: readonly AreaChartProps.Series<T>[]) => void;\n highlightedSeries: null | AreaChartProps.Series<T>;\n setHighlightedSeries: (series: null | AreaChartProps.Series<T>) => void;\n xDomain?: XDomain<T>;\n yDomain?: YDomain;\n xScaleType: XScaleType;\n yScaleType: YScaleType;\n height: number;\n width: number;\n popoverRef: RefObject<HTMLElement>;\n}\n\n// Represents the core the chart logic, including the model of all allowed user interactions.\nexport default function useChartModel<T extends AreaChartProps.DataTypes>({\n fitHeight,\n externalSeries: allSeries,\n visibleSeries: series,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height: explicitHeight,\n width,\n popoverRef,\n}: UseChartModelProps<T>): ChartModel<T> {\n // Chart elements refs used in handlers.\n const plotRef = useRef<ChartPlotRef>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const hasVisibleSeries = series.length > 0;\n const height = useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries]) ?? explicitHeight;\n\n const stableSetVisibleSeries = useStableEventHandler(setVisibleSeries);\n\n const model = useMemo(() => {\n // Compute scales, ticks and two-dimensional plots.\n const computed = computeChartProps({\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n });\n\n // A store for chart interactions that don't require plot recomputation.\n const interactions = new InteractionsStore(series, computed.plot);\n\n const containsMultipleSeries = interactions.series.length > 1;\n\n // A series decorator to provide extra props such as color and marker type.\n const getInternalSeries = createSeriesDecorator(allSeries);\n\n const isMouseOverPopover = (clientX: number, clientY: number) => {\n if (popoverRef.current?.firstChild) {\n const popoverPosition = (popoverRef.current.firstChild as HTMLElement).getBoundingClientRect();\n if (\n clientX > popoverPosition.x - POPOVER_DEADZONE &&\n clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE &&\n clientY > popoverPosition.y - POPOVER_DEADZONE &&\n clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE\n ) {\n return true;\n }\n }\n return false;\n };\n\n // A Callback for svg mouseover to hover the plot points.\n // Throttling is necessary for a substantially smoother customer experience.\n const onSVGMouseMoveThrottled = throttle((clientX: number, clientY: number) => {\n // No hover logic when the popover is pinned or no data available.\n if (\n interactions.get().isPopoverPinned ||\n !plotRef.current ||\n interactions.plot.xy.length === 0 ||\n isMouseOverPopover(clientX, clientY)\n ) {\n return;\n }\n\n const svgRect = plotRef.current.svg.getBoundingClientRect();\n const offsetX = clientX - svgRect.left;\n const offsetY = clientY - svgRect.top;\n\n const closestX = findClosest(interactions.plot.xy, offsetX, xPoints => xPoints[0].scaled.x);\n const closestPoint = findClosest(closestX, offsetY, point => point.scaled.y1);\n\n // If close enough to the point - highlight the point and its column.\n // If not - only highlight the closest column.\n if (\n Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN &&\n Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN\n ) {\n interactions.highlightPoint(closestPoint);\n } else {\n interactions.highlightX(closestX);\n }\n }, SVG_HOVER_THROTTLE);\n\n const onSVGMouseMove = ({ clientX, clientY }: React.MouseEvent<SVGElement>) =>\n onSVGMouseMoveThrottled(clientX, clientY);\n\n // A callback for svg mouseout to clear all highlights.\n const onSVGMouseOut = (event: React.MouseEvent<SVGElement>) => {\n // Because the mouseover is throttled, in can occur slightly after the mouseout,\n // neglecting its effect; cancelling the throttled function prevents that.\n onSVGMouseMoveThrottled.cancel();\n\n // No hover logic when the popover is pinned or mouse is over popover\n if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) {\n return;\n }\n\n // Check if the target is contained within svg to allow hovering on the popover body.\n if (!nodeContains(plotRef.current!.svg, event.relatedTarget as Element)) {\n interactions.clearHighlightedLegend();\n interactions.clearHighlight();\n }\n };\n\n // A callback for svg click to pin/unpin the popover.\n const onSVGMouseDown = (event: React.MouseEvent<SVGSVGElement>) => {\n interactions.togglePopoverPin();\n event.preventDefault();\n };\n\n const moveWithinXAxis = (direction: -1 | 1) => {\n if (interactions.get().highlightedPoint) {\n return moveWithinSeries(direction);\n } else if (containsMultipleSeries) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const currentXIndex = highlightedX[0].index.x;\n const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]);\n interactions.highlightX(interactions.plot.xy[nextXIndex]);\n }\n }\n };\n\n // A helper function to highlight the next or previous point within selected series.\n const moveWithinSeries = (direction: -1 | 1) => {\n // Can only use motion when a particular point is highlighted.\n const point = interactions.get().highlightedPoint;\n if (!point) {\n return;\n }\n\n // Take the index of the currently highlighted series.\n const sIndex = point.index.s;\n // Take the incremented(circularly) x-index of the currently highlighted point.\n const xIndex = circleIndex(point.index.x + direction, [0, interactions.plot.xs.length - 1]);\n // Highlight the next point using x:s grouped data.\n interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]);\n };\n\n // A helper function to highlight the next or previous point within the selected column.\n const moveBetweenSeries = (direction: -1 | 1) => {\n const point = interactions.get().highlightedPoint;\n if (!point) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const xIndex = highlightedX[0].index.x;\n const points = interactions.plot.xy[xIndex];\n const yIndex = direction === 1 ? 0 : points.length - 1;\n interactions.highlightPoint(points[yIndex]);\n }\n return;\n }\n\n // Take the index of the currently highlighted column.\n const xIndex = point.index.x;\n const currentYIndex = point.index.y;\n\n if (\n containsMultipleSeries &&\n ((currentYIndex === 0 && direction === -1) ||\n (currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1))\n ) {\n interactions.highlightX(interactions.plot.xy[xIndex]);\n } else {\n // Take the incremented(circularly) y-index of the currently highlighted point.\n const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]);\n // Highlight the next point using x:y grouped data.\n interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]);\n }\n };\n\n // A callback for svg keydown to enable motions and popover pin with the keyboard.\n const onSVGKeyDown = (event: React.KeyboardEvent) => {\n const keyCode = event.keyCode;\n if (\n keyCode !== KeyCode.up &&\n keyCode !== KeyCode.right &&\n keyCode !== KeyCode.down &&\n keyCode !== KeyCode.left &&\n keyCode !== KeyCode.space &&\n keyCode !== KeyCode.enter\n ) {\n return;\n }\n\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n // No keydown logic when the popover is pinned.\n if (interactions.get().isPopoverPinned) {\n return;\n }\n\n // Move up/down.\n if (keyCode === KeyCode.down || keyCode === KeyCode.up) {\n moveBetweenSeries(keyCode === KeyCode.down ? -1 : 1);\n }\n // Move left/right.\n else if (keyCode === KeyCode.left || keyCode === KeyCode.right) {\n moveWithinXAxis(keyCode === KeyCode.right ? 1 : -1);\n }\n // Pin popover.\n else if (keyCode === KeyCode.enter || keyCode === KeyCode.space) {\n interactions.pinPopover();\n }\n };\n\n const highlightFirstX = () => {\n interactions.highlightX(interactions.plot.xy[0]);\n };\n\n // A callback for svg focus to highlight series.\n const onSVGFocus = (_event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n // When focus is caused by a click event nothing is expected as clicks are handled separately.\n if (trigger === 'keyboard') {\n const { highlightedX, highlightedPoint, highlightedSeries, legendSeries } = interactions.get();\n if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries && !legendSeries) {\n highlightFirstX();\n } else if (!highlightedX) {\n interactions.highlightFirstPoint();\n }\n }\n };\n\n // A callback for svg blur to clear all highlights unless the popover is pinned.\n const onSVGBlur = () => {\n // Pinned popover stays pinned even if the focus is lost.\n // If blur is not caused by the popover, forget the previously highlighted point.\n if (!interactions.get().isPopoverPinned) {\n interactions.clearHighlight();\n }\n };\n\n const onFilterSeries = (series: readonly AreaChartProps.Series<T>[]) => {\n stableSetVisibleSeries(series);\n };\n\n const onLegendHighlight = (series: null | AreaChartProps.Series<T>) => {\n interactions.highlightSeries(series);\n };\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n interactions.unpinPopover();\n\n // Return focus back to the application or plot (when no point is highlighted).\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n if (interactions.get().highlightedPoint || interactions.get().highlightedX) {\n plotRef.current!.focusApplication();\n } else {\n interactions.clearHighlight();\n plotRef.current!.focusPlot();\n }\n }, 0);\n }\n };\n\n const onContainerBlur = () => {\n interactions.clearState();\n };\n\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n }\n };\n\n const onPopoverLeave = (event: MouseEvent) => {\n if (plotRef.current!.svg.contains(event.relatedTarget as Node) || interactions.get().isPopoverPinned) {\n return;\n }\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n };\n return {\n width,\n height,\n series,\n allSeries,\n getInternalSeries,\n computed,\n interactions,\n handlers: {\n onSVGMouseMove,\n onSVGMouseOut,\n onSVGMouseDown,\n onSVGKeyDown,\n onSVGFocus,\n onSVGBlur,\n onFilterSeries,\n onLegendHighlight,\n onPopoverDismiss,\n onContainerBlur,\n onDocumentKeyDown,\n onPopoverLeave,\n },\n refs: {\n plot: plotRef,\n plotMeasure: plotMeasureRef,\n container: containerRef,\n verticalMarker: verticalMarkerRef,\n popoverRef,\n },\n };\n }, [allSeries, series, xDomain, yDomain, xScaleType, yScaleType, height, width, stableSetVisibleSeries, popoverRef]);\n\n // Notify client when series highlight change.\n useReaction(model.interactions, state => state.highlightedSeries, setHighlightedSeries);\n\n // Update interactions store when series highlight in a controlled way.\n useEffect(() => {\n if (highlightedSeries !== model.interactions.get().highlightedSeries) {\n model.interactions.highlightSeries(highlightedSeries);\n }\n }, [model, highlightedSeries]);\n\n return model;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-chart-model.js","sourceRoot":"lib/default/","sources":["area-chart/model/use-chart-model.ts"],"names":[],"mappings":"AAGA,OAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAyB,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,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AAK,CAAC,YAAY,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;SACvD;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE/B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AreaChartProps } from '../interfaces';\nimport React, { useEffect, useMemo, useRef, RefObject, MouseEvent } from 'react';\nimport { findClosest, circleIndex } from './utils';\n\nimport { nodeContains } from '../../internal/utils/dom';\nimport { KeyCode } from '../../internal/keycode';\nimport { XDomain, XScaleType, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport computeChartProps from './compute-chart-props';\nimport createSeriesDecorator from './create-series-decorator';\nimport InteractionsStore from './interactions-store';\nimport { ChartModel } from './index';\nimport { ChartPlotRef } from '../../internal/components/chart-plot';\nimport { throttle } from '../../internal/utils/throttle';\nimport { useReaction } from '../async-store';\nimport { useHeightMeasure } from '../../internal/hooks/container-queries/use-height-measure';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nconst MAX_HOVER_MARGIN = 6;\nconst SVG_HOVER_THROTTLE = 25;\nconst POPOVER_DEADZONE = 12;\n\nexport interface UseChartModelProps<T extends AreaChartProps.DataTypes> {\n fitHeight?: boolean;\n externalSeries: readonly AreaChartProps.Series<T>[];\n visibleSeries: readonly AreaChartProps.Series<T>[];\n setVisibleSeries: (series: readonly AreaChartProps.Series<T>[]) => void;\n highlightedSeries: null | AreaChartProps.Series<T>;\n setHighlightedSeries: (series: null | AreaChartProps.Series<T>) => void;\n xDomain?: XDomain<T>;\n yDomain?: YDomain;\n xScaleType: XScaleType;\n yScaleType: YScaleType;\n height: number;\n width: number;\n popoverRef: RefObject<HTMLElement>;\n}\n\n// Represents the core the chart logic, including the model of all allowed user interactions.\nexport default function useChartModel<T extends AreaChartProps.DataTypes>({\n fitHeight,\n externalSeries: allSeries,\n visibleSeries: series,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height: explicitHeight,\n width,\n popoverRef,\n}: UseChartModelProps<T>): ChartModel<T> {\n // Chart elements refs used in handlers.\n const plotRef = useRef<ChartPlotRef>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const hasVisibleSeries = series.length > 0;\n const height = useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries]) ?? explicitHeight;\n\n const stableSetVisibleSeries = useStableCallback(setVisibleSeries);\n\n const model = useMemo(() => {\n // Compute scales, ticks and two-dimensional plots.\n const computed = computeChartProps({\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n });\n\n // A store for chart interactions that don't require plot recomputation.\n const interactions = new InteractionsStore(series, computed.plot);\n\n const containsMultipleSeries = interactions.series.length > 1;\n\n // A series decorator to provide extra props such as color and marker type.\n const getInternalSeries = createSeriesDecorator(allSeries);\n\n const isMouseOverPopover = (clientX: number, clientY: number) => {\n if (popoverRef.current?.firstChild) {\n const popoverPosition = (popoverRef.current.firstChild as HTMLElement).getBoundingClientRect();\n if (\n clientX > popoverPosition.x - POPOVER_DEADZONE &&\n clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE &&\n clientY > popoverPosition.y - POPOVER_DEADZONE &&\n clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE\n ) {\n return true;\n }\n }\n return false;\n };\n\n // A Callback for svg mouseover to hover the plot points.\n // Throttling is necessary for a substantially smoother customer experience.\n const onSVGMouseMoveThrottled = throttle((clientX: number, clientY: number) => {\n // No hover logic when the popover is pinned or no data available.\n if (\n interactions.get().isPopoverPinned ||\n !plotRef.current ||\n interactions.plot.xy.length === 0 ||\n isMouseOverPopover(clientX, clientY)\n ) {\n return;\n }\n\n const svgRect = plotRef.current.svg.getBoundingClientRect();\n const offsetX = clientX - svgRect.left;\n const offsetY = clientY - svgRect.top;\n\n const closestX = findClosest(interactions.plot.xy, offsetX, xPoints => xPoints[0].scaled.x);\n const closestPoint = findClosest(closestX, offsetY, point => point.scaled.y1);\n\n // If close enough to the point - highlight the point and its column.\n // If not - only highlight the closest column.\n if (\n Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN &&\n Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN\n ) {\n interactions.highlightPoint(closestPoint);\n } else {\n interactions.highlightX(closestX);\n }\n }, SVG_HOVER_THROTTLE);\n\n const onSVGMouseMove = ({ clientX, clientY }: React.MouseEvent<SVGElement>) =>\n onSVGMouseMoveThrottled(clientX, clientY);\n\n // A callback for svg mouseout to clear all highlights.\n const onSVGMouseOut = (event: React.MouseEvent<SVGElement>) => {\n // Because the mouseover is throttled, in can occur slightly after the mouseout,\n // neglecting its effect; cancelling the throttled function prevents that.\n onSVGMouseMoveThrottled.cancel();\n\n // No hover logic when the popover is pinned or mouse is over popover\n if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) {\n return;\n }\n\n // Check if the target is contained within svg to allow hovering on the popover body.\n if (!nodeContains(plotRef.current!.svg, event.relatedTarget as Element)) {\n interactions.clearHighlightedLegend();\n interactions.clearHighlight();\n }\n };\n\n // A callback for svg click to pin/unpin the popover.\n const onSVGMouseDown = (event: React.MouseEvent<SVGSVGElement>) => {\n interactions.togglePopoverPin();\n event.preventDefault();\n };\n\n const moveWithinXAxis = (direction: -1 | 1) => {\n if (interactions.get().highlightedPoint) {\n return moveWithinSeries(direction);\n } else if (containsMultipleSeries) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const currentXIndex = highlightedX[0].index.x;\n const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]);\n interactions.highlightX(interactions.plot.xy[nextXIndex]);\n }\n }\n };\n\n // A helper function to highlight the next or previous point within selected series.\n const moveWithinSeries = (direction: -1 | 1) => {\n // Can only use motion when a particular point is highlighted.\n const point = interactions.get().highlightedPoint;\n if (!point) {\n return;\n }\n\n // Take the index of the currently highlighted series.\n const sIndex = point.index.s;\n // Take the incremented(circularly) x-index of the currently highlighted point.\n const xIndex = circleIndex(point.index.x + direction, [0, interactions.plot.xs.length - 1]);\n // Highlight the next point using x:s grouped data.\n interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]);\n };\n\n // A helper function to highlight the next or previous point within the selected column.\n const moveBetweenSeries = (direction: -1 | 1) => {\n const point = interactions.get().highlightedPoint;\n if (!point) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const xIndex = highlightedX[0].index.x;\n const points = interactions.plot.xy[xIndex];\n const yIndex = direction === 1 ? 0 : points.length - 1;\n interactions.highlightPoint(points[yIndex]);\n }\n return;\n }\n\n // Take the index of the currently highlighted column.\n const xIndex = point.index.x;\n const currentYIndex = point.index.y;\n\n if (\n containsMultipleSeries &&\n ((currentYIndex === 0 && direction === -1) ||\n (currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1))\n ) {\n interactions.highlightX(interactions.plot.xy[xIndex]);\n } else {\n // Take the incremented(circularly) y-index of the currently highlighted point.\n const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]);\n // Highlight the next point using x:y grouped data.\n interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]);\n }\n };\n\n // A callback for svg keydown to enable motions and popover pin with the keyboard.\n const onSVGKeyDown = (event: React.KeyboardEvent) => {\n const keyCode = event.keyCode;\n if (\n keyCode !== KeyCode.up &&\n keyCode !== KeyCode.right &&\n keyCode !== KeyCode.down &&\n keyCode !== KeyCode.left &&\n keyCode !== KeyCode.space &&\n keyCode !== KeyCode.enter\n ) {\n return;\n }\n\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n // No keydown logic when the popover is pinned.\n if (interactions.get().isPopoverPinned) {\n return;\n }\n\n // Move up/down.\n if (keyCode === KeyCode.down || keyCode === KeyCode.up) {\n moveBetweenSeries(keyCode === KeyCode.down ? -1 : 1);\n }\n // Move left/right.\n else if (keyCode === KeyCode.left || keyCode === KeyCode.right) {\n moveWithinXAxis(keyCode === KeyCode.right ? 1 : -1);\n }\n // Pin popover.\n else if (keyCode === KeyCode.enter || keyCode === KeyCode.space) {\n interactions.pinPopover();\n }\n };\n\n const highlightFirstX = () => {\n interactions.highlightX(interactions.plot.xy[0]);\n };\n\n // A callback for svg focus to highlight series.\n const onSVGFocus = (_event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n // When focus is caused by a click event nothing is expected as clicks are handled separately.\n if (trigger === 'keyboard') {\n const { highlightedX, highlightedPoint, highlightedSeries, legendSeries } = interactions.get();\n if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries && !legendSeries) {\n highlightFirstX();\n } else if (!highlightedX) {\n interactions.highlightFirstPoint();\n }\n }\n };\n\n // A callback for svg blur to clear all highlights unless the popover is pinned.\n const onSVGBlur = () => {\n // Pinned popover stays pinned even if the focus is lost.\n // If blur is not caused by the popover, forget the previously highlighted point.\n if (!interactions.get().isPopoverPinned) {\n interactions.clearHighlight();\n }\n };\n\n const onFilterSeries = (series: readonly AreaChartProps.Series<T>[]) => {\n stableSetVisibleSeries(series);\n };\n\n const onLegendHighlight = (series: null | AreaChartProps.Series<T>) => {\n interactions.highlightSeries(series);\n };\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n interactions.unpinPopover();\n\n // Return focus back to the application or plot (when no point is highlighted).\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n if (interactions.get().highlightedPoint || interactions.get().highlightedX) {\n plotRef.current!.focusApplication();\n } else {\n interactions.clearHighlight();\n plotRef.current!.focusPlot();\n }\n }, 0);\n }\n };\n\n const onContainerBlur = () => {\n interactions.clearState();\n };\n\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n }\n };\n\n const onPopoverLeave = (event: MouseEvent) => {\n if (plotRef.current!.svg.contains(event.relatedTarget as Node) || interactions.get().isPopoverPinned) {\n return;\n }\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n };\n return {\n width,\n height,\n series,\n allSeries,\n getInternalSeries,\n computed,\n interactions,\n handlers: {\n onSVGMouseMove,\n onSVGMouseOut,\n onSVGMouseDown,\n onSVGKeyDown,\n onSVGFocus,\n onSVGBlur,\n onFilterSeries,\n onLegendHighlight,\n onPopoverDismiss,\n onContainerBlur,\n onDocumentKeyDown,\n onPopoverLeave,\n },\n refs: {\n plot: plotRef,\n plotMeasure: plotMeasureRef,\n container: containerRef,\n verticalMarker: verticalMarkerRef,\n popoverRef,\n },\n };\n }, [allSeries, series, xDomain, yDomain, xScaleType, yScaleType, height, width, stableSetVisibleSeries, popoverRef]);\n\n // Notify client when series highlight change.\n useReaction(model.interactions, state => state.highlightedSeries, setHighlightedSeries);\n\n // Update interactions store when series highlight in a controlled way.\n useEffect(() => {\n if (highlightedSeries !== model.interactions.get().highlightedSeries) {\n model.interactions.highlightSeries(highlightedSeries);\n }\n }, [model, highlightedSeries]);\n\n return model;\n}\n"]}
|
package/area-chart/styles.css.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"series": "
|
|
5
|
-
"root": "
|
|
6
|
-
"series--highlighted": "awsui_series--
|
|
7
|
-
"series--dimmed": "awsui_series--
|
|
8
|
-
"series--threshold": "awsui_series--
|
|
9
|
-
"popover-divider": "awsui_popover-
|
|
4
|
+
"series": "awsui_series_y1yrh_vg6ig_93",
|
|
5
|
+
"root": "awsui_root_y1yrh_vg6ig_111",
|
|
6
|
+
"series--highlighted": "awsui_series--highlighted_y1yrh_vg6ig_123",
|
|
7
|
+
"series--dimmed": "awsui_series--dimmed_y1yrh_vg6ig_127",
|
|
8
|
+
"series--threshold": "awsui_series--threshold_y1yrh_vg6ig_131",
|
|
9
|
+
"popover-divider": "awsui_popover-divider_y1yrh_vg6ig_136"
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -90,16 +90,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
93
|
+
.awsui_series_y1yrh_vg6ig_93 > rect:not(#\9) {
|
|
94
94
|
transition: opacity var(--motion-duration-transition-quick-6npj01, 90ms) var(--motion-easing-transition-quick-l9jfsx, linear);
|
|
95
95
|
}
|
|
96
96
|
@media (prefers-reduced-motion: reduce) {
|
|
97
|
-
.
|
|
97
|
+
.awsui_series_y1yrh_vg6ig_93 > rect:not(#\9) {
|
|
98
98
|
animation: none;
|
|
99
99
|
transition: none;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
.awsui-motion-disabled .
|
|
102
|
+
.awsui-motion-disabled .awsui_series_y1yrh_vg6ig_93 > rect:not(#\9), .awsui-mode-entering .awsui_series_y1yrh_vg6ig_93 > rect:not(#\9) {
|
|
103
103
|
animation: none;
|
|
104
104
|
transition: none;
|
|
105
105
|
}
|
|
@@ -108,11 +108,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
108
108
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
109
109
|
SPDX-License-Identifier: Apache-2.0
|
|
110
110
|
*/
|
|
111
|
-
.
|
|
111
|
+
.awsui_root_y1yrh_vg6ig_111:not(#\9) {
|
|
112
112
|
/* used in test-utils */
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
.
|
|
115
|
+
.awsui_series_y1yrh_vg6ig_93:not(#\9) {
|
|
116
116
|
display: block;
|
|
117
117
|
stroke-width: var(--border-line-chart-width-9mzos2, 2px);
|
|
118
118
|
fill: none;
|
|
@@ -120,20 +120,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
120
120
|
stroke-linejoin: var(--border-line-chart-line-join-hdz0jf, round);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.awsui_series--
|
|
123
|
+
.awsui_series--highlighted_y1yrh_vg6ig_123:not(#\9) {
|
|
124
124
|
/* used in test-utils */
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.awsui_series--
|
|
127
|
+
.awsui_series--dimmed_y1yrh_vg6ig_127:not(#\9) {
|
|
128
128
|
opacity: 0.3;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
.awsui_series--
|
|
131
|
+
.awsui_series--threshold_y1yrh_vg6ig_131:not(#\9) {
|
|
132
132
|
stroke-dasharray: var(--border-line-chart-dash-array-k49cgz, 3 5);
|
|
133
133
|
stroke-width: var(--border-line-chart-width-9mzos2, 2px);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.awsui_popover-
|
|
136
|
+
.awsui_popover-divider_y1yrh_vg6ig_136:not(#\9) {
|
|
137
137
|
margin: var(--space-xxs-p8yyaw, 4px) 0;
|
|
138
|
-
border-bottom: var(--border-divider-section-width-
|
|
138
|
+
border-bottom: var(--border-divider-section-width-8a5uu9, 2px) solid var(--color-border-divider-default-et9j7s, #e9ebed);
|
|
139
139
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"series": "
|
|
6
|
-
"root": "
|
|
7
|
-
"series--highlighted": "awsui_series--
|
|
8
|
-
"series--dimmed": "awsui_series--
|
|
9
|
-
"series--threshold": "awsui_series--
|
|
10
|
-
"popover-divider": "awsui_popover-
|
|
5
|
+
"series": "awsui_series_y1yrh_vg6ig_93",
|
|
6
|
+
"root": "awsui_root_y1yrh_vg6ig_111",
|
|
7
|
+
"series--highlighted": "awsui_series--highlighted_y1yrh_vg6ig_123",
|
|
8
|
+
"series--dimmed": "awsui_series--dimmed_y1yrh_vg6ig_127",
|
|
9
|
+
"series--threshold": "awsui_series--threshold_y1yrh_vg6ig_131",
|
|
10
|
+
"popover-divider": "awsui_popover-divider_y1yrh_vg6ig_136"
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"empty-appear": "awsui_empty-
|
|
5
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
6
|
-
"root": "
|
|
7
|
-
"empty": "
|
|
8
|
-
"row": "
|
|
9
|
-
"row-control": "awsui_row-
|
|
10
|
-
"field": "
|
|
11
|
-
"add-button": "awsui_add-
|
|
12
|
-
"remove-button": "awsui_remove-
|
|
13
|
-
"button-container-haslabel": "awsui_button-container-
|
|
14
|
-
"button-container-nolabel": "awsui_button-container-
|
|
15
|
-
"divider": "
|
|
16
|
-
"additional-info": "awsui_additional-
|
|
17
|
-
"right-align": "awsui_right-
|
|
4
|
+
"empty-appear": "awsui_empty-appear_n4qlp_146r2_93",
|
|
5
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_146r2_1",
|
|
6
|
+
"root": "awsui_root_n4qlp_146r2_119",
|
|
7
|
+
"empty": "awsui_empty_n4qlp_146r2_93",
|
|
8
|
+
"row": "awsui_row_n4qlp_146r2_139",
|
|
9
|
+
"row-control": "awsui_row-control_n4qlp_146r2_143",
|
|
10
|
+
"field": "awsui_field_n4qlp_146r2_147",
|
|
11
|
+
"add-button": "awsui_add-button_n4qlp_146r2_151",
|
|
12
|
+
"remove-button": "awsui_remove-button_n4qlp_146r2_155",
|
|
13
|
+
"button-container-haslabel": "awsui_button-container-haslabel_n4qlp_146r2_159",
|
|
14
|
+
"button-container-nolabel": "awsui_button-container-nolabel_n4qlp_146r2_163",
|
|
15
|
+
"divider": "awsui_divider_n4qlp_146r2_167",
|
|
16
|
+
"additional-info": "awsui_additional-info_n4qlp_146r2_171",
|
|
17
|
+
"right-align": "awsui_right-align_n4qlp_146r2_217"
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -90,10 +90,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_empty-
|
|
94
|
-
animation: awsui_awsui-motion-fade-
|
|
93
|
+
.awsui_empty-appear_n4qlp_146r2_93:not(#\9) {
|
|
94
|
+
animation: awsui_awsui-motion-fade-in_n4qlp_146r2_1 var(--motion-duration-transition-show-paced-9s9l5z, 180ms) var(--motion-easing-transition-show-paced-eobwvi, ease-out);
|
|
95
95
|
}
|
|
96
|
-
@keyframes awsui_awsui-motion-fade-
|
|
96
|
+
@keyframes awsui_awsui-motion-fade-in_n4qlp_146r2_1 {
|
|
97
97
|
from {
|
|
98
98
|
opacity: 0.2;
|
|
99
99
|
}
|
|
@@ -102,12 +102,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
@media (prefers-reduced-motion: reduce) {
|
|
105
|
-
.awsui_empty-
|
|
105
|
+
.awsui_empty-appear_n4qlp_146r2_93:not(#\9) {
|
|
106
106
|
animation: none;
|
|
107
107
|
transition: none;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
.awsui-motion-disabled .awsui_empty-
|
|
110
|
+
.awsui-motion-disabled .awsui_empty-appear_n4qlp_146r2_93:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_146r2_93:not(#\9) {
|
|
111
111
|
animation: none;
|
|
112
112
|
transition: none;
|
|
113
113
|
}
|
|
@@ -116,7 +116,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
116
116
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
117
117
|
SPDX-License-Identifier: Apache-2.0
|
|
118
118
|
*/
|
|
119
|
-
.
|
|
119
|
+
.awsui_root_n4qlp_146r2_119:not(#\9) {
|
|
120
120
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
121
121
|
border-collapse: separate;
|
|
122
122
|
border-spacing: 0;
|
|
@@ -156,45 +156,45 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
156
156
|
display: block;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
.
|
|
159
|
+
.awsui_empty_n4qlp_146r2_93:not(#\9) {
|
|
160
160
|
font-size: var(--font-body-m-size-dhtyxm, 14px);
|
|
161
161
|
line-height: var(--font-body-m-line-height-5wv9x1, 20px);
|
|
162
162
|
color: var(--color-text-empty-2wfcyr, #5f6b7a);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
.
|
|
165
|
+
.awsui_row_n4qlp_146r2_139:not(#\9) {
|
|
166
166
|
/* used in test-utils */
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
.awsui_row-
|
|
169
|
+
.awsui_row-control_n4qlp_146r2_143:not(#\9) {
|
|
170
170
|
/* used in test-utils */
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
.
|
|
173
|
+
.awsui_field_n4qlp_146r2_147:not(#\9) {
|
|
174
174
|
/* used in test-utils */
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
.awsui_add-
|
|
177
|
+
.awsui_add-button_n4qlp_146r2_151:not(#\9) {
|
|
178
178
|
/* used in test-utils */
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.awsui_remove-
|
|
181
|
+
.awsui_remove-button_n4qlp_146r2_155:not(#\9) {
|
|
182
182
|
/* used in test-utils */
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
.awsui_button-container-
|
|
185
|
+
.awsui_button-container-haslabel_n4qlp_146r2_159:not(#\9) {
|
|
186
186
|
padding-top: calc(var(--space-xxs-p8yyaw, 4px) + var(--font-body-m-line-height-5wv9x1, 20px));
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
.awsui_button-container-
|
|
189
|
+
.awsui_button-container-nolabel_n4qlp_146r2_163:not(#\9) {
|
|
190
190
|
padding-top: var(--space-xxs-p8yyaw, 4px);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
.
|
|
194
|
-
border-bottom: var(--border-divider-section-width-
|
|
193
|
+
.awsui_divider_n4qlp_146r2_167:not(#\9) {
|
|
194
|
+
border-bottom: var(--border-divider-section-width-8a5uu9, 2px) solid var(--color-border-divider-default-et9j7s, #e9ebed);
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
.awsui_additional-
|
|
197
|
+
.awsui_additional-info_n4qlp_146r2_171:not(#\9) {
|
|
198
198
|
color: var(--color-text-form-secondary-dxc248, #5f6b7a);
|
|
199
199
|
font-size: var(--font-body-s-size-8339kg, 12px);
|
|
200
200
|
line-height: var(--font-body-s-line-height-uztvf6, 16px);
|
|
@@ -204,7 +204,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
204
204
|
margin-top: var(--space-xxs-p8yyaw, 4px);
|
|
205
205
|
/* stylelint-disable-next-line selector-max-type */
|
|
206
206
|
}
|
|
207
|
-
.awsui_additional-
|
|
207
|
+
.awsui_additional-info_n4qlp_146r2_171 > a:not(#\9) {
|
|
208
208
|
color: var(--color-text-link-default-latg1a, #0972d3);
|
|
209
209
|
font-weight: inherit;
|
|
210
210
|
letter-spacing: normal;
|
|
@@ -217,31 +217,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
217
217
|
transition-duration: var(--motion-duration-refresh-only-medium-nf6485, 165ms);
|
|
218
218
|
}
|
|
219
219
|
@media (prefers-reduced-motion: reduce) {
|
|
220
|
-
.awsui_additional-
|
|
220
|
+
.awsui_additional-info_n4qlp_146r2_171 > a:not(#\9) {
|
|
221
221
|
animation: none;
|
|
222
222
|
transition: none;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
.awsui-motion-disabled .awsui_additional-
|
|
225
|
+
.awsui-motion-disabled .awsui_additional-info_n4qlp_146r2_171 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_146r2_171 > a:not(#\9) {
|
|
226
226
|
animation: none;
|
|
227
227
|
transition: none;
|
|
228
228
|
}
|
|
229
|
-
.awsui_additional-
|
|
229
|
+
.awsui_additional-info_n4qlp_146r2_171 > a:not(#\9):hover {
|
|
230
230
|
cursor: pointer;
|
|
231
231
|
color: var(--color-text-link-hover-8j6p14, #033160);
|
|
232
232
|
}
|
|
233
|
-
.awsui_additional-
|
|
233
|
+
.awsui_additional-info_n4qlp_146r2_171 > a:not(#\9):focus {
|
|
234
234
|
outline: none;
|
|
235
235
|
}
|
|
236
|
-
.awsui_additional-
|
|
236
|
+
.awsui_additional-info_n4qlp_146r2_171 > a:not(#\9):active {
|
|
237
237
|
color: var(--color-text-link-hover-8j6p14, #033160);
|
|
238
238
|
}
|
|
239
|
-
.awsui_additional-
|
|
239
|
+
.awsui_additional-info_n4qlp_146r2_171 > a:not(#\9):active, .awsui_additional-info_n4qlp_146r2_171 > a:not(#\9):focus, .awsui_additional-info_n4qlp_146r2_171 > a:not(#\9):hover {
|
|
240
240
|
text-decoration: underline;
|
|
241
241
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
242
242
|
text-decoration-color: currentColor;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
.awsui_right-
|
|
245
|
+
.awsui_right-align_n4qlp_146r2_217:not(#\9) {
|
|
246
246
|
float: right;
|
|
247
247
|
}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"empty-appear": "awsui_empty-
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"root": "
|
|
8
|
-
"empty": "
|
|
9
|
-
"row": "
|
|
10
|
-
"row-control": "awsui_row-
|
|
11
|
-
"field": "
|
|
12
|
-
"add-button": "awsui_add-
|
|
13
|
-
"remove-button": "awsui_remove-
|
|
14
|
-
"button-container-haslabel": "awsui_button-container-
|
|
15
|
-
"button-container-nolabel": "awsui_button-container-
|
|
16
|
-
"divider": "
|
|
17
|
-
"additional-info": "awsui_additional-
|
|
18
|
-
"right-align": "awsui_right-
|
|
5
|
+
"empty-appear": "awsui_empty-appear_n4qlp_146r2_93",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_146r2_1",
|
|
7
|
+
"root": "awsui_root_n4qlp_146r2_119",
|
|
8
|
+
"empty": "awsui_empty_n4qlp_146r2_93",
|
|
9
|
+
"row": "awsui_row_n4qlp_146r2_139",
|
|
10
|
+
"row-control": "awsui_row-control_n4qlp_146r2_143",
|
|
11
|
+
"field": "awsui_field_n4qlp_146r2_147",
|
|
12
|
+
"add-button": "awsui_add-button_n4qlp_146r2_151",
|
|
13
|
+
"remove-button": "awsui_remove-button_n4qlp_146r2_155",
|
|
14
|
+
"button-container-haslabel": "awsui_button-container-haslabel_n4qlp_146r2_159",
|
|
15
|
+
"button-container-nolabel": "awsui_button-container-nolabel_n4qlp_146r2_163",
|
|
16
|
+
"divider": "awsui_divider_n4qlp_146r2_167",
|
|
17
|
+
"additional-info": "awsui_additional-info_n4qlp_146r2_171",
|
|
18
|
+
"right-align": "awsui_right-align_n4qlp_146r2_217"
|
|
19
19
|
};
|
|
20
20
|
|