@solid-design-system/components 3.23.3 → 3.23.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/es/dialog.js +1 -1
- package/dist/components/umd/solid-components.js +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/dialog/dialog.js +3 -3
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/audio.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/checkbox-group.js +1 -1
- package/dist/versioned-components/es/checkbox.js +1 -1
- package/dist/versioned-components/es/combobox.js +4 -4
- package/dist/versioned-components/es/dialog.js +1 -1
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -1
- package/dist/versioned-components/es/dropdown.js +1 -1
- package/dist/versioned-components/es/expandable.js +1 -1
- package/dist/versioned-components/es/flipcard.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/header.js +1 -1
- package/dist/versioned-components/es/icon.js +1 -1
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/input.js +1 -1
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/map-marker.js +1 -1
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/notification.js +1 -1
- package/dist/versioned-components/es/optgroup.js +1 -1
- package/dist/versioned-components/es/option.js +1 -1
- package/dist/versioned-components/es/quickfact.js +1 -1
- package/dist/versioned-components/es/radio-button.js +1 -1
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/scrollable.js +1 -1
- package/dist/versioned-components/es/select.js +4 -4
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/step-group.js +1 -1
- package/dist/versioned-components/es/step.js +1 -1
- package/dist/versioned-components/es/switch.js +1 -1
- package/dist/versioned-components/es/tab-group.js +1 -1
- package/dist/versioned-components/es/tab-panel.js +1 -1
- package/dist/versioned-components/es/tab.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser-media.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/textarea.js +1 -1
- package/dist/versioned-components/es/tooltip.js +2 -2
- package/dist/versioned-components/es/utils.js +1 -1
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
- package/dist/versioned-package/components/accordion/accordion.js +2 -2
- package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
- package/dist/versioned-package/components/audio/audio.d.ts +1 -1
- package/dist/versioned-package/components/audio/audio.js +6 -6
- package/dist/versioned-package/components/badge/badge.d.ts +1 -1
- package/dist/versioned-package/components/badge/badge.js +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
- package/dist/versioned-package/components/button/button.d.ts +1 -1
- package/dist/versioned-package/components/button/button.js +4 -4
- package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
- package/dist/versioned-package/components/carousel/carousel.js +6 -6
- package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +3 -3
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
- package/dist/versioned-package/components/combobox/combobox.d.ts +4 -4
- package/dist/versioned-package/components/combobox/combobox.js +26 -26
- package/dist/versioned-package/components/combobox/utils.js +2 -2
- package/dist/versioned-package/components/dialog/dialog.d.ts +1 -1
- package/dist/versioned-package/components/dialog/dialog.js +4 -4
- package/dist/versioned-package/components/divider/divider.d.ts +1 -1
- package/dist/versioned-package/components/divider/divider.js +2 -2
- package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
- package/dist/versioned-package/components/dropdown/dropdown.js +9 -9
- package/dist/versioned-package/components/expandable/expandable.d.ts +1 -1
- package/dist/versioned-package/components/expandable/expandable.js +2 -2
- package/dist/versioned-package/components/flipcard/flipcard.d.ts +1 -1
- package/dist/versioned-package/components/flipcard/flipcard.js +1 -1
- package/dist/versioned-package/components/header/header.d.ts +1 -1
- package/dist/versioned-package/components/header/header.js +4 -4
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/input/input.d.ts +1 -1
- package/dist/versioned-package/components/input/input.js +3 -3
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/map-marker/map-marker.d.ts +1 -1
- package/dist/versioned-package/components/map-marker/map-marker.js +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +5 -5
- package/dist/versioned-package/components/notification/notification.d.ts +1 -1
- package/dist/versioned-package/components/notification/notification.js +5 -5
- package/dist/versioned-package/components/optgroup/optgroup.d.ts +2 -2
- package/dist/versioned-package/components/optgroup/optgroup.js +5 -5
- package/dist/versioned-package/components/option/option.d.ts +1 -1
- package/dist/versioned-package/components/option/option.js +2 -2
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/quickfact/quickfact.d.ts +1 -1
- package/dist/versioned-package/components/quickfact/quickfact.js +2 -2
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
- package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +13 -13
- package/dist/versioned-package/components/scrollable/scrollable.d.ts +1 -1
- package/dist/versioned-package/components/scrollable/scrollable.js +3 -3
- package/dist/versioned-package/components/select/select.d.ts +4 -4
- package/dist/versioned-package/components/select/select.js +29 -29
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/step/step.d.ts +1 -1
- package/dist/versioned-package/components/step/step.js +2 -2
- package/dist/versioned-package/components/step-group/step-group.d.ts +1 -1
- package/dist/versioned-package/components/step-group/step-group.js +2 -2
- package/dist/versioned-package/components/switch/switch.d.ts +1 -1
- package/dist/versioned-package/components/switch/switch.js +1 -1
- package/dist/versioned-package/components/tab/tab.d.ts +1 -1
- package/dist/versioned-package/components/tab/tab.js +2 -2
- package/dist/versioned-package/components/tab-group/tab-group.d.ts +1 -1
- package/dist/versioned-package/components/tab-group/tab-group.js +13 -13
- package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist/versioned-package/components/tab-panel/tab-panel.js +2 -2
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/teaser-media/teaser-media.js +1 -1
- package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
- package/dist/versioned-package/components/textarea/textarea.js +2 -2
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.js +3 -3
- package/dist/versioned-package/styles/headline/headline.css.js +1 -1
- package/dist/versioned-package/utilities/autocomplete-config.js +4 -4
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +47 -47
- package/dist/web-types.json +48 -48
- package/package.json +1 -1
@@ -155,16 +155,16 @@ let SdDialog = class extends SolidElement {
|
|
155
155
|
"flex items-center justify-center fixed inset-0 z-dialog",
|
156
156
|
this.hasSlotController.test("footer") && "dialog--has-footer"
|
157
157
|
)}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${() => this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${cx(
|
158
|
-
"flex flex-col z-20 bg-white
|
158
|
+
"flex flex-col z-20 bg-white py-4 sm:py-8 relative gap-6 focus-visible:focus-outline-inverted",
|
159
159
|
this.open && "flex opacity-100"
|
160
|
-
)}" role="dialog" aria-modal="true" aria-hidden="${this.open ? "false" : "true"}" aria-label="${this.headline}" aria-labelledby="title" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length > 0 ? html`<
|
160
|
+
)}" role="dialog" aria-modal="true" aria-hidden="${this.open ? "false" : "true"}" aria-label="${this.headline}" aria-labelledby="title" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length > 0 ? html`<span class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</span>` : html`<slot name="headline"></slot>`}</h2>${!this.noCloseButton ? html`<sd-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${cx("absolute top-2 right-2")}" name="x-lg" @click="${() => this.requestClose("close-button")}" type="button"><sd-icon label="${this.localize.term("close")}" name="close" library="system" color="currentColor"></sd-icon></sd-button>` : ""}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`;
|
161
161
|
}
|
162
162
|
};
|
163
163
|
SdDialog.styles = [
|
164
164
|
componentStyles,
|
165
165
|
unsafeCSS(HeadlineStyles),
|
166
166
|
SolidElement.styles,
|
167
|
-
css`:host{--width:662px}[part=panel]{width:var(--width)
|
167
|
+
css`:host{--width:662px}[part=panel]{width:var(--width)}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=footer]{width:100%}}`
|
168
168
|
];
|
169
169
|
__decorateClass([
|
170
170
|
query('[part="base"]')
|
@@ -1 +1 @@
|
|
1
|
-
import"./accordion.js";import{S as e,x as t,c as o,i as s,n as r,a}from"./solid-components2.js";import{o as c}from"./query-assigned-elements.js";var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(e,t,o,s)=>{for(var r,a=s>1?void 0:s?d(t,o):t,c=e.length-1;c>=0;c--)(r=e[c])&&(a=(s?r(t,o,a):r(a))||a);return s&&a&&n(t,o,a),a};let l=class extends e{constructor(){super(...arguments),this.closeOthers=!1,this.handleAccordionShow=e=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach((t=>{t!==e.target&&t.parentNode===e.target.parentNode&&t.removeAttribute("open")}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return t`<div part="base"><slot></slot></div>`}};l.styles=[o,e.styles,s`:host{display:block}::slotted(sd-3-23-
|
1
|
+
import"./accordion.js";import{S as e,x as t,c as o,i as s,n as r,a}from"./solid-components2.js";import{o as c}from"./query-assigned-elements.js";var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(e,t,o,s)=>{for(var r,a=s>1?void 0:s?d(t,o):t,c=e.length-1;c>=0;c--)(r=e[c])&&(a=(s?r(t,o,a):r(a))||a);return s&&a&&n(t,o,a),a};let l=class extends e{constructor(){super(...arguments),this.closeOthers=!1,this.handleAccordionShow=e=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach((t=>{t!==e.target&&t.parentNode===e.target.parentNode&&t.removeAttribute("open")}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return t`<div part="base"><slot></slot></div>`}};l.styles=[o,e.styles,s`:host{display:block}::slotted(sd-3-23-4-accordion:not(:first-of-type)){margin-top:-1px}`],i([c({selector:"sd-3-23-4-accordion"})],l.prototype,"_accordionsInDefaultSlot",2),i([r({attribute:"close-others",type:Boolean})],l.prototype,"closeOthers",2),l=i([a("sd-3-23-4-accordion-group")],l);export{l as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{s as e,a as t,b as s}from"./animate.js";import{S as o,L as i,x as a,t as r,i as n,e as h,n as d,a as l}from"./solid-components2.js";import{g as p,s as c}from"./animation-registry.js";import{w as y}from"./event.js";import{w as m}from"./watch.js";var u=Object.defineProperty,f=Object.getOwnPropertyDescriptor,b=(e,t,s,o)=>{for(var i,a=o>1?void 0:o?f(t,s):t,r=e.length-1;r>=0;r--)(i=e[r])&&(a=(o?i(t,s,a):i(a))||a);return o&&a&&u(t,s,a),a};let w=class extends o{constructor(){super(...arguments),this.localize=new i(this),this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}handleSummaryClick(){this.open?this.hide():this.show()}handleSummaryKeyDown(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.open?this.hide():this.show()),("ArrowUp"===e.key||"ArrowLeft"===e.key)&&(e.preventDefault(),this.hide()),("ArrowDown"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.emit("sd-show",{cancelable:!0}).defaultPrevented)return void(this.open=!1);await e(this.body),this.body.hidden=!1;const{keyframes:o,options:i}=p(this,"accordion.show",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented)return void(this.open=!0);await e(this.body);const{keyframes:o,options:i}=p(this,"accordion.hide",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.hidden=!0,this.body.style.height="auto",this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,y(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,y(this,"sd-after-hide")}render(){return a`<div part="base" class="border-y border-neutral-400"><header part="header" id="header" class="${r("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary hover:bg-neutral-200 relative group")}" role="button" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${r(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-all h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${r("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${r(this.open&&"hidden")}"><sd-3-23-
|
1
|
+
import"./icon.js";import{s as e,a as t,b as s}from"./animate.js";import{S as o,L as i,x as a,t as r,i as n,e as h,n as d,a as l}from"./solid-components2.js";import{g as p,s as c}from"./animation-registry.js";import{w as y}from"./event.js";import{w as m}from"./watch.js";var u=Object.defineProperty,f=Object.getOwnPropertyDescriptor,b=(e,t,s,o)=>{for(var i,a=o>1?void 0:o?f(t,s):t,r=e.length-1;r>=0;r--)(i=e[r])&&(a=(o?i(t,s,a):i(a))||a);return o&&a&&u(t,s,a),a};let w=class extends o{constructor(){super(...arguments),this.localize=new i(this),this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}handleSummaryClick(){this.open?this.hide():this.show()}handleSummaryKeyDown(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.open?this.hide():this.show()),("ArrowUp"===e.key||"ArrowLeft"===e.key)&&(e.preventDefault(),this.hide()),("ArrowDown"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.emit("sd-show",{cancelable:!0}).defaultPrevented)return void(this.open=!1);await e(this.body),this.body.hidden=!1;const{keyframes:o,options:i}=p(this,"accordion.show",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented)return void(this.open=!0);await e(this.body);const{keyframes:o,options:i}=p(this,"accordion.hide",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.hidden=!0,this.body.style.height="auto",this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,y(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,y(this,"sd-after-hide")}render(){return a`<div part="base" class="border-y border-neutral-400"><header part="header" id="header" class="${r("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary hover:bg-neutral-200 relative group")}" role="button" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${r(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-all h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${r("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${r(this.open&&"hidden")}"><sd-3-23-4-icon library="system" name="chevron-down"></sd-3-23-4-icon></slot><slot name="collapse-icon" class="${r(!this.open&&"hidden")}"><sd-3-23-4-icon library="system" name="chevron-down"></sd-3-23-4-icon></slot></span></header><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></div>`}};w.styles=[o.styles,n`:host{display:block}`],b([h('[part="base"]')],w.prototype,"accordion",2),b([h('[part="header"]')],w.prototype,"header",2),b([h('[part="content"]')],w.prototype,"body",2),b([d({type:Boolean,reflect:!0})],w.prototype,"open",2),b([d()],w.prototype,"summary",2),b([m("open",{waitUntilFirstUpdate:!0})],w.prototype,"handleOpenChange",1),w=b([l("sd-3-23-4-accordion")],w),c("accordion.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),c("accordion.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});export{w as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,L as e,x as i,t as s,r,i as a,n as o,e as n,a as d}from"./solid-components2.js";import{H as l}from"./slot.js";import{r as h}from"./state.js";import{Wave as u}from"./wave.js";import{I as c}from"./interactive.js";var p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,y=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?m(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s?r(e,i,a):r(a))||a);return s&&a&&p(e,i,a),a};let g=class extends t{constructor(){super(),this.localize=new e(this),this.hasSlotController=new l(this,"transcript"),this.reversedLayout=!1,this.hideTimestamps=!1,this.animated=!1,this.inverted=!1,this.speed=1,this.currentTime=this.formatTime(0),this.duration="",this.isPlaying=!1,this.isMuted=!1,this.progress=0,this.setAudioProgress=()=>{this.progressSlider.max=Math.floor(this.audioElement.duration).toString()},this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),this.audioElement.playbackRate=this.speed,this.animated&&this.initAnimation())}updated(t){if(t.has("animated")){const e=t.get("animated");!e&&this.animated?this.initAnimation():e&&!this.animated&&this.clear()}}get audioElement(){const t=this.shadowRoot.querySelector("slot");return(null==t?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}updateCurrentTime(){if(!this.audioElement)return;const t=this.audioElement.currentTime;this.currentTime=this.formatTime(t),this.progress=Math.floor(t),this.progressSlider&&(this.progressSlider.value=this.progress.toString())}updateAudioDuration(){if(this.audioElement){if(isNaN(this.audioElement.duration))return void setTimeout((()=>{this.updateAudioDuration()}),100);this.duration=this.formatTime(this.audioElement.duration),this.setAudioProgress()}}playAudio(){this.audioElement&&(this.isPlaying=!0,this.audioElement.play(),this.emit("sd-playback-start"),this.animated&&this.draw())}pauseAudio(){this.audioElement&&(this.isPlaying=!1,this.audioElement.pause(),this.emit("sd-playback-pause"),this.animated&&this.stopAnimation())}handleAudioEnd(){this.emit("sd-playback-end"),this.isPlaying=!1,this.progress=0,this.progressSlider.value="0",this.currentTime=this.formatTime(0),this.animated&&this.stopAnimation()}toggleMute(){this.audioElement&&(this.isMuted=!this.isMuted,this.isMuted?(this.emit("sd-playback-mute"),this.audioElement.muted=!0):(this.emit("sd-playback-unmute"),this.audioElement.muted=!1))}toggleMuteKeydown(t){"Enter"===t.key&&(t.preventDefault(),this.toggleMute())}togglePlaybackSpeed(){this.audioElement&&(this.emit("sd-playback-speed"),this.speed=1.5===this.speed?1:this.speed+.25,this.audioElement.playbackRate=this.speed)}togglePlaybackSpeedKeydown(t){"Enter"===t.key&&(t.preventDefault(),this.togglePlaybackSpeed())}formatTime(t){const e=Math.floor(t/60),i=Math.floor(t%60);return`${e}:${i<10?"0":""}${i}`}handleAudioProgress(){if(!this.audioElement)return;const t=Number(this.progressSlider.value);this.audioElement.currentTime=t,this.progress=t,this.currentTime=this.formatTime(t)}handleAudioProgressKeydown(t){"ArrowRight"===t.key&&(this.progressSlider.value=(Number(this.progressSlider.value)+1).toString(),this.handleAudioProgress()),"ArrowLeft"===t.key&&(this.progressSlider.value=(Number(this.progressSlider.value)-1).toString(),this.handleAudioProgress())}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0}showTranscriptKeydown(t){("Enter"===t.key||" "===t.key)&&this.showTranscript()}rgbToHex(t){const e=t.match(/\d+/g);if(e&&3===e.length){const t=parseInt(e[0]),i=parseInt(e[1]),s=parseInt(e[2]),r=t=>t.toString(16).padStart(2,"0");return`#${r(t)}${r(i)}${r(s)}`.toUpperCase()}return null}initAnimation(){this.context=this.canvas.getContext("2d");const t=this.audioPlayerContainer.querySelector(".playback-speed"),e=window.getComputedStyle(t).color;let i;i=this.inverted?"#FFFFFF33":this.rgbToHex(e)+"33",this.waveList=[new u({canvas:this.canvas,color:i,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:1.5,amplitude:150,frequency:.01,damping:1})],this.animated&&this.drawStillWaves()}drawStillWaves(){this.waveList.forEach((t=>{t.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((t=>{t.redraw()})),await new Promise((t=>{setTimeout(t,1e3/30)})),await this.draw())}render(){const t=this.audioElement?this.progress/this.audioElement.duration*100:0,e=i`<div class="${s("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="${s("playback-speed justify-self-start text-base font-bold hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.localize.term("playbackSpeed")}" tabindex="0" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-3-23-3-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")}">${this.isPlaying?i`<sd-3-23-3-icon name="pause" library="system"></sd-3-23-3-icon>`:i`<sd-3-23-3-icon name="start" library="system"></sd-3-23-3-icon>`}</sd-3-23-3-button><div class="flex items-center justify-self-end">${this.hasSlotController.test("transcript")?i`<button class="${s("mr-6 w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" tab-index="0"><sd-3-23-3-icon class="w-6 h-6" name="transcript" library="system" label="${this.isMuted?this.localize.term("unmute"):this.localize.term("mute")}"></sd-3-23-3-icon></button>`:null} <button class="${s("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" part="volume" aria-label="${this.localize.term("mute")}" tabindex="0" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-3-23-3-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="system"></sd-3-23-3-icon></button></div></div>`,r=i`<div class="${s("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="${s("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.currentTime}</div><div class="${s("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.duration}</div></div>`;return i`<div class="${s("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?e:null}<div class="relative">${this.animated&&!this.reversedLayout?i`${e}`:null} ${this.animated?i`<canvas class="w-full h-16"></canvas>`:null} ${!this.hideTimestamps&&this.animated&&this.reversedLayout?r:null} <input class="${s("progress-slider bg-primary appearance-none w-full cursor-pointer outline-none h-1 flex items-center sd-interactive",this.inverted&&"sd-interactive--inverted")}" type="range" max="100" step="0.001" value="${this.progress}" tabindex="0" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" part="progress-slider" style="background:linear-gradient(to right,${this.inverted?"rgb(var(--sd-color-white, 255 255 255) / 1)":"rgb(var(--sd-color-primary, 0 53 142) / 1)"} ${t}%,${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)"} ${t}%)"></div>${this.hasSlotController.test("transcript")?i`<sd-3-23-3-drawer><slot name="transcript"></slot></sd-3-23-3-drawer>`:null} ${this.hideTimestamps||this.animated&&this.reversedLayout?null:r}</div>`}};g.styles=[t.styles,r(c),a`.progress-slider:focus-visible{outline:2px solid transparent;outline-offset:2px}.progress-slider::-webkit-slider-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-webkit-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-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-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-webkit-slider-thumb{outline-style:solid;outline-offset:2px}.progress-slider::-moz-range-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-moz-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-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-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-moz-range-thumb{outline-style:solid;outline-offset:2px}sd-3-23-3-button::part(base){display:flex;height:var(--sd-spacing-16,4rem);width:var(--sd-spacing-16,4rem);align-items:center;justify-content:center;border-radius:var(--sd-border-radius-full,9999px)}sd-3-23-3-button::part(label){flex-grow:0}`],y([o({type:Boolean,reflect:!0,attribute:"reversed-layout"})],g.prototype,"reversedLayout",2),y([o({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],g.prototype,"hideTimestamps",2),y([o({type:Boolean,reflect:!0})],g.prototype,"animated",2),y([o({type:Boolean,reflect:!0})],g.prototype,"inverted",2),y([o({type:Number})],g.prototype,"speed",2),y([h()],g.prototype,"currentTime",2),y([h()],g.prototype,"duration",2),y([h()],g.prototype,"isPlaying",2),y([h()],g.prototype,"isMuted",2),y([h()],g.prototype,"progress",2),y([n('[part="progress-slider"]')],g.prototype,"progressSlider",2),y([n('[part="audio-player"]')],g.prototype,"audioPlayerContainer",2),y([n("sd-3-23-3-drawer")],g.prototype,"drawer",2),y([n("canvas")],g.prototype,"canvas",2),g=y([d("sd-3-23-3-audio")],g);export{g as default};
|
1
|
+
import{S as t,L as e,x as i,t as s,r,i as a,n as o,e as n,a as d}from"./solid-components2.js";import{H as l}from"./slot.js";import{r as h}from"./state.js";import{Wave as u}from"./wave.js";import{I as c}from"./interactive.js";var p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,y=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?m(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s?r(e,i,a):r(a))||a);return s&&a&&p(e,i,a),a};let g=class extends t{constructor(){super(),this.localize=new e(this),this.hasSlotController=new l(this,"transcript"),this.reversedLayout=!1,this.hideTimestamps=!1,this.animated=!1,this.inverted=!1,this.speed=1,this.currentTime=this.formatTime(0),this.duration="",this.isPlaying=!1,this.isMuted=!1,this.progress=0,this.setAudioProgress=()=>{this.progressSlider.max=Math.floor(this.audioElement.duration).toString()},this.updateCurrentTime=this.updateCurrentTime.bind(this),this.handleAudioEnd=this.handleAudioEnd.bind(this),this.handleAudioProgress=this.handleAudioProgress.bind(this),this.handleAudioProgressKeydown=this.handleAudioProgressKeydown.bind(this)}firstUpdated(){this.audioElement&&(this.audioElement.addEventListener("timeupdate",this.updateCurrentTime),this.audioElement.addEventListener("ended",this.handleAudioEnd),this.audioElement.setAttribute("controlsList","nodownload"),this.audioElement.playbackRate=this.speed,this.animated&&this.initAnimation())}updated(t){if(t.has("animated")){const e=t.get("animated");!e&&this.animated?this.initAnimation():e&&!this.animated&&this.clear()}}get audioElement(){const t=this.shadowRoot.querySelector("slot");return(null==t?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}updateCurrentTime(){if(!this.audioElement)return;const t=this.audioElement.currentTime;this.currentTime=this.formatTime(t),this.progress=Math.floor(t),this.progressSlider&&(this.progressSlider.value=this.progress.toString())}updateAudioDuration(){if(this.audioElement){if(isNaN(this.audioElement.duration))return void setTimeout((()=>{this.updateAudioDuration()}),100);this.duration=this.formatTime(this.audioElement.duration),this.setAudioProgress()}}playAudio(){this.audioElement&&(this.isPlaying=!0,this.audioElement.play(),this.emit("sd-playback-start"),this.animated&&this.draw())}pauseAudio(){this.audioElement&&(this.isPlaying=!1,this.audioElement.pause(),this.emit("sd-playback-pause"),this.animated&&this.stopAnimation())}handleAudioEnd(){this.emit("sd-playback-end"),this.isPlaying=!1,this.progress=0,this.progressSlider.value="0",this.currentTime=this.formatTime(0),this.animated&&this.stopAnimation()}toggleMute(){this.audioElement&&(this.isMuted=!this.isMuted,this.isMuted?(this.emit("sd-playback-mute"),this.audioElement.muted=!0):(this.emit("sd-playback-unmute"),this.audioElement.muted=!1))}toggleMuteKeydown(t){"Enter"===t.key&&(t.preventDefault(),this.toggleMute())}togglePlaybackSpeed(){this.audioElement&&(this.emit("sd-playback-speed"),this.speed=1.5===this.speed?1:this.speed+.25,this.audioElement.playbackRate=this.speed)}togglePlaybackSpeedKeydown(t){"Enter"===t.key&&(t.preventDefault(),this.togglePlaybackSpeed())}formatTime(t){const e=Math.floor(t/60),i=Math.floor(t%60);return`${e}:${i<10?"0":""}${i}`}handleAudioProgress(){if(!this.audioElement)return;const t=Number(this.progressSlider.value);this.audioElement.currentTime=t,this.progress=t,this.currentTime=this.formatTime(t)}handleAudioProgressKeydown(t){"ArrowRight"===t.key&&(this.progressSlider.value=(Number(this.progressSlider.value)+1).toString(),this.handleAudioProgress()),"ArrowLeft"===t.key&&(this.progressSlider.value=(Number(this.progressSlider.value)-1).toString(),this.handleAudioProgress())}showTranscript(){this.emit("sd-transcript-click"),this.drawer.open=!0}showTranscriptKeydown(t){("Enter"===t.key||" "===t.key)&&this.showTranscript()}rgbToHex(t){const e=t.match(/\d+/g);if(e&&3===e.length){const t=parseInt(e[0]),i=parseInt(e[1]),s=parseInt(e[2]),r=t=>t.toString(16).padStart(2,"0");return`#${r(t)}${r(i)}${r(s)}`.toUpperCase()}return null}initAnimation(){this.context=this.canvas.getContext("2d");const t=this.audioPlayerContainer.querySelector(".playback-speed"),e=window.getComputedStyle(t).color;let i;i=this.inverted?"#FFFFFF33":this.rgbToHex(e)+"33",this.waveList=[new u({canvas:this.canvas,color:i,phase:240,shift:1.5,amplitude:230,frequency:.012,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:-2.5,amplitude:250,frequency:.005,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:-1,amplitude:200,frequency:.018,damping:1}),new u({canvas:this.canvas,color:i,phase:180,shift:1.5,amplitude:150,frequency:.01,damping:1})],this.animated&&this.drawStillWaves()}drawStillWaves(){this.waveList.forEach((t=>{t.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((t=>{t.redraw()})),await new Promise((t=>{setTimeout(t,1e3/30)})),await this.draw())}render(){const t=this.audioElement?this.progress/this.audioElement.duration*100:0,e=i`<div class="${s("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="${s("playback-speed justify-self-start text-base font-bold hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" aria-label="${this.localize.term("playbackSpeed")}" tabindex="0" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-3-23-4-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")}">${this.isPlaying?i`<sd-3-23-4-icon name="pause" library="system"></sd-3-23-4-icon>`:i`<sd-3-23-4-icon name="start" library="system"></sd-3-23-4-icon>`}</sd-3-23-4-button><div class="flex items-center justify-self-end">${this.hasSlotController.test("transcript")?i`<button class="${s("mr-6 w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" tab-index="0"><sd-3-23-4-icon class="w-6 h-6" name="transcript" library="system" label="${this.isMuted?this.localize.term("unmute"):this.localize.term("mute")}"></sd-3-23-4-icon></button>`:null} <button class="${s("w-6 h-6 hover:cursor-pointer sd-interactive",this.inverted&&"sd-interactive--inverted")}" part="volume" aria-label="${this.localize.term("mute")}" tabindex="0" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-3-23-4-icon class="w-6 h-6" name="${this.isMuted?"mute":"volume"}" library="system"></sd-3-23-4-icon></button></div></div>`,r=i`<div class="${s("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="${s("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.currentTime}</div><div class="${s("current-time text-sm",this.inverted?"text-primary-400":"text-neutral-700")}">${this.duration}</div></div>`;return i`<div class="${s("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?e:null}<div class="relative">${this.animated&&!this.reversedLayout?i`${e}`:null} ${this.animated?i`<canvas class="w-full h-16"></canvas>`:null} ${!this.hideTimestamps&&this.animated&&this.reversedLayout?r:null} <input class="${s("progress-slider bg-primary appearance-none w-full cursor-pointer outline-none h-1 flex items-center sd-interactive",this.inverted&&"sd-interactive--inverted")}" type="range" max="100" step="0.001" value="${this.progress}" tabindex="0" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" part="progress-slider" style="background:linear-gradient(to right,${this.inverted?"rgb(var(--sd-color-white, 255 255 255) / 1)":"rgb(var(--sd-color-primary, 0 53 142) / 1)"} ${t}%,${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)"} ${t}%)"></div>${this.hasSlotController.test("transcript")?i`<sd-3-23-4-drawer><slot name="transcript"></slot></sd-3-23-4-drawer>`:null} ${this.hideTimestamps||this.animated&&this.reversedLayout?null:r}</div>`}};g.styles=[t.styles,r(c),a`.progress-slider:focus-visible{outline:2px solid transparent;outline-offset:2px}.progress-slider::-webkit-slider-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-webkit-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-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-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-webkit-slider-thumb{outline-style:solid;outline-offset:2px}.progress-slider::-moz-range-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-moz-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-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-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-moz-range-thumb{outline-style:solid;outline-offset:2px}sd-3-23-4-button::part(base){display:flex;height:var(--sd-spacing-16,4rem);width:var(--sd-spacing-16,4rem);align-items:center;justify-content:center;border-radius:var(--sd-border-radius-full,9999px)}sd-3-23-4-button::part(label){flex-grow:0}`],y([o({type:Boolean,reflect:!0,attribute:"reversed-layout"})],g.prototype,"reversedLayout",2),y([o({type:Boolean,reflect:!0,attribute:"hide-timestamps"})],g.prototype,"hideTimestamps",2),y([o({type:Boolean,reflect:!0})],g.prototype,"animated",2),y([o({type:Boolean,reflect:!0})],g.prototype,"inverted",2),y([o({type:Number})],g.prototype,"speed",2),y([h()],g.prototype,"currentTime",2),y([h()],g.prototype,"duration",2),y([h()],g.prototype,"isPlaying",2),y([h()],g.prototype,"isMuted",2),y([h()],g.prototype,"progress",2),y([n('[part="progress-slider"]')],g.prototype,"progressSlider",2),y([n('[part="audio-player"]')],g.prototype,"audioPlayerContainer",2),y([n("sd-3-23-4-drawer")],g.prototype,"drawer",2),y([n("canvas")],g.prototype,"canvas",2),g=y([d("sd-3-23-4-audio")],g);export{g as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,x as t,t as r,i as s,n as i,a as n}from"./solid-components2.js";var o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=(e,t,r,s)=>{for(var i,n=s>1?void 0:s?a(t,r):t,l=e.length-1;l>=0;l--)(i=e[l])&&(n=(s?i(t,r,n):i(n))||n);return s&&n&&o(t,r,n),n};let p=class extends e{constructor(){super(...arguments),this.size="lg",this.variant="default",this.inverted=!1}render(){return t`<span role="status" part="base" aria-labelledby="content" class="${r("inline-flex items-center justify-center gap-x-[1px] text-center font-bold whitespace-nowrap border rounded-full select-none cursor-[inherit]",{default:this.inverted?"text-primary bg-primary-100 border-primary":"text-white bg-primary-500 border-white",success:this.inverted?"text-white bg-success border-primary":"text-white bg-success border-white",error:this.inverted?"text-white bg-error border-primary":"text-white bg-error border-white"}[this.variant],{sm:"h-2 min-w-2",md:"h-4 px-1 min-w-4",lg:"h-5 min-w-5"}[this.size])}"><span id="content" part="content" class="${r("sm"===this.size&&"sr-only")}"><slot></slot></span></span>`}};p.styles=[e.styles,s`:host{display:inline-flex;align-items:center;justify-content:center}:host([size=md]){font-size:.625rem}:host([size=lg]){font-size:.75rem}:host([size=lg])::part(base){padding-left:.313rem;padding-right:.313rem}`],l([i({reflect:!0})],p.prototype,"size",2),l([i({reflect:!0})],p.prototype,"variant",2),l([i({type:Boolean,reflect:!0})],p.prototype,"inverted",2),p=l([n("sd-3-23-
|
1
|
+
import{S as e,x as t,t as r,i as s,n as i,a as n}from"./solid-components2.js";var o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=(e,t,r,s)=>{for(var i,n=s>1?void 0:s?a(t,r):t,l=e.length-1;l>=0;l--)(i=e[l])&&(n=(s?i(t,r,n):i(n))||n);return s&&n&&o(t,r,n),n};let p=class extends e{constructor(){super(...arguments),this.size="lg",this.variant="default",this.inverted=!1}render(){return t`<span role="status" part="base" aria-labelledby="content" class="${r("inline-flex items-center justify-center gap-x-[1px] text-center font-bold whitespace-nowrap border rounded-full select-none cursor-[inherit]",{default:this.inverted?"text-primary bg-primary-100 border-primary":"text-white bg-primary-500 border-white",success:this.inverted?"text-white bg-success border-primary":"text-white bg-success border-white",error:this.inverted?"text-white bg-error border-primary":"text-white bg-error border-white"}[this.variant],{sm:"h-2 min-w-2",md:"h-4 px-1 min-w-4",lg:"h-5 min-w-5"}[this.size])}"><span id="content" part="content" class="${r("sm"===this.size&&"sr-only")}"><slot></slot></span></span>`}};p.styles=[e.styles,s`:host{display:inline-flex;align-items:center;justify-content:center}:host([size=md]){font-size:.625rem}:host([size=lg]){font-size:.75rem}:host([size=lg])::part(base){padding-left:.313rem;padding-right:.313rem}`],l([i({reflect:!0})],p.prototype,"size",2),l([i({reflect:!0})],p.prototype,"variant",2),l([i({type:Boolean,reflect:!0})],p.prototype,"inverted",2),p=l([n("sd-3-23-4-badge")],p);export{p as default};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import{S as t,x as e,t as r,c as a,i as s,e as i,n as o,a as n}from"./solid-components2.js";import{r as p}from"./state.js";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(t,e,r,a)=>{for(var s,i=a>1?void 0:a?d(e,r):e,o=t.length-1;o>=0;o--)(s=t[o])&&(i=(a?s(e,r,i):s(i))||i);return a&&i&&l(e,r,i),i};let v=class extends t{constructor(){super(...arguments),this.variant="primary",this.shapes=["top","middle","bottom"],this.componentBreakpoint=0}getSvg(t,e){return{0:this.smallSvg(e),414:this.mediumSvg(e),640:this.largeSvg(e)}[t]}largeSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.setBreakpoint())),this.updateComplete.then((()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)}))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return e`<div class="relative" part="shape-top">${this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return e`<div class="${r({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${r({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="z-10 relative" part="content"><slot></slot></div></div>`}renderBottomBrandshape(){return e`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(t){return e`<div class="${r({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white","border-white":"bg-transparent","border-primary":"bg-transparent",image:"bg-transparent"}[this.variant],{top:"bottom-0",bottom:"top-0"}[t],"block absolute left-0 w-full h-[1px]")}"></div>`}renderStylizedVariant(){return e`<div part="stylized-container" class="w-full overflow-hidden"><slot class="${r("image"!==this.variant&&"hidden")}" name="image"></slot></div>`}renderShapes(){return e`${this.shapes.includes("top")?this.renderTopBrandshape():""} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():""} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():""}`}render(){const t=this.variant.startsWith("border-")||"image"===this.variant;return e`<div class="${r({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white","border-white":"fill-transparent","border-primary":"fill-transparent",image:"fill-transparent"}[this.variant],"relative")}" part="base">${t?this.renderStylizedVariant():""} ${this.renderShapes()} ${this.shapes.includes("middle")?e`<slot></slot>`:""}</div>`}};v.styles=[a,t.styles,s`:host{display:block;container-type:inline-size;--angle:11deg;--radius:60px;--tan:tan(var(--angle));--adjacent:100cqw;--opposite:calc(var(--tan) * var(--adjacent));--curve:calc(
|
2
2
|
(var(--opposite) - (var(--radius) / 3)) * 0.5
|
3
|
-
)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]::before{position:absolute;top:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle) * -1));height:calc(100% - var(--curve) * 2);border-radius:0 var(--radius);margin-top:calc(var(--curve))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){width:100%;-o-object-fit:cover;object-fit:cover;transform:translateY(calc(var(--curve) * -1)) skewY(var(--angle));height:calc(100% + var(--curve) * 2)!important;position:absolute!important}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]::before{transform:unset;height:100%;margin-top:0}slot[name=image]::slotted(img),slot[name=image]::slotted(video){transform:unset;height:100%!important}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary, 0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white, white)}:host([variant^=border-]) [part=stylized-container]::before{right:var(--sd-spacing-0,0);border-width:2px;border-style:solid;content:'';border-color:var(--internal-border-color,#000)}`],h([i("[part=base]")],v.prototype,"containerElem",2),h([o({type:String})],v.prototype,"variant",2),h([o({type:Array})],v.prototype,"shapes",2),h([p()],v.prototype,"componentBreakpoint",2),v=h([n("sd-3-23-
|
3
|
+
)}@supports not (transform:skewY(11deg)){:host{--tan:0.1943803091}}@media (min-width:415px){:host{--radius:72px}}@media (min-width:640px){:host{--radius:84px}}:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]::before{position:absolute;top:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);transform:skewY(calc(var(--angle) * -1));height:calc(100% - var(--curve) * 2);border-radius:0 var(--radius);margin-top:calc(var(--curve))}slot[name=image]::slotted(img),slot[name=image]::slotted(video){width:100%;-o-object-fit:cover;object-fit:cover;transform:translateY(calc(var(--curve) * -1)) skewY(var(--angle));height:calc(100% + var(--curve) * 2)!important;position:absolute!important}@supports not (height:100cqw){:host([variant=image]) [part=stylized-container],:host([variant^=border-]) [part=stylized-container]::before{transform:unset;height:100%;margin-top:0}slot[name=image]::slotted(img),slot[name=image]::slotted(video){transform:unset;height:100%!important}}:host([variant=border-primary]){--internal-border-color:rgb(var(--sd-color-primary, 0 53 142))}:host([variant=border-white]){--internal-border-color:var(--sd-color-white, white)}:host([variant^=border-]) [part=stylized-container]::before{right:var(--sd-spacing-0,0);border-width:2px;border-style:solid;content:'';border-color:var(--internal-border-color,#000)}`],h([i("[part=base]")],v.prototype,"containerElem",2),h([o({type:String})],v.prototype,"variant",2),h([o({type:Array})],v.prototype,"shapes",2),h([p()],v.prototype,"componentBreakpoint",2),v=h([n("sd-3-23-4-brandshape")],v);export{v as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./spinner.js";import{S as t,t as e,c as r,i,e as o,n as a,a as s}from"./solid-components2.js";import{F as n,v as l}from"./form.js";import{H as d}from"./slot.js";import{s as p,n as h}from"./static.js";import{o as c}from"./if-defined.js";import{r as m}from"./state.js";import{o as u}from"./query-assigned-elements.js";import{w as b}from"./watch.js";var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,f=(t,e,r,i)=>{for(var o,a=i>1?void 0:i?y(e,r):e,s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&v(e,r,a),a};let g=class extends t{constructor(){super(...arguments),this.formControlController=new n(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),r=t.getAttribute("form");return e.getElementById(r)}return t.closest("form")}}),this.hasSlotController=new d(this,"[default]","icon-left","icon-right"),this.invalid=!1,this.title="",this.variant="primary",this.inverted=!1,this.size="lg",this.disabled=!1,this.loading=!1,this.type="button",this.name="",this.value="",this.href=""}get validity(){return this.isButton()?this.button.validity:l}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(t){this.isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}render(){const t=this.isLink(),r=t?p`a`:p`button`,i={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right"),"icon-only":this._iconsInDefaultSlot.length>0};return h`<${r} part="base" class="${e("font-md leading-[calc(var(--tw-varspacing)-2px)] no-underline\n w-full h-varspacing whitespace-nowrap align-middle inline-flex items-stretch justify-center\n border transition-colors duration-200 ease-in-out rounded-default\n select-none cursor-[inherit]",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.loading&&"relative cursor-wait",this.disabled&&"cursor-not-allowed",i["icon-only"]&&"px-0 w-varspacing",{sm:"text-sm varspacing-8 px-4",md:"text-base varspacing-10 px-4",lg:"text-base varspacing-12 px-4"}[this.size],{primary:this.inverted?"text-primary bg-white border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:bg-neutral-600 disabled:text-white":"text-white bg-primary border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:bg-neutral-500",secondary:this.inverted?"text-white border-white\n hover:text-primary-100 hover:bg-primary-500 hover:border-primary-100\n active:text-primary-200 active:bg-primary-800 active:border-primary-200\n disabled:text-neutral-600 disabled:border-neutral-600":"text-primary border-primary\n hover:text-primary-500 hover:border-primary-500 hover:bg-primary-100\n active:text-primary-800 active:border-primary-800 active:bg-primary-200\n disabled:text-neutral-500 disabled:border-neutral-500",tertiary:this.inverted?"text-white border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:text-neutral-600":"text-primary border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:text-neutral-500",cta:`text-white bg-accent-500 border-transparent\n hover:bg-accent-550\n active:bg-accent-700\n ${this.inverted?"disabled:bg-neutral-600":"disabled:bg-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${c(t?void 0:this.disabled)}" type="${c(t?void 0:this.type)}" title="${this.title}" name="${c(t?void 0:this.name)}" value="${c(t?void 0:this.value)}" href="${c(t?this.href:void 0)}" target="${c(t?this.target:void 0)}" download="${c(t?this.download:void 0)}" rel="${c(t&&this.target?"noreferrer noopener":void 0)}" role="${c(t?void 0:"button")}" aria-disabled="${this.disabled?"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}"><slot name="icon-left" part="icon-left" class="${e("flex flex-auto items-center pointer-events-none",i["icon-only"]&&"hidden",this.loading&&"invisible",i["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" id="content" class="${e(i["icon-only"]?"flex flex-auto items-center pointer-events-none":"inline-block",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${e("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",i["icon-only"]&&"hidden",i["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?h`<sd-3-23-
|
1
|
+
import"./spinner.js";import{S as t,t as e,c as r,i,e as o,n as a,a as s}from"./solid-components2.js";import{F as n,v as l}from"./form.js";import{H as d}from"./slot.js";import{s as p,n as h}from"./static.js";import{o as c}from"./if-defined.js";import{r as m}from"./state.js";import{o as u}from"./query-assigned-elements.js";import{w as b}from"./watch.js";var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,f=(t,e,r,i)=>{for(var o,a=i>1?void 0:i?y(e,r):e,s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&v(e,r,a),a};let g=class extends t{constructor(){super(...arguments),this.formControlController=new n(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),r=t.getAttribute("form");return e.getElementById(r)}return t.closest("form")}}),this.hasSlotController=new d(this,"[default]","icon-left","icon-right"),this.invalid=!1,this.title="",this.variant="primary",this.inverted=!1,this.size="lg",this.disabled=!1,this.loading=!1,this.type="button",this.name="",this.value="",this.href=""}get validity(){return this.isButton()?this.button.validity:l}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(t){this.isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}render(){const t=this.isLink(),r=t?p`a`:p`button`,i={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right"),"icon-only":this._iconsInDefaultSlot.length>0};return h`<${r} part="base" class="${e("font-md leading-[calc(var(--tw-varspacing)-2px)] no-underline\n w-full h-varspacing whitespace-nowrap align-middle inline-flex items-stretch justify-center\n border transition-colors duration-200 ease-in-out rounded-default\n select-none cursor-[inherit]",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.loading&&"relative cursor-wait",this.disabled&&"cursor-not-allowed",i["icon-only"]&&"px-0 w-varspacing",{sm:"text-sm varspacing-8 px-4",md:"text-base varspacing-10 px-4",lg:"text-base varspacing-12 px-4"}[this.size],{primary:this.inverted?"text-primary bg-white border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:bg-neutral-600 disabled:text-white":"text-white bg-primary border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:bg-neutral-500",secondary:this.inverted?"text-white border-white\n hover:text-primary-100 hover:bg-primary-500 hover:border-primary-100\n active:text-primary-200 active:bg-primary-800 active:border-primary-200\n disabled:text-neutral-600 disabled:border-neutral-600":"text-primary border-primary\n hover:text-primary-500 hover:border-primary-500 hover:bg-primary-100\n active:text-primary-800 active:border-primary-800 active:bg-primary-200\n disabled:text-neutral-500 disabled:border-neutral-500",tertiary:this.inverted?"text-white border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:text-neutral-600":"text-primary border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:text-neutral-500",cta:`text-white bg-accent-500 border-transparent\n hover:bg-accent-550\n active:bg-accent-700\n ${this.inverted?"disabled:bg-neutral-600":"disabled:bg-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${c(t?void 0:this.disabled)}" type="${c(t?void 0:this.type)}" title="${this.title}" name="${c(t?void 0:this.name)}" value="${c(t?void 0:this.value)}" href="${c(t?this.href:void 0)}" target="${c(t?this.target:void 0)}" download="${c(t?this.download:void 0)}" rel="${c(t&&this.target?"noreferrer noopener":void 0)}" role="${c(t?void 0:"button")}" aria-disabled="${this.disabled?"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}"><slot name="icon-left" part="icon-left" class="${e("flex flex-auto items-center pointer-events-none",i["icon-only"]&&"hidden",this.loading&&"invisible",i["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" id="content" class="${e(i["icon-only"]?"flex flex-auto items-center pointer-events-none":"inline-block",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${e("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",i["icon-only"]&&"hidden",i["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?h`<sd-3-23-4-spinner class="${e("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-3-23-4-spinner>`:""}</${r}>`}};g.styles=[r,t.styles,i`:host{position:relative;display:inline-block;width:var(--sd-spacing-auto,auto);cursor:pointer}sd-3-23-4-spinner{--indicator-color:currentColor;--track-color:var(--tw-varcolor-200)}::slotted(sd-3-23-4-badge){pointer-events:none;position:absolute;top:var(--sd-spacing-0,0);right: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-3-23-4-icon),sd-3-23-4-spinner{font-size:calc(var(--tw-varspacing)/ 2)}`],f([o("a, button")],g.prototype,"button",2),f([u({selector:"sd-3-23-4-icon"})],g.prototype,"_iconsInDefaultSlot",2),f([m()],g.prototype,"invalid",2),f([a()],g.prototype,"title",2),f([a({reflect:!0})],g.prototype,"variant",2),f([a({type:Boolean,reflect:!0})],g.prototype,"inverted",2),f([a({reflect:!0})],g.prototype,"size",2),f([a({type:Boolean,reflect:!0})],g.prototype,"disabled",2),f([a({type:Boolean,reflect:!0})],g.prototype,"loading",2),f([a()],g.prototype,"type",2),f([a()],g.prototype,"name",2),f([a()],g.prototype,"value",2),f([a()],g.prototype,"href",2),f([a()],g.prototype,"target",2),f([a()],g.prototype,"download",2),f([a()],g.prototype,"form",2),f([a({attribute:"formaction"})],g.prototype,"formAction",2),f([a({attribute:"formenctype"})],g.prototype,"formEnctype",2),f([a({attribute:"formmethod"})],g.prototype,"formMethod",2),f([a({attribute:"formnovalidate",type:Boolean})],g.prototype,"formNoValidate",2),f([a({attribute:"formtarget"})],g.prototype,"formTarget",2),f([b("disabled",{waitUntilFirstUpdate:!0})],g.prototype,"handleDisabledChange",1),g=f([s("sd-3-23-4-button")],g);export{g as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,c as s,i as r,a as o}from"./solid-components2.js";Object.defineProperty,Object.getOwnPropertyDescriptor;let a=class extends t{static isCarouselItem(t){return t instanceof Element&&"slide"===t.getAttribute("aria-roledescription")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return e`<slot></slot>`}};a.styles=[t.styles,s,r`:host{aspect-ratio:var(--aspect-ratio);scroll-snap-align:start;scroll-snap-stop:always;display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center}::slotted(img){height:100%;width:100%;-o-object-fit:cover;object-fit:cover}`],a=((t,e,s,r)=>{for(var o,a=e,i=t.length-1;i>=0;i--)(o=t[i])&&(a=o(a)||a);return a})([o("sd-3-23-
|
1
|
+
import{S as t,x as e,c as s,i as r,a as o}from"./solid-components2.js";Object.defineProperty,Object.getOwnPropertyDescriptor;let a=class extends t{static isCarouselItem(t){return t instanceof Element&&"slide"===t.getAttribute("aria-roledescription")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return e`<slot></slot>`}};a.styles=[t.styles,s,r`:host{aspect-ratio:var(--aspect-ratio);scroll-snap-align:start;scroll-snap-stop:always;display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center}::slotted(img){height:100%;width:100%;-o-object-fit:cover;object-fit:cover}`],a=((t,e,s,r)=>{for(var o,a=e,i=t.length-1;i>=0;i--)(o=t[i])&&(a=o(a)||a);return a})([o("sd-3-23-4-carousel-item")],a);export{a as default};
|
@@ -3,14 +3,14 @@ import"./icon.js";import{AutoplayController as e}from"./autoplay-controller.js";
|
|
3
3
|
* @license
|
4
4
|
* Copyright 2017 Google LLC
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
6
|
-
*/let y;var f=Object.defineProperty,S=Object.getOwnPropertyDescriptor,P=(e,t,i,s)=>{for(var o,a=s>1?void 0:s?S(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(a=(s?o(t,i,a):o(a))||a);return s&&a&&f(t,i,a),a};let w=class extends i{constructor(){super(...arguments),this.variant="number",this.inverted=!1,this.loop=!1,this.autoplay=!1,this.slidesPerPage=1,this.slidesPerMove=1,this.activeSlide=0,this.currentPage=1,this.pausedAutoplay=!1,this.autoplayController=new e(this,(()=>this.next())),this.scrollController=new g(this),this.slides=this.getElementsByTagName("sd-3-23-
|
6
|
+
*/let y;var f=Object.defineProperty,S=Object.getOwnPropertyDescriptor,P=(e,t,i,s)=>{for(var o,a=s>1?void 0:s?S(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(a=(s?o(t,i,a):o(a))||a);return s&&a&&f(t,i,a),a};let w=class extends i{constructor(){super(...arguments),this.variant="number",this.inverted=!1,this.loop=!1,this.autoplay=!1,this.slidesPerPage=1,this.slidesPerMove=1,this.activeSlide=0,this.currentPage=1,this.pausedAutoplay=!1,this.autoplayController=new e(this,(()=>this.next())),this.scrollController=new g(this),this.slides=this.getElementsByTagName("sd-3-23-4-carousel-item"),this.intersectionObserverEntries=new Map,this.localize=new s(this),this.handleSlotChange=e=>{e.some((e=>[...e.addedNodes,...e.removedNodes].some((e=>m.isCarouselItem(e)&&!e.hasAttribute("data-clone")))))&&this.initializeSlides(),this.requestUpdate()},this.unblockAutoplay=(e,t)=>{e.detail&&t.blur()}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-label",this.localize.term("carousel"));const e=new IntersectionObserver((e=>{e.forEach((e=>{this.intersectionObserverEntries.set(e.target,e);const t=e.target;t.toggleAttribute("inert",!e.isIntersecting),t.classList.toggle("--in-view",e.isIntersecting),t.setAttribute("aria-hidden",e.isIntersecting?"false":"true")}))}),{root:this,threshold:.6});this.intersectionObserver=e,e.takeRecords().forEach((e=>{this.intersectionObserverEntries.set(e.target,e)}))}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(){this.initializeSlides(),this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!1})}static getPageCount(e,t,i){return Math.ceil((e-t)/i)+1>0?Math.ceil((e-t)/i)+1:1}static getCurrentPage(e,t,i,s){return Math.ceil((e-i)/s)-Math.ceil((e-i-t)/s)+1}getSlides({excludeClones:e=!0}={}){return[...this.slides].filter((t=>!e||!t.hasAttribute("data-clone")))}handleKeyDown(e){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){const t=e.target,i="rtl"===this.localize.dir(),s=null!==t.closest('[part~="pagination-item"]'),o="ArrowDown"===e.key||!i&&"ArrowRight"===e.key||i&&"ArrowLeft"===e.key,a="ArrowUp"===e.key||!i&&"ArrowLeft"===e.key||i&&"ArrowRight"===e.key;e.preventDefault(),a&&this.previous(),o&&this.next(),"Home"===e.key&&this.goToSlide(0),"End"===e.key&&this.goToSlide(this.getSlides().length-1),s&&this.updateComplete.then((()=>{var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector('[part~="pagination-item--active"]');t&&t.focus()}))}}handleScrollEnd(){const e=this.getSlides(),t=[...this.intersectionObserverEntries.values()].find((e=>e.isIntersecting));if(this.loop&&null!=t&&t.target.hasAttribute("data-clone")){const e=Number(t.target.getAttribute("data-clone"));this.goToSlide(e,"auto")}else t&&(this.activeSlide=e.indexOf(t.target))}pause(){this.pausedAutoplay=!0}resume(){this.pausedAutoplay=!1}handlePausedAutoplay(){var e,t;this.pausedAutoplay?(this.autoplayController.stop(),null==(e=this.autoplayControls)||e.setAttribute("aria-pressed","false")):this.autoplay&&(this.autoplayController.start(3e3),null==(t=this.autoplayControls)||t.setAttribute("aria-pressed","true"))}initializeSlides(){const e=this.getSlides(),t=this.intersectionObserver;if(this.intersectionObserverEntries.clear(),this.getSlides({excludeClones:!1}).forEach(((i,s)=>{t.unobserve(i),i.classList.remove("--in-view"),i.classList.remove("--is-active"),i.setAttribute("aria-label",this.localize.term("slideNum",s+1,e.length)),i.hasAttribute("data-clone")&&i.remove()})),this.loop){const t=this.slidesPerPage,i=e.slice(-t),s=e.slice(0,t);i.reverse().forEach(((t,i)=>{const s=t.cloneNode(!0);s.setAttribute("data-clone",String(e.length-i-1)),this.prepend(s)})),s.forEach(((e,t)=>{const i=e.cloneNode(!0);i.setAttribute("data-clone",String(t)),this.append(i)}))}this.getSlides({excludeClones:!1}).forEach((e=>{t.observe(e)})),this.goToSlide(this.activeSlide,"auto")}handleSlideChange(){const e=this.getSlides();e.forEach(((e,t)=>{e.classList.toggle("--is-active",t===this.activeSlide)}));const t=w.getCurrentPage(e.length,this.activeSlide,this.slidesPerPage,this.slidesPerMove);this.currentPage!==t&&(this.currentPage=t),this.hasUpdated&&this.emit("sd-slide-change",{detail:{index:this.activeSlide,slide:e[this.activeSlide]}});const i=w.getPageCount(e.length,this.slidesPerPage,this.slidesPerMove);this.currentPage>i&&requestAnimationFrame((()=>{this.nextTillFirst()}))}handleSlidesPerMoveChange(){const e=this.getSlides({excludeClones:!1}),t=this.slidesPerMove;e.forEach(((e,i)=>{Math.abs(i-t)%t==0?e.style.removeProperty("scroll-snap-align"):e.style.setProperty("scroll-snap-align","none")}))}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&!this.pausedAutoplay&&this.autoplayController.start(3e3)}previous(e="smooth"){let t=this.activeSlide||this.activeSlide-this.slidesPerMove,i=!1;for(;!i&&t>0;)t-=1,i=Math.abs(t-this.slidesPerMove)%this.slidesPerMove==0;this.currentPage-1==0&&this.loop?this.goToSlide(this.activeSlide-this.slidesPerPage,e):this.goToSlide(t,e)}next(e="smooth"){this.currentPage+1<=w.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove)?this.goToSlide(this.activeSlide+this.slidesPerMove,e):this.loop&&this.nextTillFirst(e)}nextTillFirst(e="smooth"){for(;0!==this.activeSlide;)this.goToSlide(this.activeSlide+1,e);this.currentPage=w.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove)}goToSlide(e,t="smooth"){const{slidesPerPage:i,loop:s,scrollContainer:o}=this,a=this.getSlides(),r=this.getSlides({excludeClones:!1}),l=(e+a.length)%a.length;this.activeSlide=l;const n=function(e,t,i){return(e=>Object.is(e,-0)?0:e)(e<0?0:e>i?i:e)}
|
7
7
|
/**
|
8
8
|
* @license
|
9
9
|
* Copyright 2021 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/(e+(s?i:0),0,r.length+1),d=r[n],c=o.getBoundingClientRect(),h=d.getBoundingClientRect();o.scrollTo({left:h.left-c.left+o.scrollLeft,top:h.top-c.top+o.scrollTop,behavior:p()?"auto":t}),this.activeSlide!==a.length-1||this.loop?0===this.activeSlide&&!this.loop&&this.nextButton.focus({preventScroll:!0}):this.previousButton.focus({preventScroll:!0})}render(){const{scrollController:e,slidesPerMove:t}=this,i=w.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove),s=w.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove),r=this.loop||s>1,l=this.loop||s<i,n="ltr"===this.localize.dir();return o`<div part="base" class="${a("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${a("carousel__slides mb-6\n grid max-h-full w-full items-center justify-items-center overflow-auto",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline","overscroll-x-contain grid-flow-col auto-rows-[100%]\n snap-x snap-mandatory overflow-y-hidden")}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" role="status" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${a("w-full flex items-center justify-center relative")}"><div part="navigation" class="${a("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!r}" class="${a("!mr-6 !rounded-sm sd-interactive",!r&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${r?"false":"true"}" @click="${r?e=>{this.previous(),this.unblockAutoplay(e,this.previousButton)}:null}"><slot name="previous-icon"><sd-3-23-
|
11
|
+
*/(e+(s?i:0),0,r.length+1),d=r[n],c=o.getBoundingClientRect(),h=d.getBoundingClientRect();o.scrollTo({left:h.left-c.left+o.scrollLeft,top:h.top-c.top+o.scrollTop,behavior:p()?"auto":t}),this.activeSlide!==a.length-1||this.loop?0===this.activeSlide&&!this.loop&&this.nextButton.focus({preventScroll:!0}):this.previousButton.focus({preventScroll:!0})}render(){const{scrollController:e,slidesPerMove:t}=this,i=w.getPageCount(this.getSlides().length,this.slidesPerPage,this.slidesPerMove),s=w.getCurrentPage(this.getSlides().length,this.activeSlide,this.slidesPerPage,this.slidesPerMove),r=this.loop||s>1,l=this.loop||s<i,n="ltr"===this.localize.dir();return o`<div part="base" class="${a("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${a("carousel__slides mb-6\n grid max-h-full w-full items-center justify-items-center overflow-auto",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline","overscroll-x-contain grid-flow-col auto-rows-[100%]\n snap-x snap-mandatory overflow-y-hidden")}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" role="status" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${a("w-full flex items-center justify-center relative")}"><div part="navigation" class="${a("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!r}" class="${a("!mr-6 !rounded-sm sd-interactive",!r&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${r?"false":"true"}" @click="${r?e=>{this.previous(),this.unblockAutoplay(e,this.previousButton)}:null}"><slot name="previous-icon"><sd-3-23-4-icon class="${a("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${n?"chevron-down":"chevron-up"}"></sd-3-23-4-icon></slot></button> ${"dot"===this.variant?o`<div part="pagination-dot" role="tablist" class="${a("carousel__pagination dot flex wrap items-center gap-2")}" aria-controls="scroll-container">${function*(e,t){if(void 0!==e){let i=0;for(const s of e)yield t(s,i++)}}
|
12
12
|
/**
|
13
13
|
* @license
|
14
14
|
* Copyright 2021 Google LLC
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
16
|
-
*/(function*(e,t,i=1){const s=void 0===t?0:e;t??(t=e);for(let e=s;i>0?e<t:t<e;e+=i)yield e}(i),(e=>{const r=e+1===s;return o`<button part="pagination-item ${r?"pagination-item--active":""}" class="${a("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",r?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${r?"true":"false"}" aria-label="${this.localize.term("goToSlide",e+1,i)}" @click="${i=>{this.goToSlide(e*t),this.unblockAutoplay(i,this.paginationItems[e])}}" @keydown="${this.handleKeyDown}"><span class="${a("h-4 w-4 block border hover:border-primary-500 rounded-full",this.inverted?"border-white hover:border-primary-500":"border-primary",r&&"bg-accent border-none",r?this.inverted?"hover:bg-accent-300":"hover:bg-accent-550":"")}"></span></button>`}))}</div>`:o`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${a("w-5 text-center border-b-2 border-accent",this.inverted?"text-white":"text-black")}">${s}</span> <span part="pagination-divider" class="${a("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${a("w-5 text-center",this.inverted?"text-white":"text-black")}">${i}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!l}" class="${a("!ml-6 !rounded-sm sd-interactive ",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @click="${l?e=>{this.next(),this.unblockAutoplay(e,this.nextButton)}:null}"><slot name="next-icon"><sd-3-23-
|
16
|
+
*/(function*(e,t,i=1){const s=void 0===t?0:e;t??(t=e);for(let e=s;i>0?e<t:t<e;e+=i)yield e}(i),(e=>{const r=e+1===s;return o`<button part="pagination-item ${r?"pagination-item--active":""}" class="${a("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",r?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${r?"true":"false"}" aria-label="${this.localize.term("goToSlide",e+1,i)}" @click="${i=>{this.goToSlide(e*t),this.unblockAutoplay(i,this.paginationItems[e])}}" @keydown="${this.handleKeyDown}"><span class="${a("h-4 w-4 block border hover:border-primary-500 rounded-full",this.inverted?"border-white hover:border-primary-500":"border-primary",r&&"bg-accent border-none",r?this.inverted?"hover:bg-accent-300":"hover:bg-accent-550":"")}"></span></button>`}))}</div>`:o`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${a("w-5 text-center border-b-2 border-accent",this.inverted?"text-white":"text-black")}">${s}</span> <span part="pagination-divider" class="${a("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${a("w-5 text-center",this.inverted?"text-white":"text-black")}">${i}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!l}" class="${a("!ml-6 !rounded-sm sd-interactive ",!l&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${l?"false":"true"}" @click="${l?e=>{this.next(),this.unblockAutoplay(e,this.nextButton)}:null}"><slot name="next-icon"><sd-3-23-4-icon class="${a("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${n?"chevron-up":"chevron-down"}"></sd-3-23-4-icon></slot></button></div><button class="${a("ml-6 !rounded-sm","!absolute !right-0 sd-interactive",this.inverted?"sd-interactive--inverted":"sd-interactive--reset",!this.autoplay&&"!hidden")}" part="autoplay-controls" aria-label="${this.localize.term("autoplay")}" aria-pressed="true" @click="${e=>{this.pausedAutoplay=!this.pausedAutoplay,e.detail&&this.autoplayControls.blur()}}"><slot name="autoplay-start" class="${a(this.pausedAutoplay?"":"hidden")}"><sd-3-23-4-icon class="h-6 w-6 grid place-items-center" library="system" name="start"></sd-3-23-4-icon></slot><slot name="autoplay-pause" class="${a(this.pausedAutoplay?"hidden":"")}"><sd-3-23-4-icon class="h-6 w-6 grid place-items-center" library="system" name="pause"></sd-3-23-4-icon></slot></button></div></div>`}};w.styles=[i.styles,r(b),l,n`:host{--slide-gap:var(--sl-spacing-medium, 1rem);--scroll-hint:0px;display:flex}.carousel{grid-template-areas:'. slides .' '. pagination .'}.carousel__pagination{grid-area:pagination}.carousel__slides{grid-area:slides;scrollbar-width:none;--slide-size:calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));grid-auto-columns:var(--slide-size);-moz-column-gap:var(--slide-gap);column-gap:var(--slide-gap);scroll-padding-inline:var(--scroll-hint);padding-inline:var(--scroll-hint)}.carousel__slides::-webkit-scrollbar{display:none}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__navigation{grid-area:navigation}sd-3-23-4-button::part(label){pointer-events:none;display:flex;flex:1 1 auto;align-items:center}`],P([d('[part~="autoplay-controls"]')],w.prototype,"autoplayControls",2),P([d('[part~="navigation-button--previous"]')],w.prototype,"previousButton",2),P([d('[part~="navigation-button--next"]')],w.prototype,"nextButton",2),P([(e,i)=>t(e,i,{get(){return(this.renderRoot??y??(y=document.createDocumentFragment())).querySelectorAll('[part~="pagination-item"]')}})],w.prototype,"paginationItems",2),P([c({type:String,reflect:!0})],w.prototype,"variant",2),P([c({type:Boolean,reflect:!0})],w.prototype,"inverted",2),P([c({type:Boolean,reflect:!0})],w.prototype,"loop",2),P([c({type:Boolean,reflect:!0})],w.prototype,"autoplay",2),P([c({type:Number,attribute:"slides-per-page"})],w.prototype,"slidesPerPage",2),P([c({type:Number,attribute:"slides-per-move"})],w.prototype,"slidesPerMove",2),P([d("slot:not([name])")],w.prototype,"defaultSlot",2),P([d(".carousel__slides")],w.prototype,"scrollContainer",2),P([d(".carousel__pagination")],w.prototype,"paginationContainer",2),P([u()],w.prototype,"activeSlide",2),P([u()],w.prototype,"currentPage",2),P([u()],w.prototype,"pausedAutoplay",2),P([v("pausedAutoplay")],w.prototype,"handlePausedAutoplay",1),P([v("loop",{waitUntilFirstUpdate:!0}),v("slidesPerPage",{waitUntilFirstUpdate:!0})],w.prototype,"initializeSlides",1),P([v("activeSlide")],w.prototype,"handleSlideChange",1),P([v("slidesPerMove")],w.prototype,"handleSlidesPerMoveChange",1),P([v("autoplay")],w.prototype,"handleAutoplayChange",1),w=P([h("sd-3-23-4-carousel")],w);export{w as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{S as t,x as e,t as s,c as o,i as l,n as a,a as i}from"./solid-components2.js";import{H as r}from"./slot.js";import{w as n}from"./watch.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var l,a=o>1?void 0:o?h(e,s):e,i=t.length-1;i>=0;i--)(l=t[i])&&(a=(o?l(e,s,a):l(a))||a);return o&&a&&c(e,s,a),a};let p=class extends t{constructor(){super(...arguments),this.hasSlotController=new r(this,"label"),this.size="lg",this.orientation="vertical",this.label=""}getAllCheckboxes(){return[...this.querySelectorAll("sd-3-23-
|
1
|
+
import"./icon.js";import{S as t,x as e,t as s,c as o,i as l,n as a,a as i}from"./solid-components2.js";import{H as r}from"./slot.js";import{w as n}from"./watch.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var l,a=o>1?void 0:o?h(e,s):e,i=t.length-1;i>=0;i--)(l=t[i])&&(a=(o?l(e,s,a):l(a))||a);return o&&a&&c(e,s,a),a};let p=class extends t{constructor(){super(...arguments),this.hasSlotController=new r(this,"label"),this.size="lg",this.orientation="vertical",this.label=""}getAllCheckboxes(){return[...this.querySelectorAll("sd-3-23-4-checkbox")]}async syncCheckboxElements(){const t=this.getAllCheckboxes();await Promise.all(t.map((async t=>{await t.updateComplete,t.size=this.size})))}syncCheckboxes(){customElements.get("sd-3-23-4-checkbox")?this.syncCheckboxElements():customElements.whenDefined("sd-3-23-4-checkbox").then((()=>this.syncCheckboxes()))}handleSizeChange(){this.syncCheckboxes()}handleInvalid(){this.syncCheckboxes()}render(){const t=this.hasSlotController.test("label"),o=!!this.label||t,l=e`<slot @slotchange="${this.syncCheckboxes}"></slot>`;return e`<fieldset part="form-control" class="${s("border-0 p-0 m-0",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}" role="group" aria-labelledby="label"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${s("p-0 font-bold leading-normal text-black",o?"flex":"hidden")}" aria-hidden="${o?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${s({vertical:"flex flex-col",horizontal:"flex flex-row"}[this.orientation])}">${l}</div></fieldset>`}};p.styles=[o,t.styles,l`:host{display:block}:host([orientation=vertical]) ::slotted(sd-3-23-4-checkbox){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-3-23-4-checkbox:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-3-23-4-checkbox){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-3-23-4-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-23-4-checkbox){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-23-4-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}`],d([a({reflect:!0})],p.prototype,"size",2),d([a({reflect:!0})],p.prototype,"orientation",2),d([a()],p.prototype,"label",2),d([n("size",{waitUntilFirstUpdate:!0})],p.prototype,"handleSizeChange",1),d([n("invalid",{waitUntilFirstUpdate:!0})],p.prototype,"handleInvalid",1),p=d([i("sd-3-23-4-checkbox-group")],p);export{p as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{S as e,x as t,t as i,i as r,e as s,n as l,a}from"./solid-components2.js";import{d as o}from"./default-value.js";import{F as n}from"./form.js";import{o as d}from"./if-defined.js";import{l as h}from"./live.js";import{r as c}from"./state.js";import{w as p}from"./watch.js";var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,b=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?m(t,i):t,a=e.length-1;a>=0;a--)(s=e[a])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&u(t,i,l),l};let f=class extends e{constructor(){super(...arguments),this.formControlController=new n(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.title="",this.name="",this.size="lg",this.disabled=!1,this.checked=!1,this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return t`<label part="base" class="${i("sd-3-23-
|
1
|
+
import"./icon.js";import{S as e,x as t,t as i,i as r,e as s,n as l,a}from"./solid-components2.js";import{d as o}from"./default-value.js";import{F as n}from"./form.js";import{o as d}from"./if-defined.js";import{l as h}from"./live.js";import{r as c}from"./state.js";import{w as p}from"./watch.js";var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,b=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?m(t,i):t,a=e.length-1;a>=0;a--)(s=e[a])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&u(t,i,l),l};let f=class extends e{constructor(){super(...arguments),this.formControlController=new n(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.title="",this.name="",this.size="lg",this.disabled=!1,this.checked=!1,this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return t`<label part="base" class="${i("sd-3-23-4-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}"><input class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${d(this.value)}" .indeterminate="${h(this.indeterminate)}" .checked="${h(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" aria-describedby="invalid-message" aria-invalid="${this.showInvalidStyle}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"} ${this.indeterminate?" control--indeterminate":""}" class="${i("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4\n peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\n peer-focus-visible:outline-primary",{sm:"mt-[2px]",md:"mt-[3px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}">${this.checked?t`<sd-3-23-4-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-check"></sd-3-23-4-icon>`:""} ${!this.checked&&this.indeterminate?t`<sd-3-23-4-icon part="indeterminate-icon" class="text-white w-3 h-3" library="system" name="status-minus"></sd-3-23-4-icon>`:""} </span><span part="label" id="label" class="${i("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};f.styles=[e.styles,r`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline-width:0}:host([required]) #label::after{content:' *'}`],b([s('input[type="checkbox"]')],f.prototype,"input",2),b([s("#invalid-message")],f.prototype,"invalidMessage",2),b([l()],f.prototype,"title",2),b([l()],f.prototype,"name",2),b([l()],f.prototype,"value",2),b([l({reflect:!0})],f.prototype,"size",2),b([l({type:Boolean,reflect:!0})],f.prototype,"disabled",2),b([l({type:Boolean,reflect:!0})],f.prototype,"checked",2),b([l({type:Boolean,reflect:!0})],f.prototype,"indeterminate",2),b([o("checked")],f.prototype,"defaultChecked",2),b([l({reflect:!0})],f.prototype,"form",2),b([l({type:Boolean,reflect:!0})],f.prototype,"required",2),b([c()],f.prototype,"showInvalidStyle",2),b([p("disabled",{waitUntilFirstUpdate:!0})],f.prototype,"handleDisabledChange",1),b([p(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],f.prototype,"handleStateChange",1),f=b([a("sd-3-23-4-checkbox")],f);export{f as default};
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import{s as t,a as e}from"./animate.js";import{S as s,L as i,x as o,t as l,d as a,c as n,i as r,e as d,n as p,a as h}from"./solid-components2.js";import{defaultOptionRenderer as u}from"./option-renderer.js";import{d as c}from"./default-value.js";import{normalizeString as m,getAllOptions as b,getAssignedElementsForSlot as v,filterOnlyOptgroups as y}from"./utils.js";import{F as g}from"./form.js";import{g as f,s as O}from"./animation-registry.js";import{H as x}from"./slot.js";import{r as C}from"./state.js";import{s as w}from"./scroll.js";import{o as S,S as $}from"./icon.js";import{w as I}from"./event.js";import{w as V}from"./watch.js";import T from"./tag.js";var k=Object.defineProperty,L=Object.getOwnPropertyDescriptor,F=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?L(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&k(e,s,l),l};let D=class extends s{constructor(){super(...arguments),this.formControlController=new g(this,{assumeInteractionOn:["sd-blur","sd-3-23-
|
1
|
+
import{s as t,a as e}from"./animate.js";import{S as s,L as i,x as o,t as l,d as a,c as n,i as r,e as d,n as p,a as h}from"./solid-components2.js";import{defaultOptionRenderer as u}from"./option-renderer.js";import{d as c}from"./default-value.js";import{normalizeString as m,getAllOptions as b,getAssignedElementsForSlot as v,filterOnlyOptgroups as y}from"./utils.js";import{F as g}from"./form.js";import{g as f,s as O}from"./animation-registry.js";import{H as x}from"./slot.js";import{r as C}from"./state.js";import{s as w}from"./scroll.js";import{o as S,S as $}from"./icon.js";import{w as I}from"./event.js";import{w as V}from"./watch.js";import T from"./tag.js";var k=Object.defineProperty,L=Object.getOwnPropertyDescriptor,F=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?L(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&k(e,s,l),l};let D=class extends s{constructor(){super(...arguments),this.formControlController=new g(this,{assumeInteractionOn:["sd-blur","sd-3-23-4-input"]}),this.hasSlotController=new x(this,"help-text","label"),this.localize=new i(this),this.hasHover=!1,this.hasFocus=!1,this.displayInputValue="",this.selectedTextLabel="",this.selectedOptions=[],this.filteredOptions=[],this.allOptions=[],this.showValidStyle=!1,this.showInvalidStyle=!1,this.name="",this.value="",this.defaultValue="",this.size="lg",this.placeholder=this.localize.term("comboboxDefaultPlaceholder"),this.disabled=!1,this.clearable=!1,this.open=!1,this.hoist=!1,this.label="",this.placement="bottom",this.helpText="",this.form="",this.required=!1,this.currentPlacement=this.placement,this.getOption=u,this.multiple=!1,this.useTags=!0,this.maxOptionsVisible=3,this.styleOnValid=!1,this.filter=(t,e)=>{const s=m(t.value),i=m(t.getTextLabel()),o=m(e);return s.includes(o)||i.includes(o)},this.getTag=t=>o`<sd-3-23-4-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
2
2
|
base:tag__base,
|
3
3
|
content:tag__content,
|
4
4
|
removable-indicator:tag__removable-indicator,
|
5
|
-
" size="${"sm"===this.size?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-3-23-
|
5
|
+
" size="${"sm"===this.size?"sm":"lg"}" removable @keydown="${e=>this.handleTagKeyDown(e,t)}" @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-3-23-4-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{if(null===t.target.closest(".combobox__clear")){if("Escape"===t.key&&(this.open?(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})):this.displayInputValue=""),"Backspace"===t.key&&this.multiple&&""===this.displayInput.value)return this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),void this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0})));if("Enter"===t.key){const e=this.getCurrentOption(),s=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;if(!this.open&&!s)return void setTimeout((()=>{t.defaultPrevented||this.formControlController.submit()}));if(!this.open||null!=e&&e.disabled)return;if(e&&!e.disabled){const t=this.value;this.multiple?(this.toggleOptionSelection(e),this.lastOption=e,this.setOrderedSelectedOptions(e),this.updateComplete.then((()=>{this.selectionChanged()}))):(this.setOrderedSelectedOptions(e),this.setSelectedOptions(e)),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==t&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")}))}return this.displayInput.focus({preventScroll:!0}),void(this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}["ArrowUp","ArrowDown"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.open||this.show(),this.selectNextOption("ArrowDown"===t.key)),["Home","End"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"Home"===t.key?this.displayInput.setSelectionRange(0,0):"End"===t.key&&this.displayInput.setSelectionRange(this.displayInput.value.length,this.displayInput.value.length))}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}connectedCallback(){super.connectedCallback(),this.open=!1}firstUpdated(){if(!this.multiple){const t=this.findOptionByValue(this.getSlottedOptions(),this.value);this.selectedTextLabel=(null==t?void 0:t.getTextLabel())||""}this.formControlController.updateValidity(),this.applySizeToOptions()}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}get options(){const t=t=>{const e=this.displayInput.value,s=this.getOption(t,e);return o`${"string"==typeof s?S(s):s}`};return this.filteredOptions.map((e=>"sd-3-23-4-optgroup"===e.tagName.toLowerCase()?(Array.from(e.children).forEach((e=>{"sd-3-23-4-option"===e.tagName.toLowerCase()&&t(e)})),e):t(e)))}get tags(){return this.selectedOptions.length<=this.maxOptionsVisible?this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?S(s):s}</div>`}return[o``]})):[o`<sd-3-23-4-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
6
6
|
base:tag__base,
|
7
7
|
content:tag__content,
|
8
8
|
removable-indicator:tag__removable-indicator,
|
9
|
-
" size="${"sm"===this.size?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-3-23-3-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){"Backspace"===t.key&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))))}handleTagMaxOptionsKeyDown(t){"Backspace"===t.key&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))))}handleLabelClick(){this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.updateComplete.then((()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")})))}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(this.open?this.hide():this.show()).then((()=>{setTimeout((()=>this.displayInput.focus({preventScroll:!0})))}))}handleComboboxKeyDown(t){"Tab"!==t.key&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){""!==this.value&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach((t=>{t.selected=!1})),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-3-23-3-option"),s=this.value;e&&!e.disabled&&(this.multiple?(this.toggleOptionSelection(e),this.lastOption=e,this.setOrderedSelectedOptions(e),this.updateComplete.then((()=>{this.selectionChanged()}))):(this.setOrderedSelectedOptions(e),this.setSelectedOptions(e)),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){const e=this.getAllFilteredOptions();if(0===e.length)return;const s=this.getCurrentOption(),i=e.indexOf(s);let o=Math.max(0,i);if(t){const t=i+1;o=t>e.length-1?0:t}else{const t=i-1;o=t<0?e.length-1:t}this.setCurrentOption(e[o]),w(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-3-23-3-option")]}getCurrentOption(){return this.getAllFilteredOptions().find((t=>t.current))}setCurrentOption(t){const e=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),e.forEach((t=>{t.current=!1,t.setAttribute("aria-selected","false")})),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id))}toggleOptionSelection(t,e){const s=this.getSlottedOptions().find((e=>e.value&&t.value?e.value===t.value:e.getTextLabel()===t.getTextLabel()));s&&(s.selected=e??!s.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find((t=>e.includes(t.value))):t.find((t=>t.value===e))}selectedOptionsAndValueSynced(){var t;return!this.value&&0===this.selectedOptions.length||(Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===(null==(t=this.selectedOptions[0])?void 0:t.value))}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach((t=>{t.selected=!1})),this.selectedOptions=this.getSlottedOptions().filter((t=>this.isOptionSelected(t))),this.selectedOptions.forEach((t=>{t&&(t.selected=!0)})),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach((e=>{e.selected=this.compareOptions(e,t)})),this.selectionChanged()}setOrderedSelectedOptions(t){const e=this.getSlottedOptions().find((e=>this.compareOptions(e,t)));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find((t=>this.compareOptions(t,e)))?this.selectedOptions=this.selectedOptions.filter((t=>!this.compareOptions(t,e))):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var t,e,s;const i=this.selectedOptions.some((t=>!!t&&this.isOptionSelected(t)));this.multiple?(!i&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map((t=>t.value||t.getTextLabel()))]:this.value=this.selectedOptions.map((t=>(null==t?void 0:t.value)||(null==t?void 0:t.getTextLabel())||"")),this.displayInputValue=""):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)||(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())||"",this.selectedTextLabel=(null==(s=this.selectedOptions[0])?void 0:s.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}createComboboxOptionsFromQuery(t){const e=[];this.filteredOptions=this.getSlottedOptions().filter((e=>this.filter(e,t)||""===t)).map((t=>{var s,i,o;const l=t.cloneNode(!0);if(l.current=l.value===(null==(s=this.lastOption)?void 0:s.value),l.selected=t.selected,"sd-3-23-3-optgroup"!==(null==(i=t.parentElement)?void 0:i.tagName.toLowerCase()))return l;const a=t.parentElement,n=null==(o=a.querySelector('[slot="label"]'))?void 0:o.cloneNode(!0),r=e.find((t=>t.id===a.id));if(r)return null==r||r.appendChild(l),void(n&&(null==r||r.appendChild(n)));const d=a.cloneNode();return d.appendChild(l),n&&d.appendChild(n),e.push(d),d})).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){const t=this.getAllFilteredOptions();customElements.get("sd-3-23-3-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}applySizeToOptions(){this.getSlottedOptions().forEach((t=>{t.size=this.size}))}handleDisabledChange(){this.formControlController.setValidity(this.disabled),this.disabled&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&!this.disabled){this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0;const{keyframes:s,options:i}=f(this,"combobox.show",{dir:this.localize.dir()});return await e(this.popup.popup,s,i),this.emit("sd-after-show"),void(0===this.filteredOptions.length&&this.emit("sd-error"))}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=f(this,"combobox.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(!this.open&&!this.disabled)return this.open=!0,Promise.race([I(this,"sd-after-show"),I(this,"sd-error")]);this.open=!1}async hide(){if(this.open&&!this.disabled)return this.displayInputValue="",this.open=!1,I(this,"sd-after-hide");this.open=!1}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){const t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then((()=>{this.formControlController.updateValidity()})),this.emit("sd-change"))}getSlottedOptions(){return b(v(this.defaultSlot)).flat()}getSlottedOptGroups(){return y(v(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-3-23-3-option"))return void customElements.whenDefined("sd-3-23-3-option").then((()=>this.handleDefaultSlotChange()));const t=this.getSlottedOptions(),e=this.getSlottedOptGroups();t.forEach(((t,e)=>{this.multiple&&(t.checkbox=!0),t.id=t.id||`sd-3-23-3-combobox-option-${e}`})),e.forEach(((t,e)=>{t.id=t.id||`sd-3-23-3-combobox-optgroup-${e}`})),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery(""),this.hasFocus&&this.value.length>0&&!this.open&&await this.show()}render(){const t=this.hasSlotController.test("left"),e=(this.hasSlotController.test("right"),this.hasSlotController.test("label")),s=this.hasSlotController.test("help-text"),i=!!this.label||!!e,a=!!this.helpText||!!s,n=this.clearable&&!this.disabled&&this.value.length>0,r=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",d=this.disabled?"cursor-not-allowed":"cursor-pointer",p=this.disabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],u={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],c={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${l("relative text-left",d,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${i&&"inline-block mb-2"}" aria-hidden="${!i}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${l("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[r],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-3-23-3-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${l("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
9
|
+
" size="${"sm"===this.size?"sm":"lg"}" removable @keydown="${t=>this.handleTagMaxOptionsKeyDown(t)}" @sd-remove="${t=>this.handleTagRemove(t)}">${this.selectedOptions.length} ${this.localize.term("tagsSelected")}</sd-3-23-4-tag>`]}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("mousedown",this.handleDocumentMouseDown),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleTagKeyDown(t,e){"Backspace"===t.key&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))))}handleTagMaxOptionsKeyDown(t){"Backspace"===t.key&&this.multiple&&(t.stopPropagation(),this.handleTagRemove(new CustomEvent("sd-remove"),this.selectedOptions[this.selectedOptions.length-1]),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))))}handleLabelClick(){this.displayInput.focus()}handleTagRemove(t,e){t.stopPropagation(),e||this.clearCombobox(),e&&!this.disabled&&(this.toggleOptionSelection(e,!1),this.setOrderedSelectedOptions(e),this.updateComplete.then((()=>{this.selectionChanged(),this.emit("sd-input"),this.emit("sd-change")})))}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(this.open?this.hide():this.show()).then((()=>{setTimeout((()=>this.displayInput.focus({preventScroll:!0})))}))}handleComboboxKeyDown(t){"Tab"!==t.key&&this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.clearCombobox()}handleNoResultsClick(t){t.preventDefault(),this.hide()}clearCombobox(){""!==this.value&&(this.value="",this.displayInputValue="",this.selectedTextLabel="",this.lastOption=void 0,this.selectedOptions=[],this.getSlottedOptions().forEach((t=>{t.selected=!1})),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change")})))}preventLoosingFocus(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-3-23-4-option"),s=this.value;e&&!e.disabled&&(this.multiple?(this.toggleOptionSelection(e),this.lastOption=e,this.setOrderedSelectedOptions(e),this.updateComplete.then((()=>{this.selectionChanged()}))):(this.setOrderedSelectedOptions(e),this.setSelectedOptions(e)),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}selectNextOption(t){const e=this.getAllFilteredOptions();if(0===e.length)return;const s=this.getCurrentOption(),i=e.indexOf(s);let o=Math.max(0,i);if(t){const t=i+1;o=t>e.length-1?0:t}else{const t=i-1;o=t<0?e.length-1:t}this.setCurrentOption(e[o]),w(this.getCurrentOption(),this.listbox,"vertical","auto")}getAllFilteredOptions(){return[...this.filteredWrapper.querySelectorAll("sd-3-23-4-option")]}getCurrentOption(){return this.getAllFilteredOptions().find((t=>t.current))}setCurrentOption(t){const e=this.getAllFilteredOptions();this.displayInput.removeAttribute("aria-activedescendant"),e.forEach((t=>{t.current=!1,t.setAttribute("aria-selected","false")})),t&&(t.current=!0,t.setAttribute("aria-selected","true"),this.displayInput.setAttribute("aria-activedescendant",t.id))}toggleOptionSelection(t,e){const s=this.getSlottedOptions().find((e=>e.value&&t.value?e.value===t.value:e.getTextLabel()===t.getTextLabel()));s&&(s.selected=e??!s.selected)}findOptionByValue(t,e){if(e)return Array.isArray(e)?t.find((t=>e.includes(t.value))):t.find((t=>t.value===e))}selectedOptionsAndValueSynced(){var t;return!this.value&&0===this.selectedOptions.length||(Array.isArray(this.value)?this.value.length===this.selectedOptions.length:this.value===(null==(t=this.selectedOptions[0])?void 0:t.value))}isOptionSelected(t){return t.value?this.value.includes(t.value):this.value.includes(t.getTextLabel())}syncSelectedOptionsAndValue(){return this.selectedOptionsAndValueSynced()?void 0:(this.getSlottedOptions().forEach((t=>{t.selected=!1})),this.selectedOptions=this.getSlottedOptions().filter((t=>this.isOptionSelected(t))),this.selectedOptions.forEach((t=>{t&&(t.selected=!0)})),Promise.resolve())}compareOptions(t,e){return t.value&&e.value?t.value===e.value:t.getTextLabel()===e.getTextLabel()}setSelectedOptions(t){this.getSlottedOptions().forEach((e=>{e.selected=this.compareOptions(e,t)})),this.selectionChanged()}setOrderedSelectedOptions(t){const e=this.getSlottedOptions().find((e=>this.compareOptions(e,t)));this.multiple?this.selectedOptions.length>0&&e&&this.selectedOptions.find((t=>this.compareOptions(t,e)))?this.selectedOptions=this.selectedOptions.filter((t=>!this.compareOptions(t,e))):this.selectedOptions=[...this.selectedOptions,e]:this.selectedOptions=[e]}selectionChanged(){var t,e,s;const i=this.selectedOptions.some((t=>!!t&&this.isOptionSelected(t)));this.multiple?(!i&&this.selectedOptions.length>0?this.value=[...this.value,...this.selectedOptions.map((t=>t.value||t.getTextLabel()))]:this.value=this.selectedOptions.map((t=>(null==t?void 0:t.value)||(null==t?void 0:t.getTextLabel())||"")),this.displayInputValue=""):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)||(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())||"",this.selectedTextLabel=(null==(s=this.selectedOptions[0])?void 0:s.getTextLabel())||"",this.displayInputValue=""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}createComboboxOptionsFromQuery(t){const e=[];this.filteredOptions=this.getSlottedOptions().filter((e=>this.filter(e,t)||""===t)).map((t=>{var s,i,o;const l=t.cloneNode(!0);if(l.current=l.value===(null==(s=this.lastOption)?void 0:s.value),l.selected=t.selected,"sd-3-23-4-optgroup"!==(null==(i=t.parentElement)?void 0:i.tagName.toLowerCase()))return l;const a=t.parentElement,n=null==(o=a.querySelector('[slot="label"]'))?void 0:o.cloneNode(!0),r=e.find((t=>t.id===a.id));if(r)return null==r||r.appendChild(l),void(n&&(null==r||r.appendChild(n)));const d=a.cloneNode();return d.appendChild(l),n&&d.appendChild(n),e.push(d),d})).filter(Boolean)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleFilterChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}handleUseTagsChange(){const t=this.getAllFilteredOptions();customElements.get("sd-3-23-4-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}applySizeToOptions(){this.getSlottedOptions().forEach((t=>{t.size=this.size}))}handleDisabledChange(){this.formControlController.setValidity(this.disabled),this.disabled&&(this.open=!1,this.handleOpenChange())}handleValueChange(){this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInput.value):this.createComboboxOptionsFromQuery("")}handleDisplayInputValueChange(){this.createComboboxOptionsFromQuery(this.displayInputValue)}async handleOpenChange(){if(this.open&&!this.disabled){this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0;const{keyframes:s,options:i}=f(this,"combobox.show",{dir:this.localize.dir()});return await e(this.popup.popup,s,i),this.emit("sd-after-show"),void(0===this.filteredOptions.length&&this.emit("sd-error"))}this.setCurrentOption(null),this.displayInput.removeAttribute("aria-activedescendant"),this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=f(this,"combobox.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}async show(){if(!this.open&&!this.disabled)return this.open=!0,Promise.race([I(this,"sd-after-show"),I(this,"sd-error")]);this.open=!1}async hide(){if(this.open&&!this.disabled)return this.displayInputValue="",this.open=!1,I(this,"sd-after-hide");this.open=!1}checkValidity(){return this.valueInput.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}async handleInput(){const t=this.displayInput.value;this.displayInputValue=t,await this.updateComplete,this.open=this.filteredWrapper.children.length>0,this.formControlController.updateValidity(),this.emit("sd-input")}handleChange(){(!this.selectedOptions||!this.multiple)&&(this.selectedTextLabel=this.displayInput.value,this.updateComplete.then((()=>{this.formControlController.updateValidity()})),this.emit("sd-change"))}getSlottedOptions(){return b(v(this.defaultSlot)).flat()}getSlottedOptGroups(){return y(v(this.defaultSlot))}async handleDefaultSlotChange(){if(!customElements.get("sd-3-23-4-option"))return void customElements.whenDefined("sd-3-23-4-option").then((()=>this.handleDefaultSlotChange()));const t=this.getSlottedOptions(),e=this.getSlottedOptGroups();t.forEach(((t,e)=>{this.multiple&&(t.checkbox=!0),t.id=t.id||`sd-3-23-4-combobox-option-${e}`})),e.forEach(((t,e)=>{t.id=t.id||`sd-3-23-4-combobox-optgroup-${e}`})),await this.syncSelectedOptionsAndValue(),this.multiple?this.createComboboxOptionsFromQuery(this.displayInputValue):this.createComboboxOptionsFromQuery(""),this.hasFocus&&this.value.length>0&&!this.open&&await this.show()}render(){const t=this.hasSlotController.test("left"),e=(this.hasSlotController.test("right"),this.hasSlotController.test("label")),s=this.hasSlotController.test("help-text"),i=!!this.label||!!e,a=!!this.helpText||!!s,n=this.clearable&&!this.disabled&&this.value.length>0,r=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",d=this.disabled?"cursor-not-allowed":"cursor-pointer",p=this.disabled?"text-neutral-500":"text-primary",h={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],u={sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size],c={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${l("relative text-left",d,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${i&&"inline-block mb-2"}" aria-hidden="${!i}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="relative w-full bg-white text-black"><div part="border" class="${l("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[r],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-3-23-4-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${l("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
|
10
10
|
popup:popup__content,
|
11
|
-
"><div part="combobox" class="${l("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}">${t?o`<slot part="left" name="left" class="${l("inline-flex",u,p,c)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?o`<div part="tags" class="${l("flex items-center gap-1",u)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${l("appearance-none outline-none bg-transparent flex-auto min-w-0",d,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map((t=>null==t?void 0:t.getTextLabel())).join(", ")}</div><input class="${l("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",d)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${n?o`<button part="clear-button" class="${l("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-23-
|
11
|
+
"><div part="combobox" class="${l("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}">${t?o`<slot part="left" name="left" class="${l("inline-flex",u,p,c)}"></slot>`:""} ${this.multiple&&this.useTags&&this.tags.length>0?o`<div part="tags" class="${l("flex items-center gap-1",u)}">${this.tags}</div>`:null} <input id="display-input" name="${this.name}" form="${this.form}" part="display-input" class="${l("appearance-none outline-none bg-transparent flex-auto min-w-0",d,this.selectedTextLabel&&!this.multiple?"placeholder-black":"placeholder-neutral-700")}" type="text" placeholder="${this.selectedTextLabel&&!this.multiple?this.selectedTextLabel:this.placeholder}" .disabled="${this.disabled}" .value="${this.displayInputValue}" autocomplete="off" spellcheck="false" autocapitalize="off" aria-controls="listbox" aria-expanded="${this.open}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}" aria-autocomplete="list" aria-owns="listbox" @input="${this.handleInput}" @change="${this.handleChange}"><div aria-live="polite" id="control-value" class="absolute top-0 left-0 opacity-0 -z-10">${this.selectedOptions.map((t=>null==t?void 0:t.getTextLabel())).join(", ")}</div><input class="${l("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",d)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-controls="control-value" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${n?o`<button part="clear-button" class="${l("flex justify-center",h)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.preventLoosingFocus}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-23-4-icon class="${l("text-icon-fill-neutral-800",c)}" name="closing-round" library="system"></sd-3-23-4-icon></slot></button>`:""} ${this.showInvalidStyle?o`<sd-3-23-4-icon part="invalid-icon" class="${l(h,c,"text-error")}" library="system" name="risk"></sd-3-23-4-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-3-23-4-icon part="valid-icon" class="${l("flex-shrink-0 text-success",h,c)}" library="system" name="status-check"></sd-3-23-4-icon>`:""}<slot name="right" part="right" class="${l("inline-flex ml-2 leading-[0]",this.disabled?"text-neutral-500":"text-primary",c)}"><sd-3-23-4-icon class="${l("transition-all",this.open?"rotate-180":"rotate-0")}" name="chevron-down" part="chevron" library="system" color="currentColor"></sd-3-23-4-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open}" aria-multiselectable="${this.multiple}" aria-labelledby="label" part="listbox" class="${l("bg-white px-2 py-3 relative border-primary overflow-y-auto",this.open&&"shadow","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mousedown="${this.preventLoosingFocus}" @mouseup="${this.handleOptionClick}"><div part="filtered-listbox" class="overflow-y-scroll">${0===this.filteredOptions.length?o`<span id="noResults" class="px-4 flex items-center w-full transition-all text-left text-base relative text-black py-3" aria-hidden="true" @click="${this.handleNoResultsClick}">${this.localize.term("noResults")}</span>`:this.options}</div><slot id="defaultOptionsSlot" class="hidden" @slotchange="${this.handleDefaultSlotChange}"></slot></div></sd-3-23-4-popup></div><div part="form-control-help-text" id="help-text" class="text-sm text-neutral-700" aria-hidden="${!a}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};D.dependencies={"sd-3-23-4-icon":$,"sd-3-23-4-popup":a,"sd-3-23-4-tag":T},D.styles=[n,s.styles,r`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}[part=listbox]{max-height:var(--auto-size-available-height,auto)}sd-3-23-4-popup::part(popup){z-index:var(--sd-z-index-dropdown,900)}sd-3-23-4-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-3-23-4-tag::part(content){max-width:var(--tag-max-width,15ch);overflow:hidden;white-space:nowrap;display:inline-block;text-overflow:ellipsis}sd-3-23-4-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-3-23-4-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}[part=filtered-listbox] sd-3-23-4-optgroup:first-of-type{--display-divider:none}mark{background-color:transparent;font-weight:700;color:inherit}`],F([d("sd-3-23-4-popup")],D.prototype,"popup",2),F([d('[part="combobox"]')],D.prototype,"combobox",2),F([d('[part="display-input"]')],D.prototype,"displayInput",2),F([d(".value-input")],D.prototype,"valueInput",2),F([d('[part="listbox"]')],D.prototype,"listbox",2),F([d('[part="tags"]')],D.prototype,"tagWrapper",2),F([d('[part="filtered-listbox"]')],D.prototype,"filteredWrapper",2),F([d("slot:not([name])")],D.prototype,"defaultSlot",2),F([d("#invalid-message")],D.prototype,"invalidMessage",2),F([C()],D.prototype,"hasHover",2),F([C()],D.prototype,"hasFocus",2),F([C()],D.prototype,"displayInputValue",2),F([C()],D.prototype,"selectedTextLabel",2),F([C()],D.prototype,"selectedOptions",2),F([C()],D.prototype,"filteredOptions",2),F([C()],D.prototype,"allOptions",2),F([C()],D.prototype,"lastOption",2),F([C()],D.prototype,"showValidStyle",2),F([C()],D.prototype,"showInvalidStyle",2),F([p()],D.prototype,"name",2),F([p({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],D.prototype,"value",2),F([c()],D.prototype,"defaultValue",2),F([p({reflect:!0})],D.prototype,"size",2),F([p()],D.prototype,"placeholder",2),F([p({reflect:!0,type:Boolean})],D.prototype,"disabled",2),F([p({type:Boolean})],D.prototype,"clearable",2),F([p({reflect:!0,type:Boolean})],D.prototype,"open",2),F([p({type:Boolean})],D.prototype,"hoist",2),F([p()],D.prototype,"label",2),F([p({reflect:!0})],D.prototype,"placement",2),F([p({attribute:"help-text"})],D.prototype,"helpText",2),F([p({reflect:!0})],D.prototype,"form",2),F([p({reflect:!0,type:Boolean})],D.prototype,"required",2),F([C()],D.prototype,"currentPlacement",2),F([p()],D.prototype,"getOption",2),F([p({type:Boolean,reflect:!0})],D.prototype,"multiple",2),F([p({type:Boolean,reflect:!0})],D.prototype,"useTags",2),F([p({attribute:"max-options-visible",type:Number})],D.prototype,"maxOptionsVisible",2),F([p({type:Boolean,reflect:!0,attribute:"style-on-valid"})],D.prototype,"styleOnValid",2),F([p()],D.prototype,"filter",2),F([p()],D.prototype,"getTag",2),F([V("filter",{waitUntilFirstUpdate:!0})],D.prototype,"handleFilterChange",1),F([V("useTags",{waitUntilFirstUpdate:!0})],D.prototype,"handleUseTagsChange",1),F([V("size",{waitUntilFirstUpdate:!0})],D.prototype,"applySizeToOptions",1),F([V("disabled",{waitUntilFirstUpdate:!0})],D.prototype,"handleDisabledChange",1),F([V("value",{waitUntilFirstUpdate:!0})],D.prototype,"handleValueChange",1),F([V("displayInputValue",{waitUntilFirstUpdate:!0})],D.prototype,"handleDisplayInputValueChange",1),F([V("open",{waitUntilFirstUpdate:!0})],D.prototype,"handleOpenChange",1),D=F([h("sd-3-23-4-combobox")],D),O("combobox.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),O("combobox.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{D as default};
|