@solid-design-system/components 3.20.0 → 3.20.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/es/map-marker.js +1 -1
- package/dist/components/es/solid-components2.js +5 -5
- package/dist/components/umd/solid-components.js +10 -10
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/map-marker/map-marker.d.ts +1 -0
- package/dist/package/components/map-marker/map-marker.js +9 -13
- package/dist/package/styles/tailwind.css.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 +5 -5
- 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 +5 -5
- 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 +2 -2
- 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 +2 -1
- package/dist/versioned-package/components/map-marker/map-marker.js +10 -14
- 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 +13 -13
- package/dist/versioned-package/components/scrollable/scrollable.d.ts +1 -1
- package/dist/versioned-package/components/scrollable/scrollable.js +3 -3
- package/dist/versioned-package/components/select/select.d.ts +4 -4
- package/dist/versioned-package/components/select/select.js +25 -25
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/step/step.d.ts +1 -1
- package/dist/versioned-package/components/step/step.js +2 -2
- package/dist/versioned-package/components/step-group/step-group.d.ts +1 -1
- package/dist/versioned-package/components/step-group/step-group.js +2 -2
- package/dist/versioned-package/components/switch/switch.d.ts +1 -1
- package/dist/versioned-package/components/switch/switch.js +1 -1
- package/dist/versioned-package/components/tab/tab.d.ts +1 -1
- package/dist/versioned-package/components/tab/tab.js +2 -2
- package/dist/versioned-package/components/tab-group/tab-group.d.ts +1 -1
- package/dist/versioned-package/components/tab-group/tab-group.js +13 -13
- package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist/versioned-package/components/tab-panel/tab-panel.js +2 -2
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/teaser-media/teaser-media.js +1 -1
- package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
- package/dist/versioned-package/components/textarea/textarea.js +2 -2
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.js +3 -3
- package/dist/versioned-package/styles/headline/headline.css.js +1 -1
- package/dist/versioned-package/styles/tailwind.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 +45 -45
- package/dist/web-types.json +46 -46
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as i,c as s,i as r,e as o,n as a,a as n}from"./solid-components2.js";import{w as p}from"./watch.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,l=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?h(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&c(e,i,o),o};let d=class extends t{constructor(){super(...arguments),this.steps=[],this.size="lg",this.orientation="horizontal",this.activeStep=0,this.notInteractive=!1}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{let t;this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0,this.steps.forEach(((e,i)=>{e.index=i+1,e.size=this.size,e.orientation=this.orientation,this.notInteractive?(e.current=!1,e.disabled=!1,e.notInteractive=!0):e.current&&(t=i)})),this.setActiveStep(t||this.activeStep)}))}updateSize(){this.steps.forEach((t=>{t.size=this.size}))}updateOrientation(){this.steps.forEach((t=>{t.orientation=this.orientation}))}getAllSteps(){return[...this.body.assignedElements()].filter((t=>"sd-3-20-
|
1
|
+
import{S as t,x as e,t as i,c as s,i as r,e as o,n as a,a as n}from"./solid-components2.js";import{w as p}from"./watch.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,l=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?h(e,i):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&c(e,i,o),o};let d=class extends t{constructor(){super(...arguments),this.steps=[],this.size="lg",this.orientation="horizontal",this.activeStep=0,this.notInteractive=!1}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{let t;this.steps=this.getAllSteps(),this.steps[this.steps.length-1].noTail=!0,this.steps.forEach(((e,i)=>{e.index=i+1,e.size=this.size,e.orientation=this.orientation,this.notInteractive?(e.current=!1,e.disabled=!1,e.notInteractive=!0):e.current&&(t=i)})),this.setActiveStep(t||this.activeStep)}))}updateSize(){this.steps.forEach((t=>{t.size=this.size}))}updateOrientation(){this.steps.forEach((t=>{t.orientation=this.orientation}))}getAllSteps(){return[...this.body.assignedElements()].filter((t=>"sd-3-20-1-step"===t.tagName.toLowerCase()))}setActiveStep(t){t>=0&&t<this.steps.length&&!this.notInteractive&&(this.activeStep=t,this.steps.forEach(((e,i)=>{i===t?e.current=!0:i>t?e.disabled=!0:e.current=!1})))}handleInteractivityChange(){this.notInteractive&&this.steps.forEach((t=>{t.current=!1,t.disabled=!1,t.notInteractive=!0}))}render(){return e`<div part="base" role="${this.notInteractive?"group":"navigation"}" class="${i("flex","vertical"===this.orientation&&"flex-col h-full")}"><slot part="body"></slot></div>`}};d.styles=[t.styles,s,r`:host{width:-moz-max-content;width:max-content}`],l([o("[part=body]")],d.prototype,"body",2),l([a({reflect:!0})],d.prototype,"size",2),l([a({reflect:!0})],d.prototype,"orientation",2),l([a({type:Number,reflect:!0,attribute:"active-step"})],d.prototype,"activeStep",2),l([a({type:Boolean,reflect:!0,attribute:"not-interactive"})],d.prototype,"notInteractive",2),l([p("size",{waitUntilFirstUpdate:!0})],d.prototype,"updateSize",1),l([p("orientation",{waitUntilFirstUpdate:!0})],d.prototype,"updateOrientation",1),l([p("notInteractive")],d.prototype,"handleInteractivityChange",1),d=l([n("sd-3-20-1-step-group")],d);export{d as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,t as e,c as r,r as i,i as s,n as a,a as o}from"./solid-components2.js";import{s as n,n as l}from"./static.js";import{o as h}from"./if-defined.js";import{w as d}from"./watch.js";var p=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=(t,e,r,i)=>{for(var s,a=i>1?void 0:i?c(e,r):e,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(i?s(e,r,a):s(a))||a);return i&&a&&p(e,r,a),a};let b=class extends t{constructor(){super(...arguments),this.size="lg",this.orientation="horizontal",this.disabled=!1,this.current=!1,this.noTail=!1,this.notInteractive=!1,this.label="",this.description="",this.index=1,this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1)}handleDisabledChange(){this.disabled&&(this.current=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1)}render(){const t=this.isLink(),r=this.notInteractive?n`div`:t?n`a`:n`button`;return l`<div part="base" class="${e("flex pt-1","horizontal"===this.orientation?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-min overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${e("flex shrink-0 gap-2",this.noTail&&"w-max","horizontal"===this.orientation?"flex-row":"flex-col items-stretch","horizontal"===this.orientation?"lg"===this.size?"translateLg":"translateSm":"lg"===this.size?"mt-1":"mt-3")}"><${r} part="circle" ?disabled="${this.disabled}" tabindex="${this.disabled||this.current?"-1":"0"}" href="${h(t?this.href:void 0)}" aria-current="${this.current?"step":void 0}" aria-label="Step ${this.index}" class="${e("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled||this.current?"focus-visible:outline-none":"focus-visible:focus-outline",this.notInteractive?"lg"===this.size?"w-[72px]":"w-12":"lg"===this.size?"w-12":"w-8",this.disabled&&"border-neutral-400 text-neutral-500",!this.disabled&&!this.current&&!this.notInteractive&&"border-primary group-hover:bg-primary-100 group-hover:border-primary-500",this.notInteractive?"border-neutral-400":"group-hover:cursor-pointer",this.current&&"bg-accent border-none text-white")}"><slot name="circle-content" class="${e(!this.disabled&&!this.current&&!this.notInteractive&&"text-primary group-hover:text-primary-500 group-hover:fill-primary-500",this.notInteractive&&"text-primary","lg"===this.size?"text-lg":"text-sm")}">${this.disabled||this.current||this.notInteractive?l`${this.index}`:l`<sd-3-20-
|
1
|
+
import{S as t,t as e,c as r,r as i,i as s,n as a,a as o}from"./solid-components2.js";import{s as n,n as l}from"./static.js";import{o as h}from"./if-defined.js";import{w as d}from"./watch.js";var p=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=(t,e,r,i)=>{for(var s,a=i>1?void 0:i?c(e,r):e,o=t.length-1;o>=0;o--)(s=t[o])&&(a=(i?s(e,r,a):s(a))||a);return i&&a&&p(e,r,a),a};let b=class extends t{constructor(){super(...arguments),this.size="lg",this.orientation="horizontal",this.disabled=!1,this.current=!1,this.noTail=!1,this.notInteractive=!1,this.label="",this.description="",this.index=1,this.href=""}connectedCallback(){super.connectedCallback()}isLink(){return!!this.href}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleCurrentChange(){this.current&&(this.disabled=!1)}handleDisabledChange(){this.disabled&&(this.current=!1)}handleInteractivityChange(){this.notInteractive&&(this.current=!1,this.disabled=!1)}render(){const t=this.isLink(),r=this.notInteractive?n`div`:t?n`a`:n`button`;return l`<div part="base" class="${e("flex pt-1","horizontal"===this.orientation?"flex-col w-full":"flex-row gap-4 items-stretch h-full w-min overflow-hidden",!this.disabled&&!this.current&&!this.notInteractive&&"group")}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"><div part="circle-and-tail-container" class="${e("flex shrink-0 gap-2",this.noTail&&"w-max","horizontal"===this.orientation?"flex-row":"flex-col items-stretch","horizontal"===this.orientation?"lg"===this.size?"translateLg":"translateSm":"lg"===this.size?"mt-1":"mt-3")}"><${r} part="circle" ?disabled="${this.disabled}" tabindex="${this.disabled||this.current?"-1":"0"}" href="${h(t?this.href:void 0)}" aria-current="${this.current?"step":void 0}" aria-label="Step ${this.index}" class="${e("border rounded-full aspect-square circle flex items-center justify-center shrink-0 font-bold select-none",this.disabled||this.current?"focus-visible:outline-none":"focus-visible:focus-outline",this.notInteractive?"lg"===this.size?"w-[72px]":"w-12":"lg"===this.size?"w-12":"w-8",this.disabled&&"border-neutral-400 text-neutral-500",!this.disabled&&!this.current&&!this.notInteractive&&"border-primary group-hover:bg-primary-100 group-hover:border-primary-500",this.notInteractive?"border-neutral-400":"group-hover:cursor-pointer",this.current&&"bg-accent border-none text-white")}"><slot name="circle-content" class="${e(!this.disabled&&!this.current&&!this.notInteractive&&"text-primary group-hover:text-primary-500 group-hover:fill-primary-500",this.notInteractive&&"text-primary","lg"===this.size?"text-lg":"text-sm")}">${this.disabled||this.current||this.notInteractive?l`${this.index}`:l`<sd-3-20-1-icon name="status-check" library="system"></sd-3-20-1-icon>`}</slot></${r}>${this.noTail?"":l`<div part="tail" class="${e("horizontal"===this.orientation?"border-t w-full my-auto mr-2":"border-l flex-grow flex-shrink-0 basis-auto h-full w-[1px] mx-auto",this.disabled||this.current||this.notInteractive?"border-neutral-400":" border-primary group-hover:border-primary-500")}"></div>`}</div><div part="text-container" class="${e("mt-4 mr-4 break-words flex flex-col gap-2","horizontal"===this.orientation?"text-center w-40":"w-max text-left",this.disabled&&"!text-neutral-500")}"><div part="label" class="${e("!font-bold sd-paragraph",this.disabled&&"!text-neutral-500",this.disabled||this.current||this.notInteractive?"text-black":"!text-primary group-hover:!text-primary-500 group-hover:cursor-pointer")}"><slot name="label">${this.label}</slot></div><div part="description" class="${e("sd-paragraph sd-paragraph--size-sm",this.disabled&&"!text-neutral-500")}">${this.description||l`<slot></slot>`}</div></div></div>`}};b.styles=[t.styles,r,i(".sd-paragraph,.sd-prose p{font-size:var(--sd-font-size-base,1rem)}.sd-paragraph,.sd-paragraph--size-sm,.sd-prose p,.sd-prose p--size-sm{font-weight:400;line-height:var(--sd-line-height-normal,150%);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity))}.sd-paragraph--size-sm,.sd-prose p--size-sm{font-size:var(--sd-font-size-sm,.875rem)}.sd-paragraph--inverted,.sd-prose--inverted p{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}"),s`:host{flex:1 1 0%}:host([no-tail]){flex-grow:0}.translateLg{transform:translateX(55px)}.translateSm{transform:translateX(64px)}`],u([a({reflect:!0})],b.prototype,"size",2),u([a({reflect:!0})],b.prototype,"orientation",2),u([a({type:Boolean,reflect:!0})],b.prototype,"disabled",2),u([a({type:Boolean,reflect:!0})],b.prototype,"current",2),u([a({reflect:!0,type:Boolean,attribute:"no-tail"})],b.prototype,"noTail",2),u([a({type:Boolean,reflect:!0,attribute:"not-interactive"})],b.prototype,"notInteractive",2),u([a()],b.prototype,"label",2),u([a()],b.prototype,"description",2),u([a({type:Number,reflect:!0,attribute:"index"})],b.prototype,"index",2),u([a()],b.prototype,"href",2),u([d("current")],b.prototype,"handleCurrentChange",1),u([d("disabled")],b.prototype,"handleDisabledChange",1),u([d("notInteractive")],b.prototype,"handleInteractivityChange",1),b=u([o("sd-3-20-1-step")],b);export{b as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,x as t,t as i,i as r,e as s,n as l,a as o}from"./solid-components2.js";import{d as a}from"./default-value.js";import{F as n}from"./form.js";import{o as d}from"./if-defined.js";import{l as h}from"./live.js";import{r as c}from"./state.js";import{w as u}from"./watch.js";var p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?b(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&p(t,i,l),l};let m=class extends e{constructor(){super(...arguments),this.formControlController=new n(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.showInvalidStyle=!1,this.title="",this.name="",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){return t`<label part="base" class="${i("group flex items-center text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed")}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${d(this.value)}" .checked="${h(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"}" class="${i("relative flex flex-initial items-center justify-center border rounded-full h-4 w-8 transition-colors ease duration-100\n peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\n peer-focus-visible:outline-primary",this.disabled&&this.checked?"border-neutral-500 bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?"border-error bg-error hover:bg-error-400":this.checked?"border-accent bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"border-neutral-800 bg-white hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span id="thumb" part="thumb" class="${i("w-2.5 h-2.5 rounded-full transition-transform ease-in-out duration-200",this.disabled&&this.checked?"bg-white":this.disabled?"-translate-x-2 bg-neutral-500":this.showInvalidStyle?"bg-white -translate-x-2":this.checked?"translate-x-2 bg-white":"bg-neutral-800 -translate-x-2")}"></span> </span><span part="label" id="label" class="${i("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};m.styles=[e.styles,r`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host([required]) #label::after{content:' *'}`],f([s("input")],m.prototype,"input",2),f([s("#invalid-message")],m.prototype,"invalidMessage",2),f([c()],m.prototype,"showInvalidStyle",2),f([l()],m.prototype,"title",2),f([l()],m.prototype,"name",2),f([l()],m.prototype,"value",2),f([l({type:Boolean,reflect:!0})],m.prototype,"disabled",2),f([l({type:Boolean,reflect:!0})],m.prototype,"checked",2),f([a("checked")],m.prototype,"defaultChecked",2),f([l({reflect:!0})],m.prototype,"form",2),f([l({type:Boolean,reflect:!0})],m.prototype,"required",2),f([u("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),f([u(["checked"],{waitUntilFirstUpdate:!0})],m.prototype,"handleStateChange",1),m=f([o("sd-3-20-
|
1
|
+
import{S as e,x as t,t as i,i as r,e as s,n as l,a as o}from"./solid-components2.js";import{d as a}from"./default-value.js";import{F as n}from"./form.js";import{o as d}from"./if-defined.js";import{l as h}from"./live.js";import{r as c}from"./state.js";import{w as u}from"./watch.js";var p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?b(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&p(t,i,l),l};let m=class extends e{constructor(){super(...arguments),this.formControlController=new n(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.showInvalidStyle=!1,this.title="",this.name="",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){return t`<label part="base" class="${i("group flex items-center text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed")}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${d(this.value)}" .checked="${h(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"}" class="${i("relative flex flex-initial items-center justify-center border rounded-full h-4 w-8 transition-colors ease duration-100\n peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\n peer-focus-visible:outline-primary",this.disabled&&this.checked?"border-neutral-500 bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?"border-error bg-error hover:bg-error-400":this.checked?"border-accent bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"border-neutral-800 bg-white hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span id="thumb" part="thumb" class="${i("w-2.5 h-2.5 rounded-full transition-transform ease-in-out duration-200",this.disabled&&this.checked?"bg-white":this.disabled?"-translate-x-2 bg-neutral-500":this.showInvalidStyle?"bg-white -translate-x-2":this.checked?"translate-x-2 bg-white":"bg-neutral-800 -translate-x-2")}"></span> </span><span part="label" id="label" class="${i("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};m.styles=[e.styles,r`:host{display:block;width:-moz-max-content;width:max-content}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host([required]) #label::after{content:' *'}`],f([s("input")],m.prototype,"input",2),f([s("#invalid-message")],m.prototype,"invalidMessage",2),f([c()],m.prototype,"showInvalidStyle",2),f([l()],m.prototype,"title",2),f([l()],m.prototype,"name",2),f([l()],m.prototype,"value",2),f([l({type:Boolean,reflect:!0})],m.prototype,"disabled",2),f([l({type:Boolean,reflect:!0})],m.prototype,"checked",2),f([a("checked")],m.prototype,"defaultChecked",2),f([l({reflect:!0})],m.prototype,"form",2),f([l({type:Boolean,reflect:!0})],m.prototype,"required",2),f([u("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),f([u(["checked"],{waitUntilFirstUpdate:!0})],m.prototype,"handleStateChange",1),m=f([o("sd-3-20-1-switch")],m);export{m as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,L as e,x as s,t as a,r as i,c as o,i as l,e as r,n,a as c}from"./solid-components2.js";import{r as h}from"./state.js";import{s as b}from"./scroll.js";import{I as d}from"./interactive.js";var v=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=(t,e,s,a)=>{for(var i,o=a>1?void 0:a?u(e,s):e,l=t.length-1;l>=0;l--)(i=t[l])&&(o=(a?i(e,s,o):i(o))||o);return a&&o&&v(e,s,o),o};let m=class extends t{constructor(){super(...arguments),this.localize=new e(this),this.tabs=[],this.panels=[],this.hasScrollControls=!1,this.variant="default",this.activation="auto"}connectedCallback(){const t=Promise.all([customElements.whenDefined("sd-3-20-
|
1
|
+
import{S as t,L as e,x as s,t as a,r as i,c as o,i as l,e as r,n,a as c}from"./solid-components2.js";import{r as h}from"./state.js";import{s as b}from"./scroll.js";import{I as d}from"./interactive.js";var v=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=(t,e,s,a)=>{for(var i,o=a>1?void 0:a?u(e,s):e,l=t.length-1;l>=0;l--)(i=t[l])&&(o=(a?i(e,s,o):i(o))||o);return a&&o&&v(e,s,o),o};let m=class extends t{constructor(){super(...arguments),this.localize=new e(this),this.tabs=[],this.panels=[],this.hasScrollControls=!1,this.variant="default",this.activation="auto"}connectedCallback(){const t=Promise.all([customElements.whenDefined("sd-3-20-1-tab"),customElements.whenDefined("sd-3-20-1-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{t.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),t.some((t=>"disabled"===t.attributeName))&&this.syncTabsAndPanels()})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(this.activeTab??this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.unobserve(this.nav)}getAllTabs(t={includeDisabled:!0}){return[...this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()].filter((e=>t.includeDisabled?"sd-3-20-1-tab"===e.tagName.toLowerCase():"sd-3-20-1-tab"===e.tagName.toLowerCase()&&!e.disabled))}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sd-3-20-1-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.matches(":focus")))}handleClick(t){const e=t.target.closest("sd-3-20-1-tab");(null==e?void 0:e.closest("sd-3-20-1-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sd-3-20-1-tab");if((null==e?void 0:e.closest("sd-3-20-1-tab-group"))===this){if(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["Tab"].includes(t.key)){const t=this.tabs.indexOf(this.getActiveTab());null!==e&&b(this.tabs[t+1],this.nav,"horizontal")}if(["Shift","Tab"].includes(t.key)){const t=this.tabs.indexOf(this.getActiveTab());null!==e&&b(this.tabs[t-1],this.nav,"horizontal")}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.tabs.find((t=>t.matches(":focus"))),s="rtl"===this.localize.dir();if("sd-3-20-1-tab"===(null==e?void 0:e.tagName.toLowerCase())){let a=this.tabs.indexOf(e);"Home"===t.key?a=0:"End"===t.key?a=this.tabs.length-1:t.key===(s?"ArrowRight":"ArrowLeft")||"ArrowUp"===t.key?a--:(t.key===(s?"ArrowLeft":"ArrowRight")||"ArrowDown"===t.key)&&a++,a<0&&(a=this.tabs.length-1),a>this.tabs.length-1&&(a=0),this.tabs[a].focus({preventScroll:!0}),"auto"===this.activation&&this.setActiveTab(this.tabs[a],{scrollBehavior:"smooth"}),b(this.tabs[a],this.nav,"horizontal"),t.preventDefault()}}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e={emitEvents:!0,scrollBehavior:"auto",...e},t!==this.activeTab&&!t.disabled){const s=this.activeTab;this.activeTab=t,this.tabs.map((t=>t.active=t===this.activeTab)),this.panels.map((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),b(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(s&&this.emit("sd-tab-hide",{detail:{name:s.panel}}),this.emit("sd-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels(),this.updateComplete.then((()=>this.updateScrollControls())),0!==this.tabs.length&&"container"===this.tabs[0].variant&&(this.variant="container")}updateScrollControls(){this.hasScrollControls=this.nav.scrollWidth>this.nav.clientWidth}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t="rtl"===this.localize.dir();return s`<div part="base" class="${a("flex flex-col rounded-none")}" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"><div part="nav" class="${a(this.hasScrollControls&&"relative py-0 px-12")}">${this.hasScrollControls?s`<button part="scroll-button--start" exportparts="base:scroll-button__base" class="${a("sd-interactive flex items-center justify-center absolute top-0 bottom-0 left-0 !outline-offset-0 border-b border-neutral-400 z-10","rtl"===this.localize.dir()&&"left-auto right-0")}" @click="${this.handleScrollToStart}"><sd-3-20-1-icon library="system" name="${t?"chevron-up":"chevron-down"}" class="${a("h-6 w-12 rotate-90 grid place-items-center")}"></sd-3-20-1-icon></button>`:""}<div part="scroll-container" class="flex overflow-x-auto focus-visible:focus-outline !outline-offset-0"><div part="tabs" class="${a("flex flex-auto relative flex-row")}" role="tablist"><div part="separation" class="w-full h-0.25 bg-neutral-400 absolute bottom-0"></div><slot name="nav" @slotchange="${this.syncTabsAndPanels}"></slot></div></div>${this.hasScrollControls?s`<button part="scroll-button--end" exportparts="base:scroll-button__base" class="${a("sd-interactive flex items-center justify-center absolute top-0 bottom-0 right-0 !outline-offset-0 border-b border-neutral-400 z-10","rtl"===this.localize.dir()&&"right-auto left-0")}" @click="${this.handleScrollToEnd}"><sd-3-20-1-icon library="system" name="${t?"chevron-down":"chevron-up"}" class="${a("h-6 w-12 rotate-90 grid place-items-center")}"></sd-3-20-1-icon></button>`:""}</div><slot part="body" class="${a("block auto py-8 px-6","container"===this.variant&&"border border-neutral-400 border-t-0")}" @slotchange="${this.syncTabsAndPanels}"></slot></div>`}};m.styles=[t.styles,i(d),o,l`:host{box-sizing:border-box;display:block}[part=scroll-container]{scrollbar-width:none}[part=scroll-container]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}::slotted(sd-3-20-1-tab-panel){--padding:1rem 0}`],p([r("[part=base]")],m.prototype,"tabGroup",2),p([r("[part=body]")],m.prototype,"body",2),p([r("[part=scroll-container]")],m.prototype,"nav",2),p([h()],m.prototype,"hasScrollControls",2),p([h()],m.prototype,"variant",2),p([n()],m.prototype,"activation",2),m=p([c("sd-3-20-1-tab-group")],m);export{m as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as a,c as s,i,n as r,a as n}from"./solid-components2.js";import{w as o}from"./watch.js";var c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=(t,e,a,s)=>{for(var i,r=s>1?void 0:s?l(e,a):e,n=t.length-1;n>=0;n--)(i=t[n])&&(r=(s?i(e,a,r):i(r))||r);return s&&r&&c(e,a,r),r};let p=0,h=class extends t{constructor(){super(...arguments),this.attrId=++p,this.componentId=`sd-3-20-
|
1
|
+
import{S as t,x as e,t as a,c as s,i,n as r,a as n}from"./solid-components2.js";import{w as o}from"./watch.js";var c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=(t,e,a,s)=>{for(var i,r=s>1?void 0:s?l(e,a):e,n=t.length-1;n>=0;n--)(i=t[n])&&(r=(s?i(e,a,r):i(r))||r);return s&&r&&c(e,a,r),r};let p=0,h=class extends t{constructor(){super(...arguments),this.attrId=++p,this.componentId=`sd-3-20-1-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return e`<slot part="base" class="${a("block",this.active&&"tab-panel--active")}"></slot>`}};h.styles=[t.styles,s,i`:host{--padding:0;display:none}:host([active]){display:block}::part(base){padding:var(--padding)}`],d([r({reflect:!0})],h.prototype,"name",2),d([r({type:Boolean,reflect:!0})],h.prototype,"active",2),d([o("active")],h.prototype,"handleActiveChange",1),h=d([n("sd-3-20-1-tab-panel")],h);export{h as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as a,c as i,i as r,e as s,n as o,a as l}from"./solid-components2.js";import{w as n}from"./watch.js";var d=Object.defineProperty,b=Object.getOwnPropertyDescriptor,c=(t,e,a,i)=>{for(var r,s=i>1?void 0:i?b(e,a):e,o=t.length-1;o>=0;o--)(r=t[o])&&(s=(i?r(e,a,s):r(s))||s);return i&&s&&d(e,a,s),s};let h=0,p=class extends t{constructor(){super(...arguments),this.attrId=++h,this.componentId=`sd-3-20-
|
1
|
+
import{S as t,x as e,t as a,c as i,i as r,e as s,n as o,a as l}from"./solid-components2.js";import{w as n}from"./watch.js";var d=Object.defineProperty,b=Object.getOwnPropertyDescriptor,c=(t,e,a,i)=>{for(var r,s=i>1?void 0:i?b(e,a):e,o=t.length-1;o>=0;o--)(r=t[o])&&(s=(i?r(e,a,s):r(s))||s);return i&&s&&d(e,a,s),s};let h=0,p=class extends t{constructor(){super(...arguments),this.attrId=++h,this.componentId=`sd-3-20-1-tab-${this.attrId}`,this.variant="default",this.active=!1,this.disabled=!1,this.panel=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.tab.focus(t)}blur(){this.tab.blur()}render(){return this.id=this.id.length>0?this.id:this.componentId,e`<div part="base" class="${a("inline-flex min-w-max h-12 px-3 leading-none items-center justify-center whitespace-nowrap select-none cursor-pointer group relative focus-visible:focus-outline outline-2 !-outline-offset-2","container"===this.variant&&" rounded-[4px_4px_0_0]","container"===this.variant&&this.active&&"tab--active-container-border bg-white",this.disabled?"opacity-50 !cursor-not-allowed":"hover:bg-neutral-200")}" tabindex="${this.disabled?"-1":"0"}"><slot name="left" class="${a("pr-2",this.disabled?"text-neutral-500":"text-primary")}"></slot><slot class="${a(this.disabled?"text-neutral-500":"text-primary")}"></slot><div part="active-tab-indicator" class="${a((!this.active||this.disabled)&&"hidden","absolute bottom-0 h-1 bg-accent","default"===this.variant?"w-full":"w-3/4 group-hover:w-full transition-all duration-200 ease-in-out")}"></div><div part="hover-bottom-border" class="${a(!this.active&&!this.disabled&&"absolute w-full h-0.25 bottom-0 border-b border-neutral-400 invisible group-hover:visible")}"></div></div>`}};p.styles=[t.styles,i,r`:host{box-sizing:border-box;display:block}.tab--active-container-border::after{content:'';position:absolute;height:100%;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(var(--sd-color-neutral-400,195 195 195) / var(--tw-border-opacity));border-bottom:none;border-radius:4px 4px 0 0}`],c([s("[part=base]")],p.prototype,"tab",2),c([o({type:String,reflect:!0})],p.prototype,"variant",2),c([o({type:Boolean,reflect:!0})],p.prototype,"active",2),c([o({type:Boolean,reflect:!0})],p.prototype,"disabled",2),c([o({reflect:!0})],p.prototype,"panel",2),c([n("active")],p.prototype,"handleActiveChange",1),c([n("disabled")],p.prototype,"handleDisabledChange",1),p=c([l("sd-3-20-1-tab")],p);export{p as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,t,i as r,e as s,n as o,a as i}from"./solid-components2.js";import{s as a,n as l}from"./static.js";import{o as d}from"./if-defined.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),r=e?a`a`:a`button`;return l`<${r} part="base" type="${d(e?void 0:"button")}" href="${d(e?this.href:void 0)}" rel="${d(e&&this.target?"noreferrer noopener":void 0)}" target="${d(e?this.target:void 0)}" download="${d(e?this.download:void 0)}" ?disabled="${d(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${t("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?l`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${t({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-3-20-
|
1
|
+
import{S as e,t,i as r,e as s,n as o,a as i}from"./solid-components2.js";import{s as a,n as l}from"./static.js";import{o as d}from"./if-defined.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),r=e?a`a`:a`button`;return l`<${r} part="base" type="${d(e?void 0:"button")}" href="${d(e?this.href:void 0)}" rel="${d(e&&this.target?"noreferrer noopener":void 0)}" target="${d(e?this.target:void 0)}" download="${d(e?this.download:void 0)}" ?disabled="${d(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${t("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?l`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${t({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-3-20-1-icon library="system" name="close" label="remove"></sd-3-20-1-icon></slot>`:""}</${r}>`}};b.styles=[e.styles,r`:host{display:inline-block}`],h([s("a, button")],b.prototype,"tag",2),h([o({reflect:!0})],b.prototype,"size",2),h([o({type:Boolean,reflect:!0})],b.prototype,"selected",2),h([o({type:Boolean,reflect:!0})],b.prototype,"removable",2),h([o({type:Boolean,reflect:!0})],b.prototype,"disabled",2),h([o()],b.prototype,"href",2),h([o()],b.prototype,"target",2),h([o()],b.prototype,"download",2),b=h([i("sd-3-20-1-tag")],b);export{b as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,x as t,t as a,i as r,n as s,e as i,a as o}from"./solid-components2.js";import{H as l}from"./slot.js";var d=Object.defineProperty,n=Object.getOwnPropertyDescriptor,h=(e,t,a,r)=>{for(var s,i=r>1?void 0:r?n(t,a):t,o=e.length-1;o>=0;o--)(s=e[o])&&(i=(r?s(t,a,i):s(i))||i);return r&&i&&d(t,a,i),i};let p=class extends e{constructor(){super(...arguments),this.variant="white",this.hasSlotController=new l(this,"[default]","media","meta","headline","expandable")}render(){const e={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return t`<div class="relative flex flex-col group" part="base"><div class="${a("mb-4",!e["teaser-has-media"]&&"hidden")}" part="media"><slot name="media"></slot></div><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${a("flex-1","gradient-white"===this.variant&&"bg-gradient-to-t from-white/[.8] to-60%","gradient-dark"===this.variant&&"bg-gradient-to-t from-primary-800/[.6] to-60%")}"></div><div class="${a({white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"bg-neutral-100/[.8] group-hover:bg-neutral-100/90",primary:"bg-primary/[.8] text-white group-hover:bg-primary/90","primary-100":"bg-primary-100/[.8] group-hover:bg-primary-100/90","gradient-white":"bg-gradient-to-t from-white/90 to-white/[.8]","gradient-dark":"bg-gradient-to-t from-primary-800/75 to-primary-800/[.6] text-white"}[this.variant])}"><div class="flex-col text-left p-4" part="content"><div part="meta" class="${a("gap-2 mb-4",!e["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="text-lg font-bold m-0"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div class="${a("hidden",e["teaser-has-expandable"]&&"h-[0px] invisible opacity-0 md:[transition:_height_0.2s_linear,opacity_0.1s_linear_0.1s] md:block md:group-hover:h-auto md:group-hover:my-4 md:group-hover:opacity-[100%] md:group-hover:visible")}" part="expandable"><slot name="expandable"></slot></div><div part="main" class="${a(!e["teaser-has-default"]&&"hidden")}"><slot></slot></div></div></div></div></div>`}};p.styles=[e.styles,r`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],h([s({reflect:!0})],p.prototype,"variant",2),h([i('[part="base"]')],p.prototype,"teaserMedia",2),p=h([o("sd-3-20-
|
1
|
+
import{S as e,x as t,t as a,i as r,n as s,e as i,a as o}from"./solid-components2.js";import{H as l}from"./slot.js";var d=Object.defineProperty,n=Object.getOwnPropertyDescriptor,h=(e,t,a,r)=>{for(var s,i=r>1?void 0:r?n(t,a):t,o=e.length-1;o>=0;o--)(s=e[o])&&(i=(r?s(t,a,i):s(i))||i);return r&&i&&d(t,a,i),i};let p=class extends e{constructor(){super(...arguments),this.variant="white",this.hasSlotController=new l(this,"[default]","media","meta","headline","expandable")}render(){const e={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return t`<div class="relative flex flex-col group" part="base"><div class="${a("mb-4",!e["teaser-has-media"]&&"hidden")}" part="media"><slot name="media"></slot></div><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${a("flex-1","gradient-white"===this.variant&&"bg-gradient-to-t from-white/[.8] to-60%","gradient-dark"===this.variant&&"bg-gradient-to-t from-primary-800/[.6] to-60%")}"></div><div class="${a({white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"bg-neutral-100/[.8] group-hover:bg-neutral-100/90",primary:"bg-primary/[.8] text-white group-hover:bg-primary/90","primary-100":"bg-primary-100/[.8] group-hover:bg-primary-100/90","gradient-white":"bg-gradient-to-t from-white/90 to-white/[.8]","gradient-dark":"bg-gradient-to-t from-primary-800/75 to-primary-800/[.6] text-white"}[this.variant])}"><div class="flex-col text-left p-4" part="content"><div part="meta" class="${a("gap-2 mb-4",!e["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="text-lg font-bold m-0"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div class="${a("hidden",e["teaser-has-expandable"]&&"h-[0px] invisible opacity-0 md:[transition:_height_0.2s_linear,opacity_0.1s_linear_0.1s] md:block md:group-hover:h-auto md:group-hover:my-4 md:group-hover:opacity-[100%] md:group-hover:visible")}" part="expandable"><slot name="expandable"></slot></div><div part="main" class="${a(!e["teaser-has-default"]&&"hidden")}"><slot></slot></div></div></div></div></div>`}};p.styles=[e.styles,r`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],h([s({reflect:!0})],p.prototype,"variant",2),h([i('[part="base"]')],p.prototype,"teaserMedia",2),p=h([o("sd-3-20-1-teaser-media")],p);export{p as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as i,i as r,n as a,e as s,a as o}from"./solid-components2.js";import{H as n}from"./slot.js";import{r as l}from"./state.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,i,r)=>{for(var a,s=r>1?void 0:r?d(e,i):e,o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r?a(e,i,s):a(s))||s);return r&&s&&h(e,i,s),s};let c=class extends t{constructor(){super(...arguments),this.variant="white",this.breakpoint=448,this.inset=!1,this.hasSlotController=new n(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),0===this.breakpoint?this._orientation="horizontal":9999===this.breakpoint?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateOrientation())),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(t){super.updated(t),t.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){const t="white border-neutral-400"===this.variant||this.inset,r=this.hasSlotController.test("[default]"),a=this.hasSlotController.test("media"),s=this.hasSlotController.test("meta");return this.hasSlotController.test("headline"),e`<div class="${i("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],"vertical"===this._orientation&&"flex-col","horizontal"===this._orientation&&"flex-row gap-8","horizontal"===this._orientation&&t&&"py-8 px-10")}" part="base"><div style="${"horizontal"===this._orientation?"width: var(--distribution-media, 100%);":""}" class="${i(!t&&"vertical"===this._orientation&&"mb-4",!a&&"hidden","white border-neutral-400"===this.variant&&"vertical"===this._orientation&&"mx-[-1px] mt-[-1px]")}" part="media"><slot name="media"></slot></div><div style="${"horizontal"===this._orientation?"width: var(--distribution-content, 100%); "+(t?"width: var(--distribution-content, calc(100% - 2rem));":""):""}" class="${i("flex flex-col text-left","horizontal"===this._orientation&&"flex flex-col","vertical"===this._orientation&&t&&"m-4")}" part="content"><div part="meta" class="${i("gap-2 mb-4",!s&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="${i("text-lg font-bold m-0","primary"===this.variant?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div part="main" class="${i(!r&&"hidden")}"><slot></slot></div></div></div>`}};c.styles=[t.styles,r`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],p([a({reflect:!0})],c.prototype,"variant",2),p([a({reflect:!0,type:Number})],c.prototype,"breakpoint",2),p([a({type:Boolean,reflect:!0})],c.prototype,"inset",2),p([s('[part="base"]')],c.prototype,"teaser",2),p([l()],c.prototype,"_orientation",2),c=p([o("sd-3-20-
|
1
|
+
import{S as t,x as e,t as i,i as r,n as a,e as s,a as o}from"./solid-components2.js";import{H as n}from"./slot.js";import{r as l}from"./state.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,i,r)=>{for(var a,s=r>1?void 0:r?d(e,i):e,o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r?a(e,i,s):a(s))||s);return r&&s&&h(e,i,s),s};let c=class extends t{constructor(){super(...arguments),this.variant="white",this.breakpoint=448,this.inset=!1,this.hasSlotController=new n(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),0===this.breakpoint?this._orientation="horizontal":9999===this.breakpoint?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateOrientation())),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(t){super.updated(t),t.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){const t="white border-neutral-400"===this.variant||this.inset,r=this.hasSlotController.test("[default]"),a=this.hasSlotController.test("media"),s=this.hasSlotController.test("meta");return this.hasSlotController.test("headline"),e`<div class="${i("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],"vertical"===this._orientation&&"flex-col","horizontal"===this._orientation&&"flex-row gap-8","horizontal"===this._orientation&&t&&"py-8 px-10")}" part="base"><div style="${"horizontal"===this._orientation?"width: var(--distribution-media, 100%);":""}" class="${i(!t&&"vertical"===this._orientation&&"mb-4",!a&&"hidden","white border-neutral-400"===this.variant&&"vertical"===this._orientation&&"mx-[-1px] mt-[-1px]")}" part="media"><slot name="media"></slot></div><div style="${"horizontal"===this._orientation?"width: var(--distribution-content, 100%); "+(t?"width: var(--distribution-content, calc(100% - 2rem));":""):""}" class="${i("flex flex-col text-left","horizontal"===this._orientation&&"flex flex-col","vertical"===this._orientation&&t&&"m-4")}" part="content"><div part="meta" class="${i("gap-2 mb-4",!s&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="${i("text-lg font-bold m-0","primary"===this.variant?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. <h2>)</slot></div><div part="main" class="${i(!r&&"hidden")}"><slot></slot></div></div></div>`}};c.styles=[t.styles,r`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],p([a({reflect:!0})],c.prototype,"variant",2),p([a({reflect:!0,type:Number})],c.prototype,"breakpoint",2),p([a({type:Boolean,reflect:!0})],c.prototype,"inset",2),p([s('[part="base"]')],c.prototype,"teaser",2),p([l()],c.prototype,"_orientation",2),c=p([o("sd-3-20-1-teaser")],c);export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as a,c as l,i as s,e as r,n as i,a as o}from"./solid-components2.js";import{d as h}from"./default-value.js";import{F as n}from"./form.js";import{H as d}from"./slot.js";import{o as p}from"./if-defined.js";import{l as u}from"./live.js";import{r as c}from"./state.js";import{w as y}from"./watch.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(t,e,a,l)=>{for(var s,r=l>1?void 0:l?b(e,a):e,i=t.length-1;i>=0;i--)(s=t[i])&&(r=(l?s(e,a,r):s(r))||r);return l&&r&&m(e,a,r),r};let v=class extends t{constructor(){super(...arguments),this.formControlController=new n(this),this.hasSlotController=new d(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),l=this.hasSlotController.test("help-text"),s=!!this.label||!!t,r=!!this.helpText||!!l,i=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",o="sm"===this.size?"text-sm":"text-base",h={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="flex flex-col h-full text-left"><label part="form-control-label" id="label" class="${a("mb-2",s?"inline-block":"hidden",o)}" for="input" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${a("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",{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"}[i])}"></div><div part="base" class="${a("textarea h-full px-4 flex items-top rounded-default group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===i?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${a("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",o)}" title="${this.title}" name="${p(this.name)}" .value="${u(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${p(this.placeholder)}" minlength="${p(this.minlength)}" maxlength="${p(this.maxlength)}" rows="${p(this.rows)}" autocapitalize="${p(this.autocapitalize)}" autocorrect="${p(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${p(this.spellcheck)}" enterkeyhint="${p(this.enterkeyhint)}" inputmode="${p(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-3-20-
|
1
|
+
import{S as t,x as e,t as a,c as l,i as s,e as r,n as i,a as o}from"./solid-components2.js";import{d as h}from"./default-value.js";import{F as n}from"./form.js";import{H as d}from"./slot.js";import{o as p}from"./if-defined.js";import{l as u}from"./live.js";import{r as c}from"./state.js";import{w as y}from"./watch.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(t,e,a,l)=>{for(var s,r=l>1?void 0:l?b(e,a):e,i=t.length-1;i>=0;i--)(s=t[i])&&(r=(l?s(e,a,r):s(r))||r);return l&&r&&m(e,a,r),r};let v=class extends t{constructor(){super(...arguments),this.formControlController=new n(this),this.hasSlotController=new d(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),l=this.hasSlotController.test("help-text"),s=!!this.label||!!t,r=!!this.helpText||!!l,i=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",o="sm"===this.size?"text-sm":"text-base",h={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="flex flex-col h-full text-left"><label part="form-control-label" id="label" class="${a("mb-2",s?"inline-block":"hidden",o)}" for="input" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${a("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",{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"}[i])}"></div><div part="base" class="${a("textarea h-full px-4 flex items-top rounded-default group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===i?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${a("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",o)}" title="${this.title}" name="${p(this.name)}" .value="${u(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${p(this.placeholder)}" minlength="${p(this.minlength)}" maxlength="${p(this.maxlength)}" rows="${p(this.rows)}" autocapitalize="${p(this.autocapitalize)}" autocorrect="${p(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${p(this.spellcheck)}" enterkeyhint="${p(this.enterkeyhint)}" inputmode="${p(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-3-20-1-icon class="${a("text-error absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="risk" part="invalid-icon"></sd-3-20-1-icon>`:""} ${this.styleOnValid&&this.showValidStyle?e`<sd-3-20-1-icon class="${a("text-success absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="status-check" part="valid-icon"></sd-3-20-1-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700",r?"block":"hidden")}" aria-hidden="${r?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};v.styles=[l,t.styles,s`:host{display:block;height:100%}:host([required]) #label::after{content:' *'}.no-scrollbar::-webkit-scrollbar{display:none}`],f([r("#input")],v.prototype,"textarea",2),f([r("#invalid-message")],v.prototype,"invalidMessage",2),f([c()],v.prototype,"hasFocus",2),f([c()],v.prototype,"showValidStyle",2),f([c()],v.prototype,"showInvalidStyle",2),f([i()],v.prototype,"title",2),f([i()],v.prototype,"name",2),f([i()],v.prototype,"value",2),f([i({reflect:!0})],v.prototype,"size",2),f([i()],v.prototype,"label",2),f([i({attribute:"help-text"})],v.prototype,"helpText",2),f([i()],v.prototype,"placeholder",2),f([i({type:Number})],v.prototype,"rows",2),f([i({type:Boolean,reflect:!0})],v.prototype,"disabled",2),f([i({type:Boolean,reflect:!0})],v.prototype,"readonly",2),f([i({reflect:!0})],v.prototype,"form",2),f([i({type:Boolean,reflect:!0})],v.prototype,"required",2),f([i({type:Number})],v.prototype,"minlength",2),f([i({type:Number})],v.prototype,"maxlength",2),f([i()],v.prototype,"autocapitalize",2),f([i()],v.prototype,"autocorrect",2),f([i()],v.prototype,"autocomplete",2),f([i({type:Boolean})],v.prototype,"autofocus",2),f([i()],v.prototype,"enterkeyhint",2),f([i({type:Boolean,reflect:!0,attribute:"style-on-valid"})],v.prototype,"styleOnValid",2),f([i({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],v.prototype,"spellcheck",2),f([i()],v.prototype,"inputmode",2),f([h()],v.prototype,"defaultValue",2),f([y("disabled",{waitUntilFirstUpdate:!0})],v.prototype,"handleDisabledChange",1),f([y("rows",{waitUntilFirstUpdate:!0})],v.prototype,"handleRowsChange",1),f([y("value",{waitUntilFirstUpdate:!0})],v.prototype,"handleValueChange",1),v=f([o("sd-3-20-1-textarea")],v);export{v as default};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{S as t,L as e,x as s,t as i,r as o,i as a,e as h,n as r,a as n}from"./solid-components2.js";import{c as p,s as d,a as l}from"./animate.js";import{g as c,s as u}from"./animation-registry.js";import{w as m}from"./event.js";import{w}from"./watch.js";import{I as y}from"./interactive.js";var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,f=(t,e,s,i)=>{for(var o,a=i>1?void 0:i?g(e,s):e,h=t.length-1;h>=0;h--)(o=t[h])&&(a=(i?o(e,s,a):o(a))||a);return i&&a&&v(e,s,a),a};let b=class extends t{constructor(){super(...arguments),this.isFocusTriggered=!1,this.localize=new e(this),this.size="lg",this.content="",this.placement="top",this.disabled=!1,this.open=!1,this.trigger="click focus",this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then((()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}))}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut)}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){if(this.hasTrigger("click")){if(this.isFocusTriggered)return void(this.isFocusTriggered=!1);this.open?this.hide():this.show()}}handleFocus(){this.hasTrigger("focus")&&(this.isFocusTriggered=!0,this.show())}handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){const t=p(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}}handleMouseOut(){if(this.hasTrigger("hover")){const t=p(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await d(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:e}=c(this,"tooltip.show",{dir:this.localize.dir()});await l(this.popup.popup,t,e),this.emit("sd-after-show")}else{this.emit("sd-hide"),await d(this.body);const{keyframes:t,options:e}=c(this,"tooltip.hide",{dir:this.localize.dir()});await l(this.popup.popup,t,e),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,m(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,m(this,"sd-after-hide")}render(){const t=this.placement.endsWith("-start"),e=this.placement.endsWith("-end");return s`<sd-3-20-
|
1
|
+
import{S as t,L as e,x as s,t as i,r as o,i as a,e as h,n as r,a as n}from"./solid-components2.js";import{c as p,s as d,a as l}from"./animate.js";import{g as c,s as u}from"./animation-registry.js";import{w as m}from"./event.js";import{w}from"./watch.js";import{I as y}from"./interactive.js";var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,f=(t,e,s,i)=>{for(var o,a=i>1?void 0:i?g(e,s):e,h=t.length-1;h>=0;h--)(o=t[h])&&(a=(i?o(e,s,a):o(a))||a);return i&&a&&v(e,s,a),a};let b=class extends t{constructor(){super(...arguments),this.isFocusTriggered=!1,this.localize=new e(this),this.size="lg",this.content="",this.placement="top",this.disabled=!1,this.open=!1,this.trigger="click focus",this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then((()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}))}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut)}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){if(this.hasTrigger("click")){if(this.isFocusTriggered)return void(this.isFocusTriggered=!1);this.open?this.hide():this.show()}}handleFocus(){this.hasTrigger("focus")&&(this.isFocusTriggered=!0,this.show())}handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){const t=p(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),t)}}handleMouseOut(){if(this.hasTrigger("hover")){const t=p(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),t)}}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await d(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:e}=c(this,"tooltip.show",{dir:this.localize.dir()});await l(this.popup.popup,t,e),this.emit("sd-after-show")}else{this.emit("sd-hide"),await d(this.body);const{keyframes:t,options:e}=c(this,"tooltip.hide",{dir:this.localize.dir()});await l(this.popup.popup,t,e),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,m(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,m(this,"sd-after-hide")}render(){const t=this.placement.endsWith("-start"),e=this.placement.endsWith("-end");return s`<sd-3-20-1-popup part="base" exportparts="
|
2
2
|
popup:base__popup,
|
3
3
|
arrow:base__arrow
|
4
|
-
" class="${i(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[t?"start":e?"end":"default"]*("sm"===this.size?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${i("lg"===this.size?"text-xl":"text-base")}"><button class="flex sd-interactive rounded-full"><sd-3-20-
|
4
|
+
" class="${i(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[t?"start":e?"end":"default"]*("sm"===this.size?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${i("lg"===this.size?"text-xl":"text-base")}"><button class="flex sd-interactive rounded-full"><sd-3-20-1-icon library="system" name="info-circle" class="${i(this.disabled&&"sd-interactive--disabled")}"></sd-3-20-1-icon></button></slot><slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="Tooltip" aria-live="${this.open?"polite":"off"}">${this.content}</slot></sd-3-20-1-popup>`}};b.styles=[t.styles,o(y),a`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-3-20-1-popup{--arrow-color:rgb(var(--sd-color-primary, 0 53 142) / 1);--arrow-size:10px}sd-3-20-1-popup::part(popup){pointer-events:none;z-index:10;--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-3-20-1-popup::part(arrow){--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-3-20-1-popup[placement^=top]::part(popup){transform-origin:bottom}sd-3-20-1-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`],f([h("slot:not([name])")],b.prototype,"defaultSlot",2),f([h("#tooltip")],b.prototype,"body",2),f([h("sd-3-20-1-popup")],b.prototype,"popup",2),f([r()],b.prototype,"size",2),f([r()],b.prototype,"content",2),f([r({reflect:!0})],b.prototype,"placement",2),f([r({type:Boolean,reflect:!0})],b.prototype,"disabled",2),f([r({type:Boolean,reflect:!0})],b.prototype,"open",2),f([r()],b.prototype,"trigger",2),f([r({type:Boolean})],b.prototype,"hoist",2),f([w("open",{waitUntilFirstUpdate:!0})],b.prototype,"handleOpenChange",1),f([w(["content","hoist","placement"])],b.prototype,"handleOptionsChange",1),f([w("disabled")],b.prototype,"handleDisabledChange",1),b=f([n("sd-3-20-1-tooltip")],b),u("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),u("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});export{b as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as s,i as o,e as a,n as i,a as l}from"./solid-components2.js";import{H as r}from"./slot.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var a,i=o>1?void 0:o?p(e,s):e,l=t.length-1;l>=0;l--)(a=t[l])&&(i=(o?a(e,s,i):a(i))||i);return o&&i&&n(e,s,i),i};let y=class extends t{constructor(){super(...arguments),this.playing=!1,this.overlay=!1,this.isBelowBreakpoint=!1,this.hasSlotController=new r(this,"[default]","play-icon","poster")}get poster(){const t=this.shadowRoot.querySelector("slot[name=poster]");return(null==t?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}fadeoutPoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0")}hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.display="none")}play(){this.emit("sd-play"),this.playing=!0,this.fadeoutPoster()}handleKeydown(t){t instanceof KeyboardEvent&&("Enter"===t.key||" "===t.key)&&(this.play(),setTimeout((()=>{var t;null==(t=this.querySelector("video"))||t.focus()})))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.handleButtonResize())),this.updateComplete.then((()=>{this.resizeObserver.observe(this.hostEl)}))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return e`<div part="base" aria-label="Video Player" class="cursor-pointer"><button part="play-button" aria-label="Play video" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${s(this.playing&&"pointer-events-none","w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${s(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition")}"><slot name="play-icon" part="play-icon" class="${s(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-3-20-
|
1
|
+
import{S as t,x as e,t as s,i as o,e as a,n as i,a as l}from"./solid-components2.js";import{H as r}from"./slot.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var a,i=o>1?void 0:o?p(e,s):e,l=t.length-1;l>=0;l--)(a=t[l])&&(i=(o?a(e,s,i):a(i))||i);return o&&i&&n(e,s,i),i};let y=class extends t{constructor(){super(...arguments),this.playing=!1,this.overlay=!1,this.isBelowBreakpoint=!1,this.hasSlotController=new r(this,"[default]","play-icon","poster")}get poster(){const t=this.shadowRoot.querySelector("slot[name=poster]");return(null==t?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}fadeoutPoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0")}hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.display="none")}play(){this.emit("sd-play"),this.playing=!0,this.fadeoutPoster()}handleKeydown(t){t instanceof KeyboardEvent&&("Enter"===t.key||" "===t.key)&&(this.play(),setTimeout((()=>{var t;null==(t=this.querySelector("video"))||t.focus()})))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.handleButtonResize())),this.updateComplete.then((()=>{this.resizeObserver.observe(this.hostEl)}))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return e`<div part="base" aria-label="Video Player" class="cursor-pointer"><button part="play-button" aria-label="Play video" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${s(this.playing&&"pointer-events-none","w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${s(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition")}"><slot name="play-icon" part="play-icon" class="${s(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-3-20-1-icon id="default-play-icon" library="system" name="start"></sd-3-20-1-icon></slot></div></button> ${this.hasSlotController.test("poster")?e`<slot name="poster" role="presentation" @transitionend="${this.hidePoster}"></slot>`:null}<div part="overlay" id="overlay" role="presentation" class="${s(this.overlay&&!this.playing?"opacity-100":"opacity-0","bg-[rgba(0,0,0,0.65)] w-full h-full absolute top-0 left-0 pointer-events-none z-20 play-pause-transition")}"></div><slot></slot></div>`}};y.styles=[t.styles,o`:host{position:relative;display:inline-block;overflow:hidden}.play-pause-transition,::slotted([slot=poster]){transition-property:opacity;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}::slotted([slot=poster]){position:absolute;left:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);z-index:10;width:100%}#default-play-icon,::slotted([slot=play-icon]){position:absolute;left:50%;top:50%;--tw-translate-x:-50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}`],d([a("[part=base]")],y.prototype,"hostEl",2),d([i({type:Boolean,reflect:!0})],y.prototype,"playing",2),d([i({type:Boolean,reflect:!0})],y.prototype,"overlay",2),d([i({type:Boolean})],y.prototype,"isBelowBreakpoint",2),y=d([l("sd-3-20-1-video")],y);export{y as default};
|
@@ -21,19 +21,19 @@ let SdButtonGroup = class extends SolidElement {
|
|
21
21
|
}
|
22
22
|
handleFocus(event) {
|
23
23
|
const button = findButton(event.target);
|
24
|
-
button == null ? void 0 : button.classList.add("sd-3-20-
|
24
|
+
button == null ? void 0 : button.classList.add("sd-3-20-1-button-group__button--focus");
|
25
25
|
}
|
26
26
|
handleBlur(event) {
|
27
27
|
const button = findButton(event.target);
|
28
|
-
button == null ? void 0 : button.classList.remove("sd-3-20-
|
28
|
+
button == null ? void 0 : button.classList.remove("sd-3-20-1-button-group__button--focus");
|
29
29
|
}
|
30
30
|
handleMouseOver(event) {
|
31
31
|
const button = findButton(event.target);
|
32
|
-
button == null ? void 0 : button.classList.add("sd-3-20-
|
32
|
+
button == null ? void 0 : button.classList.add("sd-3-20-1-button-group__button--hover");
|
33
33
|
}
|
34
34
|
handleMouseOut(event) {
|
35
35
|
const button = findButton(event.target);
|
36
|
-
button == null ? void 0 : button.classList.remove("sd-3-20-
|
36
|
+
button == null ? void 0 : button.classList.remove("sd-3-20-1-button-group__button--hover");
|
37
37
|
}
|
38
38
|
handleSlotChange() {
|
39
39
|
const slottedElements = [...this.defaultSlot.assignedElements({ flatten: true })];
|
@@ -41,11 +41,11 @@ let SdButtonGroup = class extends SolidElement {
|
|
41
41
|
const index = slottedElements.indexOf(el);
|
42
42
|
const button = findButton(el);
|
43
43
|
if (button !== null) {
|
44
|
-
button.classList.add("sd-3-20-
|
45
|
-
button.classList.toggle("sd-3-20-
|
46
|
-
button.classList.toggle("sd-3-20-
|
47
|
-
button.classList.toggle("sd-3-20-
|
48
|
-
button.classList.toggle("sd-3-20-
|
44
|
+
button.classList.add("sd-3-20-1-button-group__button");
|
45
|
+
button.classList.toggle("sd-3-20-1-button-group__button--first", index === 0);
|
46
|
+
button.classList.toggle("sd-3-20-1-button-group__button--inner", index > 0 && index < slottedElements.length - 1);
|
47
|
+
button.classList.toggle("sd-3-20-1-button-group__button--last", index === slottedElements.length - 1);
|
48
|
+
button.classList.toggle("sd-3-20-1-button-group__button--radio", button.tagName.toLowerCase() === "sd-3-20-1-radio-button");
|
49
49
|
}
|
50
50
|
});
|
51
51
|
}
|
@@ -64,10 +64,10 @@ __decorateClass([
|
|
64
64
|
property()
|
65
65
|
], SdButtonGroup.prototype, "label", 2);
|
66
66
|
SdButtonGroup = __decorateClass([
|
67
|
-
customElement("sd-3-20-
|
67
|
+
customElement("sd-3-20-1-button-group")
|
68
68
|
], SdButtonGroup);
|
69
69
|
function findButton(el) {
|
70
|
-
const selector = "sd-3-20-
|
70
|
+
const selector = "sd-3-20-1-button, sd-3-20-1-radio-button";
|
71
71
|
return el.closest(selector) ?? el.querySelector(selector);
|
72
72
|
}
|
73
73
|
export {
|
@@ -106,7 +106,7 @@ let SdAccordion = class extends SolidElement {
|
|
106
106
|
)}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${cx(
|
107
107
|
"flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",
|
108
108
|
this.open && "rotate-180"
|
109
|
-
)}"><slot name="expand-icon" class="${cx(this.open && "hidden")}"><sd-3-20-
|
109
|
+
)}"><slot name="expand-icon" class="${cx(this.open && "hidden")}"><sd-3-20-1-icon library="system" name="chevron-down"></sd-3-20-1-icon></slot><slot name="collapse-icon" class="${cx(!this.open && "hidden")}"><sd-3-20-1-icon library="system" name="chevron-down"></sd-3-20-1-icon></slot></span></header><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></div>`;
|
110
110
|
}
|
111
111
|
};
|
112
112
|
SdAccordion.styles = [
|
@@ -132,7 +132,7 @@ __decorateClass([
|
|
132
132
|
watch("open", { waitUntilFirstUpdate: true })
|
133
133
|
], SdAccordion.prototype, "handleOpenChange", 1);
|
134
134
|
SdAccordion = __decorateClass([
|
135
|
-
customElement("sd-3-20-
|
135
|
+
customElement("sd-3-20-1-accordion")
|
136
136
|
], SdAccordion);
|
137
137
|
setDefaultAnimation("accordion.show", {
|
138
138
|
keyframes: [
|
@@ -47,16 +47,16 @@ let SdAccordionGroup = class extends SolidElement {
|
|
47
47
|
SdAccordionGroup.styles = [
|
48
48
|
componentStyles,
|
49
49
|
SolidElement.styles,
|
50
|
-
css`:host{display:block}::slotted(sd-3-20-
|
50
|
+
css`:host{display:block}::slotted(sd-3-20-1-accordion:not(:first-of-type)){margin-top:-1px}`
|
51
51
|
];
|
52
52
|
__decorateClass([
|
53
|
-
queryAssignedElements({ selector: "sd-3-20-
|
53
|
+
queryAssignedElements({ selector: "sd-3-20-1-accordion" })
|
54
54
|
], SdAccordionGroup.prototype, "_accordionsInDefaultSlot", 2);
|
55
55
|
__decorateClass([
|
56
56
|
property({ attribute: "close-others", type: Boolean })
|
57
57
|
], SdAccordionGroup.prototype, "closeOthers", 2);
|
58
58
|
SdAccordionGroup = __decorateClass([
|
59
|
-
customElement("sd-3-20-
|
59
|
+
customElement("sd-3-20-1-accordion-group")
|
60
60
|
], SdAccordionGroup);
|
61
61
|
export {
|
62
62
|
SdAccordionGroup as default
|
@@ -282,10 +282,10 @@ let SdAudio = class extends SolidElement {
|
|
282
282
|
)}" part="audio-controls"><button class="${cx(
|
283
283
|
"playback-speed justify-self-start text-base font-bold hover:cursor-pointer sd-interactive",
|
284
284
|
this.inverted && "sd-interactive--inverted"
|
285
|
-
)}" aria-label="${this.localize.term("playbackSpeed")}" tabindex="0" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-3-20-
|
285
|
+
)}" aria-label="${this.localize.term("playbackSpeed")}" tabindex="0" @click="${this.togglePlaybackSpeed}" @keydown="${this.togglePlaybackSpeedKeydown}" part="playback-speed">${this.speed}x</button><sd-3-20-1-button ?inverted="${this.inverted ? true : false}" part="play-button" size="lg" @click="${!this.isPlaying ? this.playAudio : this.pauseAudio}" aria-label="${this.isPlaying ? this.localize.term("pauseAudio") : this.localize.term("playAudio")}">${this.isPlaying ? html`<sd-3-20-1-icon name="pause" library="system"></sd-3-20-1-icon>` : html`<sd-3-20-1-icon name="start" library="system"></sd-3-20-1-icon>`}</sd-3-20-1-button><div class="flex items-center justify-self-end">${this.hasSlotController.test("transcript") ? html`<button class="${cx(
|
286
286
|
"mr-6 w-6 h-6 hover:cursor-pointer sd-interactive",
|
287
287
|
this.inverted && "sd-interactive--inverted"
|
288
|
-
)}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" tab-index="0"><sd-3-20-
|
288
|
+
)}" @click="${this.showTranscript}" @keydown="${this.showTranscriptKeydown}" tab-index="0"><sd-3-20-1-icon class="w-6 h-6" name="transcript" library="system" label="${this.isMuted ? this.localize.term("unmute") : this.localize.term("mute")}"></sd-3-20-1-icon></button>` : null} <button class="${cx("w-6 h-6 hover:cursor-pointer sd-interactive", this.inverted && "sd-interactive--inverted")}" part="volume" aria-label="${this.localize.term("mute")}" tabindex="0" @click="${this.toggleMute}" @keydown="${this.toggleMuteKeydown}"><sd-3-20-1-icon class="w-6 h-6" name="${this.isMuted ? "mute" : "volume"}" library="system"></sd-3-20-1-icon></button></div></div>`;
|
289
289
|
const renderTimestamps = html`<div class="${cx(
|
290
290
|
"w-full flex justify-between",
|
291
291
|
this.reversedLayout ? "mb-2" : "mt-2",
|
@@ -295,13 +295,13 @@ let SdAudio = class extends SolidElement {
|
|
295
295
|
return html`<div class="${cx("w-full flex relative", this.reversedLayout ? "flex-col-reverse" : "flex-col")}" aria-label="${this.localize.term("audioPlayer")}" part="audio-player"><slot @slotchange="${this.updateAudioDuration}"></slot>${!this.animated || this.animated && this.reversedLayout ? renderAudioControls : null}<div class="relative">${this.animated && !this.reversedLayout ? html`${renderAudioControls}` : null} ${this.animated ? html`<canvas class="w-full h-16"></canvas>` : null} ${!this.hideTimestamps && this.animated && this.reversedLayout ? renderTimestamps : null} <input class="${cx(
|
296
296
|
"progress-slider bg-primary appearance-none w-full cursor-pointer outline-none h-1 flex items-center sd-interactive",
|
297
297
|
this.inverted && "sd-interactive--inverted"
|
298
|
-
)}" type="range" max="100" step="0.001" value="${this.progress}" tabindex="0" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" part="progress-slider" style="background:linear-gradient(to right,${this.inverted ? "rgb(var(--sd-color-white, 255 255 255) / 1)" : "rgb(var(--sd-color-primary, 0 53 142) / 1)"} ${progressPercentage}%,${this.animated ? "transparent" : this.inverted ? "rgb(var(--sd-color-primary-400, 153 171 208) / 1)" : "rgb(var(--sd-color-grey-400, 195 195 195) / 1)"} ${progressPercentage}%)"></div>${this.hasSlotController.test("transcript") ? html`<sd-3-20-
|
298
|
+
)}" type="range" max="100" step="0.001" value="${this.progress}" tabindex="0" @input="${this.handleAudioProgress}" @keydown="${this.handleAudioProgressKeydown}" part="progress-slider" style="background:linear-gradient(to right,${this.inverted ? "rgb(var(--sd-color-white, 255 255 255) / 1)" : "rgb(var(--sd-color-primary, 0 53 142) / 1)"} ${progressPercentage}%,${this.animated ? "transparent" : this.inverted ? "rgb(var(--sd-color-primary-400, 153 171 208) / 1)" : "rgb(var(--sd-color-grey-400, 195 195 195) / 1)"} ${progressPercentage}%)"></div>${this.hasSlotController.test("transcript") ? html`<sd-3-20-1-drawer><slot name="transcript"></slot></sd-3-20-1-drawer>` : null} ${!this.hideTimestamps && (!this.animated || !this.reversedLayout) ? renderTimestamps : null}</div>`;
|
299
299
|
}
|
300
300
|
};
|
301
301
|
SdAudio.styles = [
|
302
302
|
SolidElement.styles,
|
303
303
|
unsafeCSS(InteractiveStyles),
|
304
|
-
css`.progress-slider:focus-visible{outline:2px solid transparent;outline-offset:2px}.progress-slider::-webkit-slider-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-webkit-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-webkit-slider-thumb{outline-style:solid;outline-offset:2px}.progress-slider::-moz-range-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-moz-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-moz-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-moz-range-thumb{outline-style:solid;outline-offset:2px}sd-3-20-
|
304
|
+
css`.progress-slider:focus-visible{outline:2px solid transparent;outline-offset:2px}.progress-slider::-webkit-slider-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-webkit-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-webkit-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-webkit-slider-thumb{outline-style:solid;outline-offset:2px}.progress-slider::-moz-range-thumb{background-color:currentColor;height:var(--sd-spacing-4,1rem);width:var(--sd-spacing-4,1rem);-moz-appearance:none;appearance:none;border-radius:var(--sd-border-radius-full,9999px);border-style:none;-moz-transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.progress-slider:focus-visible::-moz-range-thumb{outline-style:solid;outline-offset:2px}sd-3-20-1-button::part(base){display:flex;height:var(--sd-spacing-16,4rem);width:var(--sd-spacing-16,4rem);align-items:center;justify-content:center;border-radius:var(--sd-border-radius-full,9999px)}sd-3-20-1-button::part(label){flex-grow:0}`
|
305
305
|
];
|
306
306
|
__decorateClass([
|
307
307
|
property({ type: Boolean, reflect: true, attribute: "reversed-layout" })
|
@@ -340,13 +340,13 @@ __decorateClass([
|
|
340
340
|
query('[part="audio-player"]')
|
341
341
|
], SdAudio.prototype, "audioPlayerContainer", 2);
|
342
342
|
__decorateClass([
|
343
|
-
query("sd-3-20-
|
343
|
+
query("sd-3-20-1-drawer")
|
344
344
|
], SdAudio.prototype, "drawer", 2);
|
345
345
|
__decorateClass([
|
346
346
|
query("canvas")
|
347
347
|
], SdAudio.prototype, "canvas", 2);
|
348
348
|
SdAudio = __decorateClass([
|
349
|
-
customElement("sd-3-20-
|
349
|
+
customElement("sd-3-20-1-audio")
|
350
350
|
], SdAudio);
|
351
351
|
export {
|
352
352
|
SdAudio as default
|
@@ -141,7 +141,7 @@ __decorateClass([
|
|
141
141
|
state()
|
142
142
|
], SdBrandshape.prototype, "componentBreakpoint", 2);
|
143
143
|
SdBrandshape = __decorateClass([
|
144
|
-
customElement("sd-3-20-
|
144
|
+
customElement("sd-3-20-1-brandshape")
|
145
145
|
], SdBrandshape);
|
146
146
|
export {
|
147
147
|
SdBrandshape as default
|