@solid-design-system/components 3.22.4 → 3.22.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. package/dist/components/es/tag.js +1 -1
  2. package/dist/components/es/textarea.js +1 -1
  3. package/dist/components/umd/solid-components.js +2 -2
  4. package/dist/custom-elements.json +1 -1
  5. package/dist/package/components/tag/tag.d.ts +1 -0
  6. package/dist/package/components/tag/tag.js +5 -1
  7. package/dist/package/components/textarea/textarea.js +1 -1
  8. package/dist/versioned-components/es/accordion-group.js +1 -1
  9. package/dist/versioned-components/es/accordion.js +1 -1
  10. package/dist/versioned-components/es/audio.js +1 -1
  11. package/dist/versioned-components/es/badge.js +1 -1
  12. package/dist/versioned-components/es/brandshape.js +1 -1
  13. package/dist/versioned-components/es/button.js +1 -1
  14. package/dist/versioned-components/es/carousel-item.js +1 -1
  15. package/dist/versioned-components/es/carousel.js +3 -3
  16. package/dist/versioned-components/es/checkbox-group.js +1 -1
  17. package/dist/versioned-components/es/checkbox.js +1 -1
  18. package/dist/versioned-components/es/dialog.js +1 -1
  19. package/dist/versioned-components/es/divider.js +1 -1
  20. package/dist/versioned-components/es/drawer.js +1 -1
  21. package/dist/versioned-components/es/dropdown.js +1 -1
  22. package/dist/versioned-components/es/expandable.js +1 -1
  23. package/dist/versioned-components/es/flipcard.js +1 -1
  24. package/dist/versioned-components/es/form.js +1 -1
  25. package/dist/versioned-components/es/header.js +1 -1
  26. package/dist/versioned-components/es/icon.js +1 -1
  27. package/dist/versioned-components/es/include.js +1 -1
  28. package/dist/versioned-components/es/input.js +1 -1
  29. package/dist/versioned-components/es/link.js +1 -1
  30. package/dist/versioned-components/es/map-marker.js +1 -1
  31. package/dist/versioned-components/es/navigation-item.js +1 -1
  32. package/dist/versioned-components/es/notification.js +1 -1
  33. package/dist/versioned-components/es/option.js +1 -1
  34. package/dist/versioned-components/es/quickfact.js +1 -1
  35. package/dist/versioned-components/es/radio-button.js +1 -1
  36. package/dist/versioned-components/es/radio-group.js +1 -1
  37. package/dist/versioned-components/es/radio.js +1 -1
  38. package/dist/versioned-components/es/scrollable.js +1 -1
  39. package/dist/versioned-components/es/select.js +3 -3
  40. package/dist/versioned-components/es/solid-components2.js +1 -1
  41. package/dist/versioned-components/es/spinner.js +1 -1
  42. package/dist/versioned-components/es/step-group.js +1 -1
  43. package/dist/versioned-components/es/step.js +1 -1
  44. package/dist/versioned-components/es/switch.js +1 -1
  45. package/dist/versioned-components/es/tab-group.js +1 -1
  46. package/dist/versioned-components/es/tab-panel.js +1 -1
  47. package/dist/versioned-components/es/tab.js +1 -1
  48. package/dist/versioned-components/es/tag.js +1 -1
  49. package/dist/versioned-components/es/teaser-media.js +1 -1
  50. package/dist/versioned-components/es/teaser.js +1 -1
  51. package/dist/versioned-components/es/textarea.js +1 -1
  52. package/dist/versioned-components/es/tooltip.js +2 -2
  53. package/dist/versioned-components/es/video.js +1 -1
  54. package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
  55. package/dist/versioned-package/_components/button-group/button-group.js +11 -11
  56. package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
  57. package/dist/versioned-package/components/accordion/accordion.js +2 -2
  58. package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
  59. package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
  60. package/dist/versioned-package/components/audio/audio.d.ts +1 -1
  61. package/dist/versioned-package/components/audio/audio.js +6 -6
  62. package/dist/versioned-package/components/badge/badge.d.ts +1 -1
  63. package/dist/versioned-package/components/badge/badge.js +1 -1
  64. package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
  65. package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
  66. package/dist/versioned-package/components/button/button.d.ts +1 -1
  67. package/dist/versioned-package/components/button/button.js +4 -4
  68. package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
  69. package/dist/versioned-package/components/carousel/carousel.js +6 -6
  70. package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
  71. package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
  72. package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
  73. package/dist/versioned-package/components/checkbox/checkbox.js +3 -3
  74. package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
  75. package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
  76. package/dist/versioned-package/components/dialog/dialog.d.ts +1 -1
  77. package/dist/versioned-package/components/dialog/dialog.js +2 -2
  78. package/dist/versioned-package/components/divider/divider.d.ts +1 -1
  79. package/dist/versioned-package/components/divider/divider.js +2 -2
  80. package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
  81. package/dist/versioned-package/components/drawer/drawer.js +2 -2
  82. package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
  83. package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
  84. package/dist/versioned-package/components/expandable/expandable.d.ts +1 -1
  85. package/dist/versioned-package/components/expandable/expandable.js +2 -2
  86. package/dist/versioned-package/components/flipcard/flipcard.d.ts +1 -1
  87. package/dist/versioned-package/components/flipcard/flipcard.js +1 -1
  88. package/dist/versioned-package/components/header/header.d.ts +1 -1
  89. package/dist/versioned-package/components/header/header.js +4 -4
  90. package/dist/versioned-package/components/icon/icon.d.ts +1 -1
  91. package/dist/versioned-package/components/icon/icon.js +1 -1
  92. package/dist/versioned-package/components/include/include.d.ts +1 -1
  93. package/dist/versioned-package/components/include/include.js +1 -1
  94. package/dist/versioned-package/components/input/input.d.ts +1 -1
  95. package/dist/versioned-package/components/input/input.js +3 -3
  96. package/dist/versioned-package/components/link/link.d.ts +1 -1
  97. package/dist/versioned-package/components/link/link.js +2 -2
  98. package/dist/versioned-package/components/map-marker/map-marker.d.ts +1 -1
  99. package/dist/versioned-package/components/map-marker/map-marker.js +1 -1
  100. package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
  101. package/dist/versioned-package/components/navigation-item/navigation-item.js +5 -5
  102. package/dist/versioned-package/components/notification/notification.d.ts +1 -1
  103. package/dist/versioned-package/components/notification/notification.js +5 -5
  104. package/dist/versioned-package/components/option/option.d.ts +1 -1
  105. package/dist/versioned-package/components/option/option.js +2 -2
  106. package/dist/versioned-package/components/popup/popup.d.ts +1 -1
  107. package/dist/versioned-package/components/popup/popup.js +1 -1
  108. package/dist/versioned-package/components/quickfact/quickfact.d.ts +1 -1
  109. package/dist/versioned-package/components/quickfact/quickfact.js +2 -2
  110. package/dist/versioned-package/components/radio/radio.d.ts +1 -1
  111. package/dist/versioned-package/components/radio/radio.js +2 -2
  112. package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
  113. package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
  114. package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
  115. package/dist/versioned-package/components/radio-group/radio-group.js +13 -13
  116. package/dist/versioned-package/components/scrollable/scrollable.d.ts +1 -1
  117. package/dist/versioned-package/components/scrollable/scrollable.js +3 -3
  118. package/dist/versioned-package/components/select/select.d.ts +4 -4
  119. package/dist/versioned-package/components/select/select.js +25 -25
  120. package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
  121. package/dist/versioned-package/components/spinner/spinner.js +1 -1
  122. package/dist/versioned-package/components/step/step.d.ts +1 -1
  123. package/dist/versioned-package/components/step/step.js +2 -2
  124. package/dist/versioned-package/components/step-group/step-group.d.ts +1 -1
  125. package/dist/versioned-package/components/step-group/step-group.js +2 -2
  126. package/dist/versioned-package/components/switch/switch.d.ts +1 -1
  127. package/dist/versioned-package/components/switch/switch.js +1 -1
  128. package/dist/versioned-package/components/tab/tab.d.ts +1 -1
  129. package/dist/versioned-package/components/tab/tab.js +2 -2
  130. package/dist/versioned-package/components/tab-group/tab-group.d.ts +1 -1
  131. package/dist/versioned-package/components/tab-group/tab-group.js +13 -13
  132. package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
  133. package/dist/versioned-package/components/tab-panel/tab-panel.js +2 -2
  134. package/dist/versioned-package/components/tag/tag.d.ts +2 -1
  135. package/dist/versioned-package/components/tag/tag.js +7 -3
  136. package/dist/versioned-package/components/teaser/teaser.js +1 -1
  137. package/dist/versioned-package/components/teaser-media/teaser-media.js +1 -1
  138. package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
  139. package/dist/versioned-package/components/textarea/textarea.js +2 -2
  140. package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
  141. package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
  142. package/dist/versioned-package/components/video/video.d.ts +1 -1
  143. package/dist/versioned-package/components/video/video.js +2 -2
  144. package/dist/versioned-package/internal/form.js +3 -3
  145. package/dist/versioned-package/styles/headline/headline.css.js +1 -1
  146. package/dist/versioned-package/utilities/autocomplete-config.js +4 -4
  147. package/dist/versioned-styles/solid-styles.css +1 -1
  148. package/dist/vscode.html-custom-data.json +55 -45
  149. package/dist/web-types.json +74 -46
  150. package/package.json +1 -1
@@ -1 +1 @@
1
- import{S as e,t,i as r,e as s,n as o,a as i}from"./solid-components2.js";import{s as a,n as l}from"./static.js";import{o as d}from"./if-defined.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),r=e?a`a`:a`button`;return l`<${r} part="base" type="${d(e?void 0:"button")}" href="${d(e?this.href:void 0)}" rel="${d(e&&this.target?"noreferrer noopener":void 0)}" target="${d(e?this.target:void 0)}" download="${d(e?this.download:void 0)}" ?disabled="${d(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${t("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?l`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${t({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-icon library="system" name="close" label="remove"></sd-icon></slot>`:""}</${r}>`}};b.styles=[e.styles,r`:host{display:inline-block}`],h([s("a, button")],b.prototype,"tag",2),h([o({reflect:!0})],b.prototype,"size",2),h([o({type:Boolean,reflect:!0})],b.prototype,"selected",2),h([o({type:Boolean,reflect:!0})],b.prototype,"removable",2),h([o({type:Boolean,reflect:!0})],b.prototype,"disabled",2),h([o()],b.prototype,"href",2),h([o()],b.prototype,"target",2),h([o()],b.prototype,"download",2),b=h([i("sd-tag")],b);export{b as default};
1
+ import{S as e,t,i as r,e as s,n as o,a as i}from"./solid-components2.js";import{s as a,n as l}from"./static.js";import{o as d}from"./if-defined.js";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(e,t,r,s)=>{for(var o,i=s>1?void 0:s?p(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s?o(t,r,i):o(i))||i);return s&&i&&n(t,r,i),i};let b=class extends e{constructor(){super(...arguments),this.size="lg",this.selected=!1,this.toggleable=!1,this.removable=!1,this.disabled=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleRemoveClick(){this.emit("sd-remove")}isLink(){return!!this.href}click(){this.tag.click()}focus(e){this.tag.focus(e)}blur(){this.tag.blur()}render(){const e=this.isLink(),r=e?a`a`:a`button`;return l`<${r} part="base" type="${d(e?void 0:"button")}" href="${d(e?this.href:void 0)}" rel="${d(e&&this.target?"noreferrer noopener":void 0)}" target="${d(e?this.target:void 0)}" download="${d(e?this.download:void 0)}" ?disabled="${d(e?void 0:this.disabled)}" aria-disabled="${this.disabled?"true":"false"}" aria-pressed="${d(this.toggleable?this.selected:void 0)}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" class="${t("inline-flex border box-border rounded-full items-center leading-none whitespace-nowrap focus-visible:focus-outline",{lg:"h-8 text-base gap-2",sm:"h-6 text-sm gap-1"}[this.size],{lg:this.removable?"pl-4 pr-3 py-2":"px-4 py-2",sm:this.removable?"pl-3 pr-2 py-2":"px-3 py-[5px]"}[this.size],this.selected?"bg-primary border-primary text-white hover:bg-primary-500 hover:border-primary-500 disabled:bg-neutral-500 disabled:border-neutral-500":"border-primary text-primary hover:border-primary-500 hover:bg-neutral-100 hover:text-primary-500 disabled:border-neutral-500 disabled:text-neutral-500",this.disabled&&!e&&"cursor-not-allowed")}"><slot part="content"></slot>${this.removable?l`<slot part="removable-indicator" name="removable-indicator" @click="${this.handleRemoveClick}" class="${t({lg:"text-base",sm:"text-[12px]"}[this.size])}"><sd-icon library="system" name="close" label="remove"></sd-icon></slot>`:""}</${r}>`}};b.styles=[e.styles,r`:host{display:inline-block}`],h([s("a, button")],b.prototype,"tag",2),h([o({reflect:!0})],b.prototype,"size",2),h([o({type:Boolean,reflect:!0})],b.prototype,"selected",2),h([o({type:Boolean,reflect:!0})],b.prototype,"toggleable",2),h([o({type:Boolean,reflect:!0})],b.prototype,"removable",2),h([o({type:Boolean,reflect:!0})],b.prototype,"disabled",2),h([o()],b.prototype,"href",2),h([o()],b.prototype,"target",2),h([o()],b.prototype,"download",2),b=h([i("sd-tag")],b);export{b as default};
@@ -1 +1 @@
1
- import{S as t,x as e,t as a,c as l,i as s,e as i,n as o,a as r}from"./solid-components2.js";import{d as h}from"./default-value.js";import{F as n}from"./form.js";import{H as d}from"./slot.js";import{o as p}from"./if-defined.js";import{l as u}from"./live.js";import{r as c}from"./state.js";import{w as y}from"./watch.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(t,e,a,l)=>{for(var s,i=l>1?void 0:l?b(e,a):e,o=t.length-1;o>=0;o--)(s=t[o])&&(i=(l?s(e,a,i):s(i))||i);return l&&i&&m(e,a,i),i};let v=class extends t{constructor(){super(...arguments),this.formControlController=new n(this),this.hasSlotController=new d(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),l=this.hasSlotController.test("help-text"),s=!!this.label||!!t,i=!!this.helpText||!!l,o=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",r="sm"===this.size?"text-sm":"text-base",h={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="flex flex-col h-full text-left"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(s?"inline-block":"hidden",r)}" for="input" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${a("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[o])}"></div><div part="base" class="${a("textarea h-full px-4 flex items-top rounded-default group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===o?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${a("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",r)}" title="${this.title}" name="${p(this.name)}" .value="${u(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${p(this.placeholder)}" minlength="${p(this.minlength)}" maxlength="${p(this.maxlength)}" rows="${p(this.rows)}" autocapitalize="${p(this.autocapitalize)}" autocorrect="${p(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${p(this.spellcheck)}" enterkeyhint="${p(this.enterkeyhint)}" inputmode="${p(this.inputmode)}" aria-describedby="help-text invalid-message" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-icon class="${a("text-error absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="risk" part="invalid-icon"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?e`<sd-icon class="${a("text-success absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="status-check" part="valid-icon"></sd-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700",i?"block":"hidden")}" aria-hidden="${i?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};v.styles=[l,t.styles,s`:host{display:block;height:100%}:host([required]) #label::after{content:' *'}.no-scrollbar::-webkit-scrollbar{display:none}`],f([i("#input")],v.prototype,"textarea",2),f([i("#invalid-message")],v.prototype,"invalidMessage",2),f([c()],v.prototype,"hasFocus",2),f([c()],v.prototype,"showValidStyle",2),f([c()],v.prototype,"showInvalidStyle",2),f([o()],v.prototype,"title",2),f([o()],v.prototype,"name",2),f([o()],v.prototype,"value",2),f([o({reflect:!0})],v.prototype,"size",2),f([o()],v.prototype,"label",2),f([o({attribute:"help-text"})],v.prototype,"helpText",2),f([o()],v.prototype,"placeholder",2),f([o({type:Number})],v.prototype,"rows",2),f([o({type:Boolean,reflect:!0})],v.prototype,"disabled",2),f([o({type:Boolean,reflect:!0})],v.prototype,"readonly",2),f([o({reflect:!0})],v.prototype,"form",2),f([o({type:Boolean,reflect:!0})],v.prototype,"required",2),f([o({type:Number})],v.prototype,"minlength",2),f([o({type:Number})],v.prototype,"maxlength",2),f([o()],v.prototype,"autocapitalize",2),f([o()],v.prototype,"autocorrect",2),f([o()],v.prototype,"autocomplete",2),f([o({type:Boolean})],v.prototype,"autofocus",2),f([o()],v.prototype,"enterkeyhint",2),f([o({type:Boolean,reflect:!0,attribute:"style-on-valid"})],v.prototype,"styleOnValid",2),f([o({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],v.prototype,"spellcheck",2),f([o()],v.prototype,"inputmode",2),f([h()],v.prototype,"defaultValue",2),f([y("disabled",{waitUntilFirstUpdate:!0})],v.prototype,"handleDisabledChange",1),f([y("rows",{waitUntilFirstUpdate:!0})],v.prototype,"handleRowsChange",1),f([y("value",{waitUntilFirstUpdate:!0})],v.prototype,"handleValueChange",1),v=f([r("sd-textarea")],v);export{v as default};
1
+ import{S as t,x as e,t as a,c as l,i as s,e as i,n as o,a as r}from"./solid-components2.js";import{d as h}from"./default-value.js";import{F as n}from"./form.js";import{H as d}from"./slot.js";import{o as p}from"./if-defined.js";import{l as u}from"./live.js";import{r as c}from"./state.js";import{w as y}from"./watch.js";var m=Object.defineProperty,b=Object.getOwnPropertyDescriptor,f=(t,e,a,l)=>{for(var s,i=l>1?void 0:l?b(e,a):e,o=t.length-1;o>=0;o--)(s=t[o])&&(i=(l?s(e,a,i):s(i))||i);return l&&i&&m(e,a,i),i};let v=class extends t{constructor(){super(...arguments),this.formControlController=new n(this),this.hasSlotController=new d(this,"help-text","label"),this.hasFocus=!1,this.showValidStyle=!1,this.showInvalidStyle=!1,this.title="",this.name="",this.value="",this.size="lg",this.label="",this.helpText="",this.placeholder="",this.rows=4,this.disabled=!1,this.readonly=!1,this.form="",this.required=!1,this.styleOnValid=!1,this.spellcheck=!0,this.defaultValue=""}get validity(){return this.textarea.validity}get validationMessage(){return this.textarea.validationMessage}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this.setTextareaHeight()}))}firstUpdated(){this.formControlController.updateValidity()}disconnectedCallback(){super.disconnectedCallback()}handleBlur(){this.hasFocus=!1,this.emit("sd-blur")}handleChange(){this.value=this.textarea.value,this.setTextareaHeight(),this.emit("sd-change")}handleFocus(){this.hasFocus=!0,this.emit("sd-focus")}handleInput(){this.value=this.textarea.value,this.formControlController.updateValidity(),this.emit("sd-input")}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t),this.invalidMessage.textContent=t.target.validationMessage}setTextareaHeight(){this.textarea.style.height=void 0}handleDisabledChange(){this.formControlController.setValidity(this.disabled)}handleRowsChange(){this.setTextareaHeight()}async handleValueChange(){await this.updateComplete,this.formControlController.updateValidity(),this.setTextareaHeight()}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}select(){this.textarea.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.textarea.scrollTop=t.top),void("number"==typeof t.left&&(this.textarea.scrollLeft=t.left))):{top:this.textarea.scrollTop,left:this.textarea.scrollTop}}setSelectionRange(t,e,a="none"){this.textarea.setSelectionRange(t,e,a)}setRangeText(t,e,a,l){this.textarea.setRangeText(t,e,a,l),this.value!==this.textarea.value&&(this.value=this.textarea.value),this.value!==this.textarea.value&&(this.value=this.textarea.value,this.setTextareaHeight())}checkValidity(){var t;return null==(t=this.textarea)?void 0:t.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.textarea.reportValidity()}setCustomValidity(t){this.textarea.setCustomValidity(t),this.formControlController.updateValidity()}render(){const t=this.hasSlotController.test("label"),l=this.hasSlotController.test("help-text"),s=!!this.label||!!t,i=!!this.helpText||!!l,o=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",r="sm"===this.size?"text-sm":"text-base",h={sm:"text-base ml-1",md:"text-lg ml-2",lg:"text-xl ml-2"}[this.size];return e`<div part="form-control" class="flex flex-col h-full text-left"><div class="flex items-center gap-1 mb-2"><label part="form-control-label" id="label" class="${a(s?"inline-block":"hidden",r)}" for="input" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><slot name="tooltip"></slot></div><div part="form-control-input" class="${a("relative h-full w-full",this.disabled&&"cursor-not-allowed")}"><div part="border" class="${a("absolute w-full h-full pointer-events-none border rounded-default",{disabled:"border-neutral-500",readonly:"border-neutral-800",activeInvalid:"border-error border-2",activeValid:"border-success border-2",active:"border-primary border-2",invalid:"border-error",valid:"border-success",default:"border-neutral-800"}[o])}"></div><div part="base" class="${a("textarea h-full px-4 flex items-top rounded-default group",{sm:"textarea-sm py-1",md:"textarea-md py-1",lg:"textarea-lg py-2"}[this.size],this.disabled||this.readonly?"":"hover:bg-neutral-200",this.readonly?"bg-neutral-100":"bg-white","disabled"===o?"text-neutral-500":"text-black")}"><textarea part="textarea" id="input" class="${a("flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",this.disabled&&"cursor-not-allowed",r)}" title="${this.title}" name="${p(this.name)}" .value="${u(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${p(this.placeholder)}" minlength="${p(this.minlength)}" maxlength="${p(this.maxlength)}" rows="${p(this.rows)}" autocapitalize="${p(this.autocapitalize)}" autocorrect="${p(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${p(this.spellcheck)}" enterkeyhint="${p(this.enterkeyhint)}" inputmode="${p(this.inputmode)}" aria-describedby="help-text invalid-message" aria-invalid="${this.showInvalidStyle}" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle?e`<sd-icon class="${a("text-error absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="risk" part="invalid-icon"></sd-icon>`:""} ${this.styleOnValid&&this.showValidStyle?e`<sd-icon class="${a("text-success absolute right-4 bg-white group-hover:bg-neutral-200",h)}" library="system" name="status-check" part="valid-icon"></sd-icon>`:""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${a("text-sm text-neutral-700",i?"block":"hidden")}" aria-hidden="${i?"false":"true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`}};v.styles=[l,t.styles,s`:host{display:block;height:100%}:host([required]) #label::after{content:' *'}.no-scrollbar::-webkit-scrollbar{display:none}`],f([i("#input")],v.prototype,"textarea",2),f([i("#invalid-message")],v.prototype,"invalidMessage",2),f([c()],v.prototype,"hasFocus",2),f([c()],v.prototype,"showValidStyle",2),f([c()],v.prototype,"showInvalidStyle",2),f([o()],v.prototype,"title",2),f([o()],v.prototype,"name",2),f([o()],v.prototype,"value",2),f([o({reflect:!0})],v.prototype,"size",2),f([o()],v.prototype,"label",2),f([o({attribute:"help-text"})],v.prototype,"helpText",2),f([o()],v.prototype,"placeholder",2),f([o({type:Number})],v.prototype,"rows",2),f([o({type:Boolean,reflect:!0})],v.prototype,"disabled",2),f([o({type:Boolean,reflect:!0})],v.prototype,"readonly",2),f([o({reflect:!0})],v.prototype,"form",2),f([o({type:Boolean,reflect:!0})],v.prototype,"required",2),f([o({type:Number})],v.prototype,"minlength",2),f([o({type:Number})],v.prototype,"maxlength",2),f([o()],v.prototype,"autocapitalize",2),f([o()],v.prototype,"autocorrect",2),f([o()],v.prototype,"autocomplete",2),f([o({type:Boolean})],v.prototype,"autofocus",2),f([o()],v.prototype,"enterkeyhint",2),f([o({type:Boolean,reflect:!0,attribute:"style-on-valid"})],v.prototype,"styleOnValid",2),f([o({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],v.prototype,"spellcheck",2),f([o()],v.prototype,"inputmode",2),f([h()],v.prototype,"defaultValue",2),f([y("disabled",{waitUntilFirstUpdate:!0})],v.prototype,"handleDisabledChange",1),f([y("rows",{waitUntilFirstUpdate:!0})],v.prototype,"handleRowsChange",1),f([y("value",{waitUntilFirstUpdate:!0})],v.prototype,"handleValueChange",1),v=f([r("sd-textarea")],v);export{v as default};