@cloudscape-design/components 3.0.619 → 3.0.620

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.
Files changed (96) hide show
  1. package/annotation-context/annotation/styles.css.js +24 -24
  2. package/annotation-context/annotation/styles.scoped.css +31 -31
  3. package/annotation-context/annotation/styles.selectors.js +24 -24
  4. package/app-layout/classic.d.ts.map +1 -1
  5. package/app-layout/classic.js +5 -16
  6. package/app-layout/classic.js.map +1 -1
  7. package/app-layout/content-wrapper/index.d.ts +1 -0
  8. package/app-layout/content-wrapper/index.d.ts.map +1 -1
  9. package/app-layout/content-wrapper/index.js +3 -3
  10. package/app-layout/content-wrapper/index.js.map +1 -1
  11. package/app-layout/notifications/styles.css.js +3 -3
  12. package/app-layout/notifications/styles.scoped.css +7 -7
  13. package/app-layout/notifications/styles.selectors.js +3 -3
  14. package/app-layout/utils/sticky-offsets.d.ts +4 -0
  15. package/app-layout/utils/sticky-offsets.d.ts.map +1 -0
  16. package/app-layout/utils/sticky-offsets.js +10 -0
  17. package/app-layout/utils/sticky-offsets.js.map +1 -0
  18. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  19. package/app-layout/visual-refresh/context.js +1 -5
  20. package/app-layout/visual-refresh/context.js.map +1 -1
  21. package/app-layout/visual-refresh/main.d.ts.map +1 -1
  22. package/app-layout/visual-refresh/main.js +6 -4
  23. package/app-layout/visual-refresh/main.js.map +1 -1
  24. package/app-layout/visual-refresh/styles.css.js +81 -81
  25. package/app-layout/visual-refresh/styles.scoped.css +258 -294
  26. package/app-layout/visual-refresh/styles.selectors.js +81 -81
  27. package/container/use-sticky-header.d.ts +1 -5
  28. package/container/use-sticky-header.d.ts.map +1 -1
  29. package/container/use-sticky-header.js +7 -34
  30. package/container/use-sticky-header.js.map +1 -1
  31. package/flashbar/styles.css.js +47 -47
  32. package/flashbar/styles.scoped.css +171 -171
  33. package/flashbar/styles.selectors.js +47 -47
  34. package/header/internal.d.ts.map +1 -1
  35. package/header/internal.js +3 -1
  36. package/header/internal.js.map +1 -1
  37. package/header/styles.css.js +35 -34
  38. package/header/styles.scoped.css +55 -52
  39. package/header/styles.selectors.js +35 -34
  40. package/internal/components/dropdown/styles.css.js +20 -20
  41. package/internal/components/dropdown/styles.scoped.css +41 -41
  42. package/internal/components/dropdown/styles.selectors.js +20 -20
  43. package/internal/context/app-layout-context.d.ts +0 -3
  44. package/internal/context/app-layout-context.d.ts.map +1 -1
  45. package/internal/context/app-layout-context.js +1 -5
  46. package/internal/context/app-layout-context.js.map +1 -1
  47. package/internal/environment.js +1 -1
  48. package/internal/environment.json +1 -1
  49. package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
  50. package/internal/generated/custom-css-properties/index.js +43 -44
  51. package/internal/generated/custom-css-properties/index.js.map +1 -1
  52. package/internal/manifest.json +1 -1
  53. package/internal/styles/global-vars.d.ts +6 -0
  54. package/internal/styles/global-vars.d.ts.map +1 -0
  55. package/internal/styles/global-vars.js +8 -0
  56. package/internal/styles/global-vars.js.map +1 -0
  57. package/mixed-line-bar-chart/bar-series.d.ts +3 -3
  58. package/mixed-line-bar-chart/bar-series.d.ts.map +1 -1
  59. package/mixed-line-bar-chart/bar-series.js +61 -17
  60. package/mixed-line-bar-chart/bar-series.js.map +1 -1
  61. package/mixed-line-bar-chart/create-one-side-rounded-rect-path.d.ts +7 -0
  62. package/mixed-line-bar-chart/create-one-side-rounded-rect-path.d.ts.map +1 -0
  63. package/mixed-line-bar-chart/create-one-side-rounded-rect-path.js +33 -0
  64. package/mixed-line-bar-chart/create-one-side-rounded-rect-path.js.map +1 -0
  65. package/mixed-line-bar-chart/data-series.d.ts.map +1 -1
  66. package/mixed-line-bar-chart/data-series.js +5 -5
  67. package/mixed-line-bar-chart/data-series.js.map +1 -1
  68. package/mixed-line-bar-chart/utils.d.ts +2 -9
  69. package/mixed-line-bar-chart/utils.d.ts.map +1 -1
  70. package/mixed-line-bar-chart/utils.js +19 -26
  71. package/mixed-line-bar-chart/utils.js.map +1 -1
  72. package/package.json +1 -1
  73. package/spinner/styles.css.js +13 -13
  74. package/spinner/styles.scoped.css +39 -39
  75. package/spinner/styles.selectors.js +13 -13
  76. package/split-panel/implementation.d.ts.map +1 -1
  77. package/split-panel/implementation.js +7 -7
  78. package/split-panel/implementation.js.map +1 -1
  79. package/split-panel/interfaces.d.ts +1 -0
  80. package/split-panel/interfaces.d.ts.map +1 -1
  81. package/split-panel/interfaces.js.map +1 -1
  82. package/split-panel/side.d.ts +1 -1
  83. package/split-panel/side.d.ts.map +1 -1
  84. package/split-panel/side.js +2 -5
  85. package/split-panel/side.js.map +1 -1
  86. package/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -1
  87. package/table/sticky-scrollbar/sticky-scrollbar.js +1 -7
  88. package/table/sticky-scrollbar/sticky-scrollbar.js.map +1 -1
  89. package/table/sticky-scrollbar/use-sticky-scrollbar.d.ts +2 -2
  90. package/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -1
  91. package/table/sticky-scrollbar/use-sticky-scrollbar.js +12 -30
  92. package/table/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -1
  93. package/theming/index.d.ts +5 -0
  94. package/theming/index.d.ts.map +1 -1
  95. package/theming/index.js +8 -1
  96. package/theming/index.js.map +1 -1
@@ -2,86 +2,86 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "background": "awsui_background_hyvsj_oarcx_99",
6
- "scrolling-background": "awsui_scrolling-background_hyvsj_oarcx_102",
7
- "sticky-background": "awsui_sticky-background_hyvsj_oarcx_108",
8
- "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_oarcx_116",
9
- "breadcrumbs": "awsui_breadcrumbs_hyvsj_oarcx_129",
10
- "has-sticky-background": "awsui_has-sticky-background_hyvsj_oarcx_139",
11
- "drawers-container": "awsui_drawers-container_hyvsj_oarcx_151",
12
- "has-open-drawer": "awsui_has-open-drawer_hyvsj_oarcx_162",
13
- "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_oarcx_185",
14
- "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_oarcx_190",
15
- "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_oarcx_231",
16
- "drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_oarcx_241",
17
- "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_oarcx_245",
18
- "drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_oarcx_259",
19
- "drawers-trigger": "awsui_drawers-trigger_hyvsj_oarcx_245",
20
- "drawer": "awsui_drawer_hyvsj_oarcx_151",
21
- "drawer-content-container": "awsui_drawer-content-container_hyvsj_oarcx_290",
22
- "drawer-close-button": "awsui_drawer-close-button_hyvsj_oarcx_299",
23
- "drawer-content": "awsui_drawer-content_hyvsj_oarcx_290",
24
- "drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_oarcx_307",
25
- "drawer-slider": "awsui_drawer-slider_hyvsj_oarcx_310",
26
- "is-drawer-open": "awsui_is-drawer-open_hyvsj_oarcx_317",
27
- "content": "awsui_content_hyvsj_oarcx_343",
28
- "layout": "awsui_layout_hyvsj_oarcx_364",
29
- "has-max-content-width": "awsui_has-max-content-width_hyvsj_oarcx_445",
30
- "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_oarcx_460",
31
- "content-type-table": "awsui_content-type-table_hyvsj_oarcx_474",
32
- "content-type-cards": "awsui_content-type-cards_hyvsj_oarcx_474",
33
- "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_oarcx_480",
34
- "is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_oarcx_483",
35
- "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_oarcx_515",
36
- "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_oarcx_518",
37
- "content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_oarcx_528",
38
- "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_oarcx_531",
39
- "content-first-child-header": "awsui_content-first-child-header_hyvsj_oarcx_534",
40
- "has-header": "awsui_has-header_hyvsj_oarcx_534",
41
- "content-first-child-main": "awsui_content-first-child-main_hyvsj_oarcx_552",
42
- "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_oarcx_552",
43
- "has-split-panel": "awsui_has-split-panel_hyvsj_oarcx_589",
44
- "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_oarcx_589",
45
- "block-body-scroll": "awsui_block-body-scroll_hyvsj_oarcx_605",
46
- "unfocusable": "awsui_unfocusable_hyvsj_oarcx_610",
47
- "container": "awsui_container_hyvsj_oarcx_620",
48
- "is-navigation-open": "awsui_is-navigation-open_hyvsj_oarcx_646",
49
- "is-tools-open": "awsui_is-tools-open_hyvsj_oarcx_649",
50
- "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_oarcx_649",
51
- "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_oarcx_649",
52
- "has-active-drawer": "awsui_has-active-drawer_hyvsj_oarcx_649",
53
- "mobile-toolbar": "awsui_mobile-toolbar_hyvsj_oarcx_658",
54
- "remove-high-contrast-header": "awsui_remove-high-contrast-header_hyvsj_oarcx_675",
55
- "mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_oarcx_679",
56
- "mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_oarcx_683",
57
- "mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_oarcx_687",
58
- "navigation-container": "awsui_navigation-container_hyvsj_oarcx_696",
59
- "show-navigation": "awsui_show-navigation_hyvsj_oarcx_734",
60
- "animating": "awsui_animating_hyvsj_oarcx_757",
61
- "showButtons": "awsui_showButtons_hyvsj_oarcx_1",
62
- "navigation": "awsui_navigation_hyvsj_oarcx_696",
63
- "openNavigation": "awsui_openNavigation_hyvsj_oarcx_1",
64
- "animated-content": "awsui_animated-content_hyvsj_oarcx_819",
65
- "hide-navigation": "awsui_hide-navigation_hyvsj_oarcx_828",
66
- "notifications": "awsui_notifications_hyvsj_oarcx_838",
67
- "sticky-notifications": "awsui_sticky-notifications_hyvsj_oarcx_844",
68
- "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_oarcx_861",
69
- "position-bottom": "awsui_position-bottom_hyvsj_oarcx_908",
70
- "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_oarcx_1",
71
- "split-panel-side": "awsui_split-panel-side_hyvsj_oarcx_937",
72
- "position-side": "awsui_position-side_hyvsj_oarcx_950",
73
- "tools-container": "awsui_tools-container_hyvsj_oarcx_972",
74
- "tools": "awsui_tools_hyvsj_oarcx_972",
75
- "openTools": "awsui_openTools_hyvsj_oarcx_1",
76
- "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_oarcx_1063",
77
- "hide-tools": "awsui_hide-tools_hyvsj_oarcx_1073",
78
- "show-tools": "awsui_show-tools_hyvsj_oarcx_1085",
79
- "has-tools-form": "awsui_has-tools-form_hyvsj_oarcx_1063",
80
- "trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_oarcx_1168",
81
- "trigger": "awsui_trigger_hyvsj_oarcx_1168",
82
- "selected": "awsui_selected_hyvsj_oarcx_1245",
83
- "badge": "awsui_badge_hyvsj_oarcx_1265",
84
- "trigger-wrapper": "awsui_trigger-wrapper_hyvsj_oarcx_1269",
85
- "dot": "awsui_dot_hyvsj_oarcx_1280"
5
+ "background": "awsui_background_hyvsj_nbcko_99",
6
+ "scrolling-background": "awsui_scrolling-background_hyvsj_nbcko_102",
7
+ "sticky-background": "awsui_sticky-background_hyvsj_nbcko_108",
8
+ "has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_nbcko_116",
9
+ "breadcrumbs": "awsui_breadcrumbs_hyvsj_nbcko_129",
10
+ "has-sticky-background": "awsui_has-sticky-background_hyvsj_nbcko_139",
11
+ "drawers-container": "awsui_drawers-container_hyvsj_nbcko_151",
12
+ "has-open-drawer": "awsui_has-open-drawer_hyvsj_nbcko_162",
13
+ "disable-body-scroll": "awsui_disable-body-scroll_hyvsj_nbcko_185",
14
+ "drawers-desktop-triggers-container": "awsui_drawers-desktop-triggers-container_hyvsj_nbcko_190",
15
+ "has-multiple-triggers": "awsui_has-multiple-triggers_hyvsj_nbcko_231",
16
+ "drawers-mobile-triggers-container": "awsui_drawers-mobile-triggers-container_hyvsj_nbcko_241",
17
+ "drawers-trigger-content": "awsui_drawers-trigger-content_hyvsj_nbcko_245",
18
+ "drawers-trigger-overflow": "awsui_drawers-trigger-overflow_hyvsj_nbcko_259",
19
+ "drawers-trigger": "awsui_drawers-trigger_hyvsj_nbcko_245",
20
+ "drawer": "awsui_drawer_hyvsj_nbcko_151",
21
+ "drawer-content-container": "awsui_drawer-content-container_hyvsj_nbcko_290",
22
+ "drawer-close-button": "awsui_drawer-close-button_hyvsj_nbcko_299",
23
+ "drawer-content": "awsui_drawer-content_hyvsj_nbcko_290",
24
+ "drawer-content-hidden": "awsui_drawer-content-hidden_hyvsj_nbcko_307",
25
+ "drawer-slider": "awsui_drawer-slider_hyvsj_nbcko_310",
26
+ "is-drawer-open": "awsui_is-drawer-open_hyvsj_nbcko_317",
27
+ "content": "awsui_content_hyvsj_nbcko_343",
28
+ "layout": "awsui_layout_hyvsj_nbcko_364",
29
+ "has-max-content-width": "awsui_has-max-content-width_hyvsj_nbcko_435",
30
+ "content-type-dashboard": "awsui_content-type-dashboard_hyvsj_nbcko_450",
31
+ "content-type-table": "awsui_content-type-table_hyvsj_nbcko_464",
32
+ "content-type-cards": "awsui_content-type-cards_hyvsj_nbcko_464",
33
+ "is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_nbcko_470",
34
+ "is-hide-mobile-toolbar": "awsui_is-hide-mobile-toolbar_hyvsj_nbcko_473",
35
+ "has-content-gap-left": "awsui_has-content-gap-left_hyvsj_nbcko_487",
36
+ "has-content-gap-right": "awsui_has-content-gap-right_hyvsj_nbcko_490",
37
+ "content-first-child-notifications": "awsui_content-first-child-notifications_hyvsj_nbcko_500",
38
+ "has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_nbcko_503",
39
+ "content-first-child-header": "awsui_content-first-child-header_hyvsj_nbcko_506",
40
+ "has-header": "awsui_has-header_hyvsj_nbcko_506",
41
+ "content-first-child-main": "awsui_content-first-child-main_hyvsj_nbcko_524",
42
+ "disable-content-paddings": "awsui_disable-content-paddings_hyvsj_nbcko_524",
43
+ "has-split-panel": "awsui_has-split-panel_hyvsj_nbcko_561",
44
+ "split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_nbcko_561",
45
+ "block-body-scroll": "awsui_block-body-scroll_hyvsj_nbcko_569",
46
+ "unfocusable": "awsui_unfocusable_hyvsj_nbcko_574",
47
+ "container": "awsui_container_hyvsj_nbcko_584",
48
+ "is-navigation-open": "awsui_is-navigation-open_hyvsj_nbcko_610",
49
+ "is-tools-open": "awsui_is-tools-open_hyvsj_nbcko_613",
50
+ "is-split-panel-open": "awsui_is-split-panel-open_hyvsj_nbcko_613",
51
+ "split-panel-position-side": "awsui_split-panel-position-side_hyvsj_nbcko_613",
52
+ "has-active-drawer": "awsui_has-active-drawer_hyvsj_nbcko_613",
53
+ "mobile-toolbar": "awsui_mobile-toolbar_hyvsj_nbcko_622",
54
+ "remove-high-contrast-header": "awsui_remove-high-contrast-header_hyvsj_nbcko_639",
55
+ "mobile-toolbar-nav": "awsui_mobile-toolbar-nav_hyvsj_nbcko_643",
56
+ "mobile-toolbar-breadcrumbs": "awsui_mobile-toolbar-breadcrumbs_hyvsj_nbcko_647",
57
+ "mobile-toolbar-tools": "awsui_mobile-toolbar-tools_hyvsj_nbcko_651",
58
+ "navigation-container": "awsui_navigation-container_hyvsj_nbcko_660",
59
+ "show-navigation": "awsui_show-navigation_hyvsj_nbcko_698",
60
+ "animating": "awsui_animating_hyvsj_nbcko_721",
61
+ "showButtons": "awsui_showButtons_hyvsj_nbcko_1",
62
+ "navigation": "awsui_navigation_hyvsj_nbcko_660",
63
+ "openNavigation": "awsui_openNavigation_hyvsj_nbcko_1",
64
+ "animated-content": "awsui_animated-content_hyvsj_nbcko_783",
65
+ "hide-navigation": "awsui_hide-navigation_hyvsj_nbcko_792",
66
+ "notifications": "awsui_notifications_hyvsj_nbcko_802",
67
+ "sticky-notifications": "awsui_sticky-notifications_hyvsj_nbcko_808",
68
+ "split-panel-bottom": "awsui_split-panel-bottom_hyvsj_nbcko_825",
69
+ "position-bottom": "awsui_position-bottom_hyvsj_nbcko_872",
70
+ "openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_nbcko_1",
71
+ "split-panel-side": "awsui_split-panel-side_hyvsj_nbcko_901",
72
+ "position-side": "awsui_position-side_hyvsj_nbcko_914",
73
+ "tools-container": "awsui_tools-container_hyvsj_nbcko_936",
74
+ "tools": "awsui_tools_hyvsj_nbcko_936",
75
+ "openTools": "awsui_openTools_hyvsj_nbcko_1",
76
+ "has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_nbcko_1027",
77
+ "hide-tools": "awsui_hide-tools_hyvsj_nbcko_1037",
78
+ "show-tools": "awsui_show-tools_hyvsj_nbcko_1049",
79
+ "has-tools-form": "awsui_has-tools-form_hyvsj_nbcko_1027",
80
+ "trigger-badge-wrapper": "awsui_trigger-badge-wrapper_hyvsj_nbcko_1132",
81
+ "trigger": "awsui_trigger_hyvsj_nbcko_1132",
82
+ "selected": "awsui_selected_hyvsj_nbcko_1209",
83
+ "badge": "awsui_badge_hyvsj_nbcko_1229",
84
+ "trigger-wrapper": "awsui_trigger-wrapper_hyvsj_nbcko_1233",
85
+ "dot": "awsui_dot_hyvsj_nbcko_1244"
86
86
  };
87
87
 
@@ -4,15 +4,11 @@ interface StickyHeaderContextProps {
4
4
  }
5
5
  interface ComputeOffsetProps {
6
6
  isMobile: boolean;
7
- isVisualRefresh: boolean;
8
- customCssProps: Record<string, string>;
9
7
  __stickyOffset?: number;
10
8
  __mobileStickyOffset?: number;
11
- mobileBarHeight?: number;
12
- stickyOffsetTop: number;
13
9
  hasInnerOverflowParents: boolean;
14
10
  }
15
- export declare function computeOffset({ isMobile, isVisualRefresh, customCssProps, __stickyOffset, __mobileStickyOffset, mobileBarHeight, stickyOffsetTop, hasInnerOverflowParents, }: ComputeOffsetProps): string;
11
+ export declare function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, }: ComputeOffsetProps): string;
16
12
  export declare const StickyHeaderContext: import("react").Context<StickyHeaderContextProps>;
17
13
  export declare const useStickyHeader: (rootRef: RefObject<HTMLDivElement>, headerRef: RefObject<HTMLDivElement>, __stickyHeader?: boolean, __stickyOffset?: number, __mobileStickyOffset?: number, __disableMobile?: boolean) => {
18
14
  isSticky: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"use-sticky-header.d.ts","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAoE,MAAM,OAAO,CAAC;AAOpG,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,eAAmB,EACnB,eAAe,EACf,uBAAuB,GACxB,EAAE,kBAAkB,UA8BpB;AAED,eAAO,MAAM,mBAAmB,mDAE9B,CAAC;AAEH,eAAO,MAAM,eAAe,YACjB,UAAU,cAAc,CAAC,aACvB,UAAU,cAAc,CAAC,mBACnB,OAAO,mBACP,MAAM,yBACA,MAAM;;;;;;;;;;CA2E9B,CAAC"}
1
+ {"version":3,"file":"use-sticky-header.d.ts","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAoE,MAAM,OAAO,CAAC;AAMpG,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,OAAO,CAAC;CAClC;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,uBAAuB,GACxB,EAAE,kBAAkB,GAAG,MAAM,CAQ7B;AAED,eAAO,MAAM,mBAAmB,mDAE9B,CAAC;AAEH,eAAO,MAAM,eAAe,YACjB,UAAU,cAAc,CAAC,aACvB,UAAU,cAAc,CAAC,mBACnB,OAAO,mBACP,MAAM,yBACA,MAAM;;;;;;;;;;CAmE9B,CAAC"}
@@ -1,48 +1,25 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { useState, useLayoutEffect, useCallback, useEffect, createContext } from 'react';
4
- import { useAppLayoutContext } from '../internal/context/app-layout-context';
5
4
  import { findUpUntil, supportsStickyPosition } from '../internal/utils/dom';
6
5
  import { getOverflowParents } from '../internal/utils/scrollable-containers';
7
- import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
8
- import customCssProps from '../internal/generated/custom-css-properties';
9
6
  import { useMobile } from '../internal/hooks/use-mobile';
10
- export function computeOffset({ isMobile, isVisualRefresh, customCssProps, __stickyOffset, __mobileStickyOffset, mobileBarHeight = 0, stickyOffsetTop, hasInnerOverflowParents, }) {
11
- const effectiveStickyOffset = __stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : (hasInnerOverflowParents ? 0 : stickyOffsetTop);
12
- /**
13
- * The AppLayout refactor removed the need for passing the sticky offset in px all the time through the
14
- * AppLayoutDomContext provider because that information already exists on the DOM in a custom property
15
- * on the Layout subcomponent. Thus, if the Container header is sticky, we are in Visual Refresh and use
16
- * body scroll then we will use that property. When a component is used outside AppLayout, we fall back
17
- * to the default offset calculated in AppLayoutDomContext.
18
- */
19
- let computedOffset = `${effectiveStickyOffset}px`;
20
- if (isMobile) {
21
- // This mobile offset is only relevant for full page tables in the mobile viewport.
22
- // It is obtained by the sum of stickyOffsetTop (AppLayout header height), mobileBarHeight (AppLayout mobile bar height) and
23
- // __stickyOffset (value of the stickyHeaderVerticalOffset, set by users), from which we subtract __mobileStickyOffset (which is the table tools header height).
24
- // Classic offset is calculated using the AppLayout context
25
- const classicOffset = `${stickyOffsetTop + mobileBarHeight + (__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0)}px`;
26
- // VR offset is calculated using CSS custom properties
27
- const visualRefreshOffset = `calc(var(${customCssProps.offsetTop}, 0px) + var(${customCssProps.mobileBarHeight}, 0px) + ${(__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0)}px)`;
28
- computedOffset = isVisualRefresh ? visualRefreshOffset : classicOffset;
7
+ import globalVars from '../internal/styles/global-vars';
8
+ export function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, }) {
9
+ const localOffset = isMobile ? (__stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0) - (__mobileStickyOffset !== null && __mobileStickyOffset !== void 0 ? __mobileStickyOffset : 0) : __stickyOffset !== null && __stickyOffset !== void 0 ? __stickyOffset : 0;
10
+ if (hasInnerOverflowParents) {
11
+ return `${localOffset}px`;
29
12
  }
30
- else if (isVisualRefresh && !hasInnerOverflowParents) {
31
- computedOffset = `var(${customCssProps.offsetTopWithNotifications}, ${computedOffset})`;
32
- }
33
- return computedOffset;
13
+ const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;
14
+ return `calc(${globalOffset} + ${localOffset}px)`;
34
15
  }
35
16
  export const StickyHeaderContext = createContext({
36
17
  isStuck: false,
37
18
  });
38
19
  export const useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffset, __mobileStickyOffset, __disableMobile = true) => {
39
20
  const isMobile = useMobile();
40
- // We reach into AppLayoutContext in case sticky header needs to be offset down by the height
41
- // of other sticky elements positioned on top of the view.
42
- const { stickyOffsetTop, mobileBarHeight } = useAppLayoutContext();
43
21
  const disableSticky = isMobile && __disableMobile;
44
22
  const isSticky = supportsStickyPosition() && !disableSticky && !!__stickyHeader;
45
- const isVisualRefresh = useVisualRefresh();
46
23
  // If it has overflow parents inside the app layout, we shouldn't apply a sticky offset.
47
24
  const [hasInnerOverflowParents, setHasInnerOverflowParents] = useState(false);
48
25
  const [isStuck, setIsStuck] = useState(false);
@@ -59,12 +36,8 @@ export const useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffs
59
36
  }, [rootRef]);
60
37
  const computedOffset = computeOffset({
61
38
  isMobile,
62
- isVisualRefresh,
63
- customCssProps,
64
39
  __stickyOffset,
65
40
  __mobileStickyOffset,
66
- mobileBarHeight,
67
- stickyOffsetTop,
68
41
  hasInnerOverflowParents,
69
42
  });
70
43
  const stickyStyles = isSticky
@@ -1 +1 @@
1
- {"version":3,"file":"use-sticky-header.js","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACpG,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Q,EAAE,YAAY,CAAC,CAAC;YAChD,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;gBACzD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACrD,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7B,OAAO;QACL,QAAQ;QACR,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useState, useLayoutEffect, useCallback, useEffect, createContext } from 'react';\nimport { useAppLayoutContext } from '../internal/context/app-layout-context';\nimport { findUpUntil, supportsStickyPosition } from '../internal/utils/dom';\nimport { getOverflowParents } from '../internal/utils/scrollable-containers';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { useMobile } from '../internal/hooks/use-mobile';\ninterface StickyHeaderContextProps {\n isStuck: boolean;\n}\n\ninterface ComputeOffsetProps {\n isMobile: boolean;\n isVisualRefresh: boolean;\n customCssProps: Record<string, string>;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n mobileBarHeight?: number;\n stickyOffsetTop: number;\n hasInnerOverflowParents: boolean;\n}\n\nexport function computeOffset({\n isMobile,\n isVisualRefresh,\n customCssProps,\n __stickyOffset,\n __mobileStickyOffset,\n mobileBarHeight = 0,\n stickyOffsetTop,\n hasInnerOverflowParents,\n}: ComputeOffsetProps) {\n const effectiveStickyOffset = __stickyOffset ?? (hasInnerOverflowParents ? 0 : stickyOffsetTop);\n /**\n * The AppLayout refactor removed the need for passing the sticky offset in px all the time through the\n * AppLayoutDomContext provider because that information already exists on the DOM in a custom property\n * on the Layout subcomponent. Thus, if the Container header is sticky, we are in Visual Refresh and use\n * body scroll then we will use that property. When a component is used outside AppLayout, we fall back\n * to the default offset calculated in AppLayoutDomContext.\n */\n let computedOffset = `${effectiveStickyOffset}px`;\n if (isMobile) {\n // This mobile offset is only relevant for full page tables in the mobile viewport.\n // It is obtained by the sum of stickyOffsetTop (AppLayout header height), mobileBarHeight (AppLayout mobile bar height) and\n // __stickyOffset (value of the stickyHeaderVerticalOffset, set by users), from which we subtract __mobileStickyOffset (which is the table tools header height).\n\n // Classic offset is calculated using the AppLayout context\n const classicOffset = `${\n stickyOffsetTop + mobileBarHeight + (__stickyOffset ?? 0) - (__mobileStickyOffset ?? 0)\n }px`;\n\n // VR offset is calculated using CSS custom properties\n const visualRefreshOffset = `calc(var(${customCssProps.offsetTop}, 0px) + var(${\n customCssProps.mobileBarHeight\n }, 0px) + ${(__stickyOffset ?? 0) - (__mobileStickyOffset ?? 0)}px)`;\n\n computedOffset = isVisualRefresh ? visualRefreshOffset : classicOffset;\n } else if (isVisualRefresh && !hasInnerOverflowParents) {\n computedOffset = `var(${customCssProps.offsetTopWithNotifications}, ${computedOffset})`;\n }\n return computedOffset;\n}\n\nexport const StickyHeaderContext = createContext<StickyHeaderContextProps>({\n isStuck: false,\n});\n\nexport const useStickyHeader = (\n rootRef: RefObject<HTMLDivElement>,\n headerRef: RefObject<HTMLDivElement>,\n __stickyHeader?: boolean,\n __stickyOffset?: number,\n __mobileStickyOffset?: number,\n __disableMobile = true\n) => {\n const isMobile = useMobile();\n // We reach into AppLayoutContext in case sticky header needs to be offset down by the height\n // of other sticky elements positioned on top of the view.\n const { stickyOffsetTop, mobileBarHeight } = useAppLayoutContext();\n const disableSticky = isMobile && __disableMobile;\n const isSticky = supportsStickyPosition() && !disableSticky && !!__stickyHeader;\n const isVisualRefresh = useVisualRefresh();\n\n // If it has overflow parents inside the app layout, we shouldn't apply a sticky offset.\n const [hasInnerOverflowParents, setHasInnerOverflowParents] = useState(false);\n const [isStuck, setIsStuck] = useState(false);\n useLayoutEffect(() => {\n if (rootRef.current) {\n const overflowParents = getOverflowParents(rootRef.current);\n const mainElement = findUpUntil(rootRef.current, elem => elem.tagName === 'MAIN');\n // In both versions of the app layout, the scrolling element for disableBodyScroll\n // is the <main>. If the closest overflow parent is also the closest <main> and we have\n // offset values, it's safe to assume that it's the app layout scroll root and we\n // should stop there.\n setHasInnerOverflowParents(overflowParents.length > 0 && overflowParents[0] !== mainElement);\n }\n }, [rootRef]);\n\n const computedOffset = computeOffset({\n isMobile,\n isVisualRefresh,\n customCssProps,\n __stickyOffset,\n __mobileStickyOffset,\n mobileBarHeight,\n stickyOffsetTop,\n hasInnerOverflowParents,\n });\n\n const stickyStyles = isSticky\n ? {\n style: {\n top: computedOffset,\n },\n }\n : {};\n\n // \"stuck\" state, when the header has moved from its original posititon has a\n // box-shadow, applied here by a \"header-stuck\" className\n const checkIfStuck = useCallback(() => {\n if (rootRef.current && headerRef.current) {\n const rootTopBorderWidth = parseFloat(getComputedStyle(rootRef.current).borderTopWidth) || 0;\n const rootTop = rootRef.current.getBoundingClientRect().top + rootTopBorderWidth;\n const headerTop = headerRef.current.getBoundingClientRect().top;\n\n if (rootTop < headerTop) {\n setIsStuck(true);\n } else {\n setIsStuck(false);\n }\n }\n }, [rootRef, headerRef]);\n useEffect(() => {\n if (isSticky) {\n window.addEventListener('scroll', checkIfStuck, true);\n window.addEventListener('resize', checkIfStuck);\n return () => {\n window.removeEventListener('scroll', checkIfStuck, true);\n window.removeEventListener('resize', checkIfStuck);\n };\n }\n }, [isSticky, checkIfStuck]);\n return {\n isSticky,\n isStuck,\n stickyStyles,\n };\n};\n"]}
1
+ {"version":3,"file":"use-sticky-header.js","sourceRoot":"","sources":["../../../src/container/use-sticky-header.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,M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gBACvB,UAAU,CAAC,IAAI,CAAC,CAAC;aAClB;iBAAM;gBACL,UAAU,CAAC,KAAK,CAAC,CAAC;aACnB;SACF;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IACzB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,EAAE;YACZ,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACtD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YAChD,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;gBACzD,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACrD,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC;IAC7B,OAAO;QACL,QAAQ;QACR,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useState, useLayoutEffect, useCallback, useEffect, createContext } from 'react';\nimport { findUpUntil, supportsStickyPosition } from '../internal/utils/dom';\nimport { getOverflowParents } from '../internal/utils/scrollable-containers';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport globalVars from '../internal/styles/global-vars';\n\ninterface StickyHeaderContextProps {\n isStuck: boolean;\n}\n\ninterface ComputeOffsetProps {\n isMobile: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n hasInnerOverflowParents: boolean;\n}\n\nexport function computeOffset({\n isMobile,\n __stickyOffset,\n __mobileStickyOffset,\n hasInnerOverflowParents,\n}: ComputeOffsetProps): string {\n const localOffset = isMobile ? (__stickyOffset ?? 0) - (__mobileStickyOffset ?? 0) : __stickyOffset ?? 0;\n if (hasInnerOverflowParents) {\n return `${localOffset}px`;\n }\n const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;\n\n return `calc(${globalOffset} + ${localOffset}px)`;\n}\n\nexport const StickyHeaderContext = createContext<StickyHeaderContextProps>({\n isStuck: false,\n});\n\nexport const useStickyHeader = (\n rootRef: RefObject<HTMLDivElement>,\n headerRef: RefObject<HTMLDivElement>,\n __stickyHeader?: boolean,\n __stickyOffset?: number,\n __mobileStickyOffset?: number,\n __disableMobile = true\n) => {\n const isMobile = useMobile();\n const disableSticky = isMobile && __disableMobile;\n const isSticky = supportsStickyPosition() && !disableSticky && !!__stickyHeader;\n\n // If it has overflow parents inside the app layout, we shouldn't apply a sticky offset.\n const [hasInnerOverflowParents, setHasInnerOverflowParents] = useState(false);\n const [isStuck, setIsStuck] = useState(false);\n useLayoutEffect(() => {\n if (rootRef.current) {\n const overflowParents = getOverflowParents(rootRef.current);\n const mainElement = findUpUntil(rootRef.current, elem => elem.tagName === 'MAIN');\n // In both versions of the app layout, the scrolling element for disableBodyScroll\n // is the <main>. If the closest overflow parent is also the closest <main> and we have\n // offset values, it's safe to assume that it's the app layout scroll root and we\n // should stop there.\n setHasInnerOverflowParents(overflowParents.length > 0 && overflowParents[0] !== mainElement);\n }\n }, [rootRef]);\n\n const computedOffset = computeOffset({\n isMobile,\n __stickyOffset,\n __mobileStickyOffset,\n hasInnerOverflowParents,\n });\n\n const stickyStyles = isSticky\n ? {\n style: {\n top: computedOffset,\n },\n }\n : {};\n\n // \"stuck\" state, when the header has moved from its original posititon has a\n // box-shadow, applied here by a \"header-stuck\" className\n const checkIfStuck = useCallback(() => {\n if (rootRef.current && headerRef.current) {\n const rootTopBorderWidth = parseFloat(getComputedStyle(rootRef.current).borderTopWidth) || 0;\n const rootTop = rootRef.current.getBoundingClientRect().top + rootTopBorderWidth;\n const headerTop = headerRef.current.getBoundingClientRect().top;\n\n if (rootTop < headerTop) {\n setIsStuck(true);\n } else {\n setIsStuck(false);\n }\n }\n }, [rootRef, headerRef]);\n useEffect(() => {\n if (isSticky) {\n window.addEventListener('scroll', checkIfStuck, true);\n window.addEventListener('resize', checkIfStuck);\n return () => {\n window.removeEventListener('scroll', checkIfStuck, true);\n window.removeEventListener('resize', checkIfStuck);\n };\n }\n }, [isSticky, checkIfStuck]);\n return {\n isSticky,\n isStuck,\n stickyStyles,\n };\n};\n"]}
@@ -1,52 +1,52 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "flash-with-motion": "awsui_flash-with-motion_1q84n_pgrle_99",
5
- "enter": "awsui_enter_1q84n_pgrle_99",
6
- "flash-body": "awsui_flash-body_1q84n_pgrle_113",
7
- "flash-message": "awsui_flash-message_1q84n_pgrle_113",
8
- "flash-header": "awsui_flash-header_1q84n_pgrle_113",
9
- "flash-content": "awsui_flash-content_1q84n_pgrle_114",
10
- "action-button-wrapper": "awsui_action-button-wrapper_1q84n_pgrle_115",
11
- "dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_pgrle_116",
12
- "flash-icon": "awsui_flash-icon_1q84n_pgrle_139",
13
- "entering": "awsui_entering_1q84n_pgrle_152",
14
- "entered": "awsui_entered_1q84n_pgrle_173",
15
- "exiting": "awsui_exiting_1q84n_pgrle_278",
16
- "stack": "awsui_stack_1q84n_pgrle_300",
17
- "animation-running": "awsui_animation-running_1q84n_pgrle_300",
18
- "item": "awsui_item_1q84n_pgrle_300",
19
- "flash-list-item": "awsui_flash-list-item_1q84n_pgrle_301",
20
- "notification-bar": "awsui_notification-bar_1q84n_pgrle_302",
21
- "collapsed": "awsui_collapsed_1q84n_pgrle_322",
22
- "animation-ready": "awsui_animation-ready_1q84n_pgrle_322",
23
- "expanded-only": "awsui_expanded-only_1q84n_pgrle_322",
24
- "expanded": "awsui_expanded_1q84n_pgrle_322",
25
- "flash": "awsui_flash_1q84n_pgrle_99",
26
- "collapsible": "awsui_collapsible_1q84n_pgrle_386",
27
- "short-list": "awsui_short-list_1q84n_pgrle_392",
28
- "visual-refresh": "awsui_visual-refresh_1q84n_pgrle_392",
29
- "status": "awsui_status_1q84n_pgrle_605",
30
- "header": "awsui_header_1q84n_pgrle_605",
31
- "item-count": "awsui_item-count_1q84n_pgrle_606",
32
- "button": "awsui_button_1q84n_pgrle_607",
33
- "type-count": "awsui_type-count_1q84n_pgrle_640",
34
- "count-number": "awsui_count-number_1q84n_pgrle_640",
35
- "icon": "awsui_icon_1q84n_pgrle_674",
36
- "floating": "awsui_floating_1q84n_pgrle_715",
37
- "flashbar": "awsui_flashbar_1q84n_pgrle_723",
38
- "flash-refresh": "awsui_flash-refresh_1q84n_pgrle_798",
39
- "flash-list": "awsui_flash-list_1q84n_pgrle_301",
40
- "flash-focus-container": "awsui_flash-focus-container_1q84n_pgrle_819",
41
- "flash-text": "awsui_flash-text_1q84n_pgrle_849",
42
- "dismiss-button": "awsui_dismiss-button_1q84n_pgrle_116",
43
- "breakpoint-default": "awsui_breakpoint-default_1q84n_pgrle_891",
44
- "action-button": "awsui_action-button_1q84n_pgrle_115",
45
- "action-slot": "awsui_action-slot_1q84n_pgrle_901",
46
- "flash-type-success": "awsui_flash-type-success_1q84n_pgrle_905",
47
- "flash-type-error": "awsui_flash-type-error_1q84n_pgrle_909",
48
- "flash-type-info": "awsui_flash-type-info_1q84n_pgrle_913",
49
- "flash-type-in-progress": "awsui_flash-type-in-progress_1q84n_pgrle_914",
50
- "flash-type-warning": "awsui_flash-type-warning_1q84n_pgrle_918"
4
+ "flash-with-motion": "awsui_flash-with-motion_1q84n_sj5ey_99",
5
+ "enter": "awsui_enter_1q84n_sj5ey_99",
6
+ "flash-body": "awsui_flash-body_1q84n_sj5ey_113",
7
+ "flash-message": "awsui_flash-message_1q84n_sj5ey_113",
8
+ "flash-header": "awsui_flash-header_1q84n_sj5ey_113",
9
+ "flash-content": "awsui_flash-content_1q84n_sj5ey_114",
10
+ "action-button-wrapper": "awsui_action-button-wrapper_1q84n_sj5ey_115",
11
+ "dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_sj5ey_116",
12
+ "flash-icon": "awsui_flash-icon_1q84n_sj5ey_139",
13
+ "entering": "awsui_entering_1q84n_sj5ey_152",
14
+ "entered": "awsui_entered_1q84n_sj5ey_173",
15
+ "exiting": "awsui_exiting_1q84n_sj5ey_278",
16
+ "stack": "awsui_stack_1q84n_sj5ey_300",
17
+ "animation-running": "awsui_animation-running_1q84n_sj5ey_300",
18
+ "item": "awsui_item_1q84n_sj5ey_300",
19
+ "flash-list-item": "awsui_flash-list-item_1q84n_sj5ey_301",
20
+ "notification-bar": "awsui_notification-bar_1q84n_sj5ey_302",
21
+ "collapsed": "awsui_collapsed_1q84n_sj5ey_322",
22
+ "animation-ready": "awsui_animation-ready_1q84n_sj5ey_322",
23
+ "expanded-only": "awsui_expanded-only_1q84n_sj5ey_322",
24
+ "expanded": "awsui_expanded_1q84n_sj5ey_322",
25
+ "flash": "awsui_flash_1q84n_sj5ey_99",
26
+ "collapsible": "awsui_collapsible_1q84n_sj5ey_386",
27
+ "short-list": "awsui_short-list_1q84n_sj5ey_392",
28
+ "visual-refresh": "awsui_visual-refresh_1q84n_sj5ey_392",
29
+ "status": "awsui_status_1q84n_sj5ey_605",
30
+ "header": "awsui_header_1q84n_sj5ey_605",
31
+ "item-count": "awsui_item-count_1q84n_sj5ey_606",
32
+ "button": "awsui_button_1q84n_sj5ey_607",
33
+ "type-count": "awsui_type-count_1q84n_sj5ey_640",
34
+ "count-number": "awsui_count-number_1q84n_sj5ey_640",
35
+ "icon": "awsui_icon_1q84n_sj5ey_674",
36
+ "floating": "awsui_floating_1q84n_sj5ey_715",
37
+ "flashbar": "awsui_flashbar_1q84n_sj5ey_723",
38
+ "flash-refresh": "awsui_flash-refresh_1q84n_sj5ey_798",
39
+ "flash-list": "awsui_flash-list_1q84n_sj5ey_301",
40
+ "flash-focus-container": "awsui_flash-focus-container_1q84n_sj5ey_819",
41
+ "flash-text": "awsui_flash-text_1q84n_sj5ey_849",
42
+ "dismiss-button": "awsui_dismiss-button_1q84n_sj5ey_116",
43
+ "breakpoint-default": "awsui_breakpoint-default_1q84n_sj5ey_891",
44
+ "action-button": "awsui_action-button_1q84n_sj5ey_115",
45
+ "action-slot": "awsui_action-slot_1q84n_sj5ey_901",
46
+ "flash-type-success": "awsui_flash-type-success_1q84n_sj5ey_905",
47
+ "flash-type-error": "awsui_flash-type-error_1q84n_sj5ey_909",
48
+ "flash-type-info": "awsui_flash-type-info_1q84n_sj5ey_913",
49
+ "flash-type-in-progress": "awsui_flash-type-in-progress_1q84n_sj5ey_914",
50
+ "flash-type-warning": "awsui_flash-type-warning_1q84n_sj5ey_918"
51
51
  };
52
52