@cloudscape-design/components 3.0.648 → 3.0.649

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 (152) hide show
  1. package/app-layout/drawer/index.js +2 -2
  2. package/app-layout/drawer/index.js.map +1 -1
  3. package/app-layout/mobile-toolbar/index.js +1 -1
  4. package/app-layout/mobile-toolbar/index.js.map +1 -1
  5. package/app-layout/utils/sticky-offsets.d.ts +1 -1
  6. package/app-layout/utils/sticky-offsets.d.ts.map +1 -1
  7. package/app-layout/utils/sticky-offsets.js +2 -2
  8. package/app-layout/utils/sticky-offsets.js.map +1 -1
  9. package/app-layout/visual-refresh/background.d.ts.map +1 -1
  10. package/app-layout/visual-refresh/background.js +2 -5
  11. package/app-layout/visual-refresh/background.js.map +1 -1
  12. package/app-layout/visual-refresh/breadcrumbs.d.ts.map +1 -1
  13. package/app-layout/visual-refresh/breadcrumbs.js +1 -2
  14. package/app-layout/visual-refresh/breadcrumbs.js.map +1 -1
  15. package/app-layout/visual-refresh/context.d.ts +0 -2
  16. package/app-layout/visual-refresh/context.d.ts.map +1 -1
  17. package/app-layout/visual-refresh/context.js +2 -7
  18. package/app-layout/visual-refresh/context.js.map +1 -1
  19. package/app-layout/visual-refresh/drawers.js +2 -2
  20. package/app-layout/visual-refresh/drawers.js.map +1 -1
  21. package/app-layout/visual-refresh/layout.d.ts.map +1 -1
  22. package/app-layout/visual-refresh/layout.js +1 -3
  23. package/app-layout/visual-refresh/layout.js.map +1 -1
  24. package/app-layout/visual-refresh/main.d.ts.map +1 -1
  25. package/app-layout/visual-refresh/main.js +2 -4
  26. package/app-layout/visual-refresh/main.js.map +1 -1
  27. package/app-layout/visual-refresh/navigation.js +2 -2
  28. package/app-layout/visual-refresh/navigation.js.map +1 -1
  29. package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
  30. package/app-layout/visual-refresh/notifications.js +3 -1
  31. package/app-layout/visual-refresh/notifications.js.map +1 -1
  32. package/app-layout/visual-refresh/styles.css.js +82 -83
  33. package/app-layout/visual-refresh/styles.scoped.css +168 -190
  34. package/app-layout/visual-refresh/styles.selectors.js +82 -83
  35. package/app-layout/visual-refresh/tools.js +2 -2
  36. package/app-layout/visual-refresh/tools.js.map +1 -1
  37. package/app-layout/visual-refresh/trigger-button.js +1 -1
  38. package/app-layout/visual-refresh/trigger-button.js.map +1 -1
  39. package/app-layout/visual-refresh/use-background-overlap.d.ts +0 -6
  40. package/app-layout/visual-refresh/use-background-overlap.d.ts.map +1 -1
  41. package/app-layout/visual-refresh/use-background-overlap.js +0 -6
  42. package/app-layout/visual-refresh/use-background-overlap.js.map +1 -1
  43. package/button-dropdown/category-elements/category-element.js +1 -1
  44. package/button-dropdown/category-elements/category-element.js.map +1 -1
  45. package/button-dropdown/category-elements/mobile-expandable-category-element.js +1 -1
  46. package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
  47. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js +1 -1
  48. package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js.map +1 -1
  49. package/container/internal.d.ts.map +1 -1
  50. package/container/internal.js +7 -25
  51. package/container/internal.js.map +1 -1
  52. package/container/styles.css.js +30 -29
  53. package/container/styles.scoped.css +60 -53
  54. package/container/styles.selectors.js +30 -29
  55. package/container/use-sticky-header.d.ts +3 -2
  56. package/container/use-sticky-header.d.ts.map +1 -1
  57. package/container/use-sticky-header.js +5 -3
  58. package/container/use-sticky-header.js.map +1 -1
  59. package/content-layout/internal.js +2 -2
  60. package/content-layout/internal.js.map +1 -1
  61. package/drawer/implementation.js +2 -2
  62. package/drawer/implementation.js.map +1 -1
  63. package/help-panel/implementation.js +2 -2
  64. package/help-panel/implementation.js.map +1 -1
  65. package/icon/icons.js +1 -1
  66. package/icon/interfaces.d.ts +1 -1
  67. package/icon/interfaces.d.ts.map +1 -1
  68. package/icon/interfaces.js.map +1 -1
  69. package/internal/analytics/index.d.ts +7 -1
  70. package/internal/analytics/index.d.ts.map +1 -1
  71. package/internal/analytics/index.js +10 -0
  72. package/internal/analytics/index.js.map +1 -1
  73. package/internal/analytics/interfaces.d.ts +12 -0
  74. package/internal/analytics/interfaces.d.ts.map +1 -1
  75. package/internal/analytics/interfaces.js.map +1 -1
  76. package/internal/base-component/index.d.ts +5 -3
  77. package/internal/base-component/index.d.ts.map +1 -1
  78. package/internal/base-component/index.js.map +1 -1
  79. package/internal/components/cartesian-chart/inline-start-labels.js +1 -1
  80. package/internal/components/cartesian-chart/inline-start-labels.js.map +1 -1
  81. package/internal/components/option/highlight-match.d.ts.map +1 -1
  82. package/internal/components/option/highlight-match.js +1 -2
  83. package/internal/components/option/highlight-match.js.map +1 -1
  84. package/internal/components/option/index.js +2 -2
  85. package/internal/components/option/index.js.map +1 -1
  86. package/internal/context/reset-contexts-for-modal.d.ts.map +1 -1
  87. package/internal/context/reset-contexts-for-modal.js +6 -8
  88. package/internal/context/reset-contexts-for-modal.js.map +1 -1
  89. package/internal/context/single-tab-stop-navigation-context.d.ts +16 -2
  90. package/internal/context/single-tab-stop-navigation-context.d.ts.map +1 -1
  91. package/internal/context/single-tab-stop-navigation-context.js +51 -1
  92. package/internal/context/single-tab-stop-navigation-context.js.map +1 -1
  93. package/internal/environment.js +1 -1
  94. package/internal/environment.json +1 -1
  95. package/internal/hooks/use-table-interaction-metrics/index.d.ts +10 -0
  96. package/internal/hooks/use-table-interaction-metrics/index.d.ts.map +1 -0
  97. package/internal/hooks/use-table-interaction-metrics/index.js +47 -0
  98. package/internal/hooks/use-table-interaction-metrics/index.js.map +1 -0
  99. package/internal/manifest.json +1 -1
  100. package/package.json +1 -1
  101. package/popover/index.d.ts +1 -1
  102. package/popover/index.d.ts.map +1 -1
  103. package/popover/index.js +2 -2
  104. package/popover/index.js.map +1 -1
  105. package/popover/interfaces.d.ts +5 -0
  106. package/popover/interfaces.d.ts.map +1 -1
  107. package/popover/interfaces.js.map +1 -1
  108. package/popover/internal.js +2 -2
  109. package/popover/internal.js.map +1 -1
  110. package/popover/styles.css.js +50 -49
  111. package/popover/styles.scoped.css +74 -66
  112. package/popover/styles.selectors.js +50 -49
  113. package/slider/internal.js +1 -1
  114. package/slider/internal.js.map +1 -1
  115. package/slider/slider-labels.js +1 -1
  116. package/slider/slider-labels.js.map +1 -1
  117. package/slider/tick-marks.js +2 -2
  118. package/slider/tick-marks.js.map +1 -1
  119. package/split-panel/side.js +3 -3
  120. package/split-panel/side.js.map +1 -1
  121. package/table/internal.d.ts.map +1 -1
  122. package/table/internal.js +23 -17
  123. package/table/internal.js.map +1 -1
  124. package/table/selection/selection-control.js +1 -1
  125. package/table/selection/selection-control.js.map +1 -1
  126. package/table/table-role/grid-navigation.d.ts.map +1 -1
  127. package/table/table-role/grid-navigation.js +40 -67
  128. package/table/table-role/grid-navigation.js.map +1 -1
  129. package/table/thead.d.ts +1 -0
  130. package/table/thead.d.ts.map +1 -1
  131. package/table/thead.js +5 -2
  132. package/table/thead.js.map +1 -1
  133. package/table/tools-header.d.ts +2 -1
  134. package/table/tools-header.d.ts.map +1 -1
  135. package/table/tools-header.js +4 -4
  136. package/table/tools-header.js.map +1 -1
  137. package/tabs/tab-header-bar.d.ts.map +1 -1
  138. package/tabs/tab-header-bar.js +19 -47
  139. package/tabs/tab-header-bar.js.map +1 -1
  140. package/token-group/dismiss-button.d.ts.map +1 -1
  141. package/token-group/dismiss-button.js +1 -2
  142. package/token-group/dismiss-button.js.map +1 -1
  143. package/wizard/wizard-form-header.js +1 -1
  144. package/wizard/wizard-form-header.js.map +1 -1
  145. package/wizard/wizard-form.js +1 -1
  146. package/wizard/wizard-form.js.map +1 -1
  147. package/wizard/wizard-navigation.js +3 -3
  148. package/wizard/wizard-navigation.js.map +1 -1
  149. package/internal/context/app-layout-context.d.ts +0 -8
  150. package/internal/context/app-layout-context.d.ts.map +0 -1
  151. package/internal/context/app-layout-context.js +0 -9
  152. package/internal/context/app-layout-context.js.map +0 -1
@@ -1,34 +1,35 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_14iqq_1w0sy_103",
5
- "fit-height": "awsui_fit-height_14iqq_1w0sy_139",
6
- "with-side-media": "awsui_with-side-media_14iqq_1w0sy_144",
7
- "variant-default": "awsui_variant-default_14iqq_1w0sy_147",
8
- "variant-stacked": "awsui_variant-stacked_14iqq_1w0sy_147",
9
- "refresh": "awsui_refresh_14iqq_1w0sy_155",
10
- "sticky-enabled": "awsui_sticky-enabled_14iqq_1w0sy_205",
11
- "with-top-media": "awsui_with-top-media_14iqq_1w0sy_217",
12
- "content-wrapper": "awsui_content-wrapper_14iqq_1w0sy_222",
13
- "content-wrapper-fit-height": "awsui_content-wrapper-fit-height_14iqq_1w0sy_227",
14
- "media": "awsui_media_14iqq_1w0sy_234",
15
- "media-top": "awsui_media-top_14iqq_1w0sy_252",
16
- "media-side": "awsui_media-side_14iqq_1w0sy_257",
17
- "header": "awsui_header_14iqq_1w0sy_263",
18
- "header-with-media": "awsui_header-with-media_14iqq_1w0sy_268",
19
- "header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_1w0sy_274",
20
- "header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_1w0sy_278",
21
- "header-stuck": "awsui_header-stuck_14iqq_1w0sy_284",
22
- "header-variant-cards": "awsui_header-variant-cards_14iqq_1w0sy_294",
23
- "header-dynamic-height": "awsui_header-dynamic-height_14iqq_1w0sy_297",
24
- "with-paddings": "awsui_with-paddings_14iqq_1w0sy_303",
25
- "with-hidden-content": "awsui_with-hidden-content_14iqq_1w0sy_312",
26
- "header-variant-full-page": "awsui_header-variant-full-page_14iqq_1w0sy_370",
27
- "with-toolbar": "awsui_with-toolbar_14iqq_1w0sy_370",
28
- "content": "awsui_content_14iqq_1w0sy_222",
29
- "content-fit-height": "awsui_content-fit-height_14iqq_1w0sy_397",
30
- "content-with-media": "awsui_content-with-media_14iqq_1w0sy_407",
31
- "footer": "awsui_footer_14iqq_1w0sy_411",
32
- "with-divider": "awsui_with-divider_14iqq_1w0sy_415"
4
+ "root": "awsui_root_14iqq_fgdim_103",
5
+ "fit-height": "awsui_fit-height_14iqq_fgdim_139",
6
+ "with-side-media": "awsui_with-side-media_14iqq_fgdim_144",
7
+ "variant-default": "awsui_variant-default_14iqq_fgdim_147",
8
+ "variant-stacked": "awsui_variant-stacked_14iqq_fgdim_147",
9
+ "refresh": "awsui_refresh_14iqq_fgdim_155",
10
+ "sticky-enabled": "awsui_sticky-enabled_14iqq_fgdim_205",
11
+ "with-top-media": "awsui_with-top-media_14iqq_fgdim_217",
12
+ "content-wrapper": "awsui_content-wrapper_14iqq_fgdim_222",
13
+ "content-wrapper-fit-height": "awsui_content-wrapper-fit-height_14iqq_fgdim_227",
14
+ "media": "awsui_media_14iqq_fgdim_234",
15
+ "media-top": "awsui_media-top_14iqq_fgdim_252",
16
+ "media-side": "awsui_media-side_14iqq_fgdim_257",
17
+ "header": "awsui_header_14iqq_fgdim_263",
18
+ "header-with-media": "awsui_header-with-media_14iqq_fgdim_268",
19
+ "header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_fgdim_274",
20
+ "header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_fgdim_278",
21
+ "header-stuck": "awsui_header-stuck_14iqq_fgdim_284",
22
+ "header-variant-cards": "awsui_header-variant-cards_14iqq_fgdim_294",
23
+ "header-dynamic-height": "awsui_header-dynamic-height_14iqq_fgdim_297",
24
+ "with-paddings": "awsui_with-paddings_14iqq_fgdim_303",
25
+ "with-hidden-content": "awsui_with-hidden-content_14iqq_fgdim_312",
26
+ "header-variant-full-page": "awsui_header-variant-full-page_14iqq_fgdim_370",
27
+ "with-toolbar": "awsui_with-toolbar_14iqq_fgdim_370",
28
+ "header-cover": "awsui_header-cover_14iqq_fgdim_376",
29
+ "content": "awsui_content_14iqq_fgdim_222",
30
+ "content-fit-height": "awsui_content-fit-height_14iqq_fgdim_404",
31
+ "content-with-media": "awsui_content-with-media_14iqq_fgdim_414",
32
+ "footer": "awsui_footer_14iqq_fgdim_418",
33
+ "with-divider": "awsui_with-divider_14iqq_fgdim_422"
33
34
  };
34
35
 
@@ -100,7 +100,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
100
100
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
101
101
  SPDX-License-Identifier: Apache-2.0
102
102
  */
103
- .awsui_root_14iqq_1w0sy_103:not(#\9) {
103
+ .awsui_root_14iqq_fgdim_103:not(#\9) {
104
104
  border-collapse: separate;
105
105
  border-spacing: 0;
106
106
  box-sizing: border-box;
@@ -137,15 +137,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
137
137
  word-wrap: break-word;
138
138
  position: relative;
139
139
  }
140
- .awsui_root_14iqq_1w0sy_103.awsui_fit-height_14iqq_1w0sy_139:not(#\9) {
140
+ .awsui_root_14iqq_fgdim_103.awsui_fit-height_14iqq_fgdim_139:not(#\9) {
141
141
  display: flex;
142
142
  flex-direction: column;
143
143
  block-size: 100%;
144
144
  }
145
- .awsui_root_14iqq_1w0sy_103.awsui_fit-height_14iqq_1w0sy_139.awsui_with-side-media_14iqq_1w0sy_144:not(#\9) {
145
+ .awsui_root_14iqq_fgdim_103.awsui_fit-height_14iqq_fgdim_139.awsui_with-side-media_14iqq_fgdim_144:not(#\9) {
146
146
  flex-direction: row;
147
147
  }
148
- .awsui_root_14iqq_1w0sy_103.awsui_variant-default_14iqq_1w0sy_147:not(#\9), .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9) {
148
+ .awsui_root_14iqq_fgdim_103.awsui_variant-default_14iqq_fgdim_147:not(#\9), .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9) {
149
149
  background-color: var(--color-background-container-content-4un1ap, #ffffff);
150
150
  border-start-start-radius: var(--border-radius-container-wqv1zi, 16px);
151
151
  border-start-end-radius: var(--border-radius-container-wqv1zi, 16px);
@@ -153,11 +153,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
153
153
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
154
154
  box-sizing: border-box;
155
155
  }
156
- .awsui_root_14iqq_1w0sy_103.awsui_variant-default_14iqq_1w0sy_147.awsui_refresh_14iqq_1w0sy_155:not(#\9), .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147.awsui_refresh_14iqq_1w0sy_155:not(#\9) {
156
+ .awsui_root_14iqq_fgdim_103.awsui_variant-default_14iqq_fgdim_147.awsui_refresh_14iqq_fgdim_155:not(#\9), .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147.awsui_refresh_14iqq_fgdim_155:not(#\9) {
157
157
  border-block: solid var(--border-divider-section-width-1061zr, 1px) var(--color-border-divider-default-j74lyz, #b6bec9);
158
158
  border-inline: solid var(--border-divider-section-width-1061zr, 1px) var(--color-border-divider-default-j74lyz, #b6bec9);
159
159
  }
160
- .awsui_root_14iqq_1w0sy_103.awsui_variant-default_14iqq_1w0sy_147:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::before, .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::before {
160
+ .awsui_root_14iqq_fgdim_103.awsui_variant-default_14iqq_fgdim_147:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::before, .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::before {
161
161
  content: "";
162
162
  position: absolute;
163
163
  inset-inline-start: 0px;
@@ -175,7 +175,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
175
175
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
176
176
  z-index: 1;
177
177
  }
178
- .awsui_root_14iqq_1w0sy_103.awsui_variant-default_14iqq_1w0sy_147:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::after, .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::after {
178
+ .awsui_root_14iqq_fgdim_103.awsui_variant-default_14iqq_fgdim_147:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::after, .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::after {
179
179
  content: "";
180
180
  position: absolute;
181
181
  inset-inline-start: 0px;
@@ -191,141 +191,141 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
191
191
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
192
192
  box-shadow: var(--shadow-container-fxmdn3, 0px 0px 1px 1px #e9ebed, 0px 1px 8px 2px rgba(0, 7, 22, 0.12));
193
193
  }
194
- .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9):not(:last-child), .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9):not(:last-child)::before, .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9):not(:last-child)::after {
194
+ .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9):not(:last-child), .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9):not(:last-child)::before, .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9):not(:last-child)::after {
195
195
  border-end-end-radius: 0;
196
196
  border-end-start-radius: 0;
197
197
  border-block-end-width: 0;
198
198
  }
199
- .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147 + .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9), .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147 + .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9)::before, .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147 + .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9)::after {
199
+ .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147 + .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9), .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147 + .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9)::before, .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147 + .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9)::after {
200
200
  border-start-start-radius: 0;
201
201
  border-start-end-radius: 0;
202
202
  }
203
- .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147 + .awsui_root_14iqq_1w0sy_103.awsui_variant-stacked_14iqq_1w0sy_147:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::before {
203
+ .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147 + .awsui_root_14iqq_fgdim_103.awsui_variant-stacked_14iqq_fgdim_147:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::before {
204
204
  border-block-start: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-divider-default-j74lyz, #b6bec9);
205
205
  }
206
- .awsui_root_14iqq_1w0sy_103.awsui_sticky-enabled_14iqq_1w0sy_205:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::before {
206
+ .awsui_root_14iqq_fgdim_103.awsui_sticky-enabled_14iqq_fgdim_205:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::before {
207
207
  inset-block-start: calc(-1 * var(--border-container-top-width-uugwwl, 0px));
208
208
  }
209
- .awsui_root_14iqq_1w0sy_103.awsui_sticky-enabled_14iqq_1w0sy_205:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155).awsui_variant-stacked_14iqq_1w0sy_147::before {
209
+ .awsui_root_14iqq_fgdim_103.awsui_sticky-enabled_14iqq_fgdim_205:not(#\9):not(.awsui_refresh_14iqq_fgdim_155).awsui_variant-stacked_14iqq_fgdim_147::before {
210
210
  inset-block-start: calc(-1 * var(--border-divider-section-width-1061zr, 1px));
211
211
  }
212
212
 
213
- .awsui_with-side-media_14iqq_1w0sy_144:not(#\9) {
213
+ .awsui_with-side-media_14iqq_fgdim_144:not(#\9) {
214
214
  display: flex;
215
215
  flex-direction: row;
216
216
  }
217
217
 
218
- .awsui_with-top-media_14iqq_1w0sy_217:not(#\9) {
218
+ .awsui_with-top-media_14iqq_fgdim_217:not(#\9) {
219
219
  display: flex;
220
220
  flex-direction: column;
221
221
  }
222
222
 
223
- .awsui_content-wrapper_14iqq_1w0sy_222:not(#\9) {
223
+ .awsui_content-wrapper_14iqq_fgdim_222:not(#\9) {
224
224
  display: flex;
225
225
  flex-direction: column;
226
226
  inline-size: 100%;
227
227
  }
228
- .awsui_content-wrapper-fit-height_14iqq_1w0sy_227:not(#\9) {
228
+ .awsui_content-wrapper-fit-height_14iqq_fgdim_227:not(#\9) {
229
229
  block-size: 100%;
230
230
  overflow: hidden;
231
231
  border-end-start-radius: var(--border-radius-container-wqv1zi, 16px);
232
232
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
233
233
  }
234
234
 
235
- .awsui_media_14iqq_1w0sy_234:not(#\9) {
235
+ .awsui_media_14iqq_fgdim_234:not(#\9) {
236
236
  overflow: hidden;
237
237
  flex-shrink: 0;
238
238
  }
239
- .awsui_media_14iqq_1w0sy_234 img:not(#\9),
240
- .awsui_media_14iqq_1w0sy_234 video:not(#\9),
241
- .awsui_media_14iqq_1w0sy_234 picture:not(#\9) {
239
+ .awsui_media_14iqq_fgdim_234 img:not(#\9),
240
+ .awsui_media_14iqq_fgdim_234 video:not(#\9),
241
+ .awsui_media_14iqq_fgdim_234 picture:not(#\9) {
242
242
  inline-size: 100%;
243
243
  block-size: 100%;
244
244
  object-fit: cover;
245
245
  object-position: center;
246
246
  }
247
- .awsui_media_14iqq_1w0sy_234 iframe:not(#\9) {
247
+ .awsui_media_14iqq_fgdim_234 iframe:not(#\9) {
248
248
  inline-size: 100%;
249
249
  block-size: 100%;
250
250
  border-block: 0;
251
251
  border-inline: 0;
252
252
  }
253
- .awsui_media-top_14iqq_1w0sy_252:not(#\9) {
253
+ .awsui_media-top_14iqq_fgdim_252:not(#\9) {
254
254
  max-block-size: 66%;
255
255
  border-start-start-radius: calc(var(--border-radius-container-wqv1zi, 16px) - 1px);
256
256
  border-start-end-radius: calc(var(--border-radius-container-wqv1zi, 16px) - 1px);
257
257
  }
258
- .awsui_media-side_14iqq_1w0sy_257:not(#\9) {
258
+ .awsui_media-side_14iqq_fgdim_257:not(#\9) {
259
259
  max-inline-size: 66%;
260
260
  border-start-start-radius: calc(var(--border-radius-container-wqv1zi, 16px) - 1px);
261
261
  border-end-start-radius: calc(var(--border-radius-container-wqv1zi, 16px) - 1px);
262
262
  }
263
263
 
264
- .awsui_header_14iqq_1w0sy_263:not(#\9) {
264
+ .awsui_header_14iqq_fgdim_263:not(#\9) {
265
265
  background-color: var(--color-background-container-header-8b9fgi, #ffffff);
266
266
  border-start-start-radius: var(--border-radius-container-wqv1zi, 16px);
267
267
  border-start-end-radius: var(--border-radius-container-wqv1zi, 16px);
268
268
  }
269
- .awsui_header_14iqq_1w0sy_263.awsui_header-with-media_14iqq_1w0sy_268:not(#\9) {
269
+ .awsui_header_14iqq_fgdim_263.awsui_header-with-media_14iqq_fgdim_268:not(#\9) {
270
270
  background: none;
271
271
  }
272
- .awsui_header_14iqq_1w0sy_263.awsui_header-with-media_14iqq_1w0sy_268:not(#\9):not(:empty) {
272
+ .awsui_header_14iqq_fgdim_263.awsui_header-with-media_14iqq_fgdim_268:not(#\9):not(:empty) {
273
273
  border-block-end: none;
274
274
  }
275
- .awsui_header-sticky-disabled_14iqq_1w0sy_274:not(#\9) {
275
+ .awsui_header-sticky-disabled_14iqq_fgdim_274:not(#\9) {
276
276
  position: relative;
277
277
  z-index: 1;
278
278
  }
279
- .awsui_header-sticky-enabled_14iqq_1w0sy_278:not(#\9) {
279
+ .awsui_header-sticky-enabled_14iqq_fgdim_278:not(#\9) {
280
280
  inset-block-start: 0;
281
281
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
282
282
  position: sticky;
283
283
  z-index: 800;
284
284
  }
285
- .awsui_header-stuck_14iqq_1w0sy_284:not(#\9) {
285
+ .awsui_header-stuck_14iqq_fgdim_284:not(#\9) {
286
286
  border-start-start-radius: 0;
287
287
  border-start-end-radius: 0;
288
288
  border-end-start-radius: 0;
289
289
  border-end-end-radius: 0;
290
290
  }
291
- .awsui_header-stuck_14iqq_1w0sy_284:not(#\9)::before {
291
+ .awsui_header-stuck_14iqq_fgdim_284:not(#\9)::before {
292
292
  border-block: 0;
293
293
  border-inline: 0;
294
294
  }
295
- .awsui_header-stuck_14iqq_1w0sy_284:not(#\9):not(.awsui_header-variant-cards_14iqq_1w0sy_294) {
295
+ .awsui_header-stuck_14iqq_fgdim_284:not(#\9):not(.awsui_header-variant-cards_14iqq_fgdim_294) {
296
296
  box-shadow: var(--shadow-sticky-embedded-uvh5ry, 0px 2px 0px 0px #e9ebed, 0px 16px 16px -12px rgba(0, 7, 22, 0.1));
297
297
  }
298
- .awsui_header-dynamic-height_14iqq_1w0sy_297.awsui_header-stuck_14iqq_1w0sy_284:not(#\9) {
298
+ .awsui_header-dynamic-height_14iqq_fgdim_297.awsui_header-stuck_14iqq_fgdim_284:not(#\9) {
299
299
  margin-block-end: calc(var(--line-height-heading-xl-avbttk, 30px) - var(--line-height-heading-l-mmm3my, 24px));
300
300
  }
301
- .awsui_header_14iqq_1w0sy_263:not(#\9):not(:empty) {
301
+ .awsui_header_14iqq_fgdim_263:not(#\9):not(:empty) {
302
302
  border-block-end: var(--border-container-sticky-width-6asz33, 0px) solid var(--color-border-container-divider-p2uygo, transparent);
303
303
  }
304
- .awsui_header_14iqq_1w0sy_263.awsui_with-paddings_14iqq_1w0sy_303:not(#\9) {
304
+ .awsui_header_14iqq_fgdim_263.awsui_with-paddings_14iqq_fgdim_303:not(#\9) {
305
305
  padding-block-start: var(--space-container-header-top-5qav00, 12px);
306
306
  padding-block-end: var(--space-container-header-bottom-vj01hn, 8px);
307
307
  padding-inline: var(--space-container-horizontal-wfukh3, 20px);
308
308
  }
309
- .awsui_header_14iqq_1w0sy_263.awsui_with-paddings_14iqq_1w0sy_303.awsui_header-variant-cards_14iqq_1w0sy_294:not(#\9) {
309
+ .awsui_header_14iqq_fgdim_263.awsui_with-paddings_14iqq_fgdim_303.awsui_header-variant-cards_14iqq_fgdim_294:not(#\9) {
310
310
  padding-block: var(--space-container-header-top-5qav00, 12px);
311
311
  padding-inline: var(--space-container-horizontal-wfukh3, 20px);
312
312
  }
313
- .awsui_header_14iqq_1w0sy_263.awsui_with-hidden-content_14iqq_1w0sy_312:not(#\9) {
313
+ .awsui_header_14iqq_fgdim_263.awsui_with-hidden-content_14iqq_fgdim_312:not(#\9) {
314
314
  border-end-start-radius: var(--border-radius-container-wqv1zi, 16px);
315
315
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
316
316
  }
317
- .awsui_header-variant-cards_14iqq_1w0sy_294:not(#\9) {
317
+ .awsui_header-variant-cards_14iqq_fgdim_294:not(#\9) {
318
318
  border-start-start-radius: var(--border-radius-container-wqv1zi, 16px);
319
319
  border-start-end-radius: var(--border-radius-container-wqv1zi, 16px);
320
320
  border-end-start-radius: var(--border-radius-container-wqv1zi, 16px);
321
321
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
322
322
  box-sizing: border-box;
323
323
  }
324
- .awsui_header-variant-cards_14iqq_1w0sy_294.awsui_refresh_14iqq_1w0sy_155:not(#\9) {
324
+ .awsui_header-variant-cards_14iqq_fgdim_294.awsui_refresh_14iqq_fgdim_155:not(#\9) {
325
325
  border-block: solid var(--border-divider-section-width-1061zr, 1px) var(--color-border-divider-default-j74lyz, #b6bec9);
326
326
  border-inline: solid var(--border-divider-section-width-1061zr, 1px) var(--color-border-divider-default-j74lyz, #b6bec9);
327
327
  }
328
- .awsui_header-variant-cards_14iqq_1w0sy_294:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::before {
328
+ .awsui_header-variant-cards_14iqq_fgdim_294:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::before {
329
329
  content: "";
330
330
  position: absolute;
331
331
  inset-inline-start: 0px;
@@ -343,7 +343,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
343
343
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
344
344
  z-index: 1;
345
345
  }
346
- .awsui_header-variant-cards_14iqq_1w0sy_294:not(#\9):not(.awsui_refresh_14iqq_1w0sy_155)::after {
346
+ .awsui_header-variant-cards_14iqq_fgdim_294:not(#\9):not(.awsui_refresh_14iqq_fgdim_155)::after {
347
347
  content: "";
348
348
  position: absolute;
349
349
  inset-inline-start: 0px;
@@ -359,22 +359,29 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
359
359
  border-end-end-radius: var(--border-radius-container-wqv1zi, 16px);
360
360
  box-shadow: var(--shadow-container-fxmdn3, 0px 0px 1px 1px #e9ebed, 0px 1px 8px 2px rgba(0, 7, 22, 0.12));
361
361
  }
362
- .awsui_header-variant-cards_14iqq_1w0sy_294:not(#\9):not(.awsui_header-sticky-enabled_14iqq_1w0sy_278) {
362
+ .awsui_header-variant-cards_14iqq_fgdim_294:not(#\9):not(.awsui_header-sticky-enabled_14iqq_fgdim_278) {
363
363
  position: relative;
364
364
  }
365
- .awsui_header-variant-cards_14iqq_1w0sy_294.awsui_header-stuck_14iqq_1w0sy_284:not(#\9)::after, .awsui_header-variant-cards_14iqq_1w0sy_294.awsui_header-stuck_14iqq_1w0sy_284:not(#\9)::before {
365
+ .awsui_header-variant-cards_14iqq_fgdim_294.awsui_header-stuck_14iqq_fgdim_284:not(#\9)::after, .awsui_header-variant-cards_14iqq_fgdim_294.awsui_header-stuck_14iqq_fgdim_284:not(#\9)::before {
366
366
  border-block: 0;
367
367
  border-inline: 0;
368
368
  border-start-start-radius: 0;
369
369
  border-start-end-radius: 0;
370
370
  }
371
- .awsui_header-variant-full-page_14iqq_1w0sy_370.awsui_with-toolbar_14iqq_1w0sy_370:not(#\9) {
371
+ .awsui_header-variant-full-page_14iqq_fgdim_370.awsui_with-toolbar_14iqq_fgdim_370:not(#\9) {
372
372
  padding-block-start: var(--space-scaled-s-aqzyko, 12px);
373
373
  }
374
- .awsui_header-variant-full-page_14iqq_1w0sy_370.awsui_header-stuck_14iqq_1w0sy_284:not(#\9) {
374
+ .awsui_header-variant-full-page_14iqq_fgdim_370.awsui_header-stuck_14iqq_fgdim_284:not(#\9) {
375
375
  box-shadow: none;
376
376
  }
377
- .awsui_header-variant-full-page_14iqq_1w0sy_370.awsui_header-stuck_14iqq_1w0sy_284:not(#\9)::before {
377
+ .awsui_header-variant-full-page_14iqq_fgdim_370.awsui_header-stuck_14iqq_fgdim_284 > .awsui_header-cover_14iqq_fgdim_376:not(#\9) {
378
+ background-color: var(--color-background-layout-main-nx09lr, #ffffff);
379
+ inline-size: 100%;
380
+ position: absolute;
381
+ block-size: var(--space-scaled-s-aqzyko, 12px);
382
+ inset-block-start: calc(-1 * var(--space-scaled-s-aqzyko, 12px));
383
+ }
384
+ .awsui_header-variant-full-page_14iqq_fgdim_370.awsui_header-stuck_14iqq_fgdim_284:not(#\9)::before {
378
385
  content: "";
379
386
  position: absolute;
380
387
  pointer-events: none;
@@ -384,7 +391,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
384
391
  inset-block-start: 0;
385
392
  border-block-end: solid var(--border-divider-section-width-1061zr, 1px) var(--color-border-divider-default-j74lyz, #b6bec9);
386
393
  }
387
- .awsui_header-variant-full-page_14iqq_1w0sy_370.awsui_header-stuck_14iqq_1w0sy_284:not(#\9)::after {
394
+ .awsui_header-variant-full-page_14iqq_fgdim_370.awsui_header-stuck_14iqq_fgdim_284:not(#\9)::after {
388
395
  content: "";
389
396
  position: absolute;
390
397
  inset: 0;
@@ -392,27 +399,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
392
399
  clip-path: polygon(-999% 100%, 999% 100%, 999% 999%, -999% 999%);
393
400
  }
394
401
 
395
- .awsui_content_14iqq_1w0sy_222:not(#\9) {
402
+ .awsui_content_14iqq_fgdim_222:not(#\9) {
396
403
  flex: 1;
397
404
  }
398
- .awsui_content-fit-height_14iqq_1w0sy_397:not(#\9) {
405
+ .awsui_content-fit-height_14iqq_fgdim_404:not(#\9) {
399
406
  overflow: auto;
400
407
  }
401
- .awsui_content_14iqq_1w0sy_222.awsui_with-paddings_14iqq_1w0sy_303:not(#\9) {
408
+ .awsui_content_14iqq_fgdim_222.awsui_with-paddings_14iqq_fgdim_303:not(#\9) {
402
409
  padding-block: var(--space-scaled-l-0hpmd7, 20px);
403
410
  padding-inline: var(--space-container-horizontal-wfukh3, 20px);
404
411
  }
405
- .awsui_header_14iqq_1w0sy_263 + .awsui_content_14iqq_1w0sy_222.awsui_with-paddings_14iqq_1w0sy_303:not(#\9) {
412
+ .awsui_header_14iqq_fgdim_263 + .awsui_content_14iqq_fgdim_222.awsui_with-paddings_14iqq_fgdim_303:not(#\9) {
406
413
  padding-block-start: var(--space-container-content-top-1ae0r3, 4px);
407
414
  }
408
- .awsui_header_14iqq_1w0sy_263 + .awsui_content_14iqq_1w0sy_222.awsui_with-paddings_14iqq_1w0sy_303.awsui_content-with-media_14iqq_1w0sy_407:not(#\9) {
415
+ .awsui_header_14iqq_fgdim_263 + .awsui_content_14iqq_fgdim_222.awsui_with-paddings_14iqq_fgdim_303.awsui_content-with-media_14iqq_fgdim_414:not(#\9) {
409
416
  padding-block-start: 0;
410
417
  }
411
418
 
412
- .awsui_footer_14iqq_1w0sy_411.awsui_with-paddings_14iqq_1w0sy_303:not(#\9) {
419
+ .awsui_footer_14iqq_fgdim_418.awsui_with-paddings_14iqq_fgdim_303:not(#\9) {
413
420
  padding-block: var(--space-scaled-s-aqzyko, 12px);
414
421
  padding-inline: var(--space-container-horizontal-wfukh3, 20px);
415
422
  }
416
- .awsui_footer_14iqq_1w0sy_411.awsui_with-divider_14iqq_1w0sy_415:not(#\9) {
423
+ .awsui_footer_14iqq_fgdim_418.awsui_with-divider_14iqq_fgdim_422:not(#\9) {
417
424
  border-block-start: var(--border-divider-section-width-1061zr, 1px) solid var(--color-border-divider-default-j74lyz, #b6bec9);
418
425
  }
@@ -2,34 +2,35 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_14iqq_1w0sy_103",
6
- "fit-height": "awsui_fit-height_14iqq_1w0sy_139",
7
- "with-side-media": "awsui_with-side-media_14iqq_1w0sy_144",
8
- "variant-default": "awsui_variant-default_14iqq_1w0sy_147",
9
- "variant-stacked": "awsui_variant-stacked_14iqq_1w0sy_147",
10
- "refresh": "awsui_refresh_14iqq_1w0sy_155",
11
- "sticky-enabled": "awsui_sticky-enabled_14iqq_1w0sy_205",
12
- "with-top-media": "awsui_with-top-media_14iqq_1w0sy_217",
13
- "content-wrapper": "awsui_content-wrapper_14iqq_1w0sy_222",
14
- "content-wrapper-fit-height": "awsui_content-wrapper-fit-height_14iqq_1w0sy_227",
15
- "media": "awsui_media_14iqq_1w0sy_234",
16
- "media-top": "awsui_media-top_14iqq_1w0sy_252",
17
- "media-side": "awsui_media-side_14iqq_1w0sy_257",
18
- "header": "awsui_header_14iqq_1w0sy_263",
19
- "header-with-media": "awsui_header-with-media_14iqq_1w0sy_268",
20
- "header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_1w0sy_274",
21
- "header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_1w0sy_278",
22
- "header-stuck": "awsui_header-stuck_14iqq_1w0sy_284",
23
- "header-variant-cards": "awsui_header-variant-cards_14iqq_1w0sy_294",
24
- "header-dynamic-height": "awsui_header-dynamic-height_14iqq_1w0sy_297",
25
- "with-paddings": "awsui_with-paddings_14iqq_1w0sy_303",
26
- "with-hidden-content": "awsui_with-hidden-content_14iqq_1w0sy_312",
27
- "header-variant-full-page": "awsui_header-variant-full-page_14iqq_1w0sy_370",
28
- "with-toolbar": "awsui_with-toolbar_14iqq_1w0sy_370",
29
- "content": "awsui_content_14iqq_1w0sy_222",
30
- "content-fit-height": "awsui_content-fit-height_14iqq_1w0sy_397",
31
- "content-with-media": "awsui_content-with-media_14iqq_1w0sy_407",
32
- "footer": "awsui_footer_14iqq_1w0sy_411",
33
- "with-divider": "awsui_with-divider_14iqq_1w0sy_415"
5
+ "root": "awsui_root_14iqq_fgdim_103",
6
+ "fit-height": "awsui_fit-height_14iqq_fgdim_139",
7
+ "with-side-media": "awsui_with-side-media_14iqq_fgdim_144",
8
+ "variant-default": "awsui_variant-default_14iqq_fgdim_147",
9
+ "variant-stacked": "awsui_variant-stacked_14iqq_fgdim_147",
10
+ "refresh": "awsui_refresh_14iqq_fgdim_155",
11
+ "sticky-enabled": "awsui_sticky-enabled_14iqq_fgdim_205",
12
+ "with-top-media": "awsui_with-top-media_14iqq_fgdim_217",
13
+ "content-wrapper": "awsui_content-wrapper_14iqq_fgdim_222",
14
+ "content-wrapper-fit-height": "awsui_content-wrapper-fit-height_14iqq_fgdim_227",
15
+ "media": "awsui_media_14iqq_fgdim_234",
16
+ "media-top": "awsui_media-top_14iqq_fgdim_252",
17
+ "media-side": "awsui_media-side_14iqq_fgdim_257",
18
+ "header": "awsui_header_14iqq_fgdim_263",
19
+ "header-with-media": "awsui_header-with-media_14iqq_fgdim_268",
20
+ "header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_fgdim_274",
21
+ "header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_fgdim_278",
22
+ "header-stuck": "awsui_header-stuck_14iqq_fgdim_284",
23
+ "header-variant-cards": "awsui_header-variant-cards_14iqq_fgdim_294",
24
+ "header-dynamic-height": "awsui_header-dynamic-height_14iqq_fgdim_297",
25
+ "with-paddings": "awsui_with-paddings_14iqq_fgdim_303",
26
+ "with-hidden-content": "awsui_with-hidden-content_14iqq_fgdim_312",
27
+ "header-variant-full-page": "awsui_header-variant-full-page_14iqq_fgdim_370",
28
+ "with-toolbar": "awsui_with-toolbar_14iqq_fgdim_370",
29
+ "header-cover": "awsui_header-cover_14iqq_fgdim_376",
30
+ "content": "awsui_content_14iqq_fgdim_222",
31
+ "content-fit-height": "awsui_content-fit-height_14iqq_fgdim_404",
32
+ "content-with-media": "awsui_content-with-media_14iqq_fgdim_414",
33
+ "footer": "awsui_footer_14iqq_fgdim_418",
34
+ "with-divider": "awsui_with-divider_14iqq_fgdim_422"
34
35
  };
35
36
 
@@ -7,10 +7,11 @@ interface ComputeOffsetProps {
7
7
  __stickyOffset?: number;
8
8
  __mobileStickyOffset?: number;
9
9
  hasInnerOverflowParents: boolean;
10
+ __additionalOffset?: boolean;
10
11
  }
11
- export declare function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, }: ComputeOffsetProps): string;
12
+ export declare function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, __additionalOffset, }: ComputeOffsetProps): string;
12
13
  export declare const StickyHeaderContext: import("react").Context<StickyHeaderContextProps>;
13
- export declare const useStickyHeader: (rootRef: RefObject<HTMLDivElement>, headerRef: RefObject<HTMLDivElement>, __stickyHeader?: boolean, __stickyOffset?: number, __mobileStickyOffset?: number, __disableMobile?: boolean) => {
14
+ export declare const useStickyHeader: (rootRef: RefObject<HTMLDivElement>, headerRef: RefObject<HTMLDivElement>, __stickyHeader?: boolean, __stickyOffset?: number, __mobileStickyOffset?: number, __disableMobile?: boolean, __additionalOffset?: boolean) => {
14
15
  isSticky: boolean;
15
16
  isStuck: boolean;
16
17
  stickyStyles: {
@@ -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;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
+ {"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,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GACnB,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,oBACX,OAAO;;;;;;;;;;CAoE1B,CAAC"}
@@ -5,18 +5,19 @@ import { findUpUntil } from '../internal/utils/dom';
5
5
  import { getOverflowParents } from '../internal/utils/scrollable-containers';
6
6
  import { useMobile } from '../internal/hooks/use-mobile';
7
7
  import globalVars from '../internal/styles/global-vars';
8
- export function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, }) {
8
+ import * as tokens from '../internal/generated/styles/tokens';
9
+ export function computeOffset({ isMobile, __stickyOffset, __mobileStickyOffset, hasInnerOverflowParents, __additionalOffset, }) {
9
10
  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
11
  if (hasInnerOverflowParents || __stickyOffset !== undefined) {
11
12
  return `${localOffset}px`;
12
13
  }
13
14
  const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;
14
- return `calc(${globalOffset} + ${localOffset}px)`;
15
+ return `calc(${globalOffset} + ${localOffset}px + ${__additionalOffset ? tokens.spaceScaledS : '0px'})`;
15
16
  }
16
17
  export const StickyHeaderContext = createContext({
17
18
  isStuck: false,
18
19
  });
19
- export const useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffset, __mobileStickyOffset, __disableMobile = true) => {
20
+ export const useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffset, __mobileStickyOffset, __disableMobile, __additionalOffset = false) => {
20
21
  const isMobile = useMobile();
21
22
  const disableSticky = isMobile && __disableMobile;
22
23
  const isSticky = !disableSticky && !!__stickyHeader;
@@ -39,6 +40,7 @@ export const useStickyHeader = (rootRef, headerRef, __stickyHeader, __stickyOffs
39
40
  __stickyOffset,
40
41
  __mobileStickyOffset,
41
42
  hasInnerOverflowParents,
43
+ __additionalOffset,
42
44
  });
43
45
  const stickyStyles = isSticky
44
46
  ? {
@@ -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,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAaxD,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,uBAAuB,GACJ;IACnB,MAAM,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,CAAC,GAAG,CAAC,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,CAAC;IACzG,IAAI,uBAAuB,IAAI,cAAc,KAAK,SAAS,EAAE;QAC3D,OAAO,GAAG,WAAW,IAAI,CAAC;KAC3B;IACD,MAAM,YAAY,GAAG,OAAO,UAAU,CAAC,uBAAuB,QAAQ,CAAC;IAEvE,OAAO,QAAQ,YAAY,MAAM,WAAW,KAAK,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAA2B;IACzE,OAAO,EAAE,KAAK;CACf,CAAC,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yD;IACzD,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,IAAI,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE;YACxC,MAAM,kBAAkB,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7F,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,GAAG,GAAG,kBAAkB,CAAC;YACjF,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAC;YAEhE,IAAI,OAAO,GAAG,SAAS,EAAE;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 } 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 || __stickyOffset !== undefined) {\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 = !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
+ {"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,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,qCAAqC,CAAC;AAc9D,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GACC;IACnB,MAAM,W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;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 } 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';\nimport * as tokens from '../internal/generated/styles/tokens';\n\ninterface StickyHeaderContextProps {\n isStuck: boolean;\n}\n\ninterface ComputeOffsetProps {\n isMobile: boolean;\n __stickyOffset?: number;\n __mobileStickyOffset?: number;\n hasInnerOverflowParents: boolean;\n __additionalOffset?: boolean;\n}\n\nexport function computeOffset({\n isMobile,\n __stickyOffset,\n __mobileStickyOffset,\n hasInnerOverflowParents,\n __additionalOffset,\n}: ComputeOffsetProps): string {\n const localOffset = isMobile ? (__stickyOffset ?? 0) - (__mobileStickyOffset ?? 0) : __stickyOffset ?? 0;\n if (hasInnerOverflowParents || __stickyOffset !== undefined) {\n return `${localOffset}px`;\n }\n const globalOffset = `var(${globalVars.stickyVerticalTopOffset}, 0px)`;\n\n return `calc(${globalOffset} + ${localOffset}px + ${__additionalOffset ? tokens.spaceScaledS : '0px'})`;\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?: boolean,\n __additionalOffset = false\n) => {\n const isMobile = useMobile();\n const disableSticky = isMobile && __disableMobile;\n const isSticky = !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 __additionalOffset,\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"]}
@@ -35,7 +35,7 @@ export default function InternalContentLayout(_a) {
35
35
  }), style: {
36
36
  [customCssProps.contentLayoutMaxContentWidth]: maxContentWidth < Number.MAX_VALUE ? `${maxContentWidth}px` : `${halfGeckoMaxCssLength}px`,
37
37
  }, ref: mergedRef }),
38
- React.createElement("div", { className: clsx(styles.background, { [styles['has-default-background']]: !headerBackgroundStyle }, contentHeaderClassName), ref: overlapElement }, headerBackgroundStyle && (React.createElement("div", { className: clsx(styles['header-background']), style: {
38
+ React.createElement("div", { className: clsx(styles.background, { [styles['has-default-background']]: !headerBackgroundStyle }, contentHeaderClassName), ref: overlapElement }, headerBackgroundStyle && (React.createElement("div", { className: styles['header-background'], style: {
39
39
  background: typeof headerBackgroundStyle === 'function' ? headerBackgroundStyle(mode) : headerBackgroundStyle,
40
40
  } }))),
41
41
  notifications && (React.createElement("div", { className: clsx(styles.notifications, testutilStyles.notifications, contentHeaderClassName) }, notifications)),
@@ -48,7 +48,7 @@ export default function InternalContentLayout(_a) {
48
48
  }) },
49
49
  React.createElement(InternalGrid, { gridDefinition: [{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }] },
50
50
  React.createElement("div", { className: clsx(testutilStyles.header, contentHeaderClassName) }, header),
51
- React.createElement("div", { className: clsx(testutilStyles['secondary-header']) }, secondaryHeader)))),
51
+ React.createElement("div", { className: testutilStyles['secondary-header'] }, secondaryHeader)))),
52
52
  React.createElement("div", { className: clsx(styles.content, {
53
53
  [styles['with-divider']]: headerVariant === 'divider',
54
54
  }) }, children)));
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/content-layout/internal.tsx"],"names":[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C,MAAM,CAAC,OAAO,EAAE;gBAC9B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,KAAK,SAAS;aACtD,CAAC,IAED,QAAQ,CACL,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { ContentLayoutProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { highContrastHeaderClassName } from '../internal/utils/content-header-utils';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport { useCurrentMode } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport InternalGrid from '../grid/internal';\n\ntype InternalContentLayoutProps = ContentLayoutProps & InternalBaseComponentProps;\n\nconst halfGeckoMaxCssLength = ((1 << 30) - 1) / 120;\n// CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n// Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n\nexport default function InternalContentLayout({\n children,\n disableOverlap,\n header,\n headerVariant = 'default',\n headerBackgroundStyle,\n __internalRootRef,\n maxContentWidth = Number.MAX_VALUE,\n breadcrumbs,\n notifications,\n defaultPadding,\n secondaryHeader,\n ...rest\n}: InternalContentLayoutProps) {\n const mainRef = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(mainRef, __internalRootRef);\n\n const baseProps = getBaseProps(rest);\n\n const isVisualRefresh = useVisualRefresh();\n const mode = useCurrentMode(mainRef);\n\n const overlapElement = useDynamicOverlap();\n\n const isOverlapDisabled = !children || disableOverlap;\n\n const contentHeaderClassName =\n headerVariant === 'high-contrast' && isVisualRefresh ? highContrastHeaderClassName : '';\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.layout, {\n [styles['is-overlap-disabled']]: isOverlapDisabled,\n [styles['is-visual-refresh']]: isVisualRefresh,\n [styles['has-header']]: !!header,\n [styles['default-padding']]: !!defaultPadding,\n [styles['has-notifications']]: !!notifications,\n })}\n style={{\n [customCssProps.contentLayoutMaxContentWidth]:\n maxContentWidth < Number.MAX_VALUE ? `${maxContentWidth}px` : `${halfGeckoMaxCssLength}px`,\n }}\n ref={mergedRef}\n >\n <div\n className={clsx(\n styles.background,\n { [styles['has-default-background']]: !headerBackgroundStyle },\n contentHeaderClassName\n )}\n ref={overlapElement}\n >\n {headerBackgroundStyle && (\n <div\n className={clsx(styles['header-background'])}\n style={{\n background:\n typeof headerBackgroundStyle === 'function' ? headerBackgroundStyle(mode) : headerBackgroundStyle,\n }}\n />\n )}\n </div>\n {notifications && (\n <div className={clsx(styles.notifications, testutilStyles.notifications, contentHeaderClassName)}>\n {notifications}\n </div>\n )}\n {breadcrumbs && (\n <div className={clsx(styles.breadcrumbs, testutilStyles.breadcrumbs, contentHeaderClassName)}>\n {breadcrumbs}\n </div>\n )}\n {header && !secondaryHeader && (\n <div\n className={clsx(styles['header-wrapper'], testutilStyles.header, contentHeaderClassName, {\n [styles['with-divider']]: headerVariant === 'divider',\n })}\n >\n {header}\n </div>\n )}\n {header && secondaryHeader && (\n <div\n className={clsx(styles['header-wrapper'], {\n [styles['with-divider']]: headerVariant === 'divider',\n })}\n >\n <InternalGrid gridDefinition={[{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }]}>\n <div className={clsx(testutilStyles.header, contentHeaderClassName)}>{header}</div>\n <div className={clsx(testutilStyles['secondary-header'])}>{secondaryHeader}</div>\n </InternalGrid>\n </div>\n )}\n\n <div\n className={clsx(styles.content, {\n [styles['with-divider']]: headerVariant === 'divider',\n })}\n >\n {children}\n </div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,CAC9D,CACX,CACP;QAED,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;gBAC9B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,aAAa,KAAK,SAAS;aACtD,CAAC,IAED,QAAQ,CACL,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { ContentLayoutProps } from './interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { highContrastHeaderClassName } from '../internal/utils/content-header-utils';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useDynamicOverlap } from '../internal/hooks/use-dynamic-overlap';\nimport { useCurrentMode } from '@cloudscape-design/component-toolkit/internal';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\nimport InternalGrid from '../grid/internal';\n\ntype InternalContentLayoutProps = ContentLayoutProps & InternalBaseComponentProps;\n\nconst halfGeckoMaxCssLength = ((1 << 30) - 1) / 120;\n// CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n// Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n\nexport default function InternalContentLayout({\n children,\n disableOverlap,\n header,\n headerVariant = 'default',\n headerBackgroundStyle,\n __internalRootRef,\n maxContentWidth = Number.MAX_VALUE,\n breadcrumbs,\n notifications,\n defaultPadding,\n secondaryHeader,\n ...rest\n}: InternalContentLayoutProps) {\n const mainRef = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(mainRef, __internalRootRef);\n\n const baseProps = getBaseProps(rest);\n\n const isVisualRefresh = useVisualRefresh();\n const mode = useCurrentMode(mainRef);\n\n const overlapElement = useDynamicOverlap();\n\n const isOverlapDisabled = !children || disableOverlap;\n\n const contentHeaderClassName =\n headerVariant === 'high-contrast' && isVisualRefresh ? highContrastHeaderClassName : '';\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles.layout, {\n [styles['is-overlap-disabled']]: isOverlapDisabled,\n [styles['is-visual-refresh']]: isVisualRefresh,\n [styles['has-header']]: !!header,\n [styles['default-padding']]: !!defaultPadding,\n [styles['has-notifications']]: !!notifications,\n })}\n style={{\n [customCssProps.contentLayoutMaxContentWidth]:\n maxContentWidth < Number.MAX_VALUE ? `${maxContentWidth}px` : `${halfGeckoMaxCssLength}px`,\n }}\n ref={mergedRef}\n >\n <div\n className={clsx(\n styles.background,\n { [styles['has-default-background']]: !headerBackgroundStyle },\n contentHeaderClassName\n )}\n ref={overlapElement}\n >\n {headerBackgroundStyle && (\n <div\n className={styles['header-background']}\n style={{\n background:\n typeof headerBackgroundStyle === 'function' ? headerBackgroundStyle(mode) : headerBackgroundStyle,\n }}\n />\n )}\n </div>\n {notifications && (\n <div className={clsx(styles.notifications, testutilStyles.notifications, contentHeaderClassName)}>\n {notifications}\n </div>\n )}\n {breadcrumbs && (\n <div className={clsx(styles.breadcrumbs, testutilStyles.breadcrumbs, contentHeaderClassName)}>\n {breadcrumbs}\n </div>\n )}\n {header && !secondaryHeader && (\n <div\n className={clsx(styles['header-wrapper'], testutilStyles.header, contentHeaderClassName, {\n [styles['with-divider']]: headerVariant === 'divider',\n })}\n >\n {header}\n </div>\n )}\n {header && secondaryHeader && (\n <div\n className={clsx(styles['header-wrapper'], {\n [styles['with-divider']]: headerVariant === 'divider',\n })}\n >\n <InternalGrid gridDefinition={[{ colspan: { default: 12, xs: 9 } }, { colspan: { default: 12, xs: 3 } }]}>\n <div className={clsx(testutilStyles.header, contentHeaderClassName)}>{header}</div>\n <div className={testutilStyles['secondary-header']}>{secondaryHeader}</div>\n </InternalGrid>\n </div>\n )}\n\n <div\n className={clsx(styles.content, {\n [styles['with-divider']]: headerVariant === 'divider',\n })}\n >\n {children}\n </div>\n </div>\n );\n}\n"]}
@@ -17,8 +17,8 @@ export function DrawerImplementation(_a) {
17
17
  return loading ? (React.createElement("div", Object.assign({}, containerProps, { ref: __internalRootRef }),
18
18
  React.createElement(InternalStatusIndicator, { type: "loading" },
19
19
  React.createElement(LiveRegion, { visible: true }, i18n('i18nStrings.loadingText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.loadingText))))) : (React.createElement("div", Object.assign({}, containerProps, { ref: __internalRootRef }),
20
- header && React.createElement("div", { className: clsx(styles.header) }, header),
21
- React.createElement("div", { className: clsx(styles['test-utils-drawer-content']) }, children)));
20
+ header && React.createElement("div", { className: styles.header }, header),
21
+ React.createElement("div", { className: styles['test-utils-drawer-content'] }, children)));
22
22
  }
23
23
  export const createWidgetizedDrawer = createWidgetizedComponent(DrawerImplementation);
24
24
  //# sourceMappingURL=implementation.js.map