@solid-design-system/components 3.20.6 → 3.21.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/es/checkbox-group.js +1 -1
- package/dist/components/es/input.js +1 -1
- package/dist/components/es/radio-group.js +1 -1
- package/dist/components/es/select.js +1 -1
- package/dist/components/es/textarea.js +1 -1
- package/dist/components/umd/solid-components.js +4 -4
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/checkbox-group/checkbox-group.js +1 -1
- package/dist/package/components/input/input.js +1 -1
- package/dist/package/components/radio-group/radio-group.js +1 -5
- package/dist/package/components/select/select.js +1 -1
- package/dist/package/components/textarea/textarea.js +1 -1
- 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/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/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 +3 -3
- 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/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 +6 -6
- package/dist/versioned-package/components/dialog/dialog.d.ts +1 -1
- package/dist/versioned-package/components/dialog/dialog.js +2 -2
- 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 +8 -8
- 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/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 +14 -18
- 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 +26 -26
- 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 +3 -3
- 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 +55 -55
- package/dist/web-types.json +46 -46
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
import{S as e,L as t,x as o,t as i,r as s,c as n,i as r,e as a,n as l,a as d}from"./solid-components2.js";import{w as c}from"./event.js";import{w as h}from"./watch.js";import{I as p}from"./interactive.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,v=(e,t,o,i)=>{for(var s,n=i>1?void 0:i?g(t,o):t,r=e.length-1;r>=0;r--)(s=e[r])&&(n=(i?s(t,o,n):s(n))||n);return i&&n&&m(t,o,n),n};let u=class extends e{constructor(){super(...arguments),this.open=!1,this.inverted=!1,this.localize=new t(this)}updateMaxHeight(){var e;const t=null==(e=this.contentPreview)?void 0:e.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${t}px`),this.style.setProperty("--max-height",t)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}onOpenChange(){this.open?(this.emit("sd-show"),this.updateComplete.then((()=>{this.emit("sd-after-show")}))):(this.emit("sd-hide"),this.updateComplete.then((()=>{this.emit("sd-after-hide")}))),this.details.setAttribute("open",this.open.toString())}async show(){if(!this.open)return this.onToggleClick(),c(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),c(this,"sd-after-hide")}render(){return o`<details part="details"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details><button part="toggle" class="${i("sd-interactive sd-interactive--reset !h-full !justify-center !w-full !text-base !flex !items-center !underline !underline-offset-2 !toggle",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}">${this.open?o`<slot name="toggle-open"><sd-3-
|
1
|
+
import{S as e,L as t,x as o,t as i,r as s,c as n,i as r,e as a,n as l,a as d}from"./solid-components2.js";import{w as c}from"./event.js";import{w as h}from"./watch.js";import{I as p}from"./interactive.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,v=(e,t,o,i)=>{for(var s,n=i>1?void 0:i?g(t,o):t,r=e.length-1;r>=0;r--)(s=e[r])&&(n=(i?s(t,o,n):s(n))||n);return i&&n&&m(t,o,n),n};let u=class extends e{constructor(){super(...arguments),this.open=!1,this.inverted=!1,this.localize=new t(this)}updateMaxHeight(){var e;const t=null==(e=this.contentPreview)?void 0:e.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${t}px`),this.style.setProperty("--max-height",t)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}onOpenChange(){this.open?(this.emit("sd-show"),this.updateComplete.then((()=>{this.emit("sd-after-show")}))):(this.emit("sd-hide"),this.updateComplete.then((()=>{this.emit("sd-after-hide")}))),this.details.setAttribute("open",this.open.toString())}async show(){if(!this.open)return this.onToggleClick(),c(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),c(this,"sd-after-hide")}render(){return o`<details part="details"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details><button part="toggle" class="${i("sd-interactive sd-interactive--reset !h-full !justify-center !w-full !text-base !flex !items-center !underline !underline-offset-2 !toggle",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}">${this.open?o`<slot name="toggle-open"><sd-3-21-0-icon class="mr-2 text-xl" library="system" name="chevron-up"></sd-3-21-0-icon>${this.localize.term("showLess")}</slot>`:o`<slot name="toggle-closed"><sd-3-21-0-icon class="mr-2 text-xl" library="system" name="chevron-down"></sd-3-21-0-icon>${this.localize.term("showMore")}</slot>`}</button>`}firstUpdated(){this.cloneContentToLightDOM(),this.details.setAttribute("open",this.open.toString())}cloneContentToLightDOM(){const e=document.createElement("div");e.setAttribute("slot","clone"),Array.from(this.childNodes).forEach((t=>{const o=t.cloneNode(!0);e.appendChild(o)})),this.appendChild(e)}};u.styles=[e.styles,s(p),n,r`:host{--gradient-color-start:rgba(255, 255, 255, 0);--gradient-color-end:rgba(255, 255, 255, 1);--component-expandable-max-block-size:90px;--gradient-height:24px;--gradient:var(--gradient-color-start) 0%,var(--gradient-color-end) 80%,var(--gradient-color-end) 100%;position:relative;display:inline-block;width:100%}.toggle::-moz-focus-inner{border-style:none;padding:var(--sd-spacing-0,0)}details>summary::-webkit-details-marker,details[open] summary{display:none}summary{max-block-size:var(--component-expandable-max-block-size)}:host([open]) summary{max-block-size:var(--max-height-pixel,1000vh)}.content{max-block-size:var(--component-expandable-max-block-size)}:host([open]) .content{max-block-size:var(--max-height-pixel,1000vh)}:host(:not([open])) .content::after{position:absolute;bottom:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);display:block;width:100%;content:' ';height:var(--gradient-height);background:linear-gradient(180deg,var(--gradient))}:host([inverted]:not([open])) .content::after{background:var(--gradient-vertical-transparent-primary,linear-gradient(180deg,rgba(0,53,142,0) 0,#00358e 80%,#00358e 100%))}`],v([a(".content-preview")],u.prototype,"contentPreview",2),v([a("details")],u.prototype,"details",2),v([l({type:Boolean,reflect:!0})],u.prototype,"open",2),v([l({type:Boolean,reflect:!0})],u.prototype,"inverted",2),v([h("open",{waitUntilFirstUpdate:!0})],u.prototype,"onOpenChange",1),u=v([d("sd-3-21-0-expandable")],u);export{u as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as r,t as a,c as i,i as e,e as o,n,a as l}from"./solid-components2.js";var d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(t,r,a,i)=>{for(var e,o=i>1?void 0:i?c(r,a):r,n=t.length-1;n>=0;n--)(e=t[n])&&(o=(i?e(r,a,o):e(o))||o);return i&&o&&d(r,a,o),o};let f=class extends t{constructor(){super(...arguments),this.activation="click hover",this.flipDirection="horizontal",this.frontVariant="empty",this.backVariant="empty"}connectedCallback(){super.connectedCallback()}flipFront(){this.front.classList.add("clicked--front"),this.back.classList.add("clicked--back"),this.emit("sd-flip-front"),this.back.focus()}flipBack(){this.front.classList.remove("clicked--front"),this.back.classList.remove("clicked--back"),this.emit("sd-flip-back"),this.front.focus()}handleFrontClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipFront()}handleBackClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipBack()}handleFrontKeydown(t){"Enter"===t.code&&this.front===t.target&&this.flipFront()}handleBackKeydown(t){"Enter"===t.code&&this.back===t.target&&this.flipBack()}render(){return r`<div part="base" class="${a("flip-card relative h-full w-full")}"><div part="front" tabindex="0" class="${a("flip-card__side flip-card__side--front overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.frontVariant&&"bg-primary","primary-100"===this.frontVariant&&"bg-primary-100","gradient-dark-bottom"===this.frontVariant||"gradient-light-bottom"===this.frontVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleFrontClick}" @keydown="${this.handleFrontKeydown}"><div part="media-front" class="${a("absolute h-full w-full -z-20",("primary"===this.frontVariant||"primary-100"===this.frontVariant)&&"hidden")}"><slot name="media-front"></slot></div><div part="front-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.frontVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.frontVariant])}"><slot name="front"></slot></div><div part="front-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.frontVariant])}"></div></div><div part="back" tabindex="0" class="${a("flip-card__side flip-card__side--back overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.backVariant&&"bg-primary","primary-100"===this.backVariant&&"bg-primary-100","gradient-dark-bottom"===this.backVariant||"gradient-light-bottom"===this.backVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleBackClick}" @keydown="${this.handleBackKeydown}"><div part="media-back" class="${a("absolute h-full w-full -z-20",("primary"===this.backVariant||"primary-100"===this.backVariant)&&"hidden")}"><slot name="media-back"></slot></div><div part="back-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.backVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.backVariant])}"><slot name="back"></slot></div><div part="back-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.backVariant])}"></div></div></div>`}};f.styles=[i,t.styles,e`:host{display:block;aspect-ratio:3/4;--name:'';--height:480px;height:var(--height)}.flip-card{perspective:100rem}.flip-card__side{backface-visibility:hidden}.flip-card__side--back{transform:rotateY(180deg)}.clicked--front{transform:rotateY(-180deg)}.clicked--back{transform:rotateY(0)}.flip-card__side--back.vertical{transform:rotateX(180deg)}.clicked--front.vertical{transform:rotateX(-180deg)}.clicked--back.vertical{transform:rotateX(0)}.flip-card__gradient{flex:.4 1 0}@media (hover:hover) and (pointer:fine){.flip-card:hover .flip-card__side--front.hover{transform:rotateY(-180deg)}.flip-card:hover .flip-card__side--back.hover{transform:rotateY(0)}.flip-card:hover .flip-card__side--front.hover.vertical{transform:rotateX(-180deg)}.flip-card:hover .flip-card__side--back.hover.vertical{transform:rotateX(0)}}`],s([o('[part="front"]')],f.prototype,"front",2),s([o('[part="back"]')],f.prototype,"back",2),s([n({reflect:!0})],f.prototype,"activation",2),s([n({reflect:!0,attribute:"flip-direction"})],f.prototype,"flipDirection",2),s([n({type:String,reflect:!0,attribute:"front-variant"})],f.prototype,"frontVariant",2),s([n({type:String,reflect:!0,attribute:"back-variant"})],f.prototype,"backVariant",2),f=s([l("sd-3-
|
1
|
+
import{S as t,x as r,t as a,c as i,i as e,e as o,n,a as l}from"./solid-components2.js";var d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(t,r,a,i)=>{for(var e,o=i>1?void 0:i?c(r,a):r,n=t.length-1;n>=0;n--)(e=t[n])&&(o=(i?e(r,a,o):e(o))||o);return i&&o&&d(r,a,o),o};let f=class extends t{constructor(){super(...arguments),this.activation="click hover",this.flipDirection="horizontal",this.frontVariant="empty",this.backVariant="empty"}connectedCallback(){super.connectedCallback()}flipFront(){this.front.classList.add("clicked--front"),this.back.classList.add("clicked--back"),this.emit("sd-flip-front"),this.back.focus()}flipBack(){this.front.classList.remove("clicked--front"),this.back.classList.remove("clicked--back"),this.emit("sd-flip-back"),this.front.focus()}handleFrontClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipFront()}handleBackClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipBack()}handleFrontKeydown(t){"Enter"===t.code&&this.front===t.target&&this.flipFront()}handleBackKeydown(t){"Enter"===t.code&&this.back===t.target&&this.flipBack()}render(){return r`<div part="base" class="${a("flip-card relative h-full w-full")}"><div part="front" tabindex="0" class="${a("flip-card__side flip-card__side--front overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.frontVariant&&"bg-primary","primary-100"===this.frontVariant&&"bg-primary-100","gradient-dark-bottom"===this.frontVariant||"gradient-light-bottom"===this.frontVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleFrontClick}" @keydown="${this.handleFrontKeydown}"><div part="media-front" class="${a("absolute h-full w-full -z-20",("primary"===this.frontVariant||"primary-100"===this.frontVariant)&&"hidden")}"><slot name="media-front"></slot></div><div part="front-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.frontVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.frontVariant])}"><slot name="front"></slot></div><div part="front-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.frontVariant])}"></div></div><div part="back" tabindex="0" class="${a("flip-card__side flip-card__side--back overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.backVariant&&"bg-primary","primary-100"===this.backVariant&&"bg-primary-100","gradient-dark-bottom"===this.backVariant||"gradient-light-bottom"===this.backVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleBackClick}" @keydown="${this.handleBackKeydown}"><div part="media-back" class="${a("absolute h-full w-full -z-20",("primary"===this.backVariant||"primary-100"===this.backVariant)&&"hidden")}"><slot name="media-back"></slot></div><div part="back-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.backVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.backVariant])}"><slot name="back"></slot></div><div part="back-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.backVariant])}"></div></div></div>`}};f.styles=[i,t.styles,e`:host{display:block;aspect-ratio:3/4;--name:'';--height:480px;height:var(--height)}.flip-card{perspective:100rem}.flip-card__side{backface-visibility:hidden}.flip-card__side--back{transform:rotateY(180deg)}.clicked--front{transform:rotateY(-180deg)}.clicked--back{transform:rotateY(0)}.flip-card__side--back.vertical{transform:rotateX(180deg)}.clicked--front.vertical{transform:rotateX(-180deg)}.clicked--back.vertical{transform:rotateX(0)}.flip-card__gradient{flex:.4 1 0}@media (hover:hover) and (pointer:fine){.flip-card:hover .flip-card__side--front.hover{transform:rotateY(-180deg)}.flip-card:hover .flip-card__side--back.hover{transform:rotateY(0)}.flip-card:hover .flip-card__side--front.hover.vertical{transform:rotateX(-180deg)}.flip-card:hover .flip-card__side--back.hover.vertical{transform:rotateX(0)}}`],s([o('[part="front"]')],f.prototype,"front",2),s([o('[part="back"]')],f.prototype,"back",2),s([n({reflect:!0})],f.prototype,"activation",2),s([n({reflect:!0,attribute:"flip-direction"})],f.prototype,"flipDirection",2),s([n({type:String,reflect:!0,attribute:"front-variant"})],f.prototype,"frontVariant",2),s([n({type:String,reflect:!0,attribute:"back-variant"})],f.prototype,"backVariant",2),f=s([l("sd-3-21-0-flipcard")],f);export{f as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{x as t}from"./solid-components2.js";const e=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap;class a{constructor(t,i){this.handleFormData=t=>{const e=this.options.disabled(this.host),i=this.options.name(this.host),s=this.options.value(this.host),o="sd-3-
|
1
|
+
import{x as t}from"./solid-components2.js";const e=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap;class a{constructor(t,i){this.handleFormData=t=>{const e=this.options.disabled(this.host),i=this.options.name(this.host),s=this.options.value(this.host),o="sd-3-21-0-button"===this.host.tagName.toLowerCase();!e&&!o&&"string"==typeof i&&i.length>0&&typeof s<"u"&&(Array.isArray(s)?s.forEach((e=>{t.formData.append(i,e.toString())})):t.formData.append(i,s.toString()))},this.handleFormSubmit=t=>{var i,s;const o=this.options.disabled(this.host),a=this.options.reportValidity;if(this.form&&!this.form.noValidate&&(null==(i=e.get(this.form))||i.forEach((t=>{this.setUserInteracted(t,!0)}))),this.form&&!this.form.noValidate&&!o&&!a(this.host)){t.preventDefault(),t.stopImmediatePropagation();const e=null==(s=this.form)?void 0:s.querySelectorAll("[data-invalid]");Array.from(e).filter((t=>"sd-3-21-0-radio-group"===t.tagName.toLowerCase())).forEach((t=>{var e,i;null==(i=null==(e=t.shadowRoot)?void 0:e.querySelector("input"))||i.dispatchEvent(new Event("invalid"))})),null!=e&&e.length&&e[0].focus()}},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),o.set(this.host,[])},this.handleInteraction=t=>{const e=o.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.fakeUserInteraction=()=>{this.setUserInteracted(this.host,!0)},(this.host=t).addController(this),this.options={form:t=>{if(t.hasAttribute("form")&&""!==t.getAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");if(i)return e.getElementById(i)}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>t.disabled??!1,reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sd-3-21-0-input"],...i}}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),o.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),o.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){var t;const e=this.options.form(this.host);e||this.detachForm(),e&&this.form!==e&&(this.detachForm(),this.attachForm(e)),this.host.hasUpdated&&(this.setValidity(null==(t=this.host)?void 0:t.validity.valid),this.updateValidityStyle())}attachForm(t){t?(this.form=t,e.has(this.form)?e.get(this.form).add(this.host):e.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),i.has(this.form)||(i.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&(null==(t=e.get(this.form))||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),i.has(this.form)&&(this.form.reportValidity=i.get(this.form),i.delete(this.form))),this.form=void 0}reportFormValidity(){if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){s.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&(i.name=e.name,i.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}))),this.form.append(i),i.click(),i.remove()}}updateValidityStyle(){this.host.hasAttribute("data-user-valid")&&this.host.checkValidity()?(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!0),this.host.showInvalidStyle=!1):this.host.hasAttribute("data-user-invalid")&&!this.host.checkValidity()?(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!0):(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!1)}getForm(){return this.form??null}renderInvalidMessage(){return t`<div id="invalid-message" class="text-error text-sm mt-2 text-left" part="invalid-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var e;const i=this.host,o=!!s.get(i),a=!!i.required;null!=(e=this.form)&&e.noValidate?(i.removeAttribute("data-required"),i.removeAttribute("data-optional"),i.removeAttribute("data-invalid"),i.removeAttribute("data-valid"),i.removeAttribute("data-user-invalid"),i.removeAttribute("data-user-valid")):(i.toggleAttribute("data-required",a),i.toggleAttribute("data-optional",!a),i.toggleAttribute("data-invalid",!t),i.toggleAttribute("data-valid",t),i.toggleAttribute("data-user-invalid",!t&&o),i.toggleAttribute("data-user-valid",t&&o))}updateValidity(){const t=this.host;this.setValidity(null==t?void 0:t.validity.valid)}emitInvalidEvent(t){null==t||t.preventDefault();const e=new CustomEvent("sd-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault()}}const r=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),h=Object.freeze({...r,valid:!1,valueMissing:!0}),n=Object.freeze({...r,valid:!1,customError:!0});export{a as F,h as a,n as c,r as v};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,x as t,c as r,i as s,n as a,a as i}from"./solid-components2.js";import{d}from"./debounce.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=(e,t,r,s)=>{for(var a,i=s>1?void 0:s?n(t,r):t,d=e.length-1;d>=0;d--)(a=e[d])&&(i=(s?a(t,r,i):a(i))||i);return s&&i&&l(t,r,i),i};let h=class extends e{constructor(){super(...arguments),this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setCalculatedHeightProperty=this.setCalculatedHeightProperty.bind(this),this.addResizeObserver=this.addResizeObserver.bind(this)}firstUpdated(){this.toggleHeightCalculation()}toggleHeightCalculation(){var e;this.fixed?(this.setCalculatedHeightProperty(),this.addResizeObserver()):(this.setCalculatedHeightProperty(),null==(e=this.resizeObserver)||e.disconnect(),this.resizeObserver=void 0)}disconnectedCallback(){super.disconnectedCallback()}updated(e){super.updated(e),e.has("fixed")&&this.toggleHeightCalculation()}onResize(){this.fixed&&this.setCalculatedHeightProperty()}addResizeObserver(){this.resizeObserver=new ResizeObserver((()=>{this.onResize()})),this.refHeaderElement&&this.resizeObserver.observe(this.refHeaderElement)}setCalculatedHeightProperty(){this.fixed&&this.refHeaderElement?document.documentElement.style.setProperty("--sd-3-
|
1
|
+
import{S as e,x as t,c as r,i as s,n as a,a as i}from"./solid-components2.js";import{d}from"./debounce.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=(e,t,r,s)=>{for(var a,i=s>1?void 0:s?n(t,r):t,d=e.length-1;d>=0;d--)(a=e[d])&&(i=(s?a(t,r,i):a(i))||i);return s&&i&&l(t,r,i),i};let h=class extends e{constructor(){super(...arguments),this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setCalculatedHeightProperty=this.setCalculatedHeightProperty.bind(this),this.addResizeObserver=this.addResizeObserver.bind(this)}firstUpdated(){this.toggleHeightCalculation()}toggleHeightCalculation(){var e;this.fixed?(this.setCalculatedHeightProperty(),this.addResizeObserver()):(this.setCalculatedHeightProperty(),null==(e=this.resizeObserver)||e.disconnect(),this.resizeObserver=void 0)}disconnectedCallback(){super.disconnectedCallback()}updated(e){super.updated(e),e.has("fixed")&&this.toggleHeightCalculation()}onResize(){this.fixed&&this.setCalculatedHeightProperty()}addResizeObserver(){this.resizeObserver=new ResizeObserver((()=>{this.onResize()})),this.refHeaderElement&&this.resizeObserver.observe(this.refHeaderElement)}setCalculatedHeightProperty(){this.fixed&&this.refHeaderElement?document.documentElement.style.setProperty("--sd-3-21-0-header-calculated-height",`${this.refHeaderElement.clientHeight}px`):document.documentElement.style.removeProperty("--sd-3-21-0-header-calculated-height")}render(){return t`<header class="w-full bg-white relative" role="banner" @slotchange="${this.handleSlotChange}"><div part="main" class="relative mx-auto my-0 box-border"><slot></slot></div></header>`}handleSlotChange(e){e.target.assignedElements().length>0&&(this.refHeaderElement=e.currentTarget,this.setCalculatedHeightProperty())}};h.styles=[e.styles,r,s`:host{display:block}:host([fixed]){position:fixed;left:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);width:100%}:host([fixed]) header::after{content:'';position:absolute;left:var(--sd-spacing-0,0);right:var(--sd-spacing-0,0);top:100%;height:var(--sd-spacing-2,.5rem);background:var(--gradient-vertical-black-40-transparent,linear-gradient(0deg,#18181800 50%,#18181866 100%))}[part=main]{width:var(--sd-3-21-0-header-inner-width);max-width:var(--sd-3-21-0-header-inner-max-width);padding:var(--sd-3-21-0-header-padding,12px 16px)}`],o([a({reflect:!0,type:Boolean})],h.prototype,"fixed",2),o([d(100)],h.prototype,"onResize",1),h=o([i("sd-3-21-0-header")],h);export{h as default};
|
@@ -8,4 +8,4 @@ import{T as t,w as e,S as r,f as s,u as i,g as o,x as a,c as l,i as n,n as c,a a
|
|
8
8
|
* @license
|
9
9
|
* Copyright 2017 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/class f extends m{}f.directiveName="unsafeSVG",f.resultType=2;const w=u(f);var x=Object.defineProperty,j=Object.getOwnPropertyDescriptor,C=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?j(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&x(e,r,o),o};let T,_=class extends r{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),s(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),i(this)}getUrl(){const t=o(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=o(this.library),r=this.getUrl();if(T||(T=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=T.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return a`${w(this.svg)}`}};_.styles=[l,n`:host{width:1em;height:1em;box-sizing:content-box!important;display:inline-block}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity))}:host([color=white]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity))}`],C([d()],_.prototype,"svg",2),C([c({reflect:!0})],_.prototype,"name",2),C([c()],_.prototype,"src",2),C([c()],_.prototype,"label",2),C([c({reflect:!0})],_.prototype,"library",2),C([c({reflect:!0})],_.prototype,"color",2),C([y("label")],_.prototype,"handleLabelChange",1),C([y(["name","src","library"])],_.prototype,"setIcon",1),_=C([h("sd-3-
|
11
|
+
*/class f extends m{}f.directiveName="unsafeSVG",f.resultType=2;const w=u(f);var x=Object.defineProperty,j=Object.getOwnPropertyDescriptor,C=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?j(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&x(e,r,o),o};let T,_=class extends r{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),s(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),i(this)}getUrl(){const t=o(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=o(this.library),r=this.getUrl();if(T||(T=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=T.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return a`${w(this.svg)}`}};_.styles=[l,n`:host{width:1em;height:1em;box-sizing:content-box!important;display:inline-block}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity))}:host([color=white]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity))}`],C([d()],_.prototype,"svg",2),C([c({reflect:!0})],_.prototype,"name",2),C([c()],_.prototype,"src",2),C([c()],_.prototype,"label",2),C([c({reflect:!0})],_.prototype,"library",2),C([c({reflect:!0})],_.prototype,"color",2),C([y("label")],_.prototype,"handleLabelChange",1),C([y(["name","src","library"])],_.prototype,"setIcon",1),_=C([h("sd-3-21-0-icon")],_);const k=Object.freeze(Object.defineProperty({__proto__:null,get default(){return _}},Symbol.toStringTag,{value:"Module"}));export{_ as S,k as i,v as o};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,c as r,i as s,n as o,a as i}from"./solid-components2.js";import{requestInclude as a}from"./request2.js";import{w as c}from"./watch.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,p=(t,e,r,s)=>{for(var o,i=s>1?void 0:s?n(e,r):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s?o(e,r,i):o(i))||i);return s&&i&&l(e,r,i),i};let d=class extends t{constructor(){super(...arguments),this.mode="cors",this.allowScripts=!1}executeScript(t){const e=document.createElement("script");[...t.attributes].forEach((t=>e.setAttribute(t.name,t.value))),e.textContent=t.textContent,t.parentNode.replaceChild(e,t)}async handleSrcChange(){try{const t=this.src,e=await a(t,this.mode);if(t!==this.src)return;if(!e.ok)return void this.emit("sd-error",{detail:{status:e.status}});this.innerHTML=e.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach((t=>this.executeScript(t))),this.emit("sd-load")}catch{this.emit("sd-error",{detail:{status:-1}})}}render(){return e`<slot></slot>`}};d.styles=[r,s`:host{display:block}`],p([o()],d.prototype,"src",2),p([o()],d.prototype,"mode",2),p([o({attribute:"allow-scripts",type:Boolean})],d.prototype,"allowScripts",2),p([c("src")],d.prototype,"handleSrcChange",1),d=p([i("sd-3-
|
1
|
+
import{S as t,x as e,c as r,i as s,n as o,a as i}from"./solid-components2.js";import{requestInclude as a}from"./request2.js";import{w as c}from"./watch.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,p=(t,e,r,s)=>{for(var o,i=s>1?void 0:s?n(e,r):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s?o(e,r,i):o(i))||i);return s&&i&&l(e,r,i),i};let d=class extends t{constructor(){super(...arguments),this.mode="cors",this.allowScripts=!1}executeScript(t){const e=document.createElement("script");[...t.attributes].forEach((t=>e.setAttribute(t.name,t.value))),e.textContent=t.textContent,t.parentNode.replaceChild(e,t)}async handleSrcChange(){try{const t=this.src,e=await a(t,this.mode);if(t!==this.src)return;if(!e.ok)return void this.emit("sd-error",{detail:{status:e.status}});this.innerHTML=e.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach((t=>this.executeScript(t))),this.emit("sd-load")}catch{this.emit("sd-error",{detail:{status:-1}})}}render(){return e`<slot></slot>`}};d.styles=[r,s`:host{display:block}`],p([o()],d.prototype,"src",2),p([o()],d.prototype,"mode",2),p([o({attribute:"allow-scripts",type:Boolean})],d.prototype,"allowScripts",2),p([c("src")],d.prototype,"handleSrcChange",1),d=p([i("sd-3-21-0-include")],d);export{d as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{S as t,L as e,x as s,t as i,c as l,i as a,e as o,n as r,a as n}from"./solid-components2.js";import{d as p}from"./default-value.js";import{F as h}from"./form.js";import{H as d}from"./slot.js";import{o as u}from"./if-defined.js";import{l as c}from"./live.js";import{r as y}from"./state.js";import{w as m}from"./watch.js";var b,v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=(t,e,s,i)=>{for(var l,a=i>1?void 0:i?f(e,s):e,o=t.length-1;o>=0;o--)(l=t[o])&&(a=(i?l(e,s,a):l(a))||a);return i&&a&&v(e,s,a),a};const w=!(null==(b=navigator.userAgentData)?void 0:b.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let $=class extends t{constructor(){super(...arguments),this.formControlController=new h(this),this.hasSlotController=new d(this,"help-text","label","left","right","message","placeholder"),this.localize=new e(this),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.type="text",this.size="lg",this.value="",this.defaultValue="",this.placeholder="",this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.noSpinButtons=!1,this.form="",this.name="",this.title="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0}get valueAsDate(){var t;return(null==(t=this.input)?void 0:t.valueAsDate)??null}set valueAsDate(t){const e=document.createElement("input");e.type="date",e.valueAsDate=t,this.value=e.value}get valueAsNumber(){var t;return(null==(t=this.input)?void 0:t.valueAsNumber)??parseFloat(this.value)}set valueAsNumber(t){const e=document.createElement("input");e.type="number",e.valueAsNumber=t,this.value=e.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(t){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleKeyDown(t){const e=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"===t.key&&!e&&setTimeout((()=>{!t.defaultPrevented&&!t.isComposing&&this.formControlController.submit()}))}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,s="none"){this.input.setSelectionRange(t,e,s)}setRangeText(t,e,s,i){this.input.setRangeText(t,e,s,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var t;return null==(t=this.input)?void 0:t.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),e=this.hasSlotController.test("help-text"),l=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),a=this.hasSlotController.test("right"),o=!!this.label||!!t,r=!!this.helpText||!!e,n=this.clearable&&!this.readonly&&("number"==typeof this.value||this.value.length>0),p=this.disabled?"disabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",h="sm"===this.size?"text-sm":"text-base",d={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"}[p],y=this.disabled?"text-neutral-500":"text-primary",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return s`<div part="form-control" class="${i(this.disabled&&"pointer-events-none")}"><label part="form-control-label" id="label" class="${i("mb-2",o?"inline-block":"hidden",h)}" for="input" aria-hidden="${o?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="relative w-full"><div part="border" class="${i("absolute w-full h-full pointer-events-none border rounded-default",d)}"></div><div part="base" class="${i("px-4 flex flex-row items-center rounded-default transition-all","lg"===this.size?"py-2":"py-1",this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===p?"text-neutral-500":"text-black")}">${l?s`<slot name="left" part="left" class="${i("inline-flex","sm"===this.size?"mr-1":"mr-2",y,b)}"></slot>`:""} <input part="input" id="input" class="${i("min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700","sm"===this.size?"h-6":"h-8",h)}" type="${"password"===this.type&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${u(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${u(this.placeholder)}" minlength="${u(this.minlength)}" maxlength="${u(this.maxlength)}" min="${u(this.min)}" max="${u(this.max)}" step="${u(this.step)}" .value="${c(this.value)}" autocapitalize="${u("password"===this.type?"off":this.autocapitalize)}" autocomplete="${u("password"===this.type?"off":this.autocomplete)}" autocorrect="${u("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${u(this.pattern)}" enterkeyhint="${u(this.enterkeyhint)}" inputmode="${u(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${n?s`<button part="clear-button" class="${i("flex justify-center ",m)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-20-6-icon class="${i("icon-fill-neutral-800",b)}" library="system" name="closing-round"></sd-3-20-6-icon></slot></button>`:""} ${this.passwordToggle&&"password"===this.type?s`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible?s`<slot name="show-password-icon"><sd-3-20-6-icon class="${i(y,m,b)}" library="system" name="eye"></sd-3-20-6-icon></slot>`:s`<slot name="hide-password-icon"><sd-3-20-6-icon class="${i(y,m,b)}" library="system" name="eye-crossed-out"></sd-3-20-6-icon></slot>`}</button>`:""} ${"date"!==this.type&&"datetime-local"!==this.type||w?"":s`<sd-3-20-6-icon class="${i(y,m,b)}" library="system" name="calendar"></sd-3-20-6-icon>`} ${"time"===this.type?s`<sd-3-20-6-icon class="${i(y,m,b)}" library="system" name="clock"></sd-3-20-6-icon>`:""} ${"search"===this.type?s`<button class="flex items-center" type="button" tabindex="-1"><sd-3-20-6-icon class="${i(y,m,b)}" library="system" name="magnifying-glass"></sd-3-20-6-icon></button>`:""} ${this.showInvalidStyle?s`<sd-3-20-6-icon part="invalid-icon" class="${i("text-error",m,b)}" library="system" name="risk"></sd-3-20-6-icon>`:""} ${this.showValidStyle&&this.styleOnValid?s`<sd-3-20-6-icon class="${i("text-success flex-shrink-0",m,b)}" library="system" name="status-check" part="valid-icon"></sd-3-20-6-icon>`:""} ${a?s`<slot name="right" part="right" class="${i("inline-flex",y,m,b)}"></slot>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${i("text-sm text-neutral-700",r?"block":"hidden")}" aria-hidden="${!r}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};$.styles=[l,t.styles,a`:host{position:relative;box-sizing:border-box;display:inline-block;width:100%;text-align:left}:host([vertical]){display:block}:host([required]) #label::after{content:' *'}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}`],g([o("#input")],$.prototype,"input",2),g([o("#invalid-message")],$.prototype,"invalidMessage",2),g([y()],$.prototype,"hasFocus",2),g([y()],$.prototype,"showValidStyle",2),g([y()],$.prototype,"showInvalidStyle",2),g([r({reflect:!0})],$.prototype,"type",2),g([r({reflect:!0})],$.prototype,"size",2),g([r()],$.prototype,"inputmode",2),g([r()],$.prototype,"value",2),g([p()],$.prototype,"defaultValue",2),g([r()],$.prototype,"placeholder",2),g([r()],$.prototype,"label",2),g([r({attribute:"help-text"})],$.prototype,"helpText",2),g([r({type:Boolean})],$.prototype,"clearable",2),g([r({type:Boolean,reflect:!0})],$.prototype,"disabled",2),g([r({type:Boolean,reflect:!0})],$.prototype,"readonly",2),g([r({attribute:"password-toggle",type:Boolean})],$.prototype,"passwordToggle",2),g([r({attribute:"password-visible",type:Boolean})],$.prototype,"passwordVisible",2),g([r({attribute:"no-spin-buttons",type:Boolean})],$.prototype,"noSpinButtons",2),g([r({type:Number})],$.prototype,"minlength",2),g([r({type:Number})],$.prototype,"maxlength",2),g([r()],$.prototype,"min",2),g([r()],$.prototype,"max",2),g([r({reflect:!0})],$.prototype,"form",2),g([r()],$.prototype,"name",2),g([r()],$.prototype,"title",2),g([r({type:Boolean,reflect:!0})],$.prototype,"required",2),g([r()],$.prototype,"pattern",2),g([r()],$.prototype,"step",2),g([r()],$.prototype,"autocapitalize",2),g([r()],$.prototype,"autocorrect",2),g([r()],$.prototype,"autocomplete",2),g([r({type:Boolean})],$.prototype,"autofocus",2),g([r()],$.prototype,"enterkeyhint",2),g([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],$.prototype,"styleOnValid",2),g([r({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],$.prototype,"spellcheck",2),g([m("disabled",{waitUntilFirstUpdate:!0})],$.prototype,"handleDisabledChange",1),g([m("step",{waitUntilFirstUpdate:!0})],$.prototype,"handleStepChange",1),g([m("value",{waitUntilFirstUpdate:!0})],$.prototype,"handleValueChange",1),$=g([n("sd-3-20-6-input")],$);export{$ as default};
|
1
|
+
import"./icon.js";import{S as t,L as e,x as s,t as i,c as l,i as a,e as o,n as r,a as n}from"./solid-components2.js";import{d as p}from"./default-value.js";import{F as h}from"./form.js";import{H as d}from"./slot.js";import{o as u}from"./if-defined.js";import{l as c}from"./live.js";import{r as y}from"./state.js";import{w as m}from"./watch.js";var b,v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,g=(t,e,s,i)=>{for(var l,a=i>1?void 0:i?f(e,s):e,o=t.length-1;o>=0;o--)(l=t[o])&&(a=(i?l(e,s,a):l(a))||a);return i&&a&&v(e,s,a),a};const w=!(null==(b=navigator.userAgentData)?void 0:b.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let $=class extends t{constructor(){super(...arguments),this.formControlController=new h(this),this.hasSlotController=new d(this,"help-text","label","left","right","message","placeholder"),this.localize=new e(this),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.type="text",this.size="lg",this.value="",this.defaultValue="",this.placeholder="",this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.noSpinButtons=!1,this.form="",this.name="",this.title="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0}get valueAsDate(){var t;return(null==(t=this.input)?void 0:t.valueAsDate)??null}set valueAsDate(t){const e=document.createElement("input");e.type="date",e.valueAsDate=t,this.value=e.value}get valueAsNumber(){var t;return(null==(t=this.input)?void 0:t.valueAsNumber)??parseFloat(this.value)}set valueAsNumber(t){const e=document.createElement("input");e.type="number",e.valueAsNumber=t,this.value=e.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(t){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleKeyDown(t){const e=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"===t.key&&!e&&setTimeout((()=>{!t.defaultPrevented&&!t.isComposing&&this.formControlController.submit()}))}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,s="none"){this.input.setSelectionRange(t,e,s)}setRangeText(t,e,s,i){this.input.setRangeText(t,e,s,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var t;return null==(t=this.input)?void 0:t.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),e=this.hasSlotController.test("help-text"),l=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),a=this.hasSlotController.test("right"),o=!!this.label||!!t,r=!!this.helpText||!!e,n=this.clearable&&!this.readonly&&("number"==typeof this.value||this.value.length>0),p=this.disabled?"disabled":this.readonly?"readonly":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",h="sm"===this.size?"text-sm":"text-base",d={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"}[p],y=this.disabled?"text-neutral-500":"text-primary",m={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return s`<div part="form-control" class="${i(this.disabled&&"pointer-events-none")}"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${i(o?"inline-block":"hidden",h)}" for="input" aria-hidden="${o?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="relative w-full"><div part="border" class="${i("absolute w-full h-full pointer-events-none border rounded-default",d)}"></div><div part="base" class="${i("px-4 flex flex-row items-center rounded-default transition-all","lg"===this.size?"py-2":"py-1",this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===p?"text-neutral-500":"text-black")}">${l?s`<slot name="left" part="left" class="${i("inline-flex","sm"===this.size?"mr-1":"mr-2",y,b)}"></slot>`:""} <input part="input" id="input" class="${i("min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700","sm"===this.size?"h-6":"h-8",h)}" type="${"password"===this.type&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${u(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${u(this.placeholder)}" minlength="${u(this.minlength)}" maxlength="${u(this.maxlength)}" min="${u(this.min)}" max="${u(this.max)}" step="${u(this.step)}" .value="${c(this.value)}" autocapitalize="${u("password"===this.type?"off":this.autocapitalize)}" autocomplete="${u("password"===this.type?"off":this.autocomplete)}" autocorrect="${u("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${u(this.pattern)}" enterkeyhint="${u(this.enterkeyhint)}" inputmode="${u(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${n?s`<button part="clear-button" class="${i("flex justify-center ",m)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-21-0-icon class="${i("icon-fill-neutral-800",b)}" library="system" name="closing-round"></sd-3-21-0-icon></slot></button>`:""} ${this.passwordToggle&&"password"===this.type?s`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible?s`<slot name="show-password-icon"><sd-3-21-0-icon class="${i(y,m,b)}" library="system" name="eye"></sd-3-21-0-icon></slot>`:s`<slot name="hide-password-icon"><sd-3-21-0-icon class="${i(y,m,b)}" library="system" name="eye-crossed-out"></sd-3-21-0-icon></slot>`}</button>`:""} ${"date"!==this.type&&"datetime-local"!==this.type||w?"":s`<sd-3-21-0-icon class="${i(y,m,b)}" library="system" name="calendar"></sd-3-21-0-icon>`} ${"time"===this.type?s`<sd-3-21-0-icon class="${i(y,m,b)}" library="system" name="clock"></sd-3-21-0-icon>`:""} ${"search"===this.type?s`<button class="flex items-center" type="button" tabindex="-1"><sd-3-21-0-icon class="${i(y,m,b)}" library="system" name="magnifying-glass"></sd-3-21-0-icon></button>`:""} ${this.showInvalidStyle?s`<sd-3-21-0-icon part="invalid-icon" class="${i("text-error",m,b)}" library="system" name="risk"></sd-3-21-0-icon>`:""} ${this.showValidStyle&&this.styleOnValid?s`<sd-3-21-0-icon class="${i("text-success flex-shrink-0",m,b)}" library="system" name="status-check" part="valid-icon"></sd-3-21-0-icon>`:""} ${a?s`<slot name="right" part="right" class="${i("inline-flex",y,m,b)}"></slot>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${i("text-sm text-neutral-700",r?"block":"hidden")}" aria-hidden="${!r}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};$.styles=[l,t.styles,a`:host{position:relative;box-sizing:border-box;display:inline-block;width:100%;text-align:left}:host([vertical]){display:block}:host([required]) #label::after{content:' *'}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}`],g([o("#input")],$.prototype,"input",2),g([o("#invalid-message")],$.prototype,"invalidMessage",2),g([y()],$.prototype,"hasFocus",2),g([y()],$.prototype,"showValidStyle",2),g([y()],$.prototype,"showInvalidStyle",2),g([r({reflect:!0})],$.prototype,"type",2),g([r({reflect:!0})],$.prototype,"size",2),g([r()],$.prototype,"inputmode",2),g([r()],$.prototype,"value",2),g([p()],$.prototype,"defaultValue",2),g([r()],$.prototype,"placeholder",2),g([r()],$.prototype,"label",2),g([r({attribute:"help-text"})],$.prototype,"helpText",2),g([r({type:Boolean})],$.prototype,"clearable",2),g([r({type:Boolean,reflect:!0})],$.prototype,"disabled",2),g([r({type:Boolean,reflect:!0})],$.prototype,"readonly",2),g([r({attribute:"password-toggle",type:Boolean})],$.prototype,"passwordToggle",2),g([r({attribute:"password-visible",type:Boolean})],$.prototype,"passwordVisible",2),g([r({attribute:"no-spin-buttons",type:Boolean})],$.prototype,"noSpinButtons",2),g([r({type:Number})],$.prototype,"minlength",2),g([r({type:Number})],$.prototype,"maxlength",2),g([r()],$.prototype,"min",2),g([r()],$.prototype,"max",2),g([r({reflect:!0})],$.prototype,"form",2),g([r()],$.prototype,"name",2),g([r()],$.prototype,"title",2),g([r({type:Boolean,reflect:!0})],$.prototype,"required",2),g([r()],$.prototype,"pattern",2),g([r()],$.prototype,"step",2),g([r()],$.prototype,"autocapitalize",2),g([r()],$.prototype,"autocorrect",2),g([r()],$.prototype,"autocomplete",2),g([r({type:Boolean})],$.prototype,"autofocus",2),g([r()],$.prototype,"enterkeyhint",2),g([r({type:Boolean,reflect:!0,attribute:"style-on-valid"})],$.prototype,"styleOnValid",2),g([r({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],$.prototype,"spellcheck",2),g([m("disabled",{waitUntilFirstUpdate:!0})],$.prototype,"handleDisabledChange",1),g([m("step",{waitUntilFirstUpdate:!0})],$.prototype,"handleStepChange",1),g([m("value",{waitUntilFirstUpdate:!0})],$.prototype,"handleValueChange",1),$=g([n("sd-3-21-0-input")],$);export{$ as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as s,i,e as o,n as r,a as n}from"./solid-components2.js";import{H as l}from"./slot.js";import{o as a}from"./if-defined.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&h(e,s,r),r};let c=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","icon-left","icon-right"),this.standalone=!1,this.size="inherit",this.inverted=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return e`<a part="base" class="${s("inline",this.href?"cursor-pointer":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline"}[this.href?"enabled":"disabled"],this.standalone&&"flex items-start")}" href="${a(this.href||void 0)}" target="${a(this.target||void 0)}" download="${a(this.download)}" rel="${a(this.target?"noreferrer noopener":void 0)}" aria-disabled="${this.href?"false":"true"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"><slot name="icon-left" part="icon-left" class="${s("inline",t["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${s("inline",t["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};c.styles=[t.styles,i`::slotted(sd-3-
|
1
|
+
import{S as t,x as e,t as s,i,e as o,n as r,a as n}from"./solid-components2.js";import{H as l}from"./slot.js";import{o as a}from"./if-defined.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&h(e,s,r),r};let c=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","icon-left","icon-right"),this.standalone=!1,this.size="inherit",this.inverted=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return e`<a part="base" class="${s("inline",this.href?"cursor-pointer":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline"}[this.href?"enabled":"disabled"],this.standalone&&"flex items-start")}" href="${a(this.href||void 0)}" target="${a(this.target||void 0)}" download="${a(this.download)}" rel="${a(this.target?"noreferrer noopener":void 0)}" aria-disabled="${this.href?"false":"true"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"><slot name="icon-left" part="icon-left" class="${s("inline",t["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${s("inline",t["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};c.styles=[t.styles,i`::slotted(sd-3-21-0-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-3-21-0-icon){font-size:var(--sd-font-size-base,1rem)}:host([size=lg][standalone]) ::slotted(sd-3-21-0-icon){font-size:var(--sd-font-size-xl,1.5rem)}`],f([o("a")],c.prototype,"button",2),f([r({type:Boolean,reflect:!0})],c.prototype,"standalone",2),f([r({reflect:!0})],c.prototype,"size",2),f([r({type:Boolean,reflect:!0})],c.prototype,"inverted",2),f([r()],c.prototype,"href",2),f([r()],c.prototype,"target",2),f([r()],c.prototype,"download",2),c=f([n("sd-3-21-0-link")],c);export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,b as a,t as e,c as i,i as r,n as s,a as n}from"./solid-components2.js";import{s as l,n as o}from"./static.js";import{o as c}from"./if-defined.js";var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(t,a,e,i)=>{for(var r,s=i>1?void 0:i?v(a,e):a,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(i?r(a,e,s):r(s))||s);return i&&s&&h(a,e,s),s};let f=class extends t{constructor(){super(...arguments),this.variant="main",this.state="default",this.animated=!1,this.notInteractive=!1,this.href="",this.marker={cluster:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" opacity="1" r="20"/><circle cx="25" cy="25" opacity=".3" r="25"/></svg>`,main:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z"/><circle cx="30" cy="28" r="10" fill="#fff"/></svg>`,place:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path fill-rule="evenodd" d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z" clip-rule="evenodd"/></svg>`}}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}isLink(){return!!this.href}render(){const t=this.isLink(),a=this.notInteractive?l`div`:t?l`a`:l`button`;return o`<${a} part="base" class="${e("flex justify-center",!this.notInteractive&&"focus:outline focus:outline-2 focus:outline-primary focus:outline-offset-2")}" href="${c(t?this.href:void 0)}" target="${c(t?this.target:void 0)}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" aria-labelledby="content"><div part="marker" class="${e("inline-flex",this.animated&&("main"===this.variant||"place"===this.variant)&&"animate-bounce-once","cluster"===this.variant&&"hover"===this.state&&"scale-110 fill-primary-500","cluster"===this.variant&&!this.notInteractive&&"transition-all duration-200 ease-in-out hover:scale-110 hover:fill-primary-500","main"===this.variant&&"hover"===this.state&&"fill-accent-550","main"===this.variant&&"active"===this.state&&"fill-accent-700","main"===this.variant&&!this.notInteractive&&"hover:fill-accent-550 active:fill-accent-700","place"===this.variant&&"default"===this.state&&"fill-white","place"===this.variant&&"hover"===this.state&&"fill-primary-100","place"===this.variant&&"active"===this.state&&"fill-primary-200","place"===this.variant&&!this.notInteractive&&"hover:fill-primary-100",{cluster:"fill-primary",main:"fill-accent *:drop-shadow-md",place:"*:drop-shadow-md"}[this.variant])}">${this.marker[this.variant]}</div><div id="content" part="content" class="${e("absolute self-center pointer-events-none","cluster"===this.variant&&"font-bold text-white")}"><slot></slot></div></${a}>`}};f.styles=[i,t.styles,r`:host{display:block}:host([variant=cluster]) [part=base],svg{width:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=base]{height:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host(:not([variant=cluster])) [part=base]{height:calc(var(--sd-spacing-16,4rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=content]{font-size:calc(var(--sd-font-size-sm,.875rem) * var(--map-marker-scaling,1))}:host([variant=place]) [part=content]{font-size:calc(var(--sd-font-size-3xl,2rem) * var(--map-marker-scaling,1))}`],p([s({reflect:!0})],f.prototype,"variant",2),p([s({reflect:!0})],f.prototype,"state",2),p([s({type:Boolean,reflect:!0})],f.prototype,"animated",2),p([s({type:Boolean,reflect:!0,attribute:"not-interactive"})],f.prototype,"notInteractive",2),p([s()],f.prototype,"href",2),p([s()],f.prototype,"target",2),f=p([n("sd-3-
|
1
|
+
import{S as t,b as a,t as e,c as i,i as r,n as s,a as n}from"./solid-components2.js";import{s as l,n as o}from"./static.js";import{o as c}from"./if-defined.js";var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(t,a,e,i)=>{for(var r,s=i>1?void 0:i?v(a,e):a,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(i?r(a,e,s):r(s))||s);return i&&s&&h(a,e,s),s};let f=class extends t{constructor(){super(...arguments),this.variant="main",this.state="default",this.animated=!1,this.notInteractive=!1,this.href="",this.marker={cluster:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" opacity="1" r="20"/><circle cx="25" cy="25" opacity=".3" r="25"/></svg>`,main:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z"/><circle cx="30" cy="28" r="10" fill="#fff"/></svg>`,place:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path fill-rule="evenodd" d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z" clip-rule="evenodd"/></svg>`}}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}isLink(){return!!this.href}render(){const t=this.isLink(),a=this.notInteractive?l`div`:t?l`a`:l`button`;return o`<${a} part="base" class="${e("flex justify-center",!this.notInteractive&&"focus:outline focus:outline-2 focus:outline-primary focus:outline-offset-2")}" href="${c(t?this.href:void 0)}" target="${c(t?this.target:void 0)}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" aria-labelledby="content"><div part="marker" class="${e("inline-flex",this.animated&&("main"===this.variant||"place"===this.variant)&&"animate-bounce-once","cluster"===this.variant&&"hover"===this.state&&"scale-110 fill-primary-500","cluster"===this.variant&&!this.notInteractive&&"transition-all duration-200 ease-in-out hover:scale-110 hover:fill-primary-500","main"===this.variant&&"hover"===this.state&&"fill-accent-550","main"===this.variant&&"active"===this.state&&"fill-accent-700","main"===this.variant&&!this.notInteractive&&"hover:fill-accent-550 active:fill-accent-700","place"===this.variant&&"default"===this.state&&"fill-white","place"===this.variant&&"hover"===this.state&&"fill-primary-100","place"===this.variant&&"active"===this.state&&"fill-primary-200","place"===this.variant&&!this.notInteractive&&"hover:fill-primary-100",{cluster:"fill-primary",main:"fill-accent *:drop-shadow-md",place:"*:drop-shadow-md"}[this.variant])}">${this.marker[this.variant]}</div><div id="content" part="content" class="${e("absolute self-center pointer-events-none","cluster"===this.variant&&"font-bold text-white")}"><slot></slot></div></${a}>`}};f.styles=[i,t.styles,r`:host{display:block}:host([variant=cluster]) [part=base],svg{width:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=base]{height:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host(:not([variant=cluster])) [part=base]{height:calc(var(--sd-spacing-16,4rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=content]{font-size:calc(var(--sd-font-size-sm,.875rem) * var(--map-marker-scaling,1))}:host([variant=place]) [part=content]{font-size:calc(var(--sd-font-size-3xl,2rem) * var(--map-marker-scaling,1))}`],p([s({reflect:!0})],f.prototype,"variant",2),p([s({reflect:!0})],f.prototype,"state",2),p([s({type:Boolean,reflect:!0})],f.prototype,"animated",2),p([s({type:Boolean,reflect:!0,attribute:"not-interactive"})],f.prototype,"notInteractive",2),p([s()],f.prototype,"href",2),p([s()],f.prototype,"target",2),f=p([n("sd-3-21-0-map-marker")],f);export{f as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,t as e,c as i,r as s,i as r,n as a,a as o}from"./solid-components2.js";import{H as l}from"./slot.js";import{s as n,n as d}from"./static.js";import{o as h}from"./if-defined.js";import{I as c}from"./interactive.js";var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,v=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?u(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 f=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","description","children"),this.vertical=!1,this.size="base",this.current=!1,this.disabled=!1,this.chevron=!1,this.relaxed=!1,this.divider=!1,this.indented=!1,this.open=!1,this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.href&&this.hasSlotController.test("children")}handleClickButton(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}handleClickSummary(t){t.preventDefault(),t.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.isAccordion&&!this.isLink?n`summary`:this.separated?n`div`:this.isLink?n`a`:n`button`}render(){const t=this.tag,i=this.isLink,s=this.isButton,r=this.isAccordion,a=(this.hasSlotController.test("[default]"),this.hasSlotController.test("main"),this.hasSlotController.test("description")),o=this.hasSlotController.test("children"),l=this.vertical?"pb-3":"pb-2",n=d`<${t} part="base" class="${e("cursor-pointer relative focus-visible:focus-outline",{base:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",r?"flex flex-col":"inline-block w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-all min-h-[48px] px-4")}" aria-controls="${h(r?"navigation-item-details":void 0)}" aria-current="${h(this.current?"page":void 0)}" aria-disabled="${this.disabled}" ?disabled="${h(s?this.disabled:void 0)}" href="${h(i?this.href:void 0)}" target="${h(i?this.target:void 0)}" download="${h(i?this.download:void 0)}" rel="${h(i&&this.target?"noreferrer noopener":void 0)}" role="${i?"link":"button"}" tabindex="${this.disabled||this.separated?"-1":"0"}" @click="${this.separated?void 0:r?this.handleClickSummary:s?this.handleClickButton:void 0}"><div part="current-indicator" class="${e("absolute left-0 pointer-events-none transition-all duration-150",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-full bottom-0",this.current?"bg-accent":"bg-transparent",this.disabled&&"bg-neutral-500")}"></div><span part="content-area" class="${e("relative pt-3 inline-flex justify-between items-center",r?"grow":"w-full",a||this.separated?"pb-1":l,this.calculatePaddingX)}">${this.divider&&this.vertical?d`<sd-3-
|
1
|
+
import{S as t,t as e,c as i,r as s,i as r,n as a,a as o}from"./solid-components2.js";import{H as l}from"./slot.js";import{s as n,n as d}from"./static.js";import{o as h}from"./if-defined.js";import{I as c}from"./interactive.js";var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,v=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?u(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 f=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","description","children"),this.vertical=!1,this.size="base",this.current=!1,this.disabled=!1,this.chevron=!1,this.relaxed=!1,this.divider=!1,this.indented=!1,this.open=!1,this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.href&&this.hasSlotController.test("children")}handleClickButton(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}handleClickSummary(t){t.preventDefault(),t.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.isAccordion&&!this.isLink?n`summary`:this.separated?n`div`:this.isLink?n`a`:n`button`}render(){const t=this.tag,i=this.isLink,s=this.isButton,r=this.isAccordion,a=(this.hasSlotController.test("[default]"),this.hasSlotController.test("main"),this.hasSlotController.test("description")),o=this.hasSlotController.test("children"),l=this.vertical?"pb-3":"pb-2",n=d`<${t} part="base" class="${e("cursor-pointer relative focus-visible:focus-outline",{base:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",r?"flex flex-col":"inline-block w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-all min-h-[48px] px-4")}" aria-controls="${h(r?"navigation-item-details":void 0)}" aria-current="${h(this.current?"page":void 0)}" aria-disabled="${this.disabled}" ?disabled="${h(s?this.disabled:void 0)}" href="${h(i?this.href:void 0)}" target="${h(i?this.target:void 0)}" download="${h(i?this.download:void 0)}" rel="${h(i&&this.target?"noreferrer noopener":void 0)}" role="${i?"link":"button"}" tabindex="${this.disabled||this.separated?"-1":"0"}" @click="${this.separated?void 0:r?this.handleClickSummary:s?this.handleClickButton:void 0}"><div part="current-indicator" class="${e("absolute left-0 pointer-events-none transition-all duration-150",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-full bottom-0",this.current?"bg-accent":"bg-transparent",this.disabled&&"bg-neutral-500")}"></div><span part="content-area" class="${e("relative pt-3 inline-flex justify-between items-center",r?"grow":"w-full",a||this.separated?"pb-1":l,this.calculatePaddingX)}">${this.divider&&this.vertical?d`<sd-3-21-0-divider part="divider" class="${e("w-full transition-all absolute -top-0.25 left-0",this.calculatePaddingX)}"></sd-3-21-0-divider>`:""} <span part="content-container" class="inline-flex items-center flex-auto">${this.separated?d`<a class="${e("mr-4 w-full inline-flex items-center pl-4 cursor-pointer relative focus-visible:focus-outline hover:bg-neutral-200 group transition-all min-h-[48px]",!a&&"py-4")}" href="${h(i?this.href:void 0)}" target="${h(i?this.target:void 0)}" download="${h(i?this.download:void 0)}"><slot part="content" class="inline"></slot></a>`:d`<slot part="content" class="inline"></slot>`} </span>${(this.chevron||o)&&this.vertical?this.separated?d`<button type="button" title="toggle-details" class="sd-interactive sd-interactive--reset" @click="${this.handleClickSummary}"><sd-3-21-0-icon name="chevron-down" part="chevron" library="system" color="currentColor" class="${e("mr-4 h-6 w-6 transition-all",r||this.separated?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-3-21-0-icon></button>`:d`<sd-3-21-0-icon name="chevron-down" part="chevron" library="system" color="currentColor" class="${e("h-6 w-6 ml-2 transition-all",r?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-3-21-0-icon>`:""} </span>${a&&this.vertical?d`<slot name="description" part="description" class="${e("inline-block text-sm text-left text-black",r||this.separated?"grow":"w-full",this.separated?"px-4":this.calculatePaddingX,l)}"></slot>`:""}</${t}>`;return r?d`<details aria-expanded="${this.open}" part="details" id="navigation-item-details" ?open="${this.open}" class="relative flex">${n}<slot name="children"></slot></details>`:this.separated?d`<div part="details" id="navigation-item-details" class="relative flex flex-col">${n}${this.open?d`<slot name="children"></slot>`:""}</div>`:d`${n}`}};f.styles=[i,t.styles,s(c),r`:host{position:relative;box-sizing:border-box;display:inline-block}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}`],v([a({type:Boolean,reflect:!0})],f.prototype,"vertical",2),v([a({reflect:!0})],f.prototype,"size",2),v([a({reflect:!0})],f.prototype,"href",2),v([a()],f.prototype,"target",2),v([a()],f.prototype,"download",2),v([a({type:Boolean,reflect:!0})],f.prototype,"current",2),v([a({type:Boolean,reflect:!0})],f.prototype,"disabled",2),v([a({type:Boolean,reflect:!0})],f.prototype,"chevron",2),v([a({type:Boolean,reflect:!0})],f.prototype,"relaxed",2),v([a({type:Boolean,reflect:!0})],f.prototype,"divider",2),v([a({type:Boolean,reflect:!0})],f.prototype,"indented",2),v([a({type:Boolean,reflect:!0})],f.prototype,"open",2),v([a({type:Boolean,reflect:!0})],f.prototype,"separated",2),f=v([o("sd-3-21-0-navigation-item")],f);export{f as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{s as t,a as i}from"./animate.js";import{S as e,L as s,x as a,t as o,c as n,i as r,e as d,n as l,a as c}from"./solid-components2.js";import{g as h,s as u}from"./animation-registry.js";import{w as p}from"./event.js";import{w as m}from"./watch.js";var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,y=(t,i,e,s)=>{for(var a,o=s>1?void 0:s?b(i,e):i,n=t.length-1;n>=0;n--)(a=t[n])&&(o=(s?a(i,e,o):a(o))||o);return s&&o&&f(i,e,o),o};const w=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--top-right"}),g=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--bottom-center"});let v=class extends e{constructor(){super(...arguments),this.localize=new s(this),this.variant="info",this.open=!1,this.closable=!1,this.duration=1/0,this.durationIndicator=!1,this.toastStack="top-right",this.remainingDuration=this.duration,this.startTime=Date.now()}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>this.hide()),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>{this.hide()}),this.remainingDuration))}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await t(this.base),this.base.hidden=!1;const{keyframes:e,options:s}=h(this,"notification.show",{dir:this.localize.dir()});await i(this.base,e,s),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await t(this.base);const{keyframes:e,options:s}=h(this,"notification.hide",{dir:this.localize.dir()});await i(this.base,e,s),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,p(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,p(this,"sd-after-hide")}async toast(){return new Promise((t=>{const i="bottom-center"===this.toastStack?g:w;null===i.parentElement&&document.body.append(i),i.appendChild(this),requestAnimationFrame((()=>{this.clientWidth,this.show()})),this.addEventListener("sd-after-hide",(()=>{i.removeChild(this),t(),null===i.querySelector("sd-3-
|
1
|
+
import{s as t,a as i}from"./animate.js";import{S as e,L as s,x as a,t as o,c as n,i as r,e as d,n as l,a as c}from"./solid-components2.js";import{g as h,s as u}from"./animation-registry.js";import{w as p}from"./event.js";import{w as m}from"./watch.js";var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,y=(t,i,e,s)=>{for(var a,o=s>1?void 0:s?b(i,e):i,n=t.length-1;n>=0;n--)(a=t[n])&&(o=(s?a(i,e,o):a(o))||o);return s&&o&&f(i,e,o),o};const w=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--top-right"}),g=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--bottom-center"});let v=class extends e{constructor(){super(...arguments),this.localize=new s(this),this.variant="info",this.open=!1,this.closable=!1,this.duration=1/0,this.durationIndicator=!1,this.toastStack="top-right",this.remainingDuration=this.duration,this.startTime=Date.now()}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>this.hide()),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>{this.hide()}),this.remainingDuration))}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await t(this.base),this.base.hidden=!1;const{keyframes:e,options:s}=h(this,"notification.show",{dir:this.localize.dir()});await i(this.base,e,s),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await t(this.base);const{keyframes:e,options:s}=h(this,"notification.hide",{dir:this.localize.dir()});await i(this.base,e,s),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,p(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,p(this,"sd-after-hide")}async toast(){return new Promise((t=>{const i="bottom-center"===this.toastStack?g:w;null===i.parentElement&&document.body.append(i),i.appendChild(this),requestAnimationFrame((()=>{this.clientWidth,this.show()})),this.addEventListener("sd-after-hide",(()=>{i.removeChild(this),t(),null===i.querySelector("sd-3-21-0-notification")&&i.remove()}),{once:!0})}))}render(){return a`<div part="base" class="${o("w-full overflow-hidden flex items-stretch relative m-2")}" role="alert" id="notification" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}"><slot name="icon" part="icon" class="${o("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-3-21-0-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="system" class="h-6 w-6 text-white"></sd-3-21-0-icon></slot><div part="content" class="${o("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot part="message" class="block w-full pl-3 py-2" aria-live="polite"></slot>${this.closable?a`<sd-3-21-0-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-3-21-0-icon label="${this.localize.term("close")}" name="close" library="system" color="currentColor"></sd-3-21-0-icon></sd-3-21-0-button>`:""}</div>${this.durationIndicator?a`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${o("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute bg-neutral-400"></div>`:""}</div>`}};v.styles=[n,e.styles,r`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],y([d('[part~="base"]')],v.prototype,"base",2),y([l({reflect:!0})],v.prototype,"variant",2),y([l({type:Boolean,reflect:!0})],v.prototype,"open",2),y([l({type:Boolean,reflect:!0})],v.prototype,"closable",2),y([l({type:Number})],v.prototype,"duration",2),y([l({type:Boolean,reflect:!0,attribute:"duration-indicator"})],v.prototype,"durationIndicator",2),y([l({reflect:!0,attribute:"toast-stack"})],v.prototype,"toastStack",2),y([m("open",{waitUntilFirstUpdate:!0})],v.prototype,"handleOpenChange",1),y([m("duration")],v.prototype,"handleDurationChange",1),v=y([c("sd-3-21-0-notification")],v),u("notification.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),u("notification.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});export{v as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{S as e,x as t,t as s,c as l,i as a,e as o,n as r,a as i}from"./solid-components2.js";import{H as n}from"./slot.js";import{r as h}from"./state.js";import{w as c}from"./watch.js";var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,u=(e,t,s,l)=>{for(var a,o=l>1?void 0:l?p(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(o=(l?a(t,s,o):a(o))||o);return l&&o&&d(t,s,o),o};let b=class extends e{constructor(){super(...arguments),this.hasSlotController=new n(this,"default","left","right"),this.current=!1,this.selected=!1,this.hasHover=!1,this.size="lg",this.checkbox=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){const e=this.getTextLabel();typeof this.cachedTextLabel>"u"?this.cachedTextLabel=e:e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){return(this.textContent??"").trim()}render(){this.hasSlotController.test("default");const e=this.hasSlotController.test("left"),l=this.hasSlotController.test("right");return t`<div part="base" class="${s("px-4 flex items-center w-full transition-all text-left text-base relative text-black",{sm:"text-sm py-1",md:"text-base py-2",lg:"text-base py-3"}[this.size],this.disabled?"text-neutral-500 cursor-not-allowed":"cursor-pointer",this.hasHover&&!this.disabled?"bg-neutral-200":"",this.current&&"bg-neutral-200")}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><span class="${s("absolute w-full left-0 top-0 pointer-events-none transition-all duration-150 border-l-4 h-[calc(100%-8px)]",this.selected&&!this.checkbox?"border-accent":"border-transparent",this.disabled&&"border-neutral-500 top-1",!this.disabled&&this.hasHover?"h-full top-0":"top-1")}"></span> ${this.checkbox?t`<span id="control" part="control ${this.selected?" control--checked":"control--unchecked"}" class="${s("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4 mr-2",this.disabled?"border-neutral-500":this.selected?"bg-accent border-accent":"border-neutral-800")}">${this.selected?t`<sd-3-
|
1
|
+
import"./icon.js";import{S as e,x as t,t as s,c as l,i as a,e as o,n as r,a as i}from"./solid-components2.js";import{H as n}from"./slot.js";import{r as h}from"./state.js";import{w as c}from"./watch.js";var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,u=(e,t,s,l)=>{for(var a,o=l>1?void 0:l?p(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(o=(l?a(t,s,o):a(o))||o);return l&&o&&d(t,s,o),o};let b=class extends e{constructor(){super(...arguments),this.hasSlotController=new n(this,"default","left","right"),this.current=!1,this.selected=!1,this.hasHover=!1,this.size="lg",this.checkbox=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){const e=this.getTextLabel();typeof this.cachedTextLabel>"u"?this.cachedTextLabel=e:e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){return(this.textContent??"").trim()}render(){this.hasSlotController.test("default");const e=this.hasSlotController.test("left"),l=this.hasSlotController.test("right");return t`<div part="base" class="${s("px-4 flex items-center w-full transition-all text-left text-base relative text-black",{sm:"text-sm py-1",md:"text-base py-2",lg:"text-base py-3"}[this.size],this.disabled?"text-neutral-500 cursor-not-allowed":"cursor-pointer",this.hasHover&&!this.disabled?"bg-neutral-200":"",this.current&&"bg-neutral-200")}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><span class="${s("absolute w-full left-0 top-0 pointer-events-none transition-all duration-150 border-l-4 h-[calc(100%-8px)]",this.selected&&!this.checkbox?"border-accent":"border-transparent",this.disabled&&"border-neutral-500 top-1",!this.disabled&&this.hasHover?"h-full top-0":"top-1")}"></span> ${this.checkbox?t`<span id="control" part="control ${this.selected?" control--checked":"control--unchecked"}" class="${s("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4 mr-2",this.disabled?"border-neutral-500":this.selected?"bg-accent border-accent":"border-neutral-800")}">${this.selected?t`<sd-3-21-0-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-check"></sd-3-21-0-icon>`:""}</span>`:""} ${e?t`<slot name="left" part="left" class="inline-flex mr-2"></slot>`:""}<slot part="label" class="inline-block flex-grow" @slotchange="${this.handleDefaultSlotChange}"></slot>${l?t`<slot name="right" part="right" class="inline-flex ml-2"></slot>`:""}</div>`}};b.styles=[l,e.styles,a`:host{position:relative;display:block;width:100%;outline:2px solid transparent!important;outline-offset:2px!important}`],u([o('[part="base"]')],b.prototype,"defaultSlot",2),u([h()],b.prototype,"current",2),u([h()],b.prototype,"selected",2),u([h()],b.prototype,"hasHover",2),u([r({reflect:!0})],b.prototype,"size",2),u([r({type:Boolean,reflect:!0})],b.prototype,"checkbox",2),u([r({type:Boolean,reflect:!0})],b.prototype,"disabled",2),u([r({reflect:!0})],b.prototype,"value",2),u([c("disabled")],b.prototype,"handleDisabledChange",1),u([c("selected")],b.prototype,"handleSelectedChange",1),u([c("value")],b.prototype,"handleValueChange",1),b=u([i("sd-3-21-0-option")],b);export{b as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{x as e,t,i as a,n as s,a as i}from"./solid-components2.js";import{o}from"./if-defined.js";import{s as n}from"./animation-registry.js";import r from"./accordion.js";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c=(e,t,a,s)=>{for(var i,o=s>1?void 0:s?d(t,a):t,n=e.length-1;n>=0;n--)(i=e[n])&&(o=(s?i(t,a,o):i(o))||o);return s&&o&&l(t,a,o),o};let p=class extends r{constructor(){super(...arguments),this.expandable=!1}render(){return e`<div part="base" class="sm:p-6"><header part="header" id="header" class="${t("text-base font-bold items-center focus-visible:focus-outline text-primary relative group flex flex-row hover:bg-transparent gap-3 pb-3 pt-0 px-0 sm:flex-col sm:gap-4 sm:pb-8",this.expandable&&"cursor-pointer select-none")}" role="${o(this.expandable?"button":void 0)}" aria-expanded="${o(this.expandable?this.open?"true":"false":void 0)}" aria-controls="${o(this.expandable?"content":void 0)}" tabindex="${this.expandable?"0":"-1"}" @click="${this.expandable?this.handleSummaryClick:null}" @keydown="${this.expandable?this.handleSummaryKeyDown:null}"><div part="icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto items-center",!this.expandable&&"cursor-default")}"><slot name="icon"></slot></div><slot name="summary" part="summary" class="${t("flex flex-auto items-start text-left text-base leading-normal font-normal sm:leading-tight sm:text-3xl sm:text-center",this.expandable?"text-primary":"text-black cursor-default")}">${this.summary}</slot><span part="summary-icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto self-start sm:self-center transition-all ease-in-out duration-300 text-xl sm:text-4xl sm:mt-2",this.open&&"rotate-180",!this.expandable&&"hidden")}"><slot name="expand-icon" class="${t(this.open&&"hidden")}"><sd-3-
|
1
|
+
import"./icon.js";import{x as e,t,i as a,n as s,a as i}from"./solid-components2.js";import{o}from"./if-defined.js";import{s as n}from"./animation-registry.js";import r from"./accordion.js";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c=(e,t,a,s)=>{for(var i,o=s>1?void 0:s?d(t,a):t,n=e.length-1;n>=0;n--)(i=e[n])&&(o=(s?i(t,a,o):i(o))||o);return s&&o&&l(t,a,o),o};let p=class extends r{constructor(){super(...arguments),this.expandable=!1}render(){return e`<div part="base" class="sm:p-6"><header part="header" id="header" class="${t("text-base font-bold items-center focus-visible:focus-outline text-primary relative group flex flex-row hover:bg-transparent gap-3 pb-3 pt-0 px-0 sm:flex-col sm:gap-4 sm:pb-8",this.expandable&&"cursor-pointer select-none")}" role="${o(this.expandable?"button":void 0)}" aria-expanded="${o(this.expandable?this.open?"true":"false":void 0)}" aria-controls="${o(this.expandable?"content":void 0)}" tabindex="${this.expandable?"0":"-1"}" @click="${this.expandable?this.handleSummaryClick:null}" @keydown="${this.expandable?this.handleSummaryKeyDown:null}"><div part="icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto items-center",!this.expandable&&"cursor-default")}"><slot name="icon"></slot></div><slot name="summary" part="summary" class="${t("flex flex-auto items-start text-left text-base leading-normal font-normal sm:leading-tight sm:text-3xl sm:text-center",this.expandable?"text-primary":"text-black cursor-default")}">${this.summary}</slot><span part="summary-icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto self-start sm:self-center transition-all ease-in-out duration-300 text-xl sm:text-4xl sm:mt-2",this.open&&"rotate-180",!this.expandable&&"hidden")}"><slot name="expand-icon" class="${t(this.open&&"hidden")}"><sd-3-21-0-icon library="system" name="chevron-down"></sd-3-21-0-icon></slot><slot name="collapse-icon" class="${t(!this.open&&"hidden")}"><sd-3-21-0-icon library="system" name="chevron-down"></sd-3-21-0-icon></slot></span></header><div part="content" id="content" class="${t("overflow-hidden",!this.expandable&&"hidden")}"><slot part="content__slot" class="block" role="region" aria-labelledby="header"></slot></div></div>`}};p.styles=[r.styles,a`:host{display:block}@media (min-width:640px){[part=summary-icon]{font-size:var(--sd-spacing-12,3rem)}}[part=icon]{font-size:var(--sd-spacing-12,3rem)}@media (min-width:640px){[part=icon]{font-size:var(--sd-spacing-24,6rem)}}`],c([s({type:Boolean,reflect:!0})],p.prototype,"expandable",2),p=c([i("sd-3-21-0-quickfact")],p),n("quickfact.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),n("quickfact.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});export{p as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as s,c as r,i as o,e as i,n as a,a as n}from"./solid-components2.js";import{H as d}from"./slot.js";import{o as l}from"./if-defined.js";import{r as u}from"./state.js";import{w as h}from"./watch.js";var b=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var o,i=r>1?void 0:r?c(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&b(e,s,i),i};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new d(this,"[default]","icon"),this.hasFocus=!1,this.size="lg",this.disabled=!1,this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("[default]"),r=this.hasSlotController.test("icon"),o=`${this.size}-${t?"label":"no-label"}`;return e`<div part="base" role="presentation" class="relative"><button part="${"button"+(this.checked?" button--checked":"")}" role="radio" aria-checked="${this.checked}" class="${s("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline","sm"===this.size?"text-sm":"text-base",this.checked&&!this.disabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":this.disabled&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":this.disabled&&this.checked?"bg-neutral-500 border-neutral-500 text-white hover:cursor-not-allowed":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",t&&"px-4",this.hasFocus&&"focused-class",t&&"button--has-label",r&&"button--has-icon flex gap-2",o)}" aria-disabled="${this.disabled}" type="button" value="${l(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${s(r&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!r}"></slot>${t?e`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};m.styles=[t.styles,r,o`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;position:absolute;inset:var(--sd-spacing-0,0);z-index:-10;opacity:var(--sd-opacity-0,0);outline-style:dotted;outline-width:1px;outline-color:rgb(var(--sd-color-error,204 25 55) / 1)}.lg-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{height:var(--sd-spacing-12,3rem);width:var(--sd-spacing-12,3rem)}.md-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{height:var(--sd-spacing-10,2.5rem);width:var(--sd-spacing-10,2.5rem)}.sm-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{height:var(--sd-spacing-8,2rem);width:var(--sd-spacing-8,2rem)}:host(.sd-3-
|
1
|
+
import{S as t,x as e,t as s,c as r,i as o,e as i,n as a,a as n}from"./solid-components2.js";import{H as d}from"./slot.js";import{o as l}from"./if-defined.js";import{r as u}from"./state.js";import{w as h}from"./watch.js";var b=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var o,i=r>1?void 0:r?c(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&b(e,s,i),i};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new d(this,"[default]","icon"),this.hasFocus=!1,this.size="lg",this.disabled=!1,this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("[default]"),r=this.hasSlotController.test("icon"),o=`${this.size}-${t?"label":"no-label"}`;return e`<div part="base" role="presentation" class="relative"><button part="${"button"+(this.checked?" button--checked":"")}" role="radio" aria-checked="${this.checked}" class="${s("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline","sm"===this.size?"text-sm":"text-base",this.checked&&!this.disabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":this.disabled&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":this.disabled&&this.checked?"bg-neutral-500 border-neutral-500 text-white hover:cursor-not-allowed":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",t&&"px-4",this.hasFocus&&"focused-class",t&&"button--has-label",r&&"button--has-icon flex gap-2",o)}" aria-disabled="${this.disabled}" type="button" value="${l(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${s(r&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!r}"></slot>${t?e`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};m.styles=[t.styles,r,o`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;position:absolute;inset:var(--sd-spacing-0,0);z-index:-10;opacity:var(--sd-opacity-0,0);outline-style:dotted;outline-width:1px;outline-color:rgb(var(--sd-color-error,204 25 55) / 1)}.lg-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{height:var(--sd-spacing-12,3rem);width:var(--sd-spacing-12,3rem)}.md-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{height:var(--sd-spacing-10,2.5rem);width:var(--sd-spacing-10,2.5rem)}.sm-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{height:var(--sd-spacing-8,2rem);width:var(--sd-spacing-8,2rem)}:host(.sd-3-21-0-button-group__button--first:not(.sd-3-21-0-button-group__button--last)) button{border-top-right-radius:var(--sd-border-radius-none,0);border-bottom-right-radius:var(--sd-border-radius-none,0)}:host(.sd-3-21-0-button-group__button--inner) button{border-radius:var(--sd-border-radius-none,0)}:host(.sd-3-21-0-button-group__button--last:not(.sd-3-21-0-button-group__button--first)) button{border-top-left-radius:var(--sd-border-radius-none,0);border-bottom-left-radius:var(--sd-border-radius-none,0)}:host(.sd-3-21-0-button-group__button:not(.sd-3-21-0-button-group__button--first)){margin-inline-start:-1px}:host(.sd-3-21-0-button-group__button--hover){z-index:10}:host(.sd-3-21-0-button-group__button--focus),:host(.sd-3-21-0-button-group__button[checked]){z-index:20}`],p([i(".button")],m.prototype,"input",2),p([i(".hidden-input")],m.prototype,"hiddenInput",2),p([u()],m.prototype,"hasFocus",2),p([a({reflect:!0})],m.prototype,"size",2),p([a({type:Boolean,reflect:!0})],m.prototype,"disabled",2),p([a({type:Boolean,reflect:!0})],m.prototype,"checked",2),p([a()],m.prototype,"value",2),p([h("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),m=p([n("sd-3-21-0-radio-button")],m);export{m as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{i as t,c as e,e as o,n as s,S as i,x as a,a as l,t as r}from"./solid-components2.js";import{F as n,c as d,a as h,v as u}from"./form.js";import{H as c}from"./slot.js";import{r as p}from"./state.js";import{w as g}from"./watch.js";import m from"./radio.js";const b=t`${e}:host{display:inline-block}.button-group{display:flex;flex-wrap:nowrap}`;var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?v(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&f(e,o,a),a};let C=class extends i{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=w(t.target);null==e||e.classList.add("sd-3-
|
1
|
+
import{i as t,c as e,e as o,n as s,S as i,x as a,a as l,t as r}from"./solid-components2.js";import{F as n,c as d,a as h,v as u}from"./form.js";import{H as c}from"./slot.js";import{r as p}from"./state.js";import{w as g}from"./watch.js";import m from"./radio.js";const b=t`${e}:host{display:inline-block}.button-group{display:flex;flex-wrap:nowrap}`;var f=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?v(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&f(e,o,a),a};let C=class extends i{constructor(){super(...arguments),this.disableRole=!1,this.label=""}handleFocus(t){const e=w(t.target);null==e||e.classList.add("sd-3-21-0-button-group__button--focus")}handleBlur(t){const e=w(t.target);null==e||e.classList.remove("sd-3-21-0-button-group__button--focus")}handleMouseOver(t){const e=w(t.target);null==e||e.classList.add("sd-3-21-0-button-group__button--hover")}handleMouseOut(t){const e=w(t.target);null==e||e.classList.remove("sd-3-21-0-button-group__button--hover")}handleSlotChange(){const t=[...this.defaultSlot.assignedElements({flatten:!0})];t.forEach((e=>{const o=t.indexOf(e),s=w(e);null!==s&&(s.classList.add("sd-3-21-0-button-group__button"),s.classList.toggle("sd-3-21-0-button-group__button--first",0===o),s.classList.toggle("sd-3-21-0-button-group__button--inner",o>0&&o<t.length-1),s.classList.toggle("sd-3-21-0-button-group__button--last",o===t.length-1),s.classList.toggle("sd-3-21-0-button-group__button--radio","sd-3-21-0-radio-button"===s.tagName.toLowerCase()))}))}render(){return a`<slot part="base" class="button-group" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" @focusout="${this.handleBlur}" @focusin="${this.handleFocus}" @mouseover="${this.handleMouseOver}" @mouseout="${this.handleMouseOut}" @slotchange="${this.handleSlotChange}"></slot>`}};function w(t){const e="sd-3-21-0-button, sd-3-21-0-radio-button";return t.closest(e)??t.querySelector(e)}C.styles=b,y([o("slot")],C.prototype,"defaultSlot",2),y([p()],C.prototype,"disableRole",2),y([s()],C.prototype,"label",2),C=y([l("sd-3-21-0-button-group")],C);var x=Object.defineProperty,R=Object.getOwnPropertyDescriptor,k=(t,e,o,s)=>{for(var i,a=s>1?void 0:s?R(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(s?i(e,o,a):i(a))||a);return s&&a&&x(e,o,a),a};let I=class extends i{constructor(){super(...arguments),this.formControlController=new n(this),this.hasSlotController=new c(this,"label","error-text"),this.customValidityMessage="",this.hasButtonGroup=!1,this.defaultValue="",this.showInvalidStyle=!1,this.size="lg",this.required=!1,this.orientation="vertical",this.label="",this.boldLabel=!1,this.name="option",this.value="",this.form=""}get validity(){const t=this.required&&!this.value;return""!==this.customValidityMessage?d:t?h:u}get validationMessage(){const t=this.required&&!this.value;return""!==this.customValidityMessage?this.customValidityMessage:t?this.validationInput.validationMessage:""}connectedCallback(){super.connectedCallback(),this.defaultValue=this.value}firstUpdated(){this.formControlController.updateValidity()}getAllRadios(){return[...this.querySelectorAll("sd-3-21-0-radio, sd-3-21-0-radio-button")]}handleRadioClick(t){const e=t.target.closest("sd-3-21-0-radio, sd-3-21-0-radio-button"),o=this.getAllRadios(),s=this.value;e.disabled||(this.value=e.value,o.forEach((t=>t.checked=t===e)),this.value!==s&&(this.emit("sd-change"),this.emit("sd-input")))}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key))return;const e=this.getAllRadios().filter((t=>!t.disabled)),o=e.find((t=>t.checked))??e[0],s=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1,i=this.value;let a=e.indexOf(o)+s;a<0&&(a=e.length-1),a>e.length-1&&(a=0),this.getAllRadios().forEach((t=>{t.checked=!1,this.hasButtonGroup||(t.tabIndex=-1)})),this.value=e[a].value,e[a].checked=!0,this.hasButtonGroup?e[a].shadowRoot.querySelector("button").focus():(e[a].tabIndex=0,e[a].focus()),this.value!==i&&(this.emit("sd-change"),this.emit("sd-input")),t.preventDefault()}focus(){const t=this.getAllRadios(),e=t.find((t=>t.checked))||t[0];e&&e.focus()}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}async syncRadioElements(){var t,e;const o=this.getAllRadios();if(await Promise.all(o.map((async t=>{await t.updateComplete,t.checked=t.value===this.value,t.size=this.size,t instanceof m&&(t.invalid=this.showInvalidStyle)}))),this.hasButtonGroup=o.some((t=>"sd-3-21-0-radio-button"===t.tagName.toLowerCase())),!o.some((t=>t.checked)))if(this.hasButtonGroup){const e=null==(t=o[0].shadowRoot)?void 0:t.querySelector("button");e&&(e.tabIndex=0)}else o[0].tabIndex=0;if(this.hasButtonGroup){const t=null==(e=this.shadowRoot)?void 0:e.querySelector("sd-3-21-0-button-group");t&&(t.disableRole=!0)}}syncRadios(){customElements.get("sd-3-21-0-radio")&&customElements.get("sd-3-21-0-radio-button")?this.syncRadioElements():(customElements.get("sd-3-21-0-radio")?this.syncRadioElements():customElements.whenDefined("sd-3-21-0-radio").then((()=>this.syncRadios())),customElements.get("sd-3-21-0-radio-button")?this.syncRadioElements():customElements.whenDefined("sd-3-21-0-radio-button").then((()=>this.syncRadios())))}updateCheckedRadio(){this.getAllRadios().forEach((t=>t.checked=t.value===this.value)),this.formControlController.setValidity(this.validity.valid)}handleSizeChange(){this.syncRadios()}handleInvalidChange(){this.syncRadios()}handleValueChange(){this.hasUpdated&&(this.updateCheckedRadio(),this.reportValidity())}checkValidity(){const t=this.required&&!this.value,e=""!==this.customValidityMessage;return!t&&!e||(this.formControlController.emitInvalidEvent(),!1)}getForm(){return this.formControlController.getForm()}reportValidity(){const t=this.validity.valid;return this.formControlController.setValidity(t),this.validationInput.hidden=!0,clearTimeout(this.validationTimeout),this.formControlController.fakeUserInteraction(),t||(this.validationInput.hidden=!1,this.validationInput.reportValidity(),this.validationTimeout=setTimeout((()=>this.validationInput.hidden=!0),1e4)),t}setCustomValidity(t=""){this.customValidityMessage=t,this.validationInput.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),e=!!this.label||!!t,o=a`<slot @slotchange="${this.syncRadios}" @click="${this.handleRadioClick}" @keydown="${this.handleKeyDown}"></slot>`;return a`<fieldset part="form-control" class="${r("border-0 p-0 m-0 flex flex-col",{sm:"text-sm",md:"text-base",lg:"text-base"}[this.size])}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${r("p-0 leading-normal text-black text-left",!e&&"hidden",this.boldLabel&&"font-bold")}" @click="${this.focus}" aria-hidden="${e?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${r("flex",{vertical:"flex-col",horizontal:"flex-row"}[this.orientation])}"><div class="sr-only"><label><input id="validation-input" type="text" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${this.hasButtonGroup?a`<sd-3-21-0-button-group part="button-group" exportparts="base:button-group__base" role="presentation">${o}</sd-3-21-0-button-group>`:o}</div></fieldset>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-3-21-0-button-group":C},I.styles=[e,i.styles,t`:host{display:block}:host([orientation=vertical]) ::slotted(sd-3-21-0-radio){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-3-21-0-radio:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-3-21-0-radio){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-3-21-0-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-21-0-radio){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-21-0-radio:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([required]) #label::after{content:' *'}`],k([o("slot:not([name])")],I.prototype,"defaultSlot",2),k([o("#validation-input")],I.prototype,"validationInput",2),k([o("#invalid-message")],I.prototype,"invalidMessage",2),k([p()],I.prototype,"hasButtonGroup",2),k([p()],I.prototype,"defaultValue",2),k([p()],I.prototype,"showInvalidStyle",2),k([s({reflect:!0})],I.prototype,"size",2),k([s({type:Boolean,reflect:!0})],I.prototype,"required",2),k([s({reflect:!0})],I.prototype,"orientation",2),k([s()],I.prototype,"label",2),k([s({type:Boolean,reflect:!0})],I.prototype,"boldLabel",2),k([s()],I.prototype,"name",2),k([s({reflect:!0})],I.prototype,"value",2),k([s({reflect:!0})],I.prototype,"form",2),k([g("size",{waitUntilFirstUpdate:!0})],I.prototype,"handleSizeChange",1),k([g("showInvalidStyle",{waitUntilFirstUpdate:!0})],I.prototype,"handleInvalidChange",1),k([g("value")],I.prototype,"handleValueChange",1),I=k([l("sd-3-21-0-radio-group")],I);export{I as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{S as e,x as t,t as s,i,n as r,a}from"./solid-components2.js";import{r as l}from"./state.js";import{w as o}from"./watch.js";var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(e,t,s,i)=>{for(var r,a=i>1?void 0:i?d(t,s):t,l=e.length-1;l>=0;l--)(r=e[l])&&(a=(i?r(t,s,a):r(a))||a);return i&&a&&n(t,s,a),a};let c=class extends e{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.size="lg",this.disabled=!1,this.invalid=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return t`<span part="base" class="${s("sd-3-
|
1
|
+
import"./icon.js";import{S as e,x as t,t as s,i,n as r,a}from"./solid-components2.js";import{r as l}from"./state.js";import{w as o}from"./watch.js";var n=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(e,t,s,i)=>{for(var r,a=i>1?void 0:i?d(t,s):t,l=e.length-1;l>=0;l--)(r=e[l])&&(a=(i?r(t,s,a):r(a))||a);return i&&a&&n(t,s,a),a};let c=class extends e{constructor(){super(...arguments),this.checked=!1,this.hasFocus=!1,this.size="lg",this.disabled=!1,this.invalid=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.setInitialAttributes(),this.addEventListeners()}disconnectedCallback(){this.removeEventListeners()}addEventListeners(){this.addEventListener("blur",this.handleBlur),this.addEventListener("click",this.handleClick),this.addEventListener("focus",this.handleFocus)}removeEventListeners(){this.removeEventListener("blur",this.handleBlur),this.removeEventListener("click",this.handleClick),this.removeEventListener("focus",this.handleFocus)}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(){this.disabled||(this.checked=!0)}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}setInitialAttributes(){this.setAttribute("role","radio"),this.setAttribute("tabindex","-1"),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleCheckedChange(){this.setAttribute("aria-checked",this.checked?"true":"false"),this.setAttribute("tabindex",this.checked?"0":"-1")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}render(){return t`<span part="base" class="${s("sd-3-21-0-radio group inline-flex items-start items-center text-base leading-normal text-black cursor-pointer align-middle",this.disabled&&"hover:cursor-not-allowed",{sm:"small-size text-sm",md:"text-base",lg:"text-base"}[this.size])}"><span part="${this.checked?"control--checked":"control--unchecked"}" class="${s("flex-initial shrink-0 relative inline-flex items-center justify-center border rounded-full bg-white h-4 w-4",this.disabled?"border-neutral-500":this.invalid?"border-error hover:border-error-400 group-hover:border-error-400":this.checked?"border-accent hover:border-accent-550 group-hover:border-accent-550":"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200")}">${this.checked?t`<span part="checked" class="${s("rounded-full inline-flex text-white border bg-accent h-2.5 w-2.5",this.disabled?"bg-neutral-500":this.invalid?"bg-error hover:bg-error-400 group-hover:bg-error-400":this.checked?"bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"bg-neutral-800")}"></span>`:""}</span><slot part="label" class="${s("ml-2 select-none inline-block",this.disabled?"text-neutral-500":this.invalid?"text-error":"text-black")}"></slot></span>`}};c.styles=[e.styles,i`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host(:focus-visible) [part=control--checked],:host(:focus-visible) [part=control--unchecked]{outline-style:solid;outline-width:2px;outline-offset:2px;outline-color:rgb(var(--sd-color-primary,0 53 142) / 1)}`],h([l()],c.prototype,"checked",2),h([l()],c.prototype,"hasFocus",2),h([r({reflect:!0})],c.prototype,"size",2),h([r({type:Boolean,reflect:!0})],c.prototype,"disabled",2),h([r()],c.prototype,"value",2),h([r({type:Boolean,reflect:!0})],c.prototype,"invalid",2),h([o("checked")],c.prototype,"handleCheckedChange",1),h([o("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",1),c=h([a("sd-3-21-0-radio")],c);export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as l,t as o,r as e,c as r,i as s,n as i,a as n}from"./solid-components2.js";import{r as a}from"./state.js";import{I as c}from"./interactive.js";var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,b=(t,l,o,e)=>{for(var r,s=e>1?void 0:e?h(l,o):l,i=t.length-1;i>=0;i--)(r=t[i])&&(s=(e?r(l,o,s):r(s))||s);return e&&s&&d(l,o,s),s};let u=class extends t{constructor(){super(...arguments),this.orientation="horizontal",this.scrollbars=!1,this.buttons=!1,this.shadows=!1,this.inset=!1,this.step=150,this.canScroll={left:!1,right:!1,up:!1,down:!1},this.isScrollHorizontalEnabled=!1,this.isScrollVerticalEnabled=!1,this.scrollContainer=null}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver((()=>{this.updateScrollIndicatorVisibility()})),this.updateComplete.then((()=>{this.scrollContainer=this.renderRoot.querySelector(".scroll-container"),this.scrollContainer&&this.resizeObserver.observe(this.scrollContainer)}))}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer&&this.resizeObserver.unobserve(this.scrollContainer)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.updateScrollIndicatorVisibility())}updateScrollEnabledFlags(){const t=this.orientation;this.isScrollHorizontalEnabled="horizontal"===t||"auto"===t,this.isScrollVerticalEnabled="vertical"===t||"auto"===t}get container(){return this.renderRoot.querySelector(".scroll-container")}updateScrollIndicatorVisibility(){const t=this.container;if(t){const l=this.isScrollHorizontalEnabled&&t.scrollLeft>0,o=this.isScrollHorizontalEnabled&&t.scrollLeft+t.clientWidth<t.scrollWidth-1,e=this.isScrollVerticalEnabled&&t.scrollTop>0,r=this.isScrollVerticalEnabled&&t.scrollTop+t.clientHeight<t.scrollHeight-1;this.canScroll={left:l,right:o,up:e,down:r},(l||e)&&this.dispatchEvent(new CustomEvent("start")),(o||r)&&this.dispatchEvent(new CustomEvent("end"))}}handleScroll(t){var l;const o="left"===t||"up"===t?-this.step:this.step,e={behavior:"smooth"};e["left"===t||"right"===t?"left":"top"]=o,null==(l=this.scrollContainer)||l.scrollBy(e);const r=`button-${t}`;this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0}))}render(){const t="relative p-0 border-0 bg-transparent cursor-pointer w-5 h-5 flex items-center justify-center sd-interactive rounded-md flex text-lg",e="scroll-shadow absolute z-10 pointer-events-none";return l`<div part="base" class="${o("scroll-container flex overflow-hidden flex-1","horizontal"===this.orientation&&"scroll-horizontal flex-row whitespace-nowrap items-center overflow-x-scroll overflow-y-hidden","vertical"===this.orientation&&"scroll-vertical justify-items-center overflow-y-scroll overflow-x-hidden","auto"===this.orientation&&"scroll-auto overflow-auto",this.scrollbars?"show-scrollbars":"hide-scrollbars",this.inset?"p-4":"")}" @scroll="${this.updateScrollIndicatorVisibility}"><div part="scroll-content" class="flex-1"><slot></slot></div></div>${this.buttons?l`${this.isScrollHorizontalEnabled?l`${this.canScroll.left?l`<div part="button-left" class="absolute z-10 flex items-center justify-center top-0 left-0 h-full w-8"><button part="button-start" class="${o(t)}" @click="${()=>this.handleScroll("left")}"><slot name="icon-start"><sd-3-
|
1
|
+
import{S as t,x as l,t as o,r as e,c as r,i as s,n as i,a as n}from"./solid-components2.js";import{r as a}from"./state.js";import{I as c}from"./interactive.js";var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,b=(t,l,o,e)=>{for(var r,s=e>1?void 0:e?h(l,o):l,i=t.length-1;i>=0;i--)(r=t[i])&&(s=(e?r(l,o,s):r(s))||s);return e&&s&&d(l,o,s),s};let u=class extends t{constructor(){super(...arguments),this.orientation="horizontal",this.scrollbars=!1,this.buttons=!1,this.shadows=!1,this.inset=!1,this.step=150,this.canScroll={left:!1,right:!1,up:!1,down:!1},this.isScrollHorizontalEnabled=!1,this.isScrollVerticalEnabled=!1,this.scrollContainer=null}connectedCallback(){super.connectedCallback(),this.updateScrollEnabledFlags(),this.resizeObserver=new ResizeObserver((()=>{this.updateScrollIndicatorVisibility()})),this.updateComplete.then((()=>{this.scrollContainer=this.renderRoot.querySelector(".scroll-container"),this.scrollContainer&&this.resizeObserver.observe(this.scrollContainer)}))}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer&&this.resizeObserver.unobserve(this.scrollContainer)}updated(t){super.updated(t),(t.has("orientation")||t.has("buttons")||t.has("shadows"))&&(this.updateScrollEnabledFlags(),this.updateScrollIndicatorVisibility())}updateScrollEnabledFlags(){const t=this.orientation;this.isScrollHorizontalEnabled="horizontal"===t||"auto"===t,this.isScrollVerticalEnabled="vertical"===t||"auto"===t}get container(){return this.renderRoot.querySelector(".scroll-container")}updateScrollIndicatorVisibility(){const t=this.container;if(t){const l=this.isScrollHorizontalEnabled&&t.scrollLeft>0,o=this.isScrollHorizontalEnabled&&t.scrollLeft+t.clientWidth<t.scrollWidth-1,e=this.isScrollVerticalEnabled&&t.scrollTop>0,r=this.isScrollVerticalEnabled&&t.scrollTop+t.clientHeight<t.scrollHeight-1;this.canScroll={left:l,right:o,up:e,down:r},(l||e)&&this.dispatchEvent(new CustomEvent("start")),(o||r)&&this.dispatchEvent(new CustomEvent("end"))}}handleScroll(t){var l;const o="left"===t||"up"===t?-this.step:this.step,e={behavior:"smooth"};e["left"===t||"right"===t?"left":"top"]=o,null==(l=this.scrollContainer)||l.scrollBy(e);const r=`button-${t}`;this.dispatchEvent(new CustomEvent(r,{bubbles:!0,composed:!0}))}render(){const t="relative p-0 border-0 bg-transparent cursor-pointer w-5 h-5 flex items-center justify-center sd-interactive rounded-md flex text-lg",e="scroll-shadow absolute z-10 pointer-events-none";return l`<div part="base" class="${o("scroll-container flex overflow-hidden flex-1","horizontal"===this.orientation&&"scroll-horizontal flex-row whitespace-nowrap items-center overflow-x-scroll overflow-y-hidden","vertical"===this.orientation&&"scroll-vertical justify-items-center overflow-y-scroll overflow-x-hidden","auto"===this.orientation&&"scroll-auto overflow-auto",this.scrollbars?"show-scrollbars":"hide-scrollbars",this.inset?"p-4":"")}" @scroll="${this.updateScrollIndicatorVisibility}"><div part="scroll-content" class="flex-1"><slot></slot></div></div>${this.buttons?l`${this.isScrollHorizontalEnabled?l`${this.canScroll.left?l`<div part="button-left" class="absolute z-10 flex items-center justify-center top-0 left-0 h-full w-8"><button part="button-start" class="${o(t)}" @click="${()=>this.handleScroll("left")}"><slot name="icon-start"><sd-3-21-0-icon library="system" name="chevron-up" class="rotate-[-90deg]"></sd-3-21-0-icon></slot></button></div>`:null} ${this.canScroll.right?l`<div part="button-right" class="absolute z-10 flex items-center justify-center top-0 right-0 h-full w-8"><button part="button-end" class="${o(t)}" @click="${()=>this.handleScroll("right")}"><slot name="icon-end"><sd-3-21-0-icon library="system" name="chevron-down" class="rotate-[-90deg]"></sd-3-21-0-icon></slot></button></div>`:null}`:null} ${this.isScrollVerticalEnabled?l`${this.canScroll.up?l`<div part="button-top" class="absolute z-10 flex items-center justify-center top-0 left-0 w-full h-8"><button part="button-start" class="${o(t)}" @click="${()=>this.handleScroll("up")}"><slot name="icon-start"><sd-3-21-0-icon library="system" name="chevron-up"></sd-3-21-0-icon></slot></button></div>`:null} ${this.canScroll.down?l`<div part="button-bottom" class="absolute z-10 flex items-center justify-center bottom-0 left-0 w-full h-8"><button part="button-end" class="${o(t)}" @click="${()=>this.handleScroll("down")}"><slot name="icon-end"><sd-3-21-0-icon library="system" name="chevron-down"></sd-3-21-0-icon></slot></button></div>`:null}`:null}`:null} ${this.shadows?l`${this.isScrollHorizontalEnabled?l`${this.canScroll.left?l`<div part="shadow-left" class="${e} left top-0 left-0 w-[6px] h-full"></div>`:null} ${this.canScroll.right?l`<div part="shadow-right" class="${e} right top-0 right-0 w-[6px] h-full"></div>`:null}`:null} ${this.isScrollVerticalEnabled?l`${this.canScroll.up?l`<div part="shadow-top" class="${e} top top-0 left-0 w-full h-[6px]"></div>`:null} ${this.canScroll.down?l`<div part="shadow-bottom" class="${e} bottom bottom-0 left-0 w-full h-[6px]"></div>`:null}`:null}`:null}`}};u.styles=[t.styles,e(c),r,s`:host{--gradient-color:rgba(255, 255, 255, 0);--gradient:var(--gradient-color) 0%,#fff 80%,#fff 100%;position:relative;display:flex;overflow:hidden}.hide-scrollbars{scrollbar-width:none;-ms-overflow-style:none}.hide-scrollbars::-webkit-scrollbar{display:none}.scroll-container::-webkit-scrollbar-thumb{background-color:transparent}.scroll-container:hover::-webkit-scrollbar-thumb{background:var(--background-neutral-400,#c3c3c3);border-radius:var(--sd-border-radius-sm,.125rem)}.scroll-container::-webkit-scrollbar{height:var(--sd-spacing-1,.25rem);width:var(--sd-spacing-1,.25rem)}.scroll-auto{overflow:auto}[part=button-left]{background:linear-gradient(270deg,var(--gradient))}[part=button-right]{background:linear-gradient(90deg,var(--gradient))}[part=button-top]{background:linear-gradient(0deg,var(--gradient))}[part=button-bottom]{background:linear-gradient(180deg,var(--gradient))}[part=shadow-left]{background:linear-gradient(270deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}[part=shadow-right]{background:linear-gradient(90deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}[part=shadow-top]{background:linear-gradient(0deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}[part=shadow-bottom]{background:linear-gradient(180deg,rgba(24,24,24,0) 50%,rgba(24,24,24,.4) 100%)}.sd-3-21-0-icon--top{align-self:flex-start}.sd-3-21-0-icon--down{align-self:flex-end}`],b([i({type:String,reflect:!0})],u.prototype,"orientation",2),b([i({type:Boolean,reflect:!0})],u.prototype,"scrollbars",2),b([i({type:Boolean,reflect:!0})],u.prototype,"buttons",2),b([i({type:Boolean,reflect:!0})],u.prototype,"shadows",2),b([i({type:Boolean,reflect:!0})],u.prototype,"inset",2),b([i({type:Number,reflect:!0})],u.prototype,"step",2),b([a()],u.prototype,"canScroll",2),b([a()],u.prototype,"isScrollHorizontalEnabled",2),b([a()],u.prototype,"isScrollVerticalEnabled",2),u=b([n("sd-3-21-0-scrollable")],u);export{u as default};
|