@cloudscape-design/components 3.0.609 → 3.0.611
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/index.d.ts.map +1 -1
- package/alert/index.js +5 -1
- package/alert/index.js.map +1 -1
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +33 -29
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +16 -12
- package/app-layout/index.js.map +1 -1
- package/button-dropdown/category-elements/styles.css.js +14 -14
- package/button-dropdown/category-elements/styles.scoped.css +25 -22
- package/button-dropdown/category-elements/styles.selectors.js +14 -14
- package/container/index.d.ts.map +1 -1
- package/container/index.js +1 -1
- package/container/index.js.map +1 -1
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +8 -2
- package/flashbar/flash.js.map +1 -1
- package/form/index.js +2 -2
- package/form/index.js.map +1 -1
- package/internal/analytics/components/analytics-funnel.d.ts +4 -4
- package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/internal/analytics/components/analytics-funnel.js +9 -9
- package/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/internal/analytics/context/analytics-context.d.ts +2 -2
- package/internal/analytics/context/analytics-context.d.ts.map +1 -1
- package/internal/analytics/context/analytics-context.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts +1 -1
- package/internal/analytics/hooks/use-funnel.js +3 -3
- package/internal/analytics/hooks/use-funnel.js.map +1 -1
- package/internal/analytics/interfaces.d.ts +13 -7
- package/internal/analytics/interfaces.d.ts.map +1 -1
- package/internal/analytics/interfaces.js.map +1 -1
- package/internal/components/chart-popover/index.d.ts +1 -1
- package/internal/components/chart-popover/index.d.ts.map +1 -1
- package/internal/components/chart-popover/index.js.map +1 -1
- package/internal/components/dropdown/dropdown-fit-handler.d.ts +12 -12
- package/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
- package/internal/components/dropdown/dropdown-fit-handler.js +103 -83
- package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
- package/internal/components/dropdown/index.d.ts.map +1 -1
- package/internal/components/dropdown/index.js +30 -29
- package/internal/components/dropdown/index.js.map +1 -1
- package/internal/components/tooltip/index.d.ts +1 -1
- package/internal/components/tooltip/index.d.ts.map +1 -1
- package/internal/components/tooltip/index.js.map +1 -1
- package/internal/direction.d.ts +14 -0
- package/internal/direction.d.ts.map +1 -1
- package/internal/direction.js +25 -0
- package/internal/direction.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/theming/index.cjs +14 -14
- package/internal/generated/theming/index.js +14 -14
- package/internal/hooks/use-performance-marks.js +2 -2
- package/internal/hooks/use-performance-marks.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/scrollable-containers.d.ts +5 -5
- package/internal/utils/scrollable-containers.d.ts.map +1 -1
- package/internal/utils/scrollable-containers.js +19 -19
- package/internal/utils/scrollable-containers.js.map +1 -1
- package/package.json +1 -1
- package/popover/container.d.ts +1 -1
- package/popover/container.d.ts.map +1 -1
- package/popover/container.js.map +1 -1
- package/popover/interfaces.d.ts +4 -4
- package/popover/interfaces.d.ts.map +1 -1
- package/popover/interfaces.js.map +1 -1
- package/popover/styles.css.js +50 -50
- package/popover/styles.scoped.css +76 -64
- package/popover/styles.selectors.js +50 -50
- package/popover/use-popover-position.d.ts +1 -1
- package/popover/use-popover-position.d.ts.map +1 -1
- package/popover/use-popover-position.js +32 -29
- package/popover/use-popover-position.js.map +1 -1
- package/popover/utils/positions.d.ts +2 -2
- package/popover/utils/positions.d.ts.map +1 -1
- package/popover/utils/positions.js +74 -74
- package/popover/utils/positions.js.map +1 -1
- package/wizard/index.js +1 -1
- package/wizard/index.js.map +1 -1
- package/wizard/wizard-form.js +1 -1
- package/wizard/wizard-form.js.map +1 -1
|
@@ -194,11 +194,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
194
194
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
195
195
|
SPDX-License-Identifier: Apache-2.0
|
|
196
196
|
*/
|
|
197
|
-
.
|
|
197
|
+
.awsui_arrow_xjuzf_ov8et_197:not(#\9) {
|
|
198
198
|
inline-size: 20px;
|
|
199
199
|
block-size: 10px;
|
|
200
200
|
}
|
|
201
|
-
.awsui_arrow-
|
|
201
|
+
.awsui_arrow-outer_xjuzf_ov8et_201:not(#\9), .awsui_arrow-inner_xjuzf_ov8et_201:not(#\9) {
|
|
202
202
|
position: absolute;
|
|
203
203
|
overflow: hidden;
|
|
204
204
|
inline-size: 20px;
|
|
@@ -206,7 +206,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
206
206
|
inset-block-start: 0;
|
|
207
207
|
inset-inline-start: 0;
|
|
208
208
|
}
|
|
209
|
-
.awsui_arrow-
|
|
209
|
+
.awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-inner_xjuzf_ov8et_201:not(#\9)::after {
|
|
210
210
|
content: "";
|
|
211
211
|
box-sizing: border-box;
|
|
212
212
|
display: inline-block;
|
|
@@ -222,32 +222,36 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
222
222
|
transform: rotate(45deg);
|
|
223
223
|
transform-origin: 0 100%;
|
|
224
224
|
}
|
|
225
|
-
.awsui_arrow-
|
|
225
|
+
.awsui_arrow-outer_xjuzf_ov8et_201:not(#\9):dir(rtl)::after, .awsui_arrow-inner_xjuzf_ov8et_201:not(#\9):dir(rtl)::after {
|
|
226
|
+
transform: rotate(-45deg);
|
|
227
|
+
transform-origin: 100% 100%;
|
|
228
|
+
}
|
|
229
|
+
.awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after {
|
|
226
230
|
background-color: var(--color-border-popover-umqvld, #9ba7b6);
|
|
227
231
|
}
|
|
228
|
-
.awsui_arrow-
|
|
232
|
+
.awsui_arrow-inner_xjuzf_ov8et_201:not(#\9) {
|
|
229
233
|
inset-block-start: 2px;
|
|
230
234
|
}
|
|
231
|
-
.awsui_arrow-
|
|
235
|
+
.awsui_arrow-inner_xjuzf_ov8et_201.awsui_refresh_xjuzf_ov8et_235:not(#\9) {
|
|
232
236
|
inset-block-start: 3px;
|
|
233
237
|
}
|
|
234
|
-
.awsui_arrow-
|
|
238
|
+
.awsui_arrow-inner_xjuzf_ov8et_201:not(#\9)::after {
|
|
235
239
|
border-start-start-radius: 1px;
|
|
236
240
|
border-start-end-radius: 0;
|
|
237
241
|
border-end-start-radius: 0;
|
|
238
242
|
border-end-end-radius: 0;
|
|
239
243
|
background-color: var(--color-background-popover-szburm, #ffffff);
|
|
240
244
|
}
|
|
241
|
-
.awsui_arrow-position-right-
|
|
245
|
+
.awsui_arrow-position-right-top_xjuzf_ov8et_245 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-right-bottom_xjuzf_ov8et_245 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after {
|
|
242
246
|
box-shadow: -0.71px 0.71px 4px -2px var(--color-shadow-default-8jp634, rgba(0, 7, 22, 0.12));
|
|
243
247
|
}
|
|
244
|
-
.awsui_arrow-position-left-
|
|
248
|
+
.awsui_arrow-position-left-top_xjuzf_ov8et_248 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-left-bottom_xjuzf_ov8et_248 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after {
|
|
245
249
|
box-shadow: 0.71px -0.71px 4px -2px var(--color-shadow-default-8jp634, rgba(0, 7, 22, 0.12));
|
|
246
250
|
}
|
|
247
|
-
.awsui_arrow-position-top-
|
|
251
|
+
.awsui_arrow-position-top-center_xjuzf_ov8et_251 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-top-right_xjuzf_ov8et_251 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-top-left_xjuzf_ov8et_251 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-top-responsive_xjuzf_ov8et_251 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after {
|
|
248
252
|
box-shadow: -0.71px -0.71px 4px -2px var(--color-shadow-default-8jp634, rgba(0, 7, 22, 0.12));
|
|
249
253
|
}
|
|
250
|
-
.awsui_arrow-position-bottom-
|
|
254
|
+
.awsui_arrow-position-bottom-center_xjuzf_ov8et_254 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-bottom-right_xjuzf_ov8et_254 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-bottom-left_xjuzf_ov8et_254 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after, .awsui_arrow-position-bottom-responsive_xjuzf_ov8et_254 > .awsui_arrow-outer_xjuzf_ov8et_201:not(#\9)::after {
|
|
251
255
|
box-shadow: 0.71px 0.71px 4px -2px var(--color-shadow-default-8jp634, rgba(0, 7, 22, 0.12));
|
|
252
256
|
}
|
|
253
257
|
|
|
@@ -349,7 +353,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
349
353
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
350
354
|
SPDX-License-Identifier: Apache-2.0
|
|
351
355
|
*/
|
|
352
|
-
.
|
|
356
|
+
.awsui_body_xjuzf_ov8et_356:not(#\9) {
|
|
353
357
|
border-collapse: separate;
|
|
354
358
|
border-spacing: 0;
|
|
355
359
|
box-sizing: border-box;
|
|
@@ -389,16 +393,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
389
393
|
padding-block: var(--space-s-34lx8l, 12px);
|
|
390
394
|
padding-inline: var(--space-m-udix3p, 16px);
|
|
391
395
|
}
|
|
392
|
-
.awsui_body-overflow-
|
|
396
|
+
.awsui_body-overflow-visible_xjuzf_ov8et_395:not(#\9) {
|
|
393
397
|
overflow: visible;
|
|
394
398
|
}
|
|
395
399
|
|
|
396
|
-
.awsui_has-
|
|
400
|
+
.awsui_has-dismiss_xjuzf_ov8et_399:not(#\9) {
|
|
397
401
|
display: flex;
|
|
398
402
|
align-items: baseline;
|
|
399
403
|
}
|
|
400
404
|
|
|
401
|
-
.
|
|
405
|
+
.awsui_dismiss_xjuzf_ov8et_404:not(#\9) {
|
|
402
406
|
margin-block: calc(-1 * var(--space-xs-zb16t3, 8px));
|
|
403
407
|
margin-inline-start: 0;
|
|
404
408
|
margin-inline-end: calc(-1 * (var(--space-xxs-p8yyaw, 4px) + var(--border-field-width-09w7vk, 2px)));
|
|
@@ -406,15 +410,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
406
410
|
order: 1;
|
|
407
411
|
}
|
|
408
412
|
|
|
409
|
-
.awsui_dismiss-
|
|
413
|
+
.awsui_dismiss-control_xjuzf_ov8et_412:not(#\9) {
|
|
410
414
|
/* used in test-utils */
|
|
411
415
|
}
|
|
412
416
|
|
|
413
|
-
.awsui_header-
|
|
417
|
+
.awsui_header-row_xjuzf_ov8et_416:not(#\9) {
|
|
414
418
|
margin-block-end: var(--space-xs-zb16t3, 8px);
|
|
415
419
|
}
|
|
416
420
|
|
|
417
|
-
.
|
|
421
|
+
.awsui_header_xjuzf_ov8et_416:not(#\9) {
|
|
418
422
|
word-wrap: break-word;
|
|
419
423
|
max-inline-size: 100%;
|
|
420
424
|
overflow: hidden;
|
|
@@ -427,7 +431,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
427
431
|
/* stylelint-disable selector-max-type */
|
|
428
432
|
/* stylelint-enable selector-max-type */
|
|
429
433
|
}
|
|
430
|
-
.
|
|
434
|
+
.awsui_header_xjuzf_ov8et_416 > h2:not(#\9) {
|
|
431
435
|
font-size: var(--font-size-heading-xs-wo4hpf, 14px);
|
|
432
436
|
line-height: var(--line-height-heading-xs-aeleja, 18px);
|
|
433
437
|
font-weight: var(--font-weight-heading-xs-l7rqme, 700);
|
|
@@ -436,7 +440,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
436
440
|
display: inline;
|
|
437
441
|
}
|
|
438
442
|
|
|
439
|
-
.
|
|
443
|
+
.awsui_content_xjuzf_ov8et_442:not(#\9) {
|
|
440
444
|
word-wrap: break-word;
|
|
441
445
|
max-inline-size: 100%;
|
|
442
446
|
overflow: hidden;
|
|
@@ -444,7 +448,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
444
448
|
flex: 1 1 auto;
|
|
445
449
|
min-inline-size: 0;
|
|
446
450
|
}
|
|
447
|
-
.awsui_content-overflow-
|
|
451
|
+
.awsui_content-overflow-visible_xjuzf_ov8et_450:not(#\9) {
|
|
448
452
|
overflow: visible;
|
|
449
453
|
}
|
|
450
454
|
|
|
@@ -546,7 +550,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
546
550
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
547
551
|
SPDX-License-Identifier: Apache-2.0
|
|
548
552
|
*/
|
|
549
|
-
.
|
|
553
|
+
.awsui_container_xjuzf_ov8et_552:not(#\9) {
|
|
550
554
|
display: inline-block;
|
|
551
555
|
position: fixed;
|
|
552
556
|
inset-block-start: -9999px;
|
|
@@ -554,7 +558,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
554
558
|
z-index: 2000;
|
|
555
559
|
}
|
|
556
560
|
|
|
557
|
-
.awsui_container-
|
|
561
|
+
.awsui_container-body_xjuzf_ov8et_560:not(#\9) {
|
|
558
562
|
border-collapse: separate;
|
|
559
563
|
border-spacing: 0;
|
|
560
564
|
box-sizing: border-box;
|
|
@@ -598,90 +602,98 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
598
602
|
border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-popover-umqvld, #9ba7b6);
|
|
599
603
|
}
|
|
600
604
|
|
|
601
|
-
.awsui_container-body-variant-
|
|
605
|
+
.awsui_container-body-variant-annotation_xjuzf_ov8et_603:not(#\9) {
|
|
602
606
|
background-color: var(--color-background-status-info-mvnbre, #f2f8fd);
|
|
603
607
|
border-color: var(--color-border-status-info-8upc6f, #0972d3);
|
|
604
608
|
}
|
|
605
609
|
|
|
606
|
-
.awsui_container-body-size-
|
|
610
|
+
.awsui_container-body-size-small_xjuzf_ov8et_608:not(#\9) {
|
|
607
611
|
max-inline-size: 210px;
|
|
608
612
|
}
|
|
609
|
-
.awsui_container-body-size-
|
|
613
|
+
.awsui_container-body-size-small_xjuzf_ov8et_608.awsui_fixed-width_xjuzf_ov8et_611:not(#\9) {
|
|
610
614
|
inline-size: 210px;
|
|
611
615
|
}
|
|
612
616
|
|
|
613
|
-
.awsui_container-body-size-
|
|
617
|
+
.awsui_container-body-size-medium_xjuzf_ov8et_615:not(#\9) {
|
|
614
618
|
max-inline-size: 310px;
|
|
615
619
|
}
|
|
616
|
-
.awsui_container-body-size-
|
|
620
|
+
.awsui_container-body-size-medium_xjuzf_ov8et_615.awsui_fixed-width_xjuzf_ov8et_611:not(#\9) {
|
|
617
621
|
inline-size: 310px;
|
|
618
622
|
}
|
|
619
623
|
|
|
620
|
-
.awsui_container-body-size-
|
|
624
|
+
.awsui_container-body-size-large_xjuzf_ov8et_622:not(#\9) {
|
|
621
625
|
max-inline-size: 480px;
|
|
622
626
|
}
|
|
623
627
|
@media (max-width: 480px) {
|
|
624
|
-
.awsui_container-body-size-
|
|
628
|
+
.awsui_container-body-size-large_xjuzf_ov8et_622:not(#\9) {
|
|
625
629
|
max-inline-size: 310px;
|
|
626
630
|
}
|
|
627
631
|
}
|
|
628
|
-
.awsui_container-body-size-
|
|
632
|
+
.awsui_container-body-size-large_xjuzf_ov8et_622.awsui_fixed-width_xjuzf_ov8et_611:not(#\9) {
|
|
629
633
|
inline-size: 480px;
|
|
630
634
|
}
|
|
631
635
|
|
|
632
|
-
.awsui_container-
|
|
636
|
+
.awsui_container-arrow_xjuzf_ov8et_634:not(#\9) {
|
|
633
637
|
position: absolute;
|
|
634
638
|
display: inline-block;
|
|
635
639
|
}
|
|
636
|
-
.awsui_container-arrow-position-right-
|
|
640
|
+
.awsui_container-arrow-position-right-top_xjuzf_ov8et_638:not(#\9), .awsui_container-arrow-position-right-bottom_xjuzf_ov8et_638:not(#\9) {
|
|
637
641
|
transform: rotate(-90deg);
|
|
638
642
|
transform-origin: 0 100%;
|
|
639
643
|
}
|
|
640
|
-
.awsui_container-arrow-position-right-
|
|
644
|
+
.awsui_container-arrow-position-right-top_xjuzf_ov8et_638:not(#\9):dir(rtl), .awsui_container-arrow-position-right-bottom_xjuzf_ov8et_638:not(#\9):dir(rtl) {
|
|
645
|
+
transform: rotate(90deg);
|
|
646
|
+
transform-origin: 100% 100%;
|
|
647
|
+
}
|
|
648
|
+
.awsui_container-arrow-position-right-top_xjuzf_ov8et_638:not(#\9) {
|
|
641
649
|
inset-block-start: calc(12px + 10px);
|
|
642
650
|
inset-inline-start: 0;
|
|
643
651
|
}
|
|
644
|
-
.awsui_container-arrow-position-right-
|
|
652
|
+
.awsui_container-arrow-position-right-bottom_xjuzf_ov8et_638:not(#\9) {
|
|
645
653
|
inset-block-end: 12px;
|
|
646
654
|
inset-inline-start: 0;
|
|
647
655
|
}
|
|
648
|
-
.awsui_container-arrow-position-left-
|
|
656
|
+
.awsui_container-arrow-position-left-top_xjuzf_ov8et_654:not(#\9), .awsui_container-arrow-position-left-bottom_xjuzf_ov8et_654:not(#\9) {
|
|
649
657
|
transform: rotate(90deg);
|
|
650
658
|
transform-origin: 100% 100%;
|
|
651
659
|
}
|
|
652
|
-
.awsui_container-arrow-position-left-
|
|
660
|
+
.awsui_container-arrow-position-left-top_xjuzf_ov8et_654:not(#\9):dir(rtl), .awsui_container-arrow-position-left-bottom_xjuzf_ov8et_654:not(#\9):dir(rtl) {
|
|
661
|
+
transform: rotate(-90deg);
|
|
662
|
+
transform-origin: 0% 100%;
|
|
663
|
+
}
|
|
664
|
+
.awsui_container-arrow-position-left-top_xjuzf_ov8et_654:not(#\9) {
|
|
653
665
|
inset-block-start: calc(12px + 10px);
|
|
654
666
|
inset-inline-end: 0;
|
|
655
667
|
}
|
|
656
|
-
.awsui_container-arrow-position-left-
|
|
668
|
+
.awsui_container-arrow-position-left-bottom_xjuzf_ov8et_654:not(#\9) {
|
|
657
669
|
inset-block-end: 12px;
|
|
658
670
|
inset-inline-end: 0;
|
|
659
671
|
}
|
|
660
|
-
.awsui_container-arrow-position-top-
|
|
672
|
+
.awsui_container-arrow-position-top-center_xjuzf_ov8et_670:not(#\9), .awsui_container-arrow-position-top-right_xjuzf_ov8et_670:not(#\9), .awsui_container-arrow-position-top-left_xjuzf_ov8et_670:not(#\9), .awsui_container-arrow-position-top-responsive_xjuzf_ov8et_670:not(#\9) {
|
|
661
673
|
transform: rotate(180deg);
|
|
662
674
|
transform-origin: 50% 50%;
|
|
663
675
|
}
|
|
664
|
-
.awsui_container-arrow-position-top-
|
|
676
|
+
.awsui_container-arrow-position-top-center_xjuzf_ov8et_670:not(#\9) {
|
|
665
677
|
inset-block-end: -10px;
|
|
666
678
|
inset-inline-start: calc(50% - 10px);
|
|
667
679
|
}
|
|
668
|
-
.awsui_container-arrow-position-top-
|
|
680
|
+
.awsui_container-arrow-position-top-right_xjuzf_ov8et_670:not(#\9) {
|
|
669
681
|
inset-block-end: -10px;
|
|
670
682
|
inset-inline-start: 12px;
|
|
671
683
|
}
|
|
672
|
-
.awsui_container-arrow-position-top-
|
|
684
|
+
.awsui_container-arrow-position-top-left_xjuzf_ov8et_670:not(#\9) {
|
|
673
685
|
inset-block-end: -10px;
|
|
674
686
|
inset-inline-start: calc(100% - 20px - 12px);
|
|
675
687
|
}
|
|
676
|
-
.awsui_container-arrow-position-bottom-
|
|
688
|
+
.awsui_container-arrow-position-bottom-center_xjuzf_ov8et_686:not(#\9) {
|
|
677
689
|
inset-block-start: -10px;
|
|
678
690
|
inset-inline-start: calc(50% - 10px);
|
|
679
691
|
}
|
|
680
|
-
.awsui_container-arrow-position-bottom-
|
|
692
|
+
.awsui_container-arrow-position-bottom-right_xjuzf_ov8et_690:not(#\9) {
|
|
681
693
|
inset-block-start: -10px;
|
|
682
694
|
inset-inline-start: 12px;
|
|
683
695
|
}
|
|
684
|
-
.awsui_container-arrow-position-bottom-
|
|
696
|
+
.awsui_container-arrow-position-bottom-left_xjuzf_ov8et_694:not(#\9) {
|
|
685
697
|
inset-block-start: -10px;
|
|
686
698
|
inset-inline-start: calc(100% - 20px - 12px);
|
|
687
699
|
}
|
|
@@ -784,10 +796,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
784
796
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
785
797
|
SPDX-License-Identifier: Apache-2.0
|
|
786
798
|
*/
|
|
787
|
-
.
|
|
788
|
-
animation: awsui_awsui-motion-fade-
|
|
799
|
+
.awsui_container_xjuzf_ov8et_552:not(#\9) {
|
|
800
|
+
animation: awsui_awsui-motion-fade-in_xjuzf_ov8et_1 var(--motion-duration-show-paced-q2lo2h, 180ms) var(--motion-easing-show-paced-ne2o0s, ease-out);
|
|
789
801
|
}
|
|
790
|
-
@keyframes awsui_awsui-motion-fade-
|
|
802
|
+
@keyframes awsui_awsui-motion-fade-in_xjuzf_ov8et_1 {
|
|
791
803
|
from {
|
|
792
804
|
opacity: 0.2;
|
|
793
805
|
}
|
|
@@ -796,19 +808,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
796
808
|
}
|
|
797
809
|
}
|
|
798
810
|
@media (prefers-reduced-motion: reduce) {
|
|
799
|
-
.
|
|
811
|
+
.awsui_container_xjuzf_ov8et_552:not(#\9) {
|
|
800
812
|
animation: none;
|
|
801
813
|
transition: none;
|
|
802
814
|
}
|
|
803
815
|
}
|
|
804
|
-
.awsui-motion-disabled .
|
|
816
|
+
.awsui-motion-disabled .awsui_container_xjuzf_ov8et_552:not(#\9), .awsui-mode-entering .awsui_container_xjuzf_ov8et_552:not(#\9) {
|
|
805
817
|
animation: none;
|
|
806
818
|
transition: none;
|
|
807
819
|
}
|
|
808
|
-
.
|
|
809
|
-
animation: awsui_awsui-motion-fade-
|
|
820
|
+
.awsui_container_xjuzf_ov8et_552.awsui_refresh_xjuzf_ov8et_235:not(#\9) {
|
|
821
|
+
animation: awsui_awsui-motion-fade-in_xjuzf_ov8et_1 var(--motion-duration-refresh-only-fast-4jn2d7, 115ms) var(--motion-easing-refresh-only-a-8flf9q, cubic-bezier(0, 0, 0, 1));
|
|
810
822
|
}
|
|
811
|
-
@keyframes awsui_awsui-motion-fade-
|
|
823
|
+
@keyframes awsui_awsui-motion-fade-in_xjuzf_ov8et_1 {
|
|
812
824
|
from {
|
|
813
825
|
opacity: 0.2;
|
|
814
826
|
}
|
|
@@ -817,17 +829,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
817
829
|
}
|
|
818
830
|
}
|
|
819
831
|
@media (prefers-reduced-motion: reduce) {
|
|
820
|
-
.
|
|
832
|
+
.awsui_container_xjuzf_ov8et_552.awsui_refresh_xjuzf_ov8et_235:not(#\9) {
|
|
821
833
|
animation: none;
|
|
822
834
|
transition: none;
|
|
823
835
|
}
|
|
824
836
|
}
|
|
825
|
-
.awsui-motion-disabled .
|
|
837
|
+
.awsui-motion-disabled .awsui_container_xjuzf_ov8et_552.awsui_refresh_xjuzf_ov8et_235:not(#\9), .awsui-mode-entering .awsui_container_xjuzf_ov8et_552.awsui_refresh_xjuzf_ov8et_235:not(#\9) {
|
|
826
838
|
animation: none;
|
|
827
839
|
transition: none;
|
|
828
840
|
}
|
|
829
841
|
|
|
830
|
-
.
|
|
842
|
+
.awsui_root_xjuzf_ov8et_840:not(#\9) {
|
|
831
843
|
border-collapse: separate;
|
|
832
844
|
border-spacing: 0;
|
|
833
845
|
box-sizing: border-box;
|
|
@@ -864,14 +876,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
864
876
|
color: inherit;
|
|
865
877
|
}
|
|
866
878
|
|
|
867
|
-
.
|
|
879
|
+
.awsui_trigger_xjuzf_ov8et_876:not(#\9) {
|
|
868
880
|
display: inline-block;
|
|
869
881
|
max-inline-size: 100%;
|
|
870
882
|
color: inherit;
|
|
871
883
|
text-align: inherit;
|
|
872
884
|
}
|
|
873
885
|
|
|
874
|
-
.awsui_trigger-type-
|
|
886
|
+
.awsui_trigger-type-text_xjuzf_ov8et_883:not(#\9) {
|
|
875
887
|
border-block: 0;
|
|
876
888
|
border-inline: 0;
|
|
877
889
|
margin-block: 0;
|
|
@@ -882,17 +894,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
882
894
|
cursor: pointer;
|
|
883
895
|
border-block-end: var(--border-divider-list-width-27y3k5, 1px) dashed currentColor;
|
|
884
896
|
}
|
|
885
|
-
.awsui_trigger-type-
|
|
897
|
+
.awsui_trigger-type-text_xjuzf_ov8et_883:not(#\9):focus {
|
|
886
898
|
outline: none;
|
|
887
899
|
}
|
|
888
|
-
body[data-awsui-focus-visible=true] .awsui_trigger-type-
|
|
900
|
+
body[data-awsui-focus-visible=true] .awsui_trigger-type-text_xjuzf_ov8et_883:not(#\9):focus {
|
|
889
901
|
position: relative;
|
|
890
902
|
}
|
|
891
|
-
body[data-awsui-focus-visible=true] .awsui_trigger-type-
|
|
903
|
+
body[data-awsui-focus-visible=true] .awsui_trigger-type-text_xjuzf_ov8et_883:not(#\9):focus {
|
|
892
904
|
outline: 2px dotted transparent;
|
|
893
905
|
outline-offset: calc(1px - 1px);
|
|
894
906
|
}
|
|
895
|
-
body[data-awsui-focus-visible=true] .awsui_trigger-type-
|
|
907
|
+
body[data-awsui-focus-visible=true] .awsui_trigger-type-text_xjuzf_ov8et_883:not(#\9):focus::before {
|
|
896
908
|
content: " ";
|
|
897
909
|
display: block;
|
|
898
910
|
position: absolute;
|
|
@@ -906,10 +918,10 @@ body[data-awsui-focus-visible=true] .awsui_trigger-type-text_xjuzf_1xq78_871:not
|
|
|
906
918
|
border-end-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
907
919
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
908
920
|
}
|
|
909
|
-
.awsui_trigger-type-
|
|
921
|
+
.awsui_trigger-type-text_xjuzf_ov8et_883 > .awsui_trigger-inner-text_xjuzf_ov8et_918:not(#\9) {
|
|
910
922
|
position: relative;
|
|
911
923
|
}
|
|
912
924
|
|
|
913
|
-
.awsui_popover-inline-
|
|
925
|
+
.awsui_popover-inline-content_xjuzf_ov8et_922:not(#\9) {
|
|
914
926
|
display: inline;
|
|
915
927
|
}
|
|
@@ -2,55 +2,55 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"arrow": "
|
|
6
|
-
"arrow-outer": "awsui_arrow-
|
|
7
|
-
"arrow-inner": "awsui_arrow-
|
|
8
|
-
"refresh": "
|
|
9
|
-
"arrow-position-right-top": "awsui_arrow-position-right-
|
|
10
|
-
"arrow-position-right-bottom": "awsui_arrow-position-right-
|
|
11
|
-
"arrow-position-left-top": "awsui_arrow-position-left-
|
|
12
|
-
"arrow-position-left-bottom": "awsui_arrow-position-left-
|
|
13
|
-
"arrow-position-top-center": "awsui_arrow-position-top-
|
|
14
|
-
"arrow-position-top-right": "awsui_arrow-position-top-
|
|
15
|
-
"arrow-position-top-left": "awsui_arrow-position-top-
|
|
16
|
-
"arrow-position-top-responsive": "awsui_arrow-position-top-
|
|
17
|
-
"arrow-position-bottom-center": "awsui_arrow-position-bottom-
|
|
18
|
-
"arrow-position-bottom-right": "awsui_arrow-position-bottom-
|
|
19
|
-
"arrow-position-bottom-left": "awsui_arrow-position-bottom-
|
|
20
|
-
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-
|
|
21
|
-
"body": "
|
|
22
|
-
"body-overflow-visible": "awsui_body-overflow-
|
|
23
|
-
"has-dismiss": "awsui_has-
|
|
24
|
-
"dismiss": "
|
|
25
|
-
"dismiss-control": "awsui_dismiss-
|
|
26
|
-
"header-row": "awsui_header-
|
|
27
|
-
"header": "
|
|
28
|
-
"content": "
|
|
29
|
-
"content-overflow-visible": "awsui_content-overflow-
|
|
30
|
-
"container": "
|
|
31
|
-
"container-body": "awsui_container-
|
|
32
|
-
"container-body-variant-annotation": "awsui_container-body-variant-
|
|
33
|
-
"container-body-size-small": "awsui_container-body-size-
|
|
34
|
-
"fixed-width": "awsui_fixed-
|
|
35
|
-
"container-body-size-medium": "awsui_container-body-size-
|
|
36
|
-
"container-body-size-large": "awsui_container-body-size-
|
|
37
|
-
"container-arrow": "awsui_container-
|
|
38
|
-
"container-arrow-position-right-top": "awsui_container-arrow-position-right-
|
|
39
|
-
"container-arrow-position-right-bottom": "awsui_container-arrow-position-right-
|
|
40
|
-
"container-arrow-position-left-top": "awsui_container-arrow-position-left-
|
|
41
|
-
"container-arrow-position-left-bottom": "awsui_container-arrow-position-left-
|
|
42
|
-
"container-arrow-position-top-center": "awsui_container-arrow-position-top-
|
|
43
|
-
"container-arrow-position-top-right": "awsui_container-arrow-position-top-
|
|
44
|
-
"container-arrow-position-top-left": "awsui_container-arrow-position-top-
|
|
45
|
-
"container-arrow-position-top-responsive": "awsui_container-arrow-position-top-
|
|
46
|
-
"container-arrow-position-bottom-center": "awsui_container-arrow-position-bottom-
|
|
47
|
-
"container-arrow-position-bottom-right": "awsui_container-arrow-position-bottom-
|
|
48
|
-
"container-arrow-position-bottom-left": "awsui_container-arrow-position-bottom-
|
|
49
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
50
|
-
"root": "
|
|
51
|
-
"trigger": "
|
|
52
|
-
"trigger-type-text": "awsui_trigger-type-
|
|
53
|
-
"trigger-inner-text": "awsui_trigger-inner-
|
|
54
|
-
"popover-inline-content": "awsui_popover-inline-
|
|
5
|
+
"arrow": "awsui_arrow_xjuzf_ov8et_197",
|
|
6
|
+
"arrow-outer": "awsui_arrow-outer_xjuzf_ov8et_201",
|
|
7
|
+
"arrow-inner": "awsui_arrow-inner_xjuzf_ov8et_201",
|
|
8
|
+
"refresh": "awsui_refresh_xjuzf_ov8et_235",
|
|
9
|
+
"arrow-position-right-top": "awsui_arrow-position-right-top_xjuzf_ov8et_245",
|
|
10
|
+
"arrow-position-right-bottom": "awsui_arrow-position-right-bottom_xjuzf_ov8et_245",
|
|
11
|
+
"arrow-position-left-top": "awsui_arrow-position-left-top_xjuzf_ov8et_248",
|
|
12
|
+
"arrow-position-left-bottom": "awsui_arrow-position-left-bottom_xjuzf_ov8et_248",
|
|
13
|
+
"arrow-position-top-center": "awsui_arrow-position-top-center_xjuzf_ov8et_251",
|
|
14
|
+
"arrow-position-top-right": "awsui_arrow-position-top-right_xjuzf_ov8et_251",
|
|
15
|
+
"arrow-position-top-left": "awsui_arrow-position-top-left_xjuzf_ov8et_251",
|
|
16
|
+
"arrow-position-top-responsive": "awsui_arrow-position-top-responsive_xjuzf_ov8et_251",
|
|
17
|
+
"arrow-position-bottom-center": "awsui_arrow-position-bottom-center_xjuzf_ov8et_254",
|
|
18
|
+
"arrow-position-bottom-right": "awsui_arrow-position-bottom-right_xjuzf_ov8et_254",
|
|
19
|
+
"arrow-position-bottom-left": "awsui_arrow-position-bottom-left_xjuzf_ov8et_254",
|
|
20
|
+
"arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_xjuzf_ov8et_254",
|
|
21
|
+
"body": "awsui_body_xjuzf_ov8et_356",
|
|
22
|
+
"body-overflow-visible": "awsui_body-overflow-visible_xjuzf_ov8et_395",
|
|
23
|
+
"has-dismiss": "awsui_has-dismiss_xjuzf_ov8et_399",
|
|
24
|
+
"dismiss": "awsui_dismiss_xjuzf_ov8et_404",
|
|
25
|
+
"dismiss-control": "awsui_dismiss-control_xjuzf_ov8et_412",
|
|
26
|
+
"header-row": "awsui_header-row_xjuzf_ov8et_416",
|
|
27
|
+
"header": "awsui_header_xjuzf_ov8et_416",
|
|
28
|
+
"content": "awsui_content_xjuzf_ov8et_442",
|
|
29
|
+
"content-overflow-visible": "awsui_content-overflow-visible_xjuzf_ov8et_450",
|
|
30
|
+
"container": "awsui_container_xjuzf_ov8et_552",
|
|
31
|
+
"container-body": "awsui_container-body_xjuzf_ov8et_560",
|
|
32
|
+
"container-body-variant-annotation": "awsui_container-body-variant-annotation_xjuzf_ov8et_603",
|
|
33
|
+
"container-body-size-small": "awsui_container-body-size-small_xjuzf_ov8et_608",
|
|
34
|
+
"fixed-width": "awsui_fixed-width_xjuzf_ov8et_611",
|
|
35
|
+
"container-body-size-medium": "awsui_container-body-size-medium_xjuzf_ov8et_615",
|
|
36
|
+
"container-body-size-large": "awsui_container-body-size-large_xjuzf_ov8et_622",
|
|
37
|
+
"container-arrow": "awsui_container-arrow_xjuzf_ov8et_634",
|
|
38
|
+
"container-arrow-position-right-top": "awsui_container-arrow-position-right-top_xjuzf_ov8et_638",
|
|
39
|
+
"container-arrow-position-right-bottom": "awsui_container-arrow-position-right-bottom_xjuzf_ov8et_638",
|
|
40
|
+
"container-arrow-position-left-top": "awsui_container-arrow-position-left-top_xjuzf_ov8et_654",
|
|
41
|
+
"container-arrow-position-left-bottom": "awsui_container-arrow-position-left-bottom_xjuzf_ov8et_654",
|
|
42
|
+
"container-arrow-position-top-center": "awsui_container-arrow-position-top-center_xjuzf_ov8et_670",
|
|
43
|
+
"container-arrow-position-top-right": "awsui_container-arrow-position-top-right_xjuzf_ov8et_670",
|
|
44
|
+
"container-arrow-position-top-left": "awsui_container-arrow-position-top-left_xjuzf_ov8et_670",
|
|
45
|
+
"container-arrow-position-top-responsive": "awsui_container-arrow-position-top-responsive_xjuzf_ov8et_670",
|
|
46
|
+
"container-arrow-position-bottom-center": "awsui_container-arrow-position-bottom-center_xjuzf_ov8et_686",
|
|
47
|
+
"container-arrow-position-bottom-right": "awsui_container-arrow-position-bottom-right_xjuzf_ov8et_690",
|
|
48
|
+
"container-arrow-position-bottom-left": "awsui_container-arrow-position-bottom-left_xjuzf_ov8et_694",
|
|
49
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_xjuzf_ov8et_1",
|
|
50
|
+
"root": "awsui_root_xjuzf_ov8et_840",
|
|
51
|
+
"trigger": "awsui_trigger_xjuzf_ov8et_876",
|
|
52
|
+
"trigger-type-text": "awsui_trigger-type-text_xjuzf_ov8et_883",
|
|
53
|
+
"trigger-inner-text": "awsui_trigger-inner-text_xjuzf_ov8et_918",
|
|
54
|
+
"popover-inline-content": "awsui_popover-inline-content_xjuzf_ov8et_922"
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -4,7 +4,7 @@ export default function usePopoverPosition({ popoverRef, bodyRef, arrowRef, trac
|
|
|
4
4
|
popoverRef: React.RefObject<HTMLDivElement | null>;
|
|
5
5
|
bodyRef: React.RefObject<HTMLDivElement | null>;
|
|
6
6
|
arrowRef: React.RefObject<HTMLDivElement | null>;
|
|
7
|
-
trackRef: React.RefObject<
|
|
7
|
+
trackRef: React.RefObject<HTMLElement | SVGElement | null>;
|
|
8
8
|
contentRef: React.RefObject<HTMLDivElement | null>;
|
|
9
9
|
allowScrollToFit?: boolean;
|
|
10
10
|
allowVerticalOverflow?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-popover-position.d.ts","sourceRoot":"","sources":["../../../src/popover/use-popover-position.ts"],"names":[],"mappings":"AAGA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAe,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"use-popover-position.d.ts","sourceRoot":"","sources":["../../../src/popover/use-popover-position.ts"],"names":[],"mappings":"AAGA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAe,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAWnF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,EAAE;IACD,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACjD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC;IAC3D,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,EAAE,YAAY,CAAC,QAAQ,CAAC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;;;;qDAMyC,IAAI;EAsI7C"}
|
|
@@ -5,6 +5,7 @@ import { calculatePosition, getDimensions, getOffsetDimensions } from './utils/p
|
|
|
5
5
|
import { nodeContains } from '@cloudscape-design/component-toolkit/dom';
|
|
6
6
|
import { calculateScroll, getFirstScrollableParent, scrollRectangleIntoView, } from '../internal/utils/scrollable-containers';
|
|
7
7
|
import { getContainingBlock } from '../internal/utils/dom';
|
|
8
|
+
import { getLogicalBoundingClientRect } from '../internal/direction';
|
|
8
9
|
export default function usePopoverPosition({ popoverRef, bodyRef, arrowRef, trackRef, contentRef, allowScrollToFit, allowVerticalOverflow, preferredPosition, renderWithPortal, keepPosition, }) {
|
|
9
10
|
const previousInternalPositionRef = useRef(null);
|
|
10
11
|
const [popoverStyle, setPopoverStyle] = useState({});
|
|
@@ -31,26 +32,26 @@ export default function usePopoverPosition({ popoverRef, bodyRef, arrowRef, trac
|
|
|
31
32
|
// Imperatively move body off-screen to give it room to expand.
|
|
32
33
|
// Not doing this in React because this recalculation should happen
|
|
33
34
|
// in the span of a single frame without rerendering anything.
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
popover.style.
|
|
37
|
-
popover.style.
|
|
35
|
+
const prevInsetBlockStart = popover.style.insetBlockStart;
|
|
36
|
+
const prevInsetInlineStart = popover.style.insetInlineStart;
|
|
37
|
+
popover.style.insetBlockStart = '0';
|
|
38
|
+
popover.style.insetInlineStart = '0';
|
|
38
39
|
// Imperatively remove body styles that can remain from the previous computation.
|
|
39
|
-
body.style.
|
|
40
|
+
body.style.maxBlockSize = '';
|
|
40
41
|
body.style.overflowX = '';
|
|
41
42
|
body.style.overflowY = '';
|
|
42
43
|
// Get rects representing key elements
|
|
43
44
|
// Use getComputedStyle for arrowRect to avoid modifications made by transform
|
|
44
45
|
const viewportRect = getViewportRect(document.defaultView);
|
|
45
|
-
const trackRect = track
|
|
46
|
+
const trackRect = getLogicalBoundingClientRect(track);
|
|
46
47
|
const arrowRect = getDimensions(arrow);
|
|
47
48
|
const containingBlock = getContainingBlock(popover);
|
|
48
|
-
const containingBlockRect = containingBlock ? containingBlock
|
|
49
|
+
const containingBlockRect = containingBlock ? getLogicalBoundingClientRect(containingBlock) : viewportRect;
|
|
49
50
|
const bodyBorderWidth = getBorderWidth(body);
|
|
50
|
-
const contentRect = contentRef.current
|
|
51
|
+
const contentRect = getLogicalBoundingClientRect(contentRef.current);
|
|
51
52
|
const contentBoundingBox = {
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
inlineSize: contentRect.inlineSize + 2 * bodyBorderWidth,
|
|
54
|
+
blockSize: contentRect.blockSize + 2 * bodyBorderWidth,
|
|
54
55
|
};
|
|
55
56
|
// When keepPosition is true and the recalculation was triggered by a resize of the popover content,
|
|
56
57
|
// we maintain the previously defined internal position,
|
|
@@ -75,11 +76,11 @@ export default function usePopoverPosition({ popoverRef, bodyRef, arrowRef, trac
|
|
|
75
76
|
// and use that to recalculate the new popover position.
|
|
76
77
|
const trackRelativeOffset = toRelativePosition(popoverOffset, toRelativePosition(trackRect, containingBlockRect));
|
|
77
78
|
// Bring back the container to its original position to prevent any flashing.
|
|
78
|
-
popover.style.
|
|
79
|
-
popover.style.
|
|
79
|
+
popover.style.insetBlockStart = prevInsetBlockStart;
|
|
80
|
+
popover.style.insetInlineStart = prevInsetInlineStart;
|
|
80
81
|
// Allow popover body to scroll if can't fit the popover into the container/viewport otherwise.
|
|
81
82
|
if (scrollable) {
|
|
82
|
-
body.style.
|
|
83
|
+
body.style.maxBlockSize = rect.blockSize + 'px';
|
|
83
84
|
body.style.overflowX = 'hidden';
|
|
84
85
|
body.style.overflowY = 'auto';
|
|
85
86
|
}
|
|
@@ -88,18 +89,20 @@ export default function usePopoverPosition({ popoverRef, bodyRef, arrowRef, trac
|
|
|
88
89
|
setInternalPosition(newInternalPosition);
|
|
89
90
|
const shouldScroll = allowScrollToFit && !shouldKeepPosition;
|
|
90
91
|
// Position the popover
|
|
91
|
-
const
|
|
92
|
-
|
|
92
|
+
const insetBlockStart = shouldScroll
|
|
93
|
+
? popoverOffset.insetBlockStart + calculateScroll(rect)
|
|
94
|
+
: popoverOffset.insetBlockStart;
|
|
95
|
+
setPopoverStyle({ insetBlockStart, insetInlineStart: popoverOffset.insetInlineStart });
|
|
93
96
|
// Scroll if necessary
|
|
94
97
|
if (shouldScroll) {
|
|
95
98
|
const scrollableParent = getFirstScrollableParent(popover);
|
|
96
99
|
scrollRectangleIntoView(rect, scrollableParent);
|
|
97
100
|
}
|
|
98
101
|
positionHandlerRef.current = () => {
|
|
99
|
-
const newTrackOffset = toRelativePosition(track
|
|
102
|
+
const newTrackOffset = toRelativePosition(getLogicalBoundingClientRect(track), containingBlock ? getLogicalBoundingClientRect(containingBlock) : viewportRect);
|
|
100
103
|
setPopoverStyle({
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
insetBlockStart: newTrackOffset.insetBlockStart + trackRelativeOffset.insetBlockStart,
|
|
105
|
+
insetInlineStart: newTrackOffset.insetInlineStart + trackRelativeOffset.insetInlineStart,
|
|
103
106
|
});
|
|
104
107
|
};
|
|
105
108
|
}, [
|
|
@@ -124,8 +127,8 @@ function getBorderWidth(element) {
|
|
|
124
127
|
*/
|
|
125
128
|
function toRelativePosition(element, parent) {
|
|
126
129
|
return {
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
insetBlockStart: element.insetBlockStart - parent.insetBlockStart,
|
|
131
|
+
insetInlineStart: element.insetInlineStart - parent.insetInlineStart,
|
|
129
132
|
};
|
|
130
133
|
}
|
|
131
134
|
/**
|
|
@@ -133,19 +136,19 @@ function toRelativePosition(element, parent) {
|
|
|
133
136
|
*/
|
|
134
137
|
function getViewportRect(window) {
|
|
135
138
|
return {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
insetBlockStart: 0,
|
|
140
|
+
insetInlineStart: 0,
|
|
141
|
+
inlineSize: window.innerWidth,
|
|
142
|
+
blockSize: window.innerHeight,
|
|
140
143
|
};
|
|
141
144
|
}
|
|
142
145
|
function getDocumentRect(document) {
|
|
143
|
-
const {
|
|
146
|
+
const { insetBlockStart, insetInlineStart } = getLogicalBoundingClientRect(document.documentElement);
|
|
144
147
|
return {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
insetBlockStart,
|
|
149
|
+
insetInlineStart,
|
|
150
|
+
inlineSize: document.documentElement.scrollWidth,
|
|
151
|
+
blockSize: document.documentElement.scrollHeight,
|
|
149
152
|
};
|
|
150
153
|
}
|
|
151
154
|
//# sourceMappingURL=use-popover-position.js.map
|