@solid-design-system/components 4.0.0-next.5 → 4.0.0-next.6
Sign up to get free protection for your applications and to get access to all the features.
- package/cdn/chunks/chunk.5FM4F3Y4.js +1 -0
- package/cdn/components/flipcard/flipcard.d.ts +1 -0
- package/cdn/components/flipcard/flipcard.js +1 -1
- package/cdn/custom-elements.json +9 -1
- package/cdn/solid-components.bundle.js +10 -10
- package/cdn/solid-components.iife.js +11 -11
- package/cdn/solid-components.js +1 -1
- package/cdn/vscode.html-custom-data.json +47 -47
- package/cdn/web-types.json +144 -143
- package/cdn-versioned/_components/menu/menu.js +1 -1
- package/cdn-versioned/_components/menu/menu.styles.js +1 -1
- package/cdn-versioned/_components/menu-item/menu-item.js +2 -2
- package/cdn-versioned/chunks/chunk.24SF73MY.js +1 -1
- package/cdn-versioned/chunks/chunk.2IZXJHH7.js +1 -1
- package/cdn-versioned/chunks/chunk.36Z2VDHI.js +1 -1
- package/cdn-versioned/chunks/chunk.3ATYVOO4.js +1 -1
- package/cdn-versioned/chunks/chunk.4HIKTDIM.js +3 -3
- package/cdn-versioned/chunks/chunk.4W3WLVGR.js +1 -1
- package/cdn-versioned/chunks/chunk.5FM4F3Y4.js +1 -0
- package/cdn-versioned/chunks/chunk.5ZDWEJDB.js +1 -1
- package/cdn-versioned/chunks/chunk.65NSSTJE.js +1 -1
- package/cdn-versioned/chunks/chunk.6JBTCFHE.js +2 -2
- package/cdn-versioned/chunks/chunk.7M7VCE7R.js +1 -1
- package/cdn-versioned/chunks/chunk.7RJ3O2FV.js +1 -1
- package/cdn-versioned/chunks/chunk.APMDRZQD.js +1 -1
- package/cdn-versioned/chunks/chunk.C2PA7CKF.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.DEX5VJGX.js +4 -4
- package/cdn-versioned/chunks/chunk.DMLGBWCL.js +1 -1
- package/cdn-versioned/chunks/chunk.DVHKKAVM.js +1 -1
- package/cdn-versioned/chunks/chunk.EWWGLHC5.js +1 -1
- package/cdn-versioned/chunks/chunk.F7J6HN76.js +1 -1
- package/cdn-versioned/chunks/chunk.FD54463O.js +1 -1
- package/cdn-versioned/chunks/chunk.FFNTXFC3.js +1 -1
- package/cdn-versioned/chunks/chunk.FX3ED655.js +1 -1
- package/cdn-versioned/chunks/chunk.GOVNZSCO.js +1 -1
- package/cdn-versioned/chunks/chunk.GQSLHWQC.js +1 -1
- package/cdn-versioned/chunks/chunk.ISEQUO4U.js +1 -1
- package/cdn-versioned/chunks/chunk.ITRQVXFY.js +1 -1
- package/cdn-versioned/chunks/chunk.IZKUI5WK.js +1 -1
- package/cdn-versioned/chunks/chunk.KMLMMBY4.js +1 -1
- package/cdn-versioned/chunks/chunk.LLXTYJXF.js +1 -1
- package/cdn-versioned/chunks/chunk.LZEFLOSA.js +1 -1
- package/cdn-versioned/chunks/chunk.MPP7HYX7.js +1 -1
- package/cdn-versioned/chunks/chunk.MX22EZXK.js +1 -1
- package/cdn-versioned/chunks/chunk.ND7BT52X.js +1 -1
- package/cdn-versioned/chunks/chunk.NUB5WHGD.js +1 -1
- package/cdn-versioned/chunks/chunk.O4UXOQEI.js +1 -1
- package/cdn-versioned/chunks/chunk.OVV7TNT2.js +1 -1
- package/cdn-versioned/chunks/chunk.PBPFKJKV.js +1 -1
- package/cdn-versioned/chunks/chunk.QFNCQQ6S.js +1 -1
- package/cdn-versioned/chunks/chunk.QNZWJACC.js +2 -2
- package/cdn-versioned/chunks/chunk.R354E6ZD.js +1 -1
- package/cdn-versioned/chunks/chunk.ROBLMI7Q.js +4 -4
- package/cdn-versioned/chunks/chunk.TA7CZCP3.js +1 -1
- package/cdn-versioned/chunks/chunk.U443X4TI.js +1 -1
- package/cdn-versioned/chunks/chunk.UBFU6D5B.js +1 -1
- package/cdn-versioned/chunks/chunk.URB2K7JQ.js +1 -1
- package/cdn-versioned/chunks/chunk.VNKUGTKM.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.WENTMXB2.js +1 -1
- package/cdn-versioned/chunks/chunk.WQAPHFVM.js +1 -1
- package/cdn-versioned/chunks/chunk.YF5WEC4R.js +2 -2
- package/cdn-versioned/chunks/chunk.ZFA2VPUT.js +1 -1
- package/cdn-versioned/chunks/chunk.ZRIABVVM.js +1 -1
- package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
- package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/cdn-versioned/components/animation/animation.d.ts +1 -1
- package/cdn-versioned/components/audio/audio.d.ts +1 -1
- package/cdn-versioned/components/badge/badge.d.ts +1 -1
- package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/cdn-versioned/components/button/button.d.ts +1 -1
- package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
- package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
- package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/cdn-versioned/components/combobox/combobox.d.ts +4 -4
- package/cdn-versioned/components/dialog/dialog.d.ts +1 -1
- package/cdn-versioned/components/divider/divider.d.ts +1 -1
- package/cdn-versioned/components/drawer/drawer.d.ts +1 -1
- package/cdn-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/cdn-versioned/components/expandable/expandable.d.ts +1 -1
- package/cdn-versioned/components/flipcard/flipcard.d.ts +2 -1
- package/cdn-versioned/components/flipcard/flipcard.js +1 -1
- package/cdn-versioned/components/header/header.d.ts +1 -1
- package/cdn-versioned/components/icon/icon.d.ts +1 -1
- package/cdn-versioned/components/include/include.d.ts +1 -1
- package/cdn-versioned/components/input/input.d.ts +1 -1
- package/cdn-versioned/components/link/link.d.ts +1 -1
- package/cdn-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/cdn-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/cdn-versioned/components/notification/notification.d.ts +1 -1
- package/cdn-versioned/components/optgroup/optgroup.d.ts +2 -2
- package/cdn-versioned/components/option/option.d.ts +1 -1
- package/cdn-versioned/components/popup/popup.d.ts +1 -1
- package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/cdn-versioned/components/radio/radio.d.ts +1 -1
- package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/cdn-versioned/components/radio-group/radio-group.d.ts +2 -2
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +4 -4
- package/cdn-versioned/components/spinner/spinner.d.ts +1 -1
- package/cdn-versioned/components/step/step.d.ts +1 -1
- package/cdn-versioned/components/step-group/step-group.d.ts +1 -1
- package/cdn-versioned/components/switch/switch.d.ts +1 -1
- package/cdn-versioned/components/tab/tab.d.ts +1 -1
- package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/cdn-versioned/components/tag/tag.d.ts +1 -1
- package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
- package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/cdn-versioned/components/video/video.d.ts +1 -1
- package/cdn-versioned/custom-elements.json +210 -202
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +18 -18
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +18 -18
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +125 -125
- package/cdn-versioned/web-types.json +275 -274
- package/dist/chunks/{chunk.WWS3CQ2Z.js → chunk.KTJRTRDJ.js} +16 -5
- package/dist/components/flipcard/flipcard.d.ts +1 -0
- package/dist/components/flipcard/flipcard.js +1 -1
- package/dist/custom-elements.json +9 -1
- package/dist/solid-components.js +1 -1
- package/dist/vscode.html-custom-data.json +47 -47
- package/dist/web-types.json +144 -143
- package/dist-versioned/_components/menu/menu.js +1 -1
- package/dist-versioned/_components/menu/menu.styles.js +1 -1
- package/dist-versioned/_components/menu-item/menu-item.js +2 -2
- package/dist-versioned/chunks/chunk.2IBVAXOX.js +1 -1
- package/dist-versioned/chunks/chunk.3IT4HBTI.js +1 -1
- package/dist-versioned/chunks/chunk.3LGDUVS4.js +2 -2
- package/dist-versioned/chunks/chunk.4JZQQD4L.js +3 -3
- package/dist-versioned/chunks/chunk.4QKRGAOL.js +4 -4
- package/dist-versioned/chunks/chunk.4RGGPCD5.js +2 -2
- package/dist-versioned/chunks/chunk.65BWRJEA.js +5 -5
- package/dist-versioned/chunks/chunk.6CUAQSFA.js +2 -2
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.727ERQ4F.js +2 -2
- package/dist-versioned/chunks/chunk.743FPQRN.js +2 -2
- package/dist-versioned/chunks/chunk.76ZNNLGN.js +1 -1
- package/dist-versioned/chunks/chunk.7OHSCBBX.js +1 -1
- package/dist-versioned/chunks/chunk.BG3M5FUP.js +13 -13
- package/dist-versioned/chunks/chunk.BVC5FY4L.js +13 -13
- package/dist-versioned/chunks/chunk.BXB5WF23.js +5 -5
- package/dist-versioned/chunks/chunk.D6JZ4IKM.js +1 -1
- package/dist-versioned/chunks/chunk.DQPVSTUQ.js +3 -3
- package/dist-versioned/chunks/chunk.EFEBQQHC.js +26 -26
- package/dist-versioned/chunks/chunk.EKFRFDTB.js +5 -5
- package/dist-versioned/chunks/chunk.H655M7FD.js +1 -1
- package/dist-versioned/chunks/chunk.HPR3PWAE.js +3 -3
- package/dist-versioned/chunks/chunk.I3PY3VYP.js +29 -29
- package/dist-versioned/chunks/chunk.IN3GJ5QL.js +3 -3
- package/dist-versioned/chunks/chunk.J2XBUIBC.js +2 -2
- package/dist-versioned/chunks/chunk.J7MMF6WJ.js +2 -2
- package/dist-versioned/chunks/{chunk.WWS3CQ2Z.js → chunk.KTJRTRDJ.js} +20 -9
- package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
- package/dist-versioned/chunks/chunk.MTSAWJLV.js +2 -2
- package/dist-versioned/chunks/chunk.NM6QP6RJ.js +2 -2
- package/dist-versioned/chunks/chunk.PDRECIYA.js +1 -1
- package/dist-versioned/chunks/chunk.PGZ5AWZ2.js +9 -9
- package/dist-versioned/chunks/chunk.PIR4YJUS.js +2 -2
- package/dist-versioned/chunks/chunk.QAZYUCBK.js +6 -6
- package/dist-versioned/chunks/chunk.QCICV36Z.js +6 -6
- package/dist-versioned/chunks/chunk.QP3SM2LZ.js +3 -3
- package/dist-versioned/chunks/chunk.R4BETATX.js +1 -1
- package/dist-versioned/chunks/chunk.RNSJAVQE.js +1 -1
- package/dist-versioned/chunks/chunk.RZRTIYXA.js +1 -1
- package/dist-versioned/chunks/chunk.SPBPHTSS.js +2 -2
- package/dist-versioned/chunks/chunk.SSH6ATRK.js +2 -2
- package/dist-versioned/chunks/chunk.TWXYFPBS.js +2 -2
- package/dist-versioned/chunks/chunk.U5NFPAOX.js +2 -2
- package/dist-versioned/chunks/chunk.U6RY25TF.js +2 -2
- package/dist-versioned/chunks/chunk.UC5E3AEF.js +1 -1
- package/dist-versioned/chunks/chunk.UDZYWRPT.js +1 -1
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.V7TQ6VJU.js +1 -1
- package/dist-versioned/chunks/chunk.VHGHICFG.js +2 -2
- package/dist-versioned/chunks/chunk.XVFJS7VS.js +5 -5
- package/dist-versioned/chunks/chunk.Z2UY62T2.js +1 -1
- package/dist-versioned/chunks/chunk.ZGPGFEVP.js +5 -5
- package/dist-versioned/chunks/chunk.ZWJI7SLE.js +11 -11
- package/dist-versioned/components/accordion/accordion.d.ts +1 -1
- package/dist-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist-versioned/components/animation/animation.d.ts +1 -1
- package/dist-versioned/components/audio/audio.d.ts +1 -1
- package/dist-versioned/components/badge/badge.d.ts +1 -1
- package/dist-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/dist-versioned/components/button/button.d.ts +1 -1
- package/dist-versioned/components/button-group/button-group.d.ts +1 -1
- package/dist-versioned/components/carousel/carousel.d.ts +1 -1
- package/dist-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/dist-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist-versioned/components/combobox/combobox.d.ts +4 -4
- package/dist-versioned/components/dialog/dialog.d.ts +1 -1
- package/dist-versioned/components/divider/divider.d.ts +1 -1
- package/dist-versioned/components/drawer/drawer.d.ts +1 -1
- package/dist-versioned/components/dropdown/dropdown.d.ts +1 -1
- package/dist-versioned/components/expandable/expandable.d.ts +1 -1
- package/dist-versioned/components/flipcard/flipcard.d.ts +2 -1
- package/dist-versioned/components/flipcard/flipcard.js +1 -1
- package/dist-versioned/components/header/header.d.ts +1 -1
- package/dist-versioned/components/icon/icon.d.ts +1 -1
- package/dist-versioned/components/include/include.d.ts +1 -1
- package/dist-versioned/components/input/input.d.ts +1 -1
- package/dist-versioned/components/link/link.d.ts +1 -1
- package/dist-versioned/components/map-marker/map-marker.d.ts +1 -1
- package/dist-versioned/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist-versioned/components/notification/notification.d.ts +1 -1
- package/dist-versioned/components/optgroup/optgroup.d.ts +2 -2
- package/dist-versioned/components/option/option.d.ts +1 -1
- package/dist-versioned/components/popup/popup.d.ts +1 -1
- package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/dist-versioned/components/radio/radio.d.ts +1 -1
- package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/dist-versioned/components/radio-group/radio-group.d.ts +2 -2
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +4 -4
- package/dist-versioned/components/spinner/spinner.d.ts +1 -1
- package/dist-versioned/components/step/step.d.ts +1 -1
- package/dist-versioned/components/step-group/step-group.d.ts +1 -1
- package/dist-versioned/components/switch/switch.d.ts +1 -1
- package/dist-versioned/components/tab/tab.d.ts +1 -1
- package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist-versioned/components/tag/tag.d.ts +1 -1
- package/dist-versioned/components/textarea/textarea.d.ts +1 -1
- package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/dist-versioned/components/video/video.d.ts +1 -1
- package/dist-versioned/custom-elements.json +210 -202
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +1 -1
- package/dist-versioned/vscode.html-custom-data.json +125 -125
- package/dist-versioned/web-types.json +275 -274
- package/package.json +1 -1
- package/cdn/chunks/chunk.SNUMAAEG.js +0 -1
- package/cdn-versioned/chunks/chunk.SNUMAAEG.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
import{a}from"./chunk.26YUWEYR.js";import{a as m}from"./chunk.DCOFYPWX.js";import{a as i,b as s,h as l}from"./chunk.APMDRZQD.js";import{b as t,e as o}from"./chunk.IRWHG2Q4.js";import{e as r}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.color="currentColor";this.localize=new a(this)}render(){return o`<svg role="progressbar" viewBox="0 0 24 24" class="${m("animate-spin",{primary:"text-primary",white:"text-white",currentColor:""}[this.color])}" aria-label="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`}};e.styles=[...l.styles,t`:host{display:inline-block;height:1em;width:1em}`],r([s({reflect:!0})],e.prototype,"color",2),e=r([i("sd-4-0-0-next-
|
1
|
+
import{a}from"./chunk.26YUWEYR.js";import{a as m}from"./chunk.DCOFYPWX.js";import{a as i,b as s,h as l}from"./chunk.APMDRZQD.js";import{b as t,e as o}from"./chunk.IRWHG2Q4.js";import{e as r}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.color="currentColor";this.localize=new a(this)}render(){return o`<svg role="progressbar" viewBox="0 0 24 24" class="${m("animate-spin",{primary:"text-primary",white:"text-white",currentColor:""}[this.color])}" aria-label="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`}};e.styles=[...l.styles,t`:host{display:inline-block;height:1em;width:1em}`],r([s({reflect:!0})],e.prototype,"color",2),e=r([i("sd-4-0-0-next-6-spinner")],e);export{e as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as l}from"./chunk.E2DRD2OX.js";import{a as c}from"./chunk.DCOFYPWX.js";import{a as o,b as a,h as i}from"./chunk.APMDRZQD.js";import{b as r,e as s}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var p=0,t=class extends i{constructor(){super(...arguments);this.attrId=++p;this.componentId=`sd-4-0-0-next-
|
1
|
+
import{a as l}from"./chunk.E2DRD2OX.js";import{a as c}from"./chunk.DCOFYPWX.js";import{a as o,b as a,h as i}from"./chunk.APMDRZQD.js";import{b as r,e as s}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var p=0,t=class extends i{constructor(){super(...arguments);this.attrId=++p;this.componentId=`sd-4-0-0-next-6-tab-panel-${this.attrId}`;this.name="";this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return s`<slot part="base" class="${c("block",this.active&&"tab-panel--active")}"></slot>`}};t.styles=[...i.styles,r`:host{--padding:0;display:none}:host([active]){display:block}::part(base){padding:var(--padding)}`],e([a({reflect:!0})],t.prototype,"name",2),e([a({type:Boolean,reflect:!0})],t.prototype,"active",2),e([l("active")],t.prototype,"handleActiveChange",1),t=e([o("sd-4-0-0-next-6-tab-panel")],t);export{t as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a}from"./chunk.HE2LNCWW.js";import{a as n,b as s}from"./chunk.5ZILM4TA.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as i}from"./chunk.DCOFYPWX.js";import{a as u,b as r,h as o}from"./chunk.APMDRZQD.js";import{b as d}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.size="lg";this.orientation="horizontal";this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1)}handleDisabledChange(){this.disabled&&(this.current=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1)}render(){let c=this.isLink(),h=this.notInteractive?n`div`:c?n`a`:n`button`;return s`<div role="listitem" part="base" class="${i("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-min overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${i("flex shrink-0 gap-2",this.noTail&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",this.orientation==="horizontal"?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3")}"><${h} part="circle" href="${a(c?this.href:void 0)}" aria-disabled="${a(this.disabled||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${a("label")}" aria-describedby="${a("description")}" class="${i("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":"focus-visible:focus-outline group-hover:cursor-pointer",this.notInteractive?this.size==="lg"?"w-[72px]":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&"border-primary group-hover:bg-primary-100 group-hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white")}"><slot name="circle-content" class="${i(!this.disabled&&!this.current&&!this.notInteractive&&"text-primary group-hover:text-primary-500 group-hover:fill-primary-500",this.notInteractive&&"text-primary",this.size==="lg"?"text-lg":"text-sm")}">${!this.disabled&&!this.current&&!this.notInteractive?s`<sd-4-0-0-next-
|
1
|
+
import{a}from"./chunk.HE2LNCWW.js";import{a as n,b as s}from"./chunk.5ZILM4TA.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as i}from"./chunk.DCOFYPWX.js";import{a as u,b as r,h as o}from"./chunk.APMDRZQD.js";import{b as d}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.size="lg";this.orientation="horizontal";this.disabled=!1;this.current=!1;this.noTail=!1;this.notInteractive=!1;this.label="";this.description="";this.index=1;this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1)}handleDisabledChange(){this.disabled&&(this.current=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1)}render(){let c=this.isLink(),h=this.notInteractive?n`div`:c?n`a`:n`button`;return s`<div role="listitem" part="base" class="${i("flex pt-1",this.orientation==="horizontal"?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-min overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${i("flex shrink-0 gap-2",this.noTail&&"w-max",this.orientation==="horizontal"?"flex-row":"flex-col items-stretch",this.orientation==="horizontal"?this.size==="lg"?"translateLg":"translateSm":this.size==="lg"?"mt-1":"mt-3")}"><${h} part="circle" href="${a(c?this.href:void 0)}" aria-disabled="${a(this.disabled||void 0)}" aria-current="${this.current?"step":void 0}" aria-labelledby="${a("label")}" aria-describedby="${a("description")}" class="${i("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled?"focus-visible:outline-none cursor-not-allowed":"focus-visible:focus-outline group-hover:cursor-pointer",this.notInteractive?this.size==="lg"?"w-[72px]":"w-12":this.size==="lg"?"w-12":"w-8",this.disabled&&"border-neutral-400 text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive&&"border-primary group-hover:bg-primary-100 group-hover:border-primary-500",this.notInteractive&&"border-neutral-400",this.current&&"bg-accent border-none text-white")}"><slot name="circle-content" class="${i(!this.disabled&&!this.current&&!this.notInteractive&&"text-primary group-hover:text-primary-500 group-hover:fill-primary-500",this.notInteractive&&"text-primary",this.size==="lg"?"text-lg":"text-sm")}">${!this.disabled&&!this.current&&!this.notInteractive?s`<sd-4-0-0-next-6-icon name="status-check" library="system"></sd-4-0-0-next-6-icon>`:s`${this.index}`}</slot></${h}>${this.noTail?"":s`<div part="tail" class="${i(this.orientation==="horizontal"?"border-t w-full my-auto mr-2":"border-l flex-grow flex-shrink-0 basis-auto h-full w-[1px] mx-auto",!this.disabled&&!this.current&&!this.notInteractive?" border-primary group-hover:border-primary-500":"border-neutral-400")}"></div>`}</div><div part="text-container" class="${i("mt-4 break-words flex flex-col gap-2",this.orientation==="horizontal"?"text-center w-40":"w-max text-left",this.disabled&&"!text-neutral-700",this.notInteractive?"ml-3":"mr-4")}"><div part="label" id="label" class="${i("!font-bold sd-paragraph",this.disabled&&"!text-neutral-700",!this.disabled&&!this.current&&!this.notInteractive?"!text-primary group-hover:!text-primary-500 group-hover:cursor-pointer":"text-black")}"><slot name="label">${this.label}</slot></div><div part="description" id="description" class="${i("sd-paragraph sd-paragraph--size-sm",this.disabled&&"!text-neutral-700")}">${this.description||s`<slot></slot>`}</div></div></div>`}};t.styles=[...o.styles,d`:host{flex:1 1 0%}:host([no-tail]){flex-grow:0}.translateLg{transform:translateX(55px)}.translateSm{transform:translateX(64px)}`],e([r({reflect:!0})],t.prototype,"size",2),e([r({reflect:!0})],t.prototype,"orientation",2),e([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([r({type:Boolean,reflect:!0})],t.prototype,"current",2),e([r({reflect:!0,type:Boolean,attribute:"no-tail"})],t.prototype,"noTail",2),e([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],t.prototype,"notInteractive",2),e([r()],t.prototype,"label",2),e([r()],t.prototype,"description",2),e([r({type:Number,reflect:!0,attribute:"index"})],t.prototype,"index",2),e([r()],t.prototype,"href",2),e([l("current")],t.prototype,"handleCurrentChange",1),e([l("disabled")],t.prototype,"handleDisabledChange",1),e([l("notInteractive")],t.prototype,"handleInteractivityChange",1),t=e([u("sd-4-0-0-next-6-step")],t);export{t as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as A}from"./chunk.X2O263YD.js";import{a as m,b as f}from"./chunk.3L472FD4.js";import{a as T}from"./chunk.HE2LNCWW.js";import{a as o,c as l}from"./chunk.A3DKF5BY.js";import{a as n,d as p}from"./chunk.RQYP7MH5.js";import{a as g}from"./chunk.KLRPP4NQ.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as C}from"./chunk.6HO6CE4A.js";import{a as L}from"./chunk.26YUWEYR.js";import{a as c}from"./chunk.DCOFYPWX.js";import{a as E,b as r,d as h,h as w}from"./chunk.APMDRZQD.js";import{b as x,e as v}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";function k(u){return u.charAt(0).toUpperCase()+u.slice(1)}var e=class extends w{constructor(){super(...arguments);this.hasSlotController=new C(this,"footer");this.localize=new L(this);this.modal=new A(this);this.open=!1;this.label="";this.placement="end";this.contained=!1;this.noHeader=!1;this.handleDocumentKeyDown=t=>{this.open&&t.key==="Escape"&&(t.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),m(this)))}disconnectedCallback(){super.disconnectedCallback(),f(this)}requestClose(t){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){let a=l(this,"drawer.denyClose",{dir:this.localize.dir()});n(this.panel,a.keyframes,a.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){var y;let t=(y=this.closeButton.shadowRoot)==null?void 0:y.querySelector('[part="base"]');if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),m(this));let a=this.querySelector("[autofocus]");a&&a.removeAttribute("autofocus"),await Promise.all([p(this.drawer),p(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(a?a.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),a&&a.setAttribute("autofocus","")});let d=l(this,`drawer.show${k(this.placement)}`,{dir:this.localize.dir()}),s=l(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([n(this.panel,d.keyframes,d.options),n(this.overlay,s.keyframes,s.options)]),t==null||t.setAttribute("aria-controls","drawer"),t==null||t.setAttribute("aria-expanded","true"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),f(this)),await Promise.all([p(this.drawer),p(this.overlay)]);let a=l(this,`drawer.hide${k(this.placement)}`,{dir:this.localize.dir()}),d=l(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([n(this.overlay,d.keyframes,d.options).then(()=>{this.overlay.hidden=!0}),n(this.panel,a.keyframes,a.options).then(()=>{this.panel.hidden=!0})]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;let s=this.originalTrigger;typeof(s==null?void 0:s.focus)=="function"&&setTimeout(()=>s.focus()),t==null||t.setAttribute("aria-expanded","false"),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),m(this)),this.open&&this.contained&&(this.modal.deactivate(),f(this))}async show(){if(!this.open)return this.open=!0,g(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,g(this,"sd-after-hide")}render(){return v`<div id="drawer" part="base" class="${c("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}"><div part="overlay" class="${c("block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${c("absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[--width] h-full",start:"top-0 end-auto bottom-auto start-0 w-[--width] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.label}" aria-labelledby="${T(this.noHeader?void 0:"title")}" tabindex="0">${this.noHeader?"":v`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-4-0-0-next-
|
1
|
+
import{a as A}from"./chunk.X2O263YD.js";import{a as m,b as f}from"./chunk.3L472FD4.js";import{a as T}from"./chunk.HE2LNCWW.js";import{a as o,c as l}from"./chunk.A3DKF5BY.js";import{a as n,d as p}from"./chunk.RQYP7MH5.js";import{a as g}from"./chunk.KLRPP4NQ.js";import{a as b}from"./chunk.E2DRD2OX.js";import{a as C}from"./chunk.6HO6CE4A.js";import{a as L}from"./chunk.26YUWEYR.js";import{a as c}from"./chunk.DCOFYPWX.js";import{a as E,b as r,d as h,h as w}from"./chunk.APMDRZQD.js";import{b as x,e as v}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";function k(u){return u.charAt(0).toUpperCase()+u.slice(1)}var e=class extends w{constructor(){super(...arguments);this.hasSlotController=new C(this,"footer");this.localize=new L(this);this.modal=new A(this);this.open=!1;this.label="";this.placement="end";this.contained=!1;this.noHeader=!1;this.handleDocumentKeyDown=t=>{this.open&&t.key==="Escape"&&(t.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),m(this)))}disconnectedCallback(){super.disconnectedCallback(),f(this)}requestClose(t){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){let a=l(this,"drawer.denyClose",{dir:this.localize.dir()});n(this.panel,a.keyframes,a.options);return}this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){var y;let t=(y=this.closeButton.shadowRoot)==null?void 0:y.querySelector('[part="base"]');if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),m(this));let a=this.querySelector("[autofocus]");a&&a.removeAttribute("autofocus"),await Promise.all([p(this.drawer),p(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame(()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(a?a.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),a&&a.setAttribute("autofocus","")});let d=l(this,`drawer.show${k(this.placement)}`,{dir:this.localize.dir()}),s=l(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([n(this.panel,d.keyframes,d.options),n(this.overlay,s.keyframes,s.options)]),t==null||t.setAttribute("aria-controls","drawer"),t==null||t.setAttribute("aria-expanded","true"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),f(this)),await Promise.all([p(this.drawer),p(this.overlay)]);let a=l(this,`drawer.hide${k(this.placement)}`,{dir:this.localize.dir()}),d=l(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([n(this.overlay,d.keyframes,d.options).then(()=>{this.overlay.hidden=!0}),n(this.panel,a.keyframes,a.options).then(()=>{this.panel.hidden=!0})]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;let s=this.originalTrigger;typeof(s==null?void 0:s.focus)=="function"&&setTimeout(()=>s.focus()),t==null||t.setAttribute("aria-expanded","false"),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),m(this)),this.open&&this.contained&&(this.modal.deactivate(),f(this))}async show(){if(!this.open)return this.open=!0,g(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,g(this,"sd-after-hide")}render(){return v`<div id="drawer" part="base" class="${c("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}"><div part="overlay" class="${c("block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${c("absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[--width] h-full",start:"top-0 end-auto bottom-auto start-0 w-[--width] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.label}" aria-labelledby="${T(this.noHeader?void 0:"title")}" tabindex="0">${this.noHeader?"":v`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-4-0-0-next-6-button variant="tertiary" size="lg" part="close-button" @click="${()=>this.requestClose("close-button")}"><sd-4-0-0-next-6-icon label="${this.localize.term("close")}" name="close" library="system"></sd-4-0-0-next-6-icon></sd-4-0-0-next-6-button></div></header>`}<div part="body" class="flex-auto block px-4"><slot></slot></div><footer part="footer" class="${c(this.hasSlotController.test("footer")?"text-left p-4":"hidden")}"><slot name="footer"></slot></footer></div></div>`}};e.styles=[...w.styles,x`:host{--width:25rem;display:contents}:host([contained]){z-index:auto}:host(:not([contained])){z-index:var(--sd-z-index-drawer,700)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}`],i([h("[part=base]")],e.prototype,"drawer",2),i([h("[part=panel]")],e.prototype,"panel",2),i([h("[part=overlay]")],e.prototype,"overlay",2),i([h("[part=close-button]")],e.prototype,"closeButton",2),i([r({type:Boolean,reflect:!0})],e.prototype,"open",2),i([r({attribute:"label",reflect:!0})],e.prototype,"label",2),i([r({reflect:!0})],e.prototype,"placement",2),i([r({type:Boolean,reflect:!0})],e.prototype,"contained",2),i([r({attribute:"no-header",type:Boolean})],e.prototype,"noHeader",2),i([b("open",{waitUntilFirstUpdate:!0})],e.prototype,"handleOpenChange",1),i([b("contained",{waitUntilFirstUpdate:!0})],e.prototype,"handleNoModalChange",1),e=i([E("sd-4-0-0-next-6-drawer")],e);o("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}});o("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}});o("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}});o("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}});o("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}});o("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}});o("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});export{e as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as s}from"./chunk.E2DRD2OX.js";import{a as l}from"./chunk.XR2KNB36.js";import{a as y,b as a,f,h as r}from"./chunk.APMDRZQD.js";import{b as c,e as d}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends r{constructor(){super(...arguments);this.hasStarted=!1;this.name="none";this.play=!1;this.delay=0;this.direction="normal";this.duration=1e3;this.easing="linear";this.endDelay=0;this.fill="auto";this.iterations=1/0;this.iterationStart=0;this.playbackRate=1}get currentTime(){var i,n;return(n=(i=this.animation)==null?void 0:i.currentTime)!=null?n:0}set currentTime(i){this.animation&&(this.animation.currentTime=i)}connectedCallback(){super.connectedCallback(),this.createAnimation(),this.handleAnimationCancel=this.handleAnimationCancel.bind(this),this.handleAnimationFinish=this.handleAnimationFinish.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.destroyAnimation()}handleAnimationFinish(){this.play=!1,this.hasStarted=!1,this.emit("sd-finish")}handleAnimationCancel(){this.play=!1,this.hasStarted=!1,this.emit("sd-cancel")}handleSlotChange(){this.destroyAnimation(),this.createAnimation()}async createAnimation(){var o,m;let i=(o=l.easings[this.easing])!=null?o:this.easing,n=(m=this.keyframes)!=null?m:l[this.name],h=(await this.defaultSlot).assignedElements()[0];return!h||!n?!1:(this.destroyAnimation(),this.animation=h.animate(n,{delay:this.delay,direction:this.direction,duration:this.duration,easing:i,endDelay:this.endDelay,fill:this.fill,iterationStart:this.iterationStart,iterations:this.iterations}),this.animation.playbackRate=this.playbackRate,this.animation.addEventListener("cancel",this.handleAnimationCancel),this.animation.addEventListener("finish",this.handleAnimationFinish),this.play?(this.hasStarted=!0,this.emit("sd-start")):this.animation.pause(),!0)}destroyAnimation(){this.animation&&(this.animation.cancel(),this.animation.removeEventListener("cancel",this.handleAnimationCancel),this.animation.removeEventListener("finish",this.handleAnimationFinish),this.hasStarted=!1)}handleAnimationChange(){this.hasUpdated&&this.createAnimation()}handlePlayChange(){return this.animation?(this.play&&!this.hasStarted&&(this.hasStarted=!0,this.emit("sd-start")),this.play?this.animation.play():this.animation.pause(),!0):!1}handlePlaybackRateChange(){this.animation&&(this.animation.playbackRate=this.playbackRate)}cancel(){var i;(i=this.animation)==null||i.cancel()}finish(){var i;(i=this.animation)==null||i.finish()}render(){return d`<slot @slotchange="${this.handleSlotChange}"></slot>`}};t.styles=[...r.styles,c`:host{display:contents}`],e([f("slot")],t.prototype,"defaultSlot",2),e([a()],t.prototype,"name",2),e([a({type:Boolean,reflect:!0})],t.prototype,"play",2),e([a({type:Number})],t.prototype,"delay",2),e([a()],t.prototype,"direction",2),e([a({type:Number})],t.prototype,"duration",2),e([a()],t.prototype,"easing",2),e([a({attribute:"end-delay",type:Number})],t.prototype,"endDelay",2),e([a()],t.prototype,"fill",2),e([a({type:Number})],t.prototype,"iterations",2),e([a({attribute:"iteration-start",type:Number})],t.prototype,"iterationStart",2),e([a({attribute:!1})],t.prototype,"keyframes",2),e([a({attribute:"playback-rate",type:Number})],t.prototype,"playbackRate",2),e([s(["name","delay","direction","duration","easing","endDelay","fill","iterations","iterationsStart","keyframes"])],t.prototype,"handleAnimationChange",1),e([s("play")],t.prototype,"handlePlayChange",1),e([s("playbackRate")],t.prototype,"handlePlaybackRateChange",1),t=e([y("sd-4-0-0-next-
|
1
|
+
import{a as s}from"./chunk.E2DRD2OX.js";import{a as l}from"./chunk.XR2KNB36.js";import{a as y,b as a,f,h as r}from"./chunk.APMDRZQD.js";import{b as c,e as d}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends r{constructor(){super(...arguments);this.hasStarted=!1;this.name="none";this.play=!1;this.delay=0;this.direction="normal";this.duration=1e3;this.easing="linear";this.endDelay=0;this.fill="auto";this.iterations=1/0;this.iterationStart=0;this.playbackRate=1}get currentTime(){var i,n;return(n=(i=this.animation)==null?void 0:i.currentTime)!=null?n:0}set currentTime(i){this.animation&&(this.animation.currentTime=i)}connectedCallback(){super.connectedCallback(),this.createAnimation(),this.handleAnimationCancel=this.handleAnimationCancel.bind(this),this.handleAnimationFinish=this.handleAnimationFinish.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.destroyAnimation()}handleAnimationFinish(){this.play=!1,this.hasStarted=!1,this.emit("sd-finish")}handleAnimationCancel(){this.play=!1,this.hasStarted=!1,this.emit("sd-cancel")}handleSlotChange(){this.destroyAnimation(),this.createAnimation()}async createAnimation(){var o,m;let i=(o=l.easings[this.easing])!=null?o:this.easing,n=(m=this.keyframes)!=null?m:l[this.name],h=(await this.defaultSlot).assignedElements()[0];return!h||!n?!1:(this.destroyAnimation(),this.animation=h.animate(n,{delay:this.delay,direction:this.direction,duration:this.duration,easing:i,endDelay:this.endDelay,fill:this.fill,iterationStart:this.iterationStart,iterations:this.iterations}),this.animation.playbackRate=this.playbackRate,this.animation.addEventListener("cancel",this.handleAnimationCancel),this.animation.addEventListener("finish",this.handleAnimationFinish),this.play?(this.hasStarted=!0,this.emit("sd-start")):this.animation.pause(),!0)}destroyAnimation(){this.animation&&(this.animation.cancel(),this.animation.removeEventListener("cancel",this.handleAnimationCancel),this.animation.removeEventListener("finish",this.handleAnimationFinish),this.hasStarted=!1)}handleAnimationChange(){this.hasUpdated&&this.createAnimation()}handlePlayChange(){return this.animation?(this.play&&!this.hasStarted&&(this.hasStarted=!0,this.emit("sd-start")),this.play?this.animation.play():this.animation.pause(),!0):!1}handlePlaybackRateChange(){this.animation&&(this.animation.playbackRate=this.playbackRate)}cancel(){var i;(i=this.animation)==null||i.cancel()}finish(){var i;(i=this.animation)==null||i.finish()}render(){return d`<slot @slotchange="${this.handleSlotChange}"></slot>`}};t.styles=[...r.styles,c`:host{display:contents}`],e([f("slot")],t.prototype,"defaultSlot",2),e([a()],t.prototype,"name",2),e([a({type:Boolean,reflect:!0})],t.prototype,"play",2),e([a({type:Number})],t.prototype,"delay",2),e([a()],t.prototype,"direction",2),e([a({type:Number})],t.prototype,"duration",2),e([a()],t.prototype,"easing",2),e([a({attribute:"end-delay",type:Number})],t.prototype,"endDelay",2),e([a()],t.prototype,"fill",2),e([a({type:Number})],t.prototype,"iterations",2),e([a({attribute:"iteration-start",type:Number})],t.prototype,"iterationStart",2),e([a({attribute:!1})],t.prototype,"keyframes",2),e([a({attribute:"playback-rate",type:Number})],t.prototype,"playbackRate",2),e([s(["name","delay","direction","duration","easing","endDelay","fill","iterations","iterationsStart","keyframes"])],t.prototype,"handleAnimationChange",1),e([s("play")],t.prototype,"handlePlayChange",1),e([s("playbackRate")],t.prototype,"handlePlaybackRateChange",1),t=e([y("sd-4-0-0-next-6-animation")],t);export{t as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as p}from"./chunk.6HO6CE4A.js";import{a as r}from"./chunk.DCOFYPWX.js";import{a as h,b as a,c as d,d as m,h as o}from"./chunk.APMDRZQD.js";import{b as l,e as n}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.variant="white";this.breakpoint=448;this.inset=!1;this.hasSlotController=new p(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),this.breakpoint===0?this._orientation="horizontal":this.breakpoint===9999?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.updateOrientation()),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(e){super.updated(e),e.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){let e=this.variant==="white border-neutral-400"||this.inset,s={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline")};return n`<div class="${r("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],this._orientation==="vertical"&&"flex-col",this._orientation==="horizontal"&&"flex-row gap-8",this._orientation==="horizontal"&&e&&"py-8 px-10")}" part="base"><div part="media" id="media" aria-hidden="true" style="${this._orientation==="horizontal"?"width: var(--distribution-media, 100%);":""}" class="${r(!e&&this._orientation==="vertical"&&"mb-4",!s["teaser-has-media"]&&"hidden",this.variant==="white border-neutral-400"&&this._orientation==="vertical"&&"mx-[-1px] mt-[-1px]")}"><slot name="media"></slot></div><div style="${this._orientation==="horizontal"?`width: var(--distribution-content, 100%); ${e?"width: var(--distribution-content, calc(100% - 2rem));":""}`:""}" class="${r("flex flex-col text-left",this._orientation==="horizontal"&&"flex flex-col",this._orientation==="vertical"&&e&&"m-4")}" part="content"><div class="flex flex-col-reverse"><div part="headline" class="${r("text-lg font-bold m-0",this.variant==="primary"?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div part="meta" class="${r("gap-2 mb-4",!s["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div></div><div part="main" class="${r(!s["teaser-has-default"]&&"hidden")}" aria-labelledby="media"><slot></slot></div></div></div>`}};t.styles=[...o.styles,l`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700;margin:var(--sd-spacing-0,0)!important}`],i([a({reflect:!0})],t.prototype,"variant",2),i([a({reflect:!0,type:Number})],t.prototype,"breakpoint",2),i([a({type:Boolean,reflect:!0})],t.prototype,"inset",2),i([m('[part="base"]')],t.prototype,"teaser",2),i([d()],t.prototype,"_orientation",2),t=i([h("sd-4-0-0-next-
|
1
|
+
import{a as p}from"./chunk.6HO6CE4A.js";import{a as r}from"./chunk.DCOFYPWX.js";import{a as h,b as a,c as d,d as m,h as o}from"./chunk.APMDRZQD.js";import{b as l,e as n}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.variant="white";this.breakpoint=448;this.inset=!1;this.hasSlotController=new p(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),this.breakpoint===0?this._orientation="horizontal":this.breakpoint===9999?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.updateOrientation()),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(e){super.updated(e),e.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){let e=this.variant==="white border-neutral-400"||this.inset,s={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline")};return n`<div class="${r("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],this._orientation==="vertical"&&"flex-col",this._orientation==="horizontal"&&"flex-row gap-8",this._orientation==="horizontal"&&e&&"py-8 px-10")}" part="base"><div part="media" id="media" aria-hidden="true" style="${this._orientation==="horizontal"?"width: var(--distribution-media, 100%);":""}" class="${r(!e&&this._orientation==="vertical"&&"mb-4",!s["teaser-has-media"]&&"hidden",this.variant==="white border-neutral-400"&&this._orientation==="vertical"&&"mx-[-1px] mt-[-1px]")}"><slot name="media"></slot></div><div style="${this._orientation==="horizontal"?`width: var(--distribution-content, 100%); ${e?"width: var(--distribution-content, calc(100% - 2rem));":""}`:""}" class="${r("flex flex-col text-left",this._orientation==="horizontal"&&"flex flex-col",this._orientation==="vertical"&&e&&"m-4")}" part="content"><div class="flex flex-col-reverse"><div part="headline" class="${r("text-lg font-bold m-0",this.variant==="primary"?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div part="meta" class="${r("gap-2 mb-4",!s["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div></div><div part="main" class="${r(!s["teaser-has-default"]&&"hidden")}" aria-labelledby="media"><slot></slot></div></div></div>`}};t.styles=[...o.styles,l`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700;margin:var(--sd-spacing-0,0)!important}`],i([a({reflect:!0})],t.prototype,"variant",2),i([a({reflect:!0,type:Number})],t.prototype,"breakpoint",2),i([a({type:Boolean,reflect:!0})],t.prototype,"inset",2),i([m('[part="base"]')],t.prototype,"teaser",2),i([d()],t.prototype,"_orientation",2),t=i([h("sd-4-0-0-next-6-teaser")],t);export{t as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as h,c as m}from"./chunk.A3DKF5BY.js";import{a as d,d as c}from"./chunk.RQYP7MH5.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as n}from"./chunk.E2DRD2OX.js";import{a as w}from"./chunk.26YUWEYR.js";import{a as o}from"./chunk.DCOFYPWX.js";import{a as f,b as s,d as b,h as l}from"./chunk.APMDRZQD.js";import{b as p,e as r}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var y=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--top-right"}),v=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--bottom-center"}),t=class extends l{constructor(){super(...arguments);this.localize=new w(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now()}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await c(this.base),this.base.hidden=!1;let{keyframes:a,options:i}=m(this,"notification.show",{dir:this.localize.dir()});await d(this.base,a,i),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await c(this.base);let{keyframes:a,options:i}=m(this,"notification.hide",{dir:this.localize.dir()});await d(this.base,a,i),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,u(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,u(this,"sd-after-hide")}async toast(){return new Promise(a=>{let i=this.toastStack==="bottom-center"?v:y;i.parentElement===null&&document.body.append(i),i.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{i.removeChild(this),a(),i.querySelector("sd-4-0-0-next-
|
1
|
+
import{a as h,c as m}from"./chunk.A3DKF5BY.js";import{a as d,d as c}from"./chunk.RQYP7MH5.js";import{a as u}from"./chunk.KLRPP4NQ.js";import{a as n}from"./chunk.E2DRD2OX.js";import{a as w}from"./chunk.26YUWEYR.js";import{a as o}from"./chunk.DCOFYPWX.js";import{a as f,b as s,d as b,h as l}from"./chunk.APMDRZQD.js";import{b as p,e as r}from"./chunk.IRWHG2Q4.js";import{e}from"./chunk.TJOCV4DC.js";var y=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--top-right"}),v=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--bottom-center"}),t=class extends l{constructor(){super(...arguments);this.localize=new w(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now()}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await c(this.base),this.base.hidden=!1;let{keyframes:a,options:i}=m(this,"notification.show",{dir:this.localize.dir()});await d(this.base,a,i),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await c(this.base);let{keyframes:a,options:i}=m(this,"notification.hide",{dir:this.localize.dir()});await d(this.base,a,i),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,u(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,u(this,"sd-after-hide")}async toast(){return new Promise(a=>{let i=this.toastStack==="bottom-center"?v:y;i.parentElement===null&&document.body.append(i),i.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{i.removeChild(this),a(),i.querySelector("sd-4-0-0-next-6-notification")===null&&i.remove()},{once:!0})})}render(){return r`<div part="base" class="${o("w-full overflow-hidden flex items-stretch relative m-2")}" role="alert" id="notification" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}"><slot name="icon" part="icon" class="${o("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-4-0-0-next-6-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="system" class="h-6 w-6 text-white"></sd-4-0-0-next-6-icon></slot><div part="content" class="${o("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot part="message" class="block w-full pl-3 py-2" aria-live="polite"></slot>${this.closable?r`<sd-4-0-0-next-6-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-4-0-0-next-6-icon label="${this.localize.term("close")}" name="close" library="system" color="currentColor"></sd-4-0-0-next-6-icon></sd-4-0-0-next-6-button>`:""}</div>${this.durationIndicator?r`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${o("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute border border-neutral-400"></div>`:""}</div>`}};t.styles=[...l.styles,p`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],e([b('[part~="base"]')],t.prototype,"base",2),e([s({reflect:!0})],t.prototype,"variant",2),e([s({type:Boolean,reflect:!0})],t.prototype,"open",2),e([s({type:Boolean,reflect:!0})],t.prototype,"closable",2),e([s({type:Number})],t.prototype,"duration",2),e([s({type:Boolean,reflect:!0,attribute:"duration-indicator"})],t.prototype,"durationIndicator",2),e([s({reflect:!0,attribute:"toast-stack"})],t.prototype,"toastStack",2),e([n("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),e([n("duration")],t.prototype,"handleDurationChange",1),t=e([f("sd-4-0-0-next-6-notification")],t);h("notification.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}});h("notification.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});export{t as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as b}from"./chunk.U443X4TI.js";import{b as m}from"./chunk.5ZILM4TA.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as o}from"./chunk.DCOFYPWX.js";import{a as r,b as a,d as n,h as s}from"./chunk.APMDRZQD.js";import{b as d}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends s{constructor(){super(...arguments);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:i}=this;this.defaultSlot.assignedElements().filter(l=>l.tagName.toLowerCase()==="sd-4-0-0-next-
|
1
|
+
import{a as b}from"./chunk.U443X4TI.js";import{b as m}from"./chunk.5ZILM4TA.js";import{a as p}from"./chunk.E2DRD2OX.js";import{a as o}from"./chunk.DCOFYPWX.js";import{a as r,b as a,d as n,h as s}from"./chunk.APMDRZQD.js";import{b as d}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends s{constructor(){super(...arguments);this.disabled=!1;this.label=""}handleDisableOptions(){let{disabled:i}=this;this.defaultSlot.assignedElements().filter(l=>l.tagName.toLowerCase()==="sd-4-0-0-next-6-option").forEach(l=>{l.disabled=i})}handleDisabledChange(){this.handleDisableOptions()}render(){let{disabled:i}=this;return m`<div role="${i?"presentation":"group"}" class="${o(this.disabled?"text-neutral-500":"")}" part="base" aria-labelledby="group-label"><sd-4-0-0-next-6-divider id="divider" class="pt-2 pb-4" part="divider"></sd-4-0-0-next-6-divider><div part="label-container" class="${o(this.disabled?"text-neutral-500":"text-black")} px-4 font-bold text-left" role="presentation" id="group-label"><slot name="label"><span>${this.label}</span></slot></div><div role="group" part="options"><slot @slotchange="${this.handleDisableOptions}"></slot></div></div>`}};e.dependencies={"sd-4-0-0-next-6-divider":b},e.styles=[...s.styles,d`:host{--display-divider:block}#divider{display:var(--display-divider)}`],t([n("slot:not([name])")],e.prototype,"defaultSlot",2),t([a({reflect:!0,type:Boolean})],e.prototype,"disabled",2),t([a()],e.prototype,"label",2),t([p("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),e=t([r("sd-4-0-0-next-6-optgroup")],e);export{e as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as b}from"./chunk.6HO6CE4A.js";import{a as v}from"./chunk.26YUWEYR.js";import{a}from"./chunk.DCOFYPWX.js";import{a as f,b as l,c as d,d as h,h as p}from"./chunk.APMDRZQD.js";import{b as m,e as s}from"./chunk.IRWHG2Q4.js";import{a as u}from"./chunk.WNP2V63C.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends p{constructor(){super();this.localize=new v(this);this.hasSlotController=new b(this,"transcript");this.reversedLayout=!1;this.hideTimestamps=!1;this.animated=!1;this.inverted=!1;this.speed=1;this.currentTime=this.formatTime(0);this.duration="";this.isPlaying=!1;this.isMuted=!1;this.progress=0;this.setAudioProgress=()=>{this.progressSlider.max=Math.floor(this.audioElement.duration).toString()};this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),this.audioElement.playbackRate=this.speed,this.animated&&this.initAnimation())}updated(e){if(e.has("animated")){let r=e.get("animated");!r&&this.animated?this.initAnimation():r&&!this.animated&&this.clear()}}get audioElement(){let e=this.shadowRoot.querySelector("slot");return(e==null?void 0:e.assignedElements().length)>0?e.assignedElements()[0]:null}updateCurrentTime(){if(!this.audioElement)return;let e=this.audioElement.currentTime;this.currentTime=this.formatTime(e),this.progress=Math.floor(e),this.progressSlider&&(this.progressSlider.value=this.progress.toString())}updateAudioDuration(){if(this.audioElement){if(isNaN(this.audioElement.duration)){setTimeout(()=>{this.updateAudioDuration()},100);return}this.duration=this.formatTime(this.audioElement.duration),this.setAudioProgress()}}playAudio(){this.audioElement&&(this.isPlaying=!0,this.audioElement.play(),this.emit("sd-playback-start"),this.animated&&this.draw())}pauseAudio(){this.audioElement&&(this.isPlaying=!1,this.audioElement.pause(),this.emit("sd-playback-pause"),this.animated&&this.stopAnimation())}handleAudioEnd(){this.emit("sd-playback-end"),this.isPlaying=!1,this.progress=0,this.progressSlider.value="0",this.currentTime=this.formatTime(0),this.animated&&this.stopAnimation()}toggleMute(){this.audioElement&&(this.isMuted=!this.isMuted,this.isMuted?(this.emit("sd-playback-mute"),this.audioElement.muted=!0):(this.emit("sd-playback-unmute"),this.audioElement.muted=!1))}toggleMuteKeydown(e){e.key==="Enter"&&(e.preventDefault(),this.toggleMute())}togglePlaybackSpeed(){this.audioElement&&(this.emit("sd-playback-speed"),this.speed=this.speed===1.5?1:this.speed+.25,this.audioElement.playbackRate=this.speed)}togglePlaybackSpeedKeydown(e){e.key==="Enter"&&(e.preventDefault(),this.togglePlaybackSpeed())}formatTime(e){let r=Math.floor(e/60),o=Math.floor(e%60);return`${r}:${o<10?"0":""}${o}`}handleAudioProgress(){if(!this.audioElement)return;let e=Number(this.progressSlider.value);this.audioElement.currentTime=e,this.progress=e,this.currentTime=this.formatTime(e)}handleAudioProgressKeydown(e){e.key==="ArrowRight"&&(this.progressSlider.value=(Number(this.progressSlider.value)+1).toString(),this.handleAudioProgress()),e.key==="ArrowLeft"&&(this.progressSlider.value=(Number(this.progressSlider.value)-1).toString(),this.handleAudioProgress())}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0}showTranscriptKeydown(e){(e.key==="Enter"||e.key===" ")&&this.showTranscript()}rgbToHex(e){let r=e.match(/\d+/g);if(r&&r.length===3){let o=parseInt(r[0]),n=parseInt(r[1]),g=parseInt(r[2]),c=y=>y.toString(16).padStart(2,"0");return`#${c(o)}${c(n)}${c(g)}`.toUpperCase()}return null}initAnimation(){this.context=this.canvas.getContext("2d");let e=this.audioPlayerContainer.querySelector(".playback-speed"),o=window.getComputedStyle(e).color,n;this.inverted?n="#FFFFFF33":n=this.rgbToHex(o)+"33",this.waveList=[new u({canvas:this.canvas,color:n,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:1.5,amplitude:150,frequency:.01,damping:1})],this.animated&&this.drawStillWaves()}drawStillWaves(){this.waveList.forEach(e=>{e.redraw()})}stopAnimation(){this.isPlaying=!1}clear(){!this.context||!this.canvas||this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}async draw(){!this.isPlaying||!this.animated||(this.clear(),this.waveList.forEach(e=>{e.redraw()}),await new Promise(e=>{setTimeout(e,1e3/30)}),await this.draw())}render(){let e=this.audioElement?this.progress/this.audioElement.duration*100:0,r=s`<div class="${a("controls grid grid-cols-3 justify-items-center items-center",!this.animated&&"relative",this.animated&&!this.reversedLayout&&"absolute -top-4 left-0 w-full",this.reversedLayout?"mt-2":"mb-2")}" part="audio-controls"><button class="${a("playback-speed justify-self-start text-base font-bold hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.localize.term("playbackSpeed")}" tabindex="0" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-4-0-0-next-5-button ?inverted="${!!this.inverted}" part="play-button" size="lg" @click="${this.isPlaying?this.pauseAudio:this.playAudio}" aria-label="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" class="text-3xl">${this.isPlaying?s`<slot name="pause-icon"><sd-4-0-0-next-5-icon class="text-3xl" name="pause" library="system"></sd-4-0-0-next-5-icon></slot>`:s`<slot name="play-icon"><sd-4-0-0-next-5-icon class="text-3xl" name="start" library="system"></sd-4-0-0-next-5-icon></slot>`}</sd-4-0-0-next-5-button><div class="flex items-center justify-self-end">${this.hasSlotController.test("transcript")?s`<button class="${a("mr-6 w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" tab-index="0"><sd-4-0-0-next-5-icon class="w-6 h-6" name="transcript" library="system" label="${this.isMuted?this.localize.term("unmute"):this.localize.term("mute")}"></sd-4-0-0-next-5-icon></button>`:null} <button class="${a("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" part="volume" aria-label="${this.localize.term("mute")}" tabindex="0" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-4-0-0-next-5-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="system"></sd-4-0-0-next-5-icon></button></div></div>`,o=s`<div class="${a("w-full flex justify-between",this.reversedLayout?"mb-2":"mt-2",this.animated&&this.reversedLayout&&"absolute bottom-0 left-0 mb-2",this.animated&&!this.reversedLayout&&"mt-2")}" part="timestamps"><div class="${a("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.currentTime}</div><div class="${a("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.duration}</div></div>`;return s`<div class="${a("w-full flex relative",this.reversedLayout?"flex-col-reverse":"flex-col")}" aria-label="${this.localize.term("audioPlayer")}" part="audio-player"><slot @slotchange="${this.updateAudioDuration}"></slot>${!this.animated||this.animated&&this.reversedLayout?r:null}<div class="relative">${this.animated&&!this.reversedLayout?s`${r}`:null} ${this.animated?s`<canvas class="w-full h-16"></canvas>`:null} ${!this.hideTimestamps&&this.animated&&this.reversedLayout?o:null} <input class="${a("progress-slider bg-primary appearance-none w-full cursor-pointer outline-none h-1 flex items-center sd-interactive",this.inverted&&"sd-interactive--inverted")}" type="range" max="100" step="0.001" value="${this.progress}" tabindex="0" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" part="progress-slider" style="background:linear-gradient(to right,${this.inverted?"rgb(var(--sd-color-white, 255 255 255) / 1)":"rgb(var(--sd-color-primary, 0 53 142) / 1)"} ${e}%,${this.animated?"transparent":this.inverted?"rgb(var(--sd-color-primary-400, 153 171 208) / 1)":"rgb(var(--sd-color-grey-400, 195 195 195) / 1)"} ${e}%)"></div>${this.hasSlotController.test("transcript")?s`<sd-4-0-0-next-5-drawer><slot name="transcript"></slot></sd-4-0-0-next-5-drawer>`:null} ${!this.hideTimestamps&&(!this.animated||!this.reversedLayout)?o:null}</div>`}};t.styles=[...p.styles,m`.progress-slider:focus-visible{outline:2px solid transparent;outline-offset:2px}.progress-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border-radius:var(--sd-border-radius-full,9999px);border-style:none;height:var(--sd-spacing-4,1rem);transition-duration:.2s;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:var(--sd-spacing-4,1rem)}.progress-slider:focus-visible::-webkit-slider-thumb{outline-offset:2px;outline-style:solid}.progress-slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border-radius:var(--sd-border-radius-full,9999px);border-style:none;height:var(--sd-spacing-4,1rem);transition-duration:.2s;-moz-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:var(--sd-spacing-4,1rem)}.progress-slider:focus-visible::-moz-range-thumb{outline-offset:2px;outline-style:solid}sd-4-0-0-next-5-button::part(base){align-items:center;border-radius:var(--sd-border-radius-full,9999px);display:flex;height:var(--sd-spacing-16,4rem);justify-content:center;width:var(--sd-spacing-16,4rem)}sd-4-0-0-next-5-button::part(label){align-items:center;display:flex;flex-grow:0}`],i([l({type:Boolean,reflect:!0,attribute:"reversed-layout"})],t.prototype,"reversedLayout",2),i([l({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],t.prototype,"hideTimestamps",2),i([l({type:Boolean,reflect:!0})],t.prototype,"animated",2),i([l({type:Boolean,reflect:!0})],t.prototype,"inverted",2),i([l({type:Number})],t.prototype,"speed",2),i([d()],t.prototype,"currentTime",2),i([d()],t.prototype,"duration",2),i([d()],t.prototype,"isPlaying",2),i([d()],t.prototype,"isMuted",2),i([d()],t.prototype,"progress",2),i([h('[part="progress-slider"]')],t.prototype,"progressSlider",2),i([h('[part="audio-player"]')],t.prototype,"audioPlayerContainer",2),i([h("sd-4-0-0-next-5-drawer")],t.prototype,"drawer",2),i([h("canvas")],t.prototype,"canvas",2),t=i([f("sd-4-0-0-next-5-audio")],t);export{t as a};
|
1
|
+
import{a as b}from"./chunk.6HO6CE4A.js";import{a as v}from"./chunk.26YUWEYR.js";import{a}from"./chunk.DCOFYPWX.js";import{a as f,b as l,c as d,d as h,h as p}from"./chunk.APMDRZQD.js";import{b as m,e as s}from"./chunk.IRWHG2Q4.js";import{a as u}from"./chunk.WNP2V63C.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends p{constructor(){super();this.localize=new v(this);this.hasSlotController=new b(this,"transcript");this.reversedLayout=!1;this.hideTimestamps=!1;this.animated=!1;this.inverted=!1;this.speed=1;this.currentTime=this.formatTime(0);this.duration="";this.isPlaying=!1;this.isMuted=!1;this.progress=0;this.setAudioProgress=()=>{this.progressSlider.max=Math.floor(this.audioElement.duration).toString()};this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),this.audioElement.playbackRate=this.speed,this.animated&&this.initAnimation())}updated(e){if(e.has("animated")){let r=e.get("animated");!r&&this.animated?this.initAnimation():r&&!this.animated&&this.clear()}}get audioElement(){let e=this.shadowRoot.querySelector("slot");return(e==null?void 0:e.assignedElements().length)>0?e.assignedElements()[0]:null}updateCurrentTime(){if(!this.audioElement)return;let e=this.audioElement.currentTime;this.currentTime=this.formatTime(e),this.progress=Math.floor(e),this.progressSlider&&(this.progressSlider.value=this.progress.toString())}updateAudioDuration(){if(this.audioElement){if(isNaN(this.audioElement.duration)){setTimeout(()=>{this.updateAudioDuration()},100);return}this.duration=this.formatTime(this.audioElement.duration),this.setAudioProgress()}}playAudio(){this.audioElement&&(this.isPlaying=!0,this.audioElement.play(),this.emit("sd-playback-start"),this.animated&&this.draw())}pauseAudio(){this.audioElement&&(this.isPlaying=!1,this.audioElement.pause(),this.emit("sd-playback-pause"),this.animated&&this.stopAnimation())}handleAudioEnd(){this.emit("sd-playback-end"),this.isPlaying=!1,this.progress=0,this.progressSlider.value="0",this.currentTime=this.formatTime(0),this.animated&&this.stopAnimation()}toggleMute(){this.audioElement&&(this.isMuted=!this.isMuted,this.isMuted?(this.emit("sd-playback-mute"),this.audioElement.muted=!0):(this.emit("sd-playback-unmute"),this.audioElement.muted=!1))}toggleMuteKeydown(e){e.key==="Enter"&&(e.preventDefault(),this.toggleMute())}togglePlaybackSpeed(){this.audioElement&&(this.emit("sd-playback-speed"),this.speed=this.speed===1.5?1:this.speed+.25,this.audioElement.playbackRate=this.speed)}togglePlaybackSpeedKeydown(e){e.key==="Enter"&&(e.preventDefault(),this.togglePlaybackSpeed())}formatTime(e){let r=Math.floor(e/60),o=Math.floor(e%60);return`${r}:${o<10?"0":""}${o}`}handleAudioProgress(){if(!this.audioElement)return;let e=Number(this.progressSlider.value);this.audioElement.currentTime=e,this.progress=e,this.currentTime=this.formatTime(e)}handleAudioProgressKeydown(e){e.key==="ArrowRight"&&(this.progressSlider.value=(Number(this.progressSlider.value)+1).toString(),this.handleAudioProgress()),e.key==="ArrowLeft"&&(this.progressSlider.value=(Number(this.progressSlider.value)-1).toString(),this.handleAudioProgress())}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0}showTranscriptKeydown(e){(e.key==="Enter"||e.key===" ")&&this.showTranscript()}rgbToHex(e){let r=e.match(/\d+/g);if(r&&r.length===3){let o=parseInt(r[0]),n=parseInt(r[1]),g=parseInt(r[2]),c=y=>y.toString(16).padStart(2,"0");return`#${c(o)}${c(n)}${c(g)}`.toUpperCase()}return null}initAnimation(){this.context=this.canvas.getContext("2d");let e=this.audioPlayerContainer.querySelector(".playback-speed"),o=window.getComputedStyle(e).color,n;this.inverted?n="#FFFFFF33":n=this.rgbToHex(o)+"33",this.waveList=[new u({canvas:this.canvas,color:n,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new u({canvas:this.canvas,color:n,phase:180,shift:1.5,amplitude:150,frequency:.01,damping:1})],this.animated&&this.drawStillWaves()}drawStillWaves(){this.waveList.forEach(e=>{e.redraw()})}stopAnimation(){this.isPlaying=!1}clear(){!this.context||!this.canvas||this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}async draw(){!this.isPlaying||!this.animated||(this.clear(),this.waveList.forEach(e=>{e.redraw()}),await new Promise(e=>{setTimeout(e,1e3/30)}),await this.draw())}render(){let e=this.audioElement?this.progress/this.audioElement.duration*100:0,r=s`<div class="${a("controls grid grid-cols-3 justify-items-center items-center",!this.animated&&"relative",this.animated&&!this.reversedLayout&&"absolute -top-4 left-0 w-full",this.reversedLayout?"mt-2":"mb-2")}" part="audio-controls"><button class="${a("playback-speed justify-self-start text-base font-bold hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.localize.term("playbackSpeed")}" tabindex="0" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-4-0-0-next-6-button ?inverted="${!!this.inverted}" part="play-button" size="lg" @click="${this.isPlaying?this.pauseAudio:this.playAudio}" aria-label="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" class="text-3xl">${this.isPlaying?s`<slot name="pause-icon"><sd-4-0-0-next-6-icon class="text-3xl" name="pause" library="system"></sd-4-0-0-next-6-icon></slot>`:s`<slot name="play-icon"><sd-4-0-0-next-6-icon class="text-3xl" name="start" library="system"></sd-4-0-0-next-6-icon></slot>`}</sd-4-0-0-next-6-button><div class="flex items-center justify-self-end">${this.hasSlotController.test("transcript")?s`<button class="${a("mr-6 w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" tab-index="0"><sd-4-0-0-next-6-icon class="w-6 h-6" name="transcript" library="system" label="${this.isMuted?this.localize.term("unmute"):this.localize.term("mute")}"></sd-4-0-0-next-6-icon></button>`:null} <button class="${a("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" part="volume" aria-label="${this.localize.term("mute")}" tabindex="0" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-4-0-0-next-6-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="system"></sd-4-0-0-next-6-icon></button></div></div>`,o=s`<div class="${a("w-full flex justify-between",this.reversedLayout?"mb-2":"mt-2",this.animated&&this.reversedLayout&&"absolute bottom-0 left-0 mb-2",this.animated&&!this.reversedLayout&&"mt-2")}" part="timestamps"><div class="${a("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.currentTime}</div><div class="${a("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.duration}</div></div>`;return s`<div class="${a("w-full flex relative",this.reversedLayout?"flex-col-reverse":"flex-col")}" aria-label="${this.localize.term("audioPlayer")}" part="audio-player"><slot @slotchange="${this.updateAudioDuration}"></slot>${!this.animated||this.animated&&this.reversedLayout?r:null}<div class="relative">${this.animated&&!this.reversedLayout?s`${r}`:null} ${this.animated?s`<canvas class="w-full h-16"></canvas>`:null} ${!this.hideTimestamps&&this.animated&&this.reversedLayout?o:null} <input class="${a("progress-slider bg-primary appearance-none w-full cursor-pointer outline-none h-1 flex items-center sd-interactive",this.inverted&&"sd-interactive--inverted")}" type="range" max="100" step="0.001" value="${this.progress}" tabindex="0" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" part="progress-slider" style="background:linear-gradient(to right,${this.inverted?"rgb(var(--sd-color-white, 255 255 255) / 1)":"rgb(var(--sd-color-primary, 0 53 142) / 1)"} ${e}%,${this.animated?"transparent":this.inverted?"rgb(var(--sd-color-primary-400, 153 171 208) / 1)":"rgb(var(--sd-color-grey-400, 195 195 195) / 1)"} ${e}%)"></div>${this.hasSlotController.test("transcript")?s`<sd-4-0-0-next-6-drawer><slot name="transcript"></slot></sd-4-0-0-next-6-drawer>`:null} ${!this.hideTimestamps&&(!this.animated||!this.reversedLayout)?o:null}</div>`}};t.styles=[...p.styles,m`.progress-slider:focus-visible{outline:2px solid transparent;outline-offset:2px}.progress-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:currentColor;border-radius:var(--sd-border-radius-full,9999px);border-style:none;height:var(--sd-spacing-4,1rem);transition-duration:.2s;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:var(--sd-spacing-4,1rem)}.progress-slider:focus-visible::-webkit-slider-thumb{outline-offset:2px;outline-style:solid}.progress-slider::-moz-range-thumb{-moz-appearance:none;appearance:none;background-color:currentColor;border-radius:var(--sd-border-radius-full,9999px);border-style:none;height:var(--sd-spacing-4,1rem);transition-duration:.2s;-moz-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);width:var(--sd-spacing-4,1rem)}.progress-slider:focus-visible::-moz-range-thumb{outline-offset:2px;outline-style:solid}sd-4-0-0-next-6-button::part(base){align-items:center;border-radius:var(--sd-border-radius-full,9999px);display:flex;height:var(--sd-spacing-16,4rem);justify-content:center;width:var(--sd-spacing-16,4rem)}sd-4-0-0-next-6-button::part(label){align-items:center;display:flex;flex-grow:0}`],i([l({type:Boolean,reflect:!0,attribute:"reversed-layout"})],t.prototype,"reversedLayout",2),i([l({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],t.prototype,"hideTimestamps",2),i([l({type:Boolean,reflect:!0})],t.prototype,"animated",2),i([l({type:Boolean,reflect:!0})],t.prototype,"inverted",2),i([l({type:Number})],t.prototype,"speed",2),i([d()],t.prototype,"currentTime",2),i([d()],t.prototype,"duration",2),i([d()],t.prototype,"isPlaying",2),i([d()],t.prototype,"isMuted",2),i([d()],t.prototype,"progress",2),i([h('[part="progress-slider"]')],t.prototype,"progressSlider",2),i([h('[part="audio-player"]')],t.prototype,"audioPlayerContainer",2),i([h("sd-4-0-0-next-6-drawer")],t.prototype,"drawer",2),i([h("canvas")],t.prototype,"canvas",2),t=i([f("sd-4-0-0-next-6-audio")],t);export{t as a};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import{a as T}from"./chunk.CBQWVOOS.js";import{a as k}from"./chunk.EUGX6XW6.js";import{a as _}from"./chunk.7RJ3O2FV.js";import{c as M}from"./chunk.RQYP7MH5.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as $}from"./chunk.26YUWEYR.js";import{a as n}from"./chunk.DCOFYPWX.js";import{a as E,b as g,c as f,d as v,e as A,h as P}from"./chunk.APMDRZQD.js";import{b as S,e as b}from"./chunk.IRWHG2Q4.js";import{e as o}from"./chunk.TJOCV4DC.js";function C(h,d,e){let i=t=>Object.is(t,-0)?0:t;return h<d?i(d):h>e?i(e):i(h)}function*L(h,d){if(h!==void 0){let e=0;for(let i of h)yield d(i,e++)}}function*O(h,d,e=1){let i=d===void 0?0:h;d!=null||(d=h);for(let t=i;e>0?t<d:d<t;t+=e)yield t}var r=class extends P{constructor(){super(...arguments);this.variant="number";this.inverted=!1;this.loop=!1;this.autoplay=!1;this.slidesPerPage=1;this.slidesPerMove=1;this.activeSlide=0;this.currentPage=1;this.pausedAutoplay=!1;this.autoplayController=new T(this,()=>this.next());this.scrollController=new k(this);this.slides=this.getElementsByTagName("sd-4-0-0-next-
|
1
|
+
import{a as T}from"./chunk.CBQWVOOS.js";import{a as k}from"./chunk.EUGX6XW6.js";import{a as _}from"./chunk.7RJ3O2FV.js";import{c as M}from"./chunk.RQYP7MH5.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as $}from"./chunk.26YUWEYR.js";import{a as n}from"./chunk.DCOFYPWX.js";import{a as E,b as g,c as f,d as v,e as A,h as P}from"./chunk.APMDRZQD.js";import{b as S,e as b}from"./chunk.IRWHG2Q4.js";import{e as o}from"./chunk.TJOCV4DC.js";function C(h,d,e){let i=t=>Object.is(t,-0)?0:t;return h<d?i(d):h>e?i(e):i(h)}function*L(h,d){if(h!==void 0){let e=0;for(let i of h)yield d(i,e++)}}function*O(h,d,e=1){let i=d===void 0?0:h;d!=null||(d=h);for(let t=i;e>0?t<d:d<t;t+=e)yield t}var r=class extends P{constructor(){super(...arguments);this.variant="number";this.inverted=!1;this.loop=!1;this.autoplay=!1;this.slidesPerPage=1;this.slidesPerMove=1;this.activeSlide=0;this.currentPage=1;this.pausedAutoplay=!1;this.autoplayController=new T(this,()=>this.next());this.scrollController=new k(this);this.slides=this.getElementsByTagName("sd-4-0-0-next-6-carousel-item");this.intersectionObserverEntries=new Map;this.localize=new $(this);this.handleSlotChange=e=>{e.some(t=>[...t.addedNodes,...t.removedNodes].some(s=>_.isCarouselItem(s)&&!s.hasAttribute("data-clone")))&&this.initializeSlides(),this.requestUpdate()};this.unblockAutoplay=(e,i)=>{e.detail&&i.blur()}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-label",this.localize.term("carousel"));let e=new IntersectionObserver(i=>{i.forEach(t=>{this.intersectionObserverEntries.set(t.target,t);let s=t.target;s.toggleAttribute("inert",!t.isIntersecting),s.classList.toggle("--in-view",t.isIntersecting),s.setAttribute("aria-hidden",t.isIntersecting?"false":"true")})},{root:this,threshold:.6});this.intersectionObserver=e,e.takeRecords().forEach(i=>{this.intersectionObserverEntries.set(i.target,i)})}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(){this.initializeSlides(),this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!1})}getPageCount(e,i,t){return Math.ceil((e-i)/t)+1>0?Math.ceil((e-i)/t)+1:1}getCurrentPage(e,i,t,s){return Math.ceil((e-t)/s)-Math.ceil((e-t-i)/s)+1}getSlides({excludeClones:e=!0}={}){return[...this.slides].filter(i=>!e||!i.hasAttribute("data-clone"))}handleKeyDown(e){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){let i=e.target,t=this.localize.dir()==="rtl",s=i.closest('[part~="pagination-item"]')!==null,l=e.key==="ArrowDown"||!t&&e.key==="ArrowRight"||t&&e.key==="ArrowLeft",c=e.key==="ArrowUp"||!t&&e.key==="ArrowLeft"||t&&e.key==="ArrowRight";e.preventDefault(),c&&this.previous(),l&&this.next(),e.key==="Home"&&this.goToSlide(0),e.key==="End"&&this.goToSlide(this.getSlides().length-1),s&&this.updateComplete.then(()=>{var a;let u=(a=this.shadowRoot)==null?void 0:a.querySelector('[part~="pagination-item--active"]');u&&u.focus()})}}handleScrollEnd(){let e=this.getSlides(),t=[...this.intersectionObserverEntries.values()].find(s=>s.isIntersecting);if(this.loop&&(t!=null&&t.target.hasAttribute("data-clone"))){let s=Number(t.target.getAttribute("data-clone"));this.goToSlide(s,"auto");return}t&&(this.activeSlide=e.indexOf(t.target))}pause(){this.pausedAutoplay=!0}resume(){this.pausedAutoplay=!1}handlePausedAutoplay(){var e,i;this.pausedAutoplay?(this.autoplayController.stop(),(e=this.autoplayControls)==null||e.setAttribute("aria-pressed","false")):this.autoplay&&(this.autoplayController.start(3e3),(i=this.autoplayControls)==null||i.setAttribute("aria-pressed","true"))}initializeSlides(){let e=this.getSlides(),i=this.intersectionObserver;if(this.intersectionObserverEntries.clear(),this.getSlides({excludeClones:!1}).forEach((t,s)=>{i.unobserve(t),t.classList.remove("--in-view"),t.classList.remove("--is-active"),t.setAttribute("aria-label",this.localize.term("slideNum",s+1,e.length)),t.hasAttribute("data-clone")&&t.remove()}),this.loop){let t=this.slidesPerPage,s=e.slice(-t),l=e.slice(0,t);s.reverse().forEach((c,u)=>{let a=c.cloneNode(!0);a.setAttribute("data-clone",String(e.length-u-1)),this.prepend(a)}),l.forEach((c,u)=>{let a=c.cloneNode(!0);a.setAttribute("data-clone",String(u)),this.append(a)})}this.getSlides({excludeClones:!1}).forEach(t=>{i.observe(t)}),this.goToSlide(this.activeSlide,"auto")}handleSlideChange(){let e=this.getSlides();e.forEach((s,l)=>{s.classList.toggle("--is-active",l===this.activeSlide)});let i=this.getCurrentPage(e.length,this.activeSlide,this.slidesPerPage,this.slidesPerMove);this.currentPage!==i&&(this.currentPage=i),this.hasUpdated&&this.emit("sd-slide-change",{detail:{index:this.activeSlide,slide:e[this.activeSlide]}});let t=this.getPageCount(e.length,this.slidesPerPage,this.slidesPerMove);this.currentPage>t&&requestAnimationFrame(()=>{this.nextTillFirst()})}handleSlidesPerMoveChange(){let e=this.getSlides({excludeClones:!1}),i=this.slidesPerMove;e.forEach((t,s)=>{Math.abs(s-i)%i===0?t.style.removeProperty("scroll-snap-align"):t.style.setProperty("scroll-snap-align","none")})}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&!this.pausedAutoplay&&this.autoplayController.start(3e3)}previous(e="smooth"){let i=this.activeSlide||this.activeSlide-this.slidesPerMove,t=!1;for(;!t&&i>0;)i-=1,t=Math.abs(i-this.slidesPerMove)%this.slidesPerMove===0;this.currentPage-1===0&&this.loop?this.goToSlide(this.activeSlide-this.slidesPerPage,e):this.goToSlide(i,e)}next(e="smooth"){this.currentPage+1<=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove)?this.goToSlide(this.activeSlide+this.slidesPerMove,e):this.loop&&this.nextTillFirst(e)}nextTillFirst(e="smooth"){for(;this.activeSlide!==0;)this.goToSlide(this.activeSlide+1,e);this.currentPage=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove)}goToSlide(e,i="smooth"){let{slidesPerPage:t,loop:s,scrollContainer:l}=this,c=this.getSlides(),u=this.getSlides({excludeClones:!1}),a=(e+c.length)%c.length;this.activeSlide=a;let p=C(e+(s?t:0),0,u.length+1),y=u[p],w=l.getBoundingClientRect(),x=y.getBoundingClientRect();l.scrollTo({left:x.left-w.left+l.scrollLeft,top:x.top-w.top+l.scrollTop,behavior:M()?"auto":i}),this.activeSlide===c.length-1&&!this.loop?this.previousButton.focus({preventScroll:!0}):this.activeSlide===0&&!this.loop&&this.nextButton.focus({preventScroll:!0})}render(){let{scrollController:e,slidesPerMove:i}=this,t=this.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove),s=this.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove),l=this.loop||s>1,c=this.loop||s<t,u=this.localize.dir()==="ltr";return b`<div part="base" class="${n("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${n(`carousel__slides mb-6
|
2
2
|
grid max-h-full w-full items-center justify-items-center overflow-auto`,this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",`overscroll-x-contain grid-flow-col auto-rows-[100%]
|
3
|
-
snap-x snap-mandatory overflow-y-hidden`)}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" role="status" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${n("w-full flex items-center justify-center relative")}"><div part="navigation" class="${n("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!l}" class="${n("!mr-6 !rounded-sm sd-interactive",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-4-0-0-next-
|
3
|
+
snap-x snap-mandatory overflow-y-hidden`)}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" role="status" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${n("w-full flex items-center justify-center relative")}"><div part="navigation" class="${n("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!l}" class="${n("!mr-6 !rounded-sm sd-interactive",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @click="${l?a=>{this.previous(),this.unblockAutoplay(a,this.previousButton)}:null}"><slot name="previous-icon"><sd-4-0-0-next-6-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${u?"chevron-down":"chevron-up"}"></sd-4-0-0-next-6-icon></slot></button> ${this.variant==="dot"?b`<div part="pagination-dot" role="tablist" class="${n("carousel__pagination dot flex wrap items-center gap-2")}" aria-controls="scroll-container">${L(O(t),a=>{let p=a+1===s;return b`<button part="pagination-item ${p?"pagination-item--active":""}" class="${n("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",p?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${p?"true":"false"}" aria-label="${this.localize.term("goToSlide",a+1,t)}" @click="${y=>{this.goToSlide(a*i),this.unblockAutoplay(y,this.paginationItems[a])}}" @keydown="${this.handleKeyDown}"><span class="${n("h-4 w-4 block border hover:border-primary-500 rounded-full",this.inverted?"border-white hover:border-primary-500":"border-primary",p&&"bg-accent border-none",p?this.inverted?"hover:bg-accent-300":"hover:bg-accent-550":"")}"></span></button>`})}</div>`:b`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${n("w-5 text-center border-b-2 border-accent",this.inverted?"text-white":"text-black")}">${s}</span> <span part="pagination-divider" class="${n("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${n("w-5 text-center",this.inverted?"text-white":"text-black")}">${t}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!c}" class="${n("!ml-6 !rounded-sm sd-interactive ",!c&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${c?"false":"true"}" @click="${c?a=>{this.next(),this.unblockAutoplay(a,this.nextButton)}:null}"><slot name="next-icon"><sd-4-0-0-next-6-icon class="${n("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${u?"chevron-up":"chevron-down"}"></sd-4-0-0-next-6-icon></slot></button></div><button class="${n("ml-6 !rounded-sm","!absolute !right-0 sd-interactive",this.inverted?"sd-interactive--inverted":"sd-interactive--reset",!this.autoplay&&"!hidden")}" part="autoplay-controls" aria-label="${this.localize.term("autoplay")}" aria-pressed="true" @click="${a=>{this.pausedAutoplay=!this.pausedAutoplay,a.detail&&this.autoplayControls.blur()}}"><slot name="autoplay-start" class="${n(this.pausedAutoplay?"":"hidden")}"><sd-4-0-0-next-6-icon class="h-6 w-6 grid place-items-center" library="system" name="start"></sd-4-0-0-next-6-icon></slot><slot name="autoplay-pause" class="${n(this.pausedAutoplay?"hidden":"")}"><sd-4-0-0-next-6-icon class="h-6 w-6 grid place-items-center" library="system" name="pause"></sd-4-0-0-next-6-icon></slot></button></div></div>`}};r.styles=[...P.styles,S`:host{--slide-gap:var(--sl-spacing-medium,1rem);--scroll-hint:0px;display:flex}.carousel{grid-template-areas:". slides ." ". pagination ."}.carousel__pagination{grid-area:pagination}.carousel__slides{grid-area:slides;scrollbar-width:none;--slide-size:calc((100% - (var(--slides-per-page) - 1)*var(--slide-gap))/var(--slides-per-page));-moz-column-gap:var(--slide-gap);column-gap:var(--slide-gap);grid-auto-columns:var(--slide-size);padding-inline:var(--scroll-hint);scroll-padding-inline:var(--scroll-hint)}.carousel__slides::-webkit-scrollbar{display:none}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__navigation{grid-area:navigation}sd-4-0-0-next-6-button::part(label){align-items:center;display:flex;flex:1 1 auto;pointer-events:none}`],o([v('[part~="autoplay-controls"]')],r.prototype,"autoplayControls",2),o([v('[part~="navigation-button--previous"]')],r.prototype,"previousButton",2),o([v('[part~="navigation-button--next"]')],r.prototype,"nextButton",2),o([A('[part~="pagination-item"]')],r.prototype,"paginationItems",2),o([g({type:String,reflect:!0})],r.prototype,"variant",2),o([g({type:Boolean,reflect:!0})],r.prototype,"inverted",2),o([g({type:Boolean,reflect:!0})],r.prototype,"loop",2),o([g({type:Boolean,reflect:!0})],r.prototype,"autoplay",2),o([g({type:Number,attribute:"slides-per-page"})],r.prototype,"slidesPerPage",2),o([g({type:Number,attribute:"slides-per-move"})],r.prototype,"slidesPerMove",2),o([v("slot:not([name])")],r.prototype,"defaultSlot",2),o([v(".carousel__slides")],r.prototype,"scrollContainer",2),o([v(".carousel__pagination")],r.prototype,"paginationContainer",2),o([f()],r.prototype,"activeSlide",2),o([f()],r.prototype,"currentPage",2),o([f()],r.prototype,"pausedAutoplay",2),o([m("pausedAutoplay")],r.prototype,"handlePausedAutoplay",1),o([m("loop",{waitUntilFirstUpdate:!0}),m("slidesPerPage",{waitUntilFirstUpdate:!0})],r.prototype,"initializeSlides",1),o([m("activeSlide")],r.prototype,"handleSlideChange",1),o([m("slidesPerMove")],r.prototype,"handleSlidesPerMoveChange",1),o([m("autoplay")],r.prototype,"handleAutoplayChange",1),r=o([E("sd-4-0-0-next-6-carousel")],r);export{r as a};
|
4
4
|
/*! Bundled license information:
|
5
5
|
|
6
6
|
lit-html/directives/map.js:
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import{b as f}from"./chunk.5CK64GWQ.js";import{a as m}from"./chunk.D7TMPF3D.js";import{b as c}from"./chunk.65NSSTJE.js";import{a as p}from"./chunk.HE2LNCWW.js";import{a}from"./chunk.E2DRD2OX.js";import{a as r}from"./chunk.DCOFYPWX.js";import{a as h,b as l,c as u,d as o,h as s}from"./chunk.APMDRZQD.js";import{b as n,e as d}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends s{constructor(){super(...arguments);this.formControlController=new c(this,{value:i=>i.checked?i.value||"on":void 0,defaultValue:i=>i.defaultChecked,setValue:(i,b)=>i.checked=b});this.showInvalidStyle=!1;this.title="";this.name="";this.disabled=!1;this.checked=!1;this.defaultChecked=!1;this.form="";this.required=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(i){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(i),this.invalidMessage.textContent=i.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}click(){this.input.click()}focus(i){this.input.focus(i)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(i){this.input.setCustomValidity(i),this.formControlController.updateValidity()}render(){return d`<label part="base" class="${r("group flex items-center text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed")}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" role="switch" title="${this.title}" name="${this.name}" value="${p(this.value)}" .checked="${f(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" aria-invalid="${this.showInvalidStyle}" aria-describedby="invalid-message" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"}" class="${r(`relative flex flex-initial items-center justify-center border rounded-full h-4 w-8 transition-colors ease duration-100
|
2
2
|
peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2
|
3
|
-
peer-focus-visible:outline-primary`,this.disabled&&this.checked?"border-neutral-500 bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?"border-error bg-error hover:bg-error-400":this.checked?"border-accent bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"border-neutral-800 bg-white hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span id="thumb" part="thumb" class="${r("w-2.5 h-2.5 rounded-full transition-transform ease-in-out duration-200",this.disabled&&this.checked?"bg-white":this.disabled?"-translate-x-2 bg-neutral-500":this.showInvalidStyle?"bg-white -translate-x-2":this.checked?"translate-x-2 bg-white":"bg-neutral-800 -translate-x-2")}"></span> </span><span part="label" id="label" class="${r("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};e.styles=[...s.styles,n`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host([required]) #label:after{content:" *"}`],t([o("input")],e.prototype,"input",2),t([o("#invalid-message")],e.prototype,"invalidMessage",2),t([u()],e.prototype,"showInvalidStyle",2),t([l()],e.prototype,"title",2),t([l()],e.prototype,"name",2),t([l()],e.prototype,"value",2),t([l({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([l({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([m("checked")],e.prototype,"defaultChecked",2),t([l({reflect:!0})],e.prototype,"form",2),t([l({type:Boolean,reflect:!0})],e.prototype,"required",2),t([a("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),t([a(["checked"],{waitUntilFirstUpdate:!0})],e.prototype,"handleStateChange",1),e=t([h("sd-4-0-0-next-
|
3
|
+
peer-focus-visible:outline-primary`,this.disabled&&this.checked?"border-neutral-500 bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?"border-error bg-error hover:bg-error-400":this.checked?"border-accent bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"border-neutral-800 bg-white hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span id="thumb" part="thumb" class="${r("w-2.5 h-2.5 rounded-full transition-transform ease-in-out duration-200",this.disabled&&this.checked?"bg-white":this.disabled?"-translate-x-2 bg-neutral-500":this.showInvalidStyle?"bg-white -translate-x-2":this.checked?"translate-x-2 bg-white":"bg-neutral-800 -translate-x-2")}"></span> </span><span part="label" id="label" class="${r("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};e.styles=[...s.styles,n`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host([required]) #label:after{content:" *"}`],t([o("input")],e.prototype,"input",2),t([o("#invalid-message")],e.prototype,"invalidMessage",2),t([u()],e.prototype,"showInvalidStyle",2),t([l()],e.prototype,"title",2),t([l()],e.prototype,"name",2),t([l()],e.prototype,"value",2),t([l({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([l({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([m("checked")],e.prototype,"defaultChecked",2),t([l({reflect:!0})],e.prototype,"form",2),t([l({type:Boolean,reflect:!0})],e.prototype,"required",2),t([a("disabled",{waitUntilFirstUpdate:!0})],e.prototype,"handleDisabledChange",1),t([a(["checked"],{waitUntilFirstUpdate:!0})],e.prototype,"handleStateChange",1),e=t([h("sd-4-0-0-next-6-switch")],e);export{e as a};
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import{a as U}from"./chunk.3ATYVOO4.js";import{a as B}from"./chunk.VNKUGTKM.js";import{a as A}from"./chunk.D7TMPF3D.js";import{a as H}from"./chunk.X2GM34WQ.js";import{a as L,d as P,e as R,f as w}from"./chunk.W7A3TU2Z.js";import{c as K}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.65NSSTJE.js";import{a as E,c as T}from"./chunk.A3DKF5BY.js";import{a as $,b as F}from"./chunk.24SF73MY.js";import{a as C,d as S}from"./chunk.RQYP7MH5.js";import{a as x}from"./chunk.KLRPP4NQ.js";import{a as f}from"./chunk.E2DRD2OX.js";import{a as D}from"./chunk.6HO6CE4A.js";import{a as M}from"./chunk.26YUWEYR.js";import{a as r}from"./chunk.DCOFYPWX.js";import{a as k,b as o,c as h,d as c,h as I}from"./chunk.APMDRZQD.js";import{b as V,e as d}from"./chunk.IRWHG2Q4.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends I{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-4-0-0-next-
|
1
|
+
import{a as U}from"./chunk.3ATYVOO4.js";import{a as B}from"./chunk.VNKUGTKM.js";import{a as A}from"./chunk.D7TMPF3D.js";import{a as H}from"./chunk.X2GM34WQ.js";import{a as L,d as P,e as R,f as w}from"./chunk.W7A3TU2Z.js";import{c as K}from"./chunk.3L472FD4.js";import{b as z}from"./chunk.65NSSTJE.js";import{a as E,c as T}from"./chunk.A3DKF5BY.js";import{a as $,b as F}from"./chunk.24SF73MY.js";import{a as C,d as S}from"./chunk.RQYP7MH5.js";import{a as x}from"./chunk.KLRPP4NQ.js";import{a as f}from"./chunk.E2DRD2OX.js";import{a as D}from"./chunk.6HO6CE4A.js";import{a as M}from"./chunk.26YUWEYR.js";import{a as r}from"./chunk.DCOFYPWX.js";import{a as k,b as o,c as h,d as c,h as I}from"./chunk.APMDRZQD.js";import{b as V,e as d}from"./chunk.IRWHG2Q4.js";import{e as l}from"./chunk.TJOCV4DC.js";var s=class extends I{constructor(){super(...arguments);this.formControlController=new z(this,{assumeInteractionOn:["sd-blur","sd-4-0-0-next-6-input"]});this.hasSlotController=new D(this,"help-text","label");this.localize=new M(this);this.hasHover=!1;this.hasFocus=!1;this.displayInputValue="";this.selectedTextLabel="";this.selectedOptions=[];this.filteredOptions=[];this.allOptions=[];this.showValidStyle=!1;this.showInvalidStyle=!1;this.name="";this.value="";this.defaultValue="";this.size="lg";this.placeholder=this.localize.term("comboboxDefaultPlaceholder");this.disabled=!1;this.clearable=!1;this.open=!1;this.hoist=!1;this.label="";this.placement="bottom";this.helpText="";this.form="";this.required=!1;this.currentPlacement=this.placement;this.getOption=H;this.multiple=!1;this.useTags=!0;this.maxOptionsVisible=3;this.styleOnValid=!1;this.filter=(t,e)=>{let i=w(t.value),a=w(t.getTextLabel()),n=w(e);return i.includes(n)||a.includes(n)};this.getTag=t=>d`<sd-4-0-0-next-6-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
2
2
|
base:tag__base,
|
3
3
|
content:tag__content,
|
4
4
|
removable-indicator:tag__removable-indicator,
|
5
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-4-0-0-next-
|
5
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-4-0-0-next-6-tag>`;this.handleDocumentFocusIn=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()};this.handleDocumentKeyDown=t=>{if(t.target.closest(".combobox__clear")===null){if(t.key==="Escape"&&(this.open?(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})):this.displayInputValue=""),t.key==="Backspace"&&this.multiple&&this.displayInput.value===""){this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0}));return}if(t.key==="Enter"){let a=this.getCurrentOption(),n=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;if(!this.open&&!n){setTimeout(()=>{t.defaultPrevented||this.formControlController.submit()});return}if(!this.open||a!=null&&a.disabled)return;if(a&&!a.disabled){let p=this.value;this.multiple?(this.toggleOptionSelection(a),this.lastOption=a,this.setOrderedSelectedOptions(a),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(a),this.setSelectedOptions(a)),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})),this.value!==p&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")})}this.displayInput.focus({preventScroll:!0}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0}));return}["ArrowUp","ArrowDown"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.open||this.show(),this.selectNextOption(t.key==="ArrowDown")),["Home","End"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),t.key==="Home"?this.displayInput.setSelectionRange(0,0):t.key==="End"&&this.displayInput.setSelectionRange(this.displayInput.value.length,this.displayInput.value.length))}};this.handleDocumentMouseDown=t=>{let e=t.composedPath();this&&!e.includes(this)&&this.hide()}}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){if(!this.multiple){let t=this.findOptionByValue(this.getSlottedOptions(),this.value);this.selectedTextLabel=(t==null?void 0:t.getTextLabel())||""}this.formControlController.updateValidity(),this.applySizeToOptions()}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}get options(){let t=e=>{let i=this.displayInput.value,a=this.getOption(e,i);return d`${typeof a=="string"?$(a):a}`};return this.filteredOptions.map(e=>e.tagName.toLowerCase()==="sd-4-0-0-next-6-optgroup"?(Array.from(e.children).forEach(i=>{i.tagName.toLowerCase()==="sd-4-0-0-next-6-option"&&t(i)}),e):t(e))}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){let i=this.getTag(t,e);return d`<div @sd-remove="${a=>this.handleTagRemove(a,t)}">${typeof i=="string"?$(i):i}</div>`}return[d``]}):[d`<sd-4-0-0-next-6-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
6
6
|
base:tag__base,
|
7
7
|
content:tag__content,
|
8
8
|
removable-indicator:tag__removable-indicator,
|
9
|
-
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-4-0-0-next-5-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){t.key==="Backspace"&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){t.key==="Backspace"&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-4-0-0-next-5-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})),this.value!==a&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let p=a+1;n=p>e.length-1?0:p}else{let p=a-1;n=p<0?e.length-1:p}this.setCurrentOption(e[n]),K(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-4-0-0-next-5-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t){let e=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),e.forEach(i=>{i.current=!1,i.setAttribute("aria-selected","false")}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id))}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var y,O,m;let a=i.cloneNode(!0);if(a.current=a.value===((y=this.lastOption)==null?void 0:y.value),a.selected=i.selected,!(((O=i.parentElement)==null?void 0:O.tagName.toLowerCase())==="sd-4-0-0-next-5-optgroup"))return a;let p=i.parentElement,g=(m=p.querySelector('[slot="label"]'))==null?void 0:m.cloneNode(!0),u=e.find(b=>b.id===p.id);if(u){u==null||u.appendChild(a),g&&(u==null||u.appendChild(g));return}let v=p.cloneNode();return v.appendChild(a),g&&v.appendChild(g),e.push(v),v}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-4-0-0-next-5-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),this.disabled&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&!this.disabled){this.emit("sd-show"),this.addOpenListeners(),await S(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=T(this,"combobox.show",{dir:this.localize.dir()});await C(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await S(this);let{keyframes:t,options:e}=T(this,"combobox.hide",{dir:this.localize.dir()});await C(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled){this.open=!1;return}return this.open=!0,Promise.race([x(this,"sd-after-show"),x(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,x(this,"sd-after-hide")}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return P(L(this.defaultSlot)).flat()}getSlottedOptGroups(){return R(L(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-4-0-0-next-5-option")){customElements.whenDefined("sd-4-0-0-next-5-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();t.forEach((i,a)=>{this.multiple&&(i.checkbox=!0),i.id=i.id||`sd-4-0-0-next-5-combobox-option-${a}`}),e.forEach((i,a)=>{i.id=i.id||`sd-4-0-0-next-5-combobox-optgroup-${a}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery(""),this.hasFocus&&this.value.length>0&&!this.open&&await this.show()}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,p=this.clearable&&!this.disabled&&this.value.length>0,g=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",u=this.disabled?"cursor-not-allowed":"cursor-pointer",v=this.disabled?"text-neutral-500":"text-primary",y={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],O={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return d`<div part="form-control" class="${r("relative text-left",u,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${a&&"inline-block mb-2"}" aria-hidden="${!a}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${r("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[g],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-4-0-0-next-5-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${r("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
9
|
+
" size="${this.size==="sm"?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-4-0-0-next-6-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){t.key==="Backspace"&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleTagMaxOptionsKeyDown(t){t.key==="Backspace"&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})))}handleLabelClick(){this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.updateComplete.then(()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")}))}handleComboboxMouseDown(t){let i=t.composedPath().some(n=>n instanceof HTMLSlotElement&&n.name==="removable-indicator");if(this.disabled||i)return;(this.open?this.hide():this.show()).then(()=>{setTimeout(()=>this.displayInput.focus({preventScroll:!0}))})}handleComboboxKeyDown(t){t.key!=="Tab"&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){this.value!==""&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach(t=>{t.selected=!1}),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")}))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){let i=t.target.closest("sd-4-0-0-next-6-option"),a=this.value;i&&!i.disabled&&(this.multiple?(this.toggleOptionSelection(i),this.lastOption=i,this.setOrderedSelectedOptions(i),this.updateComplete.then(()=>{this.selectionChanged()})):(this.setOrderedSelectedOptions(i),this.setSelectedOptions(i)),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})),this.value!==a&&this.updateComplete.then(()=>{this.emit("sd-input"),this.emit("sd-change")}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){let e=this.getAllFilteredOptions();if(e.length===0)return;let i=this.getCurrentOption(),a=e.indexOf(i),n=Math.max(0,a);if(t){let p=a+1;n=p>e.length-1?0:p}else{let p=a-1;n=p<0?e.length-1:p}this.setCurrentOption(e[n]),K(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-4-0-0-next-6-option")]}getCurrentOption(){return this.getAllFilteredOptions().find(t=>t.current)}setCurrentOption(t){let e=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),e.forEach(i=>{i.current=!1,i.setAttribute("aria-selected","false")}),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id))}toggleOptionSelection(t,e){let a=this.getSlottedOptions().find(n=>n.value&&t.value?n.value===t.value:n.getTextLabel()===t.getTextLabel());a&&(a.selected=e!=null?e:!a.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find(i=>e.includes(i.value)):t.find(i=>i.value===e)}selectedOptionsAndValueSynced(){var t;return!this.value&&this.selectedOptions.length===0?!0:Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===((t=this.selectedOptions[0])==null?void 0:t.value)}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach(e=>{e.selected=!1}),this.selectedOptions=this.getSlottedOptions().filter(e=>this.isOptionSelected(e)),this.selectedOptions.forEach(e=>{e&&(e.selected=!0)}),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach(i=>{i.selected=this.compareOptions(i,t)}),this.selectionChanged()}setOrderedSelectedOptions(t){let e=this.getSlottedOptions().find(i=>this.compareOptions(i,t));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find(i=>this.compareOptions(i,e))?this.selectedOptions=this.selectedOptions.filter(i=>!this.compareOptions(i,e)):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var e,i,a;let t=this.selectedOptions.some(n=>n?this.isOptionSelected(n):!1);this.multiple?(!t&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map(n=>n.value||n.getTextLabel())]:this.value=this.selectedOptions.map(n=>(n==null?void 0:n.value)||(n==null?void 0:n.getTextLabel())||""),this.displayInputValue=""):(this.value=((e=this.selectedOptions[0])==null?void 0:e.value)||((i=this.selectedOptions[0])==null?void 0:i.getTextLabel())||"",this.selectedTextLabel=((a=this.selectedOptions[0])==null?void 0:a.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then(()=>{this.formControlController.updateValidity()})}createComboboxOptionsFromQuery(t){let e=[];this.filteredOptions=this.getSlottedOptions().filter(i=>this.filter(i,t)||t==="").map(i=>{var y,O,m;let a=i.cloneNode(!0);if(a.current=a.value===((y=this.lastOption)==null?void 0:y.value),a.selected=i.selected,!(((O=i.parentElement)==null?void 0:O.tagName.toLowerCase())==="sd-4-0-0-next-6-optgroup"))return a;let p=i.parentElement,g=(m=p.querySelector('[slot="label"]'))==null?void 0:m.cloneNode(!0),u=e.find(b=>b.id===p.id);if(u){u==null||u.appendChild(a),g&&(u==null||u.appendChild(g));return}let v=p.cloneNode();return v.appendChild(a),g&&v.appendChild(g),e.push(v),v}).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){let e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){let t=this.getAllFilteredOptions();customElements.get("sd-4-0-0-next-6-option")&&t.forEach(e=>{e.checkbox=this.multiple})}applySizeToOptions(){this.getSlottedOptions().forEach(t=>{t.size=this.size})}handleDisabledChange(){this.formControlController.setValidity(this.disabled),this.disabled&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&!this.disabled){this.emit("sd-show"),this.addOpenListeners(),await S(this),this.listbox.hidden=!1,this.popup.active=!0;let{keyframes:i,options:a}=T(this,"combobox.show",{dir:this.localize.dir()});await C(this.popup.popup,i,a),this.emit("sd-after-show"),this.filteredOptions.length===0&&this.emit("sd-error");return}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await S(this);let{keyframes:t,options:e}=T(this,"combobox.hide",{dir:this.localize.dir()});await C(this.popup.popup,t,e),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(this.open||this.disabled){this.open=!1;return}return this.open=!0,Promise.race([x(this,"sd-after-show"),x(this,"sd-error")])}async hide(){if(!this.open||this.disabled){this.open=!1;return}return this.displayInputValue="",this.open=!1,x(this,"sd-after-hide")}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){let t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then(()=>{this.formControlController.updateValidity()}),this.emit("sd-change"))}getSlottedOptions(){return P(L(this.defaultSlot)).flat()}getSlottedOptGroups(){return R(L(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-4-0-0-next-6-option")){customElements.whenDefined("sd-4-0-0-next-6-option").then(()=>this.handleDefaultSlotChange());return}let t=this.getSlottedOptions(),e=this.getSlottedOptGroups();t.forEach((i,a)=>{this.multiple&&(i.checkbox=!0),i.id=i.id||`sd-4-0-0-next-6-combobox-option-${a}`}),e.forEach((i,a)=>{i.id=i.id||`sd-4-0-0-next-6-combobox-optgroup-${a}`}),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery(""),this.hasFocus&&this.value.length>0&&!this.open&&await this.show()}render(){let t={left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right")},e=this.hasSlotController.test("label"),i=this.hasSlotController.test("help-text"),a=this.label?!0:!!e,n=this.helpText?!0:!!i,p=this.clearable&&!this.disabled&&this.value.length>0,g=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",u=this.disabled?"cursor-not-allowed":"cursor-pointer",v=this.disabled?"text-neutral-500":"text-primary",y={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],O={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],m={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return d`<div part="form-control" class="${r("relative text-left",u,this.size==="sm"?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${a&&"inline-block mb-2"}" aria-hidden="${!a}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${r("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[g],this.open&&(this.currentPlacement==="bottom"?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-4-0-0-next-6-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${r("inline-flex relative w-full",this.currentPlacement==="bottom"?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
10
10
|
popup:popup__content,
|
11
|
-
"><div part="combobox" class="${r("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}">${t.left?d`<slot part="left" name="left" class="${r("inline-flex",O,v,m)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?d`<div part="tags" class="${r("flex items-center gap-1",O)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${r("appearance-none outline-none bg-transparent flex-auto min-w-0",u,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(b=>b==null?void 0:b.getTextLabel()).join(", ")}</div><input class="${r("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",u)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${p?d`<button part="clear-button" class="${r("flex justify-center",y)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-4-0-0-next-
|
11
|
+
"><div part="combobox" class="${r("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}">${t.left?d`<slot part="left" name="left" class="${r("inline-flex",O,v,m)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?d`<div part="tags" class="${r("flex items-center gap-1",O)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${r("appearance-none outline-none bg-transparent flex-auto min-w-0",u,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map(b=>b==null?void 0:b.getTextLabel()).join(", ")}</div><input class="${r("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",u)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${p?d`<button part="clear-button" class="${r("flex justify-center",y)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-4-0-0-next-6-icon class="${r("text-icon-fill-neutral-800",m)}" name="closing-round" library="system"></sd-4-0-0-next-6-icon></slot></button>`:""} ${this.showInvalidStyle?d`<sd-4-0-0-next-6-icon part="invalid-icon" class="${r(y,m,"text-error")}" library="system" name="risk"></sd-4-0-0-next-6-icon>`:""} ${this.styleOnValid&&this.showValidStyle?d`<sd-4-0-0-next-6-icon part="valid-icon" class="${r("flex-shrink-0 text-success",y,m)}" library="system" name="status-check"></sd-4-0-0-next-6-icon>`:""}<slot name="right" part="right" class="${r("inline-flex ml-2 leading-[0]",this.disabled?"text-neutral-500":"text-primary",m)}"><sd-4-0-0-next-6-icon class="${r("transition-all",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="system" color="currentColor"></sd-4-0-0-next-6-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${r("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow",this.currentPlacement==="bottom"?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox" class="overflow-y-scroll">${this.filteredOptions.length===0?d`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-4-0-0-next-6-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700" aria-hidden="${!n}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};s.dependencies={"sd-4-0-0-next-6-icon":F,"sd-4-0-0-next-6-popup":B,"sd-4-0-0-next-6-tag":U},s.styles=[...I.styles,V`:host{display:block;position:relative;width:100%}:host([required]) #label:after{content:" *"}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-4-0-0-next-6-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-4-0-0-next-6-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-4-0-0-next-6-tag::part(content){display:inline-block;max-width:var(--tag-max-width,15ch);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}sd-4-0-0-next-6-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-4-0-0-next-6-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity,1))}[part=filtered-listbox] sd-4-0-0-next-6-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;color:inherit;font-weight:700}`],l([c("sd-4-0-0-next-6-popup")],s.prototype,"popup",2),l([c('[part="combobox"]')],s.prototype,"combobox",2),l([c('[part="display-input"]')],s.prototype,"displayInput",2),l([c(".value-input")],s.prototype,"valueInput",2),l([c('[part="listbox"]')],s.prototype,"listbox",2),l([c('[part="tags"]')],s.prototype,"tagWrapper",2),l([c('[part="filtered-listbox"]')],s.prototype,"filteredWrapper",2),l([c("slot:not([name])")],s.prototype,"defaultSlot",2),l([c("#invalid-message")],s.prototype,"invalidMessage",2),l([h()],s.prototype,"hasHover",2),l([h()],s.prototype,"hasFocus",2),l([h()],s.prototype,"displayInputValue",2),l([h()],s.prototype,"selectedTextLabel",2),l([h()],s.prototype,"selectedOptions",2),l([h()],s.prototype,"filteredOptions",2),l([h()],s.prototype,"allOptions",2),l([h()],s.prototype,"lastOption",2),l([h()],s.prototype,"showValidStyle",2),l([h()],s.prototype,"showInvalidStyle",2),l([o()],s.prototype,"name",2),l([o({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],s.prototype,"value",2),l([A()],s.prototype,"defaultValue",2),l([o({reflect:!0})],s.prototype,"size",2),l([o()],s.prototype,"placeholder",2),l([o({reflect:!0,type:Boolean})],s.prototype,"disabled",2),l([o({type:Boolean})],s.prototype,"clearable",2),l([o({reflect:!0,type:Boolean})],s.prototype,"open",2),l([o({type:Boolean})],s.prototype,"hoist",2),l([o()],s.prototype,"label",2),l([o({reflect:!0})],s.prototype,"placement",2),l([o({attribute:"help-text"})],s.prototype,"helpText",2),l([o({reflect:!0})],s.prototype,"form",2),l([o({reflect:!0,type:Boolean})],s.prototype,"required",2),l([h()],s.prototype,"currentPlacement",2),l([o()],s.prototype,"getOption",2),l([o({type:Boolean,reflect:!0})],s.prototype,"multiple",2),l([o({type:Boolean,reflect:!0})],s.prototype,"useTags",2),l([o({attribute:"max-options-visible",type:Number})],s.prototype,"maxOptionsVisible",2),l([o({type:Boolean,reflect:!0,attribute:"style-on-valid"})],s.prototype,"styleOnValid",2),l([o()],s.prototype,"filter",2),l([o()],s.prototype,"getTag",2),l([f("filter",{waitUntilFirstUpdate:!0})],s.prototype,"handleFilterChange",1),l([f("useTags",{waitUntilFirstUpdate:!0})],s.prototype,"handleUseTagsChange",1),l([f("size",{waitUntilFirstUpdate:!0})],s.prototype,"applySizeToOptions",1),l([f("disabled",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisabledChange",1),l([f("value",{waitUntilFirstUpdate:!0})],s.prototype,"handleValueChange",1),l([f("displayInputValue",{waitUntilFirstUpdate:!0})],s.prototype,"handleDisplayInputValueChange",1),l([f("open",{waitUntilFirstUpdate:!0})],s.prototype,"handleOpenChange",1),s=l([k("sd-4-0-0-next-6-combobox")],s);E("combobox.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}});E("combobox.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{s as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as n,b as i,g as c,h as o}from"./chunk.APMDRZQD.js";import{b as a,e as l}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.closeOthers=!1;this.handleAccordionShow=r=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach(s=>{s!==r.target&&s.parentNode===r.target.parentNode&&s.removeAttribute("open")})}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return l`<div part="base"><slot></slot></div>`}};e.styles=[...o.styles,a`:host{display:block}::slotted(sd-4-0-0-next-
|
1
|
+
import{a as n,b as i,g as c,h as o}from"./chunk.APMDRZQD.js";import{b as a,e as l}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends o{constructor(){super(...arguments);this.closeOthers=!1;this.handleAccordionShow=r=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach(s=>{s!==r.target&&s.parentNode===r.target.parentNode&&s.removeAttribute("open")})}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return l`<div part="base"><slot></slot></div>`}};e.styles=[...o.styles,a`:host{display:block}::slotted(sd-4-0-0-next-6-accordion:not(:first-of-type)){margin-top:-1px}`],t([c({selector:"sd-4-0-0-next-6-accordion"})],e.prototype,"_accordionsInDefaultSlot",2),t([i({attribute:"close-others",type:Boolean})],e.prototype,"closeOthers",2),e=t([n("sd-4-0-0-next-6-accordion-group")],e);export{e as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as n}from"./chunk.DCOFYPWX.js";import{a as l,b as e,h as o}from"./chunk.APMDRZQD.js";import{b as a,e as i}from"./chunk.IRWHG2Q4.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.orientation="horizontal";this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return i`<hr part="main" aria-orientation="${this.orientation}" class="${n(this.inverted?"border-primary-400":"border-neutral-400",this.orientation==="horizontal"?"border-t w-full":" border-l h-full")}">`}};t.styles=[...o.styles,a`:host{margin:var(--sd-spacing-0,0)}:host(sd-4-0-0-next-
|
1
|
+
import{a as n}from"./chunk.DCOFYPWX.js";import{a as l,b as e,h as o}from"./chunk.APMDRZQD.js";import{b as a,e as i}from"./chunk.IRWHG2Q4.js";import{e as r}from"./chunk.TJOCV4DC.js";var t=class extends o{constructor(){super(...arguments);this.orientation="horizontal";this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return i`<hr part="main" aria-orientation="${this.orientation}" class="${n(this.inverted?"border-primary-400":"border-neutral-400",this.orientation==="horizontal"?"border-t w-full":" border-l h-full")}">`}};t.styles=[...o.styles,a`:host{margin:var(--sd-spacing-0,0)}:host(sd-4-0-0-next-6-divider[orientation=horizontal]){display:block}:host(sd-4-0-0-next-6-divider[orientation=vertical]){display:inline-block}`],r([e({reflect:!0})],t.prototype,"orientation",2),r([e({type:Boolean,reflect:!0})],t.prototype,"inverted",2),t=r([l("sd-4-0-0-next-6-divider")],t);export{t as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as l}from"./chunk.E2DRD2OX.js";import{a as m}from"./chunk.DCOFYPWX.js";import{a as h,b as a,d as f,h as n}from"./chunk.APMDRZQD.js";import{b as o,e as c}from"./chunk.IRWHG2Q4.js";import{e as s}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.steps=[];this.size="lg";this.orientation="horizontal";this.activeStep=0;this.notInteractive=!1}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0;let t;this.steps.forEach((i,r)=>{i.index=r+1,i.size=this.size,i.orientation=this.orientation,this.notInteractive?(i.current=!1,i.disabled=!1,i.notInteractive=!0):i.current&&(t=r)}),this.setActiveStep(t||this.activeStep)})}updateSize(){this.steps.forEach(t=>{t.size=this.size})}updateOrientation(){this.steps.forEach(t=>{t.orientation=this.orientation})}getAllSteps(){return[...this.body.assignedElements()].filter(t=>t.tagName.toLowerCase()==="sd-4-0-0-next-
|
1
|
+
import{a as l}from"./chunk.E2DRD2OX.js";import{a as m}from"./chunk.DCOFYPWX.js";import{a as h,b as a,d as f,h as n}from"./chunk.APMDRZQD.js";import{b as o,e as c}from"./chunk.IRWHG2Q4.js";import{e as s}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.steps=[];this.size="lg";this.orientation="horizontal";this.activeStep=0;this.notInteractive=!1}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0;let t;this.steps.forEach((i,r)=>{i.index=r+1,i.size=this.size,i.orientation=this.orientation,this.notInteractive?(i.current=!1,i.disabled=!1,i.notInteractive=!0):i.current&&(t=r)}),this.setActiveStep(t||this.activeStep)})}updateSize(){this.steps.forEach(t=>{t.size=this.size})}updateOrientation(){this.steps.forEach(t=>{t.orientation=this.orientation})}getAllSteps(){return[...this.body.assignedElements()].filter(t=>t.tagName.toLowerCase()==="sd-4-0-0-next-6-step")}setActiveStep(t){t>=0&&t<this.steps.length&&!this.notInteractive&&(this.activeStep=t,this.steps.forEach((i,r)=>{r===t?i.current=!0:r>t?i.disabled=!0:i.current=!1}))}handleInteractivityChange(){this.notInteractive&&this.steps.forEach(t=>{t.current=!1,t.disabled=!1,t.notInteractive=!0})}render(){return c`<div role="${this.notInteractive?"group":"navigation"}" class="h-full"><div role="list" part="base" class="${m("flex",this.orientation==="vertical"&&"flex-col h-full")}"><slot part="body"></slot></div></div>`}};e.styles=[...n.styles,o`:host{width:-moz-max-content;width:max-content}`],s([f("[part=body]")],e.prototype,"body",2),s([a({reflect:!0})],e.prototype,"size",2),s([a({reflect:!0})],e.prototype,"orientation",2),s([a({type:Number,reflect:!0,attribute:"active-step"})],e.prototype,"activeStep",2),s([a({type:Boolean,reflect:!0,attribute:"not-interactive"})],e.prototype,"notInteractive",2),s([l("size",{waitUntilFirstUpdate:!0})],e.prototype,"updateSize",1),s([l("orientation",{waitUntilFirstUpdate:!0})],e.prototype,"updateOrientation",1),s([l("notInteractive")],e.prototype,"handleInteractivityChange",1),e=s([h("sd-4-0-0-next-6-step-group")],e);export{e as a};
|
@@ -1 +1 @@
|
|
1
|
-
import{a as l}from"./chunk.KLRPP4NQ.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as m}from"./chunk.26YUWEYR.js";import{a as p}from"./chunk.DCOFYPWX.js";import{a as d,b as n,d as r,h as a}from"./chunk.APMDRZQD.js";import{b as c,e as o}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends a{constructor(){super(...arguments);this.open=!1;this.inverted=!1;this.localize=new m(this)}updateMaxHeight(){var s;let i=(s=this.contentPreview)==null?void 0:s.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${i}px`),this.style.setProperty("--max-height",i)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}onOpenChange(){this.open?(this.emit("sd-show"),this.updateComplete.then(()=>{this.emit("sd-after-show")})):(this.emit("sd-hide"),this.updateComplete.then(()=>{this.emit("sd-after-hide")})),this.details.setAttribute("open",this.open.toString())}async show(){if(!this.open)return this.onToggleClick(),l(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),l(this,"sd-after-hide")}render(){return o`<details part="details"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details><button part="toggle" class="${p("sd-interactive sd-interactive--reset !h-full !justify-center !w-full !text-base !flex !items-center !underline !underline-offset-2 !toggle",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}">${this.open?o`<slot name="toggle-open"><sd-4-0-0-next-
|
1
|
+
import{a as l}from"./chunk.KLRPP4NQ.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as m}from"./chunk.26YUWEYR.js";import{a as p}from"./chunk.DCOFYPWX.js";import{a as d,b as n,d as r,h as a}from"./chunk.APMDRZQD.js";import{b as c,e as o}from"./chunk.IRWHG2Q4.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends a{constructor(){super(...arguments);this.open=!1;this.inverted=!1;this.localize=new m(this)}updateMaxHeight(){var s;let i=(s=this.contentPreview)==null?void 0:s.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${i}px`),this.style.setProperty("--max-height",i)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}onOpenChange(){this.open?(this.emit("sd-show"),this.updateComplete.then(()=>{this.emit("sd-after-show")})):(this.emit("sd-hide"),this.updateComplete.then(()=>{this.emit("sd-after-hide")})),this.details.setAttribute("open",this.open.toString())}async show(){if(!this.open)return this.onToggleClick(),l(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),l(this,"sd-after-hide")}render(){return o`<details part="details"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details><button part="toggle" class="${p("sd-interactive sd-interactive--reset !h-full !justify-center !w-full !text-base !flex !items-center !underline !underline-offset-2 !toggle",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}">${this.open?o`<slot name="toggle-open"><sd-4-0-0-next-6-icon class="mr-2 text-xl" library="system" name="chevron-up"></sd-4-0-0-next-6-icon>${this.localize.term("showLess")}</slot>`:o`<slot name="toggle-closed"><sd-4-0-0-next-6-icon class="mr-2 text-xl" library="system" name="chevron-down"></sd-4-0-0-next-6-icon>${this.localize.term("showMore")}</slot>`}</button>`}firstUpdated(){this.cloneContentToLightDOM(),this.details.setAttribute("open",this.open.toString())}cloneContentToLightDOM(){let i=document.createElement("div");i.setAttribute("slot","clone"),Array.from(this.childNodes).forEach(g=>{let u=g.cloneNode(!0);i.appendChild(u)}),this.appendChild(i)}};e.styles=[...a.styles,c`:host{--gradient-color-start:hsla(0,0%,100%,0);--gradient-color-end:#fff;--component-expandable-max-block-size:90px;--gradient-height:24px;--gradient:var(--gradient-color-start) 0%,var(--gradient-color-end) 80%,var(--gradient-color-end) 100%;display:inline-block;position:relative;width:100%}.toggle::-moz-focus-inner{border-style:none;padding:var(--sd-spacing-0,0)}details>summary::-webkit-details-marker,details[open] summary{display:none}summary{max-block-size:var(--component-expandable-max-block-size)}:host([open]) summary{max-block-size:var(--max-height-pixel,1000vh)}.content{max-block-size:var(--component-expandable-max-block-size)}:host([open]) .content{max-block-size:var(--max-height-pixel,1000vh)}:host(:not([open])) .content:after{background:linear-gradient(180deg,var(--gradient));bottom:var(--sd-spacing-0,0);content:" ";display:block;height:var(--gradient-height);left:var(--sd-spacing-0,0);position:absolute;width:100%}:host([inverted]:not([open])) .content:after{background:var(--gradient-vertical-transparent-primary,linear-gradient(180deg,rgba(0,53,142,0) 0,#00358e 80%,#00358e 100%))}`],t([r(".content-preview")],e.prototype,"contentPreview",2),t([r("details")],e.prototype,"details",2),t([n({type:Boolean,reflect:!0})],e.prototype,"open",2),t([n({type:Boolean,reflect:!0})],e.prototype,"inverted",2),t([h("open",{waitUntilFirstUpdate:!0})],e.prototype,"onOpenChange",1),e=t([d("sd-4-0-0-next-6-expandable")],e);export{e as a};
|