@sula-tech/webcomponents 0.3.3 → 0.4.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 (190) hide show
  1. package/dist/cjs/{index-87eec792.js → index-BtkenDV1.js} +205 -156
  2. package/dist/cjs/index-BtkenDV1.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -0
  4. package/dist/cjs/index.cjs.js.map +1 -1
  5. package/dist/cjs/loader.cjs.js +4 -6
  6. package/dist/cjs/loader.cjs.js.map +1 -1
  7. package/dist/cjs/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.cjs.js.map +1 -0
  8. package/dist/cjs/sula-avatar_14.cjs.entry.js +28270 -0
  9. package/dist/cjs/sula-avatar_14.cjs.entry.js.map +1 -0
  10. package/dist/cjs/webcomponents.cjs.js +8 -8
  11. package/dist/cjs/webcomponents.cjs.js.map +1 -1
  12. package/dist/collection/assets/lottie/loader.json +1 -0
  13. package/dist/collection/collection-manifest.json +7 -2
  14. package/dist/collection/components/sula-avatar/sula-avatar.css +1 -1
  15. package/dist/collection/components/sula-avatar/sula-avatar.js +4 -4
  16. package/dist/collection/components/sula-avatar/sula-avatar.stories.js +7 -0
  17. package/dist/collection/components/sula-avatar/sula-avatar.stories.js.map +1 -1
  18. package/dist/collection/components/sula-badge/sula-badge.css +1 -1
  19. package/dist/collection/components/sula-badge/sula-badge.js +5 -5
  20. package/dist/collection/components/sula-badge/sula-badge.stories.js +7 -0
  21. package/dist/collection/components/sula-badge/sula-badge.stories.js.map +1 -1
  22. package/dist/collection/components/sula-button/sula-button.css +1 -1
  23. package/dist/collection/components/sula-button/sula-button.js +8 -8
  24. package/dist/collection/components/sula-button/sula-button.stories.js +7 -0
  25. package/dist/collection/components/sula-button/sula-button.stories.js.map +1 -1
  26. package/dist/collection/components/sula-checkbox/sula-checkbox.css +1 -1
  27. package/dist/collection/components/sula-checkbox/sula-checkbox.js +5 -5
  28. package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js +7 -0
  29. package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js.map +1 -1
  30. package/dist/collection/components/sula-chip/model/sula-chip.model.js +6 -0
  31. package/dist/collection/components/sula-chip/model/sula-chip.model.js.map +1 -0
  32. package/dist/collection/components/sula-chip/sula-chip.css +1 -0
  33. package/dist/collection/components/sula-chip/sula-chip.js +243 -0
  34. package/dist/collection/components/sula-chip/sula-chip.js.map +1 -0
  35. package/dist/collection/components/sula-chip/sula-chip.stories.js +125 -0
  36. package/dist/collection/components/sula-chip/sula-chip.stories.js.map +1 -0
  37. package/dist/collection/components/sula-icon/sula-icon.css +1 -1
  38. package/dist/collection/components/sula-icon/sula-icon.js +3 -3
  39. package/dist/collection/components/sula-loader/model/sula-loader.model.js +7 -0
  40. package/dist/collection/components/sula-loader/model/sula-loader.model.js.map +1 -0
  41. package/dist/collection/components/sula-loader/sula-loader.css +1 -0
  42. package/dist/collection/components/sula-loader/sula-loader.js +102 -0
  43. package/dist/collection/components/sula-loader/sula-loader.js.map +1 -0
  44. package/dist/collection/components/sula-loader/sula-loader.stories.js +48 -0
  45. package/dist/collection/components/sula-loader/sula-loader.stories.js.map +1 -0
  46. package/dist/collection/components/sula-loader/test/__mocks__/lottie-web.js +10 -0
  47. package/dist/collection/components/sula-loader/test/__mocks__/lottie-web.js.map +1 -0
  48. package/dist/collection/components/sula-menu-select-list/model/sula-menu-select-list.model.js +2 -0
  49. package/dist/collection/components/sula-menu-select-list/model/sula-menu-select-list.model.js.map +1 -0
  50. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.css +1 -0
  51. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +81 -0
  52. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js.map +1 -0
  53. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.stories.js +91 -0
  54. package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.stories.js.map +1 -0
  55. package/dist/collection/components/sula-radio-button/sula-radio-button.css +1 -0
  56. package/dist/collection/components/sula-radio-button/sula-radio-button.js +176 -0
  57. package/dist/collection/components/sula-radio-button/sula-radio-button.js.map +1 -0
  58. package/dist/collection/components/sula-radio-button/sula-radio-button.stories.js +123 -0
  59. package/dist/collection/components/sula-radio-button/sula-radio-button.stories.js.map +1 -0
  60. package/dist/collection/components/sula-switch/sula-switch.css +1 -1
  61. package/dist/collection/components/sula-switch/sula-switch.js +9 -9
  62. package/dist/collection/components/sula-switch/sula-switch.stories.js +7 -0
  63. package/dist/collection/components/sula-switch/sula-switch.stories.js.map +1 -1
  64. package/dist/collection/components/sula-tag/sula-tag.css +1 -1
  65. package/dist/collection/components/sula-tag/sula-tag.js +9 -9
  66. package/dist/collection/components/sula-tag/sula-tag.stories.js +7 -0
  67. package/dist/collection/components/sula-tag/sula-tag.stories.js.map +1 -1
  68. package/dist/collection/components/sula-textarea/sula-textarea.css +1 -1
  69. package/dist/collection/components/sula-textarea/sula-textarea.js +14 -14
  70. package/dist/collection/components/sula-textarea/sula-textarea.js.map +1 -1
  71. package/dist/collection/components/sula-textarea/sula-textarea.stories.js +7 -0
  72. package/dist/collection/components/sula-textarea/sula-textarea.stories.js.map +1 -1
  73. package/dist/collection/components/sula-textfield/sula-textfield.css +1 -1
  74. package/dist/collection/components/sula-textfield/sula-textfield.js +12 -12
  75. package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -1
  76. package/dist/collection/components/sula-textfield/sula-textfield.stories.js +7 -0
  77. package/dist/collection/components/sula-textfield/sula-textfield.stories.js.map +1 -1
  78. package/dist/collection/components/sula-tiles/model/sula-tiles.model.js +11 -0
  79. package/dist/collection/components/sula-tiles/model/sula-tiles.model.js.map +1 -0
  80. package/dist/collection/components/sula-tiles/sula-tiles.css +1 -0
  81. package/dist/collection/components/sula-tiles/sula-tiles.js +316 -0
  82. package/dist/collection/components/sula-tiles/sula-tiles.js.map +1 -0
  83. package/dist/collection/components/sula-tiles/sula-tiles.stories.js +420 -0
  84. package/dist/collection/components/sula-tiles/sula-tiles.stories.js.map +1 -0
  85. package/dist/components/index.js +1251 -1
  86. package/dist/components/index.js.map +1 -1
  87. package/dist/components/{p-b0d1214f.js → p-CEU3PNQs.js} +6 -6
  88. package/dist/components/p-CEU3PNQs.js.map +1 -0
  89. package/dist/components/p-DJGFqp8r.js +44 -0
  90. package/dist/components/p-DJGFqp8r.js.map +1 -0
  91. package/dist/components/sula-avatar.js +5 -5
  92. package/dist/components/sula-avatar.js.map +1 -1
  93. package/dist/components/sula-badge.js +5 -5
  94. package/dist/components/sula-badge.js.map +1 -1
  95. package/dist/components/sula-button.js +6 -6
  96. package/dist/components/sula-button.js.map +1 -1
  97. package/dist/components/sula-checkbox.js +8 -8
  98. package/dist/components/sula-checkbox.js.map +1 -1
  99. package/dist/components/sula-chip.d.ts +11 -0
  100. package/dist/components/sula-chip.js +136 -0
  101. package/dist/components/sula-chip.js.map +1 -0
  102. package/dist/components/sula-icon.js +2 -1
  103. package/dist/components/sula-loader.d.ts +11 -0
  104. package/dist/components/sula-loader.js +27132 -0
  105. package/dist/components/sula-loader.js.map +1 -0
  106. package/dist/components/sula-menu-select-list.d.ts +11 -0
  107. package/dist/components/sula-menu-select-list.js +9 -0
  108. package/dist/components/sula-menu-select-list.js.map +1 -0
  109. package/dist/components/sula-radio-button.d.ts +11 -0
  110. package/dist/components/sula-radio-button.js +83 -0
  111. package/dist/components/sula-radio-button.js.map +1 -0
  112. package/dist/components/sula-switch.js +11 -11
  113. package/dist/components/sula-switch.js.map +1 -1
  114. package/dist/components/sula-tag.js +8 -8
  115. package/dist/components/sula-tag.js.map +1 -1
  116. package/dist/components/sula-textarea.js +13 -13
  117. package/dist/components/sula-textarea.js.map +1 -1
  118. package/dist/components/sula-textfield.js +11 -11
  119. package/dist/components/sula-textfield.js.map +1 -1
  120. package/dist/components/sula-tiles.d.ts +11 -0
  121. package/dist/components/sula-tiles.js +180 -0
  122. package/dist/components/sula-tiles.js.map +1 -0
  123. package/dist/esm/{index-aa1c5f36.js → index-Yyeke16a.js} +203 -135
  124. package/dist/esm/index-Yyeke16a.js.map +1 -0
  125. package/dist/esm/index.js +1 -0
  126. package/dist/esm/index.js.map +1 -1
  127. package/dist/esm/loader.js +4 -4
  128. package/dist/esm/loader.js.map +1 -1
  129. package/dist/esm/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.js.map +1 -0
  130. package/dist/esm/sula-avatar_14.entry.js +28255 -0
  131. package/dist/esm/sula-avatar_14.entry.js.map +1 -0
  132. package/dist/esm/webcomponents.js +6 -5
  133. package/dist/esm/webcomponents.js.map +1 -1
  134. package/dist/types/components/sula-avatar/sula-avatar.stories.d.ts +7 -0
  135. package/dist/types/components/sula-badge/sula-badge.stories.d.ts +7 -0
  136. package/dist/types/components/sula-button/sula-button.stories.d.ts +7 -0
  137. package/dist/types/components/sula-checkbox/sula-checkbox.stories.d.ts +7 -0
  138. package/dist/types/components/sula-chip/model/sula-chip.model.d.ts +4 -0
  139. package/dist/types/components/sula-chip/sula-chip.d.ts +40 -0
  140. package/dist/types/components/sula-chip/sula-chip.stories.d.ts +64 -0
  141. package/dist/types/components/sula-loader/model/sula-loader.model.d.ts +5 -0
  142. package/dist/types/components/sula-loader/sula-loader.d.ts +19 -0
  143. package/dist/types/components/sula-loader/sula-loader.stories.d.ts +29 -0
  144. package/dist/types/components/sula-loader/test/__mocks__/lottie-web.d.ts +4 -0
  145. package/dist/types/components/sula-menu-select-list/model/sula-menu-select-list.model.d.ts +4 -0
  146. package/dist/types/components/sula-menu-select-list/sula-menu-select-list.d.ts +14 -0
  147. package/dist/types/components/sula-menu-select-list/sula-menu-select-list.stories.d.ts +32 -0
  148. package/dist/types/components/sula-radio-button/sula-radio-button.d.ts +32 -0
  149. package/dist/types/components/sula-radio-button/sula-radio-button.stories.d.ts +57 -0
  150. package/dist/types/components/sula-switch/sula-switch.stories.d.ts +7 -0
  151. package/dist/types/components/sula-tag/sula-tag.stories.d.ts +7 -0
  152. package/dist/types/components/sula-textarea/sula-textarea.stories.d.ts +7 -0
  153. package/dist/types/components/sula-textfield/sula-textfield.stories.d.ts +7 -0
  154. package/dist/types/components/sula-tiles/model/sula-tiles.model.d.ts +8 -0
  155. package/dist/types/components/sula-tiles/sula-tiles.d.ts +54 -0
  156. package/dist/types/components/sula-tiles/sula-tiles.stories.d.ts +99 -0
  157. package/dist/types/components.d.ts +383 -0
  158. package/dist/types/stencil-public-runtime.d.ts +23 -1
  159. package/dist/webcomponents/assets/lottie/loader.json +1 -0
  160. package/dist/webcomponents/index.esm.js +1 -0
  161. package/dist/webcomponents/index.esm.js.map +1 -1
  162. package/dist/webcomponents/loader.esm.js.map +1 -0
  163. package/dist/webcomponents/p-67f9fa90.entry.js +21628 -0
  164. package/dist/webcomponents/p-67f9fa90.entry.js.map +1 -0
  165. package/dist/webcomponents/p-Yyeke16a.js +1469 -0
  166. package/dist/webcomponents/p-Yyeke16a.js.map +1 -0
  167. package/dist/webcomponents/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.esm.js.map +1 -0
  168. package/dist/webcomponents/webcomponents.esm.js +33 -9
  169. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  170. package/package.json +5 -2
  171. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  172. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  173. package/dist/cjs/index-87eec792.js.map +0 -1
  174. package/dist/cjs/sula-avatar_9.cjs.entry.js +0 -865
  175. package/dist/cjs/sula-avatar_9.cjs.entry.js.map +0 -1
  176. package/dist/components/p-881c6b35.js +0 -1198
  177. package/dist/components/p-881c6b35.js.map +0 -1
  178. package/dist/components/p-b0d1214f.js.map +0 -1
  179. package/dist/esm/app-globals-0f993ce5.js +0 -5
  180. package/dist/esm/app-globals-0f993ce5.js.map +0 -1
  181. package/dist/esm/index-aa1c5f36.js.map +0 -1
  182. package/dist/esm/sula-avatar_9.entry.js +0 -853
  183. package/dist/esm/sula-avatar_9.entry.js.map +0 -1
  184. package/dist/webcomponents/p-5a36af0f.js +0 -1492
  185. package/dist/webcomponents/p-5a36af0f.js.map +0 -1
  186. package/dist/webcomponents/p-7cde1edf.entry.js +0 -1123
  187. package/dist/webcomponents/p-7cde1edf.entry.js.map +0 -1
  188. package/dist/webcomponents/p-e1255160.js +0 -4
  189. package/dist/webcomponents/p-e1255160.js.map +0 -1
  190. package/loader/package.json +0 -11
@@ -1,4 +1,4 @@
1
- import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-881c6b35.js';
1
+ import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
2
2
 
3
3
  var SulaTextareaStatus;
4
4
  (function (SulaTextareaStatus) {
@@ -6,17 +6,16 @@ var SulaTextareaStatus;
6
6
  SulaTextareaStatus["Error"] = "error";
7
7
  })(SulaTextareaStatus || (SulaTextareaStatus = {}));
8
8
 
9
- const sulaTextareaCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.outline{outline-style:solid}:host{display:block;width:100%}.textarea-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.textarea-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.label-up{animation:labelMoveUp .2s ease-in-out}.label-down{animation:labelMoveDown .2s ease-in-out}@keyframes labelMoveUp{0%{font-size:1rem;left:12px;top:16px}to{font-size:.875rem;left:16px;top:12px}}@keyframes labelMoveDown{0%{font-size:.875rem;left:16px;top:12px}to{font-size:1rem;left:12px;top:16px}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#500202;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#683f08;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#691e07;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f4f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.pointer-events-none{pointer-events:none}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-12{left:.75rem}.left-16{left:1rem}.top-12{top:.75rem}.top-16{top:1rem}.z-10{z-index:10}.mt-4{margin-top:.25rem}.flex{display:flex}.h-full{height:100%}.w-\\[85\\%\\]{width:85%}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-text{cursor:text}.resize-none{resize:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.overflow-hidden{overflow:hidden}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-none{border-style:none}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.pt-0{padding-top:0}.pt-6{padding-top:1.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}";
10
- const SulaTextareaStyle0 = sulaTextareaCss;
9
+ const sulaTextareaCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.outline{outline-style:solid}:host{display:block;width:100%}.textarea-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.textarea-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.label-up{animation:labelMoveUp .2s ease-in-out}.label-down{animation:labelMoveDown .2s ease-in-out}@keyframes labelMoveUp{0%{font-size:1rem;left:12px;top:16px}to{font-size:.875rem;left:16px;top:12px}}@keyframes labelMoveDown{0%{font-size:.875rem;left:16px;top:12px}to{font-size:1rem;left:12px;top:16px}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#500202;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#683f08;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#691e07;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f4f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.pointer-events-none{pointer-events:none}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-12{left:.75rem}.left-16{left:1rem}.top-12{top:.75rem}.top-16{top:1rem}.z-10{z-index:10}.mt-4{margin-top:.25rem}.flex{display:flex}.h-full{height:100%}.w-\\[85\\%\\]{width:85%}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-text{cursor:text}.resize-none{resize:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.overflow-hidden{overflow:hidden}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-none{border-style:none}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.py-12{padding-bottom:.75rem;padding-top:.75rem}.pt-0{padding-top:0}.pt-6{padding-top:1.5rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}";
11
10
 
12
11
  const SulaTextarea$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextarea extends H {
13
12
  constructor() {
14
13
  super();
15
14
  this.__registerHost();
16
15
  this.__attachShadow();
17
- this.valueChanged = createEvent(this, "valueChanged", 7);
18
- this.focusedOn = createEvent(this, "focusedOn", 7);
19
- this.focusedOut = createEvent(this, "focusedOut", 7);
16
+ this.valueChanged = createEvent(this, "valueChanged");
17
+ this.focusedOn = createEvent(this, "focusedOn");
18
+ this.focusedOut = createEvent(this, "focusedOut");
20
19
  /**
21
20
  * The textarea status
22
21
  */
@@ -64,7 +63,7 @@ const SulaTextarea$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextarea exten
64
63
  };
65
64
  }
66
65
  handleClick(event) {
67
- if (!this.node)
66
+ if (!this.node || !this.textareaIsFocused)
68
67
  return;
69
68
  const clickInside = this.node.contains(event.target);
70
69
  if (!clickInside && (!this.textValue || this.textValue.trim().length === 0)) {
@@ -98,13 +97,13 @@ const SulaTextarea$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextarea exten
98
97
  }
99
98
  render() {
100
99
  const containerHeight = this.rows * 24 + 48;
101
- return (h(Host, { key: '69db08ba2dfa48ab4972febe5fb1ece24574c0d1', ref: node => (this.node = node) }, h("div", { key: '2aa2f346436687068696e73f9a8a4d89b24d69ec' }, h("div", { key: '35c9c074790112d6622b032f0dff0f54c99ab7f8', id: "textarea-container", class: {
100
+ return (h(Host, { key: '57c232e61727c00ddebfff0aec234d32b5d7ab20', ref: node => (this.node = node) }, h("div", { key: '9973953fb0a42915f5829c464966a85fc8de29a5' }, h("div", { key: '5a0e22f5a0da4b3a5f756b9630f1aa81c7bc89c4', id: "textarea-container", class: {
102
101
  'relative border rounded-sm px-16 py-12 outline-none caret-brand-primary': true,
103
102
  'textarea-focus': this.textareaIsFocused && !this.disabled && this.status === SulaTextareaStatus.Default,
104
103
  'textarea-error': this.status === SulaTextareaStatus.Error && !this.disabled,
105
104
  'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
106
105
  'bg-surface-body border-line-input cursor-text': !this.disabled,
107
- }, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h("label", { key: 'fe14082916a84da099bfc0798a10eee16169b9f7', class: {
106
+ }, style: { height: `${containerHeight}px` }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleTextareaClick }, h("label", { key: '18c83444b42e60e93dd8245127f9f84e6fc4dcc0', class: {
108
107
  'absolute font-bold transition-all duration-200 ease-in-out pointer-events-none z-10 w-[85%]': true,
109
108
  'text-sm top-12 left-16': this.isActive,
110
109
  'text-base top-16 left-12': !this.isActive,
@@ -112,23 +111,23 @@ const SulaTextarea$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextarea exten
112
111
  'text-text-disabled': this.disabled,
113
112
  'bg-surface-body': !this.disabled && this.isActive,
114
113
  [this.labelAnimationClass]: true,
115
- }, style: this.isActive ? { padding: '0 4px', marginLeft: '-4px' } : {} }, this.label), h("textarea", { key: 'a0a611ffc887e3b5a751e93bd994feb4f63a0ad6', ref: node => (this.textareaElement = node), placeholder: this.isActive ? this.placeholder : '', rows: this.rows, maxLength: this.maxLength, disabled: this.disabled, class: {
114
+ }, style: this.isActive ? { padding: '0 4px', marginLeft: '-4px' } : {} }, this.label), h("textarea", { key: '17049dd7636d3bee5dc37a6270f2a1289c6777b6', ref: node => (this.textareaElement = node), placeholder: this.isActive ? this.placeholder : '', rows: this.rows, maxLength: this.maxLength, disabled: this.disabled, class: {
116
115
  'w-full h-full outline-none text-base bg-transparent border-none resize-none': true,
117
116
  'pt-6': this.isActive,
118
117
  'pt-0': !this.isActive,
119
118
  'text-text-primary': !this.disabled,
120
119
  'text-text-disabled cursor-not-allowed overflow-hidden': this.disabled,
121
- }, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h("div", { key: 'a80df9745209ff2116815600e8077ab0c81dc122', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: '0882feb0b690fd6b56ea8911f1ddea994ef27228', id: "textarea-help-text", class: {
120
+ }, onInput: this.handleTextareaChanges, onFocus: this.handleTextareaFocus, onBlur: this.handleBlur, value: this.textValue })), (this.helpText || this.maxLength) && (h("div", { key: 'e0cc23cc8dc42a88627ab81cf68d6f2d57441df4', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: 'c208c32ea302af2dd85606582733f1ad83a4167b', id: "textarea-help-text", class: {
122
121
  'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
123
122
  'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
124
123
  'text-text-disabled': this.disabled,
125
- } }, this.helpText)), this.maxLength && (h("div", { key: '2f4150bec1a2cff4e484b35f6c92d5ee90791a6c', id: "max-length-container", class: {
124
+ } }, this.helpText)), this.maxLength && (h("div", { key: '0c397be8232862d45b922bc0eab6eef452d02040', id: "max-length-container", class: {
126
125
  'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,
127
126
  'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,
128
127
  'text-text-disabled': this.disabled,
129
128
  } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
130
129
  }
131
- static get style() { return SulaTextareaStyle0; }
130
+ static get style() { return sulaTextareaCss; }
132
131
  }, [1, "sula-textarea", {
133
132
  "value": [1025],
134
133
  "status": [1025],
@@ -162,5 +161,6 @@ const SulaTextarea = SulaTextarea$1;
162
161
  const defineCustomElement = defineCustomElement$1;
163
162
 
164
163
  export { SulaTextarea, defineCustomElement };
164
+ //# sourceMappingURL=sula-textarea.js.map
165
165
 
166
166
  //# sourceMappingURL=sula-textarea.js.map
@@ -1 +1 @@
1
- {"file":"sula-textarea.js","mappings":";;AAAA,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,qCAAe,CAAA;AACjB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB;;ACA9B,MAAM,eAAe,GAAG,y7UAAy7U,CAAC;AACl9U,2BAAe,eAAe;;MCOjBA,cAAY;IALzB;;;;;;;;;;QAe2B,WAAM,GAAuB,kBAAkB,CAAC,OAAO,CAAC;;;;QA8BzE,SAAI,GAAW,CAAC,CAAC;QAqBzB,aAAQ,GAAG,KAAK,CAAC;QAGjB,cAAS,GAAW,EAAE,CAAC;QAGvB,sBAAiB,GAAG,KAAK,CAAC;QAG1B,wBAAmB,GAAG,EAAE,CAAC;QA8CzB,wBAAmB,GAAG;YACpB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,IAAI,CAAC,eAAe,EAAE,CAAC;SACxB,CAAC;QAEF,0BAAqB,GAAG,CAAC,KAAiB;YACxC,MAAM,QAAQ,GAAI,KAAK,CAAC,MAA8B,CAAC,KAAK,CAAC;YAC7D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;YAEtB,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBACjD,IAAI,CAAC,UAA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AAE,IAAI,CAAC,mBAAmB,EACjC,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,KAAK,EAAE,IAAI,CAAC,SAAS,GACrB,CACE,EAEL,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,MAC/B,4DAAK,KAAK,EAAC,sDAAsD,IAC9D,IAAI,CAAC,QAAQ,KACZ,4DACE,EAAE,EAAC,oBAAoB,EACvB,KAAK,EAAE;gBACL,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,kBAAkB,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ;gBACjF,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,kBAAkB,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ;gBACjF,oBAAoB,EAAE,IAAI,CAAC,QAAQ;aACpC,IAEA,IAAI,CAAC,QAAQ,CACV,CACP,EACA,IAAI,CAAC,SAAS,KACb,4DACE,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAE;gBACL,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,kBAAkB,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ;gBACjF,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,kBAAkB,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ;gBACjF,oBAAoB,EAAE,IAAI,CAAC,QAAQ;aACpC,IAEA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,OAAG,IAAI,CAAC,SAAS,CACxD,CACP,CACG,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaTextarea"],"sources":["src/components/sula-textarea/model/sula-textarea.model.ts","src/components/sula-textarea/sula-textarea.scss?tag=sula-textarea&encapsulation=shadow","src/components/sula-textarea/sula-textarea.tsx"],"sourcesContent":["export enum SulaTextareaStatus {\n Default = 'default',\n Error = 'error',\n}\n",":host {\n display: block;\n width: 100%;\n}\n\n.textarea-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n\n.textarea-error {\n outline: 2px solid var(--color-feedback-error) !important;\n outline-offset: 2px !important;\n}\n\n.label-up {\n animation: labelMoveUp 0.2s ease-in-out;\n}\n\n.label-down {\n animation: labelMoveDown 0.2s ease-in-out;\n}\n\n@keyframes labelMoveUp {\n from {\n font-size: 1rem;\n top: 16px;\n left: 12px;\n }\n to {\n font-size: 0.875rem;\n top: 12px;\n left: 16px;\n }\n}\n\n@keyframes labelMoveDown {\n from {\n font-size: 0.875rem;\n top: 12px;\n left: 16px;\n }\n to {\n font-size: 1rem;\n top: 16px;\n left: 12px;\n }\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\nimport { SulaTextareaStatus } from './model/sula-textarea.model';\n\n@Component({\n tag: 'sula-textarea',\n styleUrl: 'sula-textarea.scss',\n shadow: true,\n})\nexport class SulaTextarea {\n /**\n * Value for the textarea.\n */\n @Prop({ mutable: true })\n value?: string;\n\n /**\n * The textarea status\n */\n @Prop({ mutable: true }) status: SulaTextareaStatus = SulaTextareaStatus.Default;\n\n /**\n * The textarea label\n */\n @Prop() label: string;\n\n /**\n * The textarea placeholder\n */\n @Prop() placeholder: string;\n\n /**\n * The textarea is disabled\n */\n @Prop({ mutable: true }) disabled: boolean;\n\n /**\n * The help text for textarea\n */\n @Prop() helpText?: string;\n\n /**\n * The textarea max length\n */\n @Prop() maxLength?: number;\n\n /**\n * The textarea rows (height)\n */\n @Prop() rows: number = 4;\n\n /**\n * Event emitted when textarea value changes.\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when textarea is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when textarea is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n isActive = false;\n\n @State()\n textValue: string = '';\n\n @State()\n textareaIsFocused = false;\n\n @State()\n labelAnimationClass = '';\n\n textareaElement: HTMLTextAreaElement;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleClick(event: Event) {\n if (!this.node) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside && (!this.textValue || this.textValue.trim().length === 0)) {\n this.setLabelDown();\n this.focusedOut.emit();\n this.textareaIsFocused = false;\n }\n }\n\n focusOnTextarea() {\n setTimeout(() => {\n this.textareaElement.focus();\n }, 0);\n }\n\n componentWillLoad() {\n if (this.value && this.value.trim().length > 0) {\n this.textValue = this.value;\n this.isActive = true;\n }\n }\n\n setLabelUp() {\n if (!this.isActive) {\n this.labelAnimationClass = 'label-up';\n this.isActive = true;\n }\n }\n\n setLabelDown() {\n if (this.isActive && (!this.textValue || this.textValue.trim().length === 0)) {\n this.labelAnimationClass = 'label-down';\n this.isActive = false;\n }\n }\n\n handleTextareaClick = () => {\n if (this.disabled) return;\n this.setLabelUp();\n this.focusOnTextarea();\n };\n\n handleTextareaChanges = (event: InputEvent) => {\n const newValue = (event.target as HTMLTextAreaElement).value;\n this.textValue = newValue;\n this.value = newValue;\n\n if (newValue.length > 0 || this.textareaIsFocused) {\n this.setLabelUp();\n }\n\n this.valueChanged.emit(newValue);\n };\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.setLabelUp();\n this.focusOnTextarea();\n };\n\n handleBlur = () => {\n if (!this.textValue || this.textValue.trim().length === 0) {\n this.setLabelDown();\n }\n\n this.focusedOut.emit();\n this.textareaIsFocused = false;\n };\n\n handleTextareaFocus = () => {\n this.focusedOn.emit();\n this.textareaIsFocused = true;\n this.setLabelUp();\n };\n\n render() {\n const containerHeight = this.rows * 24 + 48;\n\n return (\n <Host ref={node => (this.node = node)}>\n <div>\n <div\n id=\"textarea-container\"\n class={{\n 'relative border rounded-sm px-16 py-12 outline-none caret-brand-primary': true,\n 'textarea-focus': this.textareaIsFocused && !this.disabled && this.status === SulaTextareaStatus.Default,\n 'textarea-error': this.status === SulaTextareaStatus.Error && !this.disabled,\n 'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,\n 'bg-surface-body border-line-input cursor-text': !this.disabled,\n }}\n style={{ height: `${containerHeight}px` }}\n tabIndex={0}\n onFocus={this.handleFocus}\n onClick={this.handleTextareaClick}\n >\n <label\n class={{\n 'absolute font-bold transition-all duration-200 ease-in-out pointer-events-none z-10 w-[85%]': true,\n 'text-sm top-12 left-16': this.isActive,\n 'text-base top-16 left-12': !this.isActive,\n 'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),\n 'text-text-disabled': this.disabled,\n 'bg-surface-body': !this.disabled && this.isActive,\n [this.labelAnimationClass]: true,\n }}\n style={this.isActive ? { padding: '0 4px', marginLeft: '-4px' } : {}}\n >\n {this.label}\n </label>\n\n <textarea\n ref={node => (this.textareaElement = node)}\n placeholder={this.isActive ? this.placeholder : ''}\n rows={this.rows}\n maxLength={this.maxLength}\n disabled={this.disabled}\n class={{\n 'w-full h-full outline-none text-base bg-transparent border-none resize-none': true,\n 'pt-6': this.isActive,\n 'pt-0': !this.isActive,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled cursor-not-allowed overflow-hidden': this.disabled,\n }}\n onInput={this.handleTextareaChanges}\n onFocus={this.handleTextareaFocus}\n onBlur={this.handleBlur}\n value={this.textValue}\n />\n </div>\n\n {(this.helpText || this.maxLength) && (\n <div class=\"flex justify-between items-center px-16 mt-4 text-sm\">\n {this.helpText && (\n <div\n id=\"textarea-help-text\"\n class={{\n 'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,\n 'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.helpText}\n </div>\n )}\n {this.maxLength && (\n <div\n id=\"max-length-container\"\n class={{\n 'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,\n 'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.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AE;AACL,gBAAA,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,kBAAkB,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ;AACjF,gBAAA,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,kBAAkB,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ;gBACjF,oBAAoB,EAAE,IAAI,CAAC,QAAQ;AACpC,aAAA,EAAA,EAEA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,OAAG,IAAI,CAAC,SAAS,CACxD,CACP,CACG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaTextarea","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-textarea/model/sula-textarea.model.ts","src/components/sula-textarea/sula-textarea.scss?tag=sula-textarea&encapsulation=shadow","src/components/sula-textarea/sula-textarea.tsx"],"sourcesContent":["export enum SulaTextareaStatus {\n Default = 'default',\n Error = 'error',\n}\n",":host {\n display: block;\n width: 100%;\n}\n\n.textarea-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n\n.textarea-error {\n outline: 2px solid var(--color-feedback-error) !important;\n outline-offset: 2px !important;\n}\n\n.label-up {\n animation: labelMoveUp 0.2s ease-in-out;\n}\n\n.label-down {\n animation: labelMoveDown 0.2s ease-in-out;\n}\n\n@keyframes labelMoveUp {\n from {\n font-size: 1rem;\n top: 16px;\n left: 12px;\n }\n to {\n font-size: 0.875rem;\n top: 12px;\n left: 16px;\n }\n}\n\n@keyframes labelMoveDown {\n from {\n font-size: 0.875rem;\n top: 12px;\n left: 16px;\n }\n to {\n font-size: 1rem;\n top: 16px;\n left: 12px;\n }\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\nimport { SulaTextareaStatus } from './model/sula-textarea.model';\n\n@Component({\n tag: 'sula-textarea',\n styleUrl: 'sula-textarea.scss',\n shadow: true,\n})\nexport class SulaTextarea {\n /**\n * Value for the textarea.\n */\n @Prop({ mutable: true })\n value?: string;\n\n /**\n * The textarea status\n */\n @Prop({ mutable: true }) status: SulaTextareaStatus = SulaTextareaStatus.Default;\n\n /**\n * The textarea label\n */\n @Prop() label: string;\n\n /**\n * The textarea placeholder\n */\n @Prop() placeholder: string;\n\n /**\n * The textarea is disabled\n */\n @Prop({ mutable: true }) disabled: boolean;\n\n /**\n * The help text for textarea\n */\n @Prop() helpText?: string;\n\n /**\n * The textarea max length\n */\n @Prop() maxLength?: number;\n\n /**\n * The textarea rows (height)\n */\n @Prop() rows: number = 4;\n\n /**\n * Event emitted when textarea value changes.\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when textarea is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when textarea is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n isActive = false;\n\n @State()\n textValue: string = '';\n\n @State()\n textareaIsFocused = false;\n\n @State()\n labelAnimationClass = '';\n\n textareaElement: HTMLTextAreaElement;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleClick(event: Event) {\n if (!this.node || !this.textareaIsFocused) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside && (!this.textValue || this.textValue.trim().length === 0)) {\n this.setLabelDown();\n this.focusedOut.emit();\n this.textareaIsFocused = false;\n }\n }\n\n focusOnTextarea() {\n setTimeout(() => {\n this.textareaElement.focus();\n }, 0);\n }\n\n componentWillLoad() {\n if (this.value && this.value.trim().length > 0) {\n this.textValue = this.value;\n this.isActive = true;\n }\n }\n\n setLabelUp() {\n if (!this.isActive) {\n this.labelAnimationClass = 'label-up';\n this.isActive = true;\n }\n }\n\n setLabelDown() {\n if (this.isActive && (!this.textValue || this.textValue.trim().length === 0)) {\n this.labelAnimationClass = 'label-down';\n this.isActive = false;\n }\n }\n\n handleTextareaClick = () => {\n if (this.disabled) return;\n this.setLabelUp();\n this.focusOnTextarea();\n };\n\n handleTextareaChanges = (event: InputEvent) => {\n const newValue = (event.target as HTMLTextAreaElement).value;\n this.textValue = newValue;\n this.value = newValue;\n\n if (newValue.length > 0 || this.textareaIsFocused) {\n this.setLabelUp();\n }\n\n this.valueChanged.emit(newValue);\n };\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.setLabelUp();\n this.focusOnTextarea();\n };\n\n handleBlur = () => {\n if (!this.textValue || this.textValue.trim().length === 0) {\n this.setLabelDown();\n }\n\n this.focusedOut.emit();\n this.textareaIsFocused = false;\n };\n\n handleTextareaFocus = () => {\n this.focusedOn.emit();\n this.textareaIsFocused = true;\n this.setLabelUp();\n };\n\n render() {\n const containerHeight = this.rows * 24 + 48;\n\n return (\n <Host ref={node => (this.node = node)}>\n <div>\n <div\n id=\"textarea-container\"\n class={{\n 'relative border rounded-sm px-16 py-12 outline-none caret-brand-primary': true,\n 'textarea-focus': this.textareaIsFocused && !this.disabled && this.status === SulaTextareaStatus.Default,\n 'textarea-error': this.status === SulaTextareaStatus.Error && !this.disabled,\n 'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,\n 'bg-surface-body border-line-input cursor-text': !this.disabled,\n }}\n style={{ height: `${containerHeight}px` }}\n tabIndex={0}\n onFocus={this.handleFocus}\n onClick={this.handleTextareaClick}\n >\n <label\n class={{\n 'absolute font-bold transition-all duration-200 ease-in-out pointer-events-none z-10 w-[85%]': true,\n 'text-sm top-12 left-16': this.isActive,\n 'text-base top-16 left-12': !this.isActive,\n 'text-text-primary': !this.disabled && (this.isActive || this.status === SulaTextareaStatus.Default),\n 'text-text-disabled': this.disabled,\n 'bg-surface-body': !this.disabled && this.isActive,\n [this.labelAnimationClass]: true,\n }}\n style={this.isActive ? { padding: '0 4px', marginLeft: '-4px' } : {}}\n >\n {this.label}\n </label>\n\n <textarea\n ref={node => (this.textareaElement = node)}\n placeholder={this.isActive ? this.placeholder : ''}\n rows={this.rows}\n maxLength={this.maxLength}\n disabled={this.disabled}\n class={{\n 'w-full h-full outline-none text-base bg-transparent border-none resize-none': true,\n 'pt-6': this.isActive,\n 'pt-0': !this.isActive,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled cursor-not-allowed overflow-hidden': this.disabled,\n }}\n onInput={this.handleTextareaChanges}\n onFocus={this.handleTextareaFocus}\n onBlur={this.handleBlur}\n value={this.textValue}\n />\n </div>\n\n {(this.helpText || this.maxLength) && (\n <div class=\"flex justify-between items-center px-16 mt-4 text-sm\">\n {this.helpText && (\n <div\n id=\"textarea-help-text\"\n class={{\n 'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,\n 'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.helpText}\n </div>\n )}\n {this.maxLength && (\n <div\n id=\"max-length-container\"\n class={{\n 'text-text-primary': this.status === SulaTextareaStatus.Default && !this.disabled,\n 'text-feedback-error': this.status === SulaTextareaStatus.Error && !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.textValue ? this.textValue.length : 0}/{this.maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
- import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-881c6b35.js';
2
- import { d as defineCustomElement$2 } from './p-b0d1214f.js';
1
+ import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
2
+ import { d as defineCustomElement$2 } from './p-CEU3PNQs.js';
3
3
 
4
4
  var SulaTextfieldType;
5
5
  (function (SulaTextfieldType) {
@@ -12,17 +12,16 @@ var SulaTextfieldStatus;
12
12
  SulaTextfieldStatus["Error"] = "error";
13
13
  })(SulaTextfieldStatus || (SulaTextfieldStatus = {}));
14
14
 
15
- const sulaTextfieldCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.transform{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))}.outline{outline-style:solid}:host{display:block}.button-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.button-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.from-down{animation:from-down .2s ease-in-out}.from-up{animation:from-up .2s ease-in-out}@keyframes from-down{0%{opacity:0;transform:translateY(75%)}to{opacity:1;transform:translateY(0)}}@keyframes from-up{0%{opacity:0;transform:translateY(-75%)}to{opacity:1;transform:translateY(0)}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#500202;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#683f08;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#691e07;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f4f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.static{position:static}.mt-4{margin-top:.25rem}.flex{display:flex}.hidden{display:none}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.pr-12{padding-right:.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}";
16
- const SulaTextfieldStyle0 = sulaTextfieldCss;
15
+ const sulaTextfieldCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}.transform{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))}.outline{outline-style:solid}:host{display:block}.button-focus{outline:2px solid var(--color-feedback-informational)!important;outline-offset:2px!important}.button-error{outline:2px solid var(--color-feedback-error)!important;outline-offset:2px!important}.from-down{animation:from-down .2s ease-in-out}.from-up{animation:from-up .2s ease-in-out}@keyframes from-down{0%{opacity:0;transform:translateY(75%)}to{opacity:1;transform:translateY(0)}}@keyframes from-up{0%{opacity:0;transform:translateY(-75%)}to{opacity:1;transform:translateY(0)}}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#500202;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#683f08;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#691e07;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f4f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.static{position:static}.mt-4{margin-top:.25rem}.flex{display:flex}.hidden{display:none}.h-\\[72px\\]{height:72px}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.rounded-sm{border-radius:.75rem}.border{border-width:1px}.border-line-general{border-color:var(--color-line-general)}.border-line-input{border-color:var(--color-line-input)}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-body{background-color:var(--color-surface-body)}.bg-transparent{background-color:transparent}.px-16{padding-left:1rem;padding-right:1rem}.pr-12{padding-right:.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-bold{font-weight:700}.text-feedback-error{color:var(--color-feedback-error)}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.text-text-disabled{color:var(--color-text-disabled)}.text-text-primary{color:var(--color-text-primary)}.caret-brand-primary{caret-color:var(--color-brand-primary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}";
17
16
 
18
17
  const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield extends H {
19
18
  constructor() {
20
19
  super();
21
20
  this.__registerHost();
22
21
  this.__attachShadow();
23
- this.valueChanged = createEvent(this, "valueChanged", 7);
24
- this.focusedOn = createEvent(this, "focusedOn", 7);
25
- this.focusedOut = createEvent(this, "focusedOut", 7);
22
+ this.valueChanged = createEvent(this, "valueChanged");
23
+ this.focusedOn = createEvent(this, "focusedOn");
24
+ this.focusedOut = createEvent(this, "focusedOut");
26
25
  /**
27
26
  * The textfield type
28
27
  */
@@ -66,7 +65,7 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
66
65
  };
67
66
  }
68
67
  handleClick(event) {
69
- if (!this.node)
68
+ if (!this.node || !this.inputIsFocused)
70
69
  return;
71
70
  const clickInside = this.node.contains(event.target);
72
71
  if (!clickInside) {
@@ -118,16 +117,16 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
118
117
  return this.icon;
119
118
  }
120
119
  render() {
121
- return (h(Host, { key: '7861723c4c9a71e02a642cc856978432f1ed408e', ref: node => (this.node = node) }, h("div", { key: 'bc52f29a24273991355aa8b168f4e0740391e582' }, h("div", { key: '69fe9a5ffad527e0667fd47c8afa53b8dfd1f999', id: "button-container", class: {
120
+ return (h(Host, { key: '9c4193ba6e336add0d1c51605afd361af3066b71', ref: node => (this.node = node) }, h("div", { key: 'd54d4a4e3476dce6465152110926d911cd6fe76f' }, h("div", { key: 'ad310e6e6665b7b4dc86d063c6eb231b30da03d6', id: "button-container", class: {
122
121
  'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,
123
122
  'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,
124
123
  'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,
125
124
  'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,
126
125
  'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
127
126
  'bg-surface-body border-line-input cursor-pointer': !this.disabled,
128
- }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h("div", { key: '8590a7a30d6f8887fa6e32305ecdd7a446abe690', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h("label", { key: '6c93818aa3b4d0dbc487b45b6cf1935fe38669fe', class: "font-bold text-sm text-text-primary from-down" }, this.label), h("input", { key: 'e24e3743fb2aa481eaa20034b60b94e932396b24', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary bg-transparent", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.value }))), h("div", { key: '5c4542212763798121f13b7fcd1039ceaea3f2d3', id: "textfield-label", class: { 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }, ref: node => (this.labelElement = node) }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && (h("div", { key: 'faa4e5e74277dec53ed4665885c18f56b4f4b487', class: "flex items-center justify-center", onClick: this.handleIconClick }, h("sula-icon", { key: '5c189458c9994fc2a849d9ff1720044f070be2b1', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h("div", { key: 'a79c6661890b9fe306329de28d8471b9b051e78e', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: 'c7f7cba7ec6cb4e1492d9ae0cae3368325aaa5a4', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (h("div", { key: 'b50537b15c8f565b02b0eceac9a061e250a7bd10', id: "max-length-container", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
127
+ }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h("div", { key: '7c95cc92de32eb596c005d54244feb8a0431c024', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h("label", { key: '5368c5c52c308503ac6bf004fec6b61cff70e585', class: "font-bold text-sm text-text-primary from-down" }, this.label), h("input", { key: 'aecd88e5ab8c717ecc8b94e49f8f363b09be5da9', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary bg-transparent", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.value }))), h("div", { key: '11db876fe9c49527ba3b25e57f23fbc2eb14fc0e', id: "textfield-label", class: { 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }, ref: node => (this.labelElement = node) }, this.label), (!!this.icon || this.type === SulaTextfieldType.Password) && (h("div", { key: '2f4200a031dbe7afa38b69873822f92a84bcf87b', class: "flex items-center justify-center", onClick: this.handleIconClick }, h("sula-icon", { key: 'd0d7d25d69685a37c46fb4139f5432efa415e7fa', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h("div", { key: '20b99afe2b36b2ee1c5c3eca47cc928238d767ca', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: '70d9144ca98f4bd429ed02a9220130ef3e249c26', id: "textfield-help-text", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.helpText)), this.maxLength && (h("div", { key: '13218dba2cbd936c8b37d0b0bcd6633b07827746', id: "max-length-container", class: { 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error } }, this.textValue ? this.textValue.length : 0, "/", this.maxLength)))))));
129
128
  }
130
- static get style() { return SulaTextfieldStyle0; }
129
+ static get style() { return sulaTextfieldCss; }
131
130
  }, [1, "sula-textfield", {
132
131
  "value": [1025],
133
132
  "type": [1],
@@ -167,5 +166,6 @@ const SulaTextfield = SulaTextfield$1;
167
166
  const defineCustomElement = defineCustomElement$1;
168
167
 
169
168
  export { SulaTextfield, defineCustomElement };
169
+ //# sourceMappingURL=sula-textfield.js.map
170
170
 
171
171
  //# sourceMappingURL=sula-textfield.js.map
@@ -1 +1 @@
1
- {"file":"sula-textfield.js","mappings":";;;AAAA,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,0CAAqB,CAAA;AACvB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAED,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,sCAAe,CAAA;AACjB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB;;ACL/B,MAAM,gBAAgB,GAAG,8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EAEL,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,iBAAiB,CAAC,QAAQ,MACvD,4DAAK,KAAK,EAAC,kCAAkC,EAAC,OAAO,EAAE,IAAI,CAAC,eAAe,IACzE,kEAAW,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,YAAY,IAAI,CAAC,QAAQ,GAAG,oBAAoB,GAAG,mBAAmB,EAAE,GAAI,CAC3H,CACP,CACG,EAEL,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,QAAQ,KAClD,4DAAK,KAAK,EAAC,sDAAsD,IAC9D,IAAI,CAAC,QAAQ,KACZ,4DACE,EAAE,EAAC,qBAAqB,EACxB,KAAK,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,KAAK,EAAE,IAE5I,IAAI,CAAC,QAAQ,CACV,CACP,EACA,IAAI,CAAC,SAAS,KACb,4DACE,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,KAAK,EAAE,IAE5I,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,OAAG,IAAI,CAAC,SAAS,CACxD,CACP,CACG,CACP,CACG,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaTextfield"],"sources":["src/components/sula-textfield/model/sula-textfield.model.ts","src/components/sula-textfield/sula-textfield.scss?tag=sula-textfield&encapsulation=shadow","src/components/sula-textfield/sula-textfield.tsx"],"sourcesContent":["export enum SulaTextfieldType {\n Text = 'text',\n Password = 'password',\n}\n\nexport enum SulaTextfieldStatus {\n Default = 'default',\n Error = 'error',\n}\n",":host {\n display: block;\n}\n\n.button-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n\n.button-error {\n outline: 2px solid var(--color-feedback-error) !important;\n outline-offset: 2px !important;\n}\n\n.from-down {\n animation: from-down 0.2s ease-in-out;\n}\n\n.from-up {\n animation: from-up 0.2s ease-in-out;\n}\n\n@keyframes from-down {\n from {\n transform: translateY(75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n\n@keyframes from-up {\n from {\n transform: translateY(-75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\nimport { SulaTextfieldStatus, SulaTextfieldType } from './model/sula-textfield.model';\n\n@Component({\n tag: 'sula-textfield',\n styleUrl: 'sula-textfield.scss',\n shadow: true,\n})\nexport class SulaTextfield {\n /**\n * Value for the input.\n */\n @Prop({ mutable: true })\n value?: string;\n\n /**\n * The textfield type\n */\n @Prop() type: SulaTextfieldType = SulaTextfieldType.Text;\n\n /**\n * The textfield status\n */\n @Prop({ mutable: true }) status: SulaTextfieldStatus = SulaTextfieldStatus.Default;\n\n /**\n * The textfield label\n */\n @Prop() label: string;\n\n /**\n * The textfield placeholder\n */\n @Prop() placeholder: string;\n\n /**\n * The textfield is disabled\n */\n @Prop({ mutable: true }) disabled: boolean;\n\n /**\n * The help text for textfield\n */\n @Prop() helpText?: string;\n\n /**\n * The textfield max length\n */\n @Prop() maxLength?: number;\n\n /**\n * The textfield icon\n */\n @Prop() icon?: string;\n\n /**\n * Event emitted when input value changes.\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when input is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when input is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n inputIsOpen = false;\n\n @State()\n textValue: string = '';\n\n @State()\n showPassword = false;\n\n @State()\n inputIsFocused = false;\n\n inputContainer: HTMLDivElement;\n inputElement: HTMLInputElement;\n labelElement: HTMLDivElement;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleClick(event: Event) {\n if (!this.node) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside) {\n this.toggleOptions(false);\n this.focusedOut.emit();\n this.inputIsFocused = false;\n }\n }\n\n componentWillLoad() {\n if (this.value && this.value.trim().length > 0) {\n this.textValue = this.value;\n this.inputIsOpen = true;\n }\n }\n\n componentDidLoad() {\n if (this.textValue && this.textValue.trim().length > 0) {\n this.changeElementsStyle();\n }\n }\n\n handleInputClick = () => {\n this.toggleOptions(true);\n };\n\n toggleOptions(inputIsOpen: boolean) {\n if ((this.inputIsOpen && this.textValue && this.textValue.length > 0) || this.disabled) return;\n\n this.inputIsOpen = inputIsOpen;\n this.changeElementsStyle();\n this.inputElement.focus();\n }\n\n changeElementsStyle() {\n this.inputContainer.style.display = this.inputIsOpen ? 'flex' : 'none';\n this.labelElement.style.display = this.inputIsOpen ? 'none' : 'block';\n if (!this.inputIsOpen) {\n this.labelElement.classList.add('from-up');\n }\n }\n\n handleInputChanges = (event: InputEvent) => {\n const newValue = (event.target as HTMLInputElement).value;\n this.textValue = newValue;\n\n this.valueChanged.emit(newValue);\n };\n\n handleFocus = () => {\n if (this.disabled) return;\n this.toggleOptions(true);\n this.inputElement.focus();\n };\n\n handleBlur = () => {\n this.toggleOptions(false);\n\n this.focusedOut.emit();\n this.inputIsFocused = false;\n };\n\n handleInputFocus = () => {\n this.focusedOn.emit();\n this.inputIsFocused = true;\n };\n\n handleIconClick = (event: MouseEvent) => {\n if (this.type === SulaTextfieldType.Password) {\n event.stopPropagation();\n this.handlePasswordIconClicked();\n }\n };\n\n handlePasswordIconClicked() {\n const cursorPosition = this.inputElement.selectionStart;\n const inputValue = this.inputElement.value;\n const inputType = this.showPassword ? SulaTextfieldType.Password : SulaTextfieldType.Text;\n\n this.inputElement.setAttribute('type', inputType);\n this.showPassword = !this.showPassword;\n\n setTimeout(() => {\n this.inputElement.value = inputValue;\n\n this.inputElement.setSelectionRange(cursorPosition, cursorPosition);\n }, 0);\n }\n\n getInputIcon() {\n if (this.type === SulaTextfieldType.Password) {\n return this.showPassword ? 'ph ph-eye' : 'ph ph-eye-slash';\n }\n\n return this.icon;\n }\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div>\n <div\n id=\"button-container\"\n class={{\n 'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,\n 'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,\n 'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,\n 'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,\n 'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,\n 'bg-surface-body border-line-input cursor-pointer': !this.disabled,\n }}\n tabIndex={0}\n onFocus={this.handleFocus}\n onClick={this.handleInputClick}\n >\n {!this.disabled && (\n <div class={{ 'hidden flex-col w-full': true, 'pr-12': !!this.icon }} ref={node => (this.inputContainer = node)}>\n <label class=\"font-bold text-sm text-text-primary from-down\">{this.label}</label>\n <input\n type={this.type}\n ref={node => (this.inputElement = node)}\n placeholder={this.placeholder}\n class=\"outline-none text-base text-text-primary bg-transparent\"\n onInput={this.handleInputChanges}\n onFocus={this.handleInputFocus}\n value={this.value}\n />\n </div>\n )}\n\n <div\n id=\"textfield-label\"\n class={{ 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }}\n ref={node => (this.labelElement = node)}\n >\n {this.label}\n </div>\n\n {(!!this.icon || this.type === SulaTextfieldType.Password) && (\n <div class=\"flex items-center justify-center\" onClick={this.handleIconClick}>\n <sula-icon icon={this.getInputIcon()} customClass={`text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}`} />\n </div>\n )}\n </div>\n\n {(this.helpText || this.maxLength) && !this.disabled && (\n <div class=\"flex justify-between items-center px-16 mt-4 text-sm\">\n {this.helpText && (\n <div\n id=\"textfield-help-text\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.helpText}\n </div>\n )}\n {this.maxLength && (\n <div\n id=\"max-length-container\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.textValue ? this.textValue.length : 0}/{this.maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"sula-textfield.js","mappings":";;;AAAA,IAAY,iBAGX;AAHD,CAAA,UAAY,iBAAiB,EAAA;AAC3B,IAAA,iBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,GAG5B,EAAA,CAAA,CAAA;AAED,IAAY,mBAGX;AAHD,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,mBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,GAG9B,EAAA,CAAA,CAAA;;ACRD,MAAM,gBAAgB,GAAG,40UAA40U;;MCQx1UA,eAAa,iBAAAC,kBAAA,CAAA,MAAA,aAAA,SAAAC,CAAA,CAAA;AAL1B,IAAA,WAAA,GAAA;;;;;;;AAYE;;AAEG;AACK,QAAA,IAAA,CAAA,IAAI,GAAsB,iBAAiB,CAAC,IAAI;AAExD;;AAEG;AACsB,QAAA,IAAA,CAAA,MAAM,GAAwB,mBAAmB,CAAC,OAAO;AAmDlF,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AAG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I,CAAC,QAAQ,CACV,CACP,EACA,IAAI,CAAC,SAAS,KACb,CACE,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,KAAK,EAAE,EAAA,EAE5I,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,OAAG,IAAI,CAAC,SAAS,CACxD,CACP,CACG,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaTextfield","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-textfield/model/sula-textfield.model.ts","src/components/sula-textfield/sula-textfield.scss?tag=sula-textfield&encapsulation=shadow","src/components/sula-textfield/sula-textfield.tsx"],"sourcesContent":["export enum SulaTextfieldType {\n Text = 'text',\n Password = 'password',\n}\n\nexport enum SulaTextfieldStatus {\n Default = 'default',\n Error = 'error',\n}\n",":host {\n display: block;\n}\n\n.button-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n\n.button-error {\n outline: 2px solid var(--color-feedback-error) !important;\n outline-offset: 2px !important;\n}\n\n.from-down {\n animation: from-down 0.2s ease-in-out;\n}\n\n.from-up {\n animation: from-up 0.2s ease-in-out;\n}\n\n@keyframes from-down {\n from {\n transform: translateY(75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n\n@keyframes from-up {\n from {\n transform: translateY(-75%);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, h } from '@stencil/core';\nimport { SulaTextfieldStatus, SulaTextfieldType } from './model/sula-textfield.model';\n\n@Component({\n tag: 'sula-textfield',\n styleUrl: 'sula-textfield.scss',\n shadow: true,\n})\nexport class SulaTextfield {\n /**\n * Value for the input.\n */\n @Prop({ mutable: true })\n value?: string;\n\n /**\n * The textfield type\n */\n @Prop() type: SulaTextfieldType = SulaTextfieldType.Text;\n\n /**\n * The textfield status\n */\n @Prop({ mutable: true }) status: SulaTextfieldStatus = SulaTextfieldStatus.Default;\n\n /**\n * The textfield label\n */\n @Prop() label: string;\n\n /**\n * The textfield placeholder\n */\n @Prop() placeholder: string;\n\n /**\n * The textfield is disabled\n */\n @Prop({ mutable: true }) disabled: boolean;\n\n /**\n * The help text for textfield\n */\n @Prop() helpText?: string;\n\n /**\n * The textfield max length\n */\n @Prop() maxLength?: number;\n\n /**\n * The textfield icon\n */\n @Prop() icon?: string;\n\n /**\n * Event emitted when input value changes.\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n /**\n * Event emitted when input is focused.\n */\n @Event()\n focusedOn: EventEmitter<void>;\n\n /**\n * Event emitted when input is focused out.\n */\n @Event()\n focusedOut: EventEmitter<void>;\n\n @State()\n inputIsOpen = false;\n\n @State()\n textValue: string = '';\n\n @State()\n showPassword = false;\n\n @State()\n inputIsFocused = false;\n\n inputContainer: HTMLDivElement;\n inputElement: HTMLInputElement;\n labelElement: HTMLDivElement;\n\n node?: HTMLElement;\n\n @Listen('click', { target: 'document' })\n handleClick(event: Event) {\n if (!this.node || !this.inputIsFocused) return;\n\n const clickInside = this.node.contains(event.target as Node);\n\n if (!clickInside) {\n this.toggleOptions(false);\n this.focusedOut.emit();\n this.inputIsFocused = false;\n }\n }\n\n componentWillLoad() {\n if (this.value && this.value.trim().length > 0) {\n this.textValue = this.value;\n this.inputIsOpen = true;\n }\n }\n\n componentDidLoad() {\n if (this.textValue && this.textValue.trim().length > 0) {\n this.changeElementsStyle();\n }\n }\n\n handleInputClick = () => {\n this.toggleOptions(true);\n };\n\n toggleOptions(inputIsOpen: boolean) {\n if ((this.inputIsOpen && this.textValue && this.textValue.length > 0) || this.disabled) return;\n\n this.inputIsOpen = inputIsOpen;\n this.changeElementsStyle();\n this.inputElement.focus();\n }\n\n changeElementsStyle() {\n this.inputContainer.style.display = this.inputIsOpen ? 'flex' : 'none';\n this.labelElement.style.display = this.inputIsOpen ? 'none' : 'block';\n if (!this.inputIsOpen) {\n this.labelElement.classList.add('from-up');\n }\n }\n\n handleInputChanges = (event: InputEvent) => {\n const newValue = (event.target as HTMLInputElement).value;\n this.textValue = newValue;\n\n this.valueChanged.emit(newValue);\n };\n\n handleFocus = () => {\n if (this.disabled) return;\n this.toggleOptions(true);\n this.inputElement.focus();\n };\n\n handleBlur = () => {\n this.toggleOptions(false);\n\n this.focusedOut.emit();\n this.inputIsFocused = false;\n };\n\n handleInputFocus = () => {\n this.focusedOn.emit();\n this.inputIsFocused = true;\n };\n\n handleIconClick = (event: MouseEvent) => {\n if (this.type === SulaTextfieldType.Password) {\n event.stopPropagation();\n this.handlePasswordIconClicked();\n }\n };\n\n handlePasswordIconClicked() {\n const cursorPosition = this.inputElement.selectionStart;\n const inputValue = this.inputElement.value;\n const inputType = this.showPassword ? SulaTextfieldType.Password : SulaTextfieldType.Text;\n\n this.inputElement.setAttribute('type', inputType);\n this.showPassword = !this.showPassword;\n\n setTimeout(() => {\n this.inputElement.value = inputValue;\n\n this.inputElement.setSelectionRange(cursorPosition, cursorPosition);\n }, 0);\n }\n\n getInputIcon() {\n if (this.type === SulaTextfieldType.Password) {\n return this.showPassword ? 'ph ph-eye' : 'ph ph-eye-slash';\n }\n\n return this.icon;\n }\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div>\n <div\n id=\"button-container\"\n class={{\n 'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,\n 'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,\n 'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,\n 'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,\n 'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,\n 'bg-surface-body border-line-input cursor-pointer': !this.disabled,\n }}\n tabIndex={0}\n onFocus={this.handleFocus}\n onClick={this.handleInputClick}\n >\n {!this.disabled && (\n <div class={{ 'hidden flex-col w-full': true, 'pr-12': !!this.icon }} ref={node => (this.inputContainer = node)}>\n <label class=\"font-bold text-sm text-text-primary from-down\">{this.label}</label>\n <input\n type={this.type}\n ref={node => (this.inputElement = node)}\n placeholder={this.placeholder}\n class=\"outline-none text-base text-text-primary bg-transparent\"\n onInput={this.handleInputChanges}\n onFocus={this.handleInputFocus}\n value={this.value}\n />\n </div>\n )}\n\n <div\n id=\"textfield-label\"\n class={{ 'text-base flex items-center': true, 'text-text-primary': !this.disabled, 'text-text-disabled': this.disabled }}\n ref={node => (this.labelElement = node)}\n >\n {this.label}\n </div>\n\n {(!!this.icon || this.type === SulaTextfieldType.Password) && (\n <div class=\"flex items-center justify-center\" onClick={this.handleIconClick}>\n <sula-icon icon={this.getInputIcon()} customClass={`text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}`} />\n </div>\n )}\n </div>\n\n {(this.helpText || this.maxLength) && !this.disabled && (\n <div class=\"flex justify-between items-center px-16 mt-4 text-sm\">\n {this.helpText && (\n <div\n id=\"textfield-help-text\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.helpText}\n </div>\n )}\n {this.maxLength && (\n <div\n id=\"max-length-container\"\n class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}\n >\n {this.textValue ? this.textValue.length : 0}/{this.maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface SulaTiles extends Components.SulaTiles, HTMLElement {}
4
+ export const SulaTiles: {
5
+ prototype: SulaTiles;
6
+ new (): SulaTiles;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,180 @@
1
+ import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
2
+ import { d as defineCustomElement$2 } from './p-CEU3PNQs.js';
3
+
4
+ var SulaTilesType;
5
+ (function (SulaTilesType) {
6
+ SulaTilesType["Rounded"] = "rounded";
7
+ SulaTilesType["Square"] = "square";
8
+ })(SulaTilesType || (SulaTilesType = {}));
9
+ var SulaTilesSize;
10
+ (function (SulaTilesSize) {
11
+ SulaTilesSize["Default"] = "default";
12
+ SulaTilesSize["Large"] = "large";
13
+ })(SulaTilesSize || (SulaTilesSize = {}));
14
+
15
+ const sulaTilesCss = "*,:after,:before{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-ring-color:rgba(59,130,246,.5);--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{display:block}:root{--color-green-50:#f1f9f4;--color-green-100:#e6f4ed;--color-green-200:#cae7d8;--color-green-300:#a0d4b8;--color-green-400:#68bb8e;--color-green-500:#04843f;--color-green-600:#037236;--color-green-700:#03632f;--color-green-800:#035428;--color-green-900:#024521;--color-green-950:#02361a;--color-red-50:#fef6f6;--color-red-100:#fde8e8;--color-red-200:#fad1d1;--color-red-300:#f7abab;--color-red-400:#f17474;--color-red-500:#c80505;--color-red-600:#b30404;--color-red-700:#9f0404;--color-red-800:#860303;--color-red-900:#6d0303;--color-red-950:#500202;--color-yellow-50:#fdf4e7;--color-yellow-100:#fcedd9;--color-yellow-200:#fae0bd;--color-yellow-300:#f6c788;--color-yellow-400:#f3b159;--color-yellow-500:#ef9928;--color-yellow-600:#e49226;--color-yellow-700:#d17e10;--color-yellow-800:#b46d0e;--color-yellow-900:#93590b;--color-yellow-950:#683f08;--color-orange-50:#fef4f1;--color-orange-100:#fde8e2;--color-orange-200:#fbd2c6;--color-orange-300:#f8b4a0;--color-orange-400:#f58e70;--color-orange-500:#f05223;--color-orange-600:#ea4210;--color-orange-700:#d23b0e;--color-orange-800:#b5330c;--color-orange-900:#942a0a;--color-orange-950:#691e07;--color-blue-50:#ecf0f9;--color-blue-100:#dde3f4;--color-blue-200:#b2c2e5;--color-blue-300:#7994d2;--color-blue-400:#4066bf;--color-blue-500:#001e64;--color-blue-600:#001c5c;--color-blue-700:#00174c;--color-blue-800:#00123d;--color-blue-900:#000f33;--color-blue-950:#000d2b;--color-ambar-50:#fff6eb;--color-ambar-100:#ffefdc;--color-ambar-200:#fedfb9;--color-ambar-300:#fdca8b;--color-ambar-400:#fdb359;--color-ambar-500:#fc9c26;--color-ambar-600:#ec8403;--color-ambar-700:#d87803;--color-ambar-800:#ba6803;--color-ambar-900:#975402;--color-ambar-950:#6a3b01;--color-gray-50:#fff;--color-gray-100:#f4f4f4;--color-gray-200:#e6e6e6;--color-gray-300:#c3c3c3;--color-gray-400:#b9b9b9;--color-gray-500:#949494;--color-gray-600:#737373;--color-gray-700:#5c5c5c;--color-gray-800:#323232;--color-gray-900:#292929;--color-gray-950:#141414;--color-white-opacity-50:#ffffff0d;--color-white-opacity-100:#ffffff1a;--color-white-opacity-200:#ffffff26;--color-white-opacity-300:#ffffff45;--color-white-opacity-400:#ffffff5c;--color-white-opacity-500:#ffffff80;--color-white-opacity-600:#ffffff8c;--color-white-opacity-700:#ffffffa3;--color-white-opacity-800:#ffffffba;--color-white-opacity-900:#fffc;--color-white-opacity-950:#ffffffe8;--color-ciano-50:#f1f6fe;--color-ciano-100:#dfeafc;--color-ciano-200:#c3d9f9;--color-ciano-300:#90b9f4;--color-ciano-400:#5d98ee;--color-ciano-500:#1769e0;--color-ciano-600:#155fcb;--color-ciano-700:#1355b4;--color-ciano-800:#104899;--color-ciano-900:#0d3b7d;--color-ciano-950:#0a2e61;--color-extra-color-blue-light:#e7f0f4;--color-extra-color-blue-dark:#162931;--color-black-opacity-50:#14141405;--color-black-opacity-100:#1414141a;--color-black-opacity-200:#14141426;--color-black-opacity-300:#14141445;--color-black-opacity-400:#1414145c;--color-black-opacity-500:#14141480;--color-black-opacity-600:#1414148c;--color-black-opacity-700:#141414a3;--color-black-opacity-800:#141414ba;--color-black-opacity-900:#141414cc;--color-black-opacity-950:#141414e8;--color-feedback-success:#04843f;--color-feedback-error:#c80505;--color-feedback-informational:#1355b4;--color-feedback-alert:#ef9928;--color-brand-primary:#f05223;--color-brand-secondary:#001c5c;--color-brand-tertiary-1:#1769e0;--color-brand-tertiary-2:#fc9c26;--color-surface-body:#fff;--color-surface-on-body:#f4f4f4;--color-surface-on-body-blue:#e7f0f4;--color-surface-on-body-brand:#fff6eb;--color-surface-on-body-feedback-success:#e6f4ed;--color-surface-on-body-feedback-error:#fde8e8;--color-surface-on-body-feedback-alert:#fdf4e7;--color-surface-on-body-feedback-info:#dfeafc;--color-text-brand:#f05223;--color-text-primary:#323232;--color-text-secondary:#5c5c5c;--color-text-disabled:#949494;--color-text-link:#1355b4;--color-states-empty-bg-hover:#1414141a;--color-states-empty-bg-pressed:#14141426;--color-states-bg-disabled:#14141405;--color-states-bg-focus:#1355b4;--color-states-primary-hover:#ea4210;--color-states-primary-pressed:#d23b0e;--color-states-danger-hover:#b30404;--color-states-danger-pressed:#9f0404;--color-states-negative-hover:#e6e6e6;--color-states-negative-pressed:#c3c3c3;--color-icon-primary:#5c5c5c;--color-icon-secondary:#fff;--color-icon-tertiary:#b30404;--color-icon-disabled:#b9b9b9;--color-neutral-neutral-1:#fff;--color-neutral-neutral-2:#f4f4f4;--color-neutral-neutral-3:#b9b9b9;--color-neutral-neutral-4:#949494;--color-neutral-neutral-5:#737373;--color-neutral-neutral-6:#5c5c5c;--color-neutral-neutral-7:#323232;--color-neutral-neutral-8:#292929;--color-negative-negative-1:#fff;--color-negative-negative-2:#323232;--color-opacity-body:#fffc;--color-opacity-on-body:#14141405;--color-opacity-overlay:#1414148c;--color-opacity-on-overlay:#ffffff1a;--color-line-input:#949494;--color-line-general-strong:#c3c3c3;--color-line-general:#e6e6e6}.static{position:static}.ml-12{margin-left:.75rem}.mt-36{margin-top:2.25rem}.mt-8{margin-top:.5rem}.flex{display:flex}.h-120{height:7.5rem}.h-80{height:5rem}.w-120{width:7.5rem}.w-80{width:5rem}.w-\\[167px\\]{width:167px}.max-w-full{max-width:100%}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.25rem*var(--tw-space-y-reverse));margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)))}.overflow-hidden,.truncate{overflow:hidden}.truncate{text-overflow:ellipsis;white-space:nowrap}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:1.25rem}.bg-states-bg-disabled{background-color:var(--color-states-bg-disabled)}.bg-surface-on-body{background-color:var(--color-surface-on-body)}.p-20{padding:1.25rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.leading-4{line-height:1rem}.text-icon-disabled{color:var(--color-icon-disabled)}.text-icon-primary{color:var(--color-icon-primary)}.text-text-primary{color:var(--color-text-primary)}.text-text-secondary{color:var(--color-text-secondary)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-2{outline-width:2px}.outline-offset-2{outline-offset:2px}.outline-feedback-informational{outline-color:var(--color-feedback-informational)}.container{width:100%}@media (min-width:360px){.container{max-width:360px}}@media (min-width:744px){.container{max-width:744px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1366px){.container{max-width:1366px}}@media (min-width:1680px){.container{max-width:1680px}}.hover\\:bg-states-empty-bg-hover:hover{background-color:var(--color-states-empty-bg-hover)}.active\\:bg-states-empty-bg-pressed:active{background-color:var(--color-states-empty-bg-pressed)}";
16
+
17
+ const SulaTiles$1 = /*@__PURE__*/ proxyCustomElement(class SulaTiles extends H {
18
+ constructor() {
19
+ super();
20
+ this.__registerHost();
21
+ this.__attachShadow();
22
+ this.tileClicked = createEvent(this, "tileClicked");
23
+ /**
24
+ * Tiles type
25
+ */
26
+ this.type = SulaTilesType.Rounded;
27
+ /**
28
+ * Tiles size
29
+ */
30
+ this.size = SulaTilesSize.Default;
31
+ /**
32
+ * Use ellipsis on tiles text
33
+ */
34
+ this.ellipsis = false;
35
+ /**
36
+ * Tiles icon
37
+ */
38
+ this.icon = '';
39
+ /**
40
+ * Tiles text
41
+ */
42
+ this.text = '';
43
+ /**
44
+ * Tiles subtext
45
+ */
46
+ this.subText = '';
47
+ /**
48
+ * Tiles is disabled
49
+ */
50
+ this.disabled = false;
51
+ this.TILE_SIZES = {
52
+ [SulaTilesSize.Default]: 'w-80 h-80',
53
+ [SulaTilesSize.Large]: 'w-120 h-120',
54
+ };
55
+ this.BASE_CLASSES = {
56
+ container: 'flex w-[167px]',
57
+ roundedContainer: 'flex-col justify-center items-center',
58
+ squareContainer: 'rounded-md p-20',
59
+ interactiveBackground: 'bg-surface-on-body hover:bg-states-empty-bg-hover active:bg-states-empty-bg-pressed outline-2 outline-offset-2 outline-feedback-informational cursor-pointer',
60
+ disabledBackground: 'bg-states-bg-disabled',
61
+ iconContainer: 'flex justify-center items-center leading-4',
62
+ roundedIcon: 'rounded-full',
63
+ textContainer: 'flex',
64
+ ellipsisText: 'truncate overflow-hidden whitespace-nowrap',
65
+ };
66
+ this.handleClick = () => {
67
+ if (this.disabled)
68
+ return;
69
+ this.tileClicked.emit();
70
+ };
71
+ }
72
+ get isRounded() {
73
+ return this.type === SulaTilesType.Rounded;
74
+ }
75
+ get isSquare() {
76
+ return this.type === SulaTilesType.Square;
77
+ }
78
+ get hasSubText() {
79
+ return !!this.subText;
80
+ }
81
+ get isInteractive() {
82
+ return !this.disabled;
83
+ }
84
+ getRoundedTileSize() {
85
+ return this.TILE_SIZES[this.size] || this.TILE_SIZES[SulaTilesSize.Default];
86
+ }
87
+ getContainerClasses() {
88
+ return {
89
+ [this.BASE_CLASSES.container]: true,
90
+ [this.BASE_CLASSES.roundedContainer]: this.isRounded,
91
+ [this.BASE_CLASSES.squareContainer]: this.isSquare,
92
+ [this.BASE_CLASSES.interactiveBackground]: this.isSquare && this.isInteractive,
93
+ [this.BASE_CLASSES.disabledBackground]: this.disabled && this.isSquare,
94
+ 'items-center': this.isSquare && !this.hasSubText,
95
+ 'flex-col items-start justify-end': this.isSquare && this.hasSubText,
96
+ };
97
+ }
98
+ getIconContainerClasses() {
99
+ return {
100
+ [this.BASE_CLASSES.iconContainer]: true,
101
+ [this.BASE_CLASSES.roundedIcon]: this.isRounded,
102
+ [this.BASE_CLASSES.interactiveBackground]: this.isRounded && this.isInteractive,
103
+ [this.BASE_CLASSES.disabledBackground]: this.isRounded && this.disabled,
104
+ [this.getRoundedTileSize()]: this.isRounded,
105
+ };
106
+ }
107
+ getTextContainerClasses() {
108
+ return {
109
+ [this.BASE_CLASSES.textContainer]: true,
110
+ 'mt-8': this.isRounded,
111
+ 'ml-12': this.isSquare && !this.hasSubText,
112
+ 'flex-col mt-36 space-y-4': this.isSquare && this.hasSubText,
113
+ 'max-w-full': this.ellipsis,
114
+ };
115
+ }
116
+ getTextClasses(isPrimary = true) {
117
+ return {
118
+ 'text-base leading-4': true,
119
+ 'font-bold': isPrimary,
120
+ 'text-text-primary': isPrimary && this.isInteractive,
121
+ 'text-text-secondary': !isPrimary && this.isInteractive,
122
+ 'text-icon-disabled': this.disabled,
123
+ [this.BASE_CLASSES.ellipsisText]: this.ellipsis,
124
+ 'whitespace-normal': !this.ellipsis,
125
+ };
126
+ }
127
+ getIconClasses() {
128
+ const baseClass = 'text-3xl';
129
+ const colorClass = this.disabled ? 'text-icon-disabled' : 'text-icon-primary';
130
+ return `${baseClass} ${colorClass}`;
131
+ }
132
+ getTabIndex(condition) {
133
+ return condition && this.isInteractive ? 0 : null;
134
+ }
135
+ renderIcon() {
136
+ return (h("div", { class: this.getIconContainerClasses(), tabIndex: this.getTabIndex(this.isRounded) }, h("sula-icon", { icon: this.icon, customClass: this.getIconClasses() })));
137
+ }
138
+ renderText() {
139
+ return (h("div", { class: this.getTextContainerClasses() }, h("span", { class: this.getTextClasses(true), title: this.ellipsis ? this.text : undefined }, this.text), this.hasSubText && (h("span", { class: this.getTextClasses(false), title: this.ellipsis ? this.subText : undefined }, this.subText))));
140
+ }
141
+ render() {
142
+ return (h(Host, { key: '571dd0142465ec3483c7a460feedf63542836cfa' }, h("div", { key: '7bb61260329cbded9fb9a25201c74de94a060268', class: this.getContainerClasses(), tabIndex: this.getTabIndex(this.isSquare), onClick: this.handleClick }, this.renderIcon(), this.renderText())));
143
+ }
144
+ static get style() { return sulaTilesCss; }
145
+ }, [1, "sula-tiles", {
146
+ "type": [1],
147
+ "size": [1],
148
+ "ellipsis": [4],
149
+ "icon": [1],
150
+ "text": [1],
151
+ "subText": [1, "sub-text"],
152
+ "disabled": [4]
153
+ }]);
154
+ function defineCustomElement$1() {
155
+ if (typeof customElements === "undefined") {
156
+ return;
157
+ }
158
+ const components = ["sula-tiles", "sula-icon"];
159
+ components.forEach(tagName => { switch (tagName) {
160
+ case "sula-tiles":
161
+ if (!customElements.get(tagName)) {
162
+ customElements.define(tagName, SulaTiles$1);
163
+ }
164
+ break;
165
+ case "sula-icon":
166
+ if (!customElements.get(tagName)) {
167
+ defineCustomElement$2();
168
+ }
169
+ break;
170
+ } });
171
+ }
172
+ defineCustomElement$1();
173
+
174
+ const SulaTiles = SulaTiles$1;
175
+ const defineCustomElement = defineCustomElement$1;
176
+
177
+ export { SulaTiles, defineCustomElement };
178
+ //# sourceMappingURL=sula-tiles.js.map
179
+
180
+ //# sourceMappingURL=sula-tiles.js.map