@aurodesignsystem-dev/auro-popover 0.0.0-pr136.0 → 0.0.0-pr141.0
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/README.md +26 -27
- package/demo/api.html +1 -0
- package/demo/api.md +203 -78
- package/demo/api.min.js +141 -62
- package/demo/index.md +9 -9
- package/demo/index.min.js +141 -62
- package/demo/readme.md +26 -27
- package/dist/auro-popover-DTAnB1se.js +19 -0
- package/dist/index.d.ts +109 -54
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +7 -7
- package/dist/auro-popover-Bu7mQ0Hu.js +0 -19
package/demo/index.min.js
CHANGED
|
@@ -1991,7 +1991,10 @@ class Popover {
|
|
|
1991
1991
|
return;
|
|
1992
1992
|
}
|
|
1993
1993
|
const reference = state.elements.reference;
|
|
1994
|
-
if (
|
|
1994
|
+
if (
|
|
1995
|
+
!reference ||
|
|
1996
|
+
typeof reference.getBoundingClientRect !== "function"
|
|
1997
|
+
) {
|
|
1995
1998
|
return;
|
|
1996
1999
|
}
|
|
1997
2000
|
const r = reference.getBoundingClientRect();
|
|
@@ -2045,7 +2048,7 @@ class Popover {
|
|
|
2045
2048
|
var colorCss = i$3`::slotted(*):not([onDark]),::slotted(*):not([appearance=inverse]){color:var(--ds-auro-popover-text-color)}.popover{background-color:var(--ds-auro-popover-container-color);box-shadow:var(--ds-auro-popover-boxshadow-color)}.arrow:before{background-color:var(--ds-auro-popover-container-color);box-shadow:2px 2px 1px 0 var(--ds-auro-popover-boxshadow-color)}
|
|
2046
2049
|
`;
|
|
2047
2050
|
|
|
2048
|
-
var styleCss = i$3`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, .875rem);font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-size:var(--wcss-body-sm-emphasized-font-size, .875rem);font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-size:var(--wcss-body-xs-font-size, .75rem);font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-size:var(--wcss-body-xs-emphasized-font-size, .75rem);font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-size:var(--wcss-body-2xs-font-size, .625rem);font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, .875rem)}.body-2xs,.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-size:var(--wcss-body-2xs-emphasized-font-size, .625rem);font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, .875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, .05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, .05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, .05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, .05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, .05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, .1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(.875rem, 1.1666666667vw, .875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, .1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host(:not([data-show])) .popover,:host([disabled]) .popover,:host([addSpace]) :host(:not([data-show])) .popover{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}::slotted(*){white-space:normal}::slotted(*:hover){cursor:pointer}[data-trigger-placement]::slotted(*:hover){position:relative}[data-trigger-placement]::slotted(*:hover):before{position:absolute;left:0;display:block;width:100%;height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem));content:""}[data-trigger-placement^=top]::slotted(*:hover):before{top:calc(-1 * (var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem)))}[data-trigger-placement^=bottom]::slotted(*:hover):before{bottom:calc(-1 * (var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem)))}:host([data-show]) .popover{z-index:var(--ds-depth-tooltip, 400)}:host([removeSpace]) .popover{margin:calc(-1 * (var(--ds-size-50, .25rem) + 1px)) 0!important}:host([addSpace]) .popover{margin:var(--ds-size-200, 1rem) 0!important}:host([addSpace]) [data-trigger-placement]::slotted(*:hover):before{height:var(--ds-size-500, 2.5rem)}:host([addSpace]) [data-trigger-placement^=top]::slotted(*:hover):before{top:calc(-1 * var(--ds-size-500, 2.5rem))}:host([addSpace]) [data-trigger-placement^=bottom]::slotted(*:hover):before{bottom:calc(-1 * var(--ds-size-500, 2.5rem))}.popover{display:inline-block;max-width:calc(100% - var(--ds-size-400, 2rem));border:0;overflow:visible;border-radius:var(--ds-border-radius, .375rem)}@media screen and (min-width:576px){.popover{max-width:50%}}@media screen and (min-width:768px){.popover{max-width:40%}}@media screen and (min-width:1024px){.popover{max-width:27rem}}[data-popper-placement^=top]>.arrow{bottom:calc(-1 * (var(--ds-size-100, .5rem) + var(--ds-size-25, .125rem)))}[data-popper-placement^=top]>.arrow:before{top:calc(-1 * var(--ds-size-200, 1rem));left:calc(-1 * var(--ds-size-75, .375rem));transform:rotate(45deg)}[data-popper-placement^=bottom]>.arrow{top:calc(-1 * (var(--ds-size-100, .5rem) + var(--ds-size-25, .125rem)))}[data-popper-placement^=bottom]>.arrow:before{top:var(--ds-size-50, .25rem);right:calc(-1 * var(--ds-size-200, 1rem));transform:rotate(-135deg)}.arrow{position:relative;margin-top:-var(--ds-size-100,.5rem)}.arrow:before{position:absolute;width:var(--ds-size-150, .75rem);height:var(--ds-size-150, .75rem);content:""}
|
|
2051
|
+
var styleCss = i$3`.body-default{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-default-font-size, 1rem);font-variant-ligatures:none;font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-variant-ligatures:none;font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-lg-font-size, 1.125rem);font-variant-ligatures:none;font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-variant-ligatures:none;font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-sm-font-size, .875rem);font-variant-ligatures:none;font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-sm-emphasized-font-size, .875rem);font-variant-ligatures:none;font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-xs-font-size, .75rem);font-variant-ligatures:none;font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-xs-emphasized-font-size, .75rem);font-variant-ligatures:none;font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-font-size, .625rem);font-variant-ligatures:none;font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, .875rem)}.body-2xs,.body-2xs-emphasized{letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:var(--wcss-body-2xs-emphasized-font-size, .625rem);font-variant-ligatures:none;font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, .875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-variant-ligatures:none;font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-variant-ligatures:none;font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-variant-ligatures:none;font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-variant-ligatures:none;font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-variant-ligatures:none;font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-variant-ligatures:none;font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-variant-ligatures:none;font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, .05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, .05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, .05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, .05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, .05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, .1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(.875rem, 1.1666666667vw, .875rem));font-variant-ligatures:none;font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, .1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden,:host(:not([data-show])) .popover,:host([disabled]) .popover,:host([addspace]) :host(:not([data-show])) .popover{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px,1px,1px,1px);width:1px;height:1px;padding:0;border:0}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}::slotted(*){white-space:normal}::slotted(*:hover){cursor:pointer}[data-trigger-placement]::slotted(*:hover){position:relative}[data-trigger-placement]::slotted(*:hover):before{position:absolute;left:0;display:block;width:100%;height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem));content:""}[data-trigger-placement^=top]::slotted(*:hover):before{top:calc(-1 * (var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem)))}[data-trigger-placement^=bottom]::slotted(*:hover):before{bottom:calc(-1 * (var(--ds-size-200, 1rem) + var(--ds-size-50, .25rem)))}:host([data-show]) .popover{z-index:var(--ds-depth-tooltip, 400)}:host([removespace]) .popover{margin:calc(-1 * (var(--ds-size-50, .25rem) + 1px)) 0!important}:host([addspace]) .popover{margin:var(--ds-size-200, 1rem) 0!important}:host([addspace]) [data-trigger-placement]::slotted(*:hover):before{height:var(--ds-size-500, 2.5rem)}:host([addspace]) [data-trigger-placement^=top]::slotted(*:hover):before{top:calc(-1 * var(--ds-size-500, 2.5rem))}:host([addspace]) [data-trigger-placement^=bottom]::slotted(*:hover):before{bottom:calc(-1 * var(--ds-size-500, 2.5rem))}.popover{display:inline-block;max-width:calc(100% - var(--ds-size-400, 2rem));border:0;overflow:visible;border-radius:var(--ds-border-radius, .375rem)}@media screen and (min-width:576px){.popover{max-width:50%}}@media screen and (min-width:768px){.popover{max-width:40%}}@media screen and (min-width:1024px){.popover{max-width:27rem}}[data-popper-placement^=top]>.arrow{bottom:calc(-1 * (var(--ds-size-100, .5rem) + var(--ds-size-25, .125rem)))}[data-popper-placement^=top]>.arrow:before{top:calc(-1 * var(--ds-size-200, 1rem));left:calc(-1 * var(--ds-size-75, .375rem));transform:rotate(45deg)}[data-popper-placement^=bottom]>.arrow{top:calc(-1 * (var(--ds-size-100, .5rem) + var(--ds-size-25, .125rem)))}[data-popper-placement^=bottom]>.arrow:before{top:var(--ds-size-50, .25rem);right:calc(-1 * var(--ds-size-200, 1rem));transform:rotate(-135deg)}.arrow{position:relative;margin-top:-var(--ds-size-100,.5rem)}.arrow:before{position:absolute;width:var(--ds-size-150, .75rem);height:var(--ds-size-150, .75rem);content:""}
|
|
2049
2052
|
`;
|
|
2050
2053
|
|
|
2051
2054
|
var tokensCss = i$3`:host{--ds-auro-popover-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, .15));--ds-auro-popover-container-color: var(--ds-basic-color-surface-default, #ffffff);--ds-auro-popover-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}
|
|
@@ -2056,11 +2059,34 @@ var tokensCss = i$3`:host{--ds-auro-popover-boxshadow-color: var(--ds-elevation-
|
|
|
2056
2059
|
|
|
2057
2060
|
|
|
2058
2061
|
/**
|
|
2059
|
-
*
|
|
2062
|
+
* Shows short supporting content next to a trigger when someone hovers over, focuses, or taps it.
|
|
2063
|
+
*
|
|
2064
|
+
* **Key capabilities**
|
|
2065
|
+
*
|
|
2066
|
+
* - **Keyboard and screen reader support**: A trigger that can't take focus is made reachable with the keyboard, and screen readers announce the popover text as the trigger's description.
|
|
2067
|
+
* - **Placement**: The popover appears above the trigger by default, or below it with `placement="bottom"`.
|
|
2068
|
+
* - **Turn off**: The `disabled` attribute stops the popover from showing.
|
|
2069
|
+
* - **Restyling**: The `popover`, `arrow`, and `trigger` CSS parts let you restyle the bubble, its arrow, and the trigger wrapper.
|
|
2070
|
+
*
|
|
2071
|
+
* @example
|
|
2072
|
+
* <auro-popover>
|
|
2073
|
+
* Top popover content!
|
|
2074
|
+
* <auro-button slot="trigger">Popover test</auro-button>
|
|
2075
|
+
* </auro-popover>
|
|
2076
|
+
*
|
|
2077
|
+
* @summary A hover and focus popover that attaches to any trigger, with keyboard and screen reader support.
|
|
2060
2078
|
* @customElement auro-popover
|
|
2061
2079
|
*
|
|
2062
|
-
* @slot -
|
|
2080
|
+
* @slot - The content shown in the popover. Screen readers announce its text as the trigger's description, so use plain text.
|
|
2063
2081
|
* @slot trigger - The element in this slot triggers hiding and showing the popover.
|
|
2082
|
+
*
|
|
2083
|
+
* @csspart popover - The popover bubble that holds the content.
|
|
2084
|
+
* @csspart arrow - The positioning anchor for the popover's arrow. The visible arrow shape is its `::before` pseudo-element, so target `::part(arrow)::before` to change color, shadow, or size. Popper sets the arrow's position, so don't override it through this part.
|
|
2085
|
+
* @csspart trigger - The wrapper around the `trigger` slot, useful for correcting alignment between the trigger and the popover. Empty when the `for` attribute is used, because the trigger then lives outside the component.
|
|
2086
|
+
*
|
|
2087
|
+
* @cssprop --ds-auro-popover-boxshadow-color - Color of the shadow around the popover.
|
|
2088
|
+
* @cssprop --ds-auro-popover-container-color - Background color of the popover.
|
|
2089
|
+
* @cssprop --ds-auro-popover-text-color - Color of the popover text.
|
|
2064
2090
|
*/
|
|
2065
2091
|
class AuroPopover extends i {
|
|
2066
2092
|
constructor() {
|
|
@@ -2095,63 +2121,65 @@ class AuroPopover extends i {
|
|
|
2095
2121
|
static get properties() {
|
|
2096
2122
|
return {
|
|
2097
2123
|
/**
|
|
2098
|
-
* Adds
|
|
2124
|
+
* Adds more space between the popover and its trigger. When `removeSpace` is also set, `addSpace` takes effect.
|
|
2099
2125
|
*/
|
|
2100
2126
|
addSpace: {
|
|
2101
2127
|
type: Boolean,
|
|
2102
|
-
reflect: true
|
|
2128
|
+
reflect: true,
|
|
2129
|
+
attribute: "addspace",
|
|
2103
2130
|
},
|
|
2104
2131
|
|
|
2105
2132
|
/**
|
|
2106
|
-
*
|
|
2133
|
+
* Sets the element that keeps the popover from overflowing, such as a selector string or an HTML element.
|
|
2107
2134
|
* @type {string | object}
|
|
2108
2135
|
*/
|
|
2109
2136
|
boundary: { type: String },
|
|
2110
2137
|
|
|
2111
2138
|
/**
|
|
2112
|
-
*
|
|
2139
|
+
* Turns the popover off. A disabled popover doesn't show on hover, focus, touch, or keyboard activation.
|
|
2113
2140
|
*/
|
|
2114
2141
|
disabled: {
|
|
2115
2142
|
type: Boolean,
|
|
2116
|
-
reflect: true
|
|
2143
|
+
reflect: true,
|
|
2117
2144
|
},
|
|
2118
2145
|
|
|
2119
2146
|
/**
|
|
2120
|
-
*
|
|
2147
|
+
* Sets the ID of the trigger element, for when the trigger can't use the `trigger` slot. In most cases, set `slot="trigger"` on the element instead.
|
|
2121
2148
|
*/
|
|
2122
2149
|
for: {
|
|
2123
2150
|
type: String,
|
|
2124
|
-
reflect: true
|
|
2151
|
+
reflect: true,
|
|
2125
2152
|
},
|
|
2126
2153
|
|
|
2127
2154
|
/**
|
|
2128
|
-
*
|
|
2155
|
+
* Sets where the popover appears in relation to its trigger. Use `top` (the default) or `bottom`. The popover flips to the opposite side when there isn't room. Changing this after the first render does not currently move the popover.
|
|
2129
2156
|
* @type {'top' | 'bottom'}
|
|
2130
2157
|
* @default 'top'
|
|
2131
2158
|
*/
|
|
2132
2159
|
placement: { type: String },
|
|
2133
2160
|
|
|
2134
2161
|
/**
|
|
2135
|
-
*
|
|
2162
|
+
* Reduces the space between the popover and its trigger, so the popover sits closer to it. Has no effect when `addSpace` is also set.
|
|
2136
2163
|
*/
|
|
2137
2164
|
removeSpace: {
|
|
2138
2165
|
type: Boolean,
|
|
2139
|
-
reflect: true
|
|
2166
|
+
reflect: true,
|
|
2167
|
+
attribute: "removespace",
|
|
2140
2168
|
},
|
|
2141
2169
|
|
|
2142
2170
|
/**
|
|
2143
2171
|
* Whether the popover is currently visible. Reflected as the `data-show`
|
|
2144
|
-
* attribute so host-level CSS selectors
|
|
2172
|
+
* attribute so host-level CSS selectors, such as `:host([data-show])`, work.
|
|
2145
2173
|
* Also drives `aria-hidden` on the popover div in the template.
|
|
2146
2174
|
* @private
|
|
2147
2175
|
*/
|
|
2148
2176
|
isPopoverVisible: {
|
|
2149
2177
|
type: Boolean,
|
|
2150
2178
|
reflect: true,
|
|
2151
|
-
attribute:
|
|
2179
|
+
attribute: "data-show",
|
|
2152
2180
|
converter: {
|
|
2153
2181
|
fromAttribute: (value) => value !== null,
|
|
2154
|
-
toAttribute: (value) => (value ?
|
|
2182
|
+
toAttribute: (value) => (value ? "true" : null),
|
|
2155
2183
|
},
|
|
2156
2184
|
},
|
|
2157
2185
|
};
|
|
@@ -2162,12 +2190,11 @@ class AuroPopover extends i {
|
|
|
2162
2190
|
}
|
|
2163
2191
|
|
|
2164
2192
|
/**
|
|
2165
|
-
*
|
|
2166
|
-
* @param {string} [name="auro-popover"] - The name
|
|
2193
|
+
* Registers the element with the browser under a tag name.
|
|
2194
|
+
* @param {string} [name="auro-popover"] - The tag name to register the element under.
|
|
2167
2195
|
*
|
|
2168
2196
|
* @example
|
|
2169
|
-
* AuroPopover.register("custom-popover") //
|
|
2170
|
-
*
|
|
2197
|
+
* AuroPopover.register("custom-popover"); // Registers the element as `<custom-popover>`.
|
|
2171
2198
|
*/
|
|
2172
2199
|
static register(name = "auro-popover") {
|
|
2173
2200
|
AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroPopover);
|
|
@@ -2202,10 +2229,16 @@ class AuroPopover extends i {
|
|
|
2202
2229
|
if (this.trigger) {
|
|
2203
2230
|
// Remove listeners attached to the trigger element.
|
|
2204
2231
|
if (this._onTriggerMouseEnter) {
|
|
2205
|
-
this._eventTarget.removeEventListener(
|
|
2232
|
+
this._eventTarget.removeEventListener(
|
|
2233
|
+
"mouseenter",
|
|
2234
|
+
this._onTriggerMouseEnter,
|
|
2235
|
+
);
|
|
2206
2236
|
}
|
|
2207
2237
|
if (this._onTriggerMouseLeave) {
|
|
2208
|
-
this._eventTarget.removeEventListener(
|
|
2238
|
+
this._eventTarget.removeEventListener(
|
|
2239
|
+
"mouseleave",
|
|
2240
|
+
this._onTriggerMouseLeave,
|
|
2241
|
+
);
|
|
2209
2242
|
}
|
|
2210
2243
|
if (this._onTriggerFocus) {
|
|
2211
2244
|
this.trigger.removeEventListener("focusin", this._onTriggerFocus);
|
|
@@ -2220,18 +2253,23 @@ class AuroPopover extends i {
|
|
|
2220
2253
|
// Clean up aria-description and its sync listener set in firstUpdated.
|
|
2221
2254
|
// Prevents stale descriptions if the trigger is reused after disconnect.
|
|
2222
2255
|
if (this._onSlotChange) {
|
|
2223
|
-
this.shadowRoot
|
|
2256
|
+
this.shadowRoot
|
|
2257
|
+
?.querySelector("slot:not([name])")
|
|
2258
|
+
?.removeEventListener("slotchange", this._onSlotChange);
|
|
2224
2259
|
}
|
|
2225
2260
|
// Remove aria-description from every element that received it in
|
|
2226
2261
|
// firstUpdated (focusable descendants or the trigger itself).
|
|
2227
|
-
for (const target of
|
|
2262
|
+
for (const target of this._ariaDescriptionTargets || [this.trigger]) {
|
|
2228
2263
|
target.removeAttribute("aria-description");
|
|
2229
2264
|
}
|
|
2230
2265
|
|
|
2231
2266
|
// Remove tabindex only if the component added it and the current value
|
|
2232
2267
|
// still matches the value managed by the component. This avoids removing
|
|
2233
2268
|
// an author-updated tabindex that was set after connection.
|
|
2234
|
-
if (
|
|
2269
|
+
if (
|
|
2270
|
+
this._addedTabIndex &&
|
|
2271
|
+
this.trigger.getAttribute("tabindex") === "0"
|
|
2272
|
+
) {
|
|
2235
2273
|
this.trigger.removeAttribute("tabindex");
|
|
2236
2274
|
}
|
|
2237
2275
|
}
|
|
@@ -2246,7 +2284,10 @@ class AuroPopover extends i {
|
|
|
2246
2284
|
}
|
|
2247
2285
|
|
|
2248
2286
|
// Destroy the Popper.js instance to release its internal references.
|
|
2249
|
-
if (
|
|
2287
|
+
if (
|
|
2288
|
+
this.popper?.popper &&
|
|
2289
|
+
typeof this.popper.popper.destroy === "function"
|
|
2290
|
+
) {
|
|
2250
2291
|
this.popper.popper.destroy();
|
|
2251
2292
|
this.popper.popper = null;
|
|
2252
2293
|
}
|
|
@@ -2317,9 +2358,15 @@ class AuroPopover extends i {
|
|
|
2317
2358
|
);
|
|
2318
2359
|
|
|
2319
2360
|
this._onBodyMouseover = (evt) => this.handleMouseoverEvent(evt);
|
|
2320
|
-
this._onTriggerMouseEnter = () => {
|
|
2321
|
-
|
|
2322
|
-
|
|
2361
|
+
this._onTriggerMouseEnter = () => {
|
|
2362
|
+
this.toggleShow();
|
|
2363
|
+
};
|
|
2364
|
+
this._onTriggerMouseLeave = () => {
|
|
2365
|
+
this.toggleHide();
|
|
2366
|
+
};
|
|
2367
|
+
this._onTriggerFocus = () => {
|
|
2368
|
+
this.toggleShow();
|
|
2369
|
+
};
|
|
2323
2370
|
this._onTriggerBlur = (event) => {
|
|
2324
2371
|
// Only hide if focus leaves the trigger and popover entirely, not
|
|
2325
2372
|
// when moving between focusable children within the trigger or into
|
|
@@ -2370,7 +2417,9 @@ class AuroPopover extends i {
|
|
|
2370
2417
|
this.toggle();
|
|
2371
2418
|
}
|
|
2372
2419
|
};
|
|
2373
|
-
this._onHidePopover = () => {
|
|
2420
|
+
this._onHidePopover = () => {
|
|
2421
|
+
this.toggleHide();
|
|
2422
|
+
};
|
|
2374
2423
|
|
|
2375
2424
|
// mouseenter/mouseleave attach to the host when the trigger is a direct
|
|
2376
2425
|
// child of auro-popover (slotted), otherwise they attach to the trigger itself.
|
|
@@ -2398,13 +2447,13 @@ class AuroPopover extends i {
|
|
|
2398
2447
|
* Sets up auto-tabindex and aria-description on the trigger element.
|
|
2399
2448
|
*
|
|
2400
2449
|
* Auto-tabindex: ensures non-focusable triggers are keyboard accessible.
|
|
2401
|
-
* Covers native elements
|
|
2402
|
-
* shadow DOM contains no focusable descendant
|
|
2450
|
+
* Covers native elements, such as `<abbr>` and `<span>`, and custom elements whose
|
|
2451
|
+
* shadow DOM contains no focusable descendant, such as `auro-icon`.
|
|
2403
2452
|
*
|
|
2404
2453
|
* We skip elements that are already accessible via the tab order:
|
|
2405
|
-
* - Natively focusable elements (tabIndex >= 0):
|
|
2406
|
-
* - Custom elements whose shadow DOM contains a focusable descendant (
|
|
2407
|
-
* has an inner
|
|
2454
|
+
* - Natively focusable elements (tabIndex >= 0): `<button>`, `<a href>`, `<input>`, and so on.
|
|
2455
|
+
* - Custom elements whose shadow DOM contains a focusable descendant (for example, `auro-button`
|
|
2456
|
+
* has an inner `<button>`): adding tabindex to the host would create a double tab stop.
|
|
2408
2457
|
* - Elements where the author has explicitly set tabindex — their intent is respected.
|
|
2409
2458
|
*
|
|
2410
2459
|
* Known limitation: custom elements with a closed shadow root (mode: 'closed') cannot
|
|
@@ -2413,9 +2462,9 @@ class AuroPopover extends i {
|
|
|
2413
2462
|
* creating a double tab stop. Elements using delegatesFocus avoid this because the
|
|
2414
2463
|
* browser reflects a non-negative tabIndex on the host.
|
|
2415
2464
|
*
|
|
2416
|
-
* aria-description (ARIA 1.3): embeds the popover content string directly on
|
|
2465
|
+
* `aria-description` (ARIA 1.3): embeds the popover content string directly on
|
|
2417
2466
|
* the trigger so screen readers announce it on focus. Preferred over
|
|
2418
|
-
* aria-describedby (cross-shadow ID lookup fails) and aria-live (display:none
|
|
2467
|
+
* `aria-describedby` (cross-shadow ID lookup fails) and `aria-live` (`display:none`
|
|
2419
2468
|
* removes the region from the accessibility tree).
|
|
2420
2469
|
*
|
|
2421
2470
|
* @private
|
|
@@ -2435,7 +2484,7 @@ class AuroPopover extends i {
|
|
|
2435
2484
|
if (el.tabIndex < 0) return false;
|
|
2436
2485
|
let node = el;
|
|
2437
2486
|
while (node) {
|
|
2438
|
-
if (node.closest(
|
|
2487
|
+
if (node.closest("[hidden], [inert]")) return false;
|
|
2439
2488
|
const root = node.getRootNode();
|
|
2440
2489
|
node = root instanceof ShadowRoot ? root.host : null;
|
|
2441
2490
|
}
|
|
@@ -2443,18 +2492,26 @@ class AuroPopover extends i {
|
|
|
2443
2492
|
};
|
|
2444
2493
|
|
|
2445
2494
|
// Check light DOM children for focusable elements.
|
|
2446
|
-
let hasInternalFocus = [
|
|
2495
|
+
let hasInternalFocus = [
|
|
2496
|
+
...this.trigger.querySelectorAll(focusableSelector),
|
|
2497
|
+
].some(isReachable);
|
|
2447
2498
|
|
|
2448
2499
|
// Also check light DOM custom element descendants whose shadow DOM
|
|
2449
2500
|
// contains focusable content. querySelector cannot reach into shadow
|
|
2450
2501
|
// roots, so custom elements like auro-button inside a wrapper trigger
|
|
2451
2502
|
// would otherwise be missed (e.g. <div><auro-button></auro-button></div>).
|
|
2452
2503
|
if (!hasInternalFocus) {
|
|
2453
|
-
const descendants = this.trigger.querySelectorAll(
|
|
2504
|
+
const descendants = this.trigger.querySelectorAll("*");
|
|
2454
2505
|
|
|
2455
2506
|
for (const child of descendants) {
|
|
2456
|
-
if (
|
|
2457
|
-
|
|
2507
|
+
if (
|
|
2508
|
+
child.localName.includes("-") &&
|
|
2509
|
+
(child.tabIndex >= 0 ||
|
|
2510
|
+
(child.shadowRoot &&
|
|
2511
|
+
[...child.shadowRoot.querySelectorAll(focusableSelector)].some(
|
|
2512
|
+
isReachable,
|
|
2513
|
+
)))
|
|
2514
|
+
) {
|
|
2458
2515
|
hasInternalFocus = true;
|
|
2459
2516
|
break;
|
|
2460
2517
|
}
|
|
@@ -2466,11 +2523,21 @@ class AuroPopover extends i {
|
|
|
2466
2523
|
// If the shadow root is inaccessible (closed mode or not yet upgraded),
|
|
2467
2524
|
// we cannot inspect it — the element will receive tabindex if it is not
|
|
2468
2525
|
// otherwise focusable. This is a known limitation documented above.
|
|
2469
|
-
if (
|
|
2470
|
-
hasInternalFocus
|
|
2526
|
+
if (
|
|
2527
|
+
!hasInternalFocus &&
|
|
2528
|
+
this.trigger.localName.includes("-") &&
|
|
2529
|
+
this.trigger.shadowRoot
|
|
2530
|
+
) {
|
|
2531
|
+
hasInternalFocus = [
|
|
2532
|
+
...this.trigger.shadowRoot.querySelectorAll(focusableSelector),
|
|
2533
|
+
].some(isReachable);
|
|
2471
2534
|
}
|
|
2472
2535
|
|
|
2473
|
-
if (
|
|
2536
|
+
if (
|
|
2537
|
+
!isNativelyFocusable &&
|
|
2538
|
+
!hasInternalFocus &&
|
|
2539
|
+
!this.trigger.hasAttribute("tabindex")
|
|
2540
|
+
) {
|
|
2474
2541
|
this.trigger.setAttribute("tabindex", "0");
|
|
2475
2542
|
this._addedTabIndex = true;
|
|
2476
2543
|
}
|
|
@@ -2480,11 +2547,13 @@ class AuroPopover extends i {
|
|
|
2480
2547
|
// in modern browsers and screen readers (Chrome 92+, Firefox 92+, Safari 15.4+)
|
|
2481
2548
|
// but may be unfamiliar — do not replace with aria-describedby.
|
|
2482
2549
|
const slot = this.shadowRoot.querySelector("slot:not([name])");
|
|
2483
|
-
const getSlotText = () =>
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2550
|
+
const getSlotText = () =>
|
|
2551
|
+
slot
|
|
2552
|
+
.assignedNodes({ flatten: true })
|
|
2553
|
+
.map((n) => n.textContent ?? "")
|
|
2554
|
+
.join(" ")
|
|
2555
|
+
.replace(/\s+/g, " ")
|
|
2556
|
+
.trim();
|
|
2488
2557
|
|
|
2489
2558
|
// Determine which elements should receive aria-description.
|
|
2490
2559
|
// When the trigger is a non-focusable wrapper around focusable content
|
|
@@ -2494,15 +2563,17 @@ class AuroPopover extends i {
|
|
|
2494
2563
|
|
|
2495
2564
|
if (!isNativelyFocusable && hasInternalFocus) {
|
|
2496
2565
|
// Gather all keyboard-reachable light DOM descendants.
|
|
2497
|
-
const nativeMatches = [
|
|
2566
|
+
const nativeMatches = [
|
|
2567
|
+
...this.trigger.querySelectorAll(focusableSelector),
|
|
2568
|
+
].filter(isReachable);
|
|
2498
2569
|
|
|
2499
2570
|
this._ariaDescriptionTargets.push(...nativeMatches);
|
|
2500
2571
|
|
|
2501
2572
|
// Check custom element descendants whose shadow DOM is focusable.
|
|
2502
|
-
const allDescendants = this.trigger.querySelectorAll(
|
|
2573
|
+
const allDescendants = this.trigger.querySelectorAll("*");
|
|
2503
2574
|
|
|
2504
2575
|
for (const child of allDescendants) {
|
|
2505
|
-
if (!child.localName.includes(
|
|
2576
|
+
if (!child.localName.includes("-")) continue;
|
|
2506
2577
|
// Skip if already matched by the native selector (e.g. has tabindex attribute).
|
|
2507
2578
|
if (nativeMatches.includes(child)) continue;
|
|
2508
2579
|
|
|
@@ -2512,7 +2583,9 @@ class AuroPopover extends i {
|
|
|
2512
2583
|
} else if (child.shadowRoot) {
|
|
2513
2584
|
// Host is not keyboard-reachable; focus goes to internal elements.
|
|
2514
2585
|
// Set description directly on the shadow DOM focusable controls.
|
|
2515
|
-
const shadowFocusable = [
|
|
2586
|
+
const shadowFocusable = [
|
|
2587
|
+
...child.shadowRoot.querySelectorAll(focusableSelector),
|
|
2588
|
+
].filter(isReachable);
|
|
2516
2589
|
|
|
2517
2590
|
for (const el of shadowFocusable) {
|
|
2518
2591
|
this._ariaDescriptionTargets.push(el);
|
|
@@ -2525,8 +2598,10 @@ class AuroPopover extends i {
|
|
|
2525
2598
|
// (e.g. mock-focusable, auro-button used directly as trigger).
|
|
2526
2599
|
// Light DOM searches found nothing; add the shadow focusable controls
|
|
2527
2600
|
// so the description is announced when focus lands inside the shadow root.
|
|
2528
|
-
if (this.trigger.localName.includes(
|
|
2529
|
-
const shadowFocusable = [
|
|
2601
|
+
if (this.trigger.localName.includes("-") && this.trigger.shadowRoot) {
|
|
2602
|
+
const shadowFocusable = [
|
|
2603
|
+
...this.trigger.shadowRoot.querySelectorAll(focusableSelector),
|
|
2604
|
+
].filter(isReachable);
|
|
2530
2605
|
|
|
2531
2606
|
this._ariaDescriptionTargets.push(...shadowFocusable);
|
|
2532
2607
|
}
|
|
@@ -2596,7 +2671,7 @@ class AuroPopover extends i {
|
|
|
2596
2671
|
}
|
|
2597
2672
|
|
|
2598
2673
|
/**
|
|
2599
|
-
* Hides the popover when hovering outside of the popover or
|
|
2674
|
+
* Hides the popover when hovering outside of the popover or its trigger.
|
|
2600
2675
|
* @private
|
|
2601
2676
|
* @param {Event} evt - The event object.
|
|
2602
2677
|
* @returns {void}
|
|
@@ -2642,7 +2717,11 @@ class AuroPopover extends i {
|
|
|
2642
2717
|
// If disabled becomes true while the popover is visible, force-hide so
|
|
2643
2718
|
// aria-hidden, the body mouseover listener, and Popper stay in sync with
|
|
2644
2719
|
// the CSS that hides the popover via :host([disabled]).
|
|
2645
|
-
if (
|
|
2720
|
+
if (
|
|
2721
|
+
changedProperties.has("disabled") &&
|
|
2722
|
+
this.disabled &&
|
|
2723
|
+
this.isPopoverVisible
|
|
2724
|
+
) {
|
|
2646
2725
|
this.isPopoverVisible = false;
|
|
2647
2726
|
}
|
|
2648
2727
|
}
|
|
@@ -2656,12 +2735,12 @@ class AuroPopover extends i {
|
|
|
2656
2735
|
popover="manual"
|
|
2657
2736
|
part="popover"
|
|
2658
2737
|
role="tooltip"
|
|
2659
|
-
aria-hidden="${this.isPopoverVisible ?
|
|
2660
|
-
<div id="arrow" class="arrow" data-popper-arrow></div>
|
|
2738
|
+
aria-hidden="${this.isPopoverVisible ? "false" : "true"}">
|
|
2739
|
+
<div id="arrow" class="arrow" data-popper-arrow part="arrow"></div>
|
|
2661
2740
|
<slot></slot>
|
|
2662
2741
|
</div>
|
|
2663
2742
|
|
|
2664
|
-
<span role="presentation">
|
|
2743
|
+
<span role="presentation" part="trigger">
|
|
2665
2744
|
<slot name="trigger" data-trigger-placement="${this.placement}"></slot>
|
|
2666
2745
|
</span>
|
|
2667
2746
|
`;
|