@solid-design-system/components 4.6.12 → 4.6.13
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.3CZQFEYM.js +1 -0
- package/cdn/components/notification/notification.d.ts +0 -4
- package/cdn/components/notification/notification.js +1 -1
- package/cdn/custom-elements.json +1 -1
- package/cdn/solid-components.bundle.js +14 -14
- package/cdn/solid-components.iife.js +14 -14
- package/cdn/solid-components.js +1 -1
- package/cdn/web-types.json +1 -1
- package/cdn-versioned/_components/menu/menu.js +1 -1
- package/cdn-versioned/_components/menu/menu.styles.js +1 -1
- package/cdn-versioned/_components/menu-item/menu-item.js +2 -2
- package/cdn-versioned/chunks/chunk.3CZQFEYM.js +1 -0
- package/cdn-versioned/chunks/chunk.3LNKE2CG.js +1 -1
- package/cdn-versioned/chunks/chunk.4YCOU55E.js +2 -2
- package/cdn-versioned/chunks/chunk.65NSSTJE.js +1 -1
- package/cdn-versioned/chunks/chunk.6G6DPUNG.js +1 -1
- package/cdn-versioned/chunks/chunk.6NP6ACYF.js +1 -1
- package/cdn-versioned/chunks/chunk.6WMAE6EM.js +1 -1
- package/cdn-versioned/chunks/chunk.7QJPML7E.js +1 -1
- package/cdn-versioned/chunks/chunk.7R5WVKOU.js +1 -1
- package/cdn-versioned/chunks/chunk.7VF3CHZ2.js +1 -1
- package/cdn-versioned/chunks/chunk.A2HHAWSZ.js +1 -1
- package/cdn-versioned/chunks/chunk.A4472UE3.js +1 -1
- package/cdn-versioned/chunks/chunk.AULSVEYK.js +1 -1
- package/cdn-versioned/chunks/chunk.C7TENCCC.js +1 -1
- package/cdn-versioned/chunks/chunk.CDEAOHOV.js +1 -1
- package/cdn-versioned/chunks/chunk.CEVVDV52.js +1 -1
- package/cdn-versioned/chunks/chunk.CJHO2CRN.js +1 -1
- package/cdn-versioned/chunks/chunk.CNGICFLY.js +1 -1
- package/cdn-versioned/chunks/chunk.CRUS5X5G.js +1 -1
- package/cdn-versioned/chunks/chunk.EAAM3VG2.js +3 -3
- package/cdn-versioned/chunks/chunk.EQSUVFCF.js +1 -1
- package/cdn-versioned/chunks/chunk.ETYUJIA4.js +1 -1
- package/cdn-versioned/chunks/chunk.FK5LYWC7.js +1 -1
- package/cdn-versioned/chunks/chunk.FPWMHC7P.js +1 -1
- package/cdn-versioned/chunks/chunk.FYIER3I3.js +1 -1
- package/cdn-versioned/chunks/chunk.G3JDMNCB.js +1 -1
- package/cdn-versioned/chunks/chunk.G5HXH4DJ.js +1 -1
- package/cdn-versioned/chunks/chunk.GG4532YR.js +1 -1
- package/cdn-versioned/chunks/chunk.HLHBWQSY.js +1 -1
- package/cdn-versioned/chunks/chunk.IMSUZE4K.js +1 -1
- package/cdn-versioned/chunks/chunk.KMWJUXQH.js +1 -1
- package/cdn-versioned/chunks/chunk.KSYRDJ33.js +1 -1
- package/cdn-versioned/chunks/chunk.L2PFOOBK.js +1 -1
- package/cdn-versioned/chunks/chunk.L7T6YEYN.js +1 -1
- package/cdn-versioned/chunks/chunk.LSAUVFWV.js +1 -1
- package/cdn-versioned/chunks/chunk.M7NPMAK2.js +1 -1
- package/cdn-versioned/chunks/chunk.MT35MRN2.js +1 -1
- package/cdn-versioned/chunks/chunk.NTK6WXO7.js +1 -1
- package/cdn-versioned/chunks/chunk.O62YAWLB.js +4 -4
- package/cdn-versioned/chunks/chunk.OCOLBSJK.js +2 -2
- package/cdn-versioned/chunks/chunk.P2CPGH2M.js +1 -1
- package/cdn-versioned/chunks/chunk.QE3HRWOD.js +4 -4
- package/cdn-versioned/chunks/chunk.QJK7ON6G.js +1 -1
- package/cdn-versioned/chunks/chunk.QX6EC2OV.js +1 -1
- package/cdn-versioned/chunks/chunk.RCNLUAML.js +1 -1
- package/cdn-versioned/chunks/chunk.RTOLPQCZ.js +1 -1
- package/cdn-versioned/chunks/chunk.SA2YRNVP.js +1 -1
- package/cdn-versioned/chunks/chunk.TGMCWOXL.js +1 -1
- package/cdn-versioned/chunks/chunk.TWHESFGL.js +1 -1
- package/cdn-versioned/chunks/chunk.UJZJOR6Z.js +1 -1
- package/cdn-versioned/chunks/chunk.W7A3TU2Z.js +1 -1
- package/cdn-versioned/chunks/chunk.YICLGCNM.js +1 -1
- package/cdn-versioned/chunks/chunk.ZDACAU6O.js +1 -1
- package/cdn-versioned/components/accordion/accordion.d.ts +1 -1
- package/cdn-versioned/components/accordion-group/accordion-group.d.ts +1 -1
- package/cdn-versioned/components/animation/animation.d.ts +1 -1
- package/cdn-versioned/components/audio/audio.d.ts +1 -1
- package/cdn-versioned/components/badge/badge.d.ts +1 -1
- package/cdn-versioned/components/brandshape/brandshape.d.ts +1 -1
- package/cdn-versioned/components/button/button.d.ts +1 -1
- package/cdn-versioned/components/button-group/button-group.d.ts +1 -1
- package/cdn-versioned/components/carousel/carousel.d.ts +1 -1
- package/cdn-versioned/components/carousel-item/carousel-item.d.ts +1 -1
- package/cdn-versioned/components/checkbox/checkbox.d.ts +1 -1
- package/cdn-versioned/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/cdn-versioned/components/combobox/combobox.d.ts +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/navigation-item/navigation-item.d.ts +1 -1
- package/cdn-versioned/components/notification/notification.d.ts +1 -5
- package/cdn-versioned/components/notification/notification.js +1 -1
- package/cdn-versioned/components/optgroup/optgroup.d.ts +2 -2
- package/cdn-versioned/components/option/option.d.ts +1 -1
- package/cdn-versioned/components/popup/popup.d.ts +1 -1
- package/cdn-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/cdn-versioned/components/radio/radio.d.ts +1 -1
- package/cdn-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/cdn-versioned/components/radio-group/radio-group.d.ts +2 -2
- package/cdn-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/cdn-versioned/components/select/select.d.ts +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 +1 -1
- package/cdn-versioned/components/tab/tab.d.ts +1 -1
- package/cdn-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/cdn-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/cdn-versioned/components/tag/tag.d.ts +1 -1
- package/cdn-versioned/components/textarea/textarea.d.ts +1 -1
- package/cdn-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/cdn-versioned/components/video/video.d.ts +1 -1
- package/cdn-versioned/custom-elements.json +211 -211
- package/cdn-versioned/internal/form.js +3 -3
- package/cdn-versioned/solid-components.bundle.js +20 -20
- package/cdn-versioned/solid-components.css +2 -2
- package/cdn-versioned/solid-components.iife.js +20 -20
- package/cdn-versioned/solid-components.js +1 -1
- package/cdn-versioned/vscode.html-custom-data.json +80 -80
- package/cdn-versioned/web-types.json +137 -137
- package/dist/chunks/{chunk.SYPP74RS.js → chunk.QB4ZOKFD.js} +26 -44
- package/dist/components/notification/notification.d.ts +0 -4
- package/dist/components/notification/notification.js +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/solid-components.js +1 -1
- package/dist/web-types.json +1 -1
- package/dist-versioned/_components/menu/menu.js +1 -1
- package/dist-versioned/_components/menu/menu.styles.js +1 -1
- package/dist-versioned/_components/menu-item/menu-item.js +2 -2
- package/dist-versioned/chunks/chunk.2J5UWA4O.js +6 -6
- package/dist-versioned/chunks/chunk.2ROGEIKB.js +2 -2
- package/dist-versioned/chunks/chunk.5GXWP6YW.js +2 -2
- package/dist-versioned/chunks/chunk.5H3SWQYU.js +2 -2
- package/dist-versioned/chunks/chunk.5PZUOPFS.js +4 -4
- package/dist-versioned/chunks/chunk.6DKXZWRN.js +4 -4
- package/dist-versioned/chunks/chunk.7HZNYBYX.js +2 -2
- package/dist-versioned/chunks/chunk.AIC2K6F6.js +2 -2
- package/dist-versioned/chunks/chunk.BCX6GWFU.js +1 -1
- package/dist-versioned/chunks/chunk.BLEQBK6L.js +2 -2
- package/dist-versioned/chunks/chunk.BTFVVZN7.js +2 -2
- package/dist-versioned/chunks/chunk.C3OAT5IL.js +8 -8
- package/dist-versioned/chunks/chunk.COLY2AS3.js +3 -3
- package/dist-versioned/chunks/chunk.DCMNY5PW.js +1 -1
- package/dist-versioned/chunks/chunk.DCOXCIL6.js +5 -5
- package/dist-versioned/chunks/chunk.DDQ43DMG.js +1 -1
- package/dist-versioned/chunks/chunk.DRFKZJ6U.js +2 -2
- package/dist-versioned/chunks/chunk.EJADH4TP.js +2 -2
- package/dist-versioned/chunks/chunk.G6HSZF64.js +1 -1
- package/dist-versioned/chunks/chunk.GG6EDMMX.js +1 -1
- package/dist-versioned/chunks/chunk.GR4QWBKR.js +2 -2
- package/dist-versioned/chunks/chunk.HY3UDFFO.js +3 -3
- package/dist-versioned/chunks/chunk.IGLAKKCM.js +2 -2
- package/dist-versioned/chunks/chunk.IJO3II3P.js +2 -2
- package/dist-versioned/chunks/chunk.IUDU7IPQ.js +3 -3
- package/dist-versioned/chunks/chunk.IZJ3ASKW.js +2 -2
- package/dist-versioned/chunks/chunk.JKMRTFLI.js +1 -1
- package/dist-versioned/chunks/chunk.KDKAOP5K.js +5 -5
- package/dist-versioned/chunks/chunk.KVKRZJS7.js +3 -3
- package/dist-versioned/chunks/chunk.LHDIK3CL.js +1 -1
- package/dist-versioned/chunks/chunk.LMZE7CWI.js +2 -2
- package/dist-versioned/chunks/chunk.MHSIUMF2.js +5 -5
- package/dist-versioned/chunks/chunk.N4PCVM2O.js +1 -1
- package/dist-versioned/chunks/chunk.PAMIVTVZ.js +1 -1
- package/dist-versioned/chunks/{chunk.SYPP74RS.js → chunk.QB4ZOKFD.js} +30 -48
- package/dist-versioned/chunks/chunk.QGTHHUEP.js +11 -11
- package/dist-versioned/chunks/chunk.QJSVVX5A.js +5 -5
- package/dist-versioned/chunks/chunk.RSBV2TUF.js +3 -3
- package/dist-versioned/chunks/chunk.RX6EYXKU.js +1 -1
- package/dist-versioned/chunks/chunk.SA5CVRAH.js +1 -1
- package/dist-versioned/chunks/chunk.SH4PL7NS.js +26 -26
- package/dist-versioned/chunks/chunk.SONGMTFR.js +5 -5
- package/dist-versioned/chunks/chunk.TOAVJJSV.js +2 -2
- package/dist-versioned/chunks/chunk.UIQBHPD3.js +2 -2
- package/dist-versioned/chunks/chunk.ULJ5M2KG.js +1 -1
- package/dist-versioned/chunks/chunk.V2GCDMDD.js +9 -9
- package/dist-versioned/chunks/chunk.V32MUHC2.js +1 -1
- package/dist-versioned/chunks/chunk.VJYNSYQW.js +1 -1
- package/dist-versioned/chunks/chunk.WE6ILGOF.js +13 -13
- package/dist-versioned/chunks/chunk.XG3WGOFU.js +23 -23
- package/dist-versioned/chunks/chunk.ZFWQYTKN.js +14 -14
- package/dist-versioned/chunks/chunk.ZTC7JGWI.js +6 -6
- package/dist-versioned/chunks/chunk.ZW2FQM2X.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/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/navigation-item/navigation-item.d.ts +1 -1
- package/dist-versioned/components/notification/notification.d.ts +1 -5
- package/dist-versioned/components/notification/notification.js +1 -1
- package/dist-versioned/components/optgroup/optgroup.d.ts +2 -2
- package/dist-versioned/components/option/option.d.ts +1 -1
- package/dist-versioned/components/popup/popup.d.ts +1 -1
- package/dist-versioned/components/quickfact/quickfact.d.ts +1 -1
- package/dist-versioned/components/radio/radio.d.ts +1 -1
- package/dist-versioned/components/radio-button/radio-button.d.ts +1 -1
- package/dist-versioned/components/radio-group/radio-group.d.ts +2 -2
- package/dist-versioned/components/scrollable/scrollable.d.ts +1 -1
- package/dist-versioned/components/select/select.d.ts +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 +1 -1
- package/dist-versioned/components/tab/tab.d.ts +1 -1
- package/dist-versioned/components/tab-group/tab-group.d.ts +1 -1
- package/dist-versioned/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist-versioned/components/tag/tag.d.ts +1 -1
- package/dist-versioned/components/textarea/textarea.d.ts +1 -1
- package/dist-versioned/components/tooltip/tooltip.d.ts +1 -1
- package/dist-versioned/components/video/video.d.ts +1 -1
- package/dist-versioned/custom-elements.json +211 -211
- package/dist-versioned/internal/form.js +3 -3
- package/dist-versioned/solid-components.css +2 -2
- package/dist-versioned/solid-components.js +1 -1
- package/dist-versioned/vscode.html-custom-data.json +80 -80
- package/dist-versioned/web-types.json +137 -137
- package/package.json +2 -2
- package/cdn/chunks/chunk.IQUBYV5M.js +0 -1
- package/cdn-versioned/chunks/chunk.IQUBYV5M.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solid-design-system/components",
|
|
3
3
|
"description": "Solid Design System: Components",
|
|
4
|
-
"version": "4.6.
|
|
4
|
+
"version": "4.6.13",
|
|
5
5
|
"homepage": "https://solid-design-system.fe.union-investment.de/docs/",
|
|
6
6
|
"author": "Union Investment",
|
|
7
7
|
"license": "MIT",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"readme": "README.md",
|
|
112
112
|
"meta": {
|
|
113
113
|
"bundleSizeInKb": {
|
|
114
|
-
"uncompressed":
|
|
114
|
+
"uncompressed": 421,
|
|
115
115
|
"gzip": 99
|
|
116
116
|
}
|
|
117
117
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u,c as m}from"./chunk.A3DKF5BY.js";import{a as d,d as h}from"./chunk.RQYP7MH5.js";import{a as p}from"./chunk.KLRPP4NQ.js";import{a as y}from"./chunk.DEXOQON7.js";import{a as o}from"./chunk.26V4EXHB.js";import{a as c}from"./chunk.E2DRD2OX.js";import{a as b,b as a,d as n,h as l}from"./chunk.CDEAOHOV.js";import{b as f,e as r}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var w=Object.assign(document.createElement("div"),{role:"region",className:"sd-toast-stack sd-toast-stack--top-right"}),v=Object.assign(document.createElement("div"),{role:"region",className:"sd-toast-stack sd-toast-stack--bottom-center"}),t=class extends l{constructor(){super(...arguments);this.localize=new y(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now();this.tabDirection="forward";this.focused=!1}get stack(){return{"top-right":w,"bottom-center":v}[this.toastStack]}connectedCallback(){super.connectedCallback(),this.stack.parentElement||(document.body.append(this.stack),this.stack.ariaLabel=this.localize.term("notifications")),this.handleFocusIn=this.handleFocusIn.bind(this),document.addEventListener("focusin",this.handleFocusIn)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.handleFocusIn)}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}checkFocus(){if(!(!this.focused||!this.closable)&&!this.matches(":focus-within")){let e=this.tabDirection==="forward"?this.base:this.close;typeof(e==null?void 0:e.focus)=="function"&&e.focus({preventScroll:!0})}}handleFocusIn(){this.focused=!0}handleKeyDown(e){if(this.tabDirection="forward",this.closable&&e.key==="Escape"){this.hide();return}e.key==="Tab"&&e.shiftKey&&(this.tabDirection="backwards"),requestAnimationFrame(()=>this.checkFocus())}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await h(this.base),this.base.hidden=!1;let{keyframes:e,options:s}=m(this,"notification.show",{dir:this.localize.dir()});await d(this.base,e,s),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await h(this.base);let{keyframes:e,options:s}=m(this,"notification.hide",{dir:this.localize.dir()});await d(this.base,e,s),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,p(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,p(this,"sd-after-hide")}async toast(){return new Promise(e=>{let s=this.toastStack==="bottom-center"?v:w;s.parentElement===null&&document.body.append(s),s.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{s.removeChild(this),e(),s.querySelector("sd-notification")===null&&s.remove()},{once:!0})})}render(){return r`<div part="base" class="${o("w-full overflow-hidden flex items-stretch relative m-2 focus-visible:focus-outline")}" role="alert" id="notification" tabindex="0" aria-labelledby="message" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}" @keydown="${this.handleKeyDown}"><slot name="icon" part="icon" class="${o("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="system" class="h-6 w-6 text-white"></sd-icon></slot><div part="content" class="${o("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot id="message" part="message" class="block w-full pl-3 py-2"></slot>${this.closable?r`<sd-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-icon label="${this.localize.term("close")}" name="close" library="system" color="currentColor"></sd-icon></sd-button>`:""}</div>${this.durationIndicator?r`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${o("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute border border-neutral-400"></div>`:""}</div>`}};t.styles=[...l.styles,f`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],i([n('[part~="base"]')],t.prototype,"base",2),i([n('[part~="close-button"]')],t.prototype,"close",2),i([a({type:String,reflect:!0})],t.prototype,"variant",2),i([a({type:Boolean,reflect:!0})],t.prototype,"open",2),i([a({type:Boolean,reflect:!0})],t.prototype,"closable",2),i([a({type:Number,reflect:!0})],t.prototype,"duration",2),i([a({type:Boolean,reflect:!0,attribute:"duration-indicator"})],t.prototype,"durationIndicator",2),i([a({type:String,reflect:!0,attribute:"toast-stack"})],t.prototype,"toastStack",2),i([c("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),i([c("duration")],t.prototype,"handleDurationChange",1),t=i([b("sd-notification")],t);u("notification.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}});u("notification.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});export{t as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u,c as m}from"./chunk.A3DKF5BY.js";import{a as d,d as h}from"./chunk.RQYP7MH5.js";import{a as p}from"./chunk.KLRPP4NQ.js";import{a as y}from"./chunk.DEXOQON7.js";import{a as o}from"./chunk.26V4EXHB.js";import{a as c}from"./chunk.E2DRD2OX.js";import{a as b,b as a,d as n,h as l}from"./chunk.CDEAOHOV.js";import{b as f,e as r}from"./chunk.IRWHG2Q4.js";import{e as i}from"./chunk.TJOCV4DC.js";var w=Object.assign(document.createElement("div"),{role:"region",className:"sd-toast-stack sd-toast-stack--top-right"}),v=Object.assign(document.createElement("div"),{role:"region",className:"sd-toast-stack sd-toast-stack--bottom-center"}),t=class extends l{constructor(){super(...arguments);this.localize=new y(this);this.variant="info";this.open=!1;this.closable=!1;this.duration=1/0;this.durationIndicator=!1;this.toastStack="top-right";this.remainingDuration=this.duration;this.startTime=Date.now();this.tabDirection="forward";this.focused=!1}get stack(){return{"top-right":w,"bottom-center":v}[this.toastStack]}connectedCallback(){super.connectedCallback(),this.stack.parentElement||(document.body.append(this.stack),this.stack.ariaLabel=this.localize.term("notifications")),this.handleFocusIn=this.handleFocusIn.bind(this),document.addEventListener("focusin",this.handleFocusIn)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("focusin",this.handleFocusIn)}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>this.hide(),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout(()=>{this.hide()},this.remainingDuration))}handleCloseClick(){this.hide()}checkFocus(){if(!(!this.focused||!this.closable)&&!this.matches(":focus-within")){let e=this.tabDirection==="forward"?this.base:this.close;typeof(e==null?void 0:e.focus)=="function"&&e.focus({preventScroll:!0})}}handleFocusIn(){this.focused=!0}handleKeyDown(e){if(this.tabDirection="forward",this.closable&&e.key==="Escape"){this.hide();return}e.key==="Tab"&&e.shiftKey&&(this.tabDirection="backwards"),requestAnimationFrame(()=>this.checkFocus())}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await h(this.base),this.base.hidden=!1;let{keyframes:e,options:s}=m(this,"notification.show",{dir:this.localize.dir()});await d(this.base,e,s),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await h(this.base);let{keyframes:e,options:s}=m(this,"notification.hide",{dir:this.localize.dir()});await d(this.base,e,s),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,p(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,p(this,"sd-after-hide")}async toast(){return new Promise(e=>{let s=this.toastStack==="bottom-center"?v:w;s.parentElement===null&&document.body.append(s),s.appendChild(this),requestAnimationFrame(()=>{this.clientWidth,this.show()}),this.addEventListener("sd-after-hide",()=>{s.removeChild(this),e(),s.querySelector("sd-4-6-12-notification")===null&&s.remove()},{once:!0})})}render(){return r`<div part="base" class="${o("w-full overflow-hidden flex items-stretch relative m-2 focus-visible:focus-outline")}" role="alert" id="notification" tabindex="0" aria-labelledby="message" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}" @keydown="${this.handleKeyDown}"><slot name="icon" part="icon" class="${o("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-4-6-12-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="system" class="h-6 w-6 text-white"></sd-4-6-12-icon></slot><div part="content" class="${o("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot id="message" part="message" class="block w-full pl-3 py-2"></slot>${this.closable?r`<sd-4-6-12-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-4-6-12-icon label="${this.localize.term("close")}" name="close" library="system" color="currentColor"></sd-4-6-12-icon></sd-4-6-12-button>`:""}</div>${this.durationIndicator?r`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${o("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute border border-neutral-400"></div>`:""}</div>`}};t.styles=[...l.styles,f`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],i([n('[part~="base"]')],t.prototype,"base",2),i([n('[part~="close-button"]')],t.prototype,"close",2),i([a({type:String,reflect:!0})],t.prototype,"variant",2),i([a({type:Boolean,reflect:!0})],t.prototype,"open",2),i([a({type:Boolean,reflect:!0})],t.prototype,"closable",2),i([a({type:Number,reflect:!0})],t.prototype,"duration",2),i([a({type:Boolean,reflect:!0,attribute:"duration-indicator"})],t.prototype,"durationIndicator",2),i([a({type:String,reflect:!0,attribute:"toast-stack"})],t.prototype,"toastStack",2),i([c("open",{waitUntilFirstUpdate:!0})],t.prototype,"handleOpenChange",1),i([c("duration")],t.prototype,"handleDurationChange",1),t=i([b("sd-4-6-12-notification")],t);u("notification.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}});u("notification.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});export{t as a};
|