@cloudscape-design/components-themeable 3.0.65 → 3.0.67

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 (137) hide show
  1. package/lib/internal/scss/internal/styles/typography/mixins.scss +9 -0
  2. package/lib/internal/scss/link/styles.scss +11 -1
  3. package/lib/internal/scss/popover/body.scss +0 -36
  4. package/lib/internal/scss/popover/container.scss +41 -0
  5. package/lib/internal/scss/split-panel/styles.scss +3 -0
  6. package/lib/internal/template/annotation-context/annotation/annotation-popover.d.ts.map +1 -1
  7. package/lib/internal/template/annotation-context/annotation/annotation-popover.js +2 -2
  8. package/lib/internal/template/annotation-context/annotation/annotation-popover.js.map +1 -1
  9. package/lib/internal/template/autosuggest/interfaces.d.ts +2 -2
  10. package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
  11. package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
  12. package/lib/internal/template/button-dropdown/tooltip.js +2 -2
  13. package/lib/internal/template/button-dropdown/tooltip.js.map +1 -1
  14. package/lib/internal/template/calendar/interfaces.d.ts +2 -1
  15. package/lib/internal/template/calendar/interfaces.d.ts.map +1 -1
  16. package/lib/internal/template/calendar/interfaces.js.map +1 -1
  17. package/lib/internal/template/calendar/internal.d.ts +2 -1
  18. package/lib/internal/template/calendar/internal.d.ts.map +1 -1
  19. package/lib/internal/template/calendar/internal.js +8 -3
  20. package/lib/internal/template/calendar/internal.js.map +1 -1
  21. package/lib/internal/template/cards/index.d.ts.map +1 -1
  22. package/lib/internal/template/cards/index.js +15 -5
  23. package/lib/internal/template/cards/index.js.map +1 -1
  24. package/lib/internal/template/checkbox/base-checkbox.d.ts +1 -5
  25. package/lib/internal/template/checkbox/base-checkbox.d.ts.map +1 -1
  26. package/lib/internal/template/checkbox/base-checkbox.js.map +1 -1
  27. package/lib/internal/template/checkbox/internal.d.ts.map +1 -1
  28. package/lib/internal/template/checkbox/internal.js +3 -1
  29. package/lib/internal/template/checkbox/internal.js.map +1 -1
  30. package/lib/internal/template/container/internal.d.ts +2 -1
  31. package/lib/internal/template/container/internal.d.ts.map +1 -1
  32. package/lib/internal/template/container/internal.js +3 -2
  33. package/lib/internal/template/container/internal.js.map +1 -1
  34. package/lib/internal/template/date-input/index.d.ts.map +1 -1
  35. package/lib/internal/template/date-input/index.js +3 -4
  36. package/lib/internal/template/date-input/index.js.map +1 -1
  37. package/lib/internal/template/date-input/internal.d.ts.map +1 -1
  38. package/lib/internal/template/date-input/internal.js +2 -2
  39. package/lib/internal/template/date-input/internal.js.map +1 -1
  40. package/lib/internal/template/date-range-picker/calendar/index.js +2 -2
  41. package/lib/internal/template/date-range-picker/calendar/index.js.map +1 -1
  42. package/lib/internal/template/form-field/internal.d.ts.map +1 -1
  43. package/lib/internal/template/form-field/internal.js +2 -2
  44. package/lib/internal/template/form-field/internal.js.map +1 -1
  45. package/lib/internal/template/index.d.ts +2 -0
  46. package/lib/internal/template/index.d.ts.map +1 -1
  47. package/lib/internal/template/index.js +2 -0
  48. package/lib/internal/template/index.js.map +1 -1
  49. package/lib/internal/template/input/interfaces.d.ts +11 -9
  50. package/lib/internal/template/input/interfaces.d.ts.map +1 -1
  51. package/lib/internal/template/input/interfaces.js.map +1 -1
  52. package/lib/internal/template/input/internal.d.ts +2 -2
  53. package/lib/internal/template/input/internal.d.ts.map +1 -1
  54. package/lib/internal/template/input/internal.js +7 -0
  55. package/lib/internal/template/input/internal.js.map +1 -1
  56. package/lib/internal/template/internal/base-component/styles.scoped.css +2 -5
  57. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts +2 -2
  58. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
  59. package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
  60. package/lib/internal/template/internal/components/chart-popover/index.js +2 -2
  61. package/lib/internal/template/internal/components/chart-popover/index.js.map +1 -1
  62. package/lib/internal/template/internal/components/checkbox-icon/styles.css.js +7 -7
  63. package/lib/internal/template/internal/components/checkbox-icon/styles.scoped.css +9 -9
  64. package/lib/internal/template/internal/components/checkbox-icon/styles.selectors.js +7 -7
  65. package/lib/internal/template/internal/components/dropdown-status/index.d.ts.map +1 -1
  66. package/lib/internal/template/internal/components/dropdown-status/index.js +1 -1
  67. package/lib/internal/template/internal/components/dropdown-status/index.js.map +1 -1
  68. package/lib/internal/template/internal/environment.js +1 -1
  69. package/lib/internal/template/link/interfaces.d.ts +1 -1
  70. package/lib/internal/template/link/interfaces.d.ts.map +1 -1
  71. package/lib/internal/template/link/interfaces.js.map +1 -1
  72. package/lib/internal/template/link/styles.css.js +20 -19
  73. package/lib/internal/template/link/styles.scoped.css +75 -70
  74. package/lib/internal/template/link/styles.selectors.js +20 -19
  75. package/lib/internal/template/package.json +2 -0
  76. package/lib/internal/template/pie-chart/styles.css.js +27 -27
  77. package/lib/internal/template/pie-chart/styles.scoped.css +44 -44
  78. package/lib/internal/template/pie-chart/styles.selectors.js +27 -27
  79. package/lib/internal/template/popover/body.d.ts +1 -4
  80. package/lib/internal/template/popover/body.d.ts.map +1 -1
  81. package/lib/internal/template/popover/body.js +2 -4
  82. package/lib/internal/template/popover/body.js.map +1 -1
  83. package/lib/internal/template/popover/container.d.ts +4 -1
  84. package/lib/internal/template/popover/container.d.ts.map +1 -1
  85. package/lib/internal/template/popover/container.js +51 -37
  86. package/lib/internal/template/popover/container.js.map +1 -1
  87. package/lib/internal/template/popover/internal.js +2 -2
  88. package/lib/internal/template/popover/internal.js.map +1 -1
  89. package/lib/internal/template/popover/styles.css.js +49 -48
  90. package/lib/internal/template/popover/styles.scoped.css +209 -89
  91. package/lib/internal/template/popover/styles.selectors.js +49 -48
  92. package/lib/internal/template/popover/utils/positions.d.ts +1 -0
  93. package/lib/internal/template/popover/utils/positions.d.ts.map +1 -1
  94. package/lib/internal/template/popover/utils/positions.js +40 -14
  95. package/lib/internal/template/popover/utils/positions.js.map +1 -1
  96. package/lib/internal/template/radio-group/interfaces.d.ts +5 -0
  97. package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
  98. package/lib/internal/template/radio-group/interfaces.js.map +1 -1
  99. package/lib/internal/template/radio-group/styles.css.js +9 -9
  100. package/lib/internal/template/radio-group/styles.scoped.css +16 -16
  101. package/lib/internal/template/radio-group/styles.selectors.js +9 -9
  102. package/lib/internal/template/split-panel/index.js +8 -8
  103. package/lib/internal/template/split-panel/index.js.map +1 -1
  104. package/lib/internal/template/split-panel/styles.css.js +58 -58
  105. package/lib/internal/template/split-panel/styles.scoped.css +81 -80
  106. package/lib/internal/template/split-panel/styles.selectors.js +58 -58
  107. package/lib/internal/template/split-panel/utils/use-pointer-events.d.ts +3 -0
  108. package/lib/internal/template/split-panel/utils/use-pointer-events.d.ts.map +1 -0
  109. package/lib/internal/template/split-panel/utils/{use-mouse-events.js → use-pointer-events.js} +12 -12
  110. package/lib/internal/template/split-panel/utils/use-pointer-events.js.map +1 -0
  111. package/lib/internal/template/tag-editor/interfaces.d.ts +1 -1
  112. package/lib/internal/template/tag-editor/interfaces.d.ts.map +1 -1
  113. package/lib/internal/template/tag-editor/interfaces.js.map +1 -1
  114. package/lib/internal/template/test-utils/dom/form-field/index.js +1 -1
  115. package/lib/internal/template/test-utils/dom/form-field/index.js.map +1 -1
  116. package/lib/internal/template/test-utils/dom/index.d.ts +6 -0
  117. package/lib/internal/template/test-utils/dom/index.js +18 -2
  118. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  119. package/lib/internal/template/test-utils/selectors/form-field/index.js +1 -1
  120. package/lib/internal/template/test-utils/selectors/form-field/index.js.map +1 -1
  121. package/lib/internal/template/test-utils/selectors/index.d.ts +6 -0
  122. package/lib/internal/template/test-utils/selectors/index.js +18 -2
  123. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  124. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  125. package/lib/internal/template/textarea/interfaces.d.ts +2 -2
  126. package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
  127. package/lib/internal/template/textarea/interfaces.js.map +1 -1
  128. package/lib/internal/template/time-input/interfaces.d.ts +2 -2
  129. package/lib/internal/template/time-input/interfaces.d.ts.map +1 -1
  130. package/lib/internal/template/time-input/interfaces.js.map +1 -1
  131. package/lib/internal/template/toggle/internal.d.ts.map +1 -1
  132. package/lib/internal/template/toggle/internal.js +3 -1
  133. package/lib/internal/template/toggle/internal.js.map +1 -1
  134. package/package.json +1 -1
  135. package/lib/internal/template/split-panel/utils/use-mouse-events.d.ts +0 -3
  136. package/lib/internal/template/split-panel/utils/use-mouse-events.d.ts.map +0 -1
  137. package/lib/internal/template/split-panel/utils/use-mouse-events.js.map +0 -1
@@ -94,57 +94,57 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
94
94
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
95
  SPDX-License-Identifier: Apache-2.0
96
96
  */
97
- .awsui_segment__path_1edmh_912m4_97:not(#\9) {
97
+ .awsui_segment__path_1edmh_1x93y_97:not(#\9) {
98
98
  transition: opacity var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
99
99
  }
100
100
  @media (prefers-reduced-motion: reduce) {
101
- .awsui_segment__path_1edmh_912m4_97:not(#\9) {
101
+ .awsui_segment__path_1edmh_1x93y_97:not(#\9) {
102
102
  animation: none;
103
103
  transition: none;
104
104
  }
105
105
  }
106
- .awsui-motion-disabled .awsui_segment__path_1edmh_912m4_97:not(#\9), .awsui-mode-entering .awsui_segment__path_1edmh_912m4_97:not(#\9) {
106
+ .awsui-motion-disabled .awsui_segment__path_1edmh_1x93y_97:not(#\9), .awsui-mode-entering .awsui_segment__path_1edmh_1x93y_97:not(#\9) {
107
107
  animation: none;
108
108
  transition: none;
109
109
  }
110
110
 
111
- .awsui_segment_1edmh_912m4_97:not(#\9) {
111
+ .awsui_segment_1edmh_1x93y_97:not(#\9) {
112
112
  transition: opacity var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
113
113
  }
114
114
  @media (prefers-reduced-motion: reduce) {
115
- .awsui_segment_1edmh_912m4_97:not(#\9) {
115
+ .awsui_segment_1edmh_1x93y_97:not(#\9) {
116
116
  animation: none;
117
117
  transition: none;
118
118
  }
119
119
  }
120
- .awsui-motion-disabled .awsui_segment_1edmh_912m4_97:not(#\9), .awsui-mode-entering .awsui_segment_1edmh_912m4_97:not(#\9) {
120
+ .awsui-motion-disabled .awsui_segment_1edmh_1x93y_97:not(#\9), .awsui-mode-entering .awsui_segment_1edmh_1x93y_97:not(#\9) {
121
121
  animation: none;
122
122
  transition: none;
123
123
  }
124
- .awsui_segment_1edmh_912m4_97 > .awsui_segment__hover_1edmh_912m4_124:not(#\9) {
124
+ .awsui_segment_1edmh_1x93y_97 > .awsui_segment__hover_1edmh_1x93y_124:not(#\9) {
125
125
  transition: opacity var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
126
126
  }
127
127
  @media (prefers-reduced-motion: reduce) {
128
- .awsui_segment_1edmh_912m4_97 > .awsui_segment__hover_1edmh_912m4_124:not(#\9) {
128
+ .awsui_segment_1edmh_1x93y_97 > .awsui_segment__hover_1edmh_1x93y_124:not(#\9) {
129
129
  animation: none;
130
130
  transition: none;
131
131
  }
132
132
  }
133
- .awsui-motion-disabled .awsui_segment_1edmh_912m4_97 > .awsui_segment__hover_1edmh_912m4_124:not(#\9), .awsui-mode-entering .awsui_segment_1edmh_912m4_97 > .awsui_segment__hover_1edmh_912m4_124:not(#\9) {
133
+ .awsui-motion-disabled .awsui_segment_1edmh_1x93y_97 > .awsui_segment__hover_1edmh_1x93y_124:not(#\9), .awsui-mode-entering .awsui_segment_1edmh_1x93y_97 > .awsui_segment__hover_1edmh_1x93y_124:not(#\9) {
134
134
  animation: none;
135
135
  transition: none;
136
136
  }
137
137
 
138
- .awsui_label_1edmh_912m4_138:not(#\9) {
138
+ .awsui_label_1edmh_1x93y_138:not(#\9) {
139
139
  transition: opacity var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
140
140
  }
141
141
  @media (prefers-reduced-motion: reduce) {
142
- .awsui_label_1edmh_912m4_138:not(#\9) {
142
+ .awsui_label_1edmh_1x93y_138:not(#\9) {
143
143
  animation: none;
144
144
  transition: none;
145
145
  }
146
146
  }
147
- .awsui-motion-disabled .awsui_label_1edmh_912m4_138:not(#\9), .awsui-mode-entering .awsui_label_1edmh_912m4_138:not(#\9) {
147
+ .awsui-motion-disabled .awsui_label_1edmh_1x93y_138:not(#\9), .awsui-mode-entering .awsui_label_1edmh_1x93y_138:not(#\9) {
148
148
  animation: none;
149
149
  transition: none;
150
150
  }
@@ -153,7 +153,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
153
153
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
154
154
  SPDX-License-Identifier: Apache-2.0
155
155
  */
156
- .awsui_root_1edmh_912m4_156:not(#\9) {
156
+ .awsui_root_1edmh_1x93y_156:not(#\9) {
157
157
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
158
158
  border-collapse: separate;
159
159
  border-spacing: 0;
@@ -191,55 +191,55 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
191
191
  display: block;
192
192
  }
193
193
 
194
- .awsui_filter-container_1edmh_912m4_168:not(#\9) {
194
+ .awsui_filter-container_1edmh_1x93y_168:not(#\9) {
195
195
  /* used in test-utils */
196
196
  }
197
197
 
198
- .awsui_has-default-filter_1edmh_912m4_172 > :not(#\9):first-child {
198
+ .awsui_has-default-filter_1edmh_1x93y_172 > :not(#\9):first-child {
199
199
  flex: 280px 0 1;
200
200
  }
201
201
 
202
- .awsui_content_1edmh_912m4_176:not(#\9) {
202
+ .awsui_content_1edmh_1x93y_176:not(#\9) {
203
203
  display: flex;
204
204
  position: relative;
205
205
  justify-content: center;
206
206
  align-items: center;
207
207
  }
208
- .awsui_content_1edmh_912m4_176.awsui_content--small_1edmh_912m4_182:not(#\9) {
208
+ .awsui_content_1edmh_1x93y_176.awsui_content--small_1edmh_1x93y_182:not(#\9) {
209
209
  min-height: calc(2 * (50px + var(--space-xs-rsr2qu, 8px) + calc(2 * var(--font-body-m-line-height-i7xxvv, 22px))));
210
210
  }
211
- .awsui_content_1edmh_912m4_176.awsui_content--small_1edmh_912m4_182.awsui_content--without-labels_1edmh_912m4_185:not(#\9) {
211
+ .awsui_content_1edmh_1x93y_176.awsui_content--small_1edmh_1x93y_182.awsui_content--without-labels_1edmh_1x93y_185:not(#\9) {
212
212
  min-height: calc(2 * (50px + var(--space-xs-rsr2qu, 8px)));
213
213
  }
214
- .awsui_content_1edmh_912m4_176.awsui_content--medium_1edmh_912m4_188:not(#\9) {
214
+ .awsui_content_1edmh_1x93y_176.awsui_content--medium_1edmh_1x93y_188:not(#\9) {
215
215
  min-height: calc(2 * (100px + var(--space-s-hv8c1d, 12px) + calc(2 * var(--font-body-m-line-height-i7xxvv, 22px))));
216
216
  }
217
- .awsui_content_1edmh_912m4_176.awsui_content--medium_1edmh_912m4_188.awsui_content--without-labels_1edmh_912m4_185:not(#\9) {
217
+ .awsui_content_1edmh_1x93y_176.awsui_content--medium_1edmh_1x93y_188.awsui_content--without-labels_1edmh_1x93y_185:not(#\9) {
218
218
  min-height: calc(2 * (100px + var(--space-s-hv8c1d, 12px)));
219
219
  }
220
- .awsui_content_1edmh_912m4_176.awsui_content--large_1edmh_912m4_194:not(#\9) {
220
+ .awsui_content_1edmh_1x93y_176.awsui_content--large_1edmh_1x93y_194:not(#\9) {
221
221
  min-height: calc(2 * (140px + var(--space-s-hv8c1d, 12px) + calc(2 * var(--font-body-m-line-height-i7xxvv, 22px))));
222
222
  }
223
- .awsui_content_1edmh_912m4_176.awsui_content--large_1edmh_912m4_194.awsui_content--without-labels_1edmh_912m4_185:not(#\9) {
223
+ .awsui_content_1edmh_1x93y_176.awsui_content--large_1edmh_1x93y_194.awsui_content--without-labels_1edmh_1x93y_185:not(#\9) {
224
224
  min-height: calc(2 * (140px + var(--space-s-hv8c1d, 12px)));
225
225
  }
226
- .awsui_content_1edmh_912m4_176.awsui_content--reserve-filter_1edmh_912m4_200:not(#\9) {
226
+ .awsui_content_1edmh_1x93y_176.awsui_content--reserve-filter_1edmh_1x93y_200:not(#\9) {
227
227
  margin-top: calc(2 * var(--font-body-m-line-height-i7xxvv, 22px));
228
228
  }
229
- .awsui_content_1edmh_912m4_176.awsui_content--reserve-legend_1edmh_912m4_203:not(#\9) {
229
+ .awsui_content_1edmh_1x93y_176.awsui_content--reserve-legend_1edmh_1x93y_203:not(#\9) {
230
230
  margin-bottom: calc(2 * var(--font-body-m-line-height-i7xxvv, 22px));
231
231
  }
232
232
 
233
- .awsui_status-container_1edmh_912m4_207:not(#\9) {
233
+ .awsui_status-container_1edmh_1x93y_207:not(#\9) {
234
234
  /* used in test utils */
235
235
  }
236
236
 
237
- .awsui_chart-container_1edmh_912m4_211:not(#\9) {
237
+ .awsui_chart-container_1edmh_1x93y_211:not(#\9) {
238
238
  display: flex;
239
239
  flex: 1;
240
240
  }
241
241
 
242
- .awsui_inner-content_1edmh_912m4_216:not(#\9) {
242
+ .awsui_inner-content_1edmh_1x93y_216:not(#\9) {
243
243
  display: flex;
244
244
  position: absolute;
245
245
  flex-direction: column;
@@ -253,74 +253,74 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
253
253
  pointer-events: none;
254
254
  }
255
255
 
256
- .awsui_segment__highlight_1edmh_912m4_230:not(#\9) {
256
+ .awsui_segment__highlight_1edmh_1x93y_230:not(#\9) {
257
257
  stroke: none;
258
258
  opacity: 0;
259
259
  }
260
260
 
261
- .awsui_segment_1edmh_912m4_97:not(#\9) {
261
+ .awsui_segment_1edmh_1x93y_97:not(#\9) {
262
262
  stroke: var(--color-background-container-content-o88wxm, #ffffff);
263
263
  stroke-width: 2px;
264
264
  stroke-linejoin: round;
265
265
  opacity: 1;
266
266
  cursor: pointer;
267
267
  }
268
- .awsui_segment_1edmh_912m4_97:not(#\9):focus {
268
+ .awsui_segment_1edmh_1x93y_97:not(#\9):focus {
269
269
  outline: none;
270
270
  }
271
- .awsui_segment_1edmh_912m4_97.awsui_segment--dimmed_1edmh_912m4_245:not(#\9) {
271
+ .awsui_segment_1edmh_1x93y_97.awsui_segment--dimmed_1edmh_1x93y_245:not(#\9) {
272
272
  opacity: 0.35;
273
273
  }
274
- .awsui_segment_1edmh_912m4_97.awsui_segment--highlighted_1edmh_912m4_248 > .awsui_segment__highlight_1edmh_912m4_230:not(#\9), .awsui_segment_1edmh_912m4_97:not(#\9):hover:not(.awsui_segment--dimmed_1edmh_912m4_245) > .awsui_segment__highlight_1edmh_912m4_230 {
274
+ .awsui_segment_1edmh_1x93y_97.awsui_segment--highlighted_1edmh_1x93y_248 > .awsui_segment__highlight_1edmh_1x93y_230:not(#\9), .awsui_segment_1edmh_1x93y_97:not(#\9):hover:not(.awsui_segment--dimmed_1edmh_1x93y_245) > .awsui_segment__highlight_1edmh_1x93y_230 {
275
275
  opacity: 1;
276
276
  }
277
277
 
278
- .awsui_label_1edmh_912m4_138:not(#\9) {
278
+ .awsui_label_1edmh_1x93y_138:not(#\9) {
279
279
  color: var(--color-text-heading-default-bjds33, #16191f);
280
280
  opacity: 1;
281
281
  /* stylelint-disable-next-line selector-max-type */
282
282
  /* stylelint-disable-next-line selector-max-type */
283
283
  }
284
- .awsui_label_1edmh_912m4_138 > line:not(#\9) {
285
- stroke: var(--color-border-control-default-jt0hca, #aab7b8);
284
+ .awsui_label_1edmh_1x93y_138 > line:not(#\9) {
285
+ stroke: var(--color-border-control-default-bwkbmv, #879596);
286
286
  stroke-width: var(--border-divider-section-width-5a4cv1, 1px);
287
287
  }
288
- .awsui_label_1edmh_912m4_138 > div:not(#\9) {
288
+ .awsui_label_1edmh_1x93y_138 > div:not(#\9) {
289
289
  margin-top: -0.75em;
290
290
  }
291
- .awsui_label_1edmh_912m4_138.awsui_label--dimmed_1edmh_912m4_265:not(#\9) {
291
+ .awsui_label_1edmh_1x93y_138.awsui_label--dimmed_1edmh_1x93y_265:not(#\9) {
292
292
  opacity: 0.35;
293
293
  }
294
- .awsui_label_1edmh_912m4_138.awsui_label--align-right_1edmh_912m4_268:not(#\9) {
294
+ .awsui_label_1edmh_1x93y_138.awsui_label--align-right_1edmh_1x93y_268:not(#\9) {
295
295
  /* stylelint-disable-next-line selector-max-type */
296
296
  }
297
- .awsui_label_1edmh_912m4_138.awsui_label--align-right_1edmh_912m4_268 > div:not(#\9) {
297
+ .awsui_label_1edmh_1x93y_138.awsui_label--align-right_1edmh_1x93y_268 > div:not(#\9) {
298
298
  text-align: right;
299
299
  }
300
300
 
301
301
  /* stylelint-disable-next-line selector-max-type */
302
- .awsui_label-text_1edmh_912m4_276 > text:not(#\9) {
302
+ .awsui_label-text_1edmh_1x93y_276 > text:not(#\9) {
303
303
  font-weight: var(--font-display-label-weight-tjy9e4, 400);
304
304
  fill: var(--color-text-heading-default-bjds33, #16191f);
305
305
  dominant-baseline: middle;
306
306
  }
307
307
 
308
- text.awsui_label__description_1edmh_912m4_282:not(#\9) {
308
+ text.awsui_label__description_1edmh_1x93y_282:not(#\9) {
309
309
  font-size: var(--font-chart-detail-size-viz5mm, 14px);
310
310
  font-weight: 400;
311
311
  color: var(--color-text-group-label-5rxtyp, #545b64);
312
312
  fill: var(--color-text-group-label-5rxtyp, #545b64);
313
313
  }
314
314
 
315
- .awsui_label-line_1edmh_912m4_289:not(#\9) {
315
+ .awsui_label-line_1edmh_1x93y_289:not(#\9) {
316
316
  /* used in component code */
317
317
  }
318
318
 
319
- .awsui_label--highlighted_1edmh_912m4_293:not(#\9) {
319
+ .awsui_label--highlighted_1edmh_1x93y_293:not(#\9) {
320
320
  /* used in test-utils */
321
321
  }
322
322
 
323
- .awsui_popover-header_1edmh_912m4_297:not(#\9) {
323
+ .awsui_popover-header_1edmh_1x93y_297:not(#\9) {
324
324
  display: inline-flex;
325
325
  align-items: flex-start;
326
326
  }
@@ -2,32 +2,32 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "segment__path": "awsui_segment__path_1edmh_912m4_97",
6
- "segment": "awsui_segment_1edmh_912m4_97",
7
- "segment__hover": "awsui_segment__hover_1edmh_912m4_124",
8
- "label": "awsui_label_1edmh_912m4_138",
9
- "root": "awsui_root_1edmh_912m4_156",
10
- "filter-container": "awsui_filter-container_1edmh_912m4_168",
11
- "has-default-filter": "awsui_has-default-filter_1edmh_912m4_172",
12
- "content": "awsui_content_1edmh_912m4_176",
13
- "content--small": "awsui_content--small_1edmh_912m4_182",
14
- "content--without-labels": "awsui_content--without-labels_1edmh_912m4_185",
15
- "content--medium": "awsui_content--medium_1edmh_912m4_188",
16
- "content--large": "awsui_content--large_1edmh_912m4_194",
17
- "content--reserve-filter": "awsui_content--reserve-filter_1edmh_912m4_200",
18
- "content--reserve-legend": "awsui_content--reserve-legend_1edmh_912m4_203",
19
- "status-container": "awsui_status-container_1edmh_912m4_207",
20
- "chart-container": "awsui_chart-container_1edmh_912m4_211",
21
- "inner-content": "awsui_inner-content_1edmh_912m4_216",
22
- "segment__highlight": "awsui_segment__highlight_1edmh_912m4_230",
23
- "segment--dimmed": "awsui_segment--dimmed_1edmh_912m4_245",
24
- "segment--highlighted": "awsui_segment--highlighted_1edmh_912m4_248",
25
- "label--dimmed": "awsui_label--dimmed_1edmh_912m4_265",
26
- "label--align-right": "awsui_label--align-right_1edmh_912m4_268",
27
- "label-text": "awsui_label-text_1edmh_912m4_276",
28
- "label__description": "awsui_label__description_1edmh_912m4_282",
29
- "label-line": "awsui_label-line_1edmh_912m4_289",
30
- "label--highlighted": "awsui_label--highlighted_1edmh_912m4_293",
31
- "popover-header": "awsui_popover-header_1edmh_912m4_297"
5
+ "segment__path": "awsui_segment__path_1edmh_1x93y_97",
6
+ "segment": "awsui_segment_1edmh_1x93y_97",
7
+ "segment__hover": "awsui_segment__hover_1edmh_1x93y_124",
8
+ "label": "awsui_label_1edmh_1x93y_138",
9
+ "root": "awsui_root_1edmh_1x93y_156",
10
+ "filter-container": "awsui_filter-container_1edmh_1x93y_168",
11
+ "has-default-filter": "awsui_has-default-filter_1edmh_1x93y_172",
12
+ "content": "awsui_content_1edmh_1x93y_176",
13
+ "content--small": "awsui_content--small_1edmh_1x93y_182",
14
+ "content--without-labels": "awsui_content--without-labels_1edmh_1x93y_185",
15
+ "content--medium": "awsui_content--medium_1edmh_1x93y_188",
16
+ "content--large": "awsui_content--large_1edmh_1x93y_194",
17
+ "content--reserve-filter": "awsui_content--reserve-filter_1edmh_1x93y_200",
18
+ "content--reserve-legend": "awsui_content--reserve-legend_1edmh_1x93y_203",
19
+ "status-container": "awsui_status-container_1edmh_1x93y_207",
20
+ "chart-container": "awsui_chart-container_1edmh_1x93y_211",
21
+ "inner-content": "awsui_inner-content_1edmh_1x93y_216",
22
+ "segment__highlight": "awsui_segment__highlight_1edmh_1x93y_230",
23
+ "segment--dimmed": "awsui_segment--dimmed_1edmh_1x93y_245",
24
+ "segment--highlighted": "awsui_segment--highlighted_1edmh_1x93y_248",
25
+ "label--dimmed": "awsui_label--dimmed_1edmh_1x93y_265",
26
+ "label--align-right": "awsui_label--align-right_1edmh_1x93y_268",
27
+ "label-text": "awsui_label-text_1edmh_1x93y_276",
28
+ "label__description": "awsui_label__description_1edmh_1x93y_282",
29
+ "label-line": "awsui_label-line_1edmh_1x93y_289",
30
+ "label--highlighted": "awsui_label--highlighted_1edmh_1x93y_293",
31
+ "popover-header": "awsui_popover-header_1edmh_1x93y_297"
32
32
  };
33
33
 
@@ -1,9 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ButtonProps } from '../button/interfaces';
3
- import { PopoverProps } from './interfaces';
4
3
  export interface PopoverBodyProps {
5
- size: PopoverProps.Size;
6
- fixedWidth: boolean;
7
4
  dismissButton: boolean;
8
5
  dismissAriaLabel: string | undefined;
9
6
  onDismiss: () => void;
@@ -15,5 +12,5 @@ export interface PopoverBodyProps {
15
12
  dismissButtonRef?: React.Ref<ButtonProps.Ref>;
16
13
  className?: string;
17
14
  }
18
- export default function PopoverBody({ size, fixedWidth, dismissButton: showDismissButton, dismissAriaLabel, header, children, onDismiss, variant, returnFocus, overflowVisible, dismissButtonRef, className, }: PopoverBodyProps): JSX.Element;
15
+ export default function PopoverBody({ dismissButton: showDismissButton, dismissAriaLabel, header, children, onDismiss, variant, returnFocus, overflowVisible, dismissButtonRef, className, }: PopoverBodyProps): JSX.Element;
19
16
  //# sourceMappingURL=body.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAM3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,MAAM,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAErC,gBAAgB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAE9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,IAAI,EACJ,UAAU,EACV,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,SAAS,GACV,EAAE,gBAAgB,eAwDlB"}
1
+ {"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAM3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAKnD,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,MAAM,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAErC,gBAAgB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAE9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAa,EAAE,iBAAiB,EAChC,gBAAgB,EAChB,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,WAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,SAAS,GACV,EAAE,gBAAgB,eAsDlB"}
@@ -9,7 +9,7 @@ import { InternalButton } from '../button/internal';
9
9
  import styles from './styles.css.js';
10
10
  export default function PopoverBody(_a) {
11
11
  var _b, _c;
12
- var size = _a.size, fixedWidth = _a.fixedWidth, showDismissButton = _a.dismissButton, dismissAriaLabel = _a.dismissAriaLabel, header = _a.header, children = _a.children, onDismiss = _a.onDismiss, variant = _a.variant, _d = _a.returnFocus, returnFocus = _d === void 0 ? true : _d, overflowVisible = _a.overflowVisible, dismissButtonRef = _a.dismissButtonRef, className = _a.className;
12
+ var showDismissButton = _a.dismissButton, dismissAriaLabel = _a.dismissAriaLabel, header = _a.header, children = _a.children, onDismiss = _a.onDismiss, variant = _a.variant, _d = _a.returnFocus, returnFocus = _d === void 0 ? true : _d, overflowVisible = _a.overflowVisible, dismissButtonRef = _a.dismissButtonRef, className = _a.className;
13
13
  var labelledById = useUniqueId('awsui-popover-');
14
14
  var onKeyDown = useCallback(function (event) {
15
15
  if (event.keyCode === KeyCode.escape) {
@@ -18,9 +18,7 @@ export default function PopoverBody(_a) {
18
18
  }, [onDismiss]);
19
19
  var dismissButton = (showDismissButton !== null && showDismissButton !== void 0 ? showDismissButton : null) && (React.createElement("div", { className: styles.dismiss },
20
20
  React.createElement(InternalButton, { variant: "icon", formAction: "none", iconName: "close", className: styles['dismiss-control'], ariaLabel: dismissAriaLabel, onClick: function () { return onDismiss(); }, ref: dismissButtonRef })));
21
- return (React.createElement("div", { className: clsx(styles.body, className, styles["body-size-".concat(size)], (_b = {},
22
- _b[styles['fixed-width']] = fixedWidth,
23
- _b[styles["variant-".concat(variant)]] = variant,
21
+ return (React.createElement("div", { className: clsx(styles.body, className, (_b = {},
24
22
  _b[styles['body-overflow-visible']] = overflowVisible === 'both',
25
23
  _b)), role: header ? 'dialog' : undefined, onKeyDown: onKeyDown, "aria-modal": showDismissButton && variant !== 'annotation' ? true : undefined, "aria-labelledby": header ? labelledById : undefined },
26
24
  React.createElement(FocusLock, { disabled: variant === 'annotation' || !showDismissButton, autoFocus: true, returnFocus: returnFocus },
@@ -1 +1 @@
1
- {"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,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azon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport clsx from 'clsx';\nimport FocusLock from 'react-focus-lock';\n\nimport { KeyCode } from '../internal/keycode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\n\nimport { PopoverProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport interface PopoverBodyProps {\n size: PopoverProps.Size;\n fixedWidth: boolean;\n dismissButton: boolean;\n dismissAriaLabel: string | undefined;\n onDismiss: () => void;\n\n header: React.ReactNode | undefined;\n children: React.ReactNode;\n variant?: 'annotation';\n returnFocus?: boolean;\n overflowVisible?: 'content' | 'both';\n\n dismissButtonRef?: React.Ref<ButtonProps.Ref>;\n\n className?: string;\n}\n\nexport default function PopoverBody({\n size,\n fixedWidth,\n dismissButton: showDismissButton,\n dismissAriaLabel,\n header,\n children,\n onDismiss,\n variant,\n returnFocus = true,\n overflowVisible,\n dismissButtonRef,\n className,\n}: PopoverBodyProps) {\n const labelledById = useUniqueId('awsui-popover-');\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n onDismiss();\n }\n },\n [onDismiss]\n );\n\n const dismissButton = (showDismissButton ?? null) && (\n <div className={styles.dismiss}>\n <InternalButton\n variant=\"icon\"\n formAction=\"none\"\n iconName=\"close\"\n className={styles['dismiss-control']}\n ariaLabel={dismissAriaLabel}\n onClick={() => onDismiss()}\n ref={dismissButtonRef}\n />\n </div>\n );\n\n return (\n <div\n className={clsx(styles.body, className, styles[`body-size-${size}`], {\n [styles['fixed-width']]: fixedWidth,\n [styles[`variant-${variant}`]]: variant,\n [styles['body-overflow-visible']]: overflowVisible === 'both',\n })}\n role={header ? 'dialog' : undefined}\n onKeyDown={onKeyDown}\n aria-modal={showDismissButton && variant !== 'annotation' ? true : undefined}\n aria-labelledby={header ? labelledById : undefined}\n >\n <FocusLock disabled={variant === 'annotation' || !showDismissButton} autoFocus={true} returnFocus={returnFocus}>\n {header && (\n <div className={clsx(styles['header-row'], showDismissButton && styles['has-dismiss'])}>\n {dismissButton}\n <div className={styles.header} id={labelledById}>\n <h2>{header}</h2>\n </div>\n </div>\n )}\n <div className={!header && showDismissButton ? styles['has-dismiss'] : undefined}>\n {!header && dismissButton}\n <div className={clsx(styles.content, { [styles['content-overflow-visible']]: !!overflowVisible })}>\n {children}\n </div>\n </div>\n </FocusLock>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAkBrC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAWjB;;QAVF,iBAAiB,mBAAA,EAChC,gBAAgB,sBAAA,EAChB,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,OAAO,aAAA,EACP,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA,EAClB,eAAe,qBAAA,EACf,gBAAgB,sBAAA,EAChB,SAAS,eAAA;IAET,IAAM,YAAY,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEnD,IAAM,SAAS,GAAG,WAAW,CAC3B,UAAC,KAA0B;QACzB,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,MAAM,EAAE;YACpC,SAAS,EAAE,CAAC;SACb;IACH,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S,EAAE,CAAC,MAAM,IAAI,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC7E,CAAC,MAAM,IAAI,aAAa;gBACzB,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,YAAI,GAAC,MAAM,CAAC,0BAA0B,CAAC,IAAG,CAAC,CAAC,eAAe,MAAG,IAC9F,QAAQ,CACL,CACF,CACI,CACR,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback } from 'react';\nimport clsx from 'clsx';\nimport FocusLock from 'react-focus-lock';\n\nimport { KeyCode } from '../internal/keycode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\n\nimport styles from './styles.css.js';\n\nexport interface PopoverBodyProps {\n dismissButton: boolean;\n dismissAriaLabel: string | undefined;\n onDismiss: () => void;\n\n header: React.ReactNode | undefined;\n children: React.ReactNode;\n variant?: 'annotation';\n returnFocus?: boolean;\n overflowVisible?: 'content' | 'both';\n\n dismissButtonRef?: React.Ref<ButtonProps.Ref>;\n\n className?: string;\n}\n\nexport default function PopoverBody({\n dismissButton: showDismissButton,\n dismissAriaLabel,\n header,\n children,\n onDismiss,\n variant,\n returnFocus = true,\n overflowVisible,\n dismissButtonRef,\n className,\n}: PopoverBodyProps) {\n const labelledById = useUniqueId('awsui-popover-');\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n onDismiss();\n }\n },\n [onDismiss]\n );\n\n const dismissButton = (showDismissButton ?? null) && (\n <div className={styles.dismiss}>\n <InternalButton\n variant=\"icon\"\n formAction=\"none\"\n iconName=\"close\"\n className={styles['dismiss-control']}\n ariaLabel={dismissAriaLabel}\n onClick={() => onDismiss()}\n ref={dismissButtonRef}\n />\n </div>\n );\n\n return (\n <div\n className={clsx(styles.body, className, {\n [styles['body-overflow-visible']]: overflowVisible === 'both',\n })}\n role={header ? 'dialog' : undefined}\n onKeyDown={onKeyDown}\n aria-modal={showDismissButton && variant !== 'annotation' ? true : undefined}\n aria-labelledby={header ? labelledById : undefined}\n >\n <FocusLock disabled={variant === 'annotation' || !showDismissButton} autoFocus={true} returnFocus={returnFocus}>\n {header && (\n <div className={clsx(styles['header-row'], showDismissButton && styles['has-dismiss'])}>\n {dismissButton}\n <div className={styles.header} id={labelledById}>\n <h2>{header}</h2>\n </div>\n </div>\n )}\n <div className={!header && showDismissButton ? styles['has-dismiss'] : undefined}>\n {!header && dismissButton}\n <div className={clsx(styles.content, { [styles['content-overflow-visible']]: !!overflowVisible })}>\n {children}\n </div>\n </div>\n </FocusLock>\n </div>\n );\n}\n"]}
@@ -18,6 +18,9 @@ export interface PopoverContainerProps {
18
18
  arrow: (position: InternalPosition | null) => React.ReactNode;
19
19
  children: React.ReactNode;
20
20
  renderWithPortal?: boolean;
21
+ size: PopoverProps.Size;
22
+ fixedWidth: boolean;
23
+ variant?: 'annotation';
21
24
  }
22
- export default function PopoverContainer({ position, trackRef, trackKey, arrow, children, zIndex, renderWithPortal, }: PopoverContainerProps): JSX.Element;
25
+ export default function PopoverContainer({ position, trackRef, trackKey, arrow, children, zIndex, renderWithPortal, size, fixedWidth, variant, }: PopoverContainerProps): JSX.Element;
23
26
  //# sourceMappingURL=container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../src/popover/container.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAK7F,OAAO,EAAkB,gBAAgB,EAAU,YAAY,EAAE,MAAM,cAAc,CAAC;AAMtF,MAAM,WAAW,qBAAqB;IACpC,kEAAkE;IAClE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnC;;;;;;;;MAQE;IACF,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AC;CACxB;AAID,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,OAAO,GACR,EAAE,qBAAqB,eAqKvB"}
@@ -4,47 +4,50 @@ import { __assign } from "tslib";
4
4
  import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
5
5
  import clsx from 'clsx';
6
6
  import { getContainingBlock, nodeContains } from '../internal/utils/dom';
7
- import { useContainerQuery } from '../internal/hooks/container-queries';
7
+ import { useResizeObserver } from '../internal/hooks/container-queries';
8
8
  import { calculatePosition } from './utils/positions';
9
9
  import styles from './styles.css.js';
10
10
  import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
11
- import { useMergeRefs } from '../internal/hooks/use-merge-refs';
12
11
  var INITIAL_STYLES = { position: 'absolute', top: -9999, left: -9999 };
13
12
  export default function PopoverContainer(_a) {
14
- var position = _a.position, trackRef = _a.trackRef, trackKey = _a.trackKey, arrow = _a.arrow, children = _a.children, zIndex = _a.zIndex, renderWithPortal = _a.renderWithPortal;
15
- var _b = useContainerQuery(function (rect, prev) {
16
- var roundedRect = { width: Math.round(rect.width), height: Math.round(rect.height) };
17
- return (prev === null || prev === void 0 ? void 0 : prev.width) === roundedRect.width && (prev === null || prev === void 0 ? void 0 : prev.height) === roundedRect.height ? prev : rect;
18
- }), popoverRect = _b[0], ref = _b[1];
13
+ var _b;
14
+ var position = _a.position, trackRef = _a.trackRef, trackKey = _a.trackKey, arrow = _a.arrow, children = _a.children, zIndex = _a.zIndex, renderWithPortal = _a.renderWithPortal, size = _a.size, fixedWidth = _a.fixedWidth, variant = _a.variant;
19
15
  var bodyRef = useRef(null);
16
+ var contentRef = useRef(null);
17
+ var popoverRef = useRef(null);
20
18
  var arrowRef = useRef(null);
21
- var _c = useState(INITIAL_STYLES), inlineStyle = _c[0], setInlineStyle = _c[1];
19
+ var _c = useState(INITIAL_STYLES), popoverStyle = _c[0], setPopoverStyle = _c[1];
22
20
  var _d = useState(null), internalPosition = _d[0], setInternalPosition = _d[1];
23
21
  var isRefresh = useVisualRefresh();
24
22
  // Store the handler in a ref so that it can still be replaced from outside of the listener closure.
25
23
  var positionHandlerRef = useRef(function () { });
26
24
  // Updates the position handler.
27
25
  var updatePositionHandler = useCallback(function () {
28
- if (!trackRef.current || !ref.current || !bodyRef.current || !arrowRef.current) {
26
+ if (!trackRef.current || !popoverRef.current || !bodyRef.current || !contentRef.current || !arrowRef.current) {
29
27
  return;
30
28
  }
31
29
  // Get important elements
30
+ var popover = popoverRef.current;
32
31
  var body = bodyRef.current;
33
32
  var arrow = arrowRef.current;
34
- var document = ref.current.ownerDocument;
33
+ var document = popover.ownerDocument;
35
34
  var track = trackRef.current;
36
35
  // If the popover body isn't being rendered for whatever reason (e.g. "display: none" or JSDOM),
37
36
  // or track does not belong to the document - bail on calculating dimensions.
38
- if (body.offsetWidth === 0 || body.offsetHeight === 0 || !nodeContains(document.body, track)) {
37
+ if (popover.offsetWidth === 0 || popover.offsetHeight === 0 || !nodeContains(document.body, track)) {
39
38
  return;
40
39
  }
41
40
  // Imperatively move body off-screen to give it room to expand.
42
41
  // Not doing this in React because this recalculation should happen
43
42
  // in the span of a single frame without rerendering anything.
44
- var prevTop = body.style.top;
45
- var prevLeft = body.style.left;
46
- body.style.top = '0';
47
- body.style.left = '0';
43
+ var prevTop = popover.style.top;
44
+ var prevLeft = popover.style.left;
45
+ popover.style.top = '0';
46
+ popover.style.left = '0';
47
+ // Imperatively remove body styles that can remain from the previous computation.
48
+ body.style.maxHeight = '';
49
+ body.style.overflowX = '';
50
+ body.style.overflowY = '';
48
51
  // Get rects representing key elements
49
52
  // Use getComputedStyle for arrowRect to avoid modifications made by transform
50
53
  var viewportRect = getViewportRect(document.defaultView);
@@ -53,43 +56,48 @@ export default function PopoverContainer(_a) {
53
56
  width: parseFloat(getComputedStyle(arrow).width),
54
57
  height: parseFloat(getComputedStyle(arrow).height)
55
58
  };
56
- var containingBlock = getContainingBlock(body);
59
+ var containingBlock = getContainingBlock(popover);
57
60
  var containingBlockRect = containingBlock ? containingBlock.getBoundingClientRect() : viewportRect;
58
- // Round up dimensions (IE11 doesn't handle subpixels too accurately)
59
- var bodyRect = body.getBoundingClientRect();
60
- var bodyRectCeil = {
61
- top: bodyRect.top,
62
- left: bodyRect.left,
63
- width: Math.ceil(bodyRect.width),
64
- height: Math.ceil(bodyRect.height)
61
+ var bodyBorderWidth = getBorderWidth(body);
62
+ var contentRect = contentRef.current.getBoundingClientRect();
63
+ var contentBoundingBox = {
64
+ width: contentRect.width + 2 * bodyBorderWidth,
65
+ height: contentRect.height + 2 * bodyBorderWidth
65
66
  };
66
67
  // Calculate the arrow direction and viewport-relative position of the popover.
67
- var _a = calculatePosition(position, trackRect, arrowRect, bodyRectCeil, containingBlock ? containingBlockRect : getDocumentRect(document), viewportRect, renderWithPortal), newInternalPosition = _a.internalPosition, boundingOffset = _a.boundingOffset;
68
+ var _a = calculatePosition(position, trackRect, arrowRect, contentBoundingBox, containingBlock ? containingBlockRect : getDocumentRect(document), viewportRect, renderWithPortal), scrollable = _a.scrollable, newInternalPosition = _a.internalPosition, boundingOffset = _a.boundingOffset;
68
69
  // Get the position of the popover relative to the offset parent.
69
70
  var popoverOffset = toRelativePosition(boundingOffset, containingBlockRect);
70
71
  // Cache the distance between the trigger and the popover (which stays the same as you scroll),
71
72
  // and use that to recalculate the new popover position.
72
73
  var trackRelativeOffset = toRelativePosition(popoverOffset, toRelativePosition(trackRect, containingBlockRect));
73
- // Bring back the container to its original position to prevent any
74
- // flashing.
75
- body.style.top = prevTop;
76
- body.style.left = prevLeft;
74
+ // Bring back the container to its original position to prevent any flashing.
75
+ popover.style.top = prevTop;
76
+ popover.style.left = prevLeft;
77
+ // Allow popover body to scroll if can't fit the popover into the container/viewport otherwise.
78
+ if (scrollable) {
79
+ body.style.maxHeight = boundingOffset.height + 'px';
80
+ body.style.overflowX = 'hidden';
81
+ body.style.overflowY = 'auto';
82
+ }
77
83
  // Position the popover
78
84
  setInternalPosition(newInternalPosition);
79
- setInlineStyle({ top: popoverOffset.top, left: popoverOffset.left });
85
+ setPopoverStyle({ top: popoverOffset.top, left: popoverOffset.left });
80
86
  positionHandlerRef.current = function () {
81
87
  var newTrackOffset = toRelativePosition(track.getBoundingClientRect(), containingBlock ? containingBlock.getBoundingClientRect() : viewportRect);
82
- setInlineStyle({
88
+ setPopoverStyle({
83
89
  top: newTrackOffset.top + trackRelativeOffset.top,
84
90
  left: newTrackOffset.left + trackRelativeOffset.left
85
91
  });
86
92
  };
87
- }, [position, trackRef, ref, renderWithPortal]);
88
- // Update the handler when properties change.
93
+ }, [position, trackRef, renderWithPortal]);
94
+ // Recalculate position when properties change.
89
95
  useLayoutEffect(function () {
90
96
  updatePositionHandler();
91
- }, [updatePositionHandler, trackKey, popoverRect]);
92
- // Attach document listeners.
97
+ }, [updatePositionHandler, trackKey]);
98
+ // Recalculate position when content size changes.
99
+ useResizeObserver(contentRef, function () { return updatePositionHandler(); });
100
+ // Recalculate position on DOM events.
93
101
  useLayoutEffect(function () {
94
102
  /*
95
103
  This is a heuristic. Some layout changes are caused by user clicks (e.g. toggling the tools panel, submitting a form),
@@ -108,10 +116,16 @@ export default function PopoverContainer(_a) {
108
116
  window.removeEventListener('scroll', refreshPosition, true);
109
117
  };
110
118
  }, [updatePositionHandler]);
111
- var mergedRef = useMergeRefs(bodyRef, ref);
112
- return (React.createElement("div", { ref: mergedRef, style: __assign(__assign({}, inlineStyle), { zIndex: zIndex }), className: clsx(styles.container, isRefresh && styles.refresh) },
119
+ return (React.createElement("div", { ref: popoverRef, style: __assign(__assign({}, popoverStyle), { zIndex: zIndex }), className: clsx(styles.container, isRefresh && styles.refresh) },
113
120
  React.createElement("div", { ref: arrowRef, className: clsx(styles["container-arrow"], styles["container-arrow-position-".concat(internalPosition)]), "aria-hidden": true }, arrow(internalPosition)),
114
- children));
121
+ React.createElement("div", { ref: bodyRef, className: clsx(styles['container-body'], styles["container-body-size-".concat(size)], (_b = {},
122
+ _b[styles['fixed-width']] = fixedWidth,
123
+ _b[styles["container-body-variant-".concat(variant)]] = variant,
124
+ _b)) },
125
+ React.createElement("div", { ref: contentRef }, children))));
126
+ }
127
+ function getBorderWidth(element) {
128
+ return parseInt(getComputedStyle(element).borderWidth) || 0;
115
129
  }
116
130
  /**
117
131
  * Convert a viewport-relative offset to an element-relative offset.