@solid-design-system/components 3.22.9 → 3.22.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/es/notification.js +1 -1
- package/dist/components/es/scrollable.js +1 -1
- package/dist/components/es/solid-components2.js +2 -2
- package/dist/components/es/tab-group.js +1 -1
- package/dist/components/umd/solid-components.js +17 -17
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/notification/notification.js +1 -1
- package/dist/package/components/scrollable/scrollable.d.ts +4 -1
- package/dist/package/components/scrollable/scrollable.js +43 -17
- package/dist/package/components/tab-group/tab-group.js +1 -1
- package/dist/package/styles/tailwind.css.js +1 -1
- package/dist/package/translations/de.js +10 -10
- package/dist/package/translations/en.js +14 -14
- package/dist/package/utilities/localize.d.ts +8 -8
- package/dist/styles/solid-styles.css +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 +2 -2
- 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 +3 -3
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/map-marker/map-marker.d.ts +1 -1
- package/dist/versioned-package/components/map-marker/map-marker.js +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +5 -5
- package/dist/versioned-package/components/notification/notification.d.ts +1 -1
- package/dist/versioned-package/components/notification/notification.js +5 -5
- package/dist/versioned-package/components/option/option.d.ts +1 -1
- package/dist/versioned-package/components/option/option.js +2 -2
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/quickfact/quickfact.d.ts +1 -1
- package/dist/versioned-package/components/quickfact/quickfact.js +2 -2
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
- package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +13 -13
- package/dist/versioned-package/components/scrollable/scrollable.d.ts +5 -2
- package/dist/versioned-package/components/scrollable/scrollable.js +45 -19
- 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/translations/de.js +10 -10
- package/dist/versioned-package/translations/en.js +14 -14
- package/dist/versioned-package/utilities/autocomplete-config.js +4 -4
- package/dist/versioned-package/utilities/localize.d.ts +8 -8
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +45 -45
- package/dist/web-types.json +66 -46
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
import"./button.js";import"./icon.js";import{a as e,s as t}from"./animate.js";import{S as a,L as s,x as o,t as i,c as r,i as n,e as l,n as d,a as h}from"./solid-components2.js";import{g as p,s as c}from"./animation-registry.js";import{H as y}from"./slot.js";import{o as m}from"./if-defined.js";import{l as f,u}from"./scroll.js";import{w}from"./event.js";import{w as v}from"./watch.js";import{M as b}from"./modal.js";function g(e){return e.charAt(0).toUpperCase()+e.slice(1)}var k=Object.defineProperty,x=Object.getOwnPropertyDescriptor,j=(e,t,a,s)=>{for(var o,i=s>1?void 0:s?x(t,a):t,r=e.length-1;r>=0;r--)(o=e[r])&&(i=(s?o(t,a,i):o(i))||i);return s&&i&&k(t,a,i),i};let C=class extends a{constructor(){super(...arguments),this.hasSlotController=new y(this,"footer"),this.localize=new s(this),this.modal=new b(this),this.open=!1,this.label="",this.placement="end",this.contained=!1,this.noHeader=!1,this.handleDocumentKeyDown=e=>{this.open&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),f(this)))}disconnectedCallback(){super.disconnectedCallback(),u(this)}requestClose(t){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){const t=p(this,"drawer.denyClose",{dir:this.localize.dir()});e(this.panel,t.keyframes,t.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),f(this));const a=this.querySelector("[autofocus]");a&&a.removeAttribute("autofocus"),await Promise.all([t(this.drawer),t(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame((()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(a?a.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),a&&a.setAttribute("autofocus","")}));const s=p(this,`drawer.show${g(this.placement)}`,{dir:this.localize.dir()}),o=p(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([e(this.panel,s.keyframes,s.options),e(this.overlay,o.keyframes,o.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),u(this)),await Promise.all([t(this.drawer),t(this.overlay)]);const a=p(this,`drawer.hide${g(this.placement)}`,{dir:this.localize.dir()}),s=p(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([e(this.overlay,s.keyframes,s.options).then((()=>{this.overlay.hidden=!0})),e(this.panel,a.keyframes,a.options).then((()=>{this.panel.hidden=!0}))]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),f(this)),this.open&&this.contained&&(this.modal.deactivate(),u(this))}async show(){if(!this.open)return this.open=!0,w(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,w(this,"sd-after-hide")}render(){return o`<div part="base" class="${i("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}"><div part="overlay" class="${i("block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${i("absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[--width] h-full",start:"top-0 end-auto bottom-auto start-0 w-[--width] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.label}" aria-labelledby="${m(this.noHeader?void 0:"title")}" tabindex="0">${this.noHeader?"":o`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-3-22-
|
1
|
+
import"./button.js";import"./icon.js";import{a as e,s as t}from"./animate.js";import{S as a,L as s,x as o,t as i,c as r,i as n,e as l,n as d,a as h}from"./solid-components2.js";import{g as p,s as c}from"./animation-registry.js";import{H as y}from"./slot.js";import{o as m}from"./if-defined.js";import{l as f,u}from"./scroll.js";import{w}from"./event.js";import{w as v}from"./watch.js";import{M as b}from"./modal.js";function g(e){return e.charAt(0).toUpperCase()+e.slice(1)}var k=Object.defineProperty,x=Object.getOwnPropertyDescriptor,j=(e,t,a,s)=>{for(var o,i=s>1?void 0:s?x(t,a):t,r=e.length-1;r>=0;r--)(o=e[r])&&(i=(s?o(t,a,i):o(i))||i);return s&&i&&k(t,a,i),i};let C=class extends a{constructor(){super(...arguments),this.hasSlotController=new y(this,"footer"),this.localize=new s(this),this.modal=new b(this),this.open=!1,this.label="",this.placement="end",this.contained=!1,this.noHeader=!1,this.handleDocumentKeyDown=e=>{this.open&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),f(this)))}disconnectedCallback(){super.disconnectedCallback(),u(this)}requestClose(t){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:t}}).defaultPrevented){const t=p(this,"drawer.denyClose",{dir:this.localize.dir()});e(this.panel,t.keyframes,t.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),f(this));const a=this.querySelector("[autofocus]");a&&a.removeAttribute("autofocus"),await Promise.all([t(this.drawer),t(this.overlay)]),this.drawer.hidden=!1,requestAnimationFrame((()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(a?a.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),a&&a.setAttribute("autofocus","")}));const s=p(this,`drawer.show${g(this.placement)}`,{dir:this.localize.dir()}),o=p(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([e(this.panel,s.keyframes,s.options),e(this.overlay,o.keyframes,o.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),u(this)),await Promise.all([t(this.drawer),t(this.overlay)]);const a=p(this,`drawer.hide${g(this.placement)}`,{dir:this.localize.dir()}),s=p(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([e(this.overlay,s.keyframes,s.options).then((()=>{this.overlay.hidden=!0})),e(this.panel,a.keyframes,a.options).then((()=>{this.panel.hidden=!0}))]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),f(this)),this.open&&this.contained&&(this.modal.deactivate(),u(this))}async show(){if(!this.open)return this.open=!0,w(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,w(this,"sd-after-hide")}render(){return o`<div part="base" class="${i("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}"><div part="overlay" class="${i("block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${i("absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[--width] h-full",start:"top-0 end-auto bottom-auto start-0 w-[--width] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.label}" aria-labelledby="${m(this.noHeader?void 0:"title")}" tabindex="0">${this.noHeader?"":o`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-3-22-10-button variant="tertiary" size="lg" part="close-button" @click="${()=>this.requestClose("close-button")}"><sd-3-22-10-icon label="${this.localize.term("close")}" name="close" library="system"></sd-3-22-10-icon></sd-3-22-10-button></div></header>`}<div part="body" class="flex-auto block px-4"><slot></slot></div><footer part="footer" class="${i(this.hasSlotController.test("footer")?"text-left p-4":"hidden")}"><slot name="footer"></slot></footer></div></div>`}};C.styles=[a.styles,r,n`:host{--width:25rem;display:contents}:host([contained]){z-index:initial}:host(:not([contained])){z-index:var(--sd-z-index-drawer,700)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}`],j([l("[part=base]")],C.prototype,"drawer",2),j([l("[part=panel]")],C.prototype,"panel",2),j([l("[part=overlay]")],C.prototype,"overlay",2),j([d({type:Boolean,reflect:!0})],C.prototype,"open",2),j([d({attribute:"label",reflect:!0})],C.prototype,"label",2),j([d({reflect:!0})],C.prototype,"placement",2),j([d({type:Boolean,reflect:!0})],C.prototype,"contained",2),j([d({attribute:"no-header",type:Boolean})],C.prototype,"noHeader",2),j([v("open",{waitUntilFirstUpdate:!0})],C.prototype,"handleOpenChange",1),j([v("contained",{waitUntilFirstUpdate:!0})],C.prototype,"handleNoModalChange",1),C=j([h("sd-3-22-10-drawer")],C),c("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),c("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}}),c("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),c("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}}),c("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),c("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),c("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});export{C as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,L as t,x as n,t as i,c as o,i as s,e as a,n as r,a as d}from"./solid-components2.js";import{s as l,a as p}from"./animate.js";import{g as h,s as c}from"./animation-registry.js";import{g as u}from"./tabbable.js";import{s as m}from"./scroll.js";import{w as g}from"./event.js";import{w}from"./watch.js";var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,f=(e,t,n,i)=>{for(var o,s=i>1?void 0:i?v(t,n):t,a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i?o(t,n,s):o(s))||s);return i&&s&&y(t,n,s),s};let b=class extends e{constructor(){super(...arguments),this.localize=new t(this),this.open=!1,this.rounded=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.noAutoSize=!1,this.noFlip=!1,this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==e?void 0:e.focus)&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"sd-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){var t;if("Tab"===e.key){if(this.open&&"sd-menu-item"===(null==(t=document.activeElement)?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{var e,t,n,i,o,s,a,r,d,l,p,h;const c=(null==(o=null==(i=null==(n=null==(t=null==(e=document.activeElement)?void 0:e.shadowRoot)?void 0:t.activeElement)?void 0:n.shadowRoot)?void 0:i.activeElement)?void 0:o.getRootNode())instanceof ShadowRoot?null==(d=null==(r=null==(a=null==(s=document.activeElement)?void 0:s.shadowRoot)?void 0:a.activeElement)?void 0:r.shadowRoot)?void 0:d.activeElement:(null==(l=this.containingElement)?void 0:l.getRootNode())instanceof ShadowRoot?null==(h=null==(p=document.activeElement)?void 0:p.shadowRoot)?void 0:h.activeElement:document.activeElement;(!this.containingElement||(null==c?void 0:c.closest(this.containingElement.tagName.toLowerCase()))!==this.containingElement)&&this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(e){const t=e.target;m(t,this.panel)}handlePanelSelect(e){const t=e.target;!this.stayOpenOnSelect&&"sd-menu"===t.tagName.toLowerCase()&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if([" ","Enter"].includes(e.key))return e.preventDefault(),void this.handleTriggerClick();const t=this.getMenu();if(t){const n=t.defaultSlot.assignedElements({flatten:!0}),i=n[0],o=n[n.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),n.length>0&&requestAnimationFrame((()=>{("ArrowDown"===e.key||"Home"===e.key)&&(t.setCurrentItem(i),i.focus()),("ArrowUp"===e.key||"End"===e.key)&&(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>u(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"sd-3-22-
|
1
|
+
import{S as e,L as t,x as n,t as i,c as o,i as s,e as a,n as r,a as d}from"./solid-components2.js";import{s as l,a as p}from"./animate.js";import{g as h,s as c}from"./animation-registry.js";import{g as u}from"./tabbable.js";import{s as m}from"./scroll.js";import{w as g}from"./event.js";import{w}from"./watch.js";var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,f=(e,t,n,i)=>{for(var o,s=i>1?void 0:i?v(t,n):t,a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i?o(t,n,s):o(s))||s);return i&&s&&y(t,n,s),s};let b=class extends e{constructor(){super(...arguments),this.localize=new t(this),this.open=!1,this.rounded=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.noAutoSize=!1,this.noFlip=!1,this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==e?void 0:e.focus)&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"sd-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){var t;if("Tab"===e.key){if(this.open&&"sd-menu-item"===(null==(t=document.activeElement)?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{var e,t,n,i,o,s,a,r,d,l,p,h;const c=(null==(o=null==(i=null==(n=null==(t=null==(e=document.activeElement)?void 0:e.shadowRoot)?void 0:t.activeElement)?void 0:n.shadowRoot)?void 0:i.activeElement)?void 0:o.getRootNode())instanceof ShadowRoot?null==(d=null==(r=null==(a=null==(s=document.activeElement)?void 0:s.shadowRoot)?void 0:a.activeElement)?void 0:r.shadowRoot)?void 0:d.activeElement:(null==(l=this.containingElement)?void 0:l.getRootNode())instanceof ShadowRoot?null==(h=null==(p=document.activeElement)?void 0:p.shadowRoot)?void 0:h.activeElement:document.activeElement;(!this.containingElement||(null==c?void 0:c.closest(this.containingElement.tagName.toLowerCase()))!==this.containingElement)&&this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(e){const t=e.target;m(t,this.panel)}handlePanelSelect(e){const t=e.target;!this.stayOpenOnSelect&&"sd-menu"===t.tagName.toLowerCase()&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if([" ","Enter"].includes(e.key))return e.preventDefault(),void this.handleTriggerClick();const t=this.getMenu();if(t){const n=t.defaultSlot.assignedElements({flatten:!0}),i=n[0],o=n[n.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),n.length>0&&requestAnimationFrame((()=>{("ArrowDown"===e.key||"Home"===e.key)&&(t.setCurrentItem(i),i.focus()),("ArrowUp"===e.key||"End"===e.key)&&(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>u(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"sd-3-22-10-button":case"sd-3-22-10-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,g(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,g(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-3-22-10-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-3-22-10-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await l(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:t}=h(this,"dropdown.show",{dir:this.localize.dir()});await p(this.popup.popup,e,t),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await l(this);const{keyframes:e,options:t}=h(this,"dropdown.hide",{dir:this.localize.dir()});await p(this.popup.popup,e,t),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return n`<sd-3-22-10-popup part="base" id="dropdown" placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10" ?active="${this.open}"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${i("shadow bg-white",this.open?"block pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-3-22-10-popup>`}};b.styles=[e.styles,o,s`:host{display:inline-block}#dropdown::part(popup){z-index:var(--sd-z-index-dropdown,900)}#dropdown[data-current-placement^=top]::part(popup){transform-origin:bottom}#dropdown[data-current-placement^=bottom]::part(popup){transform-origin:top}#dropdown[data-current-placement^=left]::part(popup){transform-origin:right}#dropdown[data-current-placement^=right]::part(popup){transform-origin:left}:host(:not([no-auto-size])) ::slotted(:not([slot=trigger])){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`],f([a("#dropdown")],b.prototype,"popup",2),f([a("[part=trigger]")],b.prototype,"trigger",2),f([a("[part=panel]")],b.prototype,"panel",2),f([r({type:Boolean,reflect:!0})],b.prototype,"open",2),f([r({type:Boolean,reflect:!0})],b.prototype,"rounded",2),f([r({reflect:!0})],b.prototype,"placement",2),f([r({type:Boolean,reflect:!0})],b.prototype,"disabled",2),f([r({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],b.prototype,"stayOpenOnSelect",2),f([r({attribute:!1})],b.prototype,"containingElement",2),f([r({type:Number})],b.prototype,"distance",2),f([r({type:Number})],b.prototype,"skidding",2),f([r({type:Boolean,reflect:!0,attribute:"no-auto-size"})],b.prototype,"noAutoSize",2),f([r({type:Boolean,reflect:!0,attribute:"no-flip"})],b.prototype,"noFlip",2),f([r({type:Boolean})],b.prototype,"hoist",2),f([w("open",{waitUntilFirstUpdate:!0})],b.prototype,"handleOpenChange",1),b=f([d("sd-3-22-10-dropdown")],b),c("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),c("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{b as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,L as t,x as o,t as i,r as s,c as n,i as r,e as a,n as l,a as d}from"./solid-components2.js";import{w as c}from"./event.js";import{w as h}from"./watch.js";import{I as p}from"./interactive.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,v=(e,t,o,i)=>{for(var s,n=i>1?void 0:i?g(t,o):t,r=e.length-1;r>=0;r--)(s=e[r])&&(n=(i?s(t,o,n):s(n))||n);return i&&n&&m(t,o,n),n};let u=class extends e{constructor(){super(...arguments),this.open=!1,this.inverted=!1,this.localize=new t(this)}updateMaxHeight(){var e;const t=null==(e=this.contentPreview)?void 0:e.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${t}px`),this.style.setProperty("--max-height",t)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}onOpenChange(){this.open?(this.emit("sd-show"),this.updateComplete.then((()=>{this.emit("sd-after-show")}))):(this.emit("sd-hide"),this.updateComplete.then((()=>{this.emit("sd-after-hide")}))),this.details.setAttribute("open",this.open.toString())}async show(){if(!this.open)return this.onToggleClick(),c(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),c(this,"sd-after-hide")}render(){return o`<details part="details"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details><button part="toggle" class="${i("sd-interactive sd-interactive--reset !h-full !justify-center !w-full !text-base !flex !items-center !underline !underline-offset-2 !toggle",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}">${this.open?o`<slot name="toggle-open"><sd-3-22-
|
1
|
+
import{S as e,L as t,x as o,t as i,r as s,c as n,i as r,e as a,n as l,a as d}from"./solid-components2.js";import{w as c}from"./event.js";import{w as h}from"./watch.js";import{I as p}from"./interactive.js";var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,v=(e,t,o,i)=>{for(var s,n=i>1?void 0:i?g(t,o):t,r=e.length-1;r>=0;r--)(s=e[r])&&(n=(i?s(t,o,n):s(n))||n);return i&&n&&m(t,o,n),n};let u=class extends e{constructor(){super(...arguments),this.open=!1,this.inverted=!1,this.localize=new t(this)}updateMaxHeight(){var e;const t=null==(e=this.contentPreview)?void 0:e.scrollHeight.toString();this.style.setProperty("--max-height-pixel",`${t}px`),this.style.setProperty("--max-height",t)}onToggleClick(){this.updateMaxHeight(),this.open=!this.open}onOpenChange(){this.open?(this.emit("sd-show"),this.updateComplete.then((()=>{this.emit("sd-after-show")}))):(this.emit("sd-hide"),this.updateComplete.then((()=>{this.emit("sd-after-hide")}))),this.details.setAttribute("open",this.open.toString())}async show(){if(!this.open)return this.onToggleClick(),c(this,"sd-after-show")}async hide(){if(this.open)return this.onToggleClick(),c(this,"sd-after-hide")}render(){return o`<details part="details"><summary part="summary" aria-hidden="true" class="cursor-pointer overflow-hidden list-none"><slot name="clone"></slot></summary><div part="content" class="content content-preview overflow-hidden relative"><slot></slot></div></details><button part="toggle" class="${i("sd-interactive sd-interactive--reset !h-full !justify-center !w-full !text-base !flex !items-center !underline !underline-offset-2 !toggle",this.inverted&&"sd-interactive--inverted",this.inverted?"!focus-visible:focus-outline-inverted":"!focus-visible:focus-outline")}" @click="${this.onToggleClick}">${this.open?o`<slot name="toggle-open"><sd-3-22-10-icon class="mr-2 text-xl" library="system" name="chevron-up"></sd-3-22-10-icon>${this.localize.term("showLess")}</slot>`:o`<slot name="toggle-closed"><sd-3-22-10-icon class="mr-2 text-xl" library="system" name="chevron-down"></sd-3-22-10-icon>${this.localize.term("showMore")}</slot>`}</button>`}firstUpdated(){this.cloneContentToLightDOM(),this.details.setAttribute("open",this.open.toString())}cloneContentToLightDOM(){const e=document.createElement("div");e.setAttribute("slot","clone"),Array.from(this.childNodes).forEach((t=>{const o=t.cloneNode(!0);e.appendChild(o)})),this.appendChild(e)}};u.styles=[e.styles,s(p),n,r`:host{--gradient-color-start:rgba(255, 255, 255, 0);--gradient-color-end:rgba(255, 255, 255, 1);--component-expandable-max-block-size:90px;--gradient-height:24px;--gradient:var(--gradient-color-start) 0%,var(--gradient-color-end) 80%,var(--gradient-color-end) 100%;position:relative;display:inline-block;width:100%}.toggle::-moz-focus-inner{border-style:none;padding:var(--sd-spacing-0,0)}details>summary::-webkit-details-marker,details[open] summary{display:none}summary{max-block-size:var(--component-expandable-max-block-size)}:host([open]) summary{max-block-size:var(--max-height-pixel,1000vh)}.content{max-block-size:var(--component-expandable-max-block-size)}:host([open]) .content{max-block-size:var(--max-height-pixel,1000vh)}:host(:not([open])) .content::after{position:absolute;bottom:var(--sd-spacing-0,0);left:var(--sd-spacing-0,0);display:block;width:100%;content:' ';height:var(--gradient-height);background:linear-gradient(180deg,var(--gradient))}:host([inverted]:not([open])) .content::after{background:var(--gradient-vertical-transparent-primary,linear-gradient(180deg,rgba(0,53,142,0) 0,#00358e 80%,#00358e 100%))}`],v([a(".content-preview")],u.prototype,"contentPreview",2),v([a("details")],u.prototype,"details",2),v([l({type:Boolean,reflect:!0})],u.prototype,"open",2),v([l({type:Boolean,reflect:!0})],u.prototype,"inverted",2),v([h("open",{waitUntilFirstUpdate:!0})],u.prototype,"onOpenChange",1),u=v([d("sd-3-22-10-expandable")],u);export{u as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as r,t as a,c as i,i as e,e as o,n,a as l}from"./solid-components2.js";var d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(t,r,a,i)=>{for(var e,o=i>1?void 0:i?c(r,a):r,n=t.length-1;n>=0;n--)(e=t[n])&&(o=(i?e(r,a,o):e(o))||o);return i&&o&&d(r,a,o),o};let f=class extends t{constructor(){super(...arguments),this.activation="click hover",this.flipDirection="horizontal",this.frontVariant="empty",this.backVariant="empty"}connectedCallback(){super.connectedCallback()}flipFront(){this.front.classList.add("clicked--front"),this.back.classList.add("clicked--back"),this.emit("sd-flip-front"),this.back.focus()}flipBack(){this.front.classList.remove("clicked--front"),this.back.classList.remove("clicked--back"),this.emit("sd-flip-back"),this.front.focus()}handleFrontClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipFront()}handleBackClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipBack()}handleFrontKeydown(t){"Enter"===t.code&&this.front===t.target&&this.flipFront()}handleBackKeydown(t){"Enter"===t.code&&this.back===t.target&&this.flipBack()}render(){return r`<div part="base" class="${a("flip-card relative h-full w-full")}"><div part="front" tabindex="0" class="${a("flip-card__side flip-card__side--front overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.frontVariant&&"bg-primary","primary-100"===this.frontVariant&&"bg-primary-100","gradient-dark-bottom"===this.frontVariant||"gradient-light-bottom"===this.frontVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleFrontClick}" @keydown="${this.handleFrontKeydown}"><div part="media-front" class="${a("absolute h-full w-full -z-20",("primary"===this.frontVariant||"primary-100"===this.frontVariant)&&"hidden")}"><slot name="media-front"></slot></div><div part="front-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.frontVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.frontVariant])}"><slot name="front"></slot></div><div part="front-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.frontVariant])}"></div></div><div part="back" tabindex="0" class="${a("flip-card__side flip-card__side--back overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.backVariant&&"bg-primary","primary-100"===this.backVariant&&"bg-primary-100","gradient-dark-bottom"===this.backVariant||"gradient-light-bottom"===this.backVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleBackClick}" @keydown="${this.handleBackKeydown}"><div part="media-back" class="${a("absolute h-full w-full -z-20",("primary"===this.backVariant||"primary-100"===this.backVariant)&&"hidden")}"><slot name="media-back"></slot></div><div part="back-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.backVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.backVariant])}"><slot name="back"></slot></div><div part="back-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.backVariant])}"></div></div></div>`}};f.styles=[i,t.styles,e`:host{display:block;aspect-ratio:3/4;--name:'';--height:480px;height:var(--height)}.flip-card{perspective:100rem}.flip-card__side{backface-visibility:hidden}.flip-card__side--back{transform:rotateY(180deg)}.clicked--front{transform:rotateY(-180deg)}.clicked--back{transform:rotateY(0)}.flip-card__side--back.vertical{transform:rotateX(180deg)}.clicked--front.vertical{transform:rotateX(-180deg)}.clicked--back.vertical{transform:rotateX(0)}.flip-card__gradient{flex:.4 1 0}@media (hover:hover) and (pointer:fine){.flip-card:hover .flip-card__side--front.hover{transform:rotateY(-180deg)}.flip-card:hover .flip-card__side--back.hover{transform:rotateY(0)}.flip-card:hover .flip-card__side--front.hover.vertical{transform:rotateX(-180deg)}.flip-card:hover .flip-card__side--back.hover.vertical{transform:rotateX(0)}}`],s([o('[part="front"]')],f.prototype,"front",2),s([o('[part="back"]')],f.prototype,"back",2),s([n({reflect:!0})],f.prototype,"activation",2),s([n({reflect:!0,attribute:"flip-direction"})],f.prototype,"flipDirection",2),s([n({type:String,reflect:!0,attribute:"front-variant"})],f.prototype,"frontVariant",2),s([n({type:String,reflect:!0,attribute:"back-variant"})],f.prototype,"backVariant",2),f=s([l("sd-3-22-
|
1
|
+
import{S as t,x as r,t as a,c as i,i as e,e as o,n,a as l}from"./solid-components2.js";var d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(t,r,a,i)=>{for(var e,o=i>1?void 0:i?c(r,a):r,n=t.length-1;n>=0;n--)(e=t[n])&&(o=(i?e(r,a,o):e(o))||o);return i&&o&&d(r,a,o),o};let f=class extends t{constructor(){super(...arguments),this.activation="click hover",this.flipDirection="horizontal",this.frontVariant="empty",this.backVariant="empty"}connectedCallback(){super.connectedCallback()}flipFront(){this.front.classList.add("clicked--front"),this.back.classList.add("clicked--back"),this.emit("sd-flip-front"),this.back.focus()}flipBack(){this.front.classList.remove("clicked--front"),this.back.classList.remove("clicked--back"),this.emit("sd-flip-back"),this.front.focus()}handleFrontClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipFront()}handleBackClick(t){const r=t.target;null===r.getAttribute("onclick")&&null===r.getAttribute("href")&&this.flipBack()}handleFrontKeydown(t){"Enter"===t.code&&this.front===t.target&&this.flipFront()}handleBackKeydown(t){"Enter"===t.code&&this.back===t.target&&this.flipBack()}render(){return r`<div part="base" class="${a("flip-card relative h-full w-full")}"><div part="front" tabindex="0" class="${a("flip-card__side flip-card__side--front overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.frontVariant&&"bg-primary","primary-100"===this.frontVariant&&"bg-primary-100","gradient-dark-bottom"===this.frontVariant||"gradient-light-bottom"===this.frontVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleFrontClick}" @keydown="${this.handleFrontKeydown}"><div part="media-front" class="${a("absolute h-full w-full -z-20",("primary"===this.frontVariant||"primary-100"===this.frontVariant)&&"hidden")}"><slot name="media-front"></slot></div><div part="front-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.frontVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.frontVariant])}"><slot name="front"></slot></div><div part="front-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.frontVariant])}"></div></div><div part="back" tabindex="0" class="${a("flip-card__side flip-card__side--back overflow-hidden transition-transform duration-1000 ease-in-out","flex focus-visible:focus-outline","absolute top-0 left-0 w-full h-full justify-end text-left","click hover"===this.activation&&"hover","primary"===this.backVariant&&"bg-primary","primary-100"===this.backVariant&&"bg-primary-100","gradient-dark-bottom"===this.backVariant||"gradient-light-bottom"===this.backVariant?"flex-col-reverse":"flex-col","vertical"===this.flipDirection&&"vertical")}" @click="${this.handleBackClick}" @keydown="${this.handleBackKeydown}"><div part="media-back" class="${a("absolute h-full w-full -z-20",("primary"===this.backVariant||"primary-100"===this.backVariant)&&"hidden")}"><slot name="media-back"></slot></div><div part="back-slot-container" class="${a("flex",{empty:"text-black",primary:"text-white","primary-100":"text-black","gradient-light-top":"text-black","gradient-light-bottom":"text-black","gradient-dark-top":"text-white","gradient-dark-bottom":"text-white"}[this.backVariant],{empty:"",primary:"","primary-100":"","gradient-light-top":"bg-gradient-to-b from-white/75 to-white/60","gradient-light-bottom":"bg-gradient-to-t from-white/75 to-white/60","gradient-dark-top":"bg-gradient-to-b from-primary-800/75 to-primary-800/60","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/75 to-primary-800/60"}[this.backVariant])}"><slot name="back"></slot></div><div part="back-secondary-gradient" class="${a("flip-card__gradient",{empty:"mb-auto",primary:"mb-auto","primary-100":"mb-auto","gradient-light-top":"bg-gradient-to-b from-white/60 to-40% mb-auto","gradient-light-bottom":"bg-gradient-to-t from-white/60 to-40% mt-auto","gradient-dark-top":"bg-gradient-to-b from-primary-800/60 to-40% mb-auto","gradient-dark-bottom":"bg-gradient-to-t from-primary-800/60 to-40% mt-auto"}[this.backVariant])}"></div></div></div>`}};f.styles=[i,t.styles,e`:host{display:block;aspect-ratio:3/4;--name:'';--height:480px;height:var(--height)}.flip-card{perspective:100rem}.flip-card__side{backface-visibility:hidden}.flip-card__side--back{transform:rotateY(180deg)}.clicked--front{transform:rotateY(-180deg)}.clicked--back{transform:rotateY(0)}.flip-card__side--back.vertical{transform:rotateX(180deg)}.clicked--front.vertical{transform:rotateX(-180deg)}.clicked--back.vertical{transform:rotateX(0)}.flip-card__gradient{flex:.4 1 0}@media (hover:hover) and (pointer:fine){.flip-card:hover .flip-card__side--front.hover{transform:rotateY(-180deg)}.flip-card:hover .flip-card__side--back.hover{transform:rotateY(0)}.flip-card:hover .flip-card__side--front.hover.vertical{transform:rotateX(-180deg)}.flip-card:hover .flip-card__side--back.hover.vertical{transform:rotateX(0)}}`],s([o('[part="front"]')],f.prototype,"front",2),s([o('[part="back"]')],f.prototype,"back",2),s([n({reflect:!0})],f.prototype,"activation",2),s([n({reflect:!0,attribute:"flip-direction"})],f.prototype,"flipDirection",2),s([n({type:String,reflect:!0,attribute:"front-variant"})],f.prototype,"frontVariant",2),s([n({type:String,reflect:!0,attribute:"back-variant"})],f.prototype,"backVariant",2),f=s([l("sd-3-22-10-flipcard")],f);export{f as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{x as t}from"./solid-components2.js";const e=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap;class a{constructor(t,i){this.handleFormData=t=>{const e=this.options.disabled(this.host),i=this.options.name(this.host),s=this.options.value(this.host),o="sd-3-22-
|
1
|
+
import{x as t}from"./solid-components2.js";const e=new WeakMap,i=new WeakMap,s=new WeakMap,o=new WeakMap;class a{constructor(t,i){this.handleFormData=t=>{const e=this.options.disabled(this.host),i=this.options.name(this.host),s=this.options.value(this.host),o="sd-3-22-10-button"===this.host.tagName.toLowerCase();!e&&!o&&"string"==typeof i&&i.length>0&&typeof s<"u"&&(Array.isArray(s)?s.forEach((e=>{t.formData.append(i,e.toString())})):t.formData.append(i,s.toString()))},this.handleFormSubmit=t=>{var i,s;const o=this.options.disabled(this.host),a=this.options.reportValidity;if(this.form&&!this.form.noValidate&&(null==(i=e.get(this.form))||i.forEach((t=>{this.setUserInteracted(t,!0)}))),this.form&&!this.form.noValidate&&!o&&!a(this.host)){t.preventDefault(),t.stopImmediatePropagation();const e=null==(s=this.form)?void 0:s.querySelectorAll("[data-invalid]");Array.from(e).filter((t=>"sd-3-22-10-radio-group"===t.tagName.toLowerCase())).forEach((t=>{var e,i;null==(i=null==(e=t.shadowRoot)?void 0:e.querySelector("input"))||i.dispatchEvent(new Event("invalid"))})),null!=e&&e.length&&e[0].focus()}},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),o.set(this.host,[])},this.handleInteraction=t=>{const e=o.get(this.host);e.includes(t.type)||e.push(t.type),e.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.fakeUserInteraction=()=>{this.setUserInteracted(this.host,!0)},(this.host=t).addController(this),this.options={form:t=>{if(t.hasAttribute("form")&&""!==t.getAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");if(i)return e.getElementById(i)}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>t.disabled??!1,reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),setValue:(t,e)=>t.value=e,assumeInteractionOn:["sd-3-22-10-input"],...i}}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),o.set(this.host,[]),this.options.assumeInteractionOn.forEach((t=>{this.host.addEventListener(t,this.handleInteraction)}))}hostDisconnected(){this.detachForm(),o.delete(this.host),this.options.assumeInteractionOn.forEach((t=>{this.host.removeEventListener(t,this.handleInteraction)}))}hostUpdated(){var t;const e=this.options.form(this.host);e||this.detachForm(),e&&this.form!==e&&(this.detachForm(),this.attachForm(e)),this.host.hasUpdated&&(this.setValidity(null==(t=this.host)?void 0:t.validity.valid),this.updateValidityStyle())}attachForm(t){t?(this.form=t,e.has(this.form)?e.get(this.form).add(this.host):e.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),i.has(this.form)||(i.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&(null==(t=e.get(this.form))||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),i.has(this.form)&&(this.form.reportValidity=i.get(this.form),i.delete(this.form))),this.form=void 0}reportFormValidity(){if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){s.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&(i.name=e.name,i.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}))),this.form.append(i),i.click(),i.remove()}}updateValidityStyle(){this.host.hasAttribute("data-user-valid")&&this.host.checkValidity()?(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!0),this.host.showInvalidStyle=!1):this.host.hasAttribute("data-user-invalid")&&!this.host.checkValidity()?(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!0):(void 0!==this.host.showValidStyle&&(this.host.showValidStyle=!1),this.host.showInvalidStyle=!1)}getForm(){return this.form??null}renderInvalidMessage(){return t`<div id="invalid-message" class="text-error text-sm mt-2 text-left" part="invalid-message" aria-live="polite" ?hidden="${!this.host.showInvalidStyle}"></div>`}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var e;const i=this.host,o=!!s.get(i),a=!!i.required;null!=(e=this.form)&&e.noValidate?(i.removeAttribute("data-required"),i.removeAttribute("data-optional"),i.removeAttribute("data-invalid"),i.removeAttribute("data-valid"),i.removeAttribute("data-user-invalid"),i.removeAttribute("data-user-valid"),i.removeAttribute("aria-invalid")):(i.toggleAttribute("data-required",a),i.toggleAttribute("data-optional",!a),i.toggleAttribute("data-invalid",!t),i.toggleAttribute("data-valid",t),i.toggleAttribute("data-user-invalid",!t&&o),i.toggleAttribute("data-user-valid",t&&o),i.setAttribute("aria-invalid",(!t).toString()))}updateValidity(){const t=this.host;this.setValidity(null==t?void 0:t.validity.valid)}emitInvalidEvent(t){null==t||t.preventDefault();const e=new CustomEvent("sd-invalid",{bubbles:!1,composed:!1,cancelable:!0,detail:{}});t||e.preventDefault()}}const r=Object.freeze({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1}),h=Object.freeze({...r,valid:!1,valueMissing:!0}),n=Object.freeze({...r,valid:!1,customError:!0});export{a as F,h as a,n as c,r as v};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as e,x as t,c as r,i as s,n as a,a as i}from"./solid-components2.js";import{d}from"./debounce.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=(e,t,r,s)=>{for(var a,i=s>1?void 0:s?n(t,r):t,d=e.length-1;d>=0;d--)(a=e[d])&&(i=(s?a(t,r,i):a(i))||i);return s&&i&&l(t,r,i),i};let h=class extends e{constructor(){super(...arguments),this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setCalculatedHeightProperty=this.setCalculatedHeightProperty.bind(this),this.addResizeObserver=this.addResizeObserver.bind(this)}firstUpdated(){this.toggleHeightCalculation()}toggleHeightCalculation(){var e;this.fixed?(this.setCalculatedHeightProperty(),this.addResizeObserver()):(this.setCalculatedHeightProperty(),null==(e=this.resizeObserver)||e.disconnect(),this.resizeObserver=void 0)}disconnectedCallback(){super.disconnectedCallback()}updated(e){super.updated(e),e.has("fixed")&&this.toggleHeightCalculation()}onResize(){this.fixed&&this.setCalculatedHeightProperty()}addResizeObserver(){this.resizeObserver=new ResizeObserver((()=>{this.onResize()})),this.refHeaderElement&&this.resizeObserver.observe(this.refHeaderElement)}setCalculatedHeightProperty(){this.fixed&&this.refHeaderElement?document.documentElement.style.setProperty("--sd-3-22-
|
1
|
+
import{S as e,x as t,c as r,i as s,n as a,a as i}from"./solid-components2.js";import{d}from"./debounce.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=(e,t,r,s)=>{for(var a,i=s>1?void 0:s?n(t,r):t,d=e.length-1;d>=0;d--)(a=e[d])&&(i=(s?a(t,r,i):a(i))||i);return s&&i&&l(t,r,i),i};let h=class extends e{constructor(){super(...arguments),this.fixed=!1}connectedCallback(){super.connectedCallback(),this.setCalculatedHeightProperty=this.setCalculatedHeightProperty.bind(this),this.addResizeObserver=this.addResizeObserver.bind(this)}firstUpdated(){this.toggleHeightCalculation()}toggleHeightCalculation(){var e;this.fixed?(this.setCalculatedHeightProperty(),this.addResizeObserver()):(this.setCalculatedHeightProperty(),null==(e=this.resizeObserver)||e.disconnect(),this.resizeObserver=void 0)}disconnectedCallback(){super.disconnectedCallback()}updated(e){super.updated(e),e.has("fixed")&&this.toggleHeightCalculation()}onResize(){this.fixed&&this.setCalculatedHeightProperty()}addResizeObserver(){this.resizeObserver=new ResizeObserver((()=>{this.onResize()})),this.refHeaderElement&&this.resizeObserver.observe(this.refHeaderElement)}setCalculatedHeightProperty(){this.fixed&&this.refHeaderElement?document.documentElement.style.setProperty("--sd-3-22-10-header-calculated-height",`${this.refHeaderElement.clientHeight}px`):document.documentElement.style.removeProperty("--sd-3-22-10-header-calculated-height")}render(){return t`<header class="w-full bg-white relative" role="banner" @slotchange="${this.handleSlotChange}"><div part="main" class="relative mx-auto my-0 box-border"><slot></slot></div></header>`}handleSlotChange(e){e.target.assignedElements().length>0&&(this.refHeaderElement=e.currentTarget,this.setCalculatedHeightProperty())}};h.styles=[e.styles,r,s`:host{display:block}:host([fixed]){position:fixed;left:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);width:100%}:host([fixed]) header::after{content:'';position:absolute;left:var(--sd-spacing-0,0);right:var(--sd-spacing-0,0);top:100%;height:var(--sd-spacing-2,.5rem);background:var(--gradient-vertical-black-40-transparent,linear-gradient(0deg,#18181800 50%,#18181866 100%))}[part=main]{width:var(--sd-3-22-10-header-inner-width);max-width:var(--sd-3-22-10-header-inner-max-width);padding:var(--sd-3-22-10-header-padding,12px 16px)}`],o([a({reflect:!0,type:Boolean})],h.prototype,"fixed",2),o([d(100)],h.prototype,"onResize",1),h=o([i("sd-3-22-10-header")],h);export{h as default};
|
@@ -8,4 +8,4 @@ import{T as t,w as e,S as r,f as s,u as i,g as o,x as a,c as l,i as n,n as c,a a
|
|
8
8
|
* @license
|
9
9
|
* Copyright 2017 Google LLC
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
-
*/class f extends m{}f.directiveName="unsafeSVG",f.resultType=2;const w=u(f);var x=Object.defineProperty,j=Object.getOwnPropertyDescriptor,C=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?j(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&x(e,r,o),o};let T,_=class extends r{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),s(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),i(this)}getUrl(){const t=o(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=o(this.library),r=this.getUrl();if(T||(T=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=T.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return a`${w(this.svg)}`}};_.styles=[l,n`:host{width:1em;height:1em;box-sizing:content-box!important;display:inline-block}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity))}:host([color=white]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity))}`],C([d()],_.prototype,"svg",2),C([c({reflect:!0})],_.prototype,"name",2),C([c()],_.prototype,"src",2),C([c()],_.prototype,"label",2),C([c({reflect:!0})],_.prototype,"library",2),C([c({reflect:!0})],_.prototype,"color",2),C([y("label")],_.prototype,"handleLabelChange",1),C([y(["name","src","library"])],_.prototype,"setIcon",1),_=C([h("sd-3-22-
|
11
|
+
*/class f extends m{}f.directiveName="unsafeSVG",f.resultType=2;const w=u(f);var x=Object.defineProperty,j=Object.getOwnPropertyDescriptor,C=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?j(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&x(e,r,o),o};let T,_=class extends r{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),s(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),i(this)}getUrl(){const t=o(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=o(this.library),r=this.getUrl();if(T||(T=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=T.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return a`${w(this.svg)}`}};_.styles=[l,n`:host{width:1em;height:1em;box-sizing:content-box!important;display:inline-block}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity))}:host([color=white]) svg{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity))}`],C([d()],_.prototype,"svg",2),C([c({reflect:!0})],_.prototype,"name",2),C([c()],_.prototype,"src",2),C([c()],_.prototype,"label",2),C([c({reflect:!0})],_.prototype,"library",2),C([c({reflect:!0})],_.prototype,"color",2),C([y("label")],_.prototype,"handleLabelChange",1),C([y(["name","src","library"])],_.prototype,"setIcon",1),_=C([h("sd-3-22-10-icon")],_);const k=Object.freeze(Object.defineProperty({__proto__:null,get default(){return _}},Symbol.toStringTag,{value:"Module"}));export{_ as S,k as i,v as o};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,c as r,i as s,n as o,a as i}from"./solid-components2.js";import{requestInclude as a}from"./request2.js";import{w as c}from"./watch.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,p=(t,e,r,s)=>{for(var o,i=s>1?void 0:s?n(e,r):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s?o(e,r,i):o(i))||i);return s&&i&&l(e,r,i),i};let d=class extends t{constructor(){super(...arguments),this.mode="cors",this.allowScripts=!1}executeScript(t){const e=document.createElement("script");[...t.attributes].forEach((t=>e.setAttribute(t.name,t.value))),e.textContent=t.textContent,t.parentNode.replaceChild(e,t)}async handleSrcChange(){try{const t=this.src,e=await a(t,this.mode);if(t!==this.src)return;if(!e.ok)return void this.emit("sd-error",{detail:{status:e.status}});this.innerHTML=e.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach((t=>this.executeScript(t))),this.emit("sd-load")}catch{this.emit("sd-error",{detail:{status:-1}})}}render(){return e`<slot></slot>`}};d.styles=[r,s`:host{display:block}`],p([o()],d.prototype,"src",2),p([o()],d.prototype,"mode",2),p([o({attribute:"allow-scripts",type:Boolean})],d.prototype,"allowScripts",2),p([c("src")],d.prototype,"handleSrcChange",1),d=p([i("sd-3-22-
|
1
|
+
import{S as t,x as e,c as r,i as s,n as o,a as i}from"./solid-components2.js";import{requestInclude as a}from"./request2.js";import{w as c}from"./watch.js";var l=Object.defineProperty,n=Object.getOwnPropertyDescriptor,p=(t,e,r,s)=>{for(var o,i=s>1?void 0:s?n(e,r):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s?o(e,r,i):o(i))||i);return s&&i&&l(e,r,i),i};let d=class extends t{constructor(){super(...arguments),this.mode="cors",this.allowScripts=!1}executeScript(t){const e=document.createElement("script");[...t.attributes].forEach((t=>e.setAttribute(t.name,t.value))),e.textContent=t.textContent,t.parentNode.replaceChild(e,t)}async handleSrcChange(){try{const t=this.src,e=await a(t,this.mode);if(t!==this.src)return;if(!e.ok)return void this.emit("sd-error",{detail:{status:e.status}});this.innerHTML=e.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach((t=>this.executeScript(t))),this.emit("sd-load")}catch{this.emit("sd-error",{detail:{status:-1}})}}render(){return e`<slot></slot>`}};d.styles=[r,s`:host{display:block}`],p([o()],d.prototype,"src",2),p([o()],d.prototype,"mode",2),p([o({attribute:"allow-scripts",type:Boolean})],d.prototype,"allowScripts",2),p([c("src")],d.prototype,"handleSrcChange",1),d=p([i("sd-3-22-10-include")],d);export{d as default};
|
@@ -3,4 +3,4 @@ import"./icon.js";import{T as t,w as e,S as s,L as i,x as l,t as a,c as o,i as n
|
|
3
3
|
* @license
|
4
4
|
* Copyright 2017 Google LLC
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
6
|
-
*/const x=(t,e)=>{var s;const i=t._$AN;if(void 0===i)return!1;for(const t of i)null==(s=t._$AO)||s.call(t,e,!1),x(t,e);return!0},C=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},k=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),S(e)}};function A(t){void 0!==this._$AN?(C(this),this._$AM=t,k(this)):this._$AM=t}function V(t,e=!1,s=0){const i=this._$AH,l=this._$AN;if(void 0!==l&&0!==l.size)if(e)if(Array.isArray(i))for(let t=s;t<i.length;t++)x(i[t],!1),C(i[t]);else null!=i&&(x(i,!1),C(i));else x(this,t)}const S=t=>{t.type==f.CHILD&&(t._$AP??(t._$AP=V),t._$AQ??(t._$AQ=A))};class D extends v{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),k(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,i;t!==this.isConnected&&(this.isConnected=t,t?null==(s=this.reconnected)||s.call(this):null==(i=this.disconnected)||i.call(this)),e&&(x(this,t),C(this))}setValue(t){if(b(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const _=$(class extends D{constructor(t){if(super(t),this.handlePointerDown=t=>{0!==t.button||this.host.disabled||this.spinOnLongPressCallback(t)},this.handlePointerUp=t=>{null==t||t.preventDefault(),null==t||t.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)},t.type!==f.ELEMENT||!(t.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return t}update(t,[s]){return void 0===this.callbacks&&void 0===this.host&&(this.host=t.element,this.callbacks={...s},this.host.addEventListener("pointerdown",this.handlePointerDown)),e}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(t){var e;t.preventDefault(),t.stopPropagation(),this.timeout=setTimeout((()=>{this.timeout=void 0,this.interval=setInterval((()=>{this.callbacks.start()}),50)}),500),document.addEventListener("pointerup",this.handlePointerUp),null==(e=this.observer)||e.disconnect(),this.observer=new MutationObserver((t=>{t.forEach((t=>{"disabled"===t.attributeName&&this.stopSpinningAndCleanUp()}))})),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var t;clearInterval(this.interval),clearTimeout(this.timeout),null==(t=this.observer)||t.disconnect()}});var P,I=Object.defineProperty,T=Object.getOwnPropertyDescriptor,U=(t,e,s,i)=>{for(var l,a=i>1?void 0:i?T(e,s):e,o=t.length-1;o>=0;o--)(l=t[o])&&(a=(i?l(e,s,a):l(a))||a);return i&&a&&I(e,s,a),a};const z=!(null==(P=navigator.userAgentData)?void 0:P.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let E=class extends s{constructor(){super(...arguments),this.formControlController=new u(this),this.hasSlotController=new c(this,"help-text","label","left","right","message","placeholder"),this.localize=new i(this),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.type="text",this.size="lg",this.value="",this.defaultValue="",this.placeholder="",this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.spinButtons=!1,this.form="",this.name="",this.title="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0}get valueAsDate(){var t;return(null==(t=this.input)?void 0:t.valueAsDate)??null}set valueAsDate(t){const e=document.createElement("input");e.type="date",e.valueAsDate=t,this.value=e.value}get valueAsNumber(){var t;return(null==(t=this.input)?void 0:t.valueAsNumber)??parseFloat(this.value)}set valueAsNumber(t){const e=document.createElement("input");e.type="number",e.valueAsNumber=t,this.value=e.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(t){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleKeyDown(t){const e=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"===t.key&&!e&&setTimeout((()=>{!t.defaultPrevented&&!t.isComposing&&this.formControlController.submit()}))}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(void 0===this.min||null===this.min)return!1;const t="string"==typeof this.min?parseFloat(this.min):this.min;return this.valueAsNumber<=t}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(void 0===this.max||null===this.max)return!1;const t="string"==typeof this.max?parseFloat(this.max):this.max;return this.valueAsNumber>=t}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,s="none"){this.input.setSelectionRange(t,e,s)}setRangeText(t,e,s,i){this.input.setRangeText(t,e,s,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var t;return null==(t=this.input)?void 0:t.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),e=this.hasSlotController.test("help-text"),s=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),i=this.hasSlotController.test("right"),o=!!this.label||!!t,n=!!this.helpText||!!e,r=this.clearable&&!this.readonly&&("number"==typeof this.value||this.value.length>0),h=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",d="sm"===this.size?"text-sm":"text-base",p={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"}[h],u=this.disabled?"text-neutral-500":"text-primary",c={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return l`<div part="form-control" class="${a(this.disabled&&"pointer-events-none")}"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(o?"inline-block":"hidden",d)}" for="input" aria-hidden="${o?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="relative w-full"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",p)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-all","lg"===this.size?"py-2":"py-1",this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===h?"text-neutral-500":"text-black")}">${s?l`<slot name="left" part="left" class="${a("inline-flex","sm"===this.size?"mr-1":"mr-2",u,b)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700","sm"===this.size?"h-6":"h-8",d)}" type="${"password"===this.type&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${m(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${m(this.placeholder)}" minlength="${m(this.minlength)}" maxlength="${m(this.maxlength)}" min="${m(this.min)}" max="${m(this.max)}" step="${m(this.step)}" .value="${y(this.value)}" autocapitalize="${m("password"===this.type?"off":this.autocapitalize)}" autocomplete="${m("password"===this.type?"off":this.autocomplete)}" autocorrect="${m("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${m(this.pattern)}" enterkeyhint="${m(this.enterkeyhint)}" inputmode="${m(this.inputmode)}" aria-describedby="help-text invalid-message" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${r?l`<button part="clear-button" class="${a("flex justify-center ",c)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-22-9-icon class="${a("icon-fill-neutral-800",b)}" library="system" name="closing-round"></sd-3-22-9-icon></slot></button>`:""} ${this.passwordToggle&&"password"===this.type?l`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible?l`<slot name="show-password-icon"><sd-3-22-9-icon class="${a(u,c,b)}" library="system" name="eye"></sd-3-22-9-icon></slot>`:l`<slot name="hide-password-icon"><sd-3-22-9-icon class="${a(u,c,b)}" library="system" name="eye-crossed-out"></sd-3-22-9-icon></slot>`}</button>`:""} ${"date"!==this.type&&"datetime-local"!==this.type||z?"":l`<sd-3-22-9-icon class="${a(u,c,b)}" library="system" name="calendar"></sd-3-22-9-icon>`} ${"time"===this.type?l`<sd-3-22-9-icon class="${a(u,c,b)}" library="system" name="clock"></sd-3-22-9-icon>`:""} ${"search"===this.type?l`<button class="flex items-center" type="button" tabindex="-1"><sd-3-22-9-icon class="${a(u,c,b)}" library="system" name="magnifying-glass"></sd-3-22-9-icon></button>`:""} ${this.showInvalidStyle?l`<sd-3-22-9-icon part="invalid-icon" class="${a("text-error",c,b)}" library="system" name="risk"></sd-3-22-9-icon>`:""} ${this.showValidStyle&&this.styleOnValid?l`<sd-3-22-9-icon class="${a("text-success flex-shrink-0",c,b)}" library="system" name="status-check" part="valid-icon"></sd-3-22-9-icon>`:""} ${i?l`<slot name="right" part="right" class="${a("inline-flex",u,c,b)}"></slot>`:""} ${"number"===this.type&&this.spinButtons?l`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${_({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-3-22-9-icon library="global-resources" name="system/minus-round" label="Decrease value" class="${a(u,c,b)}"></sd-3-22-9-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${_({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-3-22-9-icon library="global-resources" name="system/plus-round" label="Decrease value" class="${a(u,c,b)}"></sd-3-22-9-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700",n?"block":"hidden")}" aria-hidden="${!n}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};E.styles=[o,s.styles,n`:host{position:relative;box-sizing:border-box;display:inline-block;width:100%;text-align:left}:host([vertical]){display:block}:host([required]) #label::after{content:' *'}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-3-22-9-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174) / var(--tw-text-opacity))}`],U([r("#input")],E.prototype,"input",2),U([r("#invalid-message")],E.prototype,"invalidMessage",2),U([g()],E.prototype,"hasFocus",2),U([g()],E.prototype,"showValidStyle",2),U([g()],E.prototype,"showInvalidStyle",2),U([h({reflect:!0})],E.prototype,"type",2),U([h({reflect:!0})],E.prototype,"size",2),U([h()],E.prototype,"inputmode",2),U([h()],E.prototype,"value",2),U([p()],E.prototype,"defaultValue",2),U([h()],E.prototype,"placeholder",2),U([h()],E.prototype,"label",2),U([h({attribute:"help-text"})],E.prototype,"helpText",2),U([h({type:Boolean})],E.prototype,"clearable",2),U([h({type:Boolean,reflect:!0})],E.prototype,"disabled",2),U([h({type:Boolean,reflect:!0})],E.prototype,"readonly",2),U([h({attribute:"password-toggle",type:Boolean})],E.prototype,"passwordToggle",2),U([h({attribute:"password-visible",type:Boolean})],E.prototype,"passwordVisible",2),U([h({attribute:"spin-buttons",type:Boolean})],E.prototype,"spinButtons",2),U([h({type:Number})],E.prototype,"minlength",2),U([h({type:Number})],E.prototype,"maxlength",2),U([h()],E.prototype,"min",2),U([h()],E.prototype,"max",2),U([h({reflect:!0})],E.prototype,"form",2),U([h()],E.prototype,"name",2),U([h()],E.prototype,"title",2),U([h({type:Boolean,reflect:!0})],E.prototype,"required",2),U([h()],E.prototype,"pattern",2),U([h()],E.prototype,"step",2),U([h()],E.prototype,"autocapitalize",2),U([h()],E.prototype,"autocorrect",2),U([h()],E.prototype,"autocomplete",2),U([h({type:Boolean})],E.prototype,"autofocus",2),U([h()],E.prototype,"enterkeyhint",2),U([h({type:Boolean,reflect:!0,attribute:"style-on-valid"})],E.prototype,"styleOnValid",2),U([h({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],E.prototype,"spellcheck",2),U([w("disabled",{waitUntilFirstUpdate:!0})],E.prototype,"handleDisabledChange",1),U([w("step",{waitUntilFirstUpdate:!0})],E.prototype,"handleStepChange",1),U([w("value",{waitUntilFirstUpdate:!0})],E.prototype,"handleValueChange",1),E=U([d("sd-3-22-9-input")],E);export{E as default};
|
6
|
+
*/const x=(t,e)=>{var s;const i=t._$AN;if(void 0===i)return!1;for(const t of i)null==(s=t._$AO)||s.call(t,e,!1),x(t,e);return!0},C=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},k=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),S(e)}};function A(t){void 0!==this._$AN?(C(this),this._$AM=t,k(this)):this._$AM=t}function V(t,e=!1,s=0){const i=this._$AH,l=this._$AN;if(void 0!==l&&0!==l.size)if(e)if(Array.isArray(i))for(let t=s;t<i.length;t++)x(i[t],!1),C(i[t]);else null!=i&&(x(i,!1),C(i));else x(this,t)}const S=t=>{t.type==f.CHILD&&(t._$AP??(t._$AP=V),t._$AQ??(t._$AQ=A))};class D extends v{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),k(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,i;t!==this.isConnected&&(this.isConnected=t,t?null==(s=this.reconnected)||s.call(this):null==(i=this.disconnected)||i.call(this)),e&&(x(this,t),C(this))}setValue(t){if(b(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}const _=$(class extends D{constructor(t){if(super(t),this.handlePointerDown=t=>{0!==t.button||this.host.disabled||this.spinOnLongPressCallback(t)},this.handlePointerUp=t=>{null==t||t.preventDefault(),null==t||t.stopPropagation(),this.timeout&&this.callbacks.start(),this.stopSpinningAndCleanUp(),this.callbacks.end(),document.removeEventListener("pointerup",this.handlePointerUp)},t.type!==f.ELEMENT||!(t.element instanceof HTMLButtonElement))throw new Error("The `longPress` directive must be used on an HTMLButtonElement.")}render(e){return t}update(t,[s]){return void 0===this.callbacks&&void 0===this.host&&(this.host=t.element,this.callbacks={...s},this.host.addEventListener("pointerdown",this.handlePointerDown)),e}disconnected(){this.stopSpinningAndCleanUp(),this.host.removeEventListener("pointerdown",this.handlePointerDown),document.removeEventListener("pointerup",this.handlePointerUp)}spinOnLongPressCallback(t){var e;t.preventDefault(),t.stopPropagation(),this.timeout=setTimeout((()=>{this.timeout=void 0,this.interval=setInterval((()=>{this.callbacks.start()}),50)}),500),document.addEventListener("pointerup",this.handlePointerUp),null==(e=this.observer)||e.disconnect(),this.observer=new MutationObserver((t=>{t.forEach((t=>{"disabled"===t.attributeName&&this.stopSpinningAndCleanUp()}))})),this.observer.observe(this.host,{attributes:!0})}stopSpinningAndCleanUp(){var t;clearInterval(this.interval),clearTimeout(this.timeout),null==(t=this.observer)||t.disconnect()}});var P,I=Object.defineProperty,T=Object.getOwnPropertyDescriptor,U=(t,e,s,i)=>{for(var l,a=i>1?void 0:i?T(e,s):e,o=t.length-1;o>=0;o--)(l=t[o])&&(a=(i?l(e,s,a):l(a))||a);return i&&a&&I(e,s,a),a};const z=!(null==(P=navigator.userAgentData)?void 0:P.brands.some((t=>t.brand.includes("Chromium"))))&&navigator.userAgent.includes("Firefox");let E=class extends s{constructor(){super(...arguments),this.formControlController=new u(this),this.hasSlotController=new c(this,"help-text","label","left","right","message","placeholder"),this.localize=new i(this),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.type="text",this.size="lg",this.value="",this.defaultValue="",this.placeholder="",this.label="",this.helpText="",this.clearable=!1,this.disabled=!1,this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.spinButtons=!1,this.form="",this.name="",this.title="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0}get valueAsDate(){var t;return(null==(t=this.input)?void 0:t.valueAsDate)??null}set valueAsDate(t){const e=document.createElement("input");e.type="date",e.valueAsDate=t,this.value=e.value}get valueAsNumber(){var t;return(null==(t=this.input)?void 0:t.valueAsNumber)??parseFloat(this.value)}set valueAsNumber(t){const e=document.createElement("input");e.type="number",e.valueAsNumber=t,this.value=e.value}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.input.value,this.emit("sd-change")}handleClearClick(t){this.value="",this.emit("sd-clear"),this.emit("sd-input"),this.emit("sd-change"),this.input.focus(),t.stopPropagation()}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.input.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleKeyDown(t){const e=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"===t.key&&!e&&setTimeout((()=>{!t.defaultPrevented&&!t.isComposing&&this.formControlController.submit()}))}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}isDecrementDisabled(){if(this.disabled||this.readonly)return!0;if(void 0===this.min||null===this.min)return!1;const t="string"==typeof this.min?parseFloat(this.min):this.min;return this.valueAsNumber<=t}isIncrementDisabled(){if(this.disabled||this.readonly)return!0;if(void 0===this.max||null===this.max)return!1;const t="string"==typeof this.max?parseFloat(this.max):this.max;return this.valueAsNumber>=t}handleStep(){this.handleInput(),this.input.focus()}handleStepUp(){this.stepUp(),this.handleStep()}handleStepDown(){this.stepDown(),this.handleStep()}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleStepChange(){this.input.step=String(this.step),this.formControlController.updateValidity()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,s="none"){this.input.setSelectionRange(t,e,s)}setRangeText(t,e,s,i){this.input.setRangeText(t,e,s,i),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}checkValidity(){var t;return null==(t=this.input)?void 0:t.checkValidity()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(t){this.input.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),e=this.hasSlotController.test("help-text"),s=(this.hasSlotController.test("description"),this.hasSlotController.test("left")),i=this.hasSlotController.test("right"),o=!!this.label||!!t,n=!!this.helpText||!!e,r=this.clearable&&!this.readonly&&("number"==typeof this.value||this.value.length>0),h=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",d="sm"===this.size?"text-sm":"text-base",p={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"}[h],u=this.disabled?"text-neutral-500":"text-primary",c={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],b={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return l`<div part="form-control" class="${a(this.disabled&&"pointer-events-none")}"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(o?"inline-block":"hidden",d)}" for="input" aria-hidden="${o?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="relative w-full"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",p)}"></div><div part="base" class="${a("px-4 flex flex-row items-center rounded-default transition-all","lg"===this.size?"py-2":"py-1",this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===h?"text-neutral-500":"text-black")}">${s?l`<slot name="left" part="left" class="${a("inline-flex","sm"===this.size?"mr-1":"mr-2",u,b)}"></slot>`:""} <input part="input" id="input" class="${a("min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700","sm"===this.size?"h-6":"h-8",d)}" type="${"password"===this.type&&this.passwordVisible?"text":this.type}" title="${this.title}" name="${m(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${m(this.placeholder)}" minlength="${m(this.minlength)}" maxlength="${m(this.maxlength)}" min="${m(this.min)}" max="${m(this.max)}" step="${m(this.step)}" .value="${y(this.value)}" autocapitalize="${m("password"===this.type?"off":this.autocapitalize)}" autocomplete="${m("password"===this.type?"off":this.autocomplete)}" autocorrect="${m("password"===this.type?"off":this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${m(this.pattern)}" enterkeyhint="${m(this.enterkeyhint)}" inputmode="${m(this.inputmode)}" aria-describedby="help-text invalid-message" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${r?l`<button part="clear-button" class="${a("flex justify-center ",c)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-22-10-icon class="${a("icon-fill-neutral-800",b)}" library="system" name="closing-round"></sd-3-22-10-icon></slot></button>`:""} ${this.passwordToggle&&"password"===this.type?l`<button aria-label="${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible?l`<slot name="show-password-icon"><sd-3-22-10-icon class="${a(u,c,b)}" library="system" name="eye"></sd-3-22-10-icon></slot>`:l`<slot name="hide-password-icon"><sd-3-22-10-icon class="${a(u,c,b)}" library="system" name="eye-crossed-out"></sd-3-22-10-icon></slot>`}</button>`:""} ${"date"!==this.type&&"datetime-local"!==this.type||z?"":l`<sd-3-22-10-icon class="${a(u,c,b)}" library="system" name="calendar"></sd-3-22-10-icon>`} ${"time"===this.type?l`<sd-3-22-10-icon class="${a(u,c,b)}" library="system" name="clock"></sd-3-22-10-icon>`:""} ${"search"===this.type?l`<button class="flex items-center" type="button" tabindex="-1"><sd-3-22-10-icon class="${a(u,c,b)}" library="system" name="magnifying-glass"></sd-3-22-10-icon></button>`:""} ${this.showInvalidStyle?l`<sd-3-22-10-icon part="invalid-icon" class="${a("text-error",c,b)}" library="system" name="risk"></sd-3-22-10-icon>`:""} ${this.showValidStyle&&this.styleOnValid?l`<sd-3-22-10-icon class="${a("text-success flex-shrink-0",c,b)}" library="system" name="status-check" part="valid-icon"></sd-3-22-10-icon>`:""} ${i?l`<slot name="right" part="right" class="${a("inline-flex",u,c,b)}"></slot>`:""} ${"number"===this.type&&this.spinButtons?l`<div part="stepper" class="flex items-center"><button part="decrement-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isDecrementDisabled()}" aria-hidden="true" ${_({start:()=>this.handleStepDown(),end:()=>this.handleChange()})} tabindex="-1"><slot name="decrement-number-stepper"><sd-3-22-10-icon library="global-resources" name="system/minus-round" label="Decrease value" class="${a(u,c,b)}"></sd-3-22-10-icon></slot></button> <button part="increment-number-stepper" class="stepper-button flex" type="button" ?disabled="${this.isIncrementDisabled()}" aria-hidden="true" ${_({start:()=>this.handleStepUp(),end:()=>this.handleChange()})} tabindex="-1"><slot name="increment-number-stepper"><sd-3-22-10-icon library="global-resources" name="system/plus-round" label="Decrease value" class="${a(u,c,b)}"></sd-3-22-10-icon></slot></button></div>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700",n?"block":"hidden")}" aria-hidden="${!n}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};E.styles=[o,s.styles,n`:host{position:relative;box-sizing:border-box;display:inline-block;width:100%;text-align:left}:host([vertical]){display:block}:host([required]) #label::after{content:' *'}details summary::-webkit-details-marker{display:none}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}input[type=time]::-webkit-calendar-picker-indicator{background:0 0}details summary::-webkit-details-marker,input[type=date]::-webkit-calendar-picker-indicator,input[type=datetime-local]::-webkit-calendar-picker-indicator,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{display:none}.stepper-button[disabled] sd-3-22-10-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-500,174 174 174) / var(--tw-text-opacity))}`],U([r("#input")],E.prototype,"input",2),U([r("#invalid-message")],E.prototype,"invalidMessage",2),U([g()],E.prototype,"hasFocus",2),U([g()],E.prototype,"showValidStyle",2),U([g()],E.prototype,"showInvalidStyle",2),U([h({reflect:!0})],E.prototype,"type",2),U([h({reflect:!0})],E.prototype,"size",2),U([h()],E.prototype,"inputmode",2),U([h()],E.prototype,"value",2),U([p()],E.prototype,"defaultValue",2),U([h()],E.prototype,"placeholder",2),U([h()],E.prototype,"label",2),U([h({attribute:"help-text"})],E.prototype,"helpText",2),U([h({type:Boolean})],E.prototype,"clearable",2),U([h({type:Boolean,reflect:!0})],E.prototype,"disabled",2),U([h({type:Boolean,reflect:!0})],E.prototype,"readonly",2),U([h({attribute:"password-toggle",type:Boolean})],E.prototype,"passwordToggle",2),U([h({attribute:"password-visible",type:Boolean})],E.prototype,"passwordVisible",2),U([h({attribute:"spin-buttons",type:Boolean})],E.prototype,"spinButtons",2),U([h({type:Number})],E.prototype,"minlength",2),U([h({type:Number})],E.prototype,"maxlength",2),U([h()],E.prototype,"min",2),U([h()],E.prototype,"max",2),U([h({reflect:!0})],E.prototype,"form",2),U([h()],E.prototype,"name",2),U([h()],E.prototype,"title",2),U([h({type:Boolean,reflect:!0})],E.prototype,"required",2),U([h()],E.prototype,"pattern",2),U([h()],E.prototype,"step",2),U([h()],E.prototype,"autocapitalize",2),U([h()],E.prototype,"autocorrect",2),U([h()],E.prototype,"autocomplete",2),U([h({type:Boolean})],E.prototype,"autofocus",2),U([h()],E.prototype,"enterkeyhint",2),U([h({type:Boolean,reflect:!0,attribute:"style-on-valid"})],E.prototype,"styleOnValid",2),U([h({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],E.prototype,"spellcheck",2),U([w("disabled",{waitUntilFirstUpdate:!0})],E.prototype,"handleDisabledChange",1),U([w("step",{waitUntilFirstUpdate:!0})],E.prototype,"handleStepChange",1),U([w("value",{waitUntilFirstUpdate:!0})],E.prototype,"handleValueChange",1),E=U([d("sd-3-22-10-input")],E);export{E as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as s,i,e as o,n as r,a as n}from"./solid-components2.js";import{H as l}from"./slot.js";import{o as a}from"./if-defined.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&h(e,s,r),r};let c=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","icon-left","icon-right"),this.standalone=!1,this.size="inherit",this.inverted=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return e`<a part="base" class="${s("inline",this.href?"cursor-pointer":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline"}[this.href?"enabled":"disabled"],this.standalone&&"flex items-start")}" href="${a(this.href||void 0)}" target="${a(this.target||void 0)}" download="${a(this.download)}" rel="${a(this.target?"noreferrer noopener":void 0)}" aria-disabled="${this.href?"false":"true"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"><slot name="icon-left" part="icon-left" class="${s("inline",t["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${s("inline",t["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};c.styles=[t.styles,i`::slotted(sd-3-22-
|
1
|
+
import{S as t,x as e,t as s,i,e as o,n as r,a as n}from"./solid-components2.js";import{H as l}from"./slot.js";import{o as a}from"./if-defined.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,n=t.length-1;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&h(e,s,r),r};let c=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","icon-left","icon-right"),this.standalone=!1,this.size="inherit",this.inverted=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return e`<a part="base" class="${s("inline",this.href?"cursor-pointer":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline"}[this.href?"enabled":"disabled"],this.standalone&&"flex items-start")}" href="${a(this.href||void 0)}" target="${a(this.target||void 0)}" download="${a(this.download)}" rel="${a(this.target?"noreferrer noopener":void 0)}" aria-disabled="${this.href?"false":"true"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"><slot name="icon-left" part="icon-left" class="${s("inline",t["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${s("inline",t["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};c.styles=[t.styles,i`::slotted(sd-3-22-10-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-3-22-10-icon){font-size:var(--sd-font-size-base,1rem)}:host([size=lg][standalone]) ::slotted(sd-3-22-10-icon){font-size:var(--sd-font-size-xl,1.5rem)}`],f([o("a")],c.prototype,"button",2),f([r({type:Boolean,reflect:!0})],c.prototype,"standalone",2),f([r({reflect:!0})],c.prototype,"size",2),f([r({type:Boolean,reflect:!0})],c.prototype,"inverted",2),f([r()],c.prototype,"href",2),f([r()],c.prototype,"target",2),f([r()],c.prototype,"download",2),c=f([n("sd-3-22-10-link")],c);export{c as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,d as a,t as e,c as i,i as r,n as s,a as n}from"./solid-components2.js";import{s as l,n as o}from"./static.js";import{o as c}from"./if-defined.js";var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(t,a,e,i)=>{for(var r,s=i>1?void 0:i?v(a,e):a,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(i?r(a,e,s):r(s))||s);return i&&s&&h(a,e,s),s};let d=class extends t{constructor(){super(...arguments),this.variant="main",this.state="default",this.animated=!1,this.notInteractive=!1,this.href="",this.marker={cluster:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" opacity="1" r="20"/><circle cx="25" cy="25" opacity=".3" r="25"/></svg>`,main:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z"/><circle cx="30" cy="28" r="10" fill="#fff"/></svg>`,place:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path fill-rule="evenodd" d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z" clip-rule="evenodd"/></svg>`}}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}isLink(){return!!this.href}render(){const t=this.isLink(),a=this.notInteractive?l`div`:t?l`a`:l`button`;return o`<${a} part="base" class="${e("flex justify-center",!this.notInteractive&&"focus:outline focus:outline-2 focus:outline-primary focus:outline-offset-2")}" href="${c(t?this.href:void 0)}" target="${c(t?this.target:void 0)}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" role="${c(this.notInteractive||t?void 0:"button")}" aria-labelledby="${c(this.notInteractive?void 0:"content")}"><div part="marker" class="${e("inline-flex",this.animated&&("main"===this.variant||"place"===this.variant)&&"animate-bounce-once","cluster"===this.variant&&"hover"===this.state&&"scale-110 fill-primary-500","cluster"===this.variant&&!this.notInteractive&&"transition-all duration-200 ease-in-out hover:scale-110 hover:fill-primary-500","main"===this.variant&&"hover"===this.state&&"fill-accent-550","main"===this.variant&&"active"===this.state&&"fill-accent-700","main"===this.variant&&!this.notInteractive&&"hover:fill-accent-550 active:fill-accent-700","place"===this.variant&&"default"===this.state&&"fill-white","place"===this.variant&&"hover"===this.state&&"fill-primary-100","place"===this.variant&&"active"===this.state&&"fill-primary-200","place"===this.variant&&!this.notInteractive&&"hover:fill-primary-100",{cluster:"fill-primary",main:"fill-accent *:drop-shadow-md",place:"*:drop-shadow-md"}[this.variant])}">${this.marker[this.variant]}</div><div id="content" part="content" class="${e("absolute self-center pointer-events-none","cluster"===this.variant&&"font-bold text-white")}"><slot></slot></div></${a}>`}};d.styles=[i,t.styles,r`:host{display:block}:host([variant=cluster]) [part=base],svg{width:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=base]{height:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host(:not([variant=cluster])) [part=base]{height:calc(var(--sd-spacing-16,4rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=content]{font-size:calc(var(--sd-font-size-sm,.875rem) * var(--map-marker-scaling,1))}:host([variant=place]) [part=content]{font-size:calc(var(--sd-font-size-3xl,2rem) * var(--map-marker-scaling,1))}`],p([s({reflect:!0})],d.prototype,"variant",2),p([s({reflect:!0})],d.prototype,"state",2),p([s({type:Boolean,reflect:!0})],d.prototype,"animated",2),p([s({type:Boolean,reflect:!0,attribute:"not-interactive"})],d.prototype,"notInteractive",2),p([s()],d.prototype,"href",2),p([s()],d.prototype,"target",2),d=p([n("sd-3-22-
|
1
|
+
import{S as t,d as a,t as e,c as i,i as r,n as s,a as n}from"./solid-components2.js";import{s as l,n as o}from"./static.js";import{o as c}from"./if-defined.js";var h=Object.defineProperty,v=Object.getOwnPropertyDescriptor,p=(t,a,e,i)=>{for(var r,s=i>1?void 0:i?v(a,e):a,n=t.length-1;n>=0;n--)(r=t[n])&&(s=(i?r(a,e,s):r(s))||s);return i&&s&&h(a,e,s),s};let d=class extends t{constructor(){super(...arguments),this.variant="main",this.state="default",this.animated=!1,this.notInteractive=!1,this.href="",this.marker={cluster:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="25" cy="25" opacity="1" r="20"/><circle cx="25" cy="25" opacity=".3" r="25"/></svg>`,main:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z"/><circle cx="30" cy="28" r="10" fill="#fff"/></svg>`,place:a`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 75"><path fill-rule="evenodd" d="M51 49A29 29 0 0 0 30 0 29 29 0 0 0 9 49l21 22 21-22Z" clip-rule="evenodd"/></svg>`}}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}isLink(){return!!this.href}render(){const t=this.isLink(),a=this.notInteractive?l`div`:t?l`a`:l`button`;return o`<${a} part="base" class="${e("flex justify-center",!this.notInteractive&&"focus:outline focus:outline-2 focus:outline-primary focus:outline-offset-2")}" href="${c(t?this.href:void 0)}" target="${c(t?this.target:void 0)}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" role="${c(this.notInteractive||t?void 0:"button")}" aria-labelledby="${c(this.notInteractive?void 0:"content")}"><div part="marker" class="${e("inline-flex",this.animated&&("main"===this.variant||"place"===this.variant)&&"animate-bounce-once","cluster"===this.variant&&"hover"===this.state&&"scale-110 fill-primary-500","cluster"===this.variant&&!this.notInteractive&&"transition-all duration-200 ease-in-out hover:scale-110 hover:fill-primary-500","main"===this.variant&&"hover"===this.state&&"fill-accent-550","main"===this.variant&&"active"===this.state&&"fill-accent-700","main"===this.variant&&!this.notInteractive&&"hover:fill-accent-550 active:fill-accent-700","place"===this.variant&&"default"===this.state&&"fill-white","place"===this.variant&&"hover"===this.state&&"fill-primary-100","place"===this.variant&&"active"===this.state&&"fill-primary-200","place"===this.variant&&!this.notInteractive&&"hover:fill-primary-100",{cluster:"fill-primary",main:"fill-accent *:drop-shadow-md",place:"*:drop-shadow-md"}[this.variant])}">${this.marker[this.variant]}</div><div id="content" part="content" class="${e("absolute self-center pointer-events-none","cluster"===this.variant&&"font-bold text-white")}"><slot></slot></div></${a}>`}};d.styles=[i,t.styles,r`:host{display:block}:host([variant=cluster]) [part=base],svg{width:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=base]{height:calc(var(--sd-spacing-12,3rem) * var(--map-marker-scaling,1))}:host(:not([variant=cluster])) [part=base]{height:calc(var(--sd-spacing-16,4rem) * var(--map-marker-scaling,1))}:host([variant=cluster]) [part=content]{font-size:calc(var(--sd-font-size-sm,.875rem) * var(--map-marker-scaling,1))}:host([variant=place]) [part=content]{font-size:calc(var(--sd-font-size-3xl,2rem) * var(--map-marker-scaling,1))}`],p([s({reflect:!0})],d.prototype,"variant",2),p([s({reflect:!0})],d.prototype,"state",2),p([s({type:Boolean,reflect:!0})],d.prototype,"animated",2),p([s({type:Boolean,reflect:!0,attribute:"not-interactive"})],d.prototype,"notInteractive",2),p([s()],d.prototype,"href",2),p([s()],d.prototype,"target",2),d=p([n("sd-3-22-10-map-marker")],d);export{d as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,t as e,c as i,r as s,i as r,n as a,a as o}from"./solid-components2.js";import{H as l}from"./slot.js";import{s as n,n as d}from"./static.js";import{o as h}from"./if-defined.js";import{I as c}from"./interactive.js";var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,v=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?u(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s?r(e,i,a):r(a))||a);return s&&a&&p(e,i,a),a};let f=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","description","children"),this.vertical=!1,this.size="base",this.current=!1,this.disabled=!1,this.chevron=!1,this.relaxed=!1,this.divider=!1,this.indented=!1,this.open=!1,this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.href&&this.hasSlotController.test("children")}handleClickButton(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}handleClickSummary(t){t.preventDefault(),t.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.isAccordion&&!this.isLink?n`summary`:this.separated?n`div`:this.isLink?n`a`:n`button`}render(){const t=this.tag,i=this.isLink,s=this.isButton,r=this.isAccordion,a=(this.hasSlotController.test("[default]"),this.hasSlotController.test("main"),this.hasSlotController.test("description")),o=this.hasSlotController.test("children"),l=this.vertical?"pb-3":"pb-2",n=d`<${t} part="base" class="${e("cursor-pointer relative focus-visible:focus-outline",{base:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",r?"flex flex-col":"inline-block w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-all min-h-[48px] px-4")}" aria-controls="${h(r?"navigation-item-details":void 0)}" aria-current="${h(this.current?"page":void 0)}" aria-disabled="${this.disabled}" ?disabled="${h(s?this.disabled:void 0)}" href="${h(i?this.href:void 0)}" target="${h(i?this.target:void 0)}" download="${h(i?this.download:void 0)}" rel="${h(i&&this.target?"noreferrer noopener":void 0)}" role="${i?"link":"button"}" tabindex="${this.disabled||this.separated?"-1":"0"}" @click="${this.separated?void 0:r?this.handleClickSummary:s?this.handleClickButton:void 0}"><div part="current-indicator" class="${e("absolute left-0 pointer-events-none transition-all duration-150",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-full bottom-0",this.current?"bg-accent":"bg-transparent",this.disabled&&"bg-neutral-500")}"></div><span part="content-area" class="${e("relative pt-3 inline-flex justify-between items-center",r?"grow":"w-full",a||this.separated?"pb-1":l,this.calculatePaddingX)}">${this.divider&&this.vertical?d`<sd-3-22-
|
1
|
+
import{S as t,t as e,c as i,r as s,i as r,n as a,a as o}from"./solid-components2.js";import{H as l}from"./slot.js";import{s as n,n as d}from"./static.js";import{o as h}from"./if-defined.js";import{I as c}from"./interactive.js";var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,v=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?u(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s?r(e,i,a):r(a))||a);return s&&a&&p(e,i,a),a};let f=class extends t{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","description","children"),this.vertical=!1,this.size="base",this.current=!1,this.disabled=!1,this.chevron=!1,this.relaxed=!1,this.divider=!1,this.indented=!1,this.open=!1,this.separated=!1}get isButton(){return!this.href&&!this.hasSlotController.test("children")}get isLink(){return!!this.href}get isAccordion(){return!this.href&&this.hasSlotController.test("children")}handleClickButton(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}handleClickSummary(t){t.preventDefault(),t.stopPropagation(),this.disabled||(this.open?this.hideDetails():this.showDetails())}hideDetails(){this.open=!1,this.emit("sd-hide",{cancelable:!0})}showDetails(){this.open=!0,this.emit("sd-show",{cancelable:!0})}get calculatePaddingX(){return this.relaxed&&this.indented?"pl-8 pr-4":this.relaxed?"px-4":this.indented?"pl-4":""}get tag(){return this.isAccordion&&!this.isLink?n`summary`:this.separated?n`div`:this.isLink?n`a`:n`button`}render(){const t=this.tag,i=this.isLink,s=this.isButton,r=this.isAccordion,a=(this.hasSlotController.test("[default]"),this.hasSlotController.test("main"),this.hasSlotController.test("description")),o=this.hasSlotController.test("children"),l=this.vertical?"pb-3":"pb-2",n=d`<${t} part="base" class="${e("cursor-pointer relative focus-visible:focus-outline",{base:"text-base",lg:"text-lg",sm:"text-[14px]"}[this.size],this.disabled?"text-neutral-500 pointer-events-none":"text-primary",r?"flex flex-col":"inline-block w-full",this.divider&&this.vertical&&"mt-0.25",!this.vertical&&"inline-flex items-center",!this.separated&&"hover:bg-neutral-200 group transition-all min-h-[48px] px-4")}" aria-controls="${h(r?"navigation-item-details":void 0)}" aria-current="${h(this.current?"page":void 0)}" aria-disabled="${this.disabled}" ?disabled="${h(s?this.disabled:void 0)}" href="${h(i?this.href:void 0)}" target="${h(i?this.target:void 0)}" download="${h(i?this.download:void 0)}" rel="${h(i&&this.target?"noreferrer noopener":void 0)}" role="${i?"link":"button"}" tabindex="${this.disabled||this.separated?"-1":"0"}" @click="${this.separated?void 0:r?this.handleClickSummary:s?this.handleClickButton:void 0}"><div part="current-indicator" class="${e("absolute left-0 pointer-events-none transition-all duration-150",this.vertical?"w-1 h-[calc(100%-16px)] top-2 group-hover:h-full group-hover:top-0":"h-1 w-full bottom-0",this.current?"bg-accent":"bg-transparent",this.disabled&&"bg-neutral-500")}"></div><span part="content-area" class="${e("relative pt-3 inline-flex justify-between items-center",r?"grow":"w-full",a||this.separated?"pb-1":l,this.calculatePaddingX)}">${this.divider&&this.vertical?d`<sd-3-22-10-divider part="divider" class="${e("w-full transition-all absolute -top-0.25 left-0",this.calculatePaddingX)}"></sd-3-22-10-divider>`:""} <span part="content-container" class="inline-flex items-center flex-auto">${this.separated?d`<a class="${e("mr-4 w-full inline-flex items-center pl-4 cursor-pointer relative focus-visible:focus-outline hover:bg-neutral-200 group transition-all min-h-[48px]",!a&&"py-4")}" href="${h(i?this.href:void 0)}" target="${h(i?this.target:void 0)}" download="${h(i?this.download:void 0)}"><slot part="content" class="inline"></slot></a>`:d`<slot part="content" class="inline"></slot>`} </span>${(this.chevron||o)&&this.vertical?this.separated?d`<button type="button" title="toggle-details" class="sd-interactive sd-interactive--reset" @click="${this.handleClickSummary}"><sd-3-22-10-icon name="chevron-down" part="chevron" library="system" color="currentColor" class="${e("mr-4 h-6 w-6 transition-all",r||this.separated?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-3-22-10-icon></button>`:d`<sd-3-22-10-icon name="chevron-down" part="chevron" library="system" color="currentColor" class="${e("h-6 w-6 ml-2 transition-all",r?this.open?"rotate-180":"rotate-0":"rotate-[270deg]")}"></sd-3-22-10-icon>`:""} </span>${a&&this.vertical?d`<slot name="description" part="description" class="${e("inline-block text-sm text-left text-black",r||this.separated?"grow":"w-full",this.separated?"px-4":this.calculatePaddingX,l)}"></slot>`:""}</${t}>`;return r?d`<details aria-expanded="${this.open}" part="details" id="navigation-item-details" ?open="${this.open}" class="relative flex">${n}<slot name="children"></slot></details>`:this.separated?d`<div part="details" id="navigation-item-details" class="relative flex flex-col">${n}${this.open?d`<slot name="children"></slot>`:""}</div>`:d`${n}`}};f.styles=[i,t.styles,s(c),r`:host{position:relative;box-sizing:border-box;display:inline-block}:host([vertical]){display:block}details summary::-webkit-details-marker{display:none}`],v([a({type:Boolean,reflect:!0})],f.prototype,"vertical",2),v([a({reflect:!0})],f.prototype,"size",2),v([a({reflect:!0})],f.prototype,"href",2),v([a()],f.prototype,"target",2),v([a()],f.prototype,"download",2),v([a({type:Boolean,reflect:!0})],f.prototype,"current",2),v([a({type:Boolean,reflect:!0})],f.prototype,"disabled",2),v([a({type:Boolean,reflect:!0})],f.prototype,"chevron",2),v([a({type:Boolean,reflect:!0})],f.prototype,"relaxed",2),v([a({type:Boolean,reflect:!0})],f.prototype,"divider",2),v([a({type:Boolean,reflect:!0})],f.prototype,"indented",2),v([a({type:Boolean,reflect:!0})],f.prototype,"open",2),v([a({type:Boolean,reflect:!0})],f.prototype,"separated",2),f=v([o("sd-3-22-10-navigation-item")],f);export{f as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{s as t,a as i}from"./animate.js";import{S as e,L as s,x as a,t as o,c as
|
1
|
+
import{s as t,a as i}from"./animate.js";import{S as e,L as s,x as a,t as o,c as r,i as n,e as d,n as l,a as c}from"./solid-components2.js";import{g as h,s as u}from"./animation-registry.js";import{w as p}from"./event.js";import{w as m}from"./watch.js";var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,y=(t,i,e,s)=>{for(var a,o=s>1?void 0:s?b(i,e):i,r=t.length-1;r>=0;r--)(a=t[r])&&(o=(s?a(i,e,o):a(o))||o);return s&&o&&f(i,e,o),o};const w=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--top-right"}),g=Object.assign(document.createElement("div"),{className:"sd-toast-stack sd-toast-stack--bottom-center"});let v=class extends e{constructor(){super(...arguments),this.localize=new s(this),this.variant="info",this.open=!1,this.closable=!1,this.duration=1/0,this.durationIndicator=!1,this.toastStack="top-right",this.remainingDuration=this.duration,this.startTime=Date.now()}firstUpdated(){this.base.hidden=!this.open}startAutoHide(){clearTimeout(this.autoHideTimeout),this.startTime=Date.now(),this.remainingDuration=this.duration,this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>this.hide()),this.duration))}onHover(){clearTimeout(this.autoHideTimeout),this.duration<1/0&&(this.remainingDuration-=Date.now()-this.startTime)}onHoverEnd(){this.startTime=Date.now(),clearTimeout(this.autoHideTimeout),this.open&&this.duration<1/0&&(this.autoHideTimeout=window.setTimeout((()=>{this.hide()}),this.remainingDuration))}handleCloseClick(){this.hide()}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.duration<1/0&&this.startAutoHide(),await t(this.base),this.base.hidden=!1;const{keyframes:e,options:s}=h(this,"notification.show",{dir:this.localize.dir()});await i(this.base,e,s),this.emit("sd-after-show")}else{this.emit("sd-hide"),clearTimeout(this.autoHideTimeout),await t(this.base);const{keyframes:e,options:s}=h(this,"notification.hide",{dir:this.localize.dir()});await i(this.base,e,s),this.base.hidden=!0,this.emit("sd-after-hide")}}handleDurationChange(){this.startAutoHide()}async show(){if(!this.open)return this.open=!0,p(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,p(this,"sd-after-hide")}async toast(){return new Promise((t=>{const i="bottom-center"===this.toastStack?g:w;null===i.parentElement&&document.body.append(i),i.appendChild(this),requestAnimationFrame((()=>{this.clientWidth,this.show()})),this.addEventListener("sd-after-hide",(()=>{i.removeChild(this),t(),null===i.querySelector("sd-3-22-10-notification")&&i.remove()}),{once:!0})}))}render(){return a`<div part="base" class="${o("w-full overflow-hidden flex items-stretch relative m-2")}" role="alert" id="notification" aria-hidden="${this.open?"false":"true"}" @mouseenter="${this.onHover}" @mouseleave="${this.onHoverEnd}"><slot name="icon" part="icon" class="${o("min-w-min flex items-center px-3 justify-center",{info:"bg-info",success:"bg-success",warning:"bg-warning",error:"bg-error"}[this.variant])}"><sd-3-22-10-icon name="${{info:"info-circle",success:"confirm-circle",warning:"exclamation-circle",error:"warning"}[this.variant]||""}" library="system" class="h-6 w-6 text-white"></sd-3-22-10-icon></slot><div part="content" class="${o("h-full w-full p-1 gap-2 flex items-center justify-stretch bg-white","border-solid border-[1px] border-l-0 border-neutral-400")}"><slot part="message" class="block w-full pl-3 py-2" aria-live="polite"></slot>${this.closable?a`<sd-3-22-10-button size="md" variant="tertiary" part="close-button" class="ml-auto flex flex-[0_0_auto] items-stretch" @click="${this.handleCloseClick}"><sd-3-22-10-icon label="${this.localize.term("close")}" name="close" library="system" color="currentColor"></sd-3-22-10-icon></sd-3-22-10-button>`:""}</div>${this.durationIndicator?a`<div part="duration-indicator__elapsed" id="duration-indicator__elapsed" style="${`animation-duration: ${this.duration}ms`}" class="${o("absolute w-0 h-[2px] bottom-0 bg-primary z-10 animate-grow")}"></div><div part="duration-indicator__total" class="w-full h-[2px] bottom-0 absolute border border-neutral-400"></div>`:""}</div>`}};v.styles=[r,e.styles,n`:host{display:contents}#notification:hover #duration-indicator__elapsed{animation-play-state:paused!important}`],y([d('[part~="base"]')],v.prototype,"base",2),y([l({reflect:!0})],v.prototype,"variant",2),y([l({type:Boolean,reflect:!0})],v.prototype,"open",2),y([l({type:Boolean,reflect:!0})],v.prototype,"closable",2),y([l({type:Number})],v.prototype,"duration",2),y([l({type:Boolean,reflect:!0,attribute:"duration-indicator"})],v.prototype,"durationIndicator",2),y([l({reflect:!0,attribute:"toast-stack"})],v.prototype,"toastStack",2),y([m("open",{waitUntilFirstUpdate:!0})],v.prototype,"handleOpenChange",1),y([m("duration")],v.prototype,"handleDurationChange",1),v=y([c("sd-3-22-10-notification")],v),u("notification.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),u("notification.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}});export{v as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{S as e,x as t,t as s,c as l,i as a,e as o,n as r,a as i}from"./solid-components2.js";import{H as n}from"./slot.js";import{r as h}from"./state.js";import{w as c}from"./watch.js";var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,u=(e,t,s,l)=>{for(var a,o=l>1?void 0:l?p(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(o=(l?a(t,s,o):a(o))||o);return l&&o&&d(t,s,o),o};let b=class extends e{constructor(){super(...arguments),this.hasSlotController=new n(this,"default","left","right"),this.current=!1,this.selected=!1,this.hasHover=!1,this.size="lg",this.checkbox=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){const e=this.getTextLabel();typeof this.cachedTextLabel>"u"?this.cachedTextLabel=e:e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){return(this.textContent??"").trim()}render(){this.hasSlotController.test("default");const e=this.hasSlotController.test("left"),l=this.hasSlotController.test("right");return t`<div part="base" class="${s("px-4 flex items-center w-full transition-all text-left text-base relative text-black",{sm:"text-sm py-1",md:"text-base py-2",lg:"text-base py-3"}[this.size],this.disabled?"text-neutral-500 cursor-not-allowed":"cursor-pointer",this.hasHover&&!this.disabled?"bg-neutral-200":"",this.current&&"bg-neutral-200")}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><span class="${s("absolute w-full left-0 top-0 pointer-events-none transition-all duration-150 border-l-4 h-[calc(100%-8px)]",this.selected&&!this.checkbox?"border-accent":"border-transparent",this.disabled&&"border-neutral-500 top-1",!this.disabled&&this.hasHover?"h-full top-0":"top-1")}"></span> ${this.checkbox?t`<span id="control" part="control ${this.selected?" control--checked":"control--unchecked"}" class="${s("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4 mr-2",this.disabled?"border-neutral-500":this.selected?"bg-accent border-accent":"border-neutral-800")}">${this.selected?t`<sd-3-22-
|
1
|
+
import"./icon.js";import{S as e,x as t,t as s,c as l,i as a,e as o,n as r,a as i}from"./solid-components2.js";import{H as n}from"./slot.js";import{r as h}from"./state.js";import{w as c}from"./watch.js";var d=Object.defineProperty,p=Object.getOwnPropertyDescriptor,u=(e,t,s,l)=>{for(var a,o=l>1?void 0:l?p(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(o=(l?a(t,s,o):a(o))||o);return l&&o&&d(t,s,o),o};let b=class extends e{constructor(){super(...arguments),this.hasSlotController=new n(this,"default","left","right"),this.current=!1,this.selected=!1,this.hasHover=!1,this.size="lg",this.checkbox=!1,this.disabled=!1,this.value=""}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false")}handleDefaultSlotChange(){const e=this.getTextLabel();typeof this.cachedTextLabel>"u"?this.cachedTextLabel=e:e!==this.cachedTextLabel&&(this.cachedTextLabel=e,this.emit("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleSelectedChange(){this.setAttribute("aria-selected",this.selected?"true":"false")}handleValueChange(){this.value.includes(" ")&&(console.error("Option values cannot include a space. All spaces have been replaced with underscores.",this),this.value=this.value.replace(/ /g,"_"))}getTextLabel(){return(this.textContent??"").trim()}render(){this.hasSlotController.test("default");const e=this.hasSlotController.test("left"),l=this.hasSlotController.test("right");return t`<div part="base" class="${s("px-4 flex items-center w-full transition-all text-left text-base relative text-black",{sm:"text-sm py-1",md:"text-base py-2",lg:"text-base py-3"}[this.size],this.disabled?"text-neutral-500 cursor-not-allowed":"cursor-pointer",this.hasHover&&!this.disabled?"bg-neutral-200":"",this.current&&"bg-neutral-200")}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><span class="${s("absolute w-full left-0 top-0 pointer-events-none transition-all duration-150 border-l-4 h-[calc(100%-8px)]",this.selected&&!this.checkbox?"border-accent":"border-transparent",this.disabled&&"border-neutral-500 top-1",!this.disabled&&this.hasHover?"h-full top-0":"top-1")}"></span> ${this.checkbox?t`<span id="control" part="control ${this.selected?" control--checked":"control--unchecked"}" class="${s("relative flex flex-shrink-0 items-center justify-center border rounded-sm h-4 w-4 mr-2",this.disabled?"border-neutral-500":this.selected?"bg-accent border-accent":"border-neutral-800")}">${this.selected?t`<sd-3-22-10-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-check"></sd-3-22-10-icon>`:""}</span>`:""} ${e?t`<slot name="left" part="left" class="inline-flex mr-2"></slot>`:""}<slot part="label" class="inline-block flex-grow" @slotchange="${this.handleDefaultSlotChange}"></slot>${l?t`<slot name="right" part="right" class="inline-flex ml-2"></slot>`:""}</div>`}};b.styles=[l,e.styles,a`:host{position:relative;display:block;width:100%;outline:2px solid transparent!important;outline-offset:2px!important}`],u([o('[part="base"]')],b.prototype,"defaultSlot",2),u([h()],b.prototype,"current",2),u([h()],b.prototype,"selected",2),u([h()],b.prototype,"hasHover",2),u([r({reflect:!0})],b.prototype,"size",2),u([r({type:Boolean,reflect:!0})],b.prototype,"checkbox",2),u([r({type:Boolean,reflect:!0})],b.prototype,"disabled",2),u([r({reflect:!0})],b.prototype,"value",2),u([c("disabled")],b.prototype,"handleDisabledChange",1),u([c("selected")],b.prototype,"handleSelectedChange",1),u([c("value")],b.prototype,"handleValueChange",1),b=u([i("sd-3-22-10-option")],b);export{b as default};
|
@@ -1 +1 @@
|
|
1
|
-
import"./icon.js";import{x as e,t,i as a,n as s,a as i}from"./solid-components2.js";import{o}from"./if-defined.js";import{s as n}from"./animation-registry.js";import r from"./accordion.js";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c=(e,t,a,s)=>{for(var i,o=s>1?void 0:s?d(t,a):t,n=e.length-1;n>=0;n--)(i=e[n])&&(o=(s?i(t,a,o):i(o))||o);return s&&o&&l(t,a,o),o};let p=class extends r{constructor(){super(...arguments),this.expandable=!1}render(){return e`<div part="base" class="sm:p-6"><header part="header" id="header" class="${t("text-base font-bold items-center focus-visible:focus-outline text-primary relative group flex flex-row hover:bg-transparent gap-3 pb-3 pt-0 px-0 sm:flex-col sm:gap-4 sm:pb-8",this.expandable&&"cursor-pointer select-none")}" role="${o(this.expandable?"button":void 0)}" aria-expanded="${o(this.expandable?this.open?"true":"false":void 0)}" aria-controls="${o(this.expandable?"content":void 0)}" tabindex="${this.expandable?"0":"-1"}" @click="${this.expandable?this.handleSummaryClick:null}" @keydown="${this.expandable?this.handleSummaryKeyDown:null}"><div part="icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto items-center",!this.expandable&&"cursor-default")}"><slot name="icon"></slot></div><slot name="summary" part="summary" class="${t("flex flex-auto items-start text-left text-base leading-normal font-normal sm:leading-tight sm:text-3xl sm:text-center",this.expandable?"text-primary":"text-black cursor-default")}">${this.summary}</slot><span part="summary-icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto self-start sm:self-center transition-all ease-in-out duration-300 text-xl sm:text-4xl sm:mt-2",this.open&&"rotate-180",!this.expandable&&"hidden")}"><slot name="expand-icon" class="${t(this.open&&"hidden")}"><sd-3-22-
|
1
|
+
import"./icon.js";import{x as e,t,i as a,n as s,a as i}from"./solid-components2.js";import{o}from"./if-defined.js";import{s as n}from"./animation-registry.js";import r from"./accordion.js";var l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c=(e,t,a,s)=>{for(var i,o=s>1?void 0:s?d(t,a):t,n=e.length-1;n>=0;n--)(i=e[n])&&(o=(s?i(t,a,o):i(o))||o);return s&&o&&l(t,a,o),o};let p=class extends r{constructor(){super(...arguments),this.expandable=!1}render(){return e`<div part="base" class="sm:p-6"><header part="header" id="header" class="${t("text-base font-bold items-center focus-visible:focus-outline text-primary relative group flex flex-row hover:bg-transparent gap-3 pb-3 pt-0 px-0 sm:flex-col sm:gap-4 sm:pb-8",this.expandable&&"cursor-pointer select-none")}" role="${o(this.expandable?"button":void 0)}" aria-expanded="${o(this.expandable?this.open?"true":"false":void 0)}" aria-controls="${o(this.expandable?"content":void 0)}" tabindex="${this.expandable?"0":"-1"}" @click="${this.expandable?this.handleSummaryClick:null}" @keydown="${this.expandable?this.handleSummaryKeyDown:null}"><div part="icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto items-center",!this.expandable&&"cursor-default")}"><slot name="icon"></slot></div><slot name="summary" part="summary" class="${t("flex flex-auto items-start text-left text-base leading-normal font-normal sm:leading-tight sm:text-3xl sm:text-center",this.expandable?"text-primary":"text-black cursor-default")}">${this.summary}</slot><span part="summary-icon" class="${t("flex flex-grow-0 flex-shrink-0 flex-auto self-start sm:self-center transition-all ease-in-out duration-300 text-xl sm:text-4xl sm:mt-2",this.open&&"rotate-180",!this.expandable&&"hidden")}"><slot name="expand-icon" class="${t(this.open&&"hidden")}"><sd-3-22-10-icon library="system" name="chevron-down"></sd-3-22-10-icon></slot><slot name="collapse-icon" class="${t(!this.open&&"hidden")}"><sd-3-22-10-icon library="system" name="chevron-down"></sd-3-22-10-icon></slot></span></header><div part="content" id="content" class="${t("overflow-hidden",!this.expandable&&"hidden")}"><slot part="content__slot" class="block" role="region" aria-labelledby="header"></slot></div></div>`}};p.styles=[r.styles,a`:host{display:block}@media (min-width:640px){[part=summary-icon]{font-size:var(--sd-spacing-12,3rem)}}[part=icon]{font-size:var(--sd-spacing-12,3rem)}@media (min-width:640px){[part=icon]{font-size:var(--sd-spacing-24,6rem)}}`],c([s({type:Boolean,reflect:!0})],p.prototype,"expandable",2),p=c([i("sd-3-22-10-quickfact")],p),n("quickfact.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),n("quickfact.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});export{p as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{S as t,x as e,t as s,c as r,i as o,e as i,n as a,a as n}from"./solid-components2.js";import{H as d}from"./slot.js";import{o as l}from"./if-defined.js";import{r as u}from"./state.js";import{w as h}from"./watch.js";var b=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var o,i=r>1?void 0:r?c(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&b(e,s,i),i};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new d(this,"[default]","icon"),this.hasFocus=!1,this.size="lg",this.disabled=!1,this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("[default]"),r=this.hasSlotController.test("icon"),o=`${this.size}-${t?"label":"no-label"}`;return e`<div part="base" role="presentation" class="relative"><button part="${"button"+(this.checked?" button--checked":"")}" role="radio" aria-checked="${this.checked}" class="${s("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline","sm"===this.size?"text-sm":"text-base",this.checked&&!this.disabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":this.disabled&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":this.disabled&&this.checked?"bg-neutral-500 border-neutral-500 text-white hover:cursor-not-allowed":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",t&&"px-4",this.hasFocus&&"focused-class",t&&"button--has-label",r&&"button--has-icon flex gap-2",o)}" aria-disabled="${this.disabled}" type="button" value="${l(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${s(r&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!r}"></slot>${t?e`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};m.styles=[t.styles,r,o`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;position:absolute;inset:var(--sd-spacing-0,0);z-index:-10;opacity:var(--sd-opacity-0,0);outline-style:dotted;outline-width:1px;outline-color:rgb(var(--sd-color-error,204 25 55) / 1)}.lg-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{height:var(--sd-spacing-12,3rem);width:var(--sd-spacing-12,3rem)}.md-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{height:var(--sd-spacing-10,2.5rem);width:var(--sd-spacing-10,2.5rem)}.sm-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{height:var(--sd-spacing-8,2rem);width:var(--sd-spacing-8,2rem)}:host(.sd-3-22-
|
1
|
+
import{S as t,x as e,t as s,c as r,i as o,e as i,n as a,a as n}from"./solid-components2.js";import{H as d}from"./slot.js";import{o as l}from"./if-defined.js";import{r as u}from"./state.js";import{w as h}from"./watch.js";var b=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p=(t,e,s,r)=>{for(var o,i=r>1?void 0:r?c(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,s,i):o(i))||i);return r&&i&&b(e,s,i),i};let m=class extends t{constructor(){super(...arguments),this.hasSlotController=new d(this,"[default]","icon"),this.hasFocus=!1,this.size="lg",this.disabled=!1,this.checked=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("[default]"),r=this.hasSlotController.test("icon"),o=`${this.size}-${t?"label":"no-label"}`;return e`<div part="base" role="presentation" class="relative"><button part="${"button"+(this.checked?" button--checked":"")}" role="radio" aria-checked="${this.checked}" class="${s("relative text-center border rounded-default transition-all ease-in-out duration-100 items-center justify-center focus-visible:focus-outline","sm"===this.size?"text-sm":"text-base",this.checked&&!this.disabled?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500":this.disabled&&!this.checked?"border-neutral-500 text-neutral-500 hover:cursor-not-allowed":this.disabled&&this.checked?"bg-neutral-500 border-neutral-500 text-white hover:cursor-not-allowed":"bg-transparent text-primary border-primary hover:bg-primary-100 hover:border-primary-500 hover:text-primary-500 cursor-pointer",t&&"px-4",this.hasFocus&&"focused-class",t&&"button--has-label",r&&"button--has-icon flex gap-2",o)}" aria-disabled="${this.disabled}" type="button" value="${l(this.value)}" tabindex="${this.checked?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon" part="icon" class="${s(r&&"inline-flex relative items-center",{sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size])}" ?hidden="${!r}"></slot>${t?e`<slot part="label" class="button__label inline-flex relative items-center whitespace-nowrap"></slot>`:null}</button></div>`}};m.styles=[t.styles,r,o`:host{display:block;width:-moz-min-content;width:min-content}.hidden-input{all:unset;position:absolute;inset:var(--sd-spacing-0,0);z-index:-10;opacity:var(--sd-opacity-0,0);outline-style:dotted;outline-width:1px;outline-color:rgb(var(--sd-color-error,204 25 55) / 1)}.lg-label{height:var(--sd-spacing-12,3rem)}.lg-no-label{height:var(--sd-spacing-12,3rem);width:var(--sd-spacing-12,3rem)}.md-label{height:var(--sd-spacing-10,2.5rem)}.md-no-label{height:var(--sd-spacing-10,2.5rem);width:var(--sd-spacing-10,2.5rem)}.sm-label{height:var(--sd-spacing-8,2rem)}.sm-no-label{height:var(--sd-spacing-8,2rem);width:var(--sd-spacing-8,2rem)}:host(.sd-3-22-10-button-group__button--first:not(.sd-3-22-10-button-group__button--last)) button{border-top-right-radius:var(--sd-border-radius-none,0);border-bottom-right-radius:var(--sd-border-radius-none,0)}:host(.sd-3-22-10-button-group__button--inner) button{border-radius:var(--sd-border-radius-none,0)}:host(.sd-3-22-10-button-group__button--last:not(.sd-3-22-10-button-group__button--first)) button{border-top-left-radius:var(--sd-border-radius-none,0);border-bottom-left-radius:var(--sd-border-radius-none,0)}:host(.sd-3-22-10-button-group__button:not(.sd-3-22-10-button-group__button--first)){margin-inline-start:-1px}:host(.sd-3-22-10-button-group__button--hover){z-index:10}:host(.sd-3-22-10-button-group__button--focus),:host(.sd-3-22-10-button-group__button[checked]){z-index:20}`],p([i(".button")],m.prototype,"input",2),p([i(".hidden-input")],m.prototype,"hiddenInput",2),p([u()],m.prototype,"hasFocus",2),p([a({reflect:!0})],m.prototype,"size",2),p([a({type:Boolean,reflect:!0})],m.prototype,"disabled",2),p([a({type:Boolean,reflect:!0})],m.prototype,"checked",2),p([a()],m.prototype,"value",2),p([h("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),m=p([n("sd-3-22-10-radio-button")],m);export{m as default};
|