@solid-design-system/components 5.9.0 → 5.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunks/chunk.45UEUNN5.js +3 -0
- package/cdn/chunks/chunk.6X4TLHUJ.js +4 -0
- package/cdn/components/switch/switch.d.ts +1 -0
- package/cdn/components/switch/switch.js +1 -1
- package/cdn/components/tooltip/tooltip.d.ts +1 -0
- package/cdn/components/tooltip/tooltip.js +1 -1
- package/cdn/custom-elements.json +5 -1
- package/cdn/solid-components.bundle.js +10 -10
- package/cdn/solid-components.iife.js +10 -10
- package/cdn/solid-components.js +1 -1
- package/cdn/vscode.html-custom-data.json +1 -1
- package/cdn/web-types.json +9 -3
- package/cdn-versioned/chunks/chunk.2JZXQAEH.js +1 -1
- package/cdn-versioned/chunks/chunk.2S6PSHGR.js +1 -1
- package/cdn-versioned/chunks/chunk.2YPPKILR.js +1 -1
- package/cdn-versioned/chunks/chunk.3I7Z2ZGA.js +1 -1
- package/cdn-versioned/chunks/chunk.3VSEXUCN.js +1 -1
- package/cdn-versioned/chunks/chunk.45UEUNN5.js +3 -0
- package/cdn-versioned/chunks/chunk.4GU7BCCI.js +1 -1
- package/cdn-versioned/chunks/chunk.6HLS5XU2.js +1 -1
- package/cdn-versioned/chunks/chunk.6NART7VP.js +1 -1
- package/cdn-versioned/chunks/chunk.6X4TLHUJ.js +4 -0
- package/cdn-versioned/chunks/chunk.7F4BLDO5.js +1 -1
- package/cdn-versioned/chunks/chunk.AD3RLPIJ.js +1 -1
- package/cdn-versioned/chunks/chunk.AOLFDR44.js +1 -1
- package/cdn-versioned/chunks/chunk.AWLGV3BD.js +1 -1
- package/cdn-versioned/chunks/chunk.AXOCHBBU.js +1 -1
- package/cdn-versioned/chunks/chunk.BBD6RMZH.js +1 -1
- package/cdn-versioned/chunks/chunk.BGEMBVJV.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.CMIXQ7JH.js +1 -1
- package/cdn-versioned/chunks/chunk.CMMWC4RI.js +1 -1
- package/cdn-versioned/chunks/chunk.EADKGOFJ.js +1 -1
- package/cdn-versioned/chunks/chunk.ELCOIK5P.js +1 -1
- package/cdn-versioned/chunks/chunk.FA5R7CKW.js +1 -1
- package/cdn-versioned/chunks/chunk.FCFA3AM7.js +1 -1
- package/cdn-versioned/chunks/chunk.GGXUEKTA.js +4 -4
- package/cdn-versioned/chunks/chunk.GYKZUJLA.js +1 -1
- package/cdn-versioned/chunks/chunk.H3RLFSFE.js +4 -4
- package/cdn-versioned/chunks/chunk.HAFUAYZZ.js +1 -1
- package/cdn-versioned/chunks/chunk.HDPQFCGV.js +1 -1
- package/cdn-versioned/chunks/chunk.IFNRX7KW.js +1 -1
- package/cdn-versioned/chunks/chunk.IHA7PGG2.js +1 -1
- package/cdn-versioned/chunks/chunk.IRWE4TYN.js +1 -1
- package/cdn-versioned/chunks/chunk.JUPXHQZ3.js +1 -1
- package/cdn-versioned/chunks/chunk.KWDCB5GN.js +1 -1
- package/cdn-versioned/chunks/chunk.LAFGNWFC.js +1 -1
- package/cdn-versioned/chunks/chunk.LDAMQCO2.js +1 -1
- package/cdn-versioned/chunks/chunk.LNX7ZKW3.js +1 -1
- package/cdn-versioned/chunks/chunk.MGVRJCCE.js +1 -1
- package/cdn-versioned/chunks/chunk.NFHVSI66.js +1 -1
- package/cdn-versioned/chunks/chunk.PQFPJ45Y.js +1 -1
- package/cdn-versioned/chunks/chunk.R2G6FMES.js +1 -1
- package/cdn-versioned/chunks/chunk.R4DOCTBU.js +1 -1
- package/cdn-versioned/chunks/chunk.RISDA2AI.js +1 -1
- package/cdn-versioned/chunks/chunk.S53XPYBW.js +1 -1
- package/cdn-versioned/chunks/chunk.SBIDVQ2E.js +1 -1
- package/cdn-versioned/chunks/chunk.SBU6FGLK.js +1 -1
- package/cdn-versioned/chunks/chunk.SHKBYZWU.js +1 -1
- package/cdn-versioned/chunks/chunk.U6FV3MPT.js +3 -3
- package/cdn-versioned/chunks/chunk.V4CRJJ5B.js +1 -1
- package/cdn-versioned/chunks/chunk.V7ZZFRHA.js +1 -1
- package/cdn-versioned/chunks/chunk.VPGQTCNG.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.WXLNA4GN.js +1 -1
- package/cdn-versioned/chunks/chunk.XMUDHBRG.js +1 -1
- package/cdn-versioned/chunks/chunk.XRBNH2NJ.js +1 -1
- package/cdn-versioned/chunks/chunk.YOYAMVUH.js +1 -1
- package/cdn-versioned/chunks/chunk.YVTCC5NZ.js +1 -1
- package/cdn-versioned/chunks/chunk.Z4UTG2XJ.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/breadcrumb/breadcrumb.d.ts +1 -1
- package/cdn-versioned/components/breadcrumb-item/breadcrumb-item.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 +1 -1
- 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 +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/menu/menu.d.ts +1 -1
- package/cdn-versioned/components/menu-item/menu-item.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 +1 -1
- 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 +1 -1
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +1 -1
- 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 +2 -1
- package/cdn-versioned/components/switch/switch.js +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 +2 -1
- package/cdn-versioned/components/tooltip/tooltip.js +1 -1
- package/cdn-versioned/components/video/video.d.ts +1 -1
- package/cdn-versioned/custom-elements.json +233 -229
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +16 -16
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +16 -16
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +87 -87
- package/cdn-versioned/web-types.json +154 -148
- package/dist/chunks/{chunk.J5E5UTG2.js → chunk.FDQQDXKD.js} +6 -2
- package/dist/chunks/{chunk.SGJGJL45.js → chunk.UDULBIWD.js} +5 -1
- package/dist/components/switch/switch.d.ts +1 -0
- package/dist/components/switch/switch.js +2 -1
- package/dist/components/tooltip/tooltip.d.ts +1 -0
- package/dist/components/tooltip/tooltip.js +2 -1
- package/dist/custom-elements.json +5 -1
- package/dist/solid-components.js +2 -2
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/web-types.json +9 -3
- package/dist-versioned/chunks/chunk.2VDSJ75Q.js +2 -2
- package/dist-versioned/chunks/chunk.3JIBD4DC.js +4 -4
- package/dist-versioned/chunks/chunk.3PUMOBIO.js +1 -1
- package/dist-versioned/chunks/chunk.47VXT6XF.js +2 -2
- package/dist-versioned/chunks/chunk.4Z5MLLDU.js +2 -2
- package/dist-versioned/chunks/chunk.5UQ6EJAW.js +1 -1
- package/dist-versioned/chunks/chunk.5XKGAQGU.js +26 -26
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.6ID5BKH5.js +2 -2
- package/dist-versioned/chunks/chunk.6SZYSES2.js +1 -1
- package/dist-versioned/chunks/chunk.7EMNYFIP.js +1 -1
- package/dist-versioned/chunks/chunk.7VIYCZ4Z.js +14 -14
- package/dist-versioned/chunks/chunk.7ZISZOWN.js +2 -2
- package/dist-versioned/chunks/chunk.AQKWXHIC.js +2 -2
- package/dist-versioned/chunks/chunk.BK4CYVLA.js +2 -2
- package/dist-versioned/chunks/chunk.EIUEZZ5G.js +12 -12
- package/dist-versioned/chunks/chunk.EO5MCLIR.js +2 -2
- package/dist-versioned/chunks/{chunk.J5E5UTG2.js → chunk.FDQQDXKD.js} +7 -3
- package/dist-versioned/chunks/chunk.FDUVN4I6.js +6 -6
- package/dist-versioned/chunks/chunk.FFAUGMVF.js +3 -3
- package/dist-versioned/chunks/chunk.FUGGYSQF.js +6 -6
- package/dist-versioned/chunks/chunk.I6NQOQEO.js +3 -3
- package/dist-versioned/chunks/chunk.JJTGSFOV.js +3 -3
- package/dist-versioned/chunks/chunk.JUUDZ47Q.js +1 -1
- package/dist-versioned/chunks/chunk.KEJFWGZI.js +4 -4
- package/dist-versioned/chunks/chunk.KFVC6XFD.js +2 -2
- package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
- package/dist-versioned/chunks/chunk.MEDUZPGV.js +4 -4
- package/dist-versioned/chunks/chunk.MEHX7EVL.js +3 -3
- package/dist-versioned/chunks/chunk.MQ5VT5VP.js +2 -2
- package/dist-versioned/chunks/chunk.N3MU3643.js +1 -1
- package/dist-versioned/chunks/chunk.N7WBIQUG.js +5 -5
- package/dist-versioned/chunks/chunk.P4UKJXBL.js +3 -3
- package/dist-versioned/chunks/chunk.PP5IDYES.js +1 -1
- package/dist-versioned/chunks/chunk.QS7N47CI.js +6 -6
- package/dist-versioned/chunks/chunk.R2XG3O7O.js +1 -1
- package/dist-versioned/chunks/chunk.RGFFEJMJ.js +3 -3
- package/dist-versioned/chunks/chunk.SW6AKO54.js +12 -12
- package/dist-versioned/chunks/chunk.TQMYNSM4.js +1 -1
- package/dist-versioned/chunks/chunk.TWDHTS5K.js +1 -1
- package/dist-versioned/chunks/chunk.TX6S5UVP.js +11 -11
- package/dist-versioned/chunks/chunk.UAADOLK5.js +1 -1
- package/dist-versioned/chunks/{chunk.SGJGJL45.js → chunk.UDULBIWD.js} +10 -6
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.UJHYOR23.js +5 -5
- package/dist-versioned/chunks/chunk.UJHYUCHT.js +2 -2
- package/dist-versioned/chunks/chunk.UQ55GFI3.js +3 -3
- package/dist-versioned/chunks/chunk.VFG2SXVE.js +8 -8
- package/dist-versioned/chunks/chunk.WEUFN5UU.js +24 -24
- package/dist-versioned/chunks/chunk.WL7EGHGP.js +2 -2
- package/dist-versioned/chunks/chunk.WSEY3LJE.js +4 -4
- package/dist-versioned/chunks/chunk.XKFVXICF.js +3 -3
- package/dist-versioned/chunks/chunk.YGVCQCO4.js +2 -2
- package/dist-versioned/chunks/chunk.YRFRBXRK.js +1 -1
- package/dist-versioned/chunks/chunk.ZCI47J45.js +1 -1
- package/dist-versioned/chunks/chunk.ZF7CPAC2.js +5 -5
- package/dist-versioned/chunks/chunk.ZSZ2IB2L.js +2 -2
- package/dist-versioned/chunks/chunk.ZVLZ6XOK.js +2 -2
- 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/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist-versioned/components/breadcrumb-item/breadcrumb-item.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 +1 -1
- 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 +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/menu/menu.d.ts +1 -1
- package/dist-versioned/components/menu-item/menu-item.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 +1 -1
- 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 +1 -1
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +1 -1
- 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 +2 -1
- package/dist-versioned/components/switch/switch.js +2 -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 +2 -1
- package/dist-versioned/components/tooltip/tooltip.js +2 -1
- package/dist-versioned/components/video/video.d.ts +1 -1
- package/dist-versioned/custom-elements.json +233 -229
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +2 -2
- package/dist-versioned/vscode.html-custom-data.json +87 -87
- package/dist-versioned/web-types.json +154 -148
- package/package.json +1 -1
- package/cdn/chunks/chunk.FCYUK5NR.js +0 -4
- package/cdn/chunks/chunk.ZOFXN52V.js +0 -3
- package/cdn-versioned/chunks/chunk.FCYUK5NR.js +0 -4
- package/cdn-versioned/chunks/chunk.ZOFXN52V.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Dt}from"./chunk.26V4EXHB.js";import{a as kt,b as E,d as Et,h as Rt}from"./chunk.HDPQFCGV.js";import{b as Mt,e as Ot}from"./chunk.UWPDCU52.js";import{a as C,b as V,c as dt,e as b}from"./chunk.TJOCV4DC.js";var j=Math.min,T=Math.max,at=Math.round,ft=Math.floor,F=t=>({x:t,y:t}),ue={left:"right",right:"left",bottom:"top",top:"bottom"},he={start:"end",end:"start"};function pt(t,e,n){return T(t,j(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function _(t){return["top","bottom"].includes(q(t))?"y":"x"}function wt(t){return Ct(_(t))}function Bt(t,e,n){n===void 0&&(n=!1);let i=tt(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=ct(r)),[r,ct(r)]}function Ft(t){let e=ct(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>he[e])}function de(t,e,n){let i=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?s:r;default:return[]}}function $t(t,e,n,i){let o=tt(t),s=de(q(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function ct(t){return t.replace(/left|right|bottom|top/g,e=>ue[e])}function me(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?me(t):{top:t,right:t,bottom:t,left:t}}function et(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Nt(t,e,n){let{reference:i,floating:o}=t,s=_(e),r=wt(e),l=gt(r),a=q(e),c=s==="y",f=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,u;switch(a){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(tt(e)){case"start":u[r]-=m*(n&&c?-1:1);break;case"end":u[r]+=m*(n&&c?-1:1);break}return u}var Ht=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(e)),c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:h}=Nt(c,i,a),m=i,u={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x:y,y:v,data:A,reset:O}=await g({x:f,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:c,platform:r,elements:{reference:t,floating:e}});f=y!=null?y:f,h=v!=null?v:h,u=V(C({},u),{[w]:C(C({},u[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(c=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:f,y:h}=Nt(c,m,a)),p=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:u}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:u=0}=Z(e,t),d=Tt(u),w=l[m?h==="floating"?"reference":"floating":h],g=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),y=h==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},O=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:a}):y);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var Wt=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:l,middlewareData:a}=e,{element:c,padding:f=0}=Z(t,e)||{};if(c==null)return{};let h=Tt(f),m={x:n,y:i},u=wt(o),d=gt(u),p=await r.getDimensions(c),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),R=k?k[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=l.floating[v]||s.floating[d]);let I=A/2-O/2,H=R/2-p[d]/2-1,S=j(h[g],H),U=j(h[y],H),W=S,K=R-p[d]-U,P=R/2-p[d]/2+I,D=pt(W,P,K),J=!a.arrow&&tt(o)!=null&&P!==D&&s.reference[d]/2-(P<W?S:U)-p[d]/2<0,Y=J?P<W?P-W:P-K:0;return{[u]:m[u]+Y,data:C({[u]:D,centerOffset:P-D-Y},J&&{alignmentOffset:Y}),reset:J}}});var Vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=e,P=Z(t,e),{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=P,w=dt(P,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=q(o),y=_(l),v=q(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),O=m||(v||!p?[ct(l)]:Ft(l)),k=d!=="none";!m&&k&&O.push(...$t(l,p,d,A));let R=[l,...O],I=await yt(e,w),H=[],S=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&H.push(I[g]),h){let D=Bt(o,r,A);H.push(I[D[0]],I[D[1]])}if(S=[...S,{placement:o,overflows:H}],!H.every(D=>D<=0)){var U,W;let D=(((U=s.flip)==null?void 0:U.index)||0)+1,J=R[D];if(J&&(!(h==="alignment"?y!==_(J):!1)||S.every(B=>B.overflows[0]>0&&_(B.placement)===y)))return{data:{index:D,overflows:S},reset:{placement:J}};let Y=(W=S.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!Y)switch(u){case"bestFit":{var K;let Q=(K=S.filter(B=>{if(k){let G=_(B.placement);return G===y||G==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(G=>G>0).reduce((G,fe)=>G+fe,0)]).sort((B,G)=>B[1]-G[1])[0])==null?void 0:K[0];Q&&(Y=Q);break}case"initialPlacement":Y=l;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};async function pe(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=q(n),l=tt(n),a=_(n)==="y",c=["left","top"].includes(r)?-1:1,f=s&&a?-1:1,h=Z(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),a?{x:u*f,y:m*c}:{x:m*c,y:u*f}}var jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:l}=e,a=await pe(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:V(C({},a),{placement:r})}}}},_t=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Z(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}}}=w,a=dt(w,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},f=await yt(e,a),h=_(q(o)),m=Ct(h),u=c[m],d=c[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=u+f[g],A=u-f[y];u=pt(v,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],A=d-f[y];d=pt(v,d,A)}let p=l.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var It=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:l}=e,S=Z(t,e),{apply:a=()=>{}}=S,c=dt(S,["apply"]),f=await yt(e,c),h=q(o),m=tt(o),u=_(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-f.top-f.bottom,v=d-f.left-f.right,A=j(p-f[w],y),O=j(d-f[g],v),k=!e.middlewareData.shift,R=A,I=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let U=T(f.left,0),W=T(f.right,0),K=T(f.top,0),P=T(f.bottom,0);u?I=d-2*(U!==0||W!==0?U+W:T(f.left,f.right)):R=p-2*(K!==0||P!==0?K+P:T(f.top,f.bottom))}await a(V(C({},e),{availableWidth:I,availableHeight:R}));let H=await r.getDimensions(l.floating);return d!==H.width||p!==H.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function nt(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function L(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return xt()?t instanceof Node||t instanceof L(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof L(t).Element:!1}function N(t){return xt()?t instanceof HTMLElement||t instanceof L(t).HTMLElement:!1}function Yt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof L(t).ShadowRoot}function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function Xt(t){return["table","td","th"].includes(nt(t))}function ut(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(n){return!1}})}function vt(t){let e=bt(),n=z(t)?M(t):t;return["transform","translate","scale","rotate","perspective"].some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function Ut(t){let e=X(t);for(;N(e)&&!it(e);){if(vt(e))return e;if(ut(e))return null;e=X(e)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function it(t){return["html","body","#document"].includes(nt(t))}function M(t){return L(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function X(t){if(nt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Yt(t)&&t.host||$(t);return Yt(e)?e.host:e}function Kt(t){let e=X(t);return it(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&st(e)?e:Kt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Kt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=L(o);if(s){let l=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qt(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=N(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=at(n)!==s||at(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function Pt(t){return z(t)?t:t.contextElement}function lt(t){let e=Pt(t);if(!N(e))return F(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=Qt(e),r=(s?at(n.width):n.width)/i,l=(s?at(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var ge=F(0);function Zt(t){let e=L(t);return!bt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function we(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==L(t)?!1:e}function ot(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=Pt(t),r=F(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=we(s,n,i)?Zt(s):F(0),a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,f=o.width/r.x,h=o.height/r.y;if(s){let m=L(s),u=i&&z(i)?L(i):i,d=m,p=At(d);for(;p&&i&&u!==d;){let w=lt(p),g=p.getBoundingClientRect(),y=M(p),v=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,h*=w.y,a+=v,c+=A,d=L(p),p=At(d)}}return et({width:f,height:h,x:a,y:c})}function St(t,e){let n=ht(t).scrollLeft;return e?e.left+n:ot($(t)).left+n}function te(t,e,n){n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:St(t,i)),s=i.top+e.scrollTop;return{x:o,y:s}}function ye(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=$(i),l=e?ut(e.floating):!1;if(i===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=F(1),f=F(0),h=N(i);if((h||!h&&!s)&&((nt(i)!=="body"||st(r))&&(a=ht(i)),N(i))){let u=ot(i);c=lt(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let m=r&&!h&&!s?te(r,a,!0):F(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-a.scrollTop*c.y+f.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){let e=$(t),n=ht(t),i=t.ownerDocument.body,o=T(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=T(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+St(t),l=-n.scrollTop;return M(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}function be(t,e){let n=L(t),i=$(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;let c=bt();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function Ae(t,e){let n=ot(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=N(t)?lt(t):F(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,a=o*s.x,c=i*s.y;return{width:r,height:l,x:a,y:c}}function Gt(t,e,n){let i;if(e==="viewport")i=be(t,n);else if(e==="document")i=ve($(t));else if(z(e))i=Ae(e,n);else{let o=Zt(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return et(i)}function ee(t,e){let n=X(t);return n===e||!z(n)||it(n)?!1:M(n).position==="fixed"||ee(n,e)}function Oe(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&nt(l)!=="body"),o=null,s=M(t).position==="fixed",r=s?X(t):t;for(;z(r)&&!it(r);){let l=M(r),a=vt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(r)&&!a&&ee(t,r))?i=i.filter(f=>f!==r):o=l,r=X(r)}return e.set(t,i),i}function Ee(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:Oe(e,this._c):[].concat(n),i],l=r[0],a=r.reduce((c,f)=>{let h=Gt(e,f,o);return c.top=T(h.top,c.top),c.right=j(h.right,c.right),c.bottom=j(h.bottom,c.bottom),c.left=T(h.left,c.left),c},Gt(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){let{width:e,height:n}=Qt(t);return{width:e,height:n}}function Ce(t,e,n){let i=N(e),o=$(e),s=n==="fixed",r=ot(t,!0,s,e),l={scrollLeft:0,scrollTop:0},a=F(0);function c(){a.x=St(o)}if(i||!i&&!s)if((nt(e)!=="body"||st(o))&&(l=ht(e)),i){let u=ot(e,!0,s,e);a.x=u.x+e.clientLeft,a.y=u.y+e.clientTop}else o&&c();s&&!i&&o&&c();let f=o&&!i&&!s?te(o,l):F(0),h=r.left+l.scrollLeft-a.x-f.x,m=r.top+l.scrollTop-a.y-f.y;return{x:h,y:m,width:r.width,height:r.height}}function Lt(t){return M(t).position==="static"}function Jt(t,e){if(!N(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function ne(t,e){let n=L(t);if(ut(t))return n;if(!N(t)){let o=X(t);for(;o&&!it(o);){if(z(o)&&!Lt(o))return o;o=X(o)}return n}let i=Jt(t,e);for(;i&&Xt(i)&&Lt(i);)i=Jt(i,e);return i&&it(i)&&Lt(i)&&!vt(i)?n:i||Ut(t)||n}var Te=async function(t){let e=this.getOffsetParent||ne,n=this.getDimensions,i=await n(t.floating);return{reference:Ce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Le(t){return M(t).direction==="rtl"}var Pe={convertOffsetParentRelativeRectToViewportRelativeRect:ye,getDocumentElement:$,getClippingRect:Ee,getOffsetParent:ne,getElementRects:Te,getClientRects:xe,getDimensions:Re,getScale:lt,isElement:z,isRTL:Le};function ie(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,i,o=$(t);function s(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();let c=t.getBoundingClientRect(),{left:f,top:h,width:m,height:u}=c;if(l||e(),!m||!u)return;let d=ft(h),p=ft(o.clientWidth-(f+m)),w=ft(o.clientHeight-(h+u)),g=ft(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,j(1,a))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==a){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!ie(c,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},v),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function oe(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,c=Pt(t),f=o||s?[...c?rt(c):[],...rt(e)]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let h=c&&l?Se(c,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),c&&!a&&u.observe(c),u.observe(e));let d,p=a?ot(t):null;a&&w();function w(){let g=ot(t);p&&!ie(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(d)}}var re=jt;var se=_t,le=Vt,zt=It;var ce=Wt;var ae=(t,e,n)=>{let i=new Map,o=C({platform:Pe},n),s=V(C({},o.platform),{_c:i});return Ht(t,e,V(C({},o),{platform:s}))};var x=class extends Rt{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=oe(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[re({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(zt({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(le({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(se({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(zt({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(ce({element:this.arrowEl,padding:this.arrowPadding})),ae(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let l=getComputedStyle(this).direction==="rtl",a={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let c=s.arrow.x,f=s.arrow.y,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=l?p:"",d=l?"":p}else if(this.arrowPlacement==="end"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=l?"":p,d=l?p:"",u=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof c=="number"?"calc(50% - var(--arrow-size-diagonal))":"",h=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof c=="number"?`${c}px`:"",h=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[a]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Ot`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Ot`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Rt.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],b([Et('[part="popup"]')],x.prototype,"popup",2),b([Et('[part="arrow"]')],x.prototype,"arrowEl",2),b([E({reflect:!0})],x.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],x.prototype,"active",2),b([E({type:String,reflect:!0})],x.prototype,"placement",2),b([E({type:String,reflect:!0})],x.prototype,"strategy",2),b([E({type:Number,reflect:!0})],x.prototype,"distance",2),b([E({type:Number,reflect:!0})],x.prototype,"skidding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),b([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"flip",2),b([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],x.prototype,"flipFallbackPlacements",2),b([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),b([E({type:Object})],x.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),b([E({type:Boolean})],x.prototype,"shift",2),b([E({type:Object})],x.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),b([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),b([E()],x.prototype,"sync",2),b([E({type:Object})],x.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=b([kt("sd-5-9-0-popup")],x);export{x as a};
|
|
1
|
+
import{a as Dt}from"./chunk.26V4EXHB.js";import{a as kt,b as E,d as Et,h as Rt}from"./chunk.HDPQFCGV.js";import{b as Mt,e as Ot}from"./chunk.UWPDCU52.js";import{a as C,b as V,c as dt,e as b}from"./chunk.TJOCV4DC.js";var j=Math.min,T=Math.max,at=Math.round,ft=Math.floor,F=t=>({x:t,y:t}),ue={left:"right",right:"left",bottom:"top",top:"bottom"},he={start:"end",end:"start"};function pt(t,e,n){return T(t,j(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Ct(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function _(t){return["top","bottom"].includes(q(t))?"y":"x"}function wt(t){return Ct(_(t))}function Bt(t,e,n){n===void 0&&(n=!1);let i=tt(t),o=wt(t),s=gt(o),r=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=ct(r)),[r,ct(r)]}function Ft(t){let e=ct(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>he[e])}function de(t,e,n){let i=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?s:r;default:return[]}}function $t(t,e,n,i){let o=tt(t),s=de(q(t),n==="start",i);return o&&(s=s.map(r=>r+"-"+o),e&&(s=s.concat(s.map(mt)))),s}function ct(t){return t.replace(/left|right|bottom|top/g,e=>ue[e])}function me(t){return C({top:0,right:0,bottom:0,left:0},t)}function Tt(t){return typeof t!="number"?me(t):{top:t,right:t,bottom:t,left:t}}function et(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Nt(t,e,n){let{reference:i,floating:o}=t,s=_(e),r=wt(e),l=gt(r),a=q(e),c=s==="y",f=i.x+i.width/2-o.width/2,h=i.y+i.height/2-o.height/2,m=i[l]/2-o[l]/2,u;switch(a){case"top":u={x:f,y:i.y-o.height};break;case"bottom":u={x:f,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:h};break;case"left":u={x:i.x-o.width,y:h};break;default:u={x:i.x,y:i.y}}switch(tt(e)){case"start":u[r]-=m*(n&&c?-1:1);break;case"end":u[r]+=m*(n&&c?-1:1);break}return u}var Ht=async(t,e,n)=>{let{placement:i="bottom",strategy:o="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(e)),c=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:h}=Nt(c,i,a),m=i,u={},d=0;for(let p=0;p<l.length;p++){let{name:w,fn:g}=l[p],{x:y,y:v,data:A,reset:O}=await g({x:f,y:h,initialPlacement:i,placement:m,strategy:o,middlewareData:u,rects:c,platform:r,elements:{reference:t,floating:e}});f=y!=null?y:f,h=v!=null?v:h,u=V(C({},u),{[w]:C(C({},u[w]),A)}),O&&d<=50&&(d++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(c=O.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:o}):O.rects),{x:f,y:h}=Nt(c,m,a)),p=-1)}return{x:f,y:h,placement:m,strategy:o,middlewareData:u}};async function yt(t,e){var n;e===void 0&&(e={});let{x:i,y:o,platform:s,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:u=0}=Z(e,t),d=Tt(u),w=l[m?h==="floating"?"reference":"floating":h],g=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),y=h==="floating"?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},O=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:a}):y);return{top:(g.top-O.top+d.top)/A.y,bottom:(O.bottom-g.bottom+d.bottom)/A.y,left:(g.left-O.left+d.left)/A.x,right:(O.right-g.right+d.right)/A.x}}var Wt=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:i,placement:o,rects:s,platform:r,elements:l,middlewareData:a}=e,{element:c,padding:f=0}=Z(t,e)||{};if(c==null)return{};let h=Tt(f),m={x:n,y:i},u=wt(o),d=gt(u),p=await r.getDimensions(c),w=u==="y",g=w?"top":"left",y=w?"bottom":"right",v=w?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[u]-m[u]-s.floating[d],O=m[u]-s.reference[u],k=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c)),R=k?k[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(k)))&&(R=l.floating[v]||s.floating[d]);let I=A/2-O/2,H=R/2-p[d]/2-1,S=j(h[g],H),U=j(h[y],H),W=S,K=R-p[d]-U,P=R/2-p[d]/2+I,D=pt(W,P,K),J=!a.arrow&&tt(o)!=null&&P!==D&&s.reference[d]/2-(P<W?S:U)-p[d]/2<0,Y=J?P<W?P-W:P-K:0;return{[u]:m[u]+Y,data:C({[u]:D,centerOffset:P-D-Y},J&&{alignmentOffset:Y}),reset:J}}});var Vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;let{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:c}=e,P=Z(t,e),{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:p=!0}=P,w=dt(P,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let g=q(o),y=_(l),v=q(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),O=m||(v||!p?[ct(l)]:Ft(l)),k=d!=="none";!m&&k&&O.push(...$t(l,p,d,A));let R=[l,...O],I=await yt(e,w),H=[],S=((i=s.flip)==null?void 0:i.overflows)||[];if(f&&H.push(I[g]),h){let D=Bt(o,r,A);H.push(I[D[0]],I[D[1]])}if(S=[...S,{placement:o,overflows:H}],!H.every(D=>D<=0)){var U,W;let D=(((U=s.flip)==null?void 0:U.index)||0)+1,J=R[D];if(J&&(!(h==="alignment"?y!==_(J):!1)||S.every(B=>B.overflows[0]>0&&_(B.placement)===y)))return{data:{index:D,overflows:S},reset:{placement:J}};let Y=(W=S.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:W.placement;if(!Y)switch(u){case"bestFit":{var K;let Q=(K=S.filter(B=>{if(k){let G=_(B.placement);return G===y||G==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(G=>G>0).reduce((G,fe)=>G+fe,0)]).sort((B,G)=>B[1]-G[1])[0])==null?void 0:K[0];Q&&(Y=Q);break}case"initialPlacement":Y=l;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};async function pe(t,e){let{placement:n,platform:i,elements:o}=t,s=await(i.isRTL==null?void 0:i.isRTL(o.floating)),r=q(n),l=tt(n),a=_(n)==="y",c=["left","top"].includes(r)?-1:1,f=s&&a?-1:1,h=Z(e,t),{mainAxis:m,crossAxis:u,alignmentAxis:d}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),a?{x:u*f,y:m*c}:{x:m*c,y:u*f}}var jt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:s,placement:r,middlewareData:l}=e,a=await pe(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:V(C({},a),{placement:r})}}}},_t=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:i,placement:o}=e,w=Z(t,e),{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}}}=w,a=dt(w,["mainAxis","crossAxis","limiter"]),c={x:n,y:i},f=await yt(e,a),h=_(q(o)),m=Ct(h),u=c[m],d=c[h];if(s){let g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=u+f[g],A=u-f[y];u=pt(v,u,A)}if(r){let g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=d+f[g],A=d-f[y];d=pt(v,d,A)}let p=l.fn(V(C({},e),{[m]:u,[h]:d}));return V(C({},p),{data:{x:p.x-n,y:p.y-i,enabled:{[m]:s,[h]:r}}})}}};var It=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;let{placement:o,rects:s,platform:r,elements:l}=e,S=Z(t,e),{apply:a=()=>{}}=S,c=dt(S,["apply"]),f=await yt(e,c),h=q(o),m=tt(o),u=_(o)==="y",{width:d,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,w=m==="end"?"top":"bottom");let y=p-f.top-f.bottom,v=d-f.left-f.right,A=j(p-f[w],y),O=j(d-f[g],v),k=!e.middlewareData.shift,R=A,I=O;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(I=v),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),k&&!m){let U=T(f.left,0),W=T(f.right,0),K=T(f.top,0),P=T(f.bottom,0);u?I=d-2*(U!==0||W!==0?U+W:T(f.left,f.right)):R=p-2*(K!==0||P!==0?K+P:T(f.top,f.bottom))}await a(V(C({},e),{availableWidth:I,availableHeight:R}));let H=await r.getDimensions(l.floating);return d!==H.width||p!==H.height?{reset:{rects:!0}}:{}}}};function xt(){return typeof window!="undefined"}function nt(t){return qt(t)?(t.nodeName||"").toLowerCase():"#document"}function L(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $(t){var e;return(e=(qt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function qt(t){return xt()?t instanceof Node||t instanceof L(t).Node:!1}function z(t){return xt()?t instanceof Element||t instanceof L(t).Element:!1}function N(t){return xt()?t instanceof HTMLElement||t instanceof L(t).HTMLElement:!1}function Yt(t){return!xt()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof L(t).ShadowRoot}function st(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=M(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function Xt(t){return["table","td","th"].includes(nt(t))}function ut(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(n){return!1}})}function vt(t){let e=bt(),n=z(t)?M(t):t;return["transform","translate","scale","rotate","perspective"].some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function Ut(t){let e=X(t);for(;N(e)&&!it(e);){if(vt(e))return e;if(ut(e))return null;e=X(e)}return null}function bt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function it(t){return["html","body","#document"].includes(nt(t))}function M(t){return L(t).getComputedStyle(t)}function ht(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function X(t){if(nt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Yt(t)&&t.host||$(t);return Yt(e)?e.host:e}function Kt(t){let e=X(t);return it(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&st(e)?e:Kt(e)}function rt(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);let o=Kt(t),s=o===((i=t.ownerDocument)==null?void 0:i.body),r=L(o);if(s){let l=At(r);return e.concat(r,r.visualViewport||[],st(o)?o:[],l&&n?rt(l):[])}return e.concat(o,rt(o,[],n))}function At(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Qt(t){let e=M(t),n=parseFloat(e.width)||0,i=parseFloat(e.height)||0,o=N(t),s=o?t.offsetWidth:n,r=o?t.offsetHeight:i,l=at(n)!==s||at(i)!==r;return l&&(n=s,i=r),{width:n,height:i,$:l}}function Pt(t){return z(t)?t:t.contextElement}function lt(t){let e=Pt(t);if(!N(e))return F(1);let n=e.getBoundingClientRect(),{width:i,height:o,$:s}=Qt(e),r=(s?at(n.width):n.width)/i,l=(s?at(n.height):n.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var ge=F(0);function Zt(t){let e=L(t);return!bt()||!e.visualViewport?ge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function we(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==L(t)?!1:e}function ot(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);let o=t.getBoundingClientRect(),s=Pt(t),r=F(1);e&&(i?z(i)&&(r=lt(i)):r=lt(t));let l=we(s,n,i)?Zt(s):F(0),a=(o.left+l.x)/r.x,c=(o.top+l.y)/r.y,f=o.width/r.x,h=o.height/r.y;if(s){let m=L(s),u=i&&z(i)?L(i):i,d=m,p=At(d);for(;p&&i&&u!==d;){let w=lt(p),g=p.getBoundingClientRect(),y=M(p),v=g.left+(p.clientLeft+parseFloat(y.paddingLeft))*w.x,A=g.top+(p.clientTop+parseFloat(y.paddingTop))*w.y;a*=w.x,c*=w.y,f*=w.x,h*=w.y,a+=v,c+=A,d=L(p),p=At(d)}}return et({width:f,height:h,x:a,y:c})}function St(t,e){let n=ht(t).scrollLeft;return e?e.left+n:ot($(t)).left+n}function te(t,e,n){n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=i.left+e.scrollLeft-(n?0:St(t,i)),s=i.top+e.scrollTop;return{x:o,y:s}}function ye(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t,s=o==="fixed",r=$(i),l=e?ut(e.floating):!1;if(i===r||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=F(1),f=F(0),h=N(i);if((h||!h&&!s)&&((nt(i)!=="body"||st(r))&&(a=ht(i)),N(i))){let u=ot(i);c=lt(i),f.x=u.x+i.clientLeft,f.y=u.y+i.clientTop}let m=r&&!h&&!s?te(r,a,!0):F(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-a.scrollTop*c.y+f.y+m.y}}function xe(t){return Array.from(t.getClientRects())}function ve(t){let e=$(t),n=ht(t),i=t.ownerDocument.body,o=T(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=T(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight),r=-n.scrollLeft+St(t),l=-n.scrollTop;return M(i).direction==="rtl"&&(r+=T(e.clientWidth,i.clientWidth)-o),{width:o,height:s,x:r,y:l}}function be(t,e){let n=L(t),i=$(t),o=n.visualViewport,s=i.clientWidth,r=i.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;let c=bt();(!c||c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function Ae(t,e){let n=ot(t,!0,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft,s=N(t)?lt(t):F(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,a=o*s.x,c=i*s.y;return{width:r,height:l,x:a,y:c}}function Gt(t,e,n){let i;if(e==="viewport")i=be(t,n);else if(e==="document")i=ve($(t));else if(z(e))i=Ae(e,n);else{let o=Zt(t);i={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return et(i)}function ee(t,e){let n=X(t);return n===e||!z(n)||it(n)?!1:M(n).position==="fixed"||ee(n,e)}function Oe(t,e){let n=e.get(t);if(n)return n;let i=rt(t,[],!1).filter(l=>z(l)&&nt(l)!=="body"),o=null,s=M(t).position==="fixed",r=s?X(t):t;for(;z(r)&&!it(r);){let l=M(r),a=vt(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||st(r)&&!a&&ee(t,r))?i=i.filter(f=>f!==r):o=l,r=X(r)}return e.set(t,i),i}function Ee(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t,r=[...n==="clippingAncestors"?ut(e)?[]:Oe(e,this._c):[].concat(n),i],l=r[0],a=r.reduce((c,f)=>{let h=Gt(e,f,o);return c.top=T(h.top,c.top),c.right=j(h.right,c.right),c.bottom=j(h.bottom,c.bottom),c.left=T(h.left,c.left),c},Gt(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){let{width:e,height:n}=Qt(t);return{width:e,height:n}}function Ce(t,e,n){let i=N(e),o=$(e),s=n==="fixed",r=ot(t,!0,s,e),l={scrollLeft:0,scrollTop:0},a=F(0);function c(){a.x=St(o)}if(i||!i&&!s)if((nt(e)!=="body"||st(o))&&(l=ht(e)),i){let u=ot(e,!0,s,e);a.x=u.x+e.clientLeft,a.y=u.y+e.clientTop}else o&&c();s&&!i&&o&&c();let f=o&&!i&&!s?te(o,l):F(0),h=r.left+l.scrollLeft-a.x-f.x,m=r.top+l.scrollTop-a.y-f.y;return{x:h,y:m,width:r.width,height:r.height}}function Lt(t){return M(t).position==="static"}function Jt(t,e){if(!N(t)||M(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function ne(t,e){let n=L(t);if(ut(t))return n;if(!N(t)){let o=X(t);for(;o&&!it(o);){if(z(o)&&!Lt(o))return o;o=X(o)}return n}let i=Jt(t,e);for(;i&&Xt(i)&&Lt(i);)i=Jt(i,e);return i&&it(i)&&Lt(i)&&!vt(i)?n:i||Ut(t)||n}var Te=async function(t){let e=this.getOffsetParent||ne,n=this.getDimensions,i=await n(t.floating);return{reference:Ce(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Le(t){return M(t).direction==="rtl"}var Pe={convertOffsetParentRelativeRectToViewportRelativeRect:ye,getDocumentElement:$,getClippingRect:Ee,getOffsetParent:ne,getElementRects:Te,getClientRects:xe,getDimensions:Re,getScale:lt,isElement:z,isRTL:Le};function ie(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Se(t,e){let n=null,i,o=$(t);function s(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();let c=t.getBoundingClientRect(),{left:f,top:h,width:m,height:u}=c;if(l||e(),!m||!u)return;let d=ft(h),p=ft(o.clientWidth-(f+m)),w=ft(o.clientHeight-(h+u)),g=ft(f),v={rootMargin:-d+"px "+-p+"px "+-w+"px "+-g+"px",threshold:T(0,j(1,a))||1},A=!0;function O(k){let R=k[0].intersectionRatio;if(R!==a){if(!A)return r();R?r(!1,R):i=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!ie(c,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(O,V(C({},v),{root:o.ownerDocument}))}catch(k){n=new IntersectionObserver(O,v)}n.observe(t)}return r(!0),s}function oe(t,e,n,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,c=Pt(t),f=o||s?[...c?rt(c):[],...rt(e)]:[];f.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});let h=c&&l?Se(c,n):null,m=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&u&&(u.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=u)==null||v.observe(e)})),n()}),c&&!a&&u.observe(c),u.observe(e));let d,p=a?ot(t):null;a&&w();function w(){let g=ot(t);p&&!ie(p,g)&&n(),p=g,d=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(y=>{o&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(d)}}var re=jt;var se=_t,le=Vt,zt=It;var ce=Wt;var ae=(t,e,n)=>{let i=new Map,o=C({platform:Pe},n),s=V(C({},o.platform),{_c:i});return Ht(t,e,V(C({},o),{platform:s}))};var x=class extends Rt{constructor(){super(...arguments);this.active=!1;this.placement="top";this.strategy="absolute";this.distance=0;this.skidding=0;this.arrow=!1;this.arrowPlacement="anchor";this.arrowPadding=10;this.flip=!1;this.flipFallbackPlacements="";this.flipFallbackStrategy="best-fit";this.flipPadding=0;this.shift=!1;this.shiftPadding=0;this.autoSizePadding=0}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.start(),this.setupMutationObserver()}disconnectedCallback(){this.stop(),this.mutationObserver&&this.mutationObserver.disconnect()}async updated(n){super.updated(n),n.has("active")&&(this.active?this.start():this.stop()),n.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}setupMutationObserver(){this.mutationObserver=new MutationObserver(i=>this.handleCurrentPlacementChange(i));let n={attributes:!0};this.mutationObserver.observe(this,n)}handleCurrentPlacementChange(n){return n.forEach(i=>{if(i.attributeName==="data-current-placement"){let o=this.getAttribute("data-current-placement");this.emit("sd-current-placement",{detail:o})}})}async handleAnchorChange(){if(await this.stop(),this.anchor&&typeof this.anchor=="string"){let n=this.getRootNode();this.anchorEl=n.getElementById(this.anchor)}else this.anchor instanceof HTMLElement?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');if(this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),!this.anchorEl)throw new Error("Invalid anchor element: no anchor could be found using the anchor slot or the anchor attribute.");this.start()}start(){this.anchorEl&&(this.cleanup=oe(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(n=>{this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>n())):n()})}reposition(){if(!this.active||!this.anchorEl)return;let n=[re({mainAxis:this.distance,crossAxis:this.skidding})];this.sync?n.push(zt({apply:({rects:i})=>{let o=this.sync==="width"||this.sync==="both",s=this.sync==="height"||this.sync==="both";this.popup.style.width=o?`${i.reference.width}px`:"",this.popup.style.height=s?`${i.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.flip&&n.push(le({boundary:this.flipBoundary,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:this.flipFallbackStrategy==="best-fit"?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&n.push(se({boundary:this.shiftBoundary,padding:this.shiftPadding})),this.autoSize?n.push(zt({boundary:this.autoSizeBoundary,padding:this.autoSizePadding,apply:({availableWidth:i,availableHeight:o})=>{this.autoSize==="vertical"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-height",`${o}px`):this.style.removeProperty("--auto-size-available-height"),this.autoSize==="horizontal"||this.autoSize==="both"?this.style.setProperty("--auto-size-available-width",`${i}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&n.push(ce({element:this.arrowEl,padding:this.arrowPadding})),ae(this.anchorEl,this.popup,{placement:this.placement,middleware:n,strategy:this.strategy}).then(({x:i,y:o,middlewareData:s,placement:r})=>{let l=getComputedStyle(this).direction==="rtl",a={top:"bottom",right:"left",bottom:"top",left:"right"}[r.split("-")[0]];if(this.setAttribute("data-current-placement",r),Object.assign(this.popup.style,{left:`${i}px`,top:`${o}px`}),this.arrow){let c=s.arrow.x,f=s.arrow.y,h="",m="",u="",d="";if(this.arrowPlacement==="start"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";h=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",m=l?p:"",d=l?"":p}else if(this.arrowPlacement==="end"){let p=typeof c=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";m=l?"":p,d=l?p:"",u=typeof f=="number"?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else this.arrowPlacement==="center"?(d=typeof c=="number"?"calc(50% - var(--arrow-size-diagonal))":"",h=typeof f=="number"?"calc(50% - var(--arrow-size-diagonal))":""):(d=typeof c=="number"?`${c}px`:"",h=typeof f=="number"?`${f}px`:"");Object.assign(this.arrowEl.style,{top:h,right:m,bottom:u,left:d,[a]:"calc(var(--arrow-size-diagonal) * -1)"})}}),this.emit("sd-reposition")}render(){return Ot`<slot name="anchor" @slotchange="${this.handleAnchorChange}"></slot><div part="popup" class="${Dt("isolate",this.strategy!=="fixed"?"absolute":"fixed",!this.active&&"hidden")}"><slot></slot>${this.arrow?Ot`<div part="arrow" class="absolute rotate-45 -z-10" role="presentation"></div>`:""}</div>`}};x.styles=[...Rt.styles,Mt`:host{--arrow-color:var(--sd-color-neutral-1000);--arrow-size:6px;--arrow-size-diagonal:calc(var(--arrow-size)*0.7071);--arrow-padding-offset:calc(var(--arrow-size-diagonal) - var(--arrow-size));display:contents}[part=popup]{max-height:var(--auto-size-available-height,none);max-width:var(--auto-size-available-width,none)}[part=arrow]{background:var(--arrow-color);height:calc(var(--arrow-size-diagonal)*2);width:calc(var(--arrow-size-diagonal)*2)}`],b([Et('[part="popup"]')],x.prototype,"popup",2),b([Et('[part="arrow"]')],x.prototype,"arrowEl",2),b([E({reflect:!0})],x.prototype,"anchor",2),b([E({type:Boolean,reflect:!0})],x.prototype,"active",2),b([E({type:String,reflect:!0})],x.prototype,"placement",2),b([E({type:String,reflect:!0})],x.prototype,"strategy",2),b([E({type:Number,reflect:!0})],x.prototype,"distance",2),b([E({type:Number,reflect:!0})],x.prototype,"skidding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"arrow",2),b([E({type:String,attribute:"arrow-placement",reflect:!0})],x.prototype,"arrowPlacement",2),b([E({attribute:"arrow-padding",type:Number,reflect:!0})],x.prototype,"arrowPadding",2),b([E({type:Boolean,reflect:!0})],x.prototype,"flip",2),b([E({attribute:"flip-fallback-placements",converter:{fromAttribute:n=>n.split(" ").map(i=>i.trim()).filter(i=>i!==""),toAttribute:n=>n.join(" ")}})],x.prototype,"flipFallbackPlacements",2),b([E({type:String,attribute:"flip-fallback-strategy"})],x.prototype,"flipFallbackStrategy",2),b([E({type:Object})],x.prototype,"flipBoundary",2),b([E({attribute:"flip-padding",type:Number})],x.prototype,"flipPadding",2),b([E({type:Boolean})],x.prototype,"shift",2),b([E({type:Object})],x.prototype,"shiftBoundary",2),b([E({attribute:"shift-padding",type:Number})],x.prototype,"shiftPadding",2),b([E({type:String,attribute:"auto-size"})],x.prototype,"autoSize",2),b([E()],x.prototype,"sync",2),b([E({type:Object})],x.prototype,"autoSizeBoundary",2),b([E({attribute:"auto-size-padding",type:Number})],x.prototype,"autoSizePadding",2),x=b([kt("sd-5-10-1-popup")],x);export{x as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk.YS7YV4KF.js";import{a as z}from"./chunk.URI32NHH.js";import{a as L}from"./chunk.CDC46OKY.js";import{b as F}from"./chunk.6HLS5XU2.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.YTG5BN3U.js";import{a as P,b as V}from"./chunk.CDEXCMVF.js";import{a}from"./chunk.26V4EXHB.js";import{a as T}from"./chunk.GHC63SXL.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as s,c as p,d as v,h as y}from"./chunk.HDPQFCGV.js";import{b as C,e as r,h as k,i as D}from"./chunk.UWPDCU52.js";import{a as $,e as i}from"./chunk.TJOCV4DC.js";var g=class extends A{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==P.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return D}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=$({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),k}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(u=>{u.forEach(c=>{c.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},w=V(g);var B,S=(B=navigator.userAgentData)==null?void 0:B.brands.some(b=>b.brand.includes("Chromium")),O=S?!1:navigator.userAgent.includes("Firefox"),t=class extends y{constructor(){super(...arguments);this.formControlController=new F(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new T(this);this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.type="text";this.size="lg";this.value="";this.defaultValue="";this.placeholder="";this.label="";this.helpText="";this.clearable=!1;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.spinButtons=!1;this.form="";this.name="";this.title="";this.required=!1;this.styleOnValid=!1;this.spellcheck=!0}get valueAsDate(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.input.value=this.value;return}this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.isComposing&&this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.min===void 0||this.min===null)return!1;let e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,u="none"){this.input.setSelectionRange(e,l,u)}setRangeText(e,l,u,c){this.input.setRangeText(e,l,u,c),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),description:this.hasSlotController.test("description"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right"),tooltip:this.hasSlotController.test("tooltip")},l=this.label?!0:!!e.label,u=this.helpText?!0:!!e.helpText,c=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),U=!!e.tooltip,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",x=this.size==="sm"?"text-sm":"text-base",H={disabled:"border-neutral-500",visuallyDisabled:"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"}[f],d=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${l||U?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block":"hidden",x)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",H)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast",this.size==="lg"?"py-2":"py-1",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",f==="disabled"||f==="visuallyDisabled"?"text-neutral-500":"text-black")}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",d,o)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent",this.visuallyDisabled||this.disabled?"placeholder-neutral-500 cursor-not-allowed":"placeholder-neutral-700",this.size==="sm"?"h-6":"h-8",x)}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${z(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text invalid-message" aria-disabled="${this.visuallyDisabled||this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${c?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-9-0-icon class="${a("text-neutral-700",o)}" library="_internal" name="closing-round"></sd-5-9-0-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-5-9-0-icon class="${a(d,o)}" library="_internal" name="eye"></sd-5-9-0-icon></slot>`:r`<slot name="hide-password-icon"><sd-5-9-0-icon class="${a(d,o)}" library="_internal" name="eye-crossed-out"></sd-5-9-0-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!O?r`<sd-5-9-0-icon class="${a(d,h,o)}" library="_internal" name="calendar"></sd-5-9-0-icon>`:""} ${this.type==="time"?r`<sd-5-9-0-icon class="${a(d,h,o)}" library="_internal" name="clock"></sd-5-9-0-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-5-9-0-icon class="${a(d,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-9-0-icon></button>`:""} ${this.showInvalidStyle?r`<sd-5-9-0-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-5-9-0-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-5-9-0-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="status-check" part="valid-icon"></sd-5-9-0-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",d,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-5-9-0-icon name="system/minus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-9-0-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-5-9-0-icon name="system/plus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-9-0-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-2",u?"block":"hidden")}" aria-hidden="${!u}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...y.styles,C`:host{box-sizing:border-box;display:inline-block;position:relative;text-align:left;width:100%}:host([vertical]){display:block}:host([required]) #label:after{content:" *"}:host([visually-disabled]) input{caret-color:transparent}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-5-9-0-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}`],i([v("#input")],t.prototype,"input",2),i([v("#invalid-message")],t.prototype,"invalidMessage",2),i([p()],t.prototype,"hasFocus",2),i([p()],t.prototype,"showValidStyle",2),i([p()],t.prototype,"showInvalidStyle",2),i([s({type:String,reflect:!0})],t.prototype,"type",2),i([s({type:String,reflect:!0})],t.prototype,"size",2),i([s({type:String,reflect:!0})],t.prototype,"inputmode",2),i([s()],t.prototype,"value",2),i([L()],t.prototype,"defaultValue",2),i([s({type:String,reflect:!0})],t.prototype,"placeholder",2),i([s({type:String,reflect:!0})],t.prototype,"label",2),i([s({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),i([s({type:Boolean,reflect:!0})],t.prototype,"clearable",2),i([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([s({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([s({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([s({attribute:"password-toggle",type:Boolean,reflect:!0})],t.prototype,"passwordToggle",2),i([s({attribute:"password-visible",type:Boolean,reflect:!0})],t.prototype,"passwordVisible",2),i([s({attribute:"spin-buttons",type:Boolean,reflect:!0})],t.prototype,"spinButtons",2),i([s({type:Number,reflect:!0})],t.prototype,"minlength",2),i([s({type:Number,reflect:!0})],t.prototype,"maxlength",2),i([s({reflect:!0})],t.prototype,"min",2),i([s({reflect:!0})],t.prototype,"max",2),i([s({type:String,reflect:!0})],t.prototype,"form",2),i([s({type:String,reflect:!0})],t.prototype,"name",2),i([s({type:String,reflect:!0})],t.prototype,"title",2),i([s({type:Boolean,reflect:!0})],t.prototype,"required",2),i([s()],t.prototype,"pattern",2),i([s({reflect:!0})],t.prototype,"step",2),i([s({type:String,reflect:!0})],t.prototype,"autocapitalize",2),i([s({type:String,reflect:!0})],t.prototype,"autocorrect",2),i([s({reflect:!0})],t.prototype,"autocomplete",2),i([s({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),i([s({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),i([s({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),i([s({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],t.prototype,"spellcheck",2),i([m("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([m("step",{waitUntilFirstUpdate:!0})],t.prototype,"handleStepChange",1),i([m("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=i([E("sd-5-9-0-input")],t);export{t as a};
|
|
1
|
+
import{a as A}from"./chunk.YS7YV4KF.js";import{a as z}from"./chunk.URI32NHH.js";import{a as L}from"./chunk.CDC46OKY.js";import{b as F}from"./chunk.6HLS5XU2.js";import{a as M}from"./chunk.CGQ2BPPZ.js";import{a as n}from"./chunk.YTG5BN3U.js";import{a as P,b as V}from"./chunk.CDEXCMVF.js";import{a}from"./chunk.26V4EXHB.js";import{a as T}from"./chunk.GHC63SXL.js";import{a as m}from"./chunk.E2DRD2OX.js";import{a as E,b as s,c as p,d as v,h as y}from"./chunk.HDPQFCGV.js";import{b as C,e as r,h as k,i as D}from"./chunk.UWPDCU52.js";import{a as $,e as i}from"./chunk.TJOCV4DC.js";var g=class extends A{constructor(e){super(e);this.handlePointerDown=e=>{e.button!==0||this.host.disabled||this.spinOnLongPressCallback(e)};this.handlePointerUp=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)};if(e.type!==P.ELEMENT||!(e.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return D}update(e,[l]){return this.callbacks===void 0&&this.host===void 0&&(this.host=e.element,this.callbacks=$({},l),this.host.addEventListener("pointerdown",this.handlePointerDown)),k}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(e){var l;e.preventDefault(),e.stopPropagation(),this.timeout=setTimeout(()=>{this.timeout=void 0,this.interval=setInterval(()=>{this.callbacks.start()},50)},500),document.addEventListener("pointerup",this.handlePointerUp),(l=this.observer)==null||l.disconnect(),this.observer=new MutationObserver(u=>{u.forEach(c=>{c.attributeName==="disabled"&&this.stopSpinningAndCleanUp()})}),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var e;clearInterval(this.interval),clearTimeout(this.timeout),(e=this.observer)==null||e.disconnect()}},w=V(g);var B,S=(B=navigator.userAgentData)==null?void 0:B.brands.some(b=>b.brand.includes("Chromium")),O=S?!1:navigator.userAgent.includes("Firefox"),t=class extends y{constructor(){super(...arguments);this.formControlController=new F(this);this.hasSlotController=new M(this,"help-text","label","left","right","message","placeholder");this.localize=new T(this);this.hasFocus=!1;this.showValidStyle=!1;this.showInvalidStyle=!1;this.type="text";this.size="lg";this.value="";this.defaultValue="";this.placeholder="";this.label="";this.helpText="";this.clearable=!1;this.disabled=!1;this.visuallyDisabled=!1;this.readonly=!1;this.passwordToggle=!1;this.passwordVisible=!1;this.spinButtons=!1;this.form="";this.name="";this.title="";this.required=!1;this.styleOnValid=!1;this.spellcheck=!0}get valueAsDate(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsDate)!=null?l:null}set valueAsDate(e){let l=document.createElement("input");l.type="date",l.valueAsDate=e,this.value=l.value}get valueAsNumber(){var e,l;return(l=(e=this.input)==null?void 0:e.valueAsNumber)!=null?l:parseFloat(this.value)}set valueAsNumber(e){let l=document.createElement("input");l.type="number",l.valueAsNumber=e,this.value=l.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(e){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),e.stopPropagation()}handleSearchClick(e){this.emit("sd-search"),e.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){if(this.visuallyDisabled){this.input.value=this.value;return}this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleKeyDown(e){let l=e.metaKey||e.ctrlKey||e.shiftKey||e.altKey;e.key==="Enter"&&!l&&setTimeout(()=>{!e.defaultPrevented&&!e.isComposing&&this.formControlController.submit()})}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.min===void 0||this.min===null)return!1;let e=typeof this.min=="string"?parseFloat(this.min):this.min;return this.valueAsNumber<=e}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(this.max===void 0||this.max===null)return!1;let e=typeof this.max=="string"?parseFloat(this.max):this.max;return this.valueAsNumber>=e}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(e){this.input.focus(e)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(e,l,u="none"){this.input.setSelectionRange(e,l,u)}setRangeText(e,l,u,c){this.input.setRangeText(e,l,u,c),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var e;return(e=this.input)==null?void 0:e.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){let e={label:this.hasSlotController.test("label"),helpText:this.hasSlotController.test("help-text"),description:this.hasSlotController.test("description"),left:this.hasSlotController.test("left"),right:this.hasSlotController.test("right"),tooltip:this.hasSlotController.test("tooltip")},l=this.label?!0:!!e.label,u=this.helpText?!0:!!e.helpText,c=this.clearable&&!this.readonly&&(typeof this.value=="number"||this.value.length>0),U=!!e.tooltip,f=this.disabled?"disabled":this.visuallyDisabled&&!this.hasFocus?"visuallyDisabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",x=this.size==="sm"?"text-sm":"text-base",H={disabled:"border-neutral-500",visuallyDisabled:"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"}[f],d=this.disabled||this.visuallyDisabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],o={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return r`<div part="form-control" class="${a((this.disabled||this.visuallyDisabled)&&"cursor-not-allowed")}">${l||U?r`<div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(l?"inline-block":"hidden",x)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label> ${e.tooltip?r`<slot name="tooltip"></slot>`:""}</div>`:null}<div part="form-control-input" class="${a("relative w-full",this.disabled&&"pointer-events-none",this.visuallyDisabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default transition-[border] ease-in-out duration-medium hover:duration-fast",H)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-colors ease-in-out duration-medium hover:duration-fast",this.size==="lg"?"py-2":"py-1",!this.disabled&&!this.readonly&&!this.visuallyDisabled?"hover:bg-neutral-200":"",this.readonly?"bg-neutral-100":"bg-white",f==="disabled"||f==="visuallyDisabled"?"text-neutral-500":"text-black")}">${e.left?r`<slot name="left" part="left" class="${a("inline-flex",this.size==="sm"?"mr-1":"mr-2",d,o)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent",this.visuallyDisabled||this.disabled?"placeholder-neutral-500 cursor-not-allowed":"placeholder-neutral-700",this.size==="sm"?"h-6":"h-8",x)}" type="${this.type==="password"&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${n(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" min="${n(this.min)}" max="${n(this.max)}" step="${n(this.step)}" .value="${z(this.value)}" autocapitalize="${n(this.type==="password"?"off":this.autocapitalize)}" autocomplete="${n(this.autocomplete)}" autocorrect="${n(this.type==="password"?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${n(this.pattern)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text invalid-message" aria-disabled="${this.visuallyDisabled||this.disabled?"true":"false"}" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${c?r`<button part="clear-button" class="${a("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-5-10-1-icon class="${a("text-neutral-700",o)}" library="_internal" name="closing-round"></sd-5-10-1-icon></slot></button>`:""} ${this.passwordToggle&&this.type==="password"?r`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handlePasswordToggle}">${this.passwordVisible?r`<slot name="show-password-icon"><sd-5-10-1-icon class="${a(d,o)}" library="_internal" name="eye"></sd-5-10-1-icon></slot>`:r`<slot name="hide-password-icon"><sd-5-10-1-icon class="${a(d,o)}" library="_internal" name="eye-crossed-out"></sd-5-10-1-icon></slot>`}</button>`:""} ${(this.type==="date"||this.type==="datetime-local")&&!O?r`<sd-5-10-1-icon class="${a(d,h,o)}" library="_internal" name="calendar"></sd-5-10-1-icon>`:""} ${this.type==="time"?r`<sd-5-10-1-icon class="${a(d,h,o)}" library="_internal" name="clock"></sd-5-10-1-icon>`:""} ${this.type==="search"?r`<button class="${a("flex items-center sd-interactive",h)}" type="button" @click="${this.handleSearchClick}"><sd-5-10-1-icon class="${a(d,o)}" library="_internal" name="magnifying-glass" label="${this.localize.term("search")}"></sd-5-10-1-icon></button>`:""} ${this.showInvalidStyle?r`<sd-5-10-1-icon part="invalid-icon" class="${a("text-error",h,o)}" library="_internal" name="risk"></sd-5-10-1-icon>`:""} ${this.showValidStyle&&this.styleOnValid?r`<sd-5-10-1-icon class="${a("text-success flex-shrink-0",h,o)}" library="_internal" name="status-check" part="valid-icon"></sd-5-10-1-icon>`:""} ${e.right?r`<slot name="right" part="right" class="${a("inline-flex",d,h,o)}"></slot>`:""} ${this.type==="number"&&this.spinButtons?r`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-5-10-1-icon name="system/minus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-10-1-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${w({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-5-10-1-icon name="system/plus-circle" label="Decrease value" class="${a(d,h,o)}"></sd-5-10-1-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700 mt-2",u?"block":"hidden")}" aria-hidden="${!u}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};t.styles=[...y.styles,C`:host{box-sizing:border-box;display:inline-block;position:relative;text-align:left;width:100%}:host([vertical]){display:block}:host([required]) #label:after{content:" *"}:host([visually-disabled]) input{caret-color:transparent}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-5-10-1-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174)/var(--tw-text-opacity,1))}`],i([v("#input")],t.prototype,"input",2),i([v("#invalid-message")],t.prototype,"invalidMessage",2),i([p()],t.prototype,"hasFocus",2),i([p()],t.prototype,"showValidStyle",2),i([p()],t.prototype,"showInvalidStyle",2),i([s({type:String,reflect:!0})],t.prototype,"type",2),i([s({type:String,reflect:!0})],t.prototype,"size",2),i([s({type:String,reflect:!0})],t.prototype,"inputmode",2),i([s()],t.prototype,"value",2),i([L()],t.prototype,"defaultValue",2),i([s({type:String,reflect:!0})],t.prototype,"placeholder",2),i([s({type:String,reflect:!0})],t.prototype,"label",2),i([s({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),i([s({type:Boolean,reflect:!0})],t.prototype,"clearable",2),i([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([s({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),i([s({type:Boolean,reflect:!0})],t.prototype,"readonly",2),i([s({attribute:"password-toggle",type:Boolean,reflect:!0})],t.prototype,"passwordToggle",2),i([s({attribute:"password-visible",type:Boolean,reflect:!0})],t.prototype,"passwordVisible",2),i([s({attribute:"spin-buttons",type:Boolean,reflect:!0})],t.prototype,"spinButtons",2),i([s({type:Number,reflect:!0})],t.prototype,"minlength",2),i([s({type:Number,reflect:!0})],t.prototype,"maxlength",2),i([s({reflect:!0})],t.prototype,"min",2),i([s({reflect:!0})],t.prototype,"max",2),i([s({type:String,reflect:!0})],t.prototype,"form",2),i([s({type:String,reflect:!0})],t.prototype,"name",2),i([s({type:String,reflect:!0})],t.prototype,"title",2),i([s({type:Boolean,reflect:!0})],t.prototype,"required",2),i([s()],t.prototype,"pattern",2),i([s({reflect:!0})],t.prototype,"step",2),i([s({type:String,reflect:!0})],t.prototype,"autocapitalize",2),i([s({type:String,reflect:!0})],t.prototype,"autocorrect",2),i([s({reflect:!0})],t.prototype,"autocomplete",2),i([s({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),i([s({type:String,reflect:!0})],t.prototype,"enterkeyhint",2),i([s({type:Boolean,reflect:!0,attribute:"style-on-valid"})],t.prototype,"styleOnValid",2),i([s({type:Boolean,converter:{fromAttribute:e=>!(!e||e==="false"),toAttribute:e=>e?"true":"false"}})],t.prototype,"spellcheck",2),i([m("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),i([m("step",{waitUntilFirstUpdate:!0})],t.prototype,"handleStepChange",1),i([m("value",{waitUntilFirstUpdate:!0})],t.prototype,"handleValueChange",1),t=i([E("sd-5-10-1-input")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk.YTG5BN3U.js";import{a as o,b as l}from"./chunk.H2TKMIFR.js";import{a as n}from"./chunk.26V4EXHB.js";import{a as u}from"./chunk.GHC63SXL.js";import{a as h,b as i,d as p,h as a}from"./chunk.HDPQFCGV.js";import{b as m}from"./chunk.UWPDCU52.js";import{e as r}from"./chunk.TJOCV4DC.js";var e=class extends a{constructor(){super(...arguments);this.localize=new u(this);this.size="lg";this.selected=!1;this.toggleable=!1;this.removable=!1;this.disabled=!1;this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemove(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(t){this.tag.focus(t)}blur(){this.tag.blur()}async hide(){this.emit("sd-hide"),this.style.opacity="0",await new Promise(t=>setTimeout(t,this.token("sd-duration-fast",150))),this.hidden=!0,this.emit("sd-after-hide")}render(){let t=this.isLink(),d=t?o`a`:this.removable?o`div`:o`button`;return l`<${d} part="base" type="${s(t?void 0:"button")}" href="${s(t?this.href:void 0)}" rel="${s(t&&this.target?"noreferrer noopener":void 0)}" target="${s(t?this.target:void 0)}" download="${s(t?this.download:void 0)}" ?disabled="${s(t?void 0:this.disabled)}" aria-labelledby="content" aria-disabled="${this.disabled?"true":"false"}" aria-pressed="${s(this.toggleable?this.selected:void 0)}" tabindex="${this.disabled||this.removable?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${n("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap transition-colors duration-fast ease-in-out focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":n("border-primary text-primary disabled:border-neutral-500 disabled:text-neutral-500",this.removable?"has-[button:hover]:border-primary-500 has-[button:hover]:bg-neutral-100 has-[button:hover]:text-primary-500":"hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500"),this.disabled&&!t&&"cursor-not-allowed")}"><slot id="content" part="content"></slot>${this.removable?l`<button class="sd-interactive flex items-center" type="button" @click="${this.handleRemove}"><slot part="removable-indicator" name="removable-indicator"><sd-5-
|
|
1
|
+
import{a as s}from"./chunk.YTG5BN3U.js";import{a as o,b as l}from"./chunk.H2TKMIFR.js";import{a as n}from"./chunk.26V4EXHB.js";import{a as u}from"./chunk.GHC63SXL.js";import{a as h,b as i,d as p,h as a}from"./chunk.HDPQFCGV.js";import{b as m}from"./chunk.UWPDCU52.js";import{e as r}from"./chunk.TJOCV4DC.js";var e=class extends a{constructor(){super(...arguments);this.localize=new u(this);this.size="lg";this.selected=!1;this.toggleable=!1;this.removable=!1;this.disabled=!1;this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemove(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(t){this.tag.focus(t)}blur(){this.tag.blur()}async hide(){this.emit("sd-hide"),this.style.opacity="0",await new Promise(t=>setTimeout(t,this.token("sd-duration-fast",150))),this.hidden=!0,this.emit("sd-after-hide")}render(){let t=this.isLink(),d=t?o`a`:this.removable?o`div`:o`button`;return l`<${d} part="base" type="${s(t?void 0:"button")}" href="${s(t?this.href:void 0)}" rel="${s(t&&this.target?"noreferrer noopener":void 0)}" target="${s(t?this.target:void 0)}" download="${s(t?this.download:void 0)}" ?disabled="${s(t?void 0:this.disabled)}" aria-labelledby="content" aria-disabled="${this.disabled?"true":"false"}" aria-pressed="${s(this.toggleable?this.selected:void 0)}" tabindex="${this.disabled||this.removable?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${n("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap transition-colors duration-fast ease-in-out focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":n("border-primary text-primary disabled:border-neutral-500 disabled:text-neutral-500",this.removable?"has-[button:hover]:border-primary-500 has-[button:hover]:bg-neutral-100 has-[button:hover]:text-primary-500":"hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500"),this.disabled&&!t&&"cursor-not-allowed")}"><slot id="content" part="content"></slot>${this.removable?l`<button class="sd-interactive flex items-center" type="button" @click="${this.handleRemove}"><slot part="removable-indicator" name="removable-indicator"><sd-5-10-1-icon library="_internal" name="close" label="${this.localize.term("remove")}"></sd-5-10-1-icon></slot></button>`:""}</${d}>`}};e.styles=[...a.styles,m`:host{display:inline-block;transition-duration:.15s;transition-duration:var(--sd-duration-fast,.15s);transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}:host([size=lg])::part(removable-indicator){font-size:var(--sd-font-size-base,1rem)}:host([size=sm])::part(removable-indicator){font-size:.75rem}`],r([p("a, button, div")],e.prototype,"tag",2),r([i({type:String,reflect:!0})],e.prototype,"size",2),r([i({type:Boolean,reflect:!0})],e.prototype,"selected",2),r([i({type:Boolean,reflect:!0})],e.prototype,"toggleable",2),r([i({type:Boolean,reflect:!0})],e.prototype,"removable",2),r([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),r([i({type:String,reflect:!0})],e.prototype,"href",2),r([i({type:String,reflect:!0})],e.prototype,"target",2),r([i({reflect:!0})],e.prototype,"download",2),e=r([h("sd-5-10-1-tag")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v}from"./chunk.CGQ2BPPZ.js";import{a}from"./chunk.26V4EXHB.js";import{a as g}from"./chunk.GHC63SXL.js";import{a as f,b as d,c as l,d as h,h as p}from"./chunk.HDPQFCGV.js";import{b as m,e as s}from"./chunk.UWPDCU52.js";import{a as c}from"./chunk.WNP2V63C.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends p{constructor(){super();this.localize=new g(this);this.hasSlotController=new v(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.isTranscriptOpen=!1;this.progress=0;this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this),this.handleTranscriptDrawerToggle=this.handleTranscriptDrawerToggle.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),document.addEventListener("sd-after-hide",this.handleTranscriptDrawerToggle),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=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.progressSlider.max=this.audioElement.duration.toString()}}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())}handleTranscriptDrawerToggle(){this.isTranscriptOpen=!this.isTranscriptOpen}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0,this.handleTranscriptDrawerToggle()}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]),b=parseInt(r[2]),u=y=>y.toString(16).padStart(2,"0");return`#${u(o)}${u(n)}${u(b)}`.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 c({canvas:this.canvas,color:n,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new c({canvas:this.canvas,color:n,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new c({canvas:this.canvas,color:n,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new c({canvas:this.canvas,color:n,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new c({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")} (${this.speed}x)" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-5-9-0-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")}" title="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" class="text-3xl">${this.isPlaying?s`<slot name="pause-icon"><sd-5-9-0-icon class="text-3xl" name="pause" library="_internal"></sd-5-9-0-icon></slot>`:s`<slot name="play-icon"><sd-5-9-0-icon class="text-3xl" name="start" library="_internal"></sd-5-9-0-icon></slot>`}</sd-5-9-0-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")}" aria-label="${this.isTranscriptOpen?this.localize.term("transcriptIsOpen"):this.localize.term("openTranscript")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" part="transcript"><sd-5-9-0-icon class="w-6 h-6" name="transcript" library="_internal"></sd-5-9-0-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.isMuted?this.localize.term("unmute"):this.localize.term("mute")}" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-5-9-0-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="_internal"></sd-5-9-0-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}" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" aria-label="${this.localize.term("seekBar")}" 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-5-9-0-drawer><slot name="transcript"></slot></sd-5-9-0-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-5-9-0-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-5-9-0-button::part(motion-wrapper){border-radius:var(--sd-border-radius-full,9999px)}sd-5-9-0-button::part(label){align-items:center;display:flex;flex-grow:0}`],i([d({type:Boolean,reflect:!0,attribute:"reversed-layout"})],t.prototype,"reversedLayout",2),i([d({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],t.prototype,"hideTimestamps",2),i([d({type:Boolean,reflect:!0})],t.prototype,"animated",2),i([d({type:Boolean,reflect:!0})],t.prototype,"inverted",2),i([d({type:Number,reflect:!0})],t.prototype,"speed",2),i([l()],t.prototype,"currentTime",2),i([l()],t.prototype,"duration",2),i([l()],t.prototype,"isPlaying",2),i([l()],t.prototype,"isMuted",2),i([l()],t.prototype,"isTranscriptOpen",2),i([l()],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-5-9-0-drawer")],t.prototype,"drawer",2),i([h("canvas")],t.prototype,"canvas",2),t=i([f("sd-5-9-0-audio")],t);export{t as a};
|
|
1
|
+
import{a as v}from"./chunk.CGQ2BPPZ.js";import{a}from"./chunk.26V4EXHB.js";import{a as g}from"./chunk.GHC63SXL.js";import{a as f,b as d,c as l,d as h,h as p}from"./chunk.HDPQFCGV.js";import{b as m,e as s}from"./chunk.UWPDCU52.js";import{a as c}from"./chunk.WNP2V63C.js";import{e as i}from"./chunk.TJOCV4DC.js";var t=class extends p{constructor(){super();this.localize=new g(this);this.hasSlotController=new v(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.isTranscriptOpen=!1;this.progress=0;this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this),this.handleTranscriptDrawerToggle=this.handleTranscriptDrawerToggle.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),document.addEventListener("sd-after-hide",this.handleTranscriptDrawerToggle),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=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.progressSlider.max=this.audioElement.duration.toString()}}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())}handleTranscriptDrawerToggle(){this.isTranscriptOpen=!this.isTranscriptOpen}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0,this.handleTranscriptDrawerToggle()}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]),b=parseInt(r[2]),u=y=>y.toString(16).padStart(2,"0");return`#${u(o)}${u(n)}${u(b)}`.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 c({canvas:this.canvas,color:n,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new c({canvas:this.canvas,color:n,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new c({canvas:this.canvas,color:n,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new c({canvas:this.canvas,color:n,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new c({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")} (${this.speed}x)" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-5-10-1-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")}" title="${this.isPlaying?this.localize.term("pauseAudio"):this.localize.term("playAudio")}" class="text-3xl">${this.isPlaying?s`<slot name="pause-icon"><sd-5-10-1-icon class="text-3xl" name="pause" library="_internal"></sd-5-10-1-icon></slot>`:s`<slot name="play-icon"><sd-5-10-1-icon class="text-3xl" name="start" library="_internal"></sd-5-10-1-icon></slot>`}</sd-5-10-1-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")}" aria-label="${this.isTranscriptOpen?this.localize.term("transcriptIsOpen"):this.localize.term("openTranscript")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" part="transcript"><sd-5-10-1-icon class="w-6 h-6" name="transcript" library="_internal"></sd-5-10-1-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.isMuted?this.localize.term("unmute"):this.localize.term("mute")}" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-5-10-1-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="_internal"></sd-5-10-1-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}" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" aria-label="${this.localize.term("seekBar")}" 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-5-10-1-drawer><slot name="transcript"></slot></sd-5-10-1-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-5-10-1-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-5-10-1-button::part(motion-wrapper){border-radius:var(--sd-border-radius-full,9999px)}sd-5-10-1-button::part(label){align-items:center;display:flex;flex-grow:0}`],i([d({type:Boolean,reflect:!0,attribute:"reversed-layout"})],t.prototype,"reversedLayout",2),i([d({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],t.prototype,"hideTimestamps",2),i([d({type:Boolean,reflect:!0})],t.prototype,"animated",2),i([d({type:Boolean,reflect:!0})],t.prototype,"inverted",2),i([d({type:Number,reflect:!0})],t.prototype,"speed",2),i([l()],t.prototype,"currentTime",2),i([l()],t.prototype,"duration",2),i([l()],t.prototype,"isPlaying",2),i([l()],t.prototype,"isMuted",2),i([l()],t.prototype,"isTranscriptOpen",2),i([l()],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-5-10-1-drawer")],t.prototype,"drawer",2),i([h("canvas")],t.prototype,"canvas",2),t=i([f("sd-5-10-1-audio")],t);export{t as a};
|
|
@@ -8,4 +8,4 @@ import{b as f,c as y}from"./chunk.6HLS5XU2.js";import{a as g}from"./chunk.CGQ2BP
|
|
|
8
8
|
disabled:text-neutral-500 disabled:border-neutral-500`,tertiary:this.inverted?`${this.visuallyDisabled?"text-neutral-600 hover:text-neutral-600 active:text-neutral-600":"text-white hover:text-primary-100 active:text-primary-200"}
|
|
9
9
|
disabled:text-neutral-600`:`${this.visuallyDisabled?"text-neutral-500 hover:text-neutral-500 active:text-neutral-500":"text-primary hover:text-primary-500 active:text-primary-800"}
|
|
10
10
|
disabled:text-neutral-500`,cta:`text-white ${this.visuallyDisabled?"bg-neutral-500 hover:bg-neutral-500 active:bg-neutral-500":"bg-accent-500"}
|
|
11
|
-
${this.inverted?"disabled:bg-neutral-600":"disabled:bg-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${a(r?void 0:this.disabled)}" type="${a(r?void 0:this.type)}" title="${this.title}" name="${a(r?void 0:this.name)}" value="${a(r?void 0:this.value)}" href="${a(r?this.href:void 0)}" target="${a(r?this.target:void 0)}" download="${a(r?this.download:void 0)}" rel="${a(r&&this.target?"noreferrer noopener":void 0)}" role="${a(r?void 0:"button")}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-labelledby="content" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @invalid="${this.isButton()?this.handleInvalid:null}" @click="${this.handleClick}"><div part="motion-wrapper" class="${l("absolute inset-0 rounded-default -z-10 overflow-hidden pointer-events-none ",(this.disabled||this.visuallyDisabled)&&"hidden")}"><div class="absolute inset-0 w-full h-full transition-all duration-fast translate-y-full group-hover:translate-y-0 group-hover:mt-[-22%] mt-[11%]"><div class="${l("absolute right-0 min-w-full min-h-full aspect-square skew-y-[-11deg] mt-[11%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div><div class="${l("absolute w-full h-full mt-[22%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div></div></div><slot name="icon-left" part="icon-left" class="${l("flex flex-auto items-center justify-end pointer-events-none",s["icon-only"]&&"hidden",this.loading&&"invisible",s["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" id="content" class="${l("inline-flex items-center justify-center",s["icon-only"]&&"pointer-events-none",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${l("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",s["icon-only"]&&"hidden",s["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?u`<sd-5-
|
|
11
|
+
${this.inverted?"disabled:bg-neutral-600":"disabled:bg-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${a(r?void 0:this.disabled)}" type="${a(r?void 0:this.type)}" title="${this.title}" name="${a(r?void 0:this.name)}" value="${a(r?void 0:this.value)}" href="${a(r?this.href:void 0)}" target="${a(r?this.target:void 0)}" download="${a(r?this.download:void 0)}" rel="${a(r&&this.target?"noreferrer noopener":void 0)}" role="${a(r?void 0:"button")}" aria-disabled="${this.disabled||this.visuallyDisabled?"true":"false"}" aria-labelledby="content" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @invalid="${this.isButton()?this.handleInvalid:null}" @click="${this.handleClick}"><div part="motion-wrapper" class="${l("absolute inset-0 rounded-default -z-10 overflow-hidden pointer-events-none ",(this.disabled||this.visuallyDisabled)&&"hidden")}"><div class="absolute inset-0 w-full h-full transition-all duration-fast translate-y-full group-hover:translate-y-0 group-hover:mt-[-22%] mt-[11%]"><div class="${l("absolute right-0 min-w-full min-h-full aspect-square skew-y-[-11deg] mt-[11%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div><div class="${l("absolute w-full h-full mt-[22%]",{primary:this.inverted?"bg-primary-100 group-active:bg-primary-200":"bg-primary-500 group-active:bg-primary-800",secondary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",tertiary:this.inverted?"bg-primary-500 group-active:bg-primary-800":"bg-primary-100 group-active:bg-primary-200",cta:"bg-accent-550 group-active:bg-accent-700"}[this.variant])}"></div></div></div><slot name="icon-left" part="icon-left" class="${l("flex flex-auto items-center justify-end pointer-events-none",s["icon-only"]&&"hidden",this.loading&&"invisible",s["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" id="content" class="${l("inline-flex items-center justify-center",s["icon-only"]&&"pointer-events-none",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${l("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",s["icon-only"]&&"hidden",s["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?u`<sd-5-10-1-spinner class="${l("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-5-10-1-spinner>`:""}</${o}>`}};t.styles=[...n.styles,c`:host{cursor:pointer;display:inline-block;position:relative;width:var(--sd-spacing-auto,auto);z-index:0}sd-5-10-1-spinner{--indicator-color:currentColor;--track-color:var(--tw-varcolor-200)}::slotted(sd-5-10-1-badge){pointer-events:none;position:absolute;right:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);--tw-translate-x:50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}::slotted(sd-5-10-1-icon),sd-5-10-1-spinner{font-size:calc(var(--tw-varspacing)/2)}`],e([h("a, button")],t.prototype,"button",2),e([b({selector:"sd-5-10-1-icon"})],t.prototype,"_iconsInDefaultSlot",2),e([p()],t.prototype,"invalid",2),e([i({type:String,reflect:!0})],t.prototype,"title",2),e([i({type:String,reflect:!0})],t.prototype,"variant",2),e([i({type:Boolean,reflect:!0})],t.prototype,"inverted",2),e([i({type:String,reflect:!0})],t.prototype,"size",2),e([i({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([i({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),e([i({type:Boolean,reflect:!0})],t.prototype,"loading",2),e([i({type:String,reflect:!0})],t.prototype,"type",2),e([i({type:String,reflect:!0})],t.prototype,"name",2),e([i()],t.prototype,"value",2),e([i({type:String,reflect:!0})],t.prototype,"href",2),e([i({type:String,reflect:!0})],t.prototype,"target",2),e([i({reflect:!0})],t.prototype,"download",2),e([i({reflect:!0})],t.prototype,"form",2),e([i({attribute:"formaction"})],t.prototype,"formAction",2),e([i({attribute:"formenctype"})],t.prototype,"formEnctype",2),e([i({attribute:"formmethod"})],t.prototype,"formMethod",2),e([i({attribute:"formnovalidate",type:Boolean})],t.prototype,"formNoValidate",2),e([i({attribute:"formtarget"})],t.prototype,"formTarget",2),e([v("disabled",{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),t=e([m("sd-5-10-1-button")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as v}from"./chunk.GHC63SXL.js";import{a as c,b as o,d,h as l}from"./chunk.HDPQFCGV.js";import{b as p,e as i}from"./chunk.UWPDCU52.js";import{e as a}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.localize=new v(this);this.playing=!1;this.isBelowBreakpoint=!1;this.hasSlotController=new h(this,"[default]","play-icon","poster")}get poster(){let t=this.shadowRoot.querySelector("slot[name=poster]");return(t==null?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}get video(){return this.querySelector("video")}async hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0",await new Promise(t=>setTimeout(t,this.token("sd-duration-medium",300))),this.poster.style.display="none")}setVideoInert(t){var s,n;t?(s=this.video)==null||s.setAttribute("inert",""):(n=this.video)==null||n.removeAttribute("inert")}play(){var t;this.emit("sd-play"),this.playing=!0,(t=this.video)==null||t.play(),this.hidePoster(),this.setVideoInert(!1)}handleKeydown(t){t instanceof KeyboardEvent&&(t.key==="Enter"||t.key===" ")&&(this.play(),setTimeout(()=>{var s;(s=this.video)==null||s.focus()}))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.setVideoInert(!0),this.resizeObserver=new ResizeObserver(()=>this.handleButtonResize()),this.updateComplete.then(()=>{this.resizeObserver.observe(this.hostEl)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return i`<div part="base" class="cursor-pointer"><button part="play-button" aria-label="${this.localize.term("playVideo")}" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${r(this.playing&&"pointer-events-none","group w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${r(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition outline-2 outline-offset-2 group-focus-visible:outline")}"><slot name="play-icon" part="play-icon" class="${r(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-5-
|
|
1
|
+
import{a as h}from"./chunk.CGQ2BPPZ.js";import{a as r}from"./chunk.26V4EXHB.js";import{a as v}from"./chunk.GHC63SXL.js";import{a as c,b as o,d,h as l}from"./chunk.HDPQFCGV.js";import{b as p,e as i}from"./chunk.UWPDCU52.js";import{e as a}from"./chunk.TJOCV4DC.js";var e=class extends l{constructor(){super(...arguments);this.localize=new v(this);this.playing=!1;this.isBelowBreakpoint=!1;this.hasSlotController=new h(this,"[default]","play-icon","poster")}get poster(){let t=this.shadowRoot.querySelector("slot[name=poster]");return(t==null?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}get video(){return this.querySelector("video")}async hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0",await new Promise(t=>setTimeout(t,this.token("sd-duration-medium",300))),this.poster.style.display="none")}setVideoInert(t){var s,n;t?(s=this.video)==null||s.setAttribute("inert",""):(n=this.video)==null||n.removeAttribute("inert")}play(){var t;this.emit("sd-play"),this.playing=!0,(t=this.video)==null||t.play(),this.hidePoster(),this.setVideoInert(!1)}handleKeydown(t){t instanceof KeyboardEvent&&(t.key==="Enter"||t.key===" ")&&(this.play(),setTimeout(()=>{var s;(s=this.video)==null||s.focus()}))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.setVideoInert(!0),this.resizeObserver=new ResizeObserver(()=>this.handleButtonResize()),this.updateComplete.then(()=>{this.resizeObserver.observe(this.hostEl)})}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return i`<div part="base" class="cursor-pointer"><button part="play-button" aria-label="${this.localize.term("playVideo")}" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${r(this.playing&&"pointer-events-none","group w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${r(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition outline-2 outline-offset-2 group-focus-visible:outline")}"><slot name="play-icon" part="play-icon" class="${r(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-5-10-1-icon id="default-play-icon" library="_internal" name="start"></sd-5-10-1-icon></slot></div></button> ${this.hasSlotController.test("poster")?i`<div part="poster-wrapper" class="absolute left-0 top-0 w-full z-10 overflow-hidden"><slot name="poster" role="presentation"></slot></div>`:null}<slot></slot></div>`}};e.styles=[...l.styles,p`:host{display:inline-block;overflow:hidden;position:relative}.play-pause-transition,::slotted([slot=poster]){--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:.15s;transition-duration:var(--sd-duration-medium,.3s);transition-property:opacity,transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}#default-play-icon,::slotted([slot=play-icon]){left:50%;position:absolute;top:50%;--tw-translate-x:-50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}:has([part=play-button]:hover) ::slotted([slot=poster]){--tw-scale-x:1.1!important;--tw-scale-y:1.1!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}`],a([d("[part=base]")],e.prototype,"hostEl",2),a([o({type:Boolean,reflect:!0})],e.prototype,"playing",2),a([o({type:Boolean})],e.prototype,"isBelowBreakpoint",2),e=a([c("sd-5-10-1-video")],e);export{e as a};
|
|
@@ -7,4 +7,4 @@ import{a as i}from"./chunk.YTG5BN3U.js";import{a as n,b as l}from"./chunk.H2TKMI
|
|
|
7
7
|
</svg> `,place:`
|
|
8
8
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75">
|
|
9
9
|
<path fill-rule="evenodd" d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z" clip-rule="evenodd" />
|
|
10
|
-
</svg>`}}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}isLink(){return!!this.href}render(){let s=this.isLink(),o=this.notInteractive?n`div`:s?n`a`:n`button`,d=h(this.marker[this.variant]),m=`url("data:image/svg+xml;utf8,${encodeURIComponent(this.marker[this.variant]).replace(/#/g,"%23")}")`;return l`<${o} part="base" class="${r("relative flex justify-center",!this.notInteractive&&"group focus-visible:focus-outline")}" href="${i(s?this.href:void 0)}" target="${i(s?this.target:void 0)}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" role="${i(this.notInteractive||s?void 0:"button")}" aria-label="${i(!this.notInteractive&&this.label?this.label:void 0)}" aria-labelledby="${i(!this.notInteractive&&!this.label?"content":void 0)}"><div part="marker" class="${r("relative inline-flex",this.animated&&(this.variant==="main"||this.variant==="place")&&"animate-bounce-once",this.variant==="cluster"&&this.state==="hover"&&"scale-110 fill-primary-500",this.variant==="cluster"&&!this.notInteractive&&"transition-transform duration-fast ease-in-out hover:scale-110",{cluster:"fill-primary",main:"fill-accent",place:"fill-white"}[this.variant])}"><div id="motion-wrapper" part="motion-wrapper" class="absolute inset-0 overflow-hidden pointer-events-none" style="mask-image:${m};-webkit-mask-image:${m}"><div class="${r("absolute inset-0 transition-transform ease-in-out duration-fast translate-y-full group-hover:translate-y-0 group-active:translate-y-0",["hover","active"].includes(this.state)&&"!translate-y-0")}"><div class="${r("min-w-full min-h-full skew-y-[-11deg]",{cluster:"bg-primary-500",main:this.state==="active"?"bg-accent-700":"bg-accent-550 group-active:bg-accent-700",place:this.state==="active"?"bg-primary-200":"bg-primary-100 group-active:bg-primary-200"}[this.variant])}"></div></div>${this.variant==="main"?l`<div id="marker-circle" class="absolute rounded-full bg-white"></div>`:""}</div>${d} ${this.variant==="cluster"?l`<div id="cluster-border" class="${r("absolute inset-0 bg-primary opacity-30 rounded-full",this.state==="hover"&&"bg-primary-500")}"></div>`:""}</div><div id="content" part="content" class="${r("absolute self-center pointer-events-none",this.variant==="cluster"&&"font-bold text-white")}"><slot></slot></div></${o}>`}};t.styles=[...c.styles,v`:host{display:block}#motion-wrapper{mask-position:center;-webkit-mask-position:center;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-size:contain;-webkit-mask-size:contain}:host([variant=cluster]) [part=base],svg{width:calc(var(--sd-spacing-12,3rem)*var(--map-marker-scaling,1))}:host([variant=cluster]) [part=base]{height:calc(var(--sd-spacing-12,3rem)*var(--map-marker-scaling,1))}:host(:not([variant=cluster])) [part=base]{height:calc(var(--sd-spacing-16,4rem)*var(--map-marker-scaling,1))}:host([variant=cluster]) [part=content]{font-size:calc(var(--sd-font-size-sm,.875rem)*var(--map-marker-scaling,1))}:host([variant=place]) [part=content]{font-size:calc(var(--sd-font-size-3xl,2rem)*var(--map-marker-scaling,1));margin-top:calc(var(--sd-spacing-2,.5rem)*-1)}:host([variant=main]) [part=marker],:host([variant=place]) [part=marker]{--tw-drop-shadow:drop-shadow(var(--sd-shadow,0px 1px 3px #515151));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host([variant=main]) #marker-circle{height:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));left:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));right:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));top:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));width:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1))}`],e([a({type:String,reflect:!0})],t.prototype,"variant",2),e([a({type:String,reflect:!0})],t.prototype,"state",2),e([a({type:Boolean,reflect:!0})],t.prototype,"animated",2),e([a({type:Boolean,reflect:!0,attribute:"not-interactive"})],t.prototype,"notInteractive",2),e([a({type:String,reflect:!0})],t.prototype,"href",2),e([a({type:String,reflect:!0})],t.prototype,"target",2),e([a({reflect:!0})],t.prototype,"label",2),t=e([p("sd-5-
|
|
10
|
+
</svg>`}}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}isLink(){return!!this.href}render(){let s=this.isLink(),o=this.notInteractive?n`div`:s?n`a`:n`button`,d=h(this.marker[this.variant]),m=`url("data:image/svg+xml;utf8,${encodeURIComponent(this.marker[this.variant]).replace(/#/g,"%23")}")`;return l`<${o} part="base" class="${r("relative flex justify-center",!this.notInteractive&&"group focus-visible:focus-outline")}" href="${i(s?this.href:void 0)}" target="${i(s?this.target:void 0)}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" role="${i(this.notInteractive||s?void 0:"button")}" aria-label="${i(!this.notInteractive&&this.label?this.label:void 0)}" aria-labelledby="${i(!this.notInteractive&&!this.label?"content":void 0)}"><div part="marker" class="${r("relative inline-flex",this.animated&&(this.variant==="main"||this.variant==="place")&&"animate-bounce-once",this.variant==="cluster"&&this.state==="hover"&&"scale-110 fill-primary-500",this.variant==="cluster"&&!this.notInteractive&&"transition-transform duration-fast ease-in-out hover:scale-110",{cluster:"fill-primary",main:"fill-accent",place:"fill-white"}[this.variant])}"><div id="motion-wrapper" part="motion-wrapper" class="absolute inset-0 overflow-hidden pointer-events-none" style="mask-image:${m};-webkit-mask-image:${m}"><div class="${r("absolute inset-0 transition-transform ease-in-out duration-fast translate-y-full group-hover:translate-y-0 group-active:translate-y-0",["hover","active"].includes(this.state)&&"!translate-y-0")}"><div class="${r("min-w-full min-h-full skew-y-[-11deg]",{cluster:"bg-primary-500",main:this.state==="active"?"bg-accent-700":"bg-accent-550 group-active:bg-accent-700",place:this.state==="active"?"bg-primary-200":"bg-primary-100 group-active:bg-primary-200"}[this.variant])}"></div></div>${this.variant==="main"?l`<div id="marker-circle" class="absolute rounded-full bg-white"></div>`:""}</div>${d} ${this.variant==="cluster"?l`<div id="cluster-border" class="${r("absolute inset-0 bg-primary opacity-30 rounded-full",this.state==="hover"&&"bg-primary-500")}"></div>`:""}</div><div id="content" part="content" class="${r("absolute self-center pointer-events-none",this.variant==="cluster"&&"font-bold text-white")}"><slot></slot></div></${o}>`}};t.styles=[...c.styles,v`:host{display:block}#motion-wrapper{mask-position:center;-webkit-mask-position:center;mask-repeat:no-repeat;-webkit-mask-repeat:no-repeat;mask-size:contain;-webkit-mask-size:contain}:host([variant=cluster]) [part=base],svg{width:calc(var(--sd-spacing-12,3rem)*var(--map-marker-scaling,1))}:host([variant=cluster]) [part=base]{height:calc(var(--sd-spacing-12,3rem)*var(--map-marker-scaling,1))}:host(:not([variant=cluster])) [part=base]{height:calc(var(--sd-spacing-16,4rem)*var(--map-marker-scaling,1))}:host([variant=cluster]) [part=content]{font-size:calc(var(--sd-font-size-sm,.875rem)*var(--map-marker-scaling,1))}:host([variant=place]) [part=content]{font-size:calc(var(--sd-font-size-3xl,2rem)*var(--map-marker-scaling,1));margin-top:calc(var(--sd-spacing-2,.5rem)*-1)}:host([variant=main]) [part=marker],:host([variant=place]) [part=marker]{--tw-drop-shadow:drop-shadow(var(--sd-shadow,0px 1px 3px #515151));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}:host([variant=main]) #marker-circle{height:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));left:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));right:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));top:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1));width:calc(var(--sd-spacing-4,1rem)*var(--map-marker-scaling,1))}`],e([a({type:String,reflect:!0})],t.prototype,"variant",2),e([a({type:String,reflect:!0})],t.prototype,"state",2),e([a({type:Boolean,reflect:!0})],t.prototype,"animated",2),e([a({type:Boolean,reflect:!0,attribute:"not-interactive"})],t.prototype,"notInteractive",2),e([a({type:String,reflect:!0})],t.prototype,"href",2),e([a({type:String,reflect:!0})],t.prototype,"target",2),e([a({reflect:!0})],t.prototype,"label",2),t=e([p("sd-5-10-1-map-marker")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk.BBD6RMZH.js";import{a as d,b as u}from"./chunk.CGQ2BPPZ.js";import{a as l}from"./chunk.26V4EXHB.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as h,b as a,d as o,h as n}from"./chunk.HDPQFCGV.js";import{b as c,e as i}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.type="normal";this.checked=!1;this.disabled=!1;this.value="";this.chevron=!1;this.hasSlotController=new d(this,"submenu");this.submenuController=new p(this,this.hasSlotController);this.handleHostClick=s=>{this.disabled&&(s.preventDefault(),s.stopImmediatePropagation())};this.handleMouseOver=s=>{this.focus(),s.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=!1,console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}this.type==="checkbox"?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.setAttribute("tabindex",this.disabled?"-1":"0")}handleTypeChange(){this.type==="checkbox"?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return u(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){let s=this.submenuController.isExpanded(),b={label:this.hasSlotController.test("[default]"),iconIndent:this.hasSlotController.test("icon-indent")};return i`<div id="anchor" part="base" class="${l("relative flex items-stretch whitespace-nowrap py-3 px-4 no-wrap",this.disabled?"outline-none cursor-not-allowed text-neutral-500 hover:bg-transparent":"cursor-pointer text-primary hover:bg-neutral-200",this.isSubmenu()&&s&&"submenu-expanded")}" .disabled="${this.disabled}" ?aria-haspopup="${this.isSubmenu()}" ?aria-expanded="${!!s}">${this.type==="checkbox"?i`<span part="checked-icon" class="${l("flex items-center justify-center grow-0 shrink-0 basis-auto",this.checked?"visible":"invisible")}"><sd-5-
|
|
1
|
+
import{a as p}from"./chunk.BBD6RMZH.js";import{a as d,b as u}from"./chunk.CGQ2BPPZ.js";import{a as l}from"./chunk.26V4EXHB.js";import{a as r}from"./chunk.E2DRD2OX.js";import{a as h,b as a,d as o,h as n}from"./chunk.HDPQFCGV.js";import{b as c,e as i}from"./chunk.UWPDCU52.js";import{e as t}from"./chunk.TJOCV4DC.js";var e=class extends n{constructor(){super(...arguments);this.type="normal";this.checked=!1;this.disabled=!1;this.value="";this.chevron=!1;this.hasSlotController=new d(this,"submenu");this.submenuController=new p(this,this.hasSlotController);this.handleHostClick=s=>{this.disabled&&(s.preventDefault(),s.stopImmediatePropagation())};this.handleMouseOver=s=>{this.focus(),s.stopPropagation()}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.handleHostClick),this.addEventListener("mouseover",this.handleMouseOver)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleHostClick),this.removeEventListener("mouseover",this.handleMouseOver)}handleDefaultSlotChange(){let s=this.getTextLabel();if(typeof this.cachedTextLabel=="undefined"){this.cachedTextLabel=s;return}s!==this.cachedTextLabel&&(this.cachedTextLabel=s,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleCheckedChange(){if(this.checked&&this.type!=="checkbox"){this.checked=!1,console.error('The checked attribute can only be used on menu items with type="checkbox"',this);return}this.type==="checkbox"?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.setAttribute("tabindex",this.disabled?"-1":"0")}handleTypeChange(){this.type==="checkbox"?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))}getTextLabel(){return u(this.defaultSlot)}isSubmenu(){return this.hasSlotController.test("submenu")}render(){let s=this.submenuController.isExpanded(),b={label:this.hasSlotController.test("[default]"),iconIndent:this.hasSlotController.test("icon-indent")};return i`<div id="anchor" part="base" class="${l("relative flex items-stretch whitespace-nowrap py-3 px-4 no-wrap",this.disabled?"outline-none cursor-not-allowed text-neutral-500 hover:bg-transparent":"cursor-pointer text-primary hover:bg-neutral-200",this.isSubmenu()&&s&&"submenu-expanded")}" .disabled="${this.disabled}" ?aria-haspopup="${this.isSubmenu()}" ?aria-expanded="${!!s}">${this.type==="checkbox"?i`<span part="checked-icon" class="${l("flex items-center justify-center grow-0 shrink-0 basis-auto",this.checked?"visible":"invisible")}"><sd-5-10-1-icon name="status-check" library="sd-status-assets" aria-hidden="true"></sd-5-10-1-icon></span>`:""} ${b.iconIndent?i`<slot name="icon-indent" part="icon-indent" class="flex items-center grow-0 shrink-0 basis-auto mr-2"></slot>`:""}<slot part="label" class="inline-flex grow shrink basis-auto text-ellipsis overflow-hidden" @slotchange="${this.handleDefaultSlotChange}"></slot>${this.chevron||this.isSubmenu()?i`<span part="submenu-icon" class="flex items-center justify-center grow-0 shrink-0 basis-auto ml-3"><sd-5-10-1-icon name="chevron-right" library="_internal" aria-hidden="true" class="h-6 w-6"></sd-5-10-1-icon></span>`:""} ${this.submenuController.renderSubmenu()}</div>`}};e.styles=[...n.styles,c`:host{--submenu-offset:-6px;display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}::slotted(sd-5-10-1-icon){height:var(--sd-spacing-6,1.5rem);width:var(--sd-spacing-6,1.5rem)}[part=checked-icon]{margin-right:var(--sd-spacing-3,.75rem)}.submenu-expanded:after{bottom:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);position:fixed;right:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);z-index:calc(var(z-dropdown) - 1);--tw-content:"";clip-path:polygon(var(--safe-triangle-cursor-x,0) var(--safe-triangle-cursor-y,0),var(--safe-triangle-submenu-start-x,0) var(--safe-triangle-submenu-start-y,0),var(--safe-triangle-submenu-end-x,0) var(--safe-triangle-submenu-end-y,0));content:var(--tw-content)}:host(:hover:not([aria-disabled=true],:focus-visible)) [part=base]{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-200,233 233 233)/var(--tw-bg-opacity,1));outline:2px solid transparent;outline-offset:2px}:host(:focus-visible:not([aria-disabled=true])) [part=base]{outline-color:rgb(var(--sd-color-primary,0 53 142)/1);outline-offset:-2px;outline-style:solid;outline-width:2px}:host(:hover) [part=base]{outline:2px solid transparent;outline-offset:2px}sd-5-10-1-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity,1));margin-left:var(--submenu-offset)}::slotted(sd-5-10-1-menu){max-height:var(--auto-size-available-height)!important;max-width:var(--auto-size-available-width)!important}`],t([o("slot:not([name])")],e.prototype,"defaultSlot",2),t([o('part="base"')],e.prototype,"menuItem",2),t([a()],e.prototype,"type",2),t([a({type:Boolean,reflect:!0})],e.prototype,"checked",2),t([a({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([a()],e.prototype,"value",2),t([a({type:Boolean,reflect:!0})],e.prototype,"chevron",2),t([r("checked")],e.prototype,"handleCheckedChange",1),t([r("disabled")],e.prototype,"handleDisabledChange",1),t([r("type")],e.prototype,"handleTypeChange",1),e=t([h("sd-5-10-1-menu-item")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk.CGQ2BPPZ.js";import{a as p}from"./chunk.YTG5BN3U.js";import{a as n}from"./chunk.26V4EXHB.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as u,b as r,c as b,d as o,h as a}from"./chunk.HDPQFCGV.js";import{b as d,e as l}from"./chunk.UWPDCU52.js";import{e as s}from"./chunk.TJOCV4DC.js";var t=class extends a{constructor(){super(...arguments);this.hasSlotController=new c(this,"[default]","icon");this.hasFocus=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(e){if(this.disabled||this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false")}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){let e=this.hasSlotController.test("[default]"),i=this.hasSlotController.test("icon"),m=`${this.size}-${e?"label":"no-label"}`;return l`<div part="base" role="presentation" class="relative"><button part="${`button${this.checked?" button--checked":""}`}" role="radio" aria-checked="${this.checked}" class="${n("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline",this.size==="sm"?"text-sm":"text-base",this.checked&&!this.disabled&&!this.visuallyDisabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":(this.disabled||this.visuallyDisabled)&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":(this.disabled||this.visuallyDisabled)&&this.checked?"text-neutral-500 border-neutral-500 hover:cursor-not-allowed ":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",e&&"px-4",this.hasFocus&&"focused-class",e&&"button--has-label",i&&"button--has-icon flex gap-2",m)}" aria-disabled="${this.disabled||this.visuallyDisabled}" type="button" value="${p(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${n(i&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!i}"></slot>${e?l`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};t.styles=[...a.styles,d`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;inset:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);outline-color:rgb(var(--sd-color-error,204 25 55)/1);outline-style:dotted;outline-width:1px;position:absolute;z-index:-10}.lg-label,.lg-no-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{width:var(--sd-spacing-12,3rem)}.md-label,.md-no-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{width:var(--sd-spacing-10,2.5rem)}.sm-label,.sm-no-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{width:var(--sd-spacing-8,2rem)}:host(.sd-5-
|
|
1
|
+
import{a as c}from"./chunk.CGQ2BPPZ.js";import{a as p}from"./chunk.YTG5BN3U.js";import{a as n}from"./chunk.26V4EXHB.js";import{a as h}from"./chunk.E2DRD2OX.js";import{a as u,b as r,c as b,d as o,h as a}from"./chunk.HDPQFCGV.js";import{b as d,e as l}from"./chunk.UWPDCU52.js";import{e as s}from"./chunk.TJOCV4DC.js";var t=class extends a{constructor(){super(...arguments);this.hasSlotController=new c(this,"[default]","icon");this.hasFocus=!1;this.size="lg";this.disabled=!1;this.visuallyDisabled=!1;this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(e){if(this.disabled||this.visuallyDisabled){e.preventDefault(),e.stopPropagation();return}this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){let e=this.disabled||this.visuallyDisabled;this.setAttribute("aria-disabled",e?"true":"false")}focus(e){this.input.focus(e)}blur(){this.input.blur()}render(){let e=this.hasSlotController.test("[default]"),i=this.hasSlotController.test("icon"),m=`${this.size}-${e?"label":"no-label"}`;return l`<div part="base" role="presentation" class="relative"><button part="${`button${this.checked?" button--checked":""}`}" role="radio" aria-checked="${this.checked}" class="${n("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline",this.size==="sm"?"text-sm":"text-base",this.checked&&!this.disabled&&!this.visuallyDisabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":(this.disabled||this.visuallyDisabled)&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":(this.disabled||this.visuallyDisabled)&&this.checked?"text-neutral-500 border-neutral-500 hover:cursor-not-allowed ":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",e&&"px-4",this.hasFocus&&"focused-class",e&&"button--has-label",i&&"button--has-icon flex gap-2",m)}" aria-disabled="${this.disabled||this.visuallyDisabled}" type="button" value="${p(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${n(i&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!i}"></slot>${e?l`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};t.styles=[...a.styles,d`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;inset:var(--sd-spacing-0,0);opacity:var(--sd-opacity-0,0);outline-color:rgb(var(--sd-color-error,204 25 55)/1);outline-style:dotted;outline-width:1px;position:absolute;z-index:-10}.lg-label,.lg-no-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{width:var(--sd-spacing-12,3rem)}.md-label,.md-no-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{width:var(--sd-spacing-10,2.5rem)}.sm-label,.sm-no-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{width:var(--sd-spacing-8,2rem)}:host(.sd-5-10-1-button-group__button--first:not(.sd-5-10-1-button-group__button--last)) button{border-bottom-right-radius:var(--sd-border-radius-none,0);border-top-right-radius:var(--sd-border-radius-none,0)}:host(.sd-5-10-1-button-group__button--inner) button{border-radius:var(--sd-border-radius-none,0)}:host(.sd-5-10-1-button-group__button--last:not(.sd-5-10-1-button-group__button--first)) button{border-bottom-left-radius:var(--sd-border-radius-none,0);border-top-left-radius:var(--sd-border-radius-none,0)}:host(.sd-5-10-1-button-group__button:not(.sd-5-10-1-button-group__button--first)){margin-inline-start:-1px}:host(.sd-5-10-1-button-group__button--hover){z-index:10}:host(.sd-5-10-1-button-group__button--focus),:host(.sd-5-10-1-button-group__button[checked]){z-index:20}`],s([o(".button")],t.prototype,"input",2),s([o(".hidden-input")],t.prototype,"hiddenInput",2),s([b()],t.prototype,"hasFocus",2),s([r({type:String,reflect:!0})],t.prototype,"size",2),s([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),s([r({type:Boolean,reflect:!0,attribute:"visually-disabled"})],t.prototype,"visuallyDisabled",2),s([r({type:Boolean,reflect:!0})],t.prototype,"checked",2),s([r()],t.prototype,"value",2),s([h(["disabled","visually-disabled"],{waitUntilFirstUpdate:!0})],t.prototype,"handleDisabledChange",1),t=s([u("sd-5-10-1-radio-button")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk.26V4EXHB.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as h,b as r,d as f,h as n}from"./chunk.HDPQFCGV.js";import{b as o,e as c}from"./chunk.UWPDCU52.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;this.label=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0;let t;this.steps.forEach((i,a)=>{i.index=a+1,i.size=this.size,i.orientation=this.orientation,this.notInteractive?(i.current=!1,i.disabled=!1,i.notInteractive=!0):i.current&&(t=a)}),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-5-
|
|
1
|
+
import{a as m}from"./chunk.26V4EXHB.js";import{a as l}from"./chunk.E2DRD2OX.js";import{a as h,b as r,d as f,h as n}from"./chunk.HDPQFCGV.js";import{b as o,e as c}from"./chunk.UWPDCU52.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;this.label=""}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0;let t;this.steps.forEach((i,a)=>{i.index=a+1,i.size=this.size,i.orientation=this.orientation,this.notInteractive?(i.current=!1,i.disabled=!1,i.notInteractive=!0):i.current&&(t=a)}),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-5-10-1-step")}setActiveStep(t){t>=0&&t<this.steps.length&&!this.notInteractive&&(this.activeStep=t,this.steps.forEach((i,a)=>{a===t?i.current=!0:a>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" aria-label="${this.label}"><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([r({type:String,reflect:!0})],e.prototype,"size",2),s([r({type:String,reflect:!0})],e.prototype,"orientation",2),s([r({type:Number,reflect:!0,attribute:"active-step"})],e.prototype,"activeStep",2),s([r({type:Boolean,reflect:!0,attribute:"not-interactive"})],e.prototype,"notInteractive",2),s([r({type:String,reflect:!0})],e.prototype,"label",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-5-10-1-step-group")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n,b as i,g as c,h as o}from"./chunk.HDPQFCGV.js";import{b as a,e as l}from"./chunk.UWPDCU52.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-5-
|
|
1
|
+
import{a as n,b as i,g as c,h as o}from"./chunk.HDPQFCGV.js";import{b as a,e as l}from"./chunk.UWPDCU52.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-5-10-1-accordion:not(:first-of-type)){margin-top:-1px}`],t([c({selector:"sd-5-10-1-accordion"})],e.prototype,"_accordionsInDefaultSlot",2),t([i({attribute:"close-others",type:Boolean,reflect:!0})],e.prototype,"closeOthers",2),e=t([n("sd-5-10-1-accordion-group")],e);export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk.CGQ2BPPZ.js";import{a as s}from"./chunk.YTG5BN3U.js";import{a as c,b as i}from"./chunk.H2TKMIFR.js";import{a}from"./chunk.26V4EXHB.js";import{a as b}from"./chunk.GHC63SXL.js";import{a as v,b as r,d as m,h}from"./chunk.HDPQFCGV.js";import{b as f}from"./chunk.UWPDCU52.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends h{constructor(){super(...arguments);this.hasSlotController=new w(this,"[default]","description","children");this.localize=new b(this);this.vertical=!1;this.size="md";this.current=!1;this.disabled=!1;this.chevron=!1;this.relaxed=!1;this.divider=!1;this.indented=!1;this.open=!1;this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.href&&this.hasSlotController.test("children")}handleClickButton(n){this.disabled&&(n.preventDefault(),n.stopPropagation())}handleClickSummary(n){n.preventDefault(),n.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.isAccordion&&!this.isLink?c`summary`:this.separated?c`div`:this.isLink?c`a`:c`button`}render(){let n=this.tag,l=this.isLink,u=this.isButton,o=this.isAccordion,d={label:this.hasSlotController.test("[default]"),main:this.hasSlotController.test("main"),description:this.hasSlotController.test("description"),children:this.hasSlotController.test("children")},x=this.vertical?"py-3":"py-2",p=i`<${n} part="base" class="${a("cursor-pointer relative focus-visible:focus-outline",{md:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",this.current&&"font-bold",o?"flex flex-col":"inline-block w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-colors duration-fast ease-in-out min-h-[48px] px-4")}" aria-current="${s(this.current?"page":void 0)}" aria-disabled="${this.disabled}" ?disabled="${s(u?this.disabled:void 0)}" href="${s(l?this.href:void 0)}" target="${s(l?this.target:void 0)}" download="${s(l?this.download:void 0)}" rel="${s(l&&this.target?"noreferrer noopener":void 0)}" role="${l?"link":"button"}" tabindex="${this.disabled||this.separated?"-1":"0"}" @click="${this.separated?void 0:o?this.handleClickSummary:u?this.handleClickButton:void 0}"><div part="current-indicator" class="${a("absolute bg-accent left-0 pointer-events-none",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-[calc(100%-16px)] bottom-0 left-2 group-hover:w-full group-hover:left-0",this.disabled&&"bg-neutral-500")}"></div><span part="content-area" class="${a("relative inline-flex justify-between items-center",o?"grow":"w-full",d.description&&"pt-3",d.description||this.separated?"pb-1":x,this.calculatePaddingX)}">${this.divider&&this.vertical?i`<sd-5-
|
|
1
|
+
import{a as w}from"./chunk.CGQ2BPPZ.js";import{a as s}from"./chunk.YTG5BN3U.js";import{a as c,b as i}from"./chunk.H2TKMIFR.js";import{a}from"./chunk.26V4EXHB.js";import{a as b}from"./chunk.GHC63SXL.js";import{a as v,b as r,d as m,h}from"./chunk.HDPQFCGV.js";import{b as f}from"./chunk.UWPDCU52.js";import{e}from"./chunk.TJOCV4DC.js";var t=class extends h{constructor(){super(...arguments);this.hasSlotController=new w(this,"[default]","description","children");this.localize=new b(this);this.vertical=!1;this.size="md";this.current=!1;this.disabled=!1;this.chevron=!1;this.relaxed=!1;this.divider=!1;this.indented=!1;this.open=!1;this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.href&&this.hasSlotController.test("children")}handleClickButton(n){this.disabled&&(n.preventDefault(),n.stopPropagation())}handleClickSummary(n){n.preventDefault(),n.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.isAccordion&&!this.isLink?c`summary`:this.separated?c`div`:this.isLink?c`a`:c`button`}render(){let n=this.tag,l=this.isLink,u=this.isButton,o=this.isAccordion,d={label:this.hasSlotController.test("[default]"),main:this.hasSlotController.test("main"),description:this.hasSlotController.test("description"),children:this.hasSlotController.test("children")},x=this.vertical?"py-3":"py-2",p=i`<${n} part="base" class="${a("cursor-pointer relative focus-visible:focus-outline",{md:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",this.current&&"font-bold",o?"flex flex-col":"inline-block w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-colors duration-fast ease-in-out min-h-[48px] px-4")}" aria-current="${s(this.current?"page":void 0)}" aria-disabled="${this.disabled}" ?disabled="${s(u?this.disabled:void 0)}" href="${s(l?this.href:void 0)}" target="${s(l?this.target:void 0)}" download="${s(l?this.download:void 0)}" rel="${s(l&&this.target?"noreferrer noopener":void 0)}" role="${l?"link":"button"}" tabindex="${this.disabled||this.separated?"-1":"0"}" @click="${this.separated?void 0:o?this.handleClickSummary:u?this.handleClickButton:void 0}"><div part="current-indicator" class="${a("absolute bg-accent left-0 pointer-events-none",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-[calc(100%-16px)] bottom-0 left-2 group-hover:w-full group-hover:left-0",this.disabled&&"bg-neutral-500")}"></div><span part="content-area" class="${a("relative inline-flex justify-between items-center",o?"grow":"w-full",d.description&&"pt-3",d.description||this.separated?"pb-1":x,this.calculatePaddingX)}">${this.divider&&this.vertical?i`<sd-5-10-1-divider part="divider" class="${a("w-full transition-all absolute -top-0.25 left-0",this.calculatePaddingX)}"></sd-5-10-1-divider>`:""} <span part="content-container" class="inline-flex items-center flex-auto">${this.separated?i`<a class="${a("mr-4 w-full inline-flex items-center pl-4 cursor-pointer relative focus-visible:focus-outline hover:bg-neutral-200 group transition-colors duration-fast ease-in-out min-h-[48px]",!d.description&&"py-4")}" href="${s(l?this.href:void 0)}" target="${s(l?this.target:void 0)}" download="${s(l?this.download:void 0)}"><slot part="content" class="inline-flex"></slot></a>`:i`<slot part="content" class="inline-flex"></slot>`} </span>${(this.chevron||d.children)&&this.vertical?this.separated?i`<button type="button" title="${this.open?this.localize.term("collapseNavigationItem"):this.localize.term("expandNavigationItem")}" class="sd-interactive sd-interactive--reset" @click="${this.handleClickSummary}"><sd-5-10-1-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${a("m-4 h-6 w-6 transition-all",o||this.separated?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-10-1-icon></button>`:i`<sd-5-10-1-icon name="chevron-down" part="chevron" library="_internal" color="currentColor" class="${a("h-6 w-6 ml-2 transition-all",o?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-5-10-1-icon>`:""} </span>${d.description&&this.vertical?i`<slot name="description" part="description" class="${a("inline-block text-sm text-left text-black pb-3",o||this.separated?"grow":"w-full",this.separated?"px-4":this.calculatePaddingX)}"></slot>`:""}</${n}>`;return o?i`<details aria-expanded="${this.open}" part="details" id="navigation-item-details" ?open="${this.open}" class="relative">${p}<slot name="children"></slot></details>`:this.separated?i`<div part="details" id="navigation-item-details" class="relative flex flex-col">${p}${this.open?i`<slot name="children"></slot>`:""}</div>`:i`${p}`}};t.styles=[...h.styles,f`:host{box-sizing:border-box;display:inline-block;position:relative}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}[part=current-indicator]{--tw-scale-x:0;--tw-scale-y:0;opacity:var(--sd-opacity-0,0);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition-duration:var(--sd-duration-fast,.15s);transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,opacity var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out var(--sd-duration-fast)}:host([current]) [part=current-indicator]{--tw-scale-x:1;--tw-scale-y:1;opacity:var(--sd-opacity-100,1);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));transition:width var(--sd-duration-fast) ease-in-out,height var(--sd-duration-fast) ease-in-out,left var(--sd-duration-fast) ease-in-out,top var(--sd-duration-fast) ease-in-out,transform var(--sd-duration-fast) ease-in-out}`],e([m('a[part="base"], button[part="base"]')],t.prototype,"button",2),e([r({type:Boolean,reflect:!0})],t.prototype,"vertical",2),e([r({type:String,reflect:!0})],t.prototype,"size",2),e([r({reflect:!0})],t.prototype,"href",2),e([r({type:String,reflect:!0})],t.prototype,"target",2),e([r({reflect:!0})],t.prototype,"download",2),e([r({type:Boolean,reflect:!0})],t.prototype,"current",2),e([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([r({type:Boolean,reflect:!0})],t.prototype,"chevron",2),e([r({type:Boolean,reflect:!0})],t.prototype,"relaxed",2),e([r({type:Boolean,reflect:!0})],t.prototype,"divider",2),e([r({type:Boolean,reflect:!0})],t.prototype,"indented",2),e([r({type:Boolean,reflect:!0})],t.prototype,"open",2),e([r({type:Boolean,reflect:!0})],t.prototype,"separated",2),t=e([v("sd-5-10-1-navigation-item")],t);export{t as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk.GHC63SXL.js";import{a as p,d as f,h as u}from"./chunk.HDPQFCGV.js";import{b as c,e as h}from"./chunk.UWPDCU52.js";import{e as d}from"./chunk.TJOCV4DC.js";var i=class extends u{constructor(){super(...arguments);this.localize=new g(this)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){let t=["menuitem","menuitemcheckbox"],n=e.composedPath(),r=n.find(s=>{var m;return t.includes(((m=s==null?void 0:s.getAttribute)==null?void 0:m.call(s,"role"))||"")});if(!r||n.find(s=>{var m;return((m=s==null?void 0:s.getAttribute)==null?void 0:m.call(s,"role"))==="menu"})!==this)return;let a=r;a.type==="checkbox"&&(a.checked=!a.checked),this.emit("sd-select",{detail:{item:a}})}handleKeyDown(e){if(e.key==="Enter"||e.key===" "){let t=this.getCurrentItem();e.preventDefault(),e.stopPropagation(),t==null||t.click()}else if(["ArrowDown","ArrowUp","Home","End"].includes(e.key)){let t=this.getAllItems(),n=this.getCurrentItem(),r=n?t.indexOf(n):0;if(t.length>0){e.preventDefault(),e.stopPropagation();let l=(o,a)=>{let s=o;for(let m of t)if(s=(s+a+t.length)%t.length,!t[s].disabled)return s;return o};if(e.key==="ArrowDown")r=l(r,1);else if(e.key==="ArrowUp")r=l(r,-1);else if(e.key==="Home")r=t.findIndex(o=>!o.disabled),r===-1&&(r=0);else if(e.key==="End"){r=t.length-1;for(let o=t.length-1;o>=0;o--)if(!t[o].disabled){r=o;break}}this.setCurrentItem(t[r]),t[r].focus()}}}handleMouseDown(e){let t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){let e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){var t;return e.tagName.toLowerCase()==="sd-5-
|
|
1
|
+
import{a as g}from"./chunk.GHC63SXL.js";import{a as p,d as f,h as u}from"./chunk.HDPQFCGV.js";import{b as c,e as h}from"./chunk.UWPDCU52.js";import{e as d}from"./chunk.TJOCV4DC.js";var i=class extends u{constructor(){super(...arguments);this.localize=new g(this)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}handleClick(e){let t=["menuitem","menuitemcheckbox"],n=e.composedPath(),r=n.find(s=>{var m;return t.includes(((m=s==null?void 0:s.getAttribute)==null?void 0:m.call(s,"role"))||"")});if(!r||n.find(s=>{var m;return((m=s==null?void 0:s.getAttribute)==null?void 0:m.call(s,"role"))==="menu"})!==this)return;let a=r;a.type==="checkbox"&&(a.checked=!a.checked),this.emit("sd-select",{detail:{item:a}})}handleKeyDown(e){if(e.key==="Enter"||e.key===" "){let t=this.getCurrentItem();e.preventDefault(),e.stopPropagation(),t==null||t.click()}else if(["ArrowDown","ArrowUp","Home","End"].includes(e.key)){let t=this.getAllItems(),n=this.getCurrentItem(),r=n?t.indexOf(n):0;if(t.length>0){e.preventDefault(),e.stopPropagation();let l=(o,a)=>{let s=o;for(let m of t)if(s=(s+a+t.length)%t.length,!t[s].disabled)return s;return o};if(e.key==="ArrowDown")r=l(r,1);else if(e.key==="ArrowUp")r=l(r,-1);else if(e.key==="Home")r=t.findIndex(o=>!o.disabled),r===-1&&(r=0);else if(e.key==="End"){r=t.length-1;for(let o=t.length-1;o>=0;o--)if(!t[o].disabled){r=o;break}}this.setCurrentItem(t[r]),t[r].focus()}}}handleMouseDown(e){let t=e.target;this.isMenuItem(t)&&this.setCurrentItem(t)}handleSlotChange(){let e=this.getAllItems();e.length>0&&this.setCurrentItem(e[0])}isMenuItem(e){var t;return e.tagName.toLowerCase()==="sd-5-10-1-menu-item"||["menuitem","menuitemcheckbox","menuitemradio"].includes((t=e.getAttribute("role"))!=null?t:"")}getAllItems(){return[...this.defaultSlot.assignedElements({flatten:!0})].filter(e=>!!this.isMenuItem(e))}getCurrentItem(){return this.getAllItems().find(e=>e.getAttribute("tabindex")==="0")}setCurrentItem(e){this.getAllItems().forEach(n=>{n.setAttribute("tabindex",n===e?"0":"-1")})}render(){return h`<slot @slotchange="${this.handleSlotChange}" @click="${this.handleClick}" @keydown="${this.handleKeyDown}" @mousedown="${this.handleMouseDown}"></slot>`}};i.styles=[...u.styles,c`:host{border-radius:var(--sd-border-radius-md,.375rem);display:block;overflow:auto;overscroll-behavior:auto;padding:var(--sd-spacing-3,.75rem) var(--sd-spacing-2,.5rem);position:relative;--tw-shadow:var(--sd-shadow,0px 1px 3px 0px rgba(81,81,81,.75))!important;--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color)!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}::slotted(sd-5-10-1-divider){padding-bottom:var(--sd-spacing-3,.75rem);padding-top:var(--sd-spacing-3,.75rem)}`],d([f("slot")],i.prototype,"defaultSlot",2),i=d([p("sd-5-10-1-menu")],i);export{i as a};
|