@solid-design-system/components 2.12.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/custom-elements.json +1 -1
  2. package/dist/styles/solid-styles.css +1 -1
  3. package/dist/versioned-components/es/accordion-group.js +1 -1
  4. package/dist/versioned-components/es/accordion.js +1 -1
  5. package/dist/versioned-components/es/badge.js +1 -1
  6. package/dist/versioned-components/es/brandshape.js +1 -1
  7. package/dist/versioned-components/es/button.js +1 -1
  8. package/dist/versioned-components/es/carousel-item.js +1 -1
  9. package/dist/versioned-components/es/carousel.js +3 -3
  10. package/dist/versioned-components/es/checkbox-group.js +1 -1
  11. package/dist/versioned-components/es/checkbox.js +1 -1
  12. package/dist/versioned-components/es/dialog.js +1 -1
  13. package/dist/versioned-components/es/divider.js +1 -1
  14. package/dist/versioned-components/es/drawer.js +1 -1
  15. package/dist/versioned-components/es/dropdown.js +1 -1
  16. package/dist/versioned-components/es/form.js +1 -1
  17. package/dist/versioned-components/es/header.js +1 -1
  18. package/dist/versioned-components/es/icon.js +1 -1
  19. package/dist/versioned-components/es/include.js +1 -1
  20. package/dist/versioned-components/es/input.js +1 -1
  21. package/dist/versioned-components/es/link.js +1 -1
  22. package/dist/versioned-components/es/map-marker.js +1 -1
  23. package/dist/versioned-components/es/navigation-item.js +1 -1
  24. package/dist/versioned-components/es/notification.js +1 -1
  25. package/dist/versioned-components/es/option.js +1 -1
  26. package/dist/versioned-components/es/popup.js +1 -1
  27. package/dist/versioned-components/es/radio-button.js +1 -1
  28. package/dist/versioned-components/es/radio-group.js +1 -1
  29. package/dist/versioned-components/es/radio.js +1 -1
  30. package/dist/versioned-components/es/select.js +3 -3
  31. package/dist/versioned-components/es/spinner.js +1 -1
  32. package/dist/versioned-components/es/switch.js +1 -1
  33. package/dist/versioned-components/es/tab-group.js +1 -1
  34. package/dist/versioned-components/es/tab-panel.js +1 -1
  35. package/dist/versioned-components/es/tab.js +1 -1
  36. package/dist/versioned-components/es/tag.js +1 -1
  37. package/dist/versioned-components/es/teaser-media.js +1 -1
  38. package/dist/versioned-components/es/teaser.js +1 -1
  39. package/dist/versioned-components/es/textarea.js +1 -1
  40. package/dist/versioned-components/es/tooltip.js +2 -2
  41. package/dist/versioned-components/es/video.js +1 -1
  42. package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
  43. package/dist/versioned-package/_components/button-group/button-group.js +11 -11
  44. package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
  45. package/dist/versioned-package/components/accordion/accordion.js +2 -2
  46. package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
  47. package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
  48. package/dist/versioned-package/components/badge/badge.d.ts +1 -1
  49. package/dist/versioned-package/components/badge/badge.js +1 -1
  50. package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
  51. package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
  52. package/dist/versioned-package/components/button/button.d.ts +1 -1
  53. package/dist/versioned-package/components/button/button.js +4 -4
  54. package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
  55. package/dist/versioned-package/components/carousel/carousel.js +6 -6
  56. package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
  57. package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
  58. package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
  59. package/dist/versioned-package/components/checkbox/checkbox.js +4 -4
  60. package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
  61. package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
  62. package/dist/versioned-package/components/dialog/dialog.d.ts +1 -1
  63. package/dist/versioned-package/components/dialog/dialog.js +2 -2
  64. package/dist/versioned-package/components/divider/divider.d.ts +1 -1
  65. package/dist/versioned-package/components/divider/divider.js +2 -2
  66. package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
  67. package/dist/versioned-package/components/drawer/drawer.js +2 -2
  68. package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
  69. package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
  70. package/dist/versioned-package/components/header/header.d.ts +1 -1
  71. package/dist/versioned-package/components/header/header.js +4 -4
  72. package/dist/versioned-package/components/icon/icon.d.ts +1 -1
  73. package/dist/versioned-package/components/icon/icon.js +1 -1
  74. package/dist/versioned-package/components/include/include.d.ts +1 -1
  75. package/dist/versioned-package/components/include/include.js +1 -1
  76. package/dist/versioned-package/components/input/input.d.ts +1 -1
  77. package/dist/versioned-package/components/input/input.js +4 -4
  78. package/dist/versioned-package/components/link/link.d.ts +1 -1
  79. package/dist/versioned-package/components/link/link.js +2 -2
  80. package/dist/versioned-package/components/map-marker/map-marker.d.ts +1 -1
  81. package/dist/versioned-package/components/map-marker/map-marker.js +1 -1
  82. package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
  83. package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
  84. package/dist/versioned-package/components/notification/notification.d.ts +1 -1
  85. package/dist/versioned-package/components/notification/notification.js +5 -5
  86. package/dist/versioned-package/components/option/option.d.ts +1 -1
  87. package/dist/versioned-package/components/option/option.js +2 -2
  88. package/dist/versioned-package/components/popup/popup.d.ts +1 -1
  89. package/dist/versioned-package/components/popup/popup.js +1 -1
  90. package/dist/versioned-package/components/radio/radio.d.ts +1 -1
  91. package/dist/versioned-package/components/radio/radio.js +2 -2
  92. package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
  93. package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
  94. package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
  95. package/dist/versioned-package/components/radio-group/radio-group.js +15 -15
  96. package/dist/versioned-package/components/select/select.d.ts +4 -4
  97. package/dist/versioned-package/components/select/select.js +29 -29
  98. package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
  99. package/dist/versioned-package/components/spinner/spinner.js +1 -1
  100. package/dist/versioned-package/components/switch/switch.d.ts +1 -1
  101. package/dist/versioned-package/components/switch/switch.js +2 -2
  102. package/dist/versioned-package/components/tab/tab.d.ts +1 -1
  103. package/dist/versioned-package/components/tab/tab.js +2 -2
  104. package/dist/versioned-package/components/tab-group/tab-group.d.ts +1 -1
  105. package/dist/versioned-package/components/tab-group/tab-group.js +15 -15
  106. package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
  107. package/dist/versioned-package/components/tab-panel/tab-panel.js +2 -2
  108. package/dist/versioned-package/components/tag/tag.d.ts +1 -1
  109. package/dist/versioned-package/components/tag/tag.js +2 -2
  110. package/dist/versioned-package/components/teaser/teaser.js +1 -1
  111. package/dist/versioned-package/components/teaser-media/teaser-media.js +1 -1
  112. package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
  113. package/dist/versioned-package/components/textarea/textarea.js +3 -3
  114. package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
  115. package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
  116. package/dist/versioned-package/components/video/video.d.ts +1 -1
  117. package/dist/versioned-package/components/video/video.js +2 -2
  118. package/dist/versioned-package/internal/form.js +3 -3
  119. package/dist/versioned-package/styles/headline/headline.css.js +1 -1
  120. package/dist/versioned-styles/solid-styles.css +1 -1
  121. package/dist/vscode.html-custom-data.json +38 -38
  122. package/dist/web-types.json +39 -39
  123. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import{s as t,a as e,w as s}from"./event.js";import{S as i,x as o,i as l,n as a,c as n}from"./solid-element.js";import{d as r}from"./default-value.js";import{F as h}from"./form.js";import{g as p,s as d}from"./animation-registry.js";import{H as c}from"./slot.js";import{L as u}from"./solid-components2.js";import{r as m}from"./state.js";import{e as y}from"./query.js";import{o as b}from"./query-assigned-elements.js";import{s as v}from"./scroll.js";import{o as f,S as g}from"./icon.js";import{w as x}from"./watch.js";import{c as w}from"./component.styles.js";import{t as O}from"./classix.js";import C from"./popup.js";import S from"./tag.js";var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?k(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&$(e,s,l),l};let I=class extends i{constructor(){super(...arguments),this.formControlController=new h(this,{assumeInteractionOn:["sd-blur","sd-2-12-0-input"]}),this.hasSlotController=new c(this,"help-text","label"),this.localize=new u(this),this.typeToSelectString="",this.hasHover=!1,this.displayLabel="",this.hasFocus=!1,this.selectedOptions=[],this.showValidStyle=!1,this.showInvalidStyle=!1,this.defaultValue="",this.open=!1,this.size="lg",this.label="",this.placeholder=this.localize.term("selectDefaultPlaceholder"),this.helpText="",this.placement="bottom",this.currentPlacement=this.placement,this.clearable=!1,this.disabled=!1,this.multiple=!1,this.useTags=!1,this.maxOptionsVisible=3,this.form="",this.name="",this.value="",this.required=!1,this.styleOnValid=!1,this.hoist=!1,this.getTag=t=>o`<sd-2-12-0-tag ?disabled="${this.disabled}" part="tag" exportparts="
1
+ import{s as t,a as e,w as s}from"./event.js";import{S as i,x as o,i as l,n as a,c as n}from"./solid-element.js";import{d as r}from"./default-value.js";import{F as h}from"./form.js";import{g as p,s as d}from"./animation-registry.js";import{H as c}from"./slot.js";import{L as u}from"./solid-components2.js";import{r as m}from"./state.js";import{e as y}from"./query.js";import{o as b}from"./query-assigned-elements.js";import{s as v}from"./scroll.js";import{o as f,S as g}from"./icon.js";import{w as x}from"./watch.js";import{c as w}from"./component.styles.js";import{t as O}from"./classix.js";import C from"./popup.js";import S from"./tag.js";var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=(t,e,s,i)=>{for(var o,l=i>1?void 0:i?k(e,s):e,a=t.length-1;a>=0;a--)(o=t[a])&&(l=(i?o(e,s,l):o(l))||l);return i&&l&&$(e,s,l),l};let I=class extends i{constructor(){super(...arguments),this.formControlController=new h(this,{assumeInteractionOn:["sd-blur","sd-3-0-0-input"]}),this.hasSlotController=new c(this,"help-text","label"),this.localize=new u(this),this.typeToSelectString="",this.hasHover=!1,this.displayLabel="",this.hasFocus=!1,this.selectedOptions=[],this.showValidStyle=!1,this.showInvalidStyle=!1,this.defaultValue="",this.open=!1,this.size="lg",this.label="",this.placeholder=this.localize.term("selectDefaultPlaceholder"),this.helpText="",this.placement="bottom",this.currentPlacement=this.placement,this.clearable=!1,this.disabled=!1,this.multiple=!1,this.useTags=!1,this.maxOptionsVisible=3,this.form="",this.name="",this.value="",this.required=!1,this.styleOnValid=!1,this.hoist=!1,this.getTag=t=>o`<sd-3-0-0-tag ?disabled="${this.disabled}" part="tag" exportparts="
2
2
  base:tag__base,
3
3
  content:tag__content,
4
4
  removable-indicator:tag__removable-indicator,
5
- " size="${"sm"===this.size?"sm":"lg"}" removable @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-2-12-0-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,s=null!==e.closest(".select__clear"),i=null!==e.closest("sd-2-12-0-icon-button");if(!s&&!i){if("Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("sd-2-12-0-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),s=e.indexOf(this.currentOption);let i=Math.max(0,s);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(i=s+1,i>e.length-1&&(i=0)):"ArrowUp"===t.key?(i=s-1,i<0&&(i=e.length-1)):"Home"===t.key?i=0:"End"===t.key&&(i=e.length-1),this.setCurrentOption(e[i])}if(1===t.key.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e)if(t.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.applySizeToOptions(),this.open=!1}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-2-12-0-input"),this.emit("sd-change")})))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-2-12-0-option"),s=this.value;e&&!e.disabled&&(this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-2-12-0-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],s=[];customElements.get("sd-2-12-0-option")?(t.forEach((t=>{this.multiple&&(t.checkbox=!0),s.push(t.value)})),this.setSelectedOptions(t.filter((t=>e.includes(t.value))))):customElements.whenDefined("sd-2-12-0-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(t,e){t.stopPropagation(),this.disabled||(this.toggleOptionSelection(e,!1),this.updateComplete.then((()=>{this.emit("sd-2-12-0-input"),this.emit("sd-change")})))}getAllOptions(){return[...this.querySelectorAll("sd-2-12-0-option")]}getFirstOption(){return this.querySelector("sd-2-12-0-option")}setCurrentOption(t){this.getAllOptions().forEach((t=>{t.current=!1,t.tabIndex=-1})),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus())}setSelectedOptions(t){const e=this.getAllOptions(),s=Array.isArray(t)?t:[t];e.forEach((t=>t.selected=!1)),s.length&&s.forEach((t=>t.selected=!0)),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){var t,e;this.selectedOptions=this.getAllOptions().filter((t=>t.selected)),this.multiple?(this.value=this.selectedOptions.map((t=>t.value)),this.useTags||0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)??"",this.displayLabel=(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())??""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}get tags(){return this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?f(s):s}</div>`}return e===this.maxOptionsVisible?o`<sd-2-12-0-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-2-12-0-tag>`:o``}))}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){const t=this.getAllOptions();customElements.get("sd-2-12-0-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:s,options:i}=p(this,"select.show",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.currentOption&&v(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=p(this,"select.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach((t=>{t.size=this.size}))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter((t=>e.includes(t.value))))}async show(){if(!this.open&&!this.disabled)return this.open=!0,s(this,"sd-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,s(this,"sd-after-hide");this.open=!1}checkValidity(){var t;return null==(t=this.valueInput)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}render(){this.hasSlotController.test("[default]");const t=this.hasSlotController.test("label"),e=(this.hasSlotController.test("clear-icon"),this.hasSlotController.test("expand-icon"),this.hasSlotController.test("help-text")),s=!!this.label||!!t,i=!!this.helpText||!!e,l=this.clearable&&!this.disabled&&this.value.length>0,a=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",n=this.disabled?"cursor-not-allowed":"cursor-pointer",r={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],h={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${O("relative text-left",n,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${s&&"inline-block mb-2"}" aria-hidden="${s?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${O("relative w-full bg-white",{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[a])}"><div part="border" class="${O("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-2-12-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${O("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
5
+ " size="${"sm"===this.size?"sm":"lg"}" removable @sd-remove="${e=>this.handleTagRemove(e,t)}">${t.getTextLabel()}</sd-3-0-0-tag>`,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,s=null!==e.closest(".select__clear"),i=null!==e.closest("sd-3-0-0-icon-button");if(!s&&!i){if("Escape"===t.key&&this.open&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then((()=>{this.emit("sd-3-0-0-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),s=e.indexOf(this.currentOption);let i=Math.max(0,s);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(i=s+1,i>e.length-1&&(i=0)):"ArrowUp"===t.key?(i=s-1,i<0&&(i=e.length-1)):"Home"===t.key?i=0:"End"===t.key&&(i=e.length-1),this.setCurrentOption(e[i])}if(1===t.key.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout((()=>this.typeToSelectString=""),1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e)if(t.getTextLabel().toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}get validity(){return this.valueInput.validity}get validationMessage(){return this.valueInput.validationMessage}connectedCallback(){super.connectedCallback(),this.applySizeToOptions(),this.open=!1}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}handleFocus(){this.hasFocus=!0,this.displayInput.setSelectionRange(0,0),this.emit("sd-focus")}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleLabelClick(){this.displayInput.focus()}handleComboboxMouseDown(t){const e=t.composedPath().some((t=>t instanceof HTMLSlotElement&&"removable-indicator"===t.name));this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),""!==this.value&&(this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then((()=>{this.emit("sd-clear"),this.emit("sd-3-0-0-input"),this.emit("sd-change")})))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("sd-3-0-0-option"),s=this.value;e&&!e.disabled&&(this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then((()=>this.displayInput.focus({preventScroll:!0}))),this.value!==s&&this.updateComplete.then((()=>{this.emit("sd-3-0-0-input"),this.emit("sd-change")})),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],s=[];customElements.get("sd-3-0-0-option")?(t.forEach((t=>{this.multiple&&(t.checkbox=!0),s.push(t.value)})),this.setSelectedOptions(t.filter((t=>e.includes(t.value))))):customElements.whenDefined("sd-3-0-0-option").then((()=>this.handleDefaultSlotChange()))}handleTagRemove(t,e){t.stopPropagation(),this.disabled||(this.toggleOptionSelection(e,!1),this.updateComplete.then((()=>{this.emit("sd-3-0-0-input"),this.emit("sd-change")})))}getAllOptions(){return[...this.querySelectorAll("sd-3-0-0-option")]}getFirstOption(){return this.querySelector("sd-3-0-0-option")}setCurrentOption(t){this.getAllOptions().forEach((t=>{t.current=!1,t.tabIndex=-1})),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus())}setSelectedOptions(t){const e=this.getAllOptions(),s=Array.isArray(t)?t:[t];e.forEach((t=>t.selected=!1)),s.length&&s.forEach((t=>t.selected=!0)),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){var t,e;this.selectedOptions=this.getAllOptions().filter((t=>t.selected)),this.multiple?(this.value=this.selectedOptions.map((t=>t.value)),this.useTags||0===this.value.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length)):(this.value=(null==(t=this.selectedOptions[0])?void 0:t.value)??"",this.displayLabel=(null==(e=this.selectedOptions[0])?void 0:e.getTextLabel())??""),this.updateComplete.then((()=>{this.formControlController.updateValidity()}))}get tags(){return this.selectedOptions.map(((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const s=this.getTag(t,e);return o`<div @sd-remove="${e=>this.handleTagRemove(e,t)}">${"string"==typeof s?f(s):s}</div>`}return e===this.maxOptionsVisible?o`<sd-3-0-0-tag size="${"sm"===this.size?"sm":"lg"}" ?disabled="${this.disabled}">+${this.selectedOptions.length-e}</sd-3-0-0-tag>`:o``}))}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}handleMouseEnter(){this.hasHover=!0}handleMouseLeave(){this.hasHover=!1}handleCurrentPlacement(t){const e=t.detail;e&&(this.currentPlacement=e)}handleUseTagsChange(){const t=this.getAllOptions();customElements.get("sd-3-0-0-option")&&t.forEach((t=>{t.checkbox=this.multiple}))}handleDisabledChange(){this.disabled&&(this.open=!1,this.handleOpenChange())}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption()),this.emit("sd-show"),this.addOpenListeners(),await t(this),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame((()=>{this.setCurrentOption(this.currentOption)}));const{keyframes:s,options:i}=p(this,"select.show",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.currentOption&&v(this.currentOption,this.listbox,"vertical","auto"),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:s,options:i}=p(this,"select.hide",{dir:this.localize.dir()});await e(this.popup.popup,s,i),this.listbox.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}applySizeToOptions(){this._optionsInDefaultSlot.forEach((t=>{t.size=this.size}))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value];this.setSelectedOptions(t.filter((t=>e.includes(t.value))))}async show(){if(!this.open&&!this.disabled)return this.open=!0,s(this,"sd-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,s(this,"sd-after-hide");this.open=!1}checkValidity(){var t;return null==(t=this.valueInput)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.valueInput.reportValidity()}setCustomValidity(t){this.valueInput.setCustomValidity(t),this.formControlController.updateValidity()}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}render(){this.hasSlotController.test("[default]");const t=this.hasSlotController.test("label"),e=(this.hasSlotController.test("clear-icon"),this.hasSlotController.test("expand-icon"),this.hasSlotController.test("help-text")),s=!!this.label||!!t,i=!!this.helpText||!!e,l=this.clearable&&!this.disabled&&this.value.length>0,a=this.disabled?"disabled":this.hasFocus&&this.showInvalidStyle?"activeInvalid":this.hasFocus&&this.styleOnValid&&this.showValidStyle?"activeValid":this.hasFocus||this.open?"active":this.showInvalidStyle?"invalid":this.styleOnValid&&this.showValidStyle?"valid":"default",n=this.disabled?"cursor-not-allowed":"cursor-pointer",r={sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size],h={sm:"text-base",md:"text-lg",lg:"text-xl"}[this.size];return o`<div part="form-control" class="${O("relative text-left",n,"sm"===this.size?"text-sm":"text-base",this.open&&"z-50")}"><label id="label" part="form-control-label" class="${s&&"inline-block mb-2"}" aria-hidden="${s?"false":"true"}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${O("relative w-full bg-white",{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[a])}"><div part="border" class="${O("absolute top-0 w-full h-full pointer-events-none border rounded-default",this.hasHover&&"bg-neutral-200",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[a],this.open&&("bottom"===this.currentPlacement?"rounded-bl-none rounded-br-none":"rounded-tl-none rounded-tr-none"))}"></div><sd-3-0-0-popup @sd-current-placement="${this.handleCurrentPlacement}" class="${O("inline-flex relative w-full","bottom"===this.currentPlacement?"origin-top":"origin-bottom")}" placement="${this.placement}" strategy="${this.hoist?"fixed":"absolute"}" flip shift sync="width" auto-size="vertical" auto-size-padding="10" exportparts="
6
6
  popup:popup__content,
7
- "><div part="combobox" class="${O("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${O("appearance-none outline-none flex-grow bg-transparent w-full",n,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${O("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?o`<button part="clear-button" class="${O("select__clear flex justify-center",r)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-2-12-0-icon class="${O("text-neutral-500",h)}" library="system" name="closing-round"></sd-2-12-0-icon></slot></button>`:""} ${this.showInvalidStyle?o`<sd-2-12-0-icon part="invalid-icon" class="${O(r,h)}" library="system" name="risk"></sd-2-12-0-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-2-12-0-icon part="valid-icon" class="${O("flex-shrink-0",r,h)}" library="system" name="confirm"></sd-2-12-0-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${O("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",this.disabled?"text-neutral-500":"text-primary",h)}"><sd-2-12-0-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-2-12-0-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${O("bg-white px-2 py-3 relative border-primary",this.open&&"shadow","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-2-12-0-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${i?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-2-12-0-icon":g,"sd-2-12-0-popup":C,"sd-2-12-0-tag":S},I.styles=[w,i.styles,l`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-2-12-0-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll}sd-2-12-0-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-2-12-0-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-2-12-0-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`],D([b({selector:"sd-2-12-0-option"})],I.prototype,"_optionsInDefaultSlot",2),D([y("sd-2-12-0-popup")],I.prototype,"popup",2),D([y('[part="combobox"]')],I.prototype,"combobox",2),D([y('[part="display-input"]')],I.prototype,"displayInput",2),D([y(".value-input")],I.prototype,"valueInput",2),D([y('[part="listbox"]')],I.prototype,"listbox",2),D([y("#invalid-message")],I.prototype,"invalidMessage",2),D([m()],I.prototype,"hasHover",2),D([m()],I.prototype,"displayLabel",2),D([m()],I.prototype,"hasFocus",2),D([m()],I.prototype,"currentOption",2),D([m()],I.prototype,"selectedOptions",2),D([m()],I.prototype,"showValidStyle",2),D([m()],I.prototype,"showInvalidStyle",2),D([r()],I.prototype,"defaultValue",2),D([a({type:Boolean,reflect:!0})],I.prototype,"open",2),D([a({reflect:!0})],I.prototype,"size",2),D([a()],I.prototype,"label",2),D([a()],I.prototype,"placeholder",2),D([a({attribute:"help-text"})],I.prototype,"helpText",2),D([a({reflect:!0})],I.prototype,"placement",2),D([m()],I.prototype,"currentPlacement",2),D([a({type:Boolean})],I.prototype,"clearable",2),D([a({type:Boolean,reflect:!0})],I.prototype,"disabled",2),D([a({type:Boolean,reflect:!0})],I.prototype,"multiple",2),D([a({type:Boolean,reflect:!0})],I.prototype,"useTags",2),D([a({attribute:"max-options-visible",type:Number})],I.prototype,"maxOptionsVisible",2),D([a({reflect:!0})],I.prototype,"form",2),D([a()],I.prototype,"name",2),D([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],I.prototype,"value",2),D([a({type:Boolean,reflect:!0})],I.prototype,"required",2),D([a({type:Boolean,reflect:!0,attribute:"style-on-valid"})],I.prototype,"styleOnValid",2),D([a({type:Boolean})],I.prototype,"hoist",2),D([a()],I.prototype,"getTag",2),D([x("useTags",{waitUntilFirstUpdate:!0})],I.prototype,"handleUseTagsChange",1),D([x("disabled",{waitUntilFirstUpdate:!0})],I.prototype,"handleDisabledChange",1),D([x("open",{waitUntilFirstUpdate:!0})],I.prototype,"handleOpenChange",1),D([x("size",{waitUntilFirstUpdate:!0})],I.prototype,"applySizeToOptions",1),D([x("value",{waitUntilFirstUpdate:!0})],I.prototype,"handleValueChange",1),I=D([n("sd-2-12-0-select")],I),d("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{I as default};
7
+ "><div part="combobox" class="${O("relative w-full px-4 flex flex-row items-center rounded-default",this.open&&"shadow",{sm:"py-1 min-h-[32px]",md:"py-1 min-h-[40px]",lg:"py-2 min-h-[48px]"}[this.size])}" slot="anchor" @keydown="${this.handleComboboxKeyDown}" @mousedown="${this.handleComboboxMouseDown}" @mouseenter="${this.handleMouseEnter}" @mouseleave="${this.handleMouseLeave}"><input name="${this.name}" form="${this.form}" part="display-input" class="${O("appearance-none outline-none flex-grow bg-transparent w-full",n,this.multiple&&this.useTags&&this.value.length>0?"hidden":"")}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open?"true":"false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled?"true":"false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple&&this.useTags?o`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>`:""} <input class="${O("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10",n)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value)?this.value.join(", "):this.value}" tabindex="-1" aria-hidden="true" @focus="${()=>this.focus()}" @invalid="${this.handleInvalid}"> ${l?o`<button part="clear-button" class="${O("select__clear flex justify-center",r)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-3-0-0-icon class="${O("text-neutral-500",h)}" library="system" name="closing-round"></sd-3-0-0-icon></slot></button>`:""} ${this.showInvalidStyle?o`<sd-3-0-0-icon part="invalid-icon" class="${O(r,h)}" library="system" name="risk"></sd-3-0-0-icon>`:""} ${this.styleOnValid&&this.showValidStyle?o`<sd-3-0-0-icon part="valid-icon" class="${O("flex-shrink-0",r,h)}" library="system" name="confirm"></sd-3-0-0-icon>`:""}<slot name="expand-icon" part="expand-icon" class="${O("inline-flex ml-2 transition-all",this.open?"rotate-180":"rotate-0",this.disabled?"text-neutral-500":"text-primary",h)}"><sd-3-0-0-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-3-0-0-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open?"true":"false"}" aria-multiselectable="${this.multiple?"true":"false"}" aria-labelledby="label" part="listbox" class="${O("bg-white px-2 py-3 relative border-primary",this.open&&"shadow","bottom"===this.currentPlacement?"border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default":"border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default")}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-3-0-0-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${i?"false":"true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`}};I.dependencies={"sd-3-0-0-icon":g,"sd-3-0-0-popup":C,"sd-3-0-0-tag":S},I.styles=[w,i.styles,l`:host{position:relative;display:block;width:100%}:host([required]) #label::after{content:' *'}sd-3-0-0-popup::part(popup){z-index:var(--sd-z-index-dropdown,900);overflow-y:scroll}sd-3-0-0-tag::part(base){border-radius:var(--sd-border-radius-default,.25rem);padding-left:var(--sd-spacing-1,.25rem);padding-right:var(--sd-spacing-1,.25rem)}sd-3-0-0-tag[size=lg]::part(base){padding-left:var(--sd-spacing-2,.5rem);padding-right:var(--sd-spacing-2,.5rem)}sd-3-0-0-tag[disabled=false]::part(base):hover{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249) / var(--tw-bg-opacity))}`],D([b({selector:"sd-3-0-0-option"})],I.prototype,"_optionsInDefaultSlot",2),D([y("sd-3-0-0-popup")],I.prototype,"popup",2),D([y('[part="combobox"]')],I.prototype,"combobox",2),D([y('[part="display-input"]')],I.prototype,"displayInput",2),D([y(".value-input")],I.prototype,"valueInput",2),D([y('[part="listbox"]')],I.prototype,"listbox",2),D([y("#invalid-message")],I.prototype,"invalidMessage",2),D([m()],I.prototype,"hasHover",2),D([m()],I.prototype,"displayLabel",2),D([m()],I.prototype,"hasFocus",2),D([m()],I.prototype,"currentOption",2),D([m()],I.prototype,"selectedOptions",2),D([m()],I.prototype,"showValidStyle",2),D([m()],I.prototype,"showInvalidStyle",2),D([r()],I.prototype,"defaultValue",2),D([a({type:Boolean,reflect:!0})],I.prototype,"open",2),D([a({reflect:!0})],I.prototype,"size",2),D([a()],I.prototype,"label",2),D([a()],I.prototype,"placeholder",2),D([a({attribute:"help-text"})],I.prototype,"helpText",2),D([a({reflect:!0})],I.prototype,"placement",2),D([m()],I.prototype,"currentPlacement",2),D([a({type:Boolean})],I.prototype,"clearable",2),D([a({type:Boolean,reflect:!0})],I.prototype,"disabled",2),D([a({type:Boolean,reflect:!0})],I.prototype,"multiple",2),D([a({type:Boolean,reflect:!0})],I.prototype,"useTags",2),D([a({attribute:"max-options-visible",type:Number})],I.prototype,"maxOptionsVisible",2),D([a({reflect:!0})],I.prototype,"form",2),D([a()],I.prototype,"name",2),D([a({converter:{fromAttribute:t=>t.split(" "),toAttribute:t=>t.join(" ")}})],I.prototype,"value",2),D([a({type:Boolean,reflect:!0})],I.prototype,"required",2),D([a({type:Boolean,reflect:!0,attribute:"style-on-valid"})],I.prototype,"styleOnValid",2),D([a({type:Boolean})],I.prototype,"hoist",2),D([a()],I.prototype,"getTag",2),D([x("useTags",{waitUntilFirstUpdate:!0})],I.prototype,"handleUseTagsChange",1),D([x("disabled",{waitUntilFirstUpdate:!0})],I.prototype,"handleDisabledChange",1),D([x("open",{waitUntilFirstUpdate:!0})],I.prototype,"handleOpenChange",1),D([x("size",{waitUntilFirstUpdate:!0})],I.prototype,"applySizeToOptions",1),D([x("value",{waitUntilFirstUpdate:!0})],I.prototype,"handleValueChange",1),I=D([n("sd-3-0-0-select")],I),d("select.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),d("select.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{I as default};
@@ -1 +1 @@
1
- import{S as e,x as r,i as s,n as t,c as l}from"./solid-element.js";import{L as o}from"./solid-components2.js";import{t as i}from"./classix.js";var a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,c=(e,r,s,t)=>{for(var l,o=t>1?void 0:t?n(r,s):r,i=e.length-1;i>=0;i--)(l=e[i])&&(o=(t?l(r,s,o):l(o))||o);return t&&o&&a(r,s,o),o};let p=class extends e{constructor(){super(...arguments),this.color="currentColor",this.localize=new o(this)}render(){return r`<svg role="progressbar" viewBox="0 0 24 24" class="${i("animate-spin",{primary:"text-primary",white:"text-white",currentColor:""}[this.color])}" aria-label="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`}};p.styles=[e.styles,s`:host{display:inline-block;width:1em;height:1em}`],c([t({reflect:!0})],p.prototype,"color",2),p=c([l("sd-2-12-0-spinner")],p);export{p as default};
1
+ import{S as e,x as r,i as s,n as t,c as l}from"./solid-element.js";import{L as o}from"./solid-components2.js";import{t as i}from"./classix.js";var a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,c=(e,r,s,t)=>{for(var l,o=t>1?void 0:t?n(r,s):r,i=e.length-1;i>=0;i--)(l=e[i])&&(o=(t?l(r,s,o):l(o))||o);return t&&o&&a(r,s,o),o};let p=class extends e{constructor(){super(...arguments),this.color="currentColor",this.localize=new o(this)}render(){return r`<svg role="progressbar" viewBox="0 0 24 24" class="${i("animate-spin",{primary:"text-primary",white:"text-white",currentColor:""}[this.color])}" aria-label="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`}};p.styles=[e.styles,s`:host{display:inline-block;width:1em;height:1em}`],c([t({reflect:!0})],p.prototype,"color",2),p=c([l("sd-3-0-0-spinner")],p);export{p as default};
@@ -1 +1 @@
1
- import{S as e,x as t,i,n as r,c as s}from"./solid-element.js";import{d as l}from"./default-value.js";import{F as o}from"./form.js";import{o as a}from"./if-defined.js";import{l as n}from"./live.js";import{r as d}from"./state.js";import{e as h}from"./query.js";import{w as c}from"./watch.js";import{t as u}from"./classix.js";var p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?b(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&p(t,i,l),l};let m=class extends e{constructor(){super(...arguments),this.formControlController=new o(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.showInvalidStyle=!1,this.title="",this.name="",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-2-12-0-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){return t`<label part="base" class="${u("group flex items-center text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed")}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${a(this.value)}" .checked="${n(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"}" class="${u("relative flex flex-initial items-center justify-center border rounded-full h-4 w-8 transition-colors ease duration-100\n peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\n peer-focus-visible:outline-primary",this.disabled&&this.checked?"border-neutral-500 bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?"border-error bg-error hover:bg-error-400":this.checked?"border-accent bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"border-neutral-800 bg-white hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span id="thumb" part="thumb" class="${u("w-2.5 h-2.5 rounded-full transition-transform ease-in-out duration-200",this.disabled&&this.checked?"bg-white":this.disabled?"-translate-x-2 bg-neutral-500":this.showInvalidStyle?"bg-white -translate-x-2":this.checked?"translate-x-2 bg-white":"bg-neutral-800 -translate-x-2")}"></span> </span><span part="label" id="label" class="${u("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};m.styles=[e.styles,i`:host{display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host([required]) #label::after{content:' *'}`],f([h("input")],m.prototype,"input",2),f([h("#invalid-message")],m.prototype,"invalidMessage",2),f([d()],m.prototype,"showInvalidStyle",2),f([r()],m.prototype,"title",2),f([r()],m.prototype,"name",2),f([r()],m.prototype,"value",2),f([r({type:Boolean,reflect:!0})],m.prototype,"disabled",2),f([r({type:Boolean,reflect:!0})],m.prototype,"checked",2),f([l("checked")],m.prototype,"defaultChecked",2),f([r({reflect:!0})],m.prototype,"form",2),f([r({type:Boolean,reflect:!0})],m.prototype,"required",2),f([c("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),f([c(["checked"],{waitUntilFirstUpdate:!0})],m.prototype,"handleStateChange",1),m=f([s("sd-2-12-0-switch")],m);export{m as default};
1
+ import{S as e,x as t,i,n as r,c as s}from"./solid-element.js";import{d as l}from"./default-value.js";import{F as o}from"./form.js";import{o as a}from"./if-defined.js";import{l as n}from"./live.js";import{r as d}from"./state.js";import{e as h}from"./query.js";import{w as c}from"./watch.js";import{t as u}from"./classix.js";var p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?b(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&p(t,i,l),l};let m=class extends e{constructor(){super(...arguments),this.formControlController=new o(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.showInvalidStyle=!1,this.title="",this.name="",this.disabled=!1,this.checked=!1,this.defaultChecked=!1,this.form="",this.required=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-3-0-0-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){return t`<label part="base" class="${u("group flex items-center text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed")}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${a(this.value)}" .checked="${n(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked?"true":"false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked?" control--checked":"control--unchecked"}" class="${u("relative flex flex-initial items-center justify-center border rounded-full h-4 w-8 transition-colors ease duration-100\n peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\n peer-focus-visible:outline-primary",this.disabled&&this.checked?"border-neutral-500 bg-neutral-500":this.disabled?"border-neutral-500":this.showInvalidStyle?"border-error bg-error hover:bg-error-400":this.checked?"border-accent bg-accent hover:bg-accent-550 group-hover:bg-accent-550":"border-neutral-800 bg-white hover:bg-neutral-200 group-hover:bg-neutral-200")}"><span id="thumb" part="thumb" class="${u("w-2.5 h-2.5 rounded-full transition-transform ease-in-out duration-200",this.disabled&&this.checked?"bg-white":this.disabled?"-translate-x-2 bg-neutral-500":this.showInvalidStyle?"bg-white -translate-x-2":this.checked?"translate-x-2 bg-white":"bg-neutral-800 -translate-x-2")}"></span> </span><span part="label" id="label" class="${u("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};m.styles=[e.styles,i`:host{display:block}:host(:focus-visible){outline:2px solid transparent;outline-offset:2px}:host([required]) #label::after{content:' *'}`],f([h("input")],m.prototype,"input",2),f([h("#invalid-message")],m.prototype,"invalidMessage",2),f([d()],m.prototype,"showInvalidStyle",2),f([r()],m.prototype,"title",2),f([r()],m.prototype,"name",2),f([r()],m.prototype,"value",2),f([r({type:Boolean,reflect:!0})],m.prototype,"disabled",2),f([r({type:Boolean,reflect:!0})],m.prototype,"checked",2),f([l("checked")],m.prototype,"defaultChecked",2),f([r({reflect:!0})],m.prototype,"form",2),f([r({type:Boolean,reflect:!0})],m.prototype,"required",2),f([c("disabled",{waitUntilFirstUpdate:!0})],m.prototype,"handleDisabledChange",1),f([c(["checked"],{waitUntilFirstUpdate:!0})],m.prototype,"handleStateChange",1),m=f([s("sd-3-0-0-switch")],m);export{m as default};
@@ -1 +1 @@
1
- import{S as t,x as e,r as s,i as a,n as i,c as o}from"./solid-element.js";import{L as r}from"./solid-components2.js";import{r as l}from"./state.js";import{e as n}from"./query.js";import{s as c}from"./scroll.js";import{c as h}from"./component.styles.js";import{t as b}from"./classix.js";import{I as d}from"./interactive.js";var v=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=(t,e,s,a)=>{for(var i,o=a>1?void 0:a?u(e,s):e,r=t.length-1;r>=0;r--)(i=t[r])&&(o=(a?i(e,s,o):i(o))||o);return a&&o&&v(e,s,o),o};let m=class extends t{constructor(){super(...arguments),this.localize=new r(this),this.tabs=[],this.panels=[],this.hasScrollControls=!1,this.variant="default",this.activation="auto"}connectedCallback(){const t=Promise.all([customElements.whenDefined("sd-2-12-0-tab"),customElements.whenDefined("sd-2-12-0-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{t.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),t.some((t=>"disabled"===t.attributeName))&&this.syncTabsAndPanels()})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(this.activeTab??this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.unobserve(this.nav)}getAllTabs(t={includeDisabled:!0}){return[...this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()].filter((e=>t.includeDisabled?"sd-2-12-0-tab"===e.tagName.toLowerCase():"sd-2-12-0-tab"===e.tagName.toLowerCase()&&!e.disabled))}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sd-2-12-0-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.matches(":focus")))}handleClick(t){const e=t.target.closest("sd-2-12-0-tab");(null==e?void 0:e.closest("sd-2-12-0-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sd-2-12-0-tab");if((null==e?void 0:e.closest("sd-2-12-0-tab-group"))===this){if(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["Tab"].includes(t.key)){const t=this.tabs.indexOf(this.getActiveTab());null!==e&&c(this.tabs[t+1],this.nav,"horizontal")}if(["Shift","Tab"].includes(t.key)){const t=this.tabs.indexOf(this.getActiveTab());null!==e&&c(this.tabs[t-1],this.nav,"horizontal")}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.tabs.find((t=>t.matches(":focus"))),s="rtl"===this.localize.dir();if("sd-2-12-0-tab"===(null==e?void 0:e.tagName.toLowerCase())){let a=this.tabs.indexOf(e);"Home"===t.key?a=0:"End"===t.key?a=this.tabs.length-1:t.key===(s?"ArrowRight":"ArrowLeft")||"ArrowUp"===t.key?a--:(t.key===(s?"ArrowLeft":"ArrowRight")||"ArrowDown"===t.key)&&a++,a<0&&(a=this.tabs.length-1),a>this.tabs.length-1&&(a=0),this.tabs[a].focus({preventScroll:!0}),"auto"===this.activation&&this.setActiveTab(this.tabs[a],{scrollBehavior:"smooth"}),c(this.tabs[a],this.nav,"horizontal"),t.preventDefault()}}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e={emitEvents:!0,scrollBehavior:"auto",...e},t!==this.activeTab&&!t.disabled){const s=this.activeTab;this.activeTab=t,this.tabs.map((t=>t.active=t===this.activeTab)),this.panels.map((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),c(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(s&&this.emit("sd-2-12-0-tab-hide",{detail:{name:s.panel}}),this.emit("sd-2-12-0-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels(),this.updateComplete.then((()=>this.updateScrollControls())),0!==this.tabs.length&&"container"===this.tabs[0].variant&&(this.variant="container")}updateScrollControls(){this.hasScrollControls=this.nav.scrollWidth>this.nav.clientWidth}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t="rtl"===this.localize.dir();return e`<div part="base" class="${b("flex flex-col rounded-none")}" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"><div part="nav" class="${b(this.hasScrollControls&&"relative py-0 px-12")}">${this.hasScrollControls?e`<button part="scroll-button--start" exportparts="base:scroll-button__base" class="${b("sd-interactive flex items-center justify-center absolute top-0 bottom-0 left-0 !outline-offset-0 border-b border-neutral-400 z-10","rtl"===this.localize.dir()&&"left-auto right-0")}" @click="${this.handleScrollToStart}"><sd-2-12-0-icon library="system" name="${t?"chevron-up":"chevron-down"}" class="${b("h-6 w-12 rotate-90 grid place-items-center")}"></sd-2-12-0-icon></button>`:""}<div part="scroll-container" class="flex overflow-x-auto focus-visible:focus-outline !outline-offset-0"><div part="tabs" class="${b("flex flex-auto relative flex-row")}" role="tablist"><div part="separation" class="w-full h-[1px] bg-neutral-400 absolute bottom-0"></div><slot name="nav" @slotchange="${this.syncTabsAndPanels}"></slot></div></div>${this.hasScrollControls?e`<button part="scroll-button--end" exportparts="base:scroll-button__base" class="${b("sd-interactive flex items-center justify-center absolute top-0 bottom-0 right-0 !outline-offset-0 border-b border-neutral-400 z-10","rtl"===this.localize.dir()&&"right-auto left-0")}" @click="${this.handleScrollToEnd}"><sd-2-12-0-icon library="system" name="${t?"chevron-down":"chevron-up"}" class="${b("h-6 w-12 rotate-90 grid place-items-center")}"></sd-2-12-0-icon></button>`:""}</div><slot part="body" class="${b("block auto py-8 px-6","container"===this.variant&&"border border-neutral-400 border-t-0")}" @slotchange="${this.syncTabsAndPanels}"></slot></div>`}};m.styles=[t.styles,s(d),h,a`:host{box-sizing:border-box;display:block}[part=scroll-container]{scrollbar-width:none}[part=scroll-container]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}::slotted(sd-2-12-0-tab-panel){--padding:1rem 0}`],p([n("[part=base]")],m.prototype,"tabGroup",2),p([n("[part=body]")],m.prototype,"body",2),p([n("[part=scroll-container]")],m.prototype,"nav",2),p([l()],m.prototype,"hasScrollControls",2),p([l()],m.prototype,"variant",2),p([i()],m.prototype,"activation",2),m=p([o("sd-2-12-0-tab-group")],m);export{m as default};
1
+ import{S as t,x as e,r as s,i as a,n as i,c as o}from"./solid-element.js";import{L as r}from"./solid-components2.js";import{r as l}from"./state.js";import{e as n}from"./query.js";import{s as c}from"./scroll.js";import{c as h}from"./component.styles.js";import{t as b}from"./classix.js";import{I as d}from"./interactive.js";var v=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=(t,e,s,a)=>{for(var i,o=a>1?void 0:a?u(e,s):e,r=t.length-1;r>=0;r--)(i=t[r])&&(o=(a?i(e,s,o):i(o))||o);return a&&o&&v(e,s,o),o};let m=class extends t{constructor(){super(...arguments),this.localize=new r(this),this.tabs=[],this.panels=[],this.hasScrollControls=!1,this.variant="default",this.activation="auto"}connectedCallback(){const t=Promise.all([customElements.whenDefined("sd-3-0-0-tab"),customElements.whenDefined("sd-3-0-0-tab-panel")]);super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>{this.updateScrollControls()})),this.mutationObserver=new MutationObserver((t=>{t.some((t=>!["aria-labelledby","aria-controls"].includes(t.attributeName)))&&setTimeout((()=>this.setAriaLabels())),t.some((t=>"disabled"===t.attributeName))&&this.syncTabsAndPanels()})),this.updateComplete.then((()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav),t.then((()=>{new IntersectionObserver(((t,e)=>{t[0].intersectionRatio>0&&(this.setAriaLabels(),this.setActiveTab(this.activeTab??this.tabs[0],{emitEvents:!1}),e.unobserve(t[0].target))})).observe(this.tabGroup)}))}))}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.unobserve(this.nav)}getAllTabs(t={includeDisabled:!0}){return[...this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()].filter((e=>t.includeDisabled?"sd-3-0-0-tab"===e.tagName.toLowerCase():"sd-3-0-0-tab"===e.tagName.toLowerCase()&&!e.disabled))}getAllPanels(){return[...this.body.assignedElements()].filter((t=>"sd-3-0-0-tab-panel"===t.tagName.toLowerCase()))}getActiveTab(){return this.tabs.find((t=>t.matches(":focus")))}handleClick(t){const e=t.target.closest("sd-3-0-0-tab");(null==e?void 0:e.closest("sd-3-0-0-tab-group"))===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("sd-3-0-0-tab");if((null==e?void 0:e.closest("sd-3-0-0-tab-group"))===this){if(["Enter"," "].includes(t.key)&&null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault()),["Tab"].includes(t.key)){const t=this.tabs.indexOf(this.getActiveTab());null!==e&&c(this.tabs[t+1],this.nav,"horizontal")}if(["Shift","Tab"].includes(t.key)){const t=this.tabs.indexOf(this.getActiveTab());null!==e&&c(this.tabs[t-1],this.nav,"horizontal")}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.tabs.find((t=>t.matches(":focus"))),s="rtl"===this.localize.dir();if("sd-3-0-0-tab"===(null==e?void 0:e.tagName.toLowerCase())){let a=this.tabs.indexOf(e);"Home"===t.key?a=0:"End"===t.key?a=this.tabs.length-1:t.key===(s?"ArrowRight":"ArrowLeft")||"ArrowUp"===t.key?a--:(t.key===(s?"ArrowLeft":"ArrowRight")||"ArrowDown"===t.key)&&a++,a<0&&(a=this.tabs.length-1),a>this.tabs.length-1&&(a=0),this.tabs[a].focus({preventScroll:!0}),"auto"===this.activation&&this.setActiveTab(this.tabs[a],{scrollBehavior:"smooth"}),c(this.tabs[a],this.nav,"horizontal"),t.preventDefault()}}}}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e={emitEvents:!0,scrollBehavior:"auto",...e},t!==this.activeTab&&!t.disabled){const s=this.activeTab;this.activeTab=t,this.tabs.map((t=>t.active=t===this.activeTab)),this.panels.map((t=>{var e;return t.active=t.name===(null==(e=this.activeTab)?void 0:e.panel)})),c(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(s&&this.emit("sd-3-0-0-tab-hide",{detail:{name:s.panel}}),this.emit("sd-3-0-0-tab-show",{detail:{name:this.activeTab.panel}}))}}setAriaLabels(){this.tabs.forEach((t=>{const e=this.panels.find((e=>e.name===t.panel));e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))}))}syncTabsAndPanels(){this.tabs=this.getAllTabs({includeDisabled:!1}),this.panels=this.getAllPanels(),this.updateComplete.then((()=>this.updateScrollControls())),0!==this.tabs.length&&"container"===this.tabs[0].variant&&(this.variant="container")}updateScrollControls(){this.hasScrollControls=this.nav.scrollWidth>this.nav.clientWidth}show(t){const e=this.tabs.find((e=>e.panel===t));e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}render(){const t="rtl"===this.localize.dir();return e`<div part="base" class="${b("flex flex-col rounded-none")}" @click="${this.handleClick}" @keydown="${this.handleKeyDown}"><div part="nav" class="${b(this.hasScrollControls&&"relative py-0 px-12")}">${this.hasScrollControls?e`<button part="scroll-button--start" exportparts="base:scroll-button__base" class="${b("sd-interactive flex items-center justify-center absolute top-0 bottom-0 left-0 !outline-offset-0 border-b border-neutral-400 z-10","rtl"===this.localize.dir()&&"left-auto right-0")}" @click="${this.handleScrollToStart}"><sd-3-0-0-icon library="system" name="${t?"chevron-up":"chevron-down"}" class="${b("h-6 w-12 rotate-90 grid place-items-center")}"></sd-3-0-0-icon></button>`:""}<div part="scroll-container" class="flex overflow-x-auto focus-visible:focus-outline !outline-offset-0"><div part="tabs" class="${b("flex flex-auto relative flex-row")}" role="tablist"><div part="separation" class="w-full h-[1px] bg-neutral-400 absolute bottom-0"></div><slot name="nav" @slotchange="${this.syncTabsAndPanels}"></slot></div></div>${this.hasScrollControls?e`<button part="scroll-button--end" exportparts="base:scroll-button__base" class="${b("sd-interactive flex items-center justify-center absolute top-0 bottom-0 right-0 !outline-offset-0 border-b border-neutral-400 z-10","rtl"===this.localize.dir()&&"right-auto left-0")}" @click="${this.handleScrollToEnd}"><sd-3-0-0-icon library="system" name="${t?"chevron-down":"chevron-up"}" class="${b("h-6 w-12 rotate-90 grid place-items-center")}"></sd-3-0-0-icon></button>`:""}</div><slot part="body" class="${b("block auto py-8 px-6","container"===this.variant&&"border border-neutral-400 border-t-0")}" @slotchange="${this.syncTabsAndPanels}"></slot></div>`}};m.styles=[t.styles,s(d),h,a`:host{box-sizing:border-box;display:block}[part=scroll-container]{scrollbar-width:none}[part=scroll-container]::-webkit-scrollbar{height:var(--sd-spacing-0,0);width:var(--sd-spacing-0,0)}::slotted(sd-3-0-0-tab-panel){--padding:1rem 0}`],p([n("[part=base]")],m.prototype,"tabGroup",2),p([n("[part=body]")],m.prototype,"body",2),p([n("[part=scroll-container]")],m.prototype,"nav",2),p([l()],m.prototype,"hasScrollControls",2),p([l()],m.prototype,"variant",2),p([i()],m.prototype,"activation",2),m=p([o("sd-3-0-0-tab-group")],m);export{m as default};
@@ -1 +1 @@
1
- import{S as t,x as e,i as a,n as s,c as i}from"./solid-element.js";import{w as r}from"./watch.js";import{c as o}from"./component.styles.js";import{t as n}from"./classix.js";var c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p=(t,e,a,s)=>{for(var i,r=s>1?void 0:s?l(e,a):e,o=t.length-1;o>=0;o--)(i=t[o])&&(r=(s?i(e,a,r):i(r))||r);return s&&r&&c(e,a,r),r};let d=0,h=class extends t{constructor(){super(...arguments),this.attrId=++d,this.componentId=`sd-2-12-0-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return e`<slot part="base" class="${n("block",this.active&&"tab-panel--active")}"></slot>`}};h.styles=[t.styles,o,a`:host{--padding:0;display:none}:host([active]){display:block}::part(base){padding:var(--padding)}`],p([s({reflect:!0})],h.prototype,"name",2),p([s({type:Boolean,reflect:!0})],h.prototype,"active",2),p([r("active")],h.prototype,"handleActiveChange",1),h=p([i("sd-2-12-0-tab-panel")],h);export{h as default};
1
+ import{S as t,x as e,i as a,n as s,c as i}from"./solid-element.js";import{w as r}from"./watch.js";import{c as o}from"./component.styles.js";import{t as n}from"./classix.js";var c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p=(t,e,a,s)=>{for(var i,r=s>1?void 0:s?l(e,a):e,o=t.length-1;o>=0;o--)(i=t[o])&&(r=(s?i(e,a,r):i(r))||r);return s&&r&&c(e,a,r),r};let d=0,h=class extends t{constructor(){super(...arguments),this.attrId=++d,this.componentId=`sd-3-0-0-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return e`<slot part="base" class="${n("block",this.active&&"tab-panel--active")}"></slot>`}};h.styles=[t.styles,o,a`:host{--padding:0;display:none}:host([active]){display:block}::part(base){padding:var(--padding)}`],p([s({reflect:!0})],h.prototype,"name",2),p([s({type:Boolean,reflect:!0})],h.prototype,"active",2),p([r("active")],h.prototype,"handleActiveChange",1),h=p([i("sd-3-0-0-tab-panel")],h);export{h as default};
@@ -1 +1 @@
1
- import{S as t,x as e,i,n as a,c as r}from"./solid-element.js";import{e as s}from"./query.js";import{w as o}from"./watch.js";import{c as l}from"./component.styles.js";import{t as n}from"./classix.js";var d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,b=(t,e,i,a)=>{for(var r,s=a>1?void 0:a?c(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a?r(e,i,s):r(s))||s);return a&&s&&d(e,i,s),s};let p=0,h=class extends t{constructor(){super(...arguments),this.attrId=++p,this.componentId=`sd-2-12-0-tab-${this.attrId}`,this.panel="",this.variant="default",this.active=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.tab.focus(t)}blur(){this.tab.blur()}render(){return this.id=this.id.length>0?this.id:this.componentId,e`<div part="base" class="${n("inline-flex min-w-max h-12 px-3 leading-none items-center justify-center whitespace-nowrap select-none cursor-pointer group relative focus-visible:focus-outline outline-2 !-outline-offset-2","container"===this.variant&&" rounded-[4px_4px_0_0]","container"===this.variant&&this.active&&"tab--active-container-border bg-white",this.disabled?"opacity-50 !cursor-not-allowed":"hover:bg-neutral-200")}" tabindex="${this.disabled?"-1":"0"}"><slot name="left" class="${n("pr-2",this.disabled?"text-neutral-500":"text-primary")}"></slot><slot class="${n(this.disabled?"text-neutral-500":"text-primary")}"></slot><div part="active-tab-indicator" class="${n((!this.active||this.disabled)&&"hidden","absolute bottom-0 h-1 bg-accent","default"===this.variant?"w-full":"w-3/4 group-hover:w-full transition-all duration-200 ease-in-out")}"></div><div part="hover-bottom-border" class="${n(!this.active&&!this.disabled&&"absolute w-full h-[1px] bottom-0 border-b border-neutral-400 invisible group-hover:visible")}"></div></div>`}};h.styles=[t.styles,l,i`:host{box-sizing:border-box;display:block}.tab--active-container-border::after{content:'';position:absolute;height:100%;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(var(--sd-color-neutral-400,195 195 195) / var(--tw-border-opacity));border-bottom:none;border-radius:4px 4px 0 0}`],b([s("[part=base]")],h.prototype,"tab",2),b([a({reflect:!0})],h.prototype,"panel",2),b([a({type:String,reflect:!0})],h.prototype,"variant",2),b([a({type:Boolean,reflect:!0})],h.prototype,"active",2),b([a({type:Boolean,reflect:!0})],h.prototype,"disabled",2),b([o("active")],h.prototype,"handleActiveChange",1),b([o("disabled")],h.prototype,"handleDisabledChange",1),h=b([r("sd-2-12-0-tab")],h);export{h as default};
1
+ import{S as t,x as e,i,n as a,c as r}from"./solid-element.js";import{e as s}from"./query.js";import{w as o}from"./watch.js";import{c as l}from"./component.styles.js";import{t as n}from"./classix.js";var d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,b=(t,e,i,a)=>{for(var r,s=a>1?void 0:a?c(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a?r(e,i,s):r(s))||s);return a&&s&&d(e,i,s),s};let p=0,h=class extends t{constructor(){super(...arguments),this.attrId=++p,this.componentId=`sd-3-0-0-tab-${this.attrId}`,this.panel="",this.variant="default",this.active=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","tab")}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.tab.focus(t)}blur(){this.tab.blur()}render(){return this.id=this.id.length>0?this.id:this.componentId,e`<div part="base" class="${n("inline-flex min-w-max h-12 px-3 leading-none items-center justify-center whitespace-nowrap select-none cursor-pointer group relative focus-visible:focus-outline outline-2 !-outline-offset-2","container"===this.variant&&" rounded-[4px_4px_0_0]","container"===this.variant&&this.active&&"tab--active-container-border bg-white",this.disabled?"opacity-50 !cursor-not-allowed":"hover:bg-neutral-200")}" tabindex="${this.disabled?"-1":"0"}"><slot name="left" class="${n("pr-2",this.disabled?"text-neutral-500":"text-primary")}"></slot><slot class="${n(this.disabled?"text-neutral-500":"text-primary")}"></slot><div part="active-tab-indicator" class="${n((!this.active||this.disabled)&&"hidden","absolute bottom-0 h-1 bg-accent","default"===this.variant?"w-full":"w-3/4 group-hover:w-full transition-all duration-200 ease-in-out")}"></div><div part="hover-bottom-border" class="${n(!this.active&&!this.disabled&&"absolute w-full h-[1px] bottom-0 border-b border-neutral-400 invisible group-hover:visible")}"></div></div>`}};h.styles=[t.styles,l,i`:host{box-sizing:border-box;display:block}.tab--active-container-border::after{content:'';position:absolute;height:100%;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(var(--sd-color-neutral-400,195 195 195) / var(--tw-border-opacity));border-bottom:none;border-radius:4px 4px 0 0}`],b([s("[part=base]")],h.prototype,"tab",2),b([a({reflect:!0})],h.prototype,"panel",2),b([a({type:String,reflect:!0})],h.prototype,"variant",2),b([a({type:Boolean,reflect:!0})],h.prototype,"active",2),b([a({type:Boolean,reflect:!0})],h.prototype,"disabled",2),b([o("active")],h.prototype,"handleActiveChange",1),b([o("disabled")],h.prototype,"handleDisabledChange",1),h=b([r("sd-3-0-0-tab")],h);export{h as default};
@@ -1 +1 @@
1
- import{S as e,i as t,n as r,c as s}from"./solid-element.js";import{s as o,n as i}from"./static.js";import{o as a}from"./if-defined.js";import{e as l}from"./query.js";import{t as d}from"./classix.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),t=e?o`a`:o`button`;return i`<${t} part="base" type="${a(e?void 0:"button")}" href="${a(e?this.href:void 0)}" rel="${a(e&&this.target?"noreferrer noopener":void 0)}" target="${a(e?this.target:void 0)}" download="${a(e?this.download:void 0)}" ?disabled="${a(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${d("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?i`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${d({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-2-12-0-icon library="system" name="close" label="remove"></sd-2-12-0-icon></slot>`:""}</${t}>`}};b.styles=[e.styles,t`:host{display:inline-block}`],h([l("a, button")],b.prototype,"tag",2),h([r({reflect:!0})],b.prototype,"size",2),h([r({type:Boolean,reflect:!0})],b.prototype,"selected",2),h([r({type:Boolean,reflect:!0})],b.prototype,"removable",2),h([r({type:Boolean,reflect:!0})],b.prototype,"disabled",2),h([r()],b.prototype,"href",2),h([r()],b.prototype,"target",2),h([r()],b.prototype,"download",2),b=h([s("sd-2-12-0-tag")],b);export{b as default};
1
+ import{S as e,i as t,n as r,c as s}from"./solid-element.js";import{s as o,n as i}from"./static.js";import{o as a}from"./if-defined.js";import{e as l}from"./query.js";import{t as d}from"./classix.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),t=e?o`a`:o`button`;return i`<${t} part="base" type="${a(e?void 0:"button")}" href="${a(e?this.href:void 0)}" rel="${a(e&&this.target?"noreferrer noopener":void 0)}" target="${a(e?this.target:void 0)}" download="${a(e?this.download:void 0)}" ?disabled="${a(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${d("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?i`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${d({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-3-0-0-icon library="system" name="close" label="remove"></sd-3-0-0-icon></slot>`:""}</${t}>`}};b.styles=[e.styles,t`:host{display:inline-block}`],h([l("a, button")],b.prototype,"tag",2),h([r({reflect:!0})],b.prototype,"size",2),h([r({type:Boolean,reflect:!0})],b.prototype,"selected",2),h([r({type:Boolean,reflect:!0})],b.prototype,"removable",2),h([r({type:Boolean,reflect:!0})],b.prototype,"disabled",2),h([r()],b.prototype,"href",2),h([r()],b.prototype,"target",2),h([r()],b.prototype,"download",2),b=h([s("sd-3-0-0-tag")],b);export{b as default};
@@ -1 +1 @@
1
- import{S as e,x as t,i as a,n as r,c as s}from"./solid-element.js";import{H as i}from"./slot.js";import{e as o}from"./query.js";import{t as l}from"./classix.js";var d=Object.defineProperty,n=Object.getOwnPropertyDescriptor,h=(e,t,a,r)=>{for(var s,i=r>1?void 0:r?n(t,a):t,o=e.length-1;o>=0;o--)(s=e[o])&&(i=(r?s(t,a,i):s(i))||i);return r&&i&&d(t,a,i),i};let m=class extends e{constructor(){super(...arguments),this.variant="white",this.hasSlotController=new i(this,"[default]","media","meta","headline","expandable")}render(){const e={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return t`<div class="relative flex flex-col group" part="base"><div class="${l("mb-4",!e["teaser-has-media"]&&"hidden")}" part="media"><slot name="media"></slot></div><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${l("flex-1","gradient-white"===this.variant&&"bg-gradient-to-t from-white/[.8] to-60%","gradient-dark"===this.variant&&"bg-gradient-to-t from-primary-800/[.6] to-60%")}"></div><div class="${l({white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"bg-neutral-100/[.8] group-hover:bg-neutral-100/90",primary:"bg-primary/[.8] text-white group-hover:bg-primary/90","primary-100":"bg-primary-100/[.8] group-hover:bg-primary-100/90","gradient-white":"bg-gradient-to-t from-white/90 to-white/[.8]","gradient-dark":"bg-gradient-to-t from-primary-800/75 to-primary-800/[.6] text-white"}[this.variant])}"><div class="flex-col text-left p-4" part="content"><div part="meta" class="${l("gap-2 mb-4",!e["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="text-lg font-bold m-0"><slot name="headline">Always insert one semantically correct heading element here (e. g. &lt;h2>)</slot></div><div class="${l("hidden",e["teaser-has-expandable"]&&"h-[0px] invisible opacity-0 md:[transition:_height_0.2s_linear,opacity_0.1s_linear_0.1s] md:block md:group-hover:h-auto md:group-hover:my-4 md:group-hover:opacity-[100%] md:group-hover:visible")}" part="expandable"><slot name="expandable"></slot></div><div part="main" class="${l(!e["teaser-has-default"]&&"hidden")}"><slot></slot></div></div></div></div></div>`}};m.styles=[e.styles,a`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],h([r({reflect:!0})],m.prototype,"variant",2),h([o('[part="base"]')],m.prototype,"teaserMedia",2),m=h([s("sd-2-12-0-teaser-media")],m);export{m as default};
1
+ import{S as e,x as t,i as a,n as r,c as s}from"./solid-element.js";import{H as i}from"./slot.js";import{e as o}from"./query.js";import{t as l}from"./classix.js";var d=Object.defineProperty,n=Object.getOwnPropertyDescriptor,h=(e,t,a,r)=>{for(var s,i=r>1?void 0:r?n(t,a):t,o=e.length-1;o>=0;o--)(s=e[o])&&(i=(r?s(t,a,i):s(i))||i);return r&&i&&d(t,a,i),i};let m=class extends e{constructor(){super(...arguments),this.variant="white",this.hasSlotController=new i(this,"[default]","media","meta","headline","expandable")}render(){const e={"teaser-has-default":this.hasSlotController.test("[default]"),"teaser-has-media":this.hasSlotController.test("media"),"teaser-has-meta":this.hasSlotController.test("meta"),"teaser-has-headline":this.hasSlotController.test("headline"),"teaser-has-expandable":this.hasSlotController.test("expandable")};return t`<div class="relative flex flex-col group" part="base"><div class="${l("mb-4",!e["teaser-has-media"]&&"hidden")}" part="media"><slot name="media"></slot></div><div class="absolute flex flex-col justify-end h-full w-full pb-4"><div class="${l("flex-1","gradient-white"===this.variant&&"bg-gradient-to-t from-white/[.8] to-60%","gradient-dark"===this.variant&&"bg-gradient-to-t from-primary-800/[.6] to-60%")}"></div><div class="${l({white:"bg-white/[.8] group-hover:bg-white/90","neutral-100":"bg-neutral-100/[.8] group-hover:bg-neutral-100/90",primary:"bg-primary/[.8] text-white group-hover:bg-primary/90","primary-100":"bg-primary-100/[.8] group-hover:bg-primary-100/90","gradient-white":"bg-gradient-to-t from-white/90 to-white/[.8]","gradient-dark":"bg-gradient-to-t from-primary-800/75 to-primary-800/[.6] text-white"}[this.variant])}"><div class="flex-col text-left p-4" part="content"><div part="meta" class="${l("gap-2 mb-4",!e["teaser-has-meta"]&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="text-lg font-bold m-0"><slot name="headline">Always insert one semantically correct heading element here (e. g. &lt;h2>)</slot></div><div class="${l("hidden",e["teaser-has-expandable"]&&"h-[0px] invisible opacity-0 md:[transition:_height_0.2s_linear,opacity_0.1s_linear_0.1s] md:block md:group-hover:h-auto md:group-hover:my-4 md:group-hover:opacity-[100%] md:group-hover:visible")}" part="expandable"><slot name="expandable"></slot></div><div part="main" class="${l(!e["teaser-has-default"]&&"hidden")}"><slot></slot></div></div></div></div></div>`}};m.styles=[e.styles,a`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],h([r({reflect:!0})],m.prototype,"variant",2),h([o('[part="base"]')],m.prototype,"teaserMedia",2),m=h([s("sd-3-0-0-teaser-media")],m);export{m as default};
@@ -1 +1 @@
1
- import{S as t,x as e,i,n as r,c as a}from"./solid-element.js";import{H as s}from"./slot.js";import{r as o}from"./state.js";import{e as n}from"./query.js";import{t as l}from"./classix.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,i,r)=>{for(var a,s=r>1?void 0:r?d(e,i):e,o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r?a(e,i,s):a(s))||s);return r&&s&&h(e,i,s),s};let c=class extends t{constructor(){super(...arguments),this.variant="white",this.breakpoint=448,this.inset=!1,this.hasSlotController=new s(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),0===this.breakpoint?this._orientation="horizontal":9999===this.breakpoint?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateOrientation())),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(t){super.updated(t),t.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){const t="white border-neutral-400"===this.variant||this.inset,i=this.hasSlotController.test("[default]"),r=this.hasSlotController.test("media"),a=this.hasSlotController.test("meta");return this.hasSlotController.test("headline"),e`<div class="${l("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],"vertical"===this._orientation&&"flex-col","horizontal"===this._orientation&&"flex-row gap-8","horizontal"===this._orientation&&t&&"py-8 px-10")}" part="base"><div style="${"horizontal"===this._orientation?"width: var(--distribution-media, 100%);":""}" class="${l(!t&&"vertical"===this._orientation&&"mb-4",!r&&"hidden","white border-neutral-400"===this.variant&&"vertical"===this._orientation&&"mx-[-1px] mt-[-1px]")}" part="media"><slot name="media"></slot></div><div style="${"horizontal"===this._orientation?"width: var(--distribution-content, 100%); "+(t?"width: var(--distribution-content, calc(100% - 2rem));":""):""}" class="${l("flex flex-col text-left","horizontal"===this._orientation&&"flex flex-col","vertical"===this._orientation&&t&&"m-4")}" part="content"><div part="meta" class="${l("gap-2 mb-4",!a&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="${l("text-lg font-bold m-0","primary"===this.variant?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. &lt;h2>)</slot></div><div part="main" class="${l(!i&&"hidden")}"><slot></slot></div></div></div>`}};c.styles=[t.styles,i`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],p([r({reflect:!0})],c.prototype,"variant",2),p([r({reflect:!0,type:Number})],c.prototype,"breakpoint",2),p([r({type:Boolean,reflect:!0})],c.prototype,"inset",2),p([n('[part="base"]')],c.prototype,"teaser",2),p([o()],c.prototype,"_orientation",2),c=p([a("sd-2-12-0-teaser")],c);export{c as default};
1
+ import{S as t,x as e,i,n as r,c as a}from"./solid-element.js";import{H as s}from"./slot.js";import{r as o}from"./state.js";import{e as n}from"./query.js";import{t as l}from"./classix.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,i,r)=>{for(var a,s=r>1?void 0:r?d(e,i):e,o=t.length-1;o>=0;o--)(a=t[o])&&(s=(r?a(e,i,s):a(s))||s);return r&&s&&h(e,i,s),s};let c=class extends t{constructor(){super(...arguments),this.variant="white",this.breakpoint=448,this.inset=!1,this.hasSlotController=new s(this,"[default]","media","meta","headline")}connectedCallback(){super.connectedCallback(),0===this.breakpoint?this._orientation="horizontal":9999===this.breakpoint?this._orientation="vertical":window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.updateOrientation())),this.resizeObserver.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect()}updated(t){super.updated(t),t.has("breakpoint")&&this.updateOrientation()}updateOrientation(){this._orientation=this.offsetWidth>=this.breakpoint?"horizontal":"vertical"}render(){const t="white border-neutral-400"===this.variant||this.inset,i=this.hasSlotController.test("[default]"),r=this.hasSlotController.test("media"),a=this.hasSlotController.test("meta");return this.hasSlotController.test("headline"),e`<div class="${l("flex",{white:"bg-white","white border-neutral-400":"bg-white border border-neutral-400","neutral-100":"bg-neutral-100",primary:"bg-primary text-white","primary-100":"bg-primary-100"}[this.variant],"vertical"===this._orientation&&"flex-col","horizontal"===this._orientation&&"flex-row gap-8","horizontal"===this._orientation&&t&&"py-8 px-10")}" part="base"><div style="${"horizontal"===this._orientation?"width: var(--distribution-media, 100%);":""}" class="${l(!t&&"vertical"===this._orientation&&"mb-4",!r&&"hidden","white border-neutral-400"===this.variant&&"vertical"===this._orientation&&"mx-[-1px] mt-[-1px]")}" part="media"><slot name="media"></slot></div><div style="${"horizontal"===this._orientation?"width: var(--distribution-content, 100%); "+(t?"width: var(--distribution-content, calc(100% - 2rem));":""):""}" class="${l("flex flex-col text-left","horizontal"===this._orientation&&"flex flex-col","vertical"===this._orientation&&t&&"m-4")}" part="content"><div part="meta" class="${l("gap-2 mb-4",!a&&"hidden")}"><slot name="meta"></slot></div><div part="headline" class="${l("text-lg font-bold m-0","primary"===this.variant?"text-white":"text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. &lt;h2>)</slot></div><div part="main" class="${l(!i&&"hidden")}"><slot></slot></div></div></div>`}};c.styles=[t.styles,i`:host{display:block}::slotted(*){margin:var(--sd-spacing-0,0)}::slotted([slot=headline]){margin:var(--sd-spacing-0,0)!important;font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700}`],p([r({reflect:!0})],c.prototype,"variant",2),p([r({reflect:!0,type:Number})],c.prototype,"breakpoint",2),p([r({type:Boolean,reflect:!0})],c.prototype,"inset",2),p([n('[part="base"]')],c.prototype,"teaser",2),p([o()],c.prototype,"_orientation",2),c=p([a("sd-3-0-0-teaser")],c);export{c as default};
@@ -1 +1 @@
1
- import{S as t,x as e,i as a,n as l,c as s}from"./solid-element.js";import{d as r}from"./default-value.js";import{F as i}from"./form.js";import{H as o}from"./slot.js";import{o as n}from"./if-defined.js";import{l as h}from"./live.js";import{r as d}from"./state.js";import{e as p}from"./query.js";import{w as u}from"./watch.js";import{c}from"./component.styles.js";import{t as y}from"./classix.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=(t,e,a,l)=>{for(var s,r=l>1?void 0:l?b(e,a):e,i=t.length-1;i>=0;i--)(s=t[i])&&(r=(l?s(e,a,r):s(r))||r);return l&&r&&m(e,a,r),r};let x=class extends t{constructor(){super(...arguments),this.formControlController=new i(this),this.hasSlotController=new o(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-2-12-0-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),a=this.hasSlotController.test("help-text"),l=!!this.label||!!t,s=!!this.helpText||!!a,r=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",i="sm"===this.size?"text-sm":"text-base",o={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="text-left"><label part="form-control-label" id="label" class="${y("mb-2",l?"inline-block":"hidden",i)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${y("relative w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${y("absolute w-full h-full pointer-events-none border rounded-default",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[r])}"></div><div part="base" class="${y("textarea px-4 flex items-top rounded-default bg-white group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[r],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly&&"bg-neutral-100")}"><textarea part="textarea" id="input" class="${y("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",i)}" title="${this.title}" name="${n(this.name)}" .value="${h(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" rows="${n(this.rows)}" autocapitalize="${n(this.autocapitalize)}" autocorrect="${n(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${n(this.spellcheck)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-2-12-0-icon class="${y("text-error absolute right-4 bg-white group-hover:bg-neutral-200",o)}" library="system" name="risk" part="invalid-icon"></sd-2-12-0-icon>`:""} ${this.styleOnValid&&this.showValidStyle?e`<sd-2-12-0-icon class="${y("text-success absolute right-4 bg-white group-hover:bg-neutral-200",o)}" library="system" name="confirm" part="valid-icon"></sd-2-12-0-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${y("text-sm text-neutral-700",s?"block":"hidden")}" aria-hidden="${s?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};x.styles=[c,t.styles,a`:host{display:block}:host([required]) #label::after{content:' *'}.no-scrollbar::-webkit-scrollbar{display:none}`],v([p("#input")],x.prototype,"textarea",2),v([p("#invalid-message")],x.prototype,"invalidMessage",2),v([d()],x.prototype,"hasFocus",2),v([d()],x.prototype,"showValidStyle",2),v([d()],x.prototype,"showInvalidStyle",2),v([l()],x.prototype,"title",2),v([l()],x.prototype,"name",2),v([l()],x.prototype,"value",2),v([l({reflect:!0})],x.prototype,"size",2),v([l()],x.prototype,"label",2),v([l({attribute:"help-text"})],x.prototype,"helpText",2),v([l()],x.prototype,"placeholder",2),v([l({type:Number})],x.prototype,"rows",2),v([l({type:Boolean,reflect:!0})],x.prototype,"disabled",2),v([l({type:Boolean,reflect:!0})],x.prototype,"readonly",2),v([l({reflect:!0})],x.prototype,"form",2),v([l({type:Boolean,reflect:!0})],x.prototype,"required",2),v([l({type:Number})],x.prototype,"minlength",2),v([l({type:Number})],x.prototype,"maxlength",2),v([l()],x.prototype,"autocapitalize",2),v([l()],x.prototype,"autocorrect",2),v([l()],x.prototype,"autocomplete",2),v([l({type:Boolean})],x.prototype,"autofocus",2),v([l()],x.prototype,"enterkeyhint",2),v([l({type:Boolean,reflect:!0,attribute:"style-on-valid"})],x.prototype,"styleOnValid",2),v([l({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],x.prototype,"spellcheck",2),v([l()],x.prototype,"inputmode",2),v([r()],x.prototype,"defaultValue",2),v([u("disabled",{waitUntilFirstUpdate:!0})],x.prototype,"handleDisabledChange",1),v([u("rows",{waitUntilFirstUpdate:!0})],x.prototype,"handleRowsChange",1),v([u("value",{waitUntilFirstUpdate:!0})],x.prototype,"handleValueChange",1),x=v([s("sd-2-12-0-textarea")],x);export{x as default};
1
+ import{S as t,x as e,i as a,n as l,c as s}from"./solid-element.js";import{d as r}from"./default-value.js";import{F as i}from"./form.js";import{H as o}from"./slot.js";import{o as n}from"./if-defined.js";import{l as h}from"./live.js";import{r as d}from"./state.js";import{e as p}from"./query.js";import{w as u}from"./watch.js";import{c}from"./component.styles.js";import{t as y}from"./classix.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=(t,e,a,l)=>{for(var s,r=l>1?void 0:l?b(e,a):e,i=t.length-1;i>=0;i--)(s=t[i])&&(r=(l?s(e,a,r):s(r))||r);return l&&r&&m(e,a,r),r};let x=class extends t{constructor(){super(...arguments),this.formControlController=new i(this),this.hasSlotController=new o(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-3-0-0-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),a=this.hasSlotController.test("help-text"),l=!!this.label||!!t,s=!!this.helpText||!!a,r=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",i="sm"===this.size?"text-sm":"text-base",o={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="text-left"><label part="form-control-label" id="label" class="${y("mb-2",l?"inline-block":"hidden",i)}" for="input" aria-hidden="${l?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${y("relative w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${y("absolute w-full h-full pointer-events-none border rounded-default",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[r])}"></div><div part="base" class="${y("textarea px-4 flex items-top rounded-default bg-white group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],{disabled:"text-neutral-500",readonly:"text-black",activeInvalid:"text-error",activeValid:"text-success",active:"text-black",invalid:"text-error",valid:"text-success",default:"text-black"}[r],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly&&"bg-neutral-100")}"><textarea part="textarea" id="input" class="${y("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",i)}" title="${this.title}" name="${n(this.name)}" .value="${h(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${n(this.placeholder)}" minlength="${n(this.minlength)}" maxlength="${n(this.maxlength)}" rows="${n(this.rows)}" autocapitalize="${n(this.autocapitalize)}" autocorrect="${n(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${n(this.spellcheck)}" enterkeyhint="${n(this.enterkeyhint)}" inputmode="${n(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-3-0-0-icon class="${y("text-error absolute right-4 bg-white group-hover:bg-neutral-200",o)}" library="system" name="risk" part="invalid-icon"></sd-3-0-0-icon>`:""} ${this.styleOnValid&&this.showValidStyle?e`<sd-3-0-0-icon class="${y("text-success absolute right-4 bg-white group-hover:bg-neutral-200",o)}" library="system" name="confirm" part="valid-icon"></sd-3-0-0-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${y("text-sm text-neutral-700",s?"block":"hidden")}" aria-hidden="${s?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};x.styles=[c,t.styles,a`:host{display:block}:host([required]) #label::after{content:' *'}.no-scrollbar::-webkit-scrollbar{display:none}`],v([p("#input")],x.prototype,"textarea",2),v([p("#invalid-message")],x.prototype,"invalidMessage",2),v([d()],x.prototype,"hasFocus",2),v([d()],x.prototype,"showValidStyle",2),v([d()],x.prototype,"showInvalidStyle",2),v([l()],x.prototype,"title",2),v([l()],x.prototype,"name",2),v([l()],x.prototype,"value",2),v([l({reflect:!0})],x.prototype,"size",2),v([l()],x.prototype,"label",2),v([l({attribute:"help-text"})],x.prototype,"helpText",2),v([l()],x.prototype,"placeholder",2),v([l({type:Number})],x.prototype,"rows",2),v([l({type:Boolean,reflect:!0})],x.prototype,"disabled",2),v([l({type:Boolean,reflect:!0})],x.prototype,"readonly",2),v([l({reflect:!0})],x.prototype,"form",2),v([l({type:Boolean,reflect:!0})],x.prototype,"required",2),v([l({type:Number})],x.prototype,"minlength",2),v([l({type:Number})],x.prototype,"maxlength",2),v([l()],x.prototype,"autocapitalize",2),v([l()],x.prototype,"autocorrect",2),v([l()],x.prototype,"autocomplete",2),v([l({type:Boolean})],x.prototype,"autofocus",2),v([l()],x.prototype,"enterkeyhint",2),v([l({type:Boolean,reflect:!0,attribute:"style-on-valid"})],x.prototype,"styleOnValid",2),v([l({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],x.prototype,"spellcheck",2),v([l()],x.prototype,"inputmode",2),v([r()],x.prototype,"defaultValue",2),v([u("disabled",{waitUntilFirstUpdate:!0})],x.prototype,"handleDisabledChange",1),v([u("rows",{waitUntilFirstUpdate:!0})],x.prototype,"handleRowsChange",1),v([u("value",{waitUntilFirstUpdate:!0})],x.prototype,"handleValueChange",1),x=v([s("sd-3-0-0-textarea")],x);export{x as default};
@@ -1,4 +1,4 @@
1
- import"./popup.js";import{c as t,s as e,a as s,w as o}from"./event.js";import{S as i,x as a,r as h,i as r,n as p,c as n}from"./solid-element.js";import{g as d,s as l}from"./animation-registry.js";import{L as c}from"./solid-components2.js";import{e as u}from"./query.js";import{w as m}from"./watch.js";import{t as w}from"./classix.js";import{I as y}from"./interactive.js";var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,b=(t,e,s,o)=>{for(var i,a=o>1?void 0:o?f(e,s):e,h=t.length-1;h>=0;h--)(i=t[h])&&(a=(o?i(e,s,a):i(a))||a);return o&&a&&v(e,s,a),a};let g=class extends i{constructor(){super(...arguments),this.localize=new c(this),this.content="",this.placement="top",this.size="lg",this.disabled=!1,this.open=!1,this.trigger="click focus",this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then((()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}))}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut)}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.show()}handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){const e=t(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),e)}}handleMouseOut(){if(this.hasTrigger("hover")){const e=t(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),e)}}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await e(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:o}=d(this,"tooltip.show",{dir:this.localize.dir()});await s(this.popup.popup,t,o),this.emit("sd-after-show")}else{this.emit("sd-hide"),await e(this.body);const{keyframes:t,options:o}=d(this,"tooltip.hide",{dir:this.localize.dir()});await s(this.popup.popup,t,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,o(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,o(this,"sd-after-hide")}render(){const t=this.placement.endsWith("-start"),e=this.placement.endsWith("-end");return a`<sd-2-12-0-popup part="base" exportparts="
1
+ import"./popup.js";import{c as t,s as e,a as s,w as o}from"./event.js";import{S as i,x as a,r as h,i as r,n as p,c as n}from"./solid-element.js";import{g as d,s as l}from"./animation-registry.js";import{L as c}from"./solid-components2.js";import{e as u}from"./query.js";import{w as m}from"./watch.js";import{t as w}from"./classix.js";import{I as y}from"./interactive.js";var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,b=(t,e,s,o)=>{for(var i,a=o>1?void 0:o?f(e,s):e,h=t.length-1;h>=0;h--)(i=t[h])&&(a=(o?i(e,s,a):i(a))||a);return o&&a&&v(e,s,a),a};let g=class extends i{constructor(){super(...arguments),this.localize=new c(this),this.content="",this.placement="top",this.size="lg",this.disabled=!1,this.open=!1,this.trigger="click focus",this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then((()=>{this.addEventListener("blur",this.handleBlur,!0),this.addEventListener("focus",this.handleFocus,!0),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut)}))}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut)}handleBlur(){this.hasTrigger("focus")&&this.hide()}handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show())}handleFocus(){this.hasTrigger("focus")&&this.show()}handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide())}handleMouseOver(){if(this.hasTrigger("hover")){const e=t(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.show()),e)}}handleMouseOut(){if(this.hasTrigger("hover")){const e=t(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout((()=>this.hide()),e)}}hasTrigger(t){return this.trigger.split(" ").includes(t)}async handleOpenChange(){if(this.open){if(this.disabled)return;this.emit("sd-show"),await e(this.body),this.body.hidden=!1,this.popup.active=!0;const{keyframes:t,options:o}=d(this,"tooltip.show",{dir:this.localize.dir()});await s(this.popup.popup,t,o),this.emit("sd-after-show")}else{this.emit("sd-hide"),await e(this.body);const{keyframes:t,options:o}=d(this,"tooltip.hide",{dir:this.localize.dir()});await s(this.popup.popup,t,o),this.popup.active=!1,this.body.hidden=!0,this.emit("sd-after-hide")}}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,o(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,o(this,"sd-after-hide")}render(){const t=this.placement.endsWith("-start"),e=this.placement.endsWith("-end");return a`<sd-3-0-0-popup part="base" exportparts="
2
2
  popup:base__popup,
3
3
  arrow:base__arrow
4
- " class="${w(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[t?"start":e?"end":"default"]*("sm"===this.size?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${w("lg"===this.size?"text-xl":"text-base")}"><button class="flex sd-interactive rounded-full"><sd-2-12-0-icon library="system" name="info-circle" class="${w(this.disabled&&"sd-interactive--disabled")}"></sd-2-12-0-icon></button></slot><slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="Tooltip" aria-live="${this.open?"polite":"off"}">${this.content}</slot></sd-2-12-0-popup>`}};g.styles=[i.styles,h(y),r`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-2-12-0-popup{--arrow-color:rgb(var(--sd-color-primary, 0 53 142) / 1);--arrow-size:10px}sd-2-12-0-popup::part(popup){pointer-events:none;z-index:10;--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-2-12-0-popup::part(arrow){--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-2-12-0-popup[placement^=top]::part(popup){transform-origin:bottom}sd-2-12-0-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`],b([u("slot:not([name])")],g.prototype,"defaultSlot",2),b([u("#tooltip")],g.prototype,"body",2),b([u("sd-2-12-0-popup")],g.prototype,"popup",2),b([p()],g.prototype,"content",2),b([p({reflect:!0})],g.prototype,"placement",2),b([p()],g.prototype,"size",2),b([p({type:Boolean,reflect:!0})],g.prototype,"disabled",2),b([p({type:Boolean,reflect:!0})],g.prototype,"open",2),b([p()],g.prototype,"trigger",2),b([p({type:Boolean})],g.prototype,"hoist",2),b([m("open",{waitUntilFirstUpdate:!0})],g.prototype,"handleOpenChange",1),b([m(["content","hoist","placement"])],g.prototype,"handleOptionsChange",1),b([m("disabled")],g.prototype,"handleDisabledChange",1),g=b([n("sd-2-12-0-tooltip")],g),l("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),l("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});export{g as default};
4
+ " class="${w(this.open&&"tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{start:2,end:-2,default:0}[t?"start":e?"end":"default"]*("sm"===this.size?-1:1)}" strategy="${this.hoist?"fixed":"absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${w("lg"===this.size?"text-xl":"text-base")}"><button class="flex sd-interactive rounded-full"><sd-3-0-0-icon library="system" name="info-circle" class="${w(this.disabled&&"sd-interactive--disabled")}"></sd-3-0-0-icon></button></slot><slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="Tooltip" aria-live="${this.open?"polite":"off"}">${this.content}</slot></sd-3-0-0-popup>`}};g.styles=[i.styles,h(y),r`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-3-0-0-popup{--arrow-color:rgb(var(--sd-color-primary, 0 53 142) / 1);--arrow-size:10px}sd-3-0-0-popup::part(popup){pointer-events:none;z-index:10;--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-3-0-0-popup::part(arrow){--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-3-0-0-popup[placement^=top]::part(popup){transform-origin:bottom}sd-3-0-0-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`],b([u("slot:not([name])")],g.prototype,"defaultSlot",2),b([u("#tooltip")],g.prototype,"body",2),b([u("sd-3-0-0-popup")],g.prototype,"popup",2),b([p()],g.prototype,"content",2),b([p({reflect:!0})],g.prototype,"placement",2),b([p()],g.prototype,"size",2),b([p({type:Boolean,reflect:!0})],g.prototype,"disabled",2),b([p({type:Boolean,reflect:!0})],g.prototype,"open",2),b([p()],g.prototype,"trigger",2),b([p({type:Boolean})],g.prototype,"hoist",2),b([m("open",{waitUntilFirstUpdate:!0})],g.prototype,"handleOpenChange",1),b([m(["content","hoist","placement"])],g.prototype,"handleOptionsChange",1),b([m("disabled")],g.prototype,"handleDisabledChange",1),g=b([n("sd-3-0-0-tooltip")],g),l("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),l("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});export{g as default};
@@ -1 +1 @@
1
- import{S as t,x as e,i as s,n as o,c as i}from"./solid-element.js";import{H as a}from"./slot.js";import{e as l}from"./query.js";import{t as r}from"./classix.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,y=(t,e,s,o)=>{for(var i,a=o>1?void 0:o?p(e,s):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(o?i(e,s,a):i(a))||a);return o&&a&&n(e,s,a),a};let c=class extends t{constructor(){super(...arguments),this.playing=!1,this.overlay=!1,this.isBelowBreakpoint=!1,this.hasSlotController=new a(this,"[default]","play-icon","poster")}get poster(){const t=this.shadowRoot.querySelector("slot[name=poster]");return(null==t?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}fadeoutPoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0")}hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.display="none")}play(){this.emit("sd-play"),this.playing=!0,this.fadeoutPoster()}handleKeydown(t){t instanceof KeyboardEvent&&("Enter"===t.key||" "===t.key)&&(this.play(),setTimeout((()=>{var t;null==(t=this.querySelector("video"))||t.focus()})))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.handleButtonResize())),this.updateComplete.then((()=>{this.resizeObserver.observe(this.hostEl)}))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return e`<div part="base" aria-label="Video Player" class="cursor-pointer"><button part="play-button" aria-label="Play video" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${r(this.playing&&"pointer-events-none","w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${r(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition")}"><slot name="play-icon" part="play-icon" class="${r(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-2-12-0-icon id="default-play-icon" library="system" name="start"></sd-2-12-0-icon></slot></div></button> ${this.hasSlotController.test("poster")?e`<slot name="poster" role="presentation" @transitionend="${this.hidePoster}"></slot>`:null}<div part="overlay" id="overlay" role="presentation" class="${r(this.overlay&&!this.playing?"opacity-100":"opacity-0","bg-[rgba(0,0,0,0.65)] w-full h-full absolute top-0 left-0 pointer-events-none z-20 play-pause-transition")}"></div><slot></slot></div>`}};c.styles=[t.styles,s`:host{position:relative;display:inline-block;overflow:hidden}.play-pause-transition,::slotted([slot=poster]){transition-property:opacity;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}::slotted([slot=poster]){position:absolute;left:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);z-index:10;width:100%}#default-play-icon,::slotted([slot=play-icon]){position:absolute;left:50%;top:50%;--tw-translate-x:-50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}`],y([l("[part=base]")],c.prototype,"hostEl",2),y([o({type:Boolean,reflect:!0})],c.prototype,"playing",2),y([o({type:Boolean,reflect:!0})],c.prototype,"overlay",2),y([o({type:Boolean})],c.prototype,"isBelowBreakpoint",2),c=y([i("sd-2-12-0-video")],c);export{c as default};
1
+ import{S as t,x as e,i as s,n as o,c as i}from"./solid-element.js";import{H as a}from"./slot.js";import{e as l}from"./query.js";import{t as r}from"./classix.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,y=(t,e,s,o)=>{for(var i,a=o>1?void 0:o?p(e,s):e,l=t.length-1;l>=0;l--)(i=t[l])&&(a=(o?i(e,s,a):i(a))||a);return o&&a&&n(e,s,a),a};let c=class extends t{constructor(){super(...arguments),this.playing=!1,this.overlay=!1,this.isBelowBreakpoint=!1,this.hasSlotController=new a(this,"[default]","play-icon","poster")}get poster(){const t=this.shadowRoot.querySelector("slot[name=poster]");return(null==t?void 0:t.assignedElements().length)>0?t.assignedElements()[0]:null}fadeoutPoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.opacity="0")}hidePoster(){this.poster instanceof HTMLImageElement&&(this.poster.style.display="none")}play(){this.emit("sd-play"),this.playing=!0,this.fadeoutPoster()}handleKeydown(t){t instanceof KeyboardEvent&&("Enter"===t.key||" "===t.key)&&(this.play(),setTimeout((()=>{var t;null==(t=this.querySelector("video"))||t.focus()})))}handleButtonResize(){this.hostEl.clientWidth<=414&&!this.isBelowBreakpoint&&(this.isBelowBreakpoint=!0),this.hostEl.clientWidth>414&&this.isBelowBreakpoint&&(this.isBelowBreakpoint=!1)}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.handleButtonResize())),this.updateComplete.then((()=>{this.resizeObserver.observe(this.hostEl)}))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.hostEl)}render(){return e`<div part="base" aria-label="Video Player" class="cursor-pointer"><button part="play-button" aria-label="Play video" tabindex="0" @click="${this.play}" @keydown="${this.handleKeydown}" class="${r(this.playing&&"pointer-events-none","w-full h-full absolute top-0 left-0 z-30 text-primary hover:text-primary-500 sd-interactive sd-interactive--reset focus-visible:focus-outline")}"><div part="play-button-bg" class="${r(this.playing?"opacity-0":"opacity-100",this.isBelowBreakpoint?"w-[48px] h-[48px]":"w-[96px] h-[96px]","absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition")}"><slot name="play-icon" part="play-icon" class="${r(this.isBelowBreakpoint?"text-[2rem]":"text-[4rem]")}"><sd-3-0-0-icon id="default-play-icon" library="system" name="start"></sd-3-0-0-icon></slot></div></button> ${this.hasSlotController.test("poster")?e`<slot name="poster" role="presentation" @transitionend="${this.hidePoster}"></slot>`:null}<div part="overlay" id="overlay" role="presentation" class="${r(this.overlay&&!this.playing?"opacity-100":"opacity-0","bg-[rgba(0,0,0,0.65)] w-full h-full absolute top-0 left-0 pointer-events-none z-20 play-pause-transition")}"></div><slot></slot></div>`}};c.styles=[t.styles,s`:host{position:relative;display:inline-block;overflow:hidden}.play-pause-transition,::slotted([slot=poster]){transition-property:opacity;transition-duration:.3s;transition-timing-function:cubic-bezier(.4,0,.2,1)}::slotted([slot=poster]){position:absolute;left:var(--sd-spacing-0,0);top:var(--sd-spacing-0,0);z-index:10;width:100%}#default-play-icon,::slotted([slot=play-icon]){position:absolute;left:50%;top:50%;--tw-translate-x:-50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}`],y([l("[part=base]")],c.prototype,"hostEl",2),y([o({type:Boolean,reflect:!0})],c.prototype,"playing",2),y([o({type:Boolean,reflect:!0})],c.prototype,"overlay",2),y([o({type:Boolean})],c.prototype,"isBelowBreakpoint",2),c=y([i("sd-3-0-0-video")],c);export{c as default};
@@ -14,6 +14,6 @@ export default class SdButtonGroup extends SolidElement {
14
14
  }
15
15
  declare global {
16
16
  interface HTMLElementTagNameMap {
17
- 'sd-2-12-0-button-group': SdButtonGroup;
17
+ 'sd-3-0-0-button-group': SdButtonGroup;
18
18
  }
19
19
  }
@@ -22,19 +22,19 @@ let SdButtonGroup = class extends SolidElement {
22
22
  }
23
23
  handleFocus(event) {
24
24
  const button = findButton(event.target);
25
- button == null ? void 0 : button.classList.add("sd-2-12-0-button-group__button--focus");
25
+ button == null ? void 0 : button.classList.add("sd-3-0-0-button-group__button--focus");
26
26
  }
27
27
  handleBlur(event) {
28
28
  const button = findButton(event.target);
29
- button == null ? void 0 : button.classList.remove("sd-2-12-0-button-group__button--focus");
29
+ button == null ? void 0 : button.classList.remove("sd-3-0-0-button-group__button--focus");
30
30
  }
31
31
  handleMouseOver(event) {
32
32
  const button = findButton(event.target);
33
- button == null ? void 0 : button.classList.add("sd-2-12-0-button-group__button--hover");
33
+ button == null ? void 0 : button.classList.add("sd-3-0-0-button-group__button--hover");
34
34
  }
35
35
  handleMouseOut(event) {
36
36
  const button = findButton(event.target);
37
- button == null ? void 0 : button.classList.remove("sd-2-12-0-button-group__button--hover");
37
+ button == null ? void 0 : button.classList.remove("sd-3-0-0-button-group__button--hover");
38
38
  }
39
39
  handleSlotChange() {
40
40
  const slottedElements = [...this.defaultSlot.assignedElements({ flatten: true })];
@@ -42,11 +42,11 @@ let SdButtonGroup = class extends SolidElement {
42
42
  const index = slottedElements.indexOf(el);
43
43
  const button = findButton(el);
44
44
  if (button !== null) {
45
- button.classList.add("sd-2-12-0-button-group__button");
46
- button.classList.toggle("sd-2-12-0-button-group__button--first", index === 0);
47
- button.classList.toggle("sd-2-12-0-button-group__button--inner", index > 0 && index < slottedElements.length - 1);
48
- button.classList.toggle("sd-2-12-0-button-group__button--last", index === slottedElements.length - 1);
49
- button.classList.toggle("sd-2-12-0-button-group__button--radio", button.tagName.toLowerCase() === "sd-2-12-0-radio-button");
45
+ button.classList.add("sd-3-0-0-button-group__button");
46
+ button.classList.toggle("sd-3-0-0-button-group__button--first", index === 0);
47
+ button.classList.toggle("sd-3-0-0-button-group__button--inner", index > 0 && index < slottedElements.length - 1);
48
+ button.classList.toggle("sd-3-0-0-button-group__button--last", index === slottedElements.length - 1);
49
+ button.classList.toggle("sd-3-0-0-button-group__button--radio", button.tagName.toLowerCase() === "sd-3-0-0-radio-button");
50
50
  }
51
51
  });
52
52
  }
@@ -65,10 +65,10 @@ __decorateClass([
65
65
  property()
66
66
  ], SdButtonGroup.prototype, "label", 2);
67
67
  SdButtonGroup = __decorateClass([
68
- customElement("sd-2-12-0-button-group")
68
+ customElement("sd-3-0-0-button-group")
69
69
  ], SdButtonGroup);
70
70
  function findButton(el) {
71
- const selector = "sd-2-12-0-button, sd-2-12-0-radio-button";
71
+ const selector = "sd-3-0-0-button, sd-3-0-0-radio-button";
72
72
  return el.closest(selector) ?? el.querySelector(selector);
73
73
  }
74
74
  export {
@@ -18,6 +18,6 @@ export default class SdAccordion extends SolidElement {
18
18
  }
19
19
  declare global {
20
20
  interface HTMLElementTagNameMap {
21
- 'sd-2-12-0-accordion': SdAccordion;
21
+ 'sd-3-0-0-accordion': SdAccordion;
22
22
  }
23
23
  }
@@ -108,7 +108,7 @@ let SdAccordion = class extends SolidElement {
108
108
  )}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${cx(
109
109
  "flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",
110
110
  this.open && "rotate-180"
111
- )}"><slot name="expand-icon" class="${cx(this.open && "hidden")}"><sd-2-12-0-icon library="system" name="chevron-down"></sd-2-12-0-icon></slot><slot name="collapse-icon" class="${cx(!this.open && "hidden")}"><sd-2-12-0-icon library="system" name="chevron-down"></sd-2-12-0-icon></slot></span></header><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></div>`;
111
+ )}"><slot name="expand-icon" class="${cx(this.open && "hidden")}"><sd-3-0-0-icon library="system" name="chevron-down"></sd-3-0-0-icon></slot><slot name="collapse-icon" class="${cx(!this.open && "hidden")}"><sd-3-0-0-icon library="system" name="chevron-down"></sd-3-0-0-icon></slot></span></header><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></div>`;
112
112
  }
113
113
  };
114
114
  SdAccordion.styles = [
@@ -134,7 +134,7 @@ __decorateClass([
134
134
  watch("open", { waitUntilFirstUpdate: true })
135
135
  ], SdAccordion.prototype, "handleOpenChange", 1);
136
136
  SdAccordion = __decorateClass([
137
- customElement("sd-2-12-0-accordion")
137
+ customElement("sd-3-0-0-accordion")
138
138
  ], SdAccordion);
139
139
  setDefaultAnimation("accordion.show", {
140
140
  keyframes: [
@@ -11,6 +11,6 @@ export default class SdAccordionGroup extends SolidElement {
11
11
  }
12
12
  declare global {
13
13
  interface HTMLElementTagNameMap {
14
- 'sd-2-12-0-accordion-group': SdAccordionGroup;
14
+ 'sd-3-0-0-accordion-group': SdAccordionGroup;
15
15
  }
16
16
  }
@@ -48,16 +48,16 @@ let SdAccordionGroup = class extends SolidElement {
48
48
  SdAccordionGroup.styles = [
49
49
  componentStyles,
50
50
  SolidElement.styles,
51
- css`:host{display:block}::slotted(sd-2-12-0-accordion:not(:first-of-type)){margin-top:-1px}`
51
+ css`:host{display:block}::slotted(sd-3-0-0-accordion:not(:first-of-type)){margin-top:-1px}`
52
52
  ];
53
53
  __decorateClass([
54
- queryAssignedElements({ selector: "sd-2-12-0-accordion" })
54
+ queryAssignedElements({ selector: "sd-3-0-0-accordion" })
55
55
  ], SdAccordionGroup.prototype, "_accordionsInDefaultSlot", 2);
56
56
  __decorateClass([
57
57
  property({ attribute: "close-others", type: Boolean })
58
58
  ], SdAccordionGroup.prototype, "closeOthers", 2);
59
59
  SdAccordionGroup = __decorateClass([
60
- customElement("sd-2-12-0-accordion-group")
60
+ customElement("sd-3-0-0-accordion-group")
61
61
  ], SdAccordionGroup);
62
62
  export {
63
63
  SdAccordionGroup as default
@@ -8,6 +8,6 @@ export default class SdBadge extends SolidElement {
8
8
  }
9
9
  declare global {
10
10
  interface HTMLElementTagNameMap {
11
- 'sd-2-12-0-badge': SdBadge;
11
+ 'sd-3-0-0-badge': SdBadge;
12
12
  }
13
13
  }
@@ -53,7 +53,7 @@ __decorateClass([
53
53
  property({ type: Boolean, reflect: true })
54
54
  ], SdBadge.prototype, "inverted", 2);
55
55
  SdBadge = __decorateClass([
56
- customElement("sd-2-12-0-badge")
56
+ customElement("sd-3-0-0-badge")
57
57
  ], SdBadge);
58
58
  export {
59
59
  SdBadge as default
@@ -23,7 +23,7 @@ export default class SdBrandshape extends SolidElement {
23
23
  }
24
24
  declare global {
25
25
  interface HTMLElementTagNameMap {
26
- 'sd-2-12-0-brandshape': SdBrandshape;
26
+ 'sd-3-0-0-brandshape': SdBrandshape;
27
27
  }
28
28
  }
29
29
  export {};
@@ -123,7 +123,7 @@ __decorateClass([
123
123
  state()
124
124
  ], SdBrandshape.prototype, "componentBreakpoint", 2);
125
125
  SdBrandshape = __decorateClass([
126
- customElement("sd-2-12-0-brandshape")
126
+ customElement("sd-3-0-0-brandshape")
127
127
  ], SdBrandshape);
128
128
  export {
129
129
  SdBrandshape as default
@@ -47,6 +47,6 @@ export default class SdButton extends SolidElement implements SolidFormControl {
47
47
  }
48
48
  declare global {
49
49
  interface HTMLElementTagNameMap {
50
- 'sd-2-12-0-button': SdButton;
50
+ 'sd-3-0-0-button': SdButton;
51
51
  }
52
52
  }