@cloudscape-design/components 3.0.1203 → 3.0.1205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alert/interfaces.d.ts +2 -0
- package/alert/interfaces.d.ts.map +1 -1
- package/alert/interfaces.js.map +1 -1
- package/alert/styles.css.js +27 -27
- package/alert/styles.scoped.css +50 -50
- package/alert/styles.selectors.js +27 -27
- package/annotation-context/annotation/styles.css.js +13 -13
- package/annotation-context/annotation/styles.scoped.css +21 -21
- package/annotation-context/annotation/styles.selectors.js +13 -13
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/visual-refresh/styles.css.js +86 -86
- package/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +30 -30
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +87 -87
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +30 -30
- package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +27 -27
- package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +54 -54
- package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +27 -27
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -28
- package/attribute-editor/styles.selectors.js +15 -15
- package/autosuggest/interfaces.d.ts +2 -0
- package/autosuggest/interfaces.d.ts.map +1 -1
- package/autosuggest/interfaces.js.map +1 -1
- package/badge/interfaces.d.ts +2 -0
- package/badge/interfaces.d.ts.map +1 -1
- package/badge/interfaces.js.map +1 -1
- package/breadcrumb-group/item/styles.css.js +7 -7
- package/breadcrumb-group/item/styles.scoped.css +28 -28
- package/breadcrumb-group/item/styles.selectors.js +7 -7
- package/button/interfaces.d.ts +2 -0
- package/button/interfaces.d.ts.map +1 -1
- package/button/interfaces.js.map +1 -1
- package/button/styles.css.js +22 -22
- package/button/styles.scoped.css +256 -256
- package/button/styles.selectors.js +22 -22
- package/button-dropdown/category-elements/expandable-category-element.js +1 -1
- package/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
- package/button-dropdown/interfaces.d.ts +2 -0
- package/button-dropdown/interfaces.d.ts.map +1 -1
- package/button-dropdown/interfaces.js.map +1 -1
- package/button-dropdown/internal.d.ts.map +1 -1
- package/button-dropdown/internal.js +1 -1
- package/button-dropdown/internal.js.map +1 -1
- package/button-dropdown/item-element/index.d.ts.map +1 -1
- package/button-dropdown/item-element/index.js +2 -1
- package/button-dropdown/item-element/index.js.map +1 -1
- package/button-dropdown/item-element/styles.css.js +21 -21
- package/button-dropdown/item-element/styles.scoped.css +37 -37
- package/button-dropdown/item-element/styles.selectors.js +21 -21
- package/button-group/interfaces.d.ts +2 -0
- package/button-group/interfaces.d.ts.map +1 -1
- package/button-group/interfaces.js.map +1 -1
- package/checkbox/interfaces.d.ts +2 -0
- package/checkbox/interfaces.d.ts.map +1 -1
- package/checkbox/interfaces.js.map +1 -1
- package/checkbox/styles.css.js +3 -3
- package/checkbox/styles.scoped.css +11 -11
- package/checkbox/styles.selectors.js +3 -3
- package/container/interfaces.d.ts +2 -0
- package/container/interfaces.d.ts.map +1 -1
- package/container/interfaces.js.map +1 -1
- package/content-layout/styles.css.js +14 -14
- package/content-layout/styles.scoped.css +27 -27
- package/content-layout/styles.selectors.js +14 -14
- package/date-picker/index.d.ts.map +1 -1
- package/date-picker/index.js +1 -1
- package/date-picker/index.js.map +1 -1
- package/date-range-picker/index.d.ts.map +1 -1
- package/date-range-picker/index.js +1 -1
- package/date-range-picker/index.js.map +1 -1
- package/flashbar/interfaces.d.ts +2 -0
- package/flashbar/interfaces.d.ts.map +1 -1
- package/flashbar/interfaces.js.map +1 -1
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +187 -187
- package/flashbar/styles.selectors.js +50 -50
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +73 -73
- package/help-panel/styles.selectors.js +6 -6
- package/input/interfaces.d.ts +2 -0
- package/input/interfaces.d.ts.map +1 -1
- package/input/interfaces.js.map +1 -1
- package/input/styles.css.js +13 -13
- package/input/styles.d.ts +9 -1
- package/input/styles.d.ts.map +1 -1
- package/input/styles.js +2 -39
- package/input/styles.js.map +1 -1
- package/input/styles.scoped.css +74 -74
- package/input/styles.selectors.js +13 -13
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/internal/components/autosuggest-input/index.js +2 -1
- package/internal/components/autosuggest-input/index.js.map +1 -1
- package/internal/components/drag-handle-wrapper/styles.css.js +30 -30
- package/internal/components/drag-handle-wrapper/styles.scoped.css +58 -58
- package/internal/components/drag-handle-wrapper/styles.selectors.js +30 -30
- package/internal/components/dropdown/dropdown-fit-handler.d.ts +14 -14
- package/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
- package/internal/components/dropdown/dropdown-fit-handler.js +22 -23
- package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
- package/internal/components/dropdown/dropdown-position.d.ts.map +1 -1
- package/internal/components/dropdown/dropdown-position.js +4 -1
- package/internal/components/dropdown/dropdown-position.js.map +1 -1
- package/internal/components/dropdown/index.d.ts +3 -4
- package/internal/components/dropdown/index.d.ts.map +1 -1
- package/internal/components/dropdown/index.js +52 -30
- package/internal/components/dropdown/index.js.map +1 -1
- package/internal/components/dropdown/interfaces.d.ts +20 -14
- package/internal/components/dropdown/interfaces.d.ts.map +1 -1
- package/internal/components/dropdown/interfaces.js.map +1 -1
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +39 -38
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/components/radio-button/interfaces.d.ts +2 -0
- package/internal/components/radio-button/interfaces.d.ts.map +1 -1
- package/internal/components/radio-button/interfaces.js.map +1 -1
- package/internal/components/radio-button/styles.css.js +7 -7
- package/internal/components/radio-button/styles.scoped.css +18 -18
- package/internal/components/radio-button/styles.selectors.js +7 -7
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/custom-css-properties/index.d.ts +1 -0
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +139 -138
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/data-attributes.d.ts +1 -0
- package/internal/utils/data-attributes.d.ts.map +1 -0
- package/internal/utils/data-attributes.js +21 -0
- package/internal/utils/data-attributes.js.map +1 -0
- package/internal/utils/input-styles.d.ts +89 -0
- package/internal/utils/input-styles.d.ts.map +1 -0
- package/internal/utils/input-styles.js +54 -0
- package/internal/utils/input-styles.js.map +1 -0
- package/link/interfaces.d.ts +2 -0
- package/link/interfaces.d.ts.map +1 -1
- package/link/interfaces.js.map +1 -1
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +103 -103
- package/link/styles.selectors.js +20 -20
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +2 -1
- package/multiselect/internal.js.map +1 -1
- package/package.json +1 -1
- package/progress-bar/interfaces.d.ts +2 -0
- package/progress-bar/interfaces.d.ts.map +1 -1
- package/progress-bar/interfaces.js.map +1 -1
- package/progress-bar/styles.css.js +18 -18
- package/progress-bar/styles.scoped.css +48 -48
- package/progress-bar/styles.selectors.js +18 -18
- package/prompt-input/interfaces.d.ts +2 -0
- package/prompt-input/interfaces.d.ts.map +1 -1
- package/prompt-input/interfaces.js.map +1 -1
- package/prompt-input/styles.css.js +17 -17
- package/prompt-input/styles.scoped.css +79 -79
- package/prompt-input/styles.selectors.js +17 -17
- package/radio-group/interfaces.d.ts +2 -0
- package/radio-group/interfaces.d.ts.map +1 -1
- package/radio-group/interfaces.js.map +1 -1
- package/segmented-control/interfaces.d.ts +2 -0
- package/segmented-control/interfaces.d.ts.map +1 -1
- package/segmented-control/interfaces.js.map +1 -1
- package/segmented-control/styles.css.js +16 -16
- package/segmented-control/styles.scoped.css +46 -46
- package/segmented-control/styles.selectors.js +16 -16
- package/select/internal.d.ts.map +1 -1
- package/select/internal.js +2 -1
- package/select/internal.js.map +1 -1
- package/slider/interfaces.d.ts +2 -0
- package/slider/interfaces.d.ts.map +1 -1
- package/slider/interfaces.js.map +1 -1
- package/slider/styles.css.js +26 -26
- package/slider/styles.scoped.css +165 -165
- package/slider/styles.selectors.js +26 -26
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +39 -39
- package/spinner/styles.selectors.js +13 -13
- package/tabs/interfaces.d.ts +2 -0
- package/tabs/interfaces.d.ts.map +1 -1
- package/tabs/interfaces.js.map +1 -1
- package/tabs/styles.css.js +30 -30
- package/tabs/styles.scoped.css +76 -76
- package/tabs/styles.selectors.js +30 -30
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +13 -13
- package/tag-editor/styles.selectors.js +3 -3
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +66 -66
- package/text-content/styles.selectors.js +1 -1
- package/text-filter/interfaces.d.ts +2 -0
- package/text-filter/interfaces.d.ts.map +1 -1
- package/text-filter/interfaces.js.map +1 -1
- package/text-filter/styles.d.ts +9 -1
- package/text-filter/styles.d.ts.map +1 -1
- package/text-filter/styles.js +2 -39
- package/text-filter/styles.js.map +1 -1
- package/textarea/interfaces.d.ts +2 -0
- package/textarea/interfaces.d.ts.map +1 -1
- package/textarea/interfaces.js.map +1 -1
- package/textarea/styles.css.js +5 -5
- package/textarea/styles.d.ts +9 -1
- package/textarea/styles.d.ts.map +1 -1
- package/textarea/styles.js +2 -49
- package/textarea/styles.js.map +1 -1
- package/textarea/styles.scoped.css +45 -45
- package/textarea/styles.selectors.js +5 -5
- package/toggle/interfaces.d.ts +2 -0
- package/toggle/interfaces.d.ts.map +1 -1
- package/toggle/interfaces.js.map +1 -1
- package/toggle/styles.css.js +10 -10
- package/toggle/styles.scoped.css +23 -23
- package/toggle/styles.selectors.js +10 -10
|
@@ -150,27 +150,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
150
150
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
151
151
|
SPDX-License-Identifier: Apache-2.0
|
|
152
152
|
*/
|
|
153
|
-
@keyframes awsui_drag-handle-
|
|
153
|
+
@keyframes awsui_drag-handle-entry_155yk_f1agp_1 {
|
|
154
154
|
from {
|
|
155
|
-
transform: translate(var(--awsui-drag-handle-animation-inline-offset-
|
|
155
|
+
transform: translate(var(--awsui-drag-handle-animation-inline-offset-c5ek4l), var(--awsui-drag-handle-animation-block-offset-c5ek4l));
|
|
156
156
|
}
|
|
157
157
|
to {
|
|
158
158
|
transform: translate(0, 0);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
@keyframes awsui_drag-handle-
|
|
161
|
+
@keyframes awsui_drag-handle-exit_155yk_f1agp_1 {
|
|
162
162
|
from {
|
|
163
163
|
transform: translate(0, 0);
|
|
164
164
|
}
|
|
165
165
|
to {
|
|
166
|
-
transform: translate(var(--awsui-drag-handle-animation-inline-offset-
|
|
166
|
+
transform: translate(var(--awsui-drag-handle-animation-inline-offset-c5ek4l), var(--awsui-drag-handle-animation-block-offset-c5ek4l));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
.awsui_direction-button-
|
|
170
|
-
--awsui-drag-handle-animation-inline-offset-
|
|
171
|
-
--awsui-drag-handle-animation-block-offset-
|
|
169
|
+
.awsui_direction-button-wrapper_155yk_f1agp_169:not(#\9) {
|
|
170
|
+
--awsui-drag-handle-animation-inline-offset-c5ek4l: 0;
|
|
171
|
+
--awsui-drag-handle-animation-block-offset-c5ek4l: 0;
|
|
172
172
|
}
|
|
173
|
-
@keyframes awsui_awsui-motion-fade-
|
|
173
|
+
@keyframes awsui_awsui-motion-fade-in_155yk_f1agp_1 {
|
|
174
174
|
from {
|
|
175
175
|
opacity: 0.2;
|
|
176
176
|
}
|
|
@@ -178,7 +178,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
178
178
|
opacity: 1;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
@keyframes awsui_awsui-motion-fade-out-
|
|
181
|
+
@keyframes awsui_awsui-motion-fade-out-0_155yk_f1agp_1 {
|
|
182
182
|
from {
|
|
183
183
|
opacity: 1;
|
|
184
184
|
}
|
|
@@ -186,81 +186,81 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
186
186
|
opacity: 0;
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
.awsui_direction-button-wrapper-motion-
|
|
189
|
+
.awsui_direction-button-wrapper-motion-enter_155yk_f1agp_189:not(#\9), .awsui_direction-button-wrapper-motion-entering_155yk_f1agp_189:not(#\9), .awsui_direction-button-wrapper-motion-exit_155yk_f1agp_189:not(#\9), .awsui_direction-button-wrapper-motion-exiting_155yk_f1agp_189:not(#\9) {
|
|
190
190
|
pointer-events: none;
|
|
191
191
|
}
|
|
192
|
-
.awsui_direction-button-wrapper-motion-
|
|
193
|
-
animation: awsui_drag-handle-
|
|
192
|
+
.awsui_direction-button-wrapper-motion-entering_155yk_f1agp_189:not(#\9) {
|
|
193
|
+
animation: awsui_drag-handle-entry_155yk_f1agp_1 var(--motion-duration-complex-tbdo30, 250ms) var(--motion-easing-responsive-hjj3ai, cubic-bezier(0, 0, 0, 1)), awsui_awsui-motion-fade-in_155yk_f1agp_1 var(--motion-duration-complex-tbdo30, 250ms) var(--motion-easing-responsive-hjj3ai, cubic-bezier(0, 0, 0, 1));
|
|
194
194
|
}
|
|
195
195
|
@media (prefers-reduced-motion: reduce) {
|
|
196
|
-
.awsui_direction-button-wrapper-motion-
|
|
196
|
+
.awsui_direction-button-wrapper-motion-entering_155yk_f1agp_189:not(#\9) {
|
|
197
197
|
animation: none;
|
|
198
198
|
transition: none;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
.awsui-motion-disabled .awsui_direction-button-wrapper-motion-
|
|
201
|
+
.awsui-motion-disabled .awsui_direction-button-wrapper-motion-entering_155yk_f1agp_189:not(#\9), .awsui-mode-entering .awsui_direction-button-wrapper-motion-entering_155yk_f1agp_189:not(#\9) {
|
|
202
202
|
animation: none;
|
|
203
203
|
transition: none;
|
|
204
204
|
}
|
|
205
|
-
.awsui_direction-button-wrapper-motion-
|
|
206
|
-
animation: awsui_drag-handle-
|
|
205
|
+
.awsui_direction-button-wrapper-motion-exiting_155yk_f1agp_189:not(#\9) {
|
|
206
|
+
animation: awsui_drag-handle-exit_155yk_f1agp_1 var(--motion-duration-complex-tbdo30, 250ms) var(--motion-easing-responsive-hjj3ai, cubic-bezier(0, 0, 0, 1)) forwards, awsui_awsui-motion-fade-out-0_155yk_f1agp_1 var(--motion-duration-complex-tbdo30, 250ms) var(--motion-easing-responsive-hjj3ai, cubic-bezier(0, 0, 0, 1)) forwards;
|
|
207
207
|
}
|
|
208
208
|
@media (prefers-reduced-motion: reduce) {
|
|
209
|
-
.awsui_direction-button-wrapper-motion-
|
|
209
|
+
.awsui_direction-button-wrapper-motion-exiting_155yk_f1agp_189:not(#\9) {
|
|
210
210
|
animation: none;
|
|
211
211
|
transition: none;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
.awsui-motion-disabled .awsui_direction-button-wrapper-motion-
|
|
214
|
+
.awsui-motion-disabled .awsui_direction-button-wrapper-motion-exiting_155yk_f1agp_189:not(#\9), .awsui-mode-entering .awsui_direction-button-wrapper-motion-exiting_155yk_f1agp_189:not(#\9) {
|
|
215
215
|
animation: none;
|
|
216
216
|
transition: none;
|
|
217
217
|
}
|
|
218
218
|
@media (prefers-reduced-motion: reduce) {
|
|
219
|
-
.awsui_direction-button-
|
|
219
|
+
.awsui_direction-button-wrapper_155yk_f1agp_169:not(#\9) {
|
|
220
220
|
animation: none;
|
|
221
221
|
transition: none;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
.awsui-motion-disabled .awsui_direction-button-
|
|
224
|
+
.awsui-motion-disabled .awsui_direction-button-wrapper_155yk_f1agp_169:not(#\9), .awsui-mode-entering .awsui_direction-button-wrapper_155yk_f1agp_169:not(#\9) {
|
|
225
225
|
animation: none;
|
|
226
226
|
transition: none;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
.awsui_direction-button-wrapper-block-
|
|
230
|
-
--awsui-drag-handle-animation-block-offset-
|
|
229
|
+
.awsui_direction-button-wrapper-block-start_155yk_f1agp_229:not(#\9) {
|
|
230
|
+
--awsui-drag-handle-animation-block-offset-c5ek4l: 20px;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
.awsui_direction-button-wrapper-block-
|
|
234
|
-
--awsui-drag-handle-animation-block-offset-
|
|
233
|
+
.awsui_direction-button-wrapper-block-end_155yk_f1agp_233:not(#\9) {
|
|
234
|
+
--awsui-drag-handle-animation-block-offset-c5ek4l: -20px;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
.awsui_direction-button-wrapper-inline-
|
|
237
|
+
.awsui_direction-button-wrapper-inline-start_155yk_f1agp_237:not(#\9) {
|
|
238
238
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
239
239
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
240
240
|
}
|
|
241
|
-
.awsui_direction-button-wrapper-inline-
|
|
242
|
-
--awsui-drag-handle-animation-inline-offset-
|
|
241
|
+
.awsui_direction-button-wrapper-inline-start_155yk_f1agp_237:not(#\9):dir(ltr) {
|
|
242
|
+
--awsui-drag-handle-animation-inline-offset-c5ek4l: 20px;
|
|
243
243
|
}
|
|
244
|
-
.awsui_direction-button-wrapper-inline-
|
|
245
|
-
--awsui-drag-handle-animation-inline-offset-
|
|
244
|
+
.awsui_direction-button-wrapper-inline-start_155yk_f1agp_237:not(#\9):dir(rtl) {
|
|
245
|
+
--awsui-drag-handle-animation-inline-offset-c5ek4l: -20px;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
.awsui_direction-button-wrapper-inline-
|
|
248
|
+
.awsui_direction-button-wrapper-inline-end_155yk_f1agp_248:not(#\9) {
|
|
249
249
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
250
250
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
251
251
|
}
|
|
252
|
-
.awsui_direction-button-wrapper-inline-
|
|
253
|
-
--awsui-drag-handle-animation-inline-offset-
|
|
252
|
+
.awsui_direction-button-wrapper-inline-end_155yk_f1agp_248:not(#\9):dir(ltr) {
|
|
253
|
+
--awsui-drag-handle-animation-inline-offset-c5ek4l: -20px;
|
|
254
254
|
}
|
|
255
|
-
.awsui_direction-button-wrapper-inline-
|
|
256
|
-
--awsui-drag-handle-animation-inline-offset-
|
|
255
|
+
.awsui_direction-button-wrapper-inline-end_155yk_f1agp_248:not(#\9):dir(rtl) {
|
|
256
|
+
--awsui-drag-handle-animation-inline-offset-c5ek4l: 20px;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
.
|
|
259
|
+
.awsui_contents_155yk_f1agp_259:not(#\9) {
|
|
260
260
|
display: contents;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
.awsui_portal-
|
|
263
|
+
.awsui_portal-overlay_155yk_f1agp_263:not(#\9) {
|
|
264
264
|
position: absolute;
|
|
265
265
|
inset-block-start: 0;
|
|
266
266
|
inset-inline-start: 0;
|
|
@@ -268,20 +268,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
268
268
|
z-index: 7000;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
-
.awsui_portal-overlay-
|
|
271
|
+
.awsui_portal-overlay-disabled_155yk_f1agp_271:not(#\9) {
|
|
272
272
|
display: none;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
.awsui_portal-overlay-
|
|
275
|
+
.awsui_portal-overlay-contents_155yk_f1agp_275:not(#\9) {
|
|
276
276
|
pointer-events: auto;
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
.awsui_drag-
|
|
279
|
+
.awsui_drag-handle_155yk_f1agp_279:not(#\9) {
|
|
280
280
|
position: relative;
|
|
281
281
|
display: inline-flex;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
.awsui_direction-button-
|
|
284
|
+
.awsui_direction-button-wrapper_155yk_f1agp_169:not(#\9) {
|
|
285
285
|
position: absolute;
|
|
286
286
|
block-size: var(--space-static-xl-4tedi6, 24px);
|
|
287
287
|
inline-size: var(--space-static-xl-4tedi6, 24px);
|
|
@@ -289,67 +289,67 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
289
289
|
padding-inline: var(--space-static-xxs-ns94dp, 4px);
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
.awsui_direction-button-wrapper-
|
|
292
|
+
.awsui_direction-button-wrapper-hidden_155yk_f1agp_292:not(#\9) {
|
|
293
293
|
display: none;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
.awsui_direction-button-wrapper-block-
|
|
296
|
+
.awsui_direction-button-wrapper-block-start_155yk_f1agp_229:not(#\9) {
|
|
297
297
|
inset-block-start: calc(-1 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
298
298
|
inset-inline-start: calc(50% - (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)) / 2);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
.awsui_direction-button-wrapper-block-
|
|
301
|
+
.awsui_direction-button-wrapper-block-end_155yk_f1agp_233:not(#\9) {
|
|
302
302
|
inset-block-end: calc(-1 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
303
303
|
inset-inline-start: calc(50% - (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)) / 2);
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
.awsui_direction-button-wrapper-inline-
|
|
306
|
+
.awsui_direction-button-wrapper-inline-start_155yk_f1agp_237:not(#\9) {
|
|
307
307
|
inset-inline-start: calc(-1 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
308
308
|
inset-block-start: calc(50% - (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)) / 2);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
.awsui_direction-button-wrapper-inline-
|
|
311
|
+
.awsui_direction-button-wrapper-inline-end_155yk_f1agp_248:not(#\9) {
|
|
312
312
|
inset-inline-end: calc(-1 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
313
313
|
inset-block-start: calc(50% - (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)) / 2);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
.awsui_direction-button-wrapper-
|
|
316
|
+
.awsui_direction-button-wrapper-forced_155yk_f1agp_316:not(#\9) {
|
|
317
317
|
inset-inline-start: calc(50% - (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)) / 2);
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
.awsui_direction-button-wrapper-forced-top-
|
|
320
|
+
.awsui_direction-button-wrapper-forced-top-0_155yk_f1agp_320:not(#\9) {
|
|
321
321
|
inset-block-start: calc(-1 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
.awsui_direction-button-wrapper-forced-top-
|
|
324
|
+
.awsui_direction-button-wrapper-forced-top-1_155yk_f1agp_324:not(#\9) {
|
|
325
325
|
inset-block-start: calc(-2 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
.awsui_direction-button-wrapper-forced-top-
|
|
328
|
+
.awsui_direction-button-wrapper-forced-top-2_155yk_f1agp_328:not(#\9) {
|
|
329
329
|
inset-block-start: calc(-3 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
.awsui_direction-button-wrapper-forced-top-
|
|
332
|
+
.awsui_direction-button-wrapper-forced-top-3_155yk_f1agp_332:not(#\9) {
|
|
333
333
|
inset-block-start: calc(-4 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
.awsui_direction-button-wrapper-forced-bottom-
|
|
336
|
+
.awsui_direction-button-wrapper-forced-bottom-0_155yk_f1agp_336:not(#\9) {
|
|
337
337
|
inset-block-start: calc(1 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
.awsui_direction-button-wrapper-forced-bottom-
|
|
340
|
+
.awsui_direction-button-wrapper-forced-bottom-1_155yk_f1agp_340:not(#\9) {
|
|
341
341
|
inset-block-start: calc(2 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
.awsui_direction-button-wrapper-forced-bottom-
|
|
344
|
+
.awsui_direction-button-wrapper-forced-bottom-2_155yk_f1agp_344:not(#\9) {
|
|
345
345
|
inset-block-start: calc(3 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
.awsui_direction-button-wrapper-forced-bottom-
|
|
348
|
+
.awsui_direction-button-wrapper-forced-bottom-3_155yk_f1agp_348:not(#\9) {
|
|
349
349
|
inset-block-start: calc(4 * (var(--space-static-xl-4tedi6, 24px) + 2 * var(--space-static-xxs-ns94dp, 4px)));
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
.awsui_direction-
|
|
352
|
+
.awsui_direction-button_155yk_f1agp_169:not(#\9) {
|
|
353
353
|
position: absolute;
|
|
354
354
|
border-width: 0;
|
|
355
355
|
cursor: pointer;
|
|
@@ -368,14 +368,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
368
368
|
color: var(--color-text-direction-button-default-p88lvb, #ffffff);
|
|
369
369
|
box-shadow: var(--shadow-dropdown-isf0w4, 0px 4px 20px 1px rgba(0, 7, 22, 0.1));
|
|
370
370
|
}
|
|
371
|
-
.awsui_direction-
|
|
371
|
+
.awsui_direction-button_155yk_f1agp_169:not(#\9):not(.awsui_direction-button-disabled_155yk_f1agp_371):hover {
|
|
372
372
|
background-color: var(--color-background-direction-button-hover-74n5o1, #333843);
|
|
373
373
|
}
|
|
374
|
-
.awsui_direction-
|
|
374
|
+
.awsui_direction-button_155yk_f1agp_169:not(#\9):not(.awsui_direction-button-disabled_155yk_f1agp_371):active {
|
|
375
375
|
background-color: var(--color-background-direction-button-active-lvo0dy, #232b37);
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
.awsui_direction-button-
|
|
378
|
+
.awsui_direction-button-disabled_155yk_f1agp_371:not(#\9) {
|
|
379
379
|
cursor: default;
|
|
380
380
|
background-color: var(--color-background-direction-button-disabled-s9x4zq, #ebebf0);
|
|
381
381
|
color: var(--color-text-direction-button-disabled-2jds36, #b4b4bb);
|
|
@@ -2,35 +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
|
-
"direction-button-wrapper": "awsui_direction-button-
|
|
6
|
-
"direction-button-wrapper-motion-enter": "awsui_direction-button-wrapper-motion-
|
|
7
|
-
"direction-button-wrapper-motion-entering": "awsui_direction-button-wrapper-motion-
|
|
8
|
-
"direction-button-wrapper-motion-exit": "awsui_direction-button-wrapper-motion-
|
|
9
|
-
"direction-button-wrapper-motion-exiting": "awsui_direction-button-wrapper-motion-
|
|
10
|
-
"drag-handle-entry": "awsui_drag-handle-
|
|
11
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
12
|
-
"drag-handle-exit": "awsui_drag-handle-
|
|
13
|
-
"awsui-motion-fade-out-0": "awsui_awsui-motion-fade-out-
|
|
14
|
-
"direction-button-wrapper-block-start": "awsui_direction-button-wrapper-block-
|
|
15
|
-
"direction-button-wrapper-block-end": "awsui_direction-button-wrapper-block-
|
|
16
|
-
"direction-button-wrapper-inline-start": "awsui_direction-button-wrapper-inline-
|
|
17
|
-
"direction-button-wrapper-inline-end": "awsui_direction-button-wrapper-inline-
|
|
18
|
-
"contents": "
|
|
19
|
-
"portal-overlay": "awsui_portal-
|
|
20
|
-
"portal-overlay-disabled": "awsui_portal-overlay-
|
|
21
|
-
"portal-overlay-contents": "awsui_portal-overlay-
|
|
22
|
-
"drag-handle": "awsui_drag-
|
|
23
|
-
"direction-button-wrapper-hidden": "awsui_direction-button-wrapper-
|
|
24
|
-
"direction-button-wrapper-forced": "awsui_direction-button-wrapper-
|
|
25
|
-
"direction-button-wrapper-forced-top-0": "awsui_direction-button-wrapper-forced-top-
|
|
26
|
-
"direction-button-wrapper-forced-top-1": "awsui_direction-button-wrapper-forced-top-
|
|
27
|
-
"direction-button-wrapper-forced-top-2": "awsui_direction-button-wrapper-forced-top-
|
|
28
|
-
"direction-button-wrapper-forced-top-3": "awsui_direction-button-wrapper-forced-top-
|
|
29
|
-
"direction-button-wrapper-forced-bottom-0": "awsui_direction-button-wrapper-forced-bottom-
|
|
30
|
-
"direction-button-wrapper-forced-bottom-1": "awsui_direction-button-wrapper-forced-bottom-
|
|
31
|
-
"direction-button-wrapper-forced-bottom-2": "awsui_direction-button-wrapper-forced-bottom-
|
|
32
|
-
"direction-button-wrapper-forced-bottom-3": "awsui_direction-button-wrapper-forced-bottom-
|
|
33
|
-
"direction-button": "awsui_direction-
|
|
34
|
-
"direction-button-disabled": "awsui_direction-button-
|
|
5
|
+
"direction-button-wrapper": "awsui_direction-button-wrapper_155yk_f1agp_169",
|
|
6
|
+
"direction-button-wrapper-motion-enter": "awsui_direction-button-wrapper-motion-enter_155yk_f1agp_189",
|
|
7
|
+
"direction-button-wrapper-motion-entering": "awsui_direction-button-wrapper-motion-entering_155yk_f1agp_189",
|
|
8
|
+
"direction-button-wrapper-motion-exit": "awsui_direction-button-wrapper-motion-exit_155yk_f1agp_189",
|
|
9
|
+
"direction-button-wrapper-motion-exiting": "awsui_direction-button-wrapper-motion-exiting_155yk_f1agp_189",
|
|
10
|
+
"drag-handle-entry": "awsui_drag-handle-entry_155yk_f1agp_1",
|
|
11
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_155yk_f1agp_1",
|
|
12
|
+
"drag-handle-exit": "awsui_drag-handle-exit_155yk_f1agp_1",
|
|
13
|
+
"awsui-motion-fade-out-0": "awsui_awsui-motion-fade-out-0_155yk_f1agp_1",
|
|
14
|
+
"direction-button-wrapper-block-start": "awsui_direction-button-wrapper-block-start_155yk_f1agp_229",
|
|
15
|
+
"direction-button-wrapper-block-end": "awsui_direction-button-wrapper-block-end_155yk_f1agp_233",
|
|
16
|
+
"direction-button-wrapper-inline-start": "awsui_direction-button-wrapper-inline-start_155yk_f1agp_237",
|
|
17
|
+
"direction-button-wrapper-inline-end": "awsui_direction-button-wrapper-inline-end_155yk_f1agp_248",
|
|
18
|
+
"contents": "awsui_contents_155yk_f1agp_259",
|
|
19
|
+
"portal-overlay": "awsui_portal-overlay_155yk_f1agp_263",
|
|
20
|
+
"portal-overlay-disabled": "awsui_portal-overlay-disabled_155yk_f1agp_271",
|
|
21
|
+
"portal-overlay-contents": "awsui_portal-overlay-contents_155yk_f1agp_275",
|
|
22
|
+
"drag-handle": "awsui_drag-handle_155yk_f1agp_279",
|
|
23
|
+
"direction-button-wrapper-hidden": "awsui_direction-button-wrapper-hidden_155yk_f1agp_292",
|
|
24
|
+
"direction-button-wrapper-forced": "awsui_direction-button-wrapper-forced_155yk_f1agp_316",
|
|
25
|
+
"direction-button-wrapper-forced-top-0": "awsui_direction-button-wrapper-forced-top-0_155yk_f1agp_320",
|
|
26
|
+
"direction-button-wrapper-forced-top-1": "awsui_direction-button-wrapper-forced-top-1_155yk_f1agp_324",
|
|
27
|
+
"direction-button-wrapper-forced-top-2": "awsui_direction-button-wrapper-forced-top-2_155yk_f1agp_328",
|
|
28
|
+
"direction-button-wrapper-forced-top-3": "awsui_direction-button-wrapper-forced-top-3_155yk_f1agp_332",
|
|
29
|
+
"direction-button-wrapper-forced-bottom-0": "awsui_direction-button-wrapper-forced-bottom-0_155yk_f1agp_336",
|
|
30
|
+
"direction-button-wrapper-forced-bottom-1": "awsui_direction-button-wrapper-forced-bottom-1_155yk_f1agp_340",
|
|
31
|
+
"direction-button-wrapper-forced-bottom-2": "awsui_direction-button-wrapper-forced-bottom-2_155yk_f1agp_344",
|
|
32
|
+
"direction-button-wrapper-forced-bottom-3": "awsui_direction-button-wrapper-forced-bottom-3_155yk_f1agp_348",
|
|
33
|
+
"direction-button": "awsui_direction-button_155yk_f1agp_169",
|
|
34
|
+
"direction-button-disabled": "awsui_direction-button-disabled_155yk_f1agp_371"
|
|
35
35
|
};
|
|
36
36
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoundingBox } from '../../utils/scrollable-containers';
|
|
2
2
|
import { LogicalDOMRect } from './dropdown-position';
|
|
3
|
+
import { DropdownWidthConstraint } from './interfaces';
|
|
3
4
|
export interface DropdownPosition {
|
|
4
5
|
blockSize: string;
|
|
5
6
|
inlineSize: string;
|
|
@@ -11,21 +12,20 @@ export interface InteriorDropdownPosition extends DropdownPosition {
|
|
|
11
12
|
insetBlockEnd: string;
|
|
12
13
|
insetBlockStart: string;
|
|
13
14
|
}
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const hasEnoughSpaceToStretchBeyondTriggerWidth: ({
|
|
15
|
+
export declare const hasEnoughSpaceForFlexibleWidth: ({
|
|
16
16
|
triggerElement,
|
|
17
17
|
dropdownElement,
|
|
18
|
-
|
|
18
|
+
minWidthConstraint,
|
|
19
|
+
maxWidthConstraint,
|
|
19
20
|
expandToViewport,
|
|
20
|
-
stretchWidth,
|
|
21
21
|
stretchHeight,
|
|
22
22
|
isMobile
|
|
23
23
|
}: {
|
|
24
24
|
triggerElement: HTMLElement;
|
|
25
25
|
dropdownElement: HTMLElement;
|
|
26
|
-
|
|
26
|
+
minWidthConstraint?: DropdownWidthConstraint;
|
|
27
|
+
maxWidthConstraint?: DropdownWidthConstraint;
|
|
27
28
|
expandToViewport: boolean;
|
|
28
|
-
stretchWidth: boolean;
|
|
29
29
|
stretchHeight: boolean;
|
|
30
30
|
isMobile: boolean;
|
|
31
31
|
}) => boolean;
|
|
@@ -33,21 +33,21 @@ export declare const getDropdownPosition: ({
|
|
|
33
33
|
triggerElement,
|
|
34
34
|
dropdownElement,
|
|
35
35
|
overflowParents,
|
|
36
|
-
minWidth:
|
|
36
|
+
minWidth: minWidthConstraint,
|
|
37
|
+
maxWidth: maxWidthConstraint,
|
|
37
38
|
preferCenter,
|
|
38
|
-
|
|
39
|
+
matchTriggerWidth,
|
|
39
40
|
stretchHeight,
|
|
40
|
-
isMobile
|
|
41
|
-
stretchBeyondTriggerWidth
|
|
41
|
+
isMobile
|
|
42
42
|
}: {
|
|
43
43
|
triggerElement: HTMLElement;
|
|
44
44
|
dropdownElement: HTMLElement;
|
|
45
45
|
overflowParents: ReadonlyArray<BoundingBox>;
|
|
46
|
-
minWidth?:
|
|
46
|
+
minWidth?: DropdownWidthConstraint;
|
|
47
|
+
maxWidth?: DropdownWidthConstraint;
|
|
47
48
|
preferCenter?: boolean;
|
|
48
|
-
|
|
49
|
+
matchTriggerWidth?: boolean;
|
|
49
50
|
stretchHeight?: boolean;
|
|
50
51
|
isMobile?: boolean;
|
|
51
|
-
stretchBeyondTriggerWidth?: boolean;
|
|
52
52
|
}) => DropdownPosition;
|
|
53
|
-
export declare const calculatePosition: (dropdownElement: HTMLDivElement, triggerElement: HTMLDivElement, verticalContainerElement: HTMLDivElement, interior: boolean, expandToViewport: boolean, preferCenter: boolean,
|
|
53
|
+
export declare const calculatePosition: (dropdownElement: HTMLDivElement, triggerElement: HTMLDivElement, verticalContainerElement: HTMLDivElement, interior: boolean, expandToViewport: boolean, preferCenter: boolean, matchTriggerWidth: boolean, stretchHeight: boolean, isMobile: boolean, minWidth?: DropdownWidthConstraint, maxWidth?: DropdownWidthConstraint) => [DropdownPosition, LogicalDOMRect];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-fit-handler.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/dropdown-fit-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown-fit-handler.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dropdown/dropdown-fit-handler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAmD,MAAM,mCAAmC,CAAC;AACjH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAcvD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AACD,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAChE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB;AAkKD,eAAO,MAAM,8BAA8B,GAAI,yHAQ5C;IACD,cAAc,EAAE,WAAW,CAAC;IAC5B,eAAe,EAAE,WAAW,CAAC;IAC7B,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IAC7C,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IAC7C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;CACnB,YAoBA,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,6KAUjC;IACD,cAAc,EAAE,WAAW,CAAC;IAC5B,eAAe,EAAE,WAAW,CAAC;IAC7B,eAAe,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,KAAG,gBA0DH,CAAC;AAkDF,eAAO,MAAM,iBAAiB,GAC5B,iBAAiB,cAAc,EAC/B,gBAAgB,cAAc,EAC9B,0BAA0B,cAAc,EACxC,UAAU,OAAO,EACjB,kBAAkB,OAAO,EACzB,cAAc,OAAO,EACrB,mBAAmB,OAAO,EAC1B,eAAe,OAAO,EACtB,UAAU,OAAO,EACjB,WAAW,uBAAuB,EAClC,WAAW,uBAAuB,KACjC,CAAC,gBAAgB,EAAE,cAAc,CAkCnC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';
|
|
4
|
-
import { getBreakpointValue } from '../../breakpoints';
|
|
5
4
|
import { getOverflowParentDimensions, getOverflowParents } from '../../utils/scrollable-containers';
|
|
6
5
|
import styles from './styles.css.js';
|
|
7
6
|
const AVAILABLE_SPACE_RESERVE_DEFAULT = 50;
|
|
@@ -19,9 +18,6 @@ const getClosestParentDimensions = (element) => {
|
|
|
19
18
|
});
|
|
20
19
|
return parents.shift();
|
|
21
20
|
};
|
|
22
|
-
// By default, most dropdowns should expand their content as necessary, but to a maximum of 465px (the XXS breakpoint).
|
|
23
|
-
// This value was determined by UX but may be subject to change in the future, depending on the feedback.
|
|
24
|
-
export const defaultMaxDropdownWidth = getBreakpointValue('xxs');
|
|
25
21
|
const getAvailableSpace = ({ trigger, overflowParents, stretchWidth = false, stretchHeight = false, isMobile, }) => {
|
|
26
22
|
const availableSpaceReserveVertical = stretchHeight
|
|
27
23
|
? 0
|
|
@@ -88,20 +84,24 @@ const getInteriorAvailableSpace = ({ trigger, overflowParents, isMobile, }) => {
|
|
|
88
84
|
inlineEnd: Number.MAX_VALUE,
|
|
89
85
|
});
|
|
90
86
|
};
|
|
91
|
-
const
|
|
92
|
-
|
|
87
|
+
const resolveWidthConstraint = (constraint, triggerWidth, fallback) => {
|
|
88
|
+
if (constraint === 'trigger') {
|
|
89
|
+
return triggerWidth;
|
|
90
|
+
}
|
|
91
|
+
if (typeof constraint === 'number') {
|
|
92
|
+
return constraint;
|
|
93
|
+
}
|
|
94
|
+
return fallback;
|
|
95
|
+
};
|
|
96
|
+
const getWidths = ({ triggerElement, dropdownElement, minWidthConstraint, maxWidthConstraint, }) => {
|
|
93
97
|
const { inlineSize: triggerInlineSize } = getLogicalBoundingClientRect(triggerElement);
|
|
94
|
-
// Minimum width is determined by either an explicit number (desiredMinWidth) or the trigger width
|
|
95
|
-
const minWidth = desiredMinWidth ? Math.min(triggerInlineSize, desiredMinWidth) : triggerInlineSize;
|
|
96
|
-
// If stretchBeyondTriggerWidth is true, the maximum width is the XS breakpoint (465px) or the trigger width (if bigger).
|
|
97
|
-
const maxWidth = stretchBeyondTriggerWidth ? Math.max(defaultMaxDropdownWidth, triggerInlineSize) : Number.MAX_VALUE;
|
|
98
|
-
// Determine the actual dropdown width, the size that it "wants" to be
|
|
99
98
|
const { inlineSize: requiredWidth } = getLogicalBoundingClientRect(dropdownElement);
|
|
100
|
-
|
|
99
|
+
const minWidth = resolveWidthConstraint(minWidthConstraint, triggerInlineSize, 0);
|
|
100
|
+
const maxWidth = resolveWidthConstraint(maxWidthConstraint, triggerInlineSize, Number.MAX_VALUE);
|
|
101
101
|
const idealWidth = Math.min(Math.max(requiredWidth, minWidth), maxWidth);
|
|
102
102
|
return { idealWidth, minWidth, triggerInlineSize };
|
|
103
103
|
};
|
|
104
|
-
export const
|
|
104
|
+
export const hasEnoughSpaceForFlexibleWidth = ({ triggerElement, dropdownElement, minWidthConstraint, maxWidthConstraint, expandToViewport, stretchHeight, isMobile, }) => {
|
|
105
105
|
const overflowParents = getOverflowParentDimensions({
|
|
106
106
|
element: dropdownElement,
|
|
107
107
|
excludeClosestParent: false,
|
|
@@ -111,32 +111,31 @@ export const hasEnoughSpaceToStretchBeyondTriggerWidth = ({ triggerElement, drop
|
|
|
111
111
|
const { idealWidth } = getWidths({
|
|
112
112
|
triggerElement: triggerElement,
|
|
113
113
|
dropdownElement,
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
minWidthConstraint,
|
|
115
|
+
maxWidthConstraint,
|
|
116
116
|
});
|
|
117
117
|
const availableSpace = getAvailableSpace({
|
|
118
118
|
trigger: triggerElement,
|
|
119
119
|
overflowParents,
|
|
120
|
-
stretchWidth,
|
|
121
120
|
stretchHeight,
|
|
122
121
|
isMobile,
|
|
123
122
|
});
|
|
124
123
|
return idealWidth <= availableSpace.inlineStart || idealWidth <= availableSpace.inlineEnd;
|
|
125
124
|
};
|
|
126
|
-
export const getDropdownPosition = ({ triggerElement, dropdownElement, overflowParents, minWidth:
|
|
125
|
+
export const getDropdownPosition = ({ triggerElement, dropdownElement, overflowParents, minWidth: minWidthConstraint, maxWidth: maxWidthConstraint, preferCenter = false, matchTriggerWidth = false, stretchHeight = false, isMobile = false, }) => {
|
|
127
126
|
// Determine the space available around the dropdown that it can grow in
|
|
128
127
|
const availableSpace = getAvailableSpace({
|
|
129
128
|
trigger: triggerElement,
|
|
130
129
|
overflowParents,
|
|
131
|
-
stretchWidth,
|
|
130
|
+
stretchWidth: matchTriggerWidth,
|
|
132
131
|
stretchHeight,
|
|
133
132
|
isMobile,
|
|
134
133
|
});
|
|
135
134
|
const { idealWidth, minWidth, triggerInlineSize } = getWidths({
|
|
136
135
|
triggerElement,
|
|
137
136
|
dropdownElement,
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
minWidthConstraint,
|
|
138
|
+
maxWidthConstraint,
|
|
140
139
|
});
|
|
141
140
|
let dropInlineStart;
|
|
142
141
|
let insetInlineStart = null;
|
|
@@ -209,7 +208,7 @@ const getInteriorDropdownPosition = (trigger, dropdown, overflowParents, isMobil
|
|
|
209
208
|
insetInlineStart: `${insetInlineStart}px`,
|
|
210
209
|
};
|
|
211
210
|
};
|
|
212
|
-
export const calculatePosition = (dropdownElement, triggerElement, verticalContainerElement, interior, expandToViewport, preferCenter,
|
|
211
|
+
export const calculatePosition = (dropdownElement, triggerElement, verticalContainerElement, interior, expandToViewport, preferCenter, matchTriggerWidth, stretchHeight, isMobile, minWidth, maxWidth) => {
|
|
213
212
|
// cleaning previously assigned values,
|
|
214
213
|
// so that they are not reused in case of screen resize and similar events
|
|
215
214
|
verticalContainerElement.style.maxBlockSize = '';
|
|
@@ -233,11 +232,11 @@ export const calculatePosition = (dropdownElement, triggerElement, verticalConta
|
|
|
233
232
|
dropdownElement,
|
|
234
233
|
overflowParents,
|
|
235
234
|
minWidth,
|
|
235
|
+
maxWidth,
|
|
236
236
|
preferCenter,
|
|
237
|
-
|
|
237
|
+
matchTriggerWidth,
|
|
238
238
|
stretchHeight,
|
|
239
239
|
isMobile,
|
|
240
|
-
stretchBeyondTriggerWidth,
|
|
241
240
|
});
|
|
242
241
|
const triggerBox = getLogicalBoundingClientRect(triggerElement);
|
|
243
242
|
return [position, triggerBox];
|