@sula-tech/webcomponents 0.2.0 → 0.2.2

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 (113) hide show
  1. package/dist/cjs/{index-3eac14f6.js → index-87eec792.js} +26 -3
  2. package/dist/cjs/index-87eec792.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/{sula-avatar_4.cjs.entry.js → sula-avatar_9.cjs.entry.js} +526 -9
  5. package/dist/cjs/sula-avatar_9.cjs.entry.js.map +1 -0
  6. package/dist/cjs/webcomponents.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +5 -0
  8. package/dist/collection/components/sula-badge/model/sula-badge.model.js +23 -0
  9. package/dist/collection/components/sula-badge/model/sula-badge.model.js.map +1 -0
  10. package/dist/collection/components/sula-badge/sula-badge.css +1 -0
  11. package/dist/collection/components/sula-badge/sula-badge.js +230 -0
  12. package/dist/collection/components/sula-badge/sula-badge.js.map +1 -0
  13. package/dist/collection/components/sula-badge/sula-badge.stories.js +148 -0
  14. package/dist/collection/components/sula-badge/sula-badge.stories.js.map +1 -0
  15. package/dist/collection/components/sula-button/sula-button.css +1 -1
  16. package/dist/collection/components/sula-button/sula-button.js +1 -1
  17. package/dist/collection/components/sula-checkbox/model/sula-checkbox.model.js +6 -0
  18. package/dist/collection/components/sula-checkbox/model/sula-checkbox.model.js.map +1 -0
  19. package/dist/collection/components/sula-checkbox/sula-checkbox.css +1 -0
  20. package/dist/collection/components/sula-checkbox/sula-checkbox.js +233 -0
  21. package/dist/collection/components/sula-checkbox/sula-checkbox.js.map +1 -0
  22. package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js +113 -0
  23. package/dist/collection/components/sula-checkbox/sula-checkbox.stories.js.map +1 -0
  24. package/dist/collection/components/sula-icon/sula-icon.css +1 -1
  25. package/dist/collection/components/sula-icon/sula-icon.js +1 -1
  26. package/dist/collection/components/sula-icon/sula-icon.stories.js +1 -1
  27. package/dist/collection/components/sula-icon/sula-icon.stories.js.map +1 -1
  28. package/dist/collection/components/sula-switch/model/sula-switch.model.js +6 -0
  29. package/dist/collection/components/sula-switch/model/sula-switch.model.js.map +1 -0
  30. package/dist/collection/components/sula-switch/sula-switch.css +1 -0
  31. package/dist/collection/components/sula-switch/sula-switch.js +235 -0
  32. package/dist/collection/components/sula-switch/sula-switch.js.map +1 -0
  33. package/dist/collection/components/sula-switch/sula-switch.stories.js +111 -0
  34. package/dist/collection/components/sula-switch/sula-switch.stories.js.map +1 -0
  35. package/dist/collection/components/sula-tag/model/sula-tag.model.js +28 -0
  36. package/dist/collection/components/sula-tag/model/sula-tag.model.js.map +1 -0
  37. package/dist/collection/components/sula-tag/sula-tag.css +1 -0
  38. package/dist/collection/components/sula-tag/sula-tag.js +249 -0
  39. package/dist/collection/components/sula-tag/sula-tag.js.map +1 -0
  40. package/dist/collection/components/sula-tag/sula-tag.stories.js +201 -0
  41. package/dist/collection/components/sula-tag/sula-tag.stories.js.map +1 -0
  42. package/dist/collection/components/sula-textarea/model/sula-textarea.model.js +6 -0
  43. package/dist/collection/components/sula-textarea/model/sula-textarea.model.js.map +1 -0
  44. package/dist/collection/components/sula-textarea/sula-textarea.css +1 -0
  45. package/dist/collection/components/sula-textarea/sula-textarea.js +358 -0
  46. package/dist/collection/components/sula-textarea/sula-textarea.js.map +1 -0
  47. package/dist/collection/components/sula-textarea/sula-textarea.stories.js +138 -0
  48. package/dist/collection/components/sula-textarea/sula-textarea.stories.js.map +1 -0
  49. package/dist/collection/components/sula-textfield/sula-textfield.css +1 -1
  50. package/dist/collection/components/sula-textfield/sula-textfield.js +2 -2
  51. package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -1
  52. package/dist/components/index.js +1 -1
  53. package/dist/components/{p-a07ff261.js → p-5066cf94.js} +4 -4
  54. package/dist/components/{p-a07ff261.js.map → p-5066cf94.js.map} +1 -1
  55. package/dist/components/{p-ca146b16.js → p-881c6b35.js} +25 -3
  56. package/dist/components/p-881c6b35.js.map +1 -0
  57. package/dist/components/sula-avatar.js +2 -2
  58. package/dist/components/sula-badge.d.ts +11 -0
  59. package/dist/components/sula-badge.js +154 -0
  60. package/dist/components/sula-badge.js.map +1 -0
  61. package/dist/components/sula-button.js +4 -4
  62. package/dist/components/sula-button.js.map +1 -1
  63. package/dist/components/sula-checkbox.d.ts +11 -0
  64. package/dist/components/sula-checkbox.js +109 -0
  65. package/dist/components/sula-checkbox.js.map +1 -0
  66. package/dist/components/sula-icon.js +1 -1
  67. package/dist/components/sula-switch.d.ts +11 -0
  68. package/dist/components/sula-switch.js +105 -0
  69. package/dist/components/sula-switch.js.map +1 -0
  70. package/dist/components/sula-tag.d.ts +11 -0
  71. package/dist/components/sula-tag.js +157 -0
  72. package/dist/components/sula-tag.js.map +1 -0
  73. package/dist/components/sula-textarea.d.ts +11 -0
  74. package/dist/components/sula-textarea.js +166 -0
  75. package/dist/components/sula-textarea.js.map +1 -0
  76. package/dist/components/sula-textfield.js +5 -5
  77. package/dist/components/sula-textfield.js.map +1 -1
  78. package/dist/esm/{index-1dc4ae53.js → index-aa1c5f36.js} +26 -4
  79. package/dist/esm/index-aa1c5f36.js.map +1 -0
  80. package/dist/esm/loader.js +3 -3
  81. package/dist/esm/{sula-avatar_4.entry.js → sula-avatar_9.entry.js} +522 -10
  82. package/dist/esm/sula-avatar_9.entry.js.map +1 -0
  83. package/dist/esm/webcomponents.js +3 -3
  84. package/dist/types/components/sula-badge/model/sula-badge.model.d.ts +19 -0
  85. package/dist/types/components/sula-badge/sula-badge.d.ts +33 -0
  86. package/dist/types/components/sula-badge/sula-badge.stories.d.ts +65 -0
  87. package/dist/types/components/sula-checkbox/model/sula-checkbox.model.d.ts +4 -0
  88. package/dist/types/components/sula-checkbox/sula-checkbox.d.ts +42 -0
  89. package/dist/types/components/sula-checkbox/sula-checkbox.stories.d.ts +73 -0
  90. package/dist/types/components/sula-switch/model/sula-switch.model.d.ts +4 -0
  91. package/dist/types/components/sula-switch/sula-switch.d.ts +41 -0
  92. package/dist/types/components/sula-switch/sula-switch.stories.d.ts +72 -0
  93. package/dist/types/components/sula-tag/model/sula-tag.model.d.ts +23 -0
  94. package/dist/types/components/sula-tag/sula-tag.d.ts +33 -0
  95. package/dist/types/components/sula-tag/sula-tag.stories.d.ts +82 -0
  96. package/dist/types/components/sula-textarea/model/sula-textarea.model.d.ts +4 -0
  97. package/dist/types/components/sula-textarea/sula-textarea.d.ts +65 -0
  98. package/dist/types/components/sula-textarea/sula-textarea.stories.d.ts +98 -0
  99. package/dist/types/components.d.ts +394 -0
  100. package/dist/webcomponents/{p-fbee9d79.js → p-5a36af0f.js} +272 -250
  101. package/dist/{esm/index-1dc4ae53.js.map → webcomponents/p-5a36af0f.js.map} +1 -1
  102. package/dist/webcomponents/{p-77709b3c.entry.js → p-d60ee44a.entry.js} +761 -100
  103. package/dist/webcomponents/p-d60ee44a.entry.js.map +1 -0
  104. package/dist/webcomponents/webcomponents.esm.js +44 -3
  105. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  106. package/package.json +2 -2
  107. package/readme.md +36 -18
  108. package/dist/cjs/index-3eac14f6.js.map +0 -1
  109. package/dist/cjs/sula-avatar_4.cjs.entry.js.map +0 -1
  110. package/dist/components/p-ca146b16.js.map +0 -1
  111. package/dist/esm/sula-avatar_4.entry.js.map +0 -1
  112. package/dist/webcomponents/p-77709b3c.entry.js.map +0 -1
  113. package/dist/webcomponents/p-fbee9d79.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { p as proxyCustomElement, H, d as createEvent, h, c as Host } from './p-ca146b16.js';
2
- import { d as defineCustomElement$2 } from './p-a07ff261.js';
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-5066cf94.js';
3
3
 
4
4
  var SulaTextfieldType;
5
5
  (function (SulaTextfieldType) {
@@ -12,7 +12,7 @@ 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{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--color-feedback-informational)!important;outline:none!important}.button-error{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--color-feedback-error)!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)}.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}";
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
16
  const SulaTextfieldStyle0 = sulaTextfieldCss;
17
17
 
18
18
  const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield extends H {
@@ -118,14 +118,14 @@ const SulaTextfield$1 = /*@__PURE__*/ proxyCustomElement(class SulaTextfield ext
118
118
  return this.icon;
119
119
  }
120
120
  render() {
121
- return (h(Host, { key: 'a8bac04c291ef9f7f894b8ee191fb47f223023ce', ref: node => (this.node = node) }, h("div", { key: '5ec9505052d5fee9d54459dea2c1281842bbf61a' }, h("div", { key: '3d8e4377e67e755815446f58bad127fcad4575d4', id: "button-container", class: {
121
+ return (h(Host, { key: '7861723c4c9a71e02a642cc856978432f1ed408e', ref: node => (this.node = node) }, h("div", { key: 'bc52f29a24273991355aa8b168f4e0740391e582' }, h("div", { key: '69fe9a5ffad527e0667fd47c8afa53b8dfd1f999', id: "button-container", class: {
122
122
  'flex items-center border rounded-sm px-16 outline-none h-[72px] caret-brand-primary': true,
123
123
  'flex-row justify-between': !!this.icon || this.type === SulaTextfieldType.Password,
124
124
  'button-focus': this.inputIsFocused && !this.disabled && this.status === SulaTextfieldStatus.Default,
125
125
  'button-error': this.status === SulaTextfieldStatus.Error && !this.disabled,
126
126
  'bg-states-bg-disabled border-line-general cursor-not-allowed': this.disabled,
127
127
  'bg-surface-body border-line-input cursor-pointer': !this.disabled,
128
- }, tabIndex: 0, onFocus: this.handleFocus, onClick: this.handleInputClick }, !this.disabled && (h("div", { key: '67286a579ce0cece357d02673c4ac695c56fe23d', class: { 'hidden flex-col w-full': true, 'pr-12': !!this.icon }, ref: node => (this.inputContainer = node) }, h("label", { key: 'f2915de1058c93d3937726dcef145cb9e217aed2', class: "font-bold text-sm text-text-primary from-down" }, this.label), h("input", { key: '09f663b3cc2c3dbd58cda35cb949fcd708c87111', type: this.type, ref: node => (this.inputElement = node), placeholder: this.placeholder, class: "outline-none text-base text-text-primary", onInput: this.handleInputChanges, onFocus: this.handleInputFocus, value: this.value }))), h("div", { key: '68615e768117e4f3d0eb09d9a8f56878e61377e0', 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: 'cfe8edb41b2163e391ec9c6615c77afc69fc35a4', class: "flex items-center justify-center", onClick: this.handleIconClick }, h("sula-icon", { key: '2676c22599c2df06eb8cc4bb1fa425e702166e11', icon: this.getInputIcon(), customClass: `text-2xl ${this.disabled ? 'text-icon-disabled' : 'text-icon-primary'}` })))), (this.helpText || this.maxLength) && !this.disabled && (h("div", { key: '77956a01dd5670649edbb65ada3e08831b6347dc', class: "flex justify-between items-center px-16 mt-4 text-sm" }, this.helpText && (h("div", { key: '7e2ac49e3a1e8cf596313d34f084ac2b2b209797', 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: '322b4c132531b57c7e503464d4bb6115311201b2', 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)))))));
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)))))));
129
129
  }
130
130
  static get style() { return SulaTextfieldStyle0; }
131
131
  }, [1, "sula-textfield", {
@@ -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,kwUAAkwU,CAAC;AAC5xU,4BAAe,gBAAgB;;MCOlBA,eAAa;IAL1B;;;;;;;;;;QAeU,SAAI,GAAsB,iBAAiB,CAAC,IAAI,CAAC;;;;QAKhC,WAAM,GAAwB,mBAAmB,CAAC,OAAO,CAAC;QAmDnF,gBAAW,GAAG,KAAK,CAAC;QAGpB,cAAS,GAAW,EAAE,CAAC;QAGvB,iBAAY,GAAG,KAAK,CAAC;QAGrB,mBAAc,GAAG,KAAK,CAAC;QAkCvB,qBAAgB,GAAG;YACjB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;SAC1B,CAAC;QAkBF,uBAAkB,GAAG,CAAC,KAAiB;YACrC,MAAM,QAAQ,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAC;YAC1D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAE1B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAClC,CAA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IAAI,CAAC,MAAM,KAAK,mBAAmB,CAAC,KAAK,EAAE,IACxK,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: none !important;\n box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-feedback-informational) !important;\n}\n\n.button-error {\n box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-feedback-error) !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\"\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 id=\"textfield-help-text\" class={{ 'text-text-primary': this.status === SulaTextfieldStatus.Default, 'text-feedback-error': this.status === SulaTextfieldStatus.Error }}>\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,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,0CAAqB,CAAA;AACvB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG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;","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,5 +1,5 @@
1
1
  const NAMESPACE = 'webcomponents';
2
- const BUILD = /* webcomponents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: true, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: true, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };
2
+ const BUILD = /* webcomponents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: true, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: true, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: false };
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
@@ -420,6 +420,27 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
420
420
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
421
421
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
422
422
  }
423
+ } else if (memberName === "style") {
424
+ {
425
+ for (const prop in oldValue) {
426
+ if (!newValue || newValue[prop] == null) {
427
+ if (prop.includes("-")) {
428
+ elm.style.removeProperty(prop);
429
+ } else {
430
+ elm.style[prop] = "";
431
+ }
432
+ }
433
+ }
434
+ }
435
+ for (const prop in newValue) {
436
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
437
+ if (prop.includes("-")) {
438
+ elm.style.setProperty(prop, newValue[prop]);
439
+ } else {
440
+ elm.style[prop] = newValue[prop];
441
+ }
442
+ }
443
+ }
423
444
  } else if (memberName === "key") ; else if (memberName === "ref") {
424
445
  if (newValue) {
425
446
  newValue(elm);
@@ -685,10 +706,11 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
685
706
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
686
707
  const oldChildren = oldVNode.$children$;
687
708
  const newChildren = newVNode2.$children$;
709
+ const tag = newVNode2.$tag$;
688
710
  const text = newVNode2.$text$;
689
711
  if (text === null) {
690
712
  {
691
- {
713
+ if (tag === "slot" && !useNativeShadowDom) ; else {
692
714
  updateElement(oldVNode, newVNode2, isSvgMode);
693
715
  }
694
716
  }
@@ -1353,6 +1375,6 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
1353
1375
  // src/runtime/nonce.ts
1354
1376
  var setNonce = (nonce) => plt.$nonce$ = nonce;
1355
1377
 
1356
- export { Host as H, bootstrapLazy as b, createEvent as c, h, promiseResolve as p, registerInstance as r, setNonce as s };
1378
+ export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1357
1379
 
1358
- //# sourceMappingURL=index-1dc4ae53.js.map
1380
+ //# sourceMappingURL=index-aa1c5f36.js.map