@swisspost/design-system-components 10.0.0-next.48 → 10.0.0-next.50
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/dist/cjs/{event-from-C6kpQwhw.js → event-from-CLvtSUKf.js} +20 -6
- package/dist/cjs/{get-root-CfQ2PogP.js → get-root-CyMf3Vsd.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-CZyXYkIN.js → package-qtH-QrKv.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +5 -5
- package/dist/cjs/post-avatar.cjs.entry.js +27 -37
- package/dist/cjs/post-back-to-top.cjs.entry.js +3 -3
- package/dist/cjs/post-banner.cjs.entry.js +5 -5
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +5 -5
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +12 -7
- package/dist/cjs/post-card-control.cjs.entry.js +5 -5
- package/dist/cjs/post-closebutton_15.cjs.entry.js +274 -134
- package/dist/cjs/post-collapsible_2.cjs.entry.js +6 -6
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/post-footer.cjs.entry.js +4 -4
- package/dist/cjs/post-linkarea.cjs.entry.js +19 -8
- package/dist/cjs/post-popover.cjs.entry.js +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +4 -4
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -4
- package/dist/collection/animations/pop-in.js +14 -0
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-avatar/post-avatar.css +1 -1
- package/dist/collection/components/post-avatar/post-avatar.js +38 -34
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
- package/dist/collection/components/post-banner/post-banner.js +2 -2
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +30 -4
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +2 -2
- package/dist/collection/components/post-closebutton/button-types.js +1 -0
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-closebutton/post-closebutton.js +65 -5
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +1 -1
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +19 -11
- package/dist/collection/components/post-icon/post-icon.js +39 -33
- package/dist/collection/components/post-language-option/post-language-option.css +1 -1
- package/dist/collection/components/post-language-option/post-language-option.js +1 -2
- package/dist/collection/components/post-language-switch/post-language-switch.js +1 -2
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +24 -6
- package/dist/collection/components/post-list/post-list.css +1 -1
- package/dist/collection/components/post-list/post-list.js +1 -1
- package/dist/collection/components/post-list-item/post-list-item.js +1 -1
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +73 -11
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +51 -9
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -1
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +18 -7
- package/dist/collection/components/post-rating/post-rating.css +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +1 -1
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
- package/dist/collection/utils/event-from.js +20 -6
- package/dist/component-names.json +39 -0
- package/dist/components/event-from.js +20 -6
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-accordion2.js +1 -1
- package/dist/components/post-avatar.js +28 -36
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +2 -2
- package/dist/components/post-breadcrumb-item2.js +1 -1
- package/dist/components/post-breadcrumbs.js +14 -7
- package/dist/components/post-card-control.js +3 -3
- package/dist/components/post-closebutton.js +1 -44
- package/dist/components/post-closebutton2.js +77 -0
- package/dist/components/post-collapsible-trigger2.js +1 -1
- package/dist/components/post-collapsible2.js +1 -1
- package/dist/components/post-footer.js +2 -2
- package/dist/components/post-header.js +17 -12
- package/dist/components/post-icon2.js +39 -33
- package/dist/components/post-language-option.js +2 -3
- package/dist/components/post-language-switch.js +1 -2
- package/dist/components/post-linkarea.js +21 -8
- package/dist/components/post-list-item.js +1 -1
- package/dist/components/post-list.js +2 -2
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +2 -2
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +74 -12
- package/dist/components/post-menu-item2.js +2 -2
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +33 -11
- package/dist/components/post-popover.js +15 -3
- package/dist/components/post-popovercontainer2.js +30 -5
- package/dist/components/post-rating.js +2 -2
- package/dist/components/post-tab-header.js +2 -2
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +2 -2
- package/dist/components/react/{p-Tg0GNTZM.js → p-B392lG2N.js} +3 -3
- package/dist/components/react/{p-Dq9F2i7n.js → p-B9Y7UQKI.js} +3 -3
- package/dist/components/react/{p-38PqL5iD.js → p-BXPcgIqO.js} +3 -3
- package/dist/components/react/{p-Da5wbVP8.js → p-BcVKzjda.js} +40 -34
- package/dist/components/react/{p-CiYSngKM.js → p-BlOv-NDA.js} +6 -6
- package/dist/components/react/{p-q8Fvf8A0.js → p-BmpB1vs4.js} +2 -2
- package/dist/components/react/p-BuKAaKXE.js +78 -0
- package/dist/components/react/{p-JHuJA2Lv.js → p-Bw6vnK1I.js} +36 -14
- package/dist/components/react/{p-Ce7jgYmK.js → p-CDsgZHvX.js} +31 -6
- package/dist/components/react/{p-kraHE1r3.js → p-CzIKqBrS.js} +20 -6
- package/dist/components/react/p-DimG3b3P.js +3 -0
- package/dist/components/react/{p-DzYquz3e.js → p-DnHwlsBi.js} +3 -3
- package/dist/components/react/{p-CGsAj6ij.js → p-U9MTjvRU.js} +2 -2
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-avatar.js +29 -37
- package/dist/components/react/post-back-to-top.js +3 -3
- package/dist/components/react/post-banner.js +4 -4
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +21 -14
- package/dist/components/react/post-card-control.js +5 -5
- package/dist/components/react/post-closebutton.js +1 -45
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-footer.js +8 -8
- package/dist/components/react/post-header.js +19 -14
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-option.js +3 -4
- package/dist/components/react/post-language-switch.js +7 -8
- package/dist/components/react/post-linkarea.js +22 -9
- package/dist/components/react/post-list-item.js +2 -2
- package/dist/components/react/post-list.js +3 -3
- package/dist/components/react/post-logo.js +2 -2
- package/dist/components/react/post-mainnavigation.js +4 -4
- package/dist/components/react/post-megadropdown-trigger.js +3 -3
- package/dist/components/react/post-megadropdown.js +75 -13
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-popover.js +17 -5
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-rating.js +4 -4
- package/dist/components/react/post-tab-header.js +3 -3
- package/dist/components/react/post-tab-panel.js +2 -2
- package/dist/components/react/post-tabs.js +2 -2
- package/dist/components/react/post-togglebutton.js +2 -2
- package/dist/components/react/post-tooltip-trigger.js +2 -2
- package/dist/components/react/post-tooltip.js +4 -4
- package/dist/docs.json +174 -12
- package/dist/esm/{event-from-kraHE1r3.js → event-from-CzIKqBrS.js} +20 -6
- package/dist/esm/{get-root-hlzxoycr.js → get-root-BkQ3CrLq.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-DimG3b3P.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +5 -5
- package/dist/esm/post-avatar.entry.js +27 -37
- package/dist/esm/post-back-to-top.entry.js +3 -3
- package/dist/esm/post-banner.entry.js +5 -5
- package/dist/esm/post-breadcrumb-item_2.entry.js +5 -5
- package/dist/esm/post-breadcrumbs.entry.js +13 -8
- package/dist/esm/post-card-control.entry.js +5 -5
- package/dist/esm/post-closebutton_15.entry.js +274 -134
- package/dist/esm/post-collapsible_2.entry.js +6 -6
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/post-linkarea.entry.js +19 -8
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/post-rating.entry.js +4 -4
- package/dist/esm/post-tab-header.entry.js +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/post-tooltip-trigger.entry.js +3 -3
- package/dist/esm/post-tooltip.entry.js +4 -4
- package/dist/post-components/{p-3c71f590.entry.js → p-048d2c1a.entry.js} +1 -1
- package/dist/post-components/p-0a4d9f33.entry.js +1 -0
- package/dist/post-components/p-11abb64f.entry.js +1 -0
- package/dist/post-components/p-1253185c.entry.js +1 -0
- package/dist/post-components/p-15e0d4b8.entry.js +1 -0
- package/dist/post-components/{p-d61bb2ff.entry.js → p-1d4252ba.entry.js} +1 -1
- package/dist/post-components/{p-aad86320.entry.js → p-3d30eafa.entry.js} +1 -1
- package/dist/post-components/p-4114fc83.entry.js +1 -0
- package/dist/post-components/p-5ddde390.entry.js +1 -0
- package/dist/post-components/p-89411986.entry.js +1 -0
- package/dist/post-components/{p-6777e505.entry.js → p-9bbf7271.entry.js} +1 -1
- package/dist/post-components/{p-BkvZk-PA.js → p-CBFgkSgY.js} +1 -1
- package/dist/post-components/p-CJ80BZ06.js +1 -0
- package/dist/post-components/p-CzIKqBrS.js +1 -0
- package/dist/post-components/p-DimG3b3P.js +1 -0
- package/dist/post-components/p-b034d196.entry.js +1 -0
- package/dist/post-components/p-b36c129a.entry.js +1 -0
- package/dist/post-components/p-b82e7cbe.entry.js +1 -0
- package/dist/post-components/{p-6add880f.entry.js → p-e7fbb03d.entry.js} +1 -1
- package/dist/post-components/p-f1d53256.entry.js +1 -0
- package/dist/post-components/p-f97f3a19.entry.js +1 -0
- package/dist/post-components/{p-16772417.entry.js → p-f9d044a3.entry.js} +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/animations/pop-in.d.ts +1 -0
- package/dist/types/components/post-avatar/post-avatar.d.ts +5 -4
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +5 -0
- package/dist/types/components/post-closebutton/button-types.d.ts +2 -0
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +10 -1
- package/dist/types/components/post-header/post-header.d.ts +5 -0
- package/dist/types/components/post-icon/post-icon.d.ts +11 -0
- package/dist/types/components/post-linkarea/post-linkarea.d.ts +6 -0
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +33 -6
- package/dist/types/components/post-menu/post-menu.d.ts +7 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +6 -2
- package/dist/types/components.d.ts +39 -3
- package/dist/types/utils/event-from.d.ts +2 -1
- package/hydrate/index.js +357 -184
- package/hydrate/index.mjs +357 -184
- package/package.json +8 -6
- package/dist/components/react/p-0Ltezq5O.js +0 -3
- package/dist/esm/package-0Ltezq5O.js +0 -3
- package/dist/post-components/p-0Ltezq5O.js +0 -1
- package/dist/post-components/p-38d3d441.entry.js +0 -1
- package/dist/post-components/p-40f21542.entry.js +0 -1
- package/dist/post-components/p-4243cdd1.entry.js +0 -1
- package/dist/post-components/p-4c18cb8c.entry.js +0 -1
- package/dist/post-components/p-51dc7647.entry.js +0 -1
- package/dist/post-components/p-8363fedb.entry.js +0 -1
- package/dist/post-components/p-83998038.entry.js +0 -1
- package/dist/post-components/p-85bb1b5e.entry.js +0 -1
- package/dist/post-components/p-8f4d8685.entry.js +0 -1
- package/dist/post-components/p-95ad536d.entry.js +0 -1
- package/dist/post-components/p-9d806e89.entry.js +0 -1
- package/dist/post-components/p-_0G7tavk.js +0 -1
- package/dist/post-components/p-c3e38acf.entry.js +0 -1
- package/dist/post-components/p-kraHE1r3.js +0 -1
- package/dist/prebuild.js +0 -26
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +0 -1
- package/dist/cjs/{breakpoints-DmZ_BQGo.js → breakpoints-CEkeixld.js} +3 -3
- package/dist/esm/{breakpoints-_0G7tavk.js → breakpoints-CJ80BZ06.js} +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
3
3
|
|
|
4
|
-
const postMenuItemCss = "post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem 1rem;gap:.5rem;font-size
|
|
4
|
+
const postMenuItemCss = "post-menu-item button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-menu-item button{background-color:ButtonFace !important}post-menu-item button:hover{background-color:Highlight !important}}post-menu-item a{text-decoration:none}post-menu-item button,post-menu-item a{position:relative;display:flex;width:100%;align-items:center;padding:.5rem .75rem .5rem 1rem;gap:.5rem;font-size:.875rem;color:#050400;border-radius:0}post-menu-item button post-icon,post-menu-item a post-icon{width:1.25rem;height:1.25rem;margin:.125rem}@media screen and (min-width: 780px){post-menu-item button,post-menu-item a{font-size:1rem;padding-block:.75rem;gap:1rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.375rem;height:1.375rem;margin:0}}@media screen and (min-width: 1024px){post-menu-item button,post-menu-item a{font-size:1.25rem;padding-block:.8125rem}post-menu-item button post-icon,post-menu-item a post-icon{width:1.5rem;height:1.5rem}}post-menu-item button:focus-visible,post-menu-item a:focus-visible{outline-offset:2px !important;border-radius:4px}post-menu-item button:hover,post-menu-item a:hover{background-color:#504f4b;color:#fff}";
|
|
5
5
|
|
|
6
6
|
const PostMenuItem = /*@__PURE__*/ proxyCustomElement(class PostMenuItem extends H {
|
|
7
7
|
constructor() {
|
|
@@ -9,7 +9,7 @@ const PostMenuItem = /*@__PURE__*/ proxyCustomElement(class PostMenuItem extends
|
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: '6b2c8542aed22132c627fadb6be036124e37853e', "data-version": version }, h("slot", { key: '8059cb5112270641ef7ba860cdacb2cdaa75fd59' })));
|
|
13
13
|
}
|
|
14
14
|
static get style() { return postMenuItemCss; }
|
|
15
15
|
}, [4, "post-menu-item"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
2
|
import { I as IS_BROWSER } from './p-CJ80BZ06.js';
|
|
3
3
|
import { d as checkEmptyOrOneOf, e as checkEmptyOrType, c as checkRequiredAndType } from './p-CV7fm1rW.js';
|
|
4
|
-
import { v as version } from './p-
|
|
4
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
5
5
|
|
|
6
6
|
const postIconCss = ":host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}";
|
|
7
7
|
|
|
@@ -44,52 +44,58 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends H {
|
|
|
44
44
|
validateScale() {
|
|
45
45
|
checkEmptyOrType(this, 'scale', 'number');
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Construct the icon URL according to the following rules:
|
|
49
|
+
* 1. `@base` (absolute URL) → use directly.
|
|
50
|
+
* 2. `@base` (relative URL) → resolve with `base href` and/or `origin`
|
|
51
|
+
* - If `base href` is absolute → use just that.
|
|
52
|
+
* - If `base href` is relative → prepend with `origin`.
|
|
53
|
+
* - If `base href` does not exist → use only `origin`.
|
|
54
|
+
* 3. `@meta` (absolute URL) → use directly.
|
|
55
|
+
* 4. `@meta` (relative URL) → resolve with `base href` and/or `origin`. (same as above)
|
|
56
|
+
* 5. `CDN_URL` fallback → `https://unpkg.com/...`.
|
|
57
|
+
**/
|
|
51
58
|
getUrl() {
|
|
52
59
|
const fileName = `${this.name}.svg`;
|
|
53
60
|
if (!IS_BROWSER && !this.base) {
|
|
54
61
|
return `${CDN_URL}${fileName}`;
|
|
55
62
|
}
|
|
63
|
+
const isAbsolute = (url) => /^https?:\/\//.test(url);
|
|
64
|
+
const normalizeUrl = (url) => (url && !url.endsWith('/') ? `${url}/` : url);
|
|
65
|
+
const cleanUrl = (url) => url.replace(/([^:])\/\//g, '$1/');
|
|
56
66
|
const currentDomain = IS_BROWSER ? window.location.origin : '';
|
|
57
67
|
const baseHref = IS_BROWSER
|
|
58
68
|
? document.querySelector('base[href]')?.getAttribute('href') || ''
|
|
59
69
|
: '';
|
|
60
|
-
const isBaseHrefAbsolute = /^https?:\/\//.test(baseHref);
|
|
61
70
|
const metaIconBase = IS_BROWSER
|
|
62
|
-
? document
|
|
63
|
-
.querySelector('meta[name="design-system-settings"]')
|
|
64
|
-
?.getAttribute('data-post-icon-base') || ''
|
|
71
|
+
? document.querySelector('meta[name="design-system-settings"]')?.getAttribute('data-post-icon-base') || ''
|
|
65
72
|
: '';
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
}
|
|
73
|
+
// Function to build the first part of the URL when 'this.base' or 'metaIconBase' are relative
|
|
74
|
+
const buildUrlWithBase = (relativeUrl) => {
|
|
75
|
+
const normalizedHref = normalizeUrl(baseHref);
|
|
76
|
+
const normalizedRelative = normalizeUrl(relativeUrl);
|
|
77
|
+
if (isAbsolute(normalizedHref)) {
|
|
78
|
+
return `${normalizedHref}${normalizedRelative}`;
|
|
79
|
+
}
|
|
80
|
+
return `${currentDomain}${normalizedHref}${normalizedRelative}`;
|
|
81
|
+
};
|
|
75
82
|
let url;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
url =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
url = `${normalizedBaseHref}${normalizedIconBase}${fileName}`;
|
|
83
|
-
}
|
|
84
|
-
else if (iconBase || baseHref) {
|
|
85
|
-
// Standard case: domain + baseHref + iconBase
|
|
86
|
-
url = `${currentDomain}${normalizedBaseHref}${normalizedIconBase}${fileName}`;
|
|
83
|
+
// Highest Priority is this.base
|
|
84
|
+
if (this.base) {
|
|
85
|
+
url = isAbsolute(this.base)
|
|
86
|
+
? `${normalizeUrl(this.base)}${fileName}`
|
|
87
|
+
: `${buildUrlWithBase(this.base)}${fileName}`;
|
|
88
|
+
return cleanUrl(url);
|
|
87
89
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
url =
|
|
90
|
+
// Second Priority is metaIconBase
|
|
91
|
+
if (metaIconBase) {
|
|
92
|
+
url = isAbsolute(metaIconBase)
|
|
93
|
+
? `${normalizeUrl(metaIconBase)}${fileName}`
|
|
94
|
+
: `${buildUrlWithBase(metaIconBase)}${fileName}`;
|
|
95
|
+
return cleanUrl(url);
|
|
91
96
|
}
|
|
92
|
-
|
|
97
|
+
// Fallback to CDN
|
|
98
|
+
return cleanUrl(`${CDN_URL}${fileName}`);
|
|
93
99
|
}
|
|
94
100
|
getStyles() {
|
|
95
101
|
const url = this.getUrl();
|
|
@@ -110,7 +116,7 @@ const PostIcon = /*@__PURE__*/ proxyCustomElement(class PostIcon extends H {
|
|
|
110
116
|
this.validateAnimation();
|
|
111
117
|
}
|
|
112
118
|
render() {
|
|
113
|
-
return (h(Host, { key: '
|
|
119
|
+
return (h(Host, { key: '0031b3e2e4016f9b28cade66fa435741940946a7', "data-version": version }, h("span", { key: '0efbcdd5f1dd737640238a0ab81b67ca8218adec', style: this.getStyles() })));
|
|
114
120
|
}
|
|
115
121
|
get host() { return this; }
|
|
116
122
|
static get watchers() { return {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './p-r4txK0AC.js';
|
|
4
4
|
import { d as checkEmptyOrOneOf } from './p-CV7fm1rW.js';
|
|
5
5
|
import './p-CJ80BZ06.js';
|
|
6
|
-
import { E as EventFrom } from './p-
|
|
6
|
+
import { E as EventFrom } from './p-CzIKqBrS.js';
|
|
7
7
|
import { n as nanoid } from './p-BLchVpF6.js';
|
|
8
|
-
import { d as defineCustomElement$3 } from './p-
|
|
9
|
-
import { d as defineCustomElement$2 } from './p-
|
|
10
|
-
import { d as defineCustomElement$1 } from './p-
|
|
8
|
+
import { d as defineCustomElement$3 } from './p-BmpB1vs4.js';
|
|
9
|
+
import { d as defineCustomElement$2 } from './p-B392lG2N.js';
|
|
10
|
+
import { d as defineCustomElement$1 } from './p-BcVKzjda.js';
|
|
11
11
|
|
|
12
|
-
const postAccordionItemCss = ".accordion-item::after{display:block;content:\"\";margin-block-start:calc(var(--post-device-border-width-default)*-1);border-block-end:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-item:has(.accordion-button:hover)::after{border-color:var(--post-scheme-color-interactive-primary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-item:has(.accordion-button:hover)::after{border-color:Highlight}}.accordion-header{color:var(--post-scheme-color-interactive-primary-enabled-fg1);font-size:var(--post-device-font-size-5);margin:0;line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black)}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;position:relative;width:100%;align-items:center;text-align:start;gap:var(--post-device-spacing-gap-7);padding:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default)) calc(var(--post-device-spacing-padding-5) + var(--post-device-border-width-default));cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button{background-color:ButtonFace !important}.accordion-button:hover{background-color:Highlight !important}}.accordion-button::before{display:block;position:absolute;content:\"\";inset:0;inset-block-end:auto;border-block-start-width:var(--post-
|
|
12
|
+
const postAccordionItemCss = ".accordion-item::after{display:block;content:\"\";margin-block-start:calc(var(--post-device-border-width-default)*-1);border-block-end:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-item:has(.accordion-button:hover)::after{border-color:var(--post-scheme-color-interactive-primary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-item:has(.accordion-button:hover)::after{border-color:Highlight}}.accordion-header{color:var(--post-scheme-color-interactive-primary-enabled-fg1);font-size:var(--post-device-font-size-5);margin:0;line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black)}.accordion-button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;display:flex;position:relative;width:100%;align-items:center;text-align:start;gap:var(--post-device-spacing-gap-7);padding:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default)) calc(var(--post-device-spacing-padding-5) + var(--post-device-border-width-default));cursor:pointer}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button{background-color:ButtonFace !important}.accordion-button:hover{background-color:Highlight !important}}.accordion-button::before{display:block;position:absolute;content:\"\";inset:0;inset-block-end:auto;border-block-start-width:var(--post-device-border-width-default);border-block-start-style:var(--post-core-border-style-solid);border-block-start-color:var(--post-scheme-color-interactive-primary-enabled-stroke)}.accordion-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.accordion-button slot::slotted(span[slot=header]){flex-grow:1}.accordion-button post-icon{flex:none;width:var(--post-core-dimension-24);aspect-ratio:1;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}.accordion-button.collapsed{padding-block-start:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default));padding-block-end:calc(var(--post-device-spacing-padding-19) + var(--post-device-border-width-default))}.accordion-button.collapsed post-icon{transform:rotate(-180deg)}.accordion-button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}.accordion-button>::slotted(.text-truncate){display:block}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.accordion-button:hover,.accordion-button:focus-visible{color:Highlight}}.accordion-body{padding-block-start:var(--post-device-spacing-padding-15);padding-block-end:calc(var(--post-device-spacing-padding-block-25) + var(--post-device-border-width-default));padding-inline:var(--post-device-spacing-padding-5)}.logo-container{display:none;width:var(--post-device-sizing-logo-1);aspect-ratio:1}.logo-container.has-image{display:block}.logo-container slot::slotted(img){display:block;width:100%;height:100%;object-fit:cover}.accordion-button>::slotted(:first-child),.accordion-body>::slotted(:first-child){margin-block-start:0 !important}.accordion-button>::slotted(:last-child),.accordion-body>::slotted(:last-child){margin-block-end:0 !important}";
|
|
13
13
|
|
|
14
14
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
3
3
|
import { I as IS_BROWSER } from './p-CJ80BZ06.js';
|
|
4
4
|
import { e as checkEmptyOrType } from './p-CV7fm1rW.js';
|
|
5
5
|
|
|
@@ -80,7 +80,7 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
80
80
|
triggers.forEach(trigger => trigger.update());
|
|
81
81
|
}
|
|
82
82
|
render() {
|
|
83
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: '3a11f1a60c536544881def998bcdf81f6d248837', "data-version": version, tabindex: this.collapsed ? -1 : undefined }, h("slot", { key: '6ea66375cdffefd02c8293aa1542c4cbfce905a4' })));
|
|
84
84
|
}
|
|
85
85
|
get host() { return this; }
|
|
86
86
|
static get watchers() { return {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
3
|
+
import { d as checkEmptyOrOneOf } from './p-CV7fm1rW.js';
|
|
4
|
+
import './p-CJ80BZ06.js';
|
|
5
|
+
import { d as defineCustomElement$1 } from './p-BcVKzjda.js';
|
|
6
|
+
|
|
7
|
+
const BUTTON_TYPES = ['button', 'submit', 'reset'];
|
|
8
|
+
|
|
9
|
+
const postClosebuttonCss = ".visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}post-closebutton .btn{padding:0;border:unset;min-height:unset;min-width:unset;width:var(--post-device-sizing-notification-1);height:var(--post-device-sizing-notification-1);border-radius:var(--post-device-border-radius-round);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}post-closebutton .btn>post-icon{min-width:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4);height:var(--post-device-sizing-interactive-icon-size4)}post-closebutton .btn:not(:disabled):hover,post-closebutton .btn.pretend-hover{cursor:pointer;background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-closebutton .btn:not(:disabled):hover,post-closebutton .btn.pretend-hover{color:HighlightText !important}}";
|
|
10
|
+
|
|
11
|
+
const PostClosebutton = /*@__PURE__*/ proxyCustomElement(class PostClosebutton extends H {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.__registerHost();
|
|
15
|
+
this.mutationObserver = new MutationObserver(this.checkContent.bind(this));
|
|
16
|
+
/**
|
|
17
|
+
* Overrides the close button's type ("button" by default)
|
|
18
|
+
*/
|
|
19
|
+
this.buttonType = 'button';
|
|
20
|
+
}
|
|
21
|
+
validateButtonType() {
|
|
22
|
+
checkEmptyOrOneOf(this, 'buttonType', BUTTON_TYPES);
|
|
23
|
+
}
|
|
24
|
+
componentDidLoad() {
|
|
25
|
+
this.checkContent();
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
this.mutationObserver.observe(this.host, {
|
|
29
|
+
childList: true,
|
|
30
|
+
characterData: true,
|
|
31
|
+
subtree: true,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
disconnectedCallback() {
|
|
35
|
+
if (this.mutationObserver) {
|
|
36
|
+
this.mutationObserver.disconnect();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
checkContent() {
|
|
40
|
+
this.validateButtonType();
|
|
41
|
+
if (!this.host.querySelector('.visually-hidden').textContent) {
|
|
42
|
+
console.error(`The \`${this.host.localName}\` component requires content for accessibility.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
return (h(Host, { key: '9b5bb7e95c6cf3039119ce485e963ac672834bc3', "data-version": version }, h("button", { key: '084709a7c632a8c665905a667fa6498cae1972a6', class: "btn", type: this.buttonType }, h("post-icon", { key: 'e19209e0c8de59d3e187531e0185d8f2d5c85408', "aria-hidden": "true", name: "closex" }), h("span", { key: '233184a45391e5a9b89635345f2324a87f5e9558', class: "visually-hidden" }, h("slot", { key: 'c213ac1dbdd98d83a8b2dc1b74c85926404ad1c1' })))));
|
|
47
|
+
}
|
|
48
|
+
get host() { return this; }
|
|
49
|
+
static get watchers() { return {
|
|
50
|
+
"buttonType": ["validateButtonType"]
|
|
51
|
+
}; }
|
|
52
|
+
static get style() { return postClosebuttonCss; }
|
|
53
|
+
}, [4, "post-closebutton", {
|
|
54
|
+
"buttonType": [1, "button-type"]
|
|
55
|
+
}, undefined, {
|
|
56
|
+
"buttonType": ["validateButtonType"]
|
|
57
|
+
}]);
|
|
58
|
+
function defineCustomElement() {
|
|
59
|
+
if (typeof customElements === "undefined") {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const components = ["post-closebutton", "post-icon"];
|
|
63
|
+
components.forEach(tagName => { switch (tagName) {
|
|
64
|
+
case "post-closebutton":
|
|
65
|
+
if (!customElements.get(tagName)) {
|
|
66
|
+
customElements.define(tagName, PostClosebutton);
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case "post-icon":
|
|
70
|
+
if (!customElements.get(tagName)) {
|
|
71
|
+
defineCustomElement$1();
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
} });
|
|
75
|
+
}
|
|
76
|
+
defineCustomElement();
|
|
77
|
+
|
|
78
|
+
export { PostClosebutton as P, defineCustomElement as d };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { a as PLACEMENT_TYPES, d as defineCustomElement$1 } from './p-
|
|
3
|
-
import { v as version } from './p-
|
|
2
|
+
import { a as PLACEMENT_TYPES, d as defineCustomElement$1 } from './p-CDsgZHvX.js';
|
|
3
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
4
4
|
import { g as getFocusableChildren } from './p-C35MCWIp.js';
|
|
5
|
-
import { d as checkEmptyOrOneOf } from './p-CV7fm1rW.js';
|
|
5
|
+
import { d as checkEmptyOrOneOf, c as checkRequiredAndType } from './p-CV7fm1rW.js';
|
|
6
6
|
import './p-CJ80BZ06.js';
|
|
7
|
-
import { E as EventFrom } from './p-
|
|
7
|
+
import { E as EventFrom } from './p-CzIKqBrS.js';
|
|
8
8
|
import { g as getRoot } from './p-CBFgkSgY.js';
|
|
9
9
|
|
|
10
|
-
const postMenuCss = "
|
|
10
|
+
const postMenuCss = ":host{display:block}:where([part=menu]){display:flex;flex-direction:column;padding-block:.5rem}::slotted([slot=header]){margin-top:-0.5rem;padding:1rem;display:flex;align-items:center;gap:.5rem;border-block-end:1px solid #050400;font-weight:700}@media screen and (max-width: 1023.98px){::slotted([slot=header]){padding:.75rem 1rem}}@media screen and (max-width: 779.98px){::slotted([slot=header]){padding:.5rem 1rem}}";
|
|
11
11
|
|
|
12
12
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
13
13
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -59,18 +59,32 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends H {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
this.handlePostToggle = (event) => {
|
|
62
|
-
this.isVisible = event.detail;
|
|
62
|
+
this.isVisible = event.detail.isOpen;
|
|
63
63
|
this.toggleMenu.emit(this.isVisible);
|
|
64
64
|
requestAnimationFrame(() => {
|
|
65
65
|
if (this.isVisible) {
|
|
66
66
|
this.lastFocusedElement = this.root?.activeElement;
|
|
67
67
|
const menuItems = this.getSlottedItems();
|
|
68
|
-
if (
|
|
69
|
-
menuItems
|
|
68
|
+
if (event.detail.first) {
|
|
69
|
+
if (menuItems.length > 0) {
|
|
70
|
+
// Add role="menu" to the popovercontainer
|
|
71
|
+
this.host.setAttribute('role', 'menu');
|
|
72
|
+
// Add role="menuitem" to the focusable elements
|
|
73
|
+
menuItems.forEach(item => {
|
|
74
|
+
item.setAttribute('role', 'menuitem');
|
|
75
|
+
});
|
|
76
|
+
// Add aria-label to the menu
|
|
77
|
+
if (this.label)
|
|
78
|
+
this.host.setAttribute('aria-label', this.label);
|
|
79
|
+
}
|
|
70
80
|
}
|
|
81
|
+
menuItems[0].focus();
|
|
71
82
|
}
|
|
72
83
|
else if (this.lastFocusedElement) {
|
|
73
|
-
|
|
84
|
+
setTimeout(() => {
|
|
85
|
+
// This timeout is added for NVDA to announce the menu as collapsed
|
|
86
|
+
this.lastFocusedElement.focus();
|
|
87
|
+
}, 0);
|
|
74
88
|
}
|
|
75
89
|
});
|
|
76
90
|
};
|
|
@@ -84,6 +98,9 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends H {
|
|
|
84
98
|
validatePlacement() {
|
|
85
99
|
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
86
100
|
}
|
|
101
|
+
validateLabel() {
|
|
102
|
+
checkRequiredAndType(this, 'label', 'string');
|
|
103
|
+
}
|
|
87
104
|
connectedCallback() {
|
|
88
105
|
this.root = getRoot(this.host);
|
|
89
106
|
this.host.addEventListener('keydown', this.handleKeyDown);
|
|
@@ -96,6 +113,7 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends H {
|
|
|
96
113
|
}
|
|
97
114
|
componentDidLoad() {
|
|
98
115
|
this.validatePlacement();
|
|
116
|
+
this.validateLabel();
|
|
99
117
|
if (this.popoverRef) {
|
|
100
118
|
this.popoverRef.addEventListener('postToggle', this.handlePostToggle);
|
|
101
119
|
}
|
|
@@ -172,8 +190,9 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends H {
|
|
|
172
190
|
}
|
|
173
191
|
}
|
|
174
192
|
getSlottedItems() {
|
|
175
|
-
const slot = this.host.shadowRoot.
|
|
176
|
-
const slottedElements =
|
|
193
|
+
const slot = this.host.shadowRoot.querySelectorAll('slot');
|
|
194
|
+
const slottedElements = [];
|
|
195
|
+
slot.forEach(slotItem => slottedElements.push(...slotItem.assignedElements()));
|
|
177
196
|
return (slottedElements
|
|
178
197
|
// If the element is a slot, get the assigned elements
|
|
179
198
|
.flatMap(el => (el instanceof HTMLSlotElement ? el.assignedElements() : el))
|
|
@@ -181,21 +200,24 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends H {
|
|
|
181
200
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
182
201
|
}
|
|
183
202
|
render() {
|
|
184
|
-
return (h(Host, { key: '
|
|
203
|
+
return (h(Host, { key: 'd98d7b0a1c607732ab12c94f8d872408a053c19b', "data-version": version }, h("post-popovercontainer", { key: '669e6062e5ff0dfac0d311cc8fdd0bb51735aac1', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '6bc1abb7b764e9e6985a839904ed5575ea20a519', part: "menu" }, h("slot", { key: '6b8670f2e80ed93761797b9161ddf54bb88f73ec', name: "header" }), h("slot", { key: '971f39ae63f22a503e36aeecb67575304ce14248' })))));
|
|
185
204
|
}
|
|
186
205
|
get host() { return this; }
|
|
187
206
|
static get watchers() { return {
|
|
188
|
-
"placement": ["validatePlacement"]
|
|
207
|
+
"placement": ["validatePlacement"],
|
|
208
|
+
"label": ["validateLabel"]
|
|
189
209
|
}; }
|
|
190
210
|
static get style() { return postMenuCss; }
|
|
191
211
|
}, [1, "post-menu", {
|
|
192
212
|
"placement": [1],
|
|
213
|
+
"label": [1],
|
|
193
214
|
"isVisible": [32],
|
|
194
215
|
"toggle": [64],
|
|
195
216
|
"show": [64],
|
|
196
217
|
"hide": [64]
|
|
197
218
|
}, undefined, {
|
|
198
|
-
"placement": ["validatePlacement"]
|
|
219
|
+
"placement": ["validatePlacement"],
|
|
220
|
+
"label": ["validateLabel"]
|
|
199
221
|
}]);
|
|
200
222
|
__decorate([
|
|
201
223
|
EventFrom('post-popovercontainer')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
2
|
import { I as IS_BROWSER } from './p-CJ80BZ06.js';
|
|
3
3
|
import { d as checkEmptyOrOneOf, e as checkEmptyOrType } from './p-CV7fm1rW.js';
|
|
4
|
-
import { v as version } from './p-
|
|
4
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
5
5
|
|
|
6
6
|
const PLACEMENT_TYPES = [
|
|
7
7
|
'top',
|
|
@@ -2707,13 +2707,29 @@ function apply() {
|
|
|
2707
2707
|
injectStyles(document);
|
|
2708
2708
|
}
|
|
2709
2709
|
|
|
2710
|
-
const
|
|
2710
|
+
const duration = 250;
|
|
2711
|
+
const easing = 'ease-out';
|
|
2712
|
+
function popIn(el) {
|
|
2713
|
+
if (!el)
|
|
2714
|
+
return;
|
|
2715
|
+
return el.animate([
|
|
2716
|
+
{ transform: 'scale(0.9)', opacity: 0 },
|
|
2717
|
+
{ transform: 'scale(1)', opacity: 1 },
|
|
2718
|
+
], {
|
|
2719
|
+
duration,
|
|
2720
|
+
easing,
|
|
2721
|
+
fill: 'forwards',
|
|
2722
|
+
});
|
|
2723
|
+
}
|
|
2724
|
+
|
|
2725
|
+
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:where(post-popovercontainer)>div{box-shadow:var(--post-device-elevation-300);width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:where(post-popovercontainer)>div{border:2px solid rgba(0,0,0,0)}}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer)[safe-space]::after{content:\"\";position:fixed;inset:0;z-index:-1;pointer-events:auto}:where(post-popovercontainer)[safe-space=triangle]::after{clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:where(post-popovercontainer)[safe-space=trapezoid]::after{clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:where(post-popovercontainer):not(:has(.arrow))>div{box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow)>div{filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top)>div{filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left)>div{filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right)>div{filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-block-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-block-start:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-block-end:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-block-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0)}";
|
|
2711
2726
|
|
|
2712
2727
|
const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopovercontainer extends H {
|
|
2713
2728
|
constructor() {
|
|
2714
2729
|
super();
|
|
2715
2730
|
this.__registerHost();
|
|
2716
2731
|
this.postToggle = createEvent(this, "postToggle");
|
|
2732
|
+
this.firstOpen = true;
|
|
2717
2733
|
/**
|
|
2718
2734
|
* Defines the placement of the popovercontainer according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
2719
2735
|
* Popovercontainers are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
@@ -2813,9 +2829,19 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2813
2829
|
this.toggleTimeoutId = window.setTimeout(() => (this.toggleTimeoutId = null), 10);
|
|
2814
2830
|
const isOpen = e.newState === 'open';
|
|
2815
2831
|
if (isOpen) {
|
|
2832
|
+
const content = this.host.querySelector('.popover-content');
|
|
2816
2833
|
this.startAutoupdates();
|
|
2834
|
+
if (content && this.animation === 'pop-in') {
|
|
2835
|
+
popIn(content);
|
|
2836
|
+
}
|
|
2817
2837
|
if (this.safeSpace)
|
|
2818
2838
|
window.addEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
2839
|
+
// Emit event with `first` flag only true on the first open
|
|
2840
|
+
if (this.firstOpen) {
|
|
2841
|
+
this.postToggle.emit({ isOpen, first: this.firstOpen });
|
|
2842
|
+
this.firstOpen = false;
|
|
2843
|
+
return;
|
|
2844
|
+
}
|
|
2819
2845
|
}
|
|
2820
2846
|
else {
|
|
2821
2847
|
if (typeof this.clearAutoUpdate === 'function')
|
|
@@ -2823,7 +2849,7 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2823
2849
|
if (this.safeSpace)
|
|
2824
2850
|
window.removeEventListener('mousemove', this.mouseTrackingHandler.bind(this));
|
|
2825
2851
|
}
|
|
2826
|
-
this.postToggle.emit(isOpen);
|
|
2852
|
+
this.postToggle.emit({ isOpen: isOpen, first: false });
|
|
2827
2853
|
}
|
|
2828
2854
|
/**
|
|
2829
2855
|
* Start listening for DOM updates, scroll events etc. that have
|
|
@@ -2954,10 +2980,9 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2954
2980
|
}
|
|
2955
2981
|
}
|
|
2956
2982
|
render() {
|
|
2957
|
-
|
|
2958
|
-
return (h(Host, { key: '357f53696ca28ab2c137d47e2192038dc756c289', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: '9c40bdc5034ccf14157ee1ae8ce33fe58a9049e4', class: animationClass }, this.arrow && (h("span", { key: '6133ab54aaea6f198560ca5cb30f5604318203f6', class: "arrow", ref: el => {
|
|
2983
|
+
return (h(Host, { key: '493d032d16ace815b6c031e77dbcc673f26d149b', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, h("div", { key: '97bb357cada0456b3aa458e12768d9ad5458ef24', class: "popover-content" }, this.arrow && (h("span", { key: 'f5f2256470edad5a8ca89c32b3a44ef0fe388eea', class: "arrow", ref: el => {
|
|
2959
2984
|
this.arrowRef = el;
|
|
2960
|
-
} })), h("slot", { key: '
|
|
2985
|
+
} })), h("slot", { key: 'f259b6ad624cf392e0d41026b4eab586009cb3c7' }))));
|
|
2961
2986
|
}
|
|
2962
2987
|
get host() { return this; }
|
|
2963
2988
|
static get watchers() { return {
|
|
@@ -6,12 +6,20 @@
|
|
|
6
6
|
* @param ignoreNestedComponents - Whether to ignore events from nested components
|
|
7
7
|
* @returns true if the event should be processed, false otherwise
|
|
8
8
|
*/
|
|
9
|
-
function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
|
|
9
|
+
function shouldProcessEvent(event, tag, host, ignoreNestedComponents, allowDescendants = false) {
|
|
10
10
|
if (!(event instanceof Event && event.target instanceof HTMLElement))
|
|
11
11
|
return false;
|
|
12
12
|
const eventTarget = event.target;
|
|
13
|
-
if (
|
|
14
|
-
|
|
13
|
+
if (allowDescendants) {
|
|
14
|
+
// Accept event if target or any ancestor matches tag
|
|
15
|
+
if (!eventTarget.closest(tag))
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// Only accept event if target exactly matches tag
|
|
20
|
+
if (eventTarget.localName !== tag)
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
15
23
|
if (ignoreNestedComponents) {
|
|
16
24
|
// Find the closest parent with the same tag as the host
|
|
17
25
|
const closestParentWithSameTag = findClosestParentWithTag(eventTarget, host.localName);
|
|
@@ -26,12 +34,18 @@ function shouldProcessEvent(event, tag, host, ignoreNestedComponents) {
|
|
|
26
34
|
* @param option - Configuration options for the event guard
|
|
27
35
|
* @param option.ignoreNestedComponents - Whether to ignore events from nested components
|
|
28
36
|
*/
|
|
29
|
-
function EventFrom(tag, option
|
|
37
|
+
function EventFrom(tag, option) {
|
|
38
|
+
// Set default values here
|
|
39
|
+
const opts = {
|
|
40
|
+
ignoreNestedComponents: true,
|
|
41
|
+
allowDescendants: false,
|
|
42
|
+
...option,
|
|
43
|
+
};
|
|
30
44
|
return function (target, propertyKey, descriptor) {
|
|
31
45
|
if (descriptor) {
|
|
32
46
|
const originalMethod = descriptor.value;
|
|
33
47
|
descriptor.value = function (event) {
|
|
34
|
-
if (!shouldProcessEvent(event, tag, this.host,
|
|
48
|
+
if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents, opts.allowDescendants)) {
|
|
35
49
|
return;
|
|
36
50
|
}
|
|
37
51
|
return originalMethod.call(this, event);
|
|
@@ -57,7 +71,7 @@ function EventFrom(tag, option = { ignoreNestedComponents: true }) {
|
|
|
57
71
|
if (typeof originalFunction === 'function') {
|
|
58
72
|
// Store original and add new behavior
|
|
59
73
|
this[privateKey] = (event) => {
|
|
60
|
-
if (!shouldProcessEvent(event, tag, this.host,
|
|
74
|
+
if (!shouldProcessEvent(event, tag, this.host, opts.ignoreNestedComponents)) {
|
|
61
75
|
return;
|
|
62
76
|
}
|
|
63
77
|
return originalFunction.call(this, event);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
3
3
|
import { a as checkEmptyOrUrl } from './p-CV7fm1rW.js';
|
|
4
4
|
import './p-CJ80BZ06.js';
|
|
5
|
-
import { d as defineCustomElement$1 } from './p-
|
|
5
|
+
import { d as defineCustomElement$1 } from './p-BcVKzjda.js';
|
|
6
6
|
|
|
7
7
|
const postBreadcrumbItemCss = ":host{display:flex;align-items:center;justify-content:start;gap:var(--post-device-spacing-gap-inline-5)}:host post-icon{box-sizing:border-box;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);padding-block:var(--post-core-dimension-4);padding-inline:var(--post-core-dimension-4)}.breadcrumb-item{white-space:nowrap;line-height:150%;padding-block:var(--post-device-spacing-padding-block-7);color:var(--post-scheme-color-interactive-primary-enabled-fg1);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.breadcrumb-item:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item:focus-visible{border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item,.breadcrumb-item:focus,.breadcrumb-item:hover{color:LinkText !important}.breadcrumb-item:visited{color:VisitedText !important}}";
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ const PostBreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb
|
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
46
|
const BreadcrumbTag = this.validUrl ? 'a' : 'span';
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: '9ccdcf67335a106fd70e1d756a941736827454c0', "data-version": version }, h("post-icon", { key: 'e0c9479626737582764a4ecd55612d3d9ee4ae21', name: "2111", class: "breadcrumb-item-icon" }), h(BreadcrumbTag, { key: '75f7b88edee2dda2907429c3c1ab55efe9e5137b', class: "breadcrumb-item", ...(this.validUrl ? { href: this.validUrl } : {}), onKeyDown: event => this.handleKeyDown(event) }, h("slot", { key: '1e59f84b6a9fd8b73372371e79fff43e44bd88c6' }))));
|
|
48
48
|
}
|
|
49
49
|
get host() { return this; }
|
|
50
50
|
static get watchers() { return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { p as proxyCustomElement, H, h, a as Host } from './index.js';
|
|
2
|
-
import { v as version } from './p-
|
|
2
|
+
import { v as version } from './p-DimG3b3P.js';
|
|
3
3
|
import { c as checkRequiredAndType } from './p-CV7fm1rW.js';
|
|
4
4
|
import './p-CJ80BZ06.js';
|
|
5
5
|
import { g as getRoot } from './p-CBFgkSgY.js';
|
|
@@ -80,7 +80,7 @@ const PostMenuTrigger = /*@__PURE__*/ proxyCustomElement(class PostMenuTrigger e
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
render() {
|
|
83
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: 'e4ab1c0cd7227b83994cbd74f2bb3fe88c48126e', "data-version": version, "tab-index": "-1" }, h("slot", { key: '9c5aa5d42457f6716c7607b50b5453cdce8d50d0' })));
|
|
84
84
|
}
|
|
85
85
|
get host() { return this; }
|
|
86
86
|
static get watchers() { return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PostAccordionItem$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { P as PostAccordionItem$1, d as defineCustomElement$1 } from './p-BlOv-NDA.js';
|
|
2
2
|
|
|
3
3
|
const PostAccordionItem = PostAccordionItem$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|