@lukso/web-components 1.88.1 → 1.90.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 (84) hide show
  1. package/dist/components/index.cjs +9 -4
  2. package/dist/components/index.d.ts +1 -0
  3. package/dist/components/index.d.ts.map +1 -1
  4. package/dist/components/index.js +5 -4
  5. package/dist/components/lukso-button/index.cjs +1 -1
  6. package/dist/components/lukso-button/index.js +1 -1
  7. package/dist/components/lukso-card/index.cjs +3 -3
  8. package/dist/components/lukso-card/index.js +3 -3
  9. package/dist/components/lukso-checkbox/index.cjs +1 -1
  10. package/dist/components/lukso-checkbox/index.js +1 -1
  11. package/dist/components/lukso-color-picker/index.cjs +347 -0
  12. package/dist/components/lukso-color-picker/index.d.ts +40 -0
  13. package/dist/components/lukso-color-picker/index.d.ts.map +1 -0
  14. package/dist/components/lukso-color-picker/index.js +345 -0
  15. package/dist/components/lukso-color-picker/lukso-color-picker.stories.d.ts +19 -0
  16. package/dist/components/lukso-color-picker/lukso-color-picker.stories.d.ts.map +1 -0
  17. package/dist/components/lukso-dropdown/index.cjs +4 -4
  18. package/dist/components/lukso-dropdown/index.js +4 -4
  19. package/dist/components/lukso-dropdown-option/index.cjs +1 -1
  20. package/dist/components/lukso-dropdown-option/index.js +1 -1
  21. package/dist/components/lukso-footer/index.cjs +1 -1
  22. package/dist/components/lukso-footer/index.js +1 -1
  23. package/dist/components/lukso-icon/index.cjs +2 -2
  24. package/dist/components/lukso-icon/index.js +2 -2
  25. package/dist/components/lukso-image/index.cjs +2 -2
  26. package/dist/components/lukso-image/index.js +2 -2
  27. package/dist/components/lukso-input/index.cjs +14 -7
  28. package/dist/components/lukso-input/index.d.ts +2 -1
  29. package/dist/components/lukso-input/index.d.ts.map +1 -1
  30. package/dist/components/lukso-input/index.js +14 -7
  31. package/dist/components/lukso-input/lukso-input.stories.d.ts.map +1 -1
  32. package/dist/components/lukso-modal/index.cjs +1 -1
  33. package/dist/components/lukso-modal/index.js +1 -1
  34. package/dist/components/lukso-navbar/index.cjs +3 -3
  35. package/dist/components/lukso-navbar/index.js +3 -3
  36. package/dist/components/lukso-pagination/index.cjs +2 -2
  37. package/dist/components/lukso-pagination/index.js +2 -2
  38. package/dist/components/lukso-profile/index.cjs +2 -2
  39. package/dist/components/lukso-profile/index.js +2 -2
  40. package/dist/components/lukso-progress/index.cjs +2 -2
  41. package/dist/components/lukso-progress/index.js +2 -2
  42. package/dist/components/lukso-sanitize/index.cjs +1 -1
  43. package/dist/components/lukso-sanitize/index.js +1 -1
  44. package/dist/components/lukso-search/index.cjs +5 -4
  45. package/dist/components/lukso-search/index.d.ts.map +1 -1
  46. package/dist/components/lukso-search/index.js +5 -4
  47. package/dist/components/lukso-select/index.cjs +4 -4
  48. package/dist/components/lukso-select/index.js +4 -4
  49. package/dist/components/lukso-share/index.cjs +1 -1
  50. package/dist/components/lukso-share/index.js +1 -1
  51. package/dist/components/lukso-switch/index.cjs +2 -2
  52. package/dist/components/lukso-switch/index.js +2 -2
  53. package/dist/components/lukso-tag/index.cjs +2 -2
  54. package/dist/components/lukso-tag/index.js +2 -2
  55. package/dist/components/lukso-terms/index.cjs +2 -2
  56. package/dist/components/lukso-terms/index.js +2 -2
  57. package/dist/components/lukso-test/index.cjs +1 -1
  58. package/dist/components/lukso-test/index.js +1 -1
  59. package/dist/components/lukso-textarea/index.cjs +14 -7
  60. package/dist/components/lukso-textarea/index.d.ts +2 -1
  61. package/dist/components/lukso-textarea/index.d.ts.map +1 -1
  62. package/dist/components/lukso-textarea/index.js +14 -7
  63. package/dist/components/lukso-textarea/lukso-textarea.stories.d.ts.map +1 -1
  64. package/dist/components/lukso-tooltip/index.cjs +2 -2
  65. package/dist/components/lukso-tooltip/index.js +2 -2
  66. package/dist/components/lukso-username/index.cjs +2 -2
  67. package/dist/components/lukso-username/index.js +2 -2
  68. package/dist/components/lukso-wizard/index.cjs +1 -1
  69. package/dist/components/lukso-wizard/index.js +1 -1
  70. package/dist/{index-0f429f67.js → index-0b520c6a.js} +1 -1
  71. package/dist/index-31c27410.cjs +46 -0
  72. package/dist/{index-8186b19a.cjs → index-3429e18a.cjs} +1 -1
  73. package/dist/{index-752774b2.cjs → index-bca7ccb0.cjs} +1 -1
  74. package/dist/{index-62e802f0.js → index-c6f49fea.js} +1 -1
  75. package/dist/index-e73db22f.js +39 -0
  76. package/dist/index.cjs +9 -4
  77. package/dist/index.js +5 -4
  78. package/dist/shared/tailwind-element/index.cjs +1 -1
  79. package/dist/shared/tailwind-element/index.js +1 -1
  80. package/dist/{style-map-272091aa.cjs → style-map-77b74f74.cjs} +1 -1
  81. package/dist/{style-map-f7093d93.js → style-map-d5d85b80.js} +1 -1
  82. package/package.json +6 -1
  83. package/dist/index-14baf4da.js +0 -39
  84. package/dist/index-8322d22b.cjs +0 -46
@@ -0,0 +1,345 @@
1
+ import { T as TailwindStyledElement, x, A } from '../../index-e73db22f.js';
2
+ import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
+ import { t } from '../../state-b9ca4e74.js';
4
+ import { c as ce } from '../../index-ca8e900d.js';
5
+ import { o } from '../../style-map-d5d85b80.js';
6
+ import '../../tailwind-config.js';
7
+ import { c as cn } from '../../cn-b54dcc61.js';
8
+ import '../lukso-icon/index.js';
9
+ import '../../bundle-mjs-fbc6e2a8.js';
10
+ import '../../directive-2bb7789e.js';
11
+
12
+ const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
13
+
14
+ var __defProp = Object.defineProperty;
15
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
16
+ var __decorateClass = (decorators, target, key, kind) => {
17
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
18
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
19
+ if (decorator = decorators[i])
20
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
21
+ if (kind && result)
22
+ __defProp(target, key, result);
23
+ return result;
24
+ };
25
+ let LuksoColorPicker = class extends TailwindStyledElement(style) {
26
+ constructor() {
27
+ super(...arguments);
28
+ this.value = "";
29
+ this.name = "";
30
+ this.placeholder = "#000000";
31
+ this.label = "";
32
+ this.id = "";
33
+ this.description = "";
34
+ this.error = "";
35
+ this.customClass = "";
36
+ this.isFullWidth = false;
37
+ this.isReadonly = false;
38
+ this.isDisabled = false;
39
+ this.autofocus = false;
40
+ this.keepFocusOnEscape = false;
41
+ this.size = "medium";
42
+ this.hasFocus = false;
43
+ this.hasHighlight = false;
44
+ this.styles = ce({
45
+ slots: {
46
+ wrapper: "group grid border overflow-hidden",
47
+ input: `bg-neutral-100 border-solid placeholder:text-neutral-70 w-full
48
+ outline-none transition transition-all duration-150 appearance-none`,
49
+ color: "border-r border-solid",
50
+ colorInput: "h-[inherit] w-[inherit] opacity-0"
51
+ },
52
+ variants: {
53
+ hasError: {
54
+ true: {
55
+ wrapper: "border-red-85 hover:border-red-65",
56
+ color: "border-red-85 group-hover:border-red-65"
57
+ },
58
+ false: {
59
+ wrapper: "border-neutral-90",
60
+ color: "border-neutral-90"
61
+ }
62
+ },
63
+ hasHighlight: {
64
+ true: {
65
+ wrapper: "border-neutral-35",
66
+ color: "border-neutral-35"
67
+ }
68
+ },
69
+ isReadonly: {
70
+ true: { input: "cursor-not-allowed", colorInput: "cursor-not-allowed" }
71
+ },
72
+ isDisabled: {
73
+ true: {
74
+ input: "text-neutral-60 cursor-not-allowed",
75
+ color: "opacity-50",
76
+ colorInput: "cursor-not-allowed"
77
+ },
78
+ false: {
79
+ wrapper: "hover:border-neutral-35",
80
+ input: "text-neutral-20",
81
+ color: "group-hover:border-neutral-35"
82
+ }
83
+ },
84
+ isFullWidth: {
85
+ true: { wrapper: "w-full" },
86
+ false: { wrapper: "w-[350px]" }
87
+ },
88
+ size: {
89
+ small: {
90
+ wrapper: "grid-cols-[28px,auto] rounded-8",
91
+ input: "h-[28px] px-2 py-1 paragraph-inter-12-regular rounded-r-8",
92
+ color: "h-[28px] w-[28px]"
93
+ },
94
+ medium: {
95
+ wrapper: "grid-cols-[48px,auto] rounded-12",
96
+ input: "h-[48px] px-4 py-3 paragraph-inter-14-regular rounded-r-12",
97
+ color: "h-[48px] w-[48px]"
98
+ }
99
+ }
100
+ },
101
+ compoundVariants: [
102
+ {
103
+ isFullWidth: false,
104
+ class: { wrapper: "w-[300px]" }
105
+ },
106
+ {
107
+ isFullWidth: false,
108
+ size: "small",
109
+ class: { wrapper: "w-[190px]" }
110
+ },
111
+ {
112
+ isFullWidth: false,
113
+ size: "small",
114
+ class: { wrapper: "w-[210px]" }
115
+ },
116
+ {
117
+ hasHighlight: true,
118
+ hasError: true,
119
+ class: {
120
+ wrapper: "border-red-65 hover:border-red-65",
121
+ color: "border-red-65 group-hover:border-red-65"
122
+ }
123
+ },
124
+ {
125
+ isReadonly: false,
126
+ isDisabled: false,
127
+ class: {
128
+ colorInput: "cursor-pointer"
129
+ }
130
+ }
131
+ ]
132
+ });
133
+ }
134
+ inputTemplate(styles) {
135
+ return x`
136
+ <input
137
+ .value=${this.value}
138
+ name=${this.name ? this.name : A}
139
+ type="text"
140
+ placeholder=${this.placeholder ? this.placeholder : A}
141
+ ?autofocus=${this.autofocus}
142
+ autocomplete="off"
143
+ id=${this.id ? this.id : A}
144
+ data-testid=${this.name ? `input-${this.name}` : "input"}
145
+ ?readonly=${this.isReadonly ? true : void 0}
146
+ ?disabled=${this.isDisabled ? true : void 0}
147
+ class=${cn(styles, this.customClass)}
148
+ @focus=${this.handleFocus}
149
+ @input=${this.handleInput}
150
+ @change=${this.handleChange}
151
+ @blur=${this.handleBlur}
152
+ @keyup=${this.handleKeyUp}
153
+ @keydown=${this.handleKeyDown}
154
+ />
155
+ `;
156
+ }
157
+ colorPickerTemplate(styles, colorInputStyles) {
158
+ return x`<div
159
+ class=${styles}
160
+ style=${o({
161
+ backgroundColor: `${this.value}`
162
+ })}
163
+ >
164
+ <input
165
+ .value=${this.value}
166
+ type="color"
167
+ ?disabled=${this.isDisabled || this.isReadonly ? true : void 0}
168
+ class=${colorInputStyles}
169
+ @input=${this.handleInput}
170
+ />
171
+ </div>`;
172
+ }
173
+ labelTemplate() {
174
+ return x`
175
+ <label
176
+ for=${this.name}
177
+ class="heading-inter-14-bold text-neutral-20 pb-2 block"
178
+ >${this.label}</label
179
+ >
180
+ `;
181
+ }
182
+ descriptionTemplate() {
183
+ return x`
184
+ <div class="paragraph-inter-12-regular text-neutral-20 pb-2">
185
+ ${this.description ?? A}
186
+ </div>
187
+ `;
188
+ }
189
+ errorTemplate() {
190
+ return x`<div class="paragraph-inter-12-regular text-red-65 pt-2">
191
+ ${this.error}
192
+ </div>`;
193
+ }
194
+ handleFocus() {
195
+ if (!this.isReadonly && !this.isDisabled) {
196
+ this.hasFocus = true;
197
+ this.hasHighlight = true;
198
+ }
199
+ }
200
+ async handleBlur(event) {
201
+ this.hasFocus = false;
202
+ this.hasHighlight = false;
203
+ await this.updateComplete;
204
+ const target = event.target;
205
+ const blurEvent = new CustomEvent("on-blur", {
206
+ detail: {
207
+ value: target?.value,
208
+ event
209
+ },
210
+ bubbles: false,
211
+ composed: true
212
+ });
213
+ this.dispatchEvent(blurEvent);
214
+ }
215
+ async handleChange(event) {
216
+ await this.updateComplete;
217
+ const target = event.target;
218
+ const changeEvent = new CustomEvent("on-change", {
219
+ detail: {
220
+ value: target?.value,
221
+ event
222
+ },
223
+ bubbles: false,
224
+ composed: true
225
+ });
226
+ this.dispatchEvent(changeEvent);
227
+ }
228
+ async handleInput(event) {
229
+ await this.updateComplete;
230
+ const target = event.target;
231
+ this.value = target?.value;
232
+ const changeEvent = new CustomEvent("on-input", {
233
+ detail: {
234
+ value: target?.value,
235
+ event
236
+ },
237
+ bubbles: false,
238
+ composed: true
239
+ });
240
+ this.dispatchEvent(changeEvent);
241
+ }
242
+ async handleKeyUp(event) {
243
+ await this.updateComplete;
244
+ const target = event.target;
245
+ const keyEvent = new CustomEvent("on-key-up", {
246
+ detail: {
247
+ value: target?.value,
248
+ event
249
+ },
250
+ bubbles: true,
251
+ composed: true
252
+ });
253
+ this.dispatchEvent(keyEvent);
254
+ if (event.key === "Escape" && !this.keepFocusOnEscape) {
255
+ this.blur();
256
+ }
257
+ }
258
+ async handleKeyDown(event) {
259
+ await this.updateComplete;
260
+ const target = event.target;
261
+ const keyEvent = new CustomEvent("on-key-down", {
262
+ detail: {
263
+ value: target.value,
264
+ event
265
+ },
266
+ bubbles: true,
267
+ composed: true
268
+ });
269
+ this.dispatchEvent(keyEvent);
270
+ }
271
+ render() {
272
+ const { wrapper, input, color, colorInput } = this.styles({
273
+ hasError: this.error !== "",
274
+ hasHighlight: this.hasHighlight,
275
+ isReadonly: this.isReadonly,
276
+ isDisabled: this.isDisabled,
277
+ isFullWidth: this.isFullWidth,
278
+ size: this.size
279
+ });
280
+ return x`
281
+ <div class="w-[inherit]">
282
+ ${this.label ? this.labelTemplate() : A}
283
+ ${this.description ? this.descriptionTemplate() : A}
284
+ <div class=${wrapper()}>
285
+ ${this.colorPickerTemplate(color(), colorInput())}
286
+ <div class="relative w-full">${this.inputTemplate(input())}</div>
287
+ </div>
288
+ ${this.error ? this.errorTemplate() : A}
289
+ </div>
290
+ `;
291
+ }
292
+ };
293
+ __decorateClass([
294
+ n({ type: String })
295
+ ], LuksoColorPicker.prototype, "value", 2);
296
+ __decorateClass([
297
+ n({ type: String })
298
+ ], LuksoColorPicker.prototype, "name", 2);
299
+ __decorateClass([
300
+ n({ type: String })
301
+ ], LuksoColorPicker.prototype, "placeholder", 2);
302
+ __decorateClass([
303
+ n({ type: String })
304
+ ], LuksoColorPicker.prototype, "label", 2);
305
+ __decorateClass([
306
+ n({ type: String })
307
+ ], LuksoColorPicker.prototype, "id", 2);
308
+ __decorateClass([
309
+ n({ type: String })
310
+ ], LuksoColorPicker.prototype, "description", 2);
311
+ __decorateClass([
312
+ n({ type: String })
313
+ ], LuksoColorPicker.prototype, "error", 2);
314
+ __decorateClass([
315
+ n({ type: String, attribute: "custom-class" })
316
+ ], LuksoColorPicker.prototype, "customClass", 2);
317
+ __decorateClass([
318
+ n({ type: Boolean, attribute: "is-full-width" })
319
+ ], LuksoColorPicker.prototype, "isFullWidth", 2);
320
+ __decorateClass([
321
+ n({ type: Boolean, attribute: "is-readonly" })
322
+ ], LuksoColorPicker.prototype, "isReadonly", 2);
323
+ __decorateClass([
324
+ n({ type: Boolean, attribute: "is-disabled" })
325
+ ], LuksoColorPicker.prototype, "isDisabled", 2);
326
+ __decorateClass([
327
+ n({ type: Boolean })
328
+ ], LuksoColorPicker.prototype, "autofocus", 2);
329
+ __decorateClass([
330
+ n({ type: Boolean, attribute: "keep-focus-on-escape" })
331
+ ], LuksoColorPicker.prototype, "keepFocusOnEscape", 2);
332
+ __decorateClass([
333
+ n({ type: String })
334
+ ], LuksoColorPicker.prototype, "size", 2);
335
+ __decorateClass([
336
+ t()
337
+ ], LuksoColorPicker.prototype, "hasFocus", 2);
338
+ __decorateClass([
339
+ t()
340
+ ], LuksoColorPicker.prototype, "hasHighlight", 2);
341
+ LuksoColorPicker = __decorateClass([
342
+ e("lukso-color-picker")
343
+ ], LuksoColorPicker);
344
+
345
+ export { LuksoColorPicker };
@@ -0,0 +1,19 @@
1
+ import type { Meta } from '@storybook/web-components';
2
+ /** Documentation and examples of `lukso-color-picker` component. */
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ /** Example of default input with `value`. */
6
+ export declare const DefaultInput: any;
7
+ /** Example of input with `placeholder` text. */
8
+ export declare const PlaceholderText: any;
9
+ /** Example of input with `label`. */
10
+ export declare const Label: any;
11
+ /** Example of input with `label` and `description`. */
12
+ export declare const LabelAndDescription: any;
13
+ /** Example of input with `error`. */
14
+ export declare const ErrorInput: any;
15
+ /** If you need input to take full width of the parent element add `is-full-width` property. */
16
+ export declare const FullWidth: any;
17
+ /** Example of `small` size input. */
18
+ export declare const Small: any;
19
+ //# sourceMappingURL=lukso-color-picker.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lukso-color-picker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-color-picker/lukso-color-picker.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAEhB,sEAAsE;AACtE,QAAA,MAAM,IAAI,EAAE,IA2LX,CAAA;AAED,eAAe,IAAI,CAAA;AA6CnB,8CAA8C;AAC9C,eAAO,MAAM,YAAY,KAAoB,CAAA;AAE7C,gDAAgD;AAChD,eAAO,MAAM,eAAe,KAAoB,CAAA;AAMhD,qCAAqC;AACrC,eAAO,MAAM,KAAK,KAAoB,CAAA;AAKtC,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,KAAoB,CAAA;AAMpD,qCAAqC;AACrC,eAAO,MAAM,UAAU,KAAoB,CAAA;AAO3C,+FAA+F;AAC/F,eAAO,MAAM,SAAS,KAAoB,CAAA;AAK1C,qCAAqC;AACrC,eAAO,MAAM,KAAK,KAAoB,CAAA"}
@@ -2,19 +2,19 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- require('../../index-8322d22b.cjs');
5
+ require('../../index-31c27410.cjs');
6
6
  require('../../query-assigned-elements-d5e45650.cjs');
7
7
  require('../../state-d9fb972b.cjs');
8
8
  require('../../index-1d3f4a5a.cjs');
9
9
  require('../lukso-icon/index.cjs');
10
10
  require('../lukso-profile/index.cjs');
11
11
  require('../lukso-username/index.cjs');
12
- const components_luksoDropdown_index = require('../../index-8186b19a.cjs');
12
+ const components_luksoDropdown_index = require('../../index-3429e18a.cjs');
13
13
  require('../../bundle-mjs-d58a83c6.cjs');
14
- require('../../style-map-272091aa.cjs');
14
+ require('../../style-map-77b74f74.cjs');
15
15
  require('../../directive-8278ab14.cjs');
16
16
  require('../lukso-image/index.cjs');
17
- require('../../index-752774b2.cjs');
17
+ require('../../index-bca7ccb0.cjs');
18
18
  require('../../tailwind-config.cjs');
19
19
  require('../../cn-5ceac001.cjs');
20
20
 
@@ -1,15 +1,15 @@
1
- import '../../index-14baf4da.js';
1
+ import '../../index-e73db22f.js';
2
2
  import '../../query-assigned-elements-1c8c9e90.js';
3
3
  import '../../state-b9ca4e74.js';
4
4
  import '../../index-ca8e900d.js';
5
5
  import '../lukso-icon/index.js';
6
6
  import '../lukso-profile/index.js';
7
7
  import '../lukso-username/index.js';
8
- export { L as LuksoDropdown } from '../../index-62e802f0.js';
8
+ export { L as LuksoDropdown } from '../../index-c6f49fea.js';
9
9
  import '../../bundle-mjs-fbc6e2a8.js';
10
- import '../../style-map-f7093d93.js';
10
+ import '../../style-map-d5d85b80.js';
11
11
  import '../../directive-2bb7789e.js';
12
12
  import '../lukso-image/index.js';
13
- import '../../index-0f429f67.js';
13
+ import '../../index-0b520c6a.js';
14
14
  import '../../tailwind-config.js';
15
15
  import '../../cn-b54dcc61.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-8322d22b.cjs');
5
+ const shared_tailwindElement_index = require('../../index-31c27410.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
7
  const index = require('../../index-1d3f4a5a.cjs');
8
8
  require('../../bundle-mjs-d58a83c6.cjs');
@@ -1,4 +1,4 @@
1
- import { T as TailwindStyledElement, x } from '../../index-14baf4da.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-e73db22f.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
3
  import { c as ce } from '../../index-ca8e900d.js';
4
4
  import '../../bundle-mjs-fbc6e2a8.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-8322d22b.cjs');
5
+ const shared_tailwindElement_index = require('../../index-31c27410.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
7
 
8
8
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- import { a as TailwindElement, x } from '../../index-14baf4da.js';
1
+ import { a as TailwindElement, x } from '../../index-e73db22f.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
3
 
4
4
  var __defProp = Object.defineProperty;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-8322d22b.cjs');
5
+ const shared_tailwindElement_index = require('../../index-31c27410.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
- const styleMap = require('../../style-map-272091aa.cjs');
7
+ const styleMap = require('../../style-map-77b74f74.cjs');
8
8
  require('../../directive-8278ab14.cjs');
9
9
 
10
10
  const style = ":host {\n display: inline-flex\n}";
@@ -1,6 +1,6 @@
1
- import { x, T as TailwindStyledElement } from '../../index-14baf4da.js';
1
+ import { x, T as TailwindStyledElement } from '../../index-e73db22f.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
- import { o } from '../../style-map-f7093d93.js';
3
+ import { o } from '../../style-map-d5d85b80.js';
4
4
  import '../../directive-2bb7789e.js';
5
5
 
6
6
  const style = ":host {\n display: inline-flex\n}";
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-8322d22b.cjs');
5
+ const shared_tailwindElement_index = require('../../index-31c27410.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
7
  const state = require('../../state-d9fb972b.cjs');
8
- const styleMap = require('../../style-map-272091aa.cjs');
8
+ const styleMap = require('../../style-map-77b74f74.cjs');
9
9
  const index = require('../../index-1d3f4a5a.cjs');
10
10
  require('../../directive-8278ab14.cjs');
11
11
  require('../../bundle-mjs-d58a83c6.cjs');
@@ -1,7 +1,7 @@
1
- import { a as TailwindElement, x } from '../../index-14baf4da.js';
1
+ import { a as TailwindElement, x } from '../../index-e73db22f.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
3
  import { t } from '../../state-b9ca4e74.js';
4
- import { o } from '../../style-map-f7093d93.js';
4
+ import { o } from '../../style-map-d5d85b80.js';
5
5
  import { c as ce } from '../../index-ca8e900d.js';
6
6
  import '../../directive-2bb7789e.js';
7
7
  import '../../bundle-mjs-fbc6e2a8.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-8322d22b.cjs');
5
+ const shared_tailwindElement_index = require('../../index-31c27410.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
7
  const state = require('../../state-d9fb972b.cjs');
8
8
  const index = require('../../index-1d3f4a5a.cjs');
@@ -10,7 +10,7 @@ require('../../tailwind-config.cjs');
10
10
  const cn = require('../../cn-5ceac001.cjs');
11
11
  require('../lukso-icon/index.cjs');
12
12
  require('../../bundle-mjs-d58a83c6.cjs');
13
- require('../../style-map-272091aa.cjs');
13
+ require('../../style-map-77b74f74.cjs');
14
14
  require('../../directive-8278ab14.cjs');
15
15
 
16
16
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
@@ -52,7 +52,8 @@ exports.LuksoInput = class LuksoInput extends shared_tailwindElement_index.Tailw
52
52
  this.size = "medium";
53
53
  this.rightIcon = "";
54
54
  this.isRightIconClickable = false;
55
- this.hasHocus = false;
55
+ this.keepFocusOnEscape = false;
56
+ this.hasFocus = false;
56
57
  this.hasHighlight = false;
57
58
  this.inputStyles = index.ce({
58
59
  slots: {
@@ -233,12 +234,12 @@ exports.LuksoInput = class LuksoInput extends shared_tailwindElement_index.Tailw
233
234
  }
234
235
  handleFocus() {
235
236
  if (!this.isReadonly && !this.isDisabled) {
236
- this.hasHocus = true;
237
+ this.hasFocus = true;
237
238
  this.hasHighlight = true;
238
239
  }
239
240
  }
240
241
  async handleBlur(event) {
241
- this.hasHocus = false;
242
+ this.hasFocus = false;
242
243
  this.hasHighlight = false;
243
244
  await this.updateComplete;
244
245
  const target = event.target;
@@ -291,6 +292,9 @@ exports.LuksoInput = class LuksoInput extends shared_tailwindElement_index.Tailw
291
292
  composed: true
292
293
  });
293
294
  this.dispatchEvent(keyEvent);
295
+ if (event.key === "Escape" && !this.keepFocusOnEscape) {
296
+ this.blur();
297
+ }
294
298
  }
295
299
  async handleKeyDown(event) {
296
300
  await this.updateComplete;
@@ -324,7 +328,7 @@ exports.LuksoInput = class LuksoInput extends shared_tailwindElement_index.Tailw
324
328
  }
325
329
  }
326
330
  handleMouseOut() {
327
- if (!this.hasHocus) {
331
+ if (!this.hasFocus) {
328
332
  this.hasHighlight = false;
329
333
  }
330
334
  }
@@ -462,9 +466,12 @@ __decorateClass([
462
466
  __decorateClass([
463
467
  queryAssignedElements.n({ type: Boolean, attribute: "is-right-icon-clickable" })
464
468
  ], exports.LuksoInput.prototype, "isRightIconClickable", 2);
469
+ __decorateClass([
470
+ queryAssignedElements.n({ type: Boolean, attribute: "keep-focus-on-escape" })
471
+ ], exports.LuksoInput.prototype, "keepFocusOnEscape", 2);
465
472
  __decorateClass([
466
473
  state.t()
467
- ], exports.LuksoInput.prototype, "hasHocus", 2);
474
+ ], exports.LuksoInput.prototype, "hasFocus", 2);
468
475
  __decorateClass([
469
476
  state.t()
470
477
  ], exports.LuksoInput.prototype, "hasHighlight", 2);
@@ -24,7 +24,8 @@ export declare class LuksoInput extends LuksoInput_base {
24
24
  size: InputSize;
25
25
  rightIcon: string;
26
26
  isRightIconClickable: boolean;
27
- private hasHocus;
27
+ keepFocusOnEscape: boolean;
28
+ private hasFocus;
28
29
  private hasHighlight;
29
30
  private inputStyles;
30
31
  inputTemplate(styles: string): import("lit-html").TemplateResult<1>;
@@ -1 +1 @@
1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,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,eAAe;YAaT,gBAAgB;IAc9B,OAAO,CAAC,oBAAoB;IAY5B,MAAM;CA6BP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAA;KAC1B;CACF"}
@@ -1,4 +1,4 @@
1
- import { T as TailwindStyledElement, x, A } from '../../index-14baf4da.js';
1
+ import { T as TailwindStyledElement, x, A } from '../../index-e73db22f.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
3
  import { t } from '../../state-b9ca4e74.js';
4
4
  import { c as ce } from '../../index-ca8e900d.js';
@@ -6,7 +6,7 @@ import '../../tailwind-config.js';
6
6
  import { c as cn } from '../../cn-b54dcc61.js';
7
7
  import '../lukso-icon/index.js';
8
8
  import '../../bundle-mjs-fbc6e2a8.js';
9
- import '../../style-map-f7093d93.js';
9
+ import '../../style-map-d5d85b80.js';
10
10
  import '../../directive-2bb7789e.js';
11
11
 
12
12
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
@@ -48,7 +48,8 @@ let LuksoInput = class extends TailwindStyledElement(style) {
48
48
  this.size = "medium";
49
49
  this.rightIcon = "";
50
50
  this.isRightIconClickable = false;
51
- this.hasHocus = false;
51
+ this.keepFocusOnEscape = false;
52
+ this.hasFocus = false;
52
53
  this.hasHighlight = false;
53
54
  this.inputStyles = ce({
54
55
  slots: {
@@ -229,12 +230,12 @@ let LuksoInput = class extends TailwindStyledElement(style) {
229
230
  }
230
231
  handleFocus() {
231
232
  if (!this.isReadonly && !this.isDisabled) {
232
- this.hasHocus = true;
233
+ this.hasFocus = true;
233
234
  this.hasHighlight = true;
234
235
  }
235
236
  }
236
237
  async handleBlur(event) {
237
- this.hasHocus = false;
238
+ this.hasFocus = false;
238
239
  this.hasHighlight = false;
239
240
  await this.updateComplete;
240
241
  const target = event.target;
@@ -287,6 +288,9 @@ let LuksoInput = class extends TailwindStyledElement(style) {
287
288
  composed: true
288
289
  });
289
290
  this.dispatchEvent(keyEvent);
291
+ if (event.key === "Escape" && !this.keepFocusOnEscape) {
292
+ this.blur();
293
+ }
290
294
  }
291
295
  async handleKeyDown(event) {
292
296
  await this.updateComplete;
@@ -320,7 +324,7 @@ let LuksoInput = class extends TailwindStyledElement(style) {
320
324
  }
321
325
  }
322
326
  handleMouseOut() {
323
- if (!this.hasHocus) {
327
+ if (!this.hasFocus) {
324
328
  this.hasHighlight = false;
325
329
  }
326
330
  }
@@ -458,9 +462,12 @@ __decorateClass([
458
462
  __decorateClass([
459
463
  n({ type: Boolean, attribute: "is-right-icon-clickable" })
460
464
  ], LuksoInput.prototype, "isRightIconClickable", 2);
465
+ __decorateClass([
466
+ n({ type: Boolean, attribute: "keep-focus-on-escape" })
467
+ ], LuksoInput.prototype, "keepFocusOnEscape", 2);
461
468
  __decorateClass([
462
469
  t()
463
- ], LuksoInput.prototype, "hasHocus", 2);
470
+ ], LuksoInput.prototype, "hasFocus", 2);
464
471
  __decorateClass([
465
472
  t()
466
473
  ], LuksoInput.prototype, "hasHighlight", 2);
@@ -1 +1 @@
1
- {"version":3,"file":"lukso-input.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-input/lukso-input.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAEhB,+DAA+D;AAC/D,QAAA,MAAM,IAAI,EAAE,IAiRX,CAAA;AAED,eAAe,IAAI,CAAA;AA+DnB,8CAA8C;AAC9C,eAAO,MAAM,YAAY,KAAoB,CAAA;AAK7C,gDAAgD;AAChD,eAAO,MAAM,eAAe,KAAoB,CAAA;AAKhD,qCAAqC;AACrC,eAAO,MAAM,KAAK,KAAoB,CAAA;AAKtC,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,KAAoB,CAAA;AAMpD,qCAAqC;AACrC,eAAO,MAAM,UAAU,KAAoB,CAAA;AAO3C,oCAAoC;AACpC,eAAO,MAAM,IAAI,KAAoB,CAAA;AAKrC,+FAA+F;AAC/F,eAAO,MAAM,SAAS,KAAoB,CAAA;AAK1C,gEAAgE;AAChE,eAAO,MAAM,SAAS,KAAoB,CAAA;AAK1C,oMAAoM;AACpM,eAAO,MAAM,WAAW,KAAoB,CAAA;AAO5C,sEAAsE;AACtE,eAAO,MAAM,UAAU,KAAoB,CAAA;AAM3C,qCAAqC;AACrC,eAAO,MAAM,KAAK,KAAoB,CAAA;AAKtC,gDAAgD;AAChD,eAAO,MAAM,SAAS,KAAoB,CAAA"}
1
+ {"version":3,"file":"lukso-input.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-input/lukso-input.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAEhB,+DAA+D;AAC/D,QAAA,MAAM,IAAI,EAAE,IA8RX,CAAA;AAED,eAAe,IAAI,CAAA;AAiEnB,8CAA8C;AAC9C,eAAO,MAAM,YAAY,KAAoB,CAAA;AAK7C,gDAAgD;AAChD,eAAO,MAAM,eAAe,KAAoB,CAAA;AAKhD,qCAAqC;AACrC,eAAO,MAAM,KAAK,KAAoB,CAAA;AAKtC,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,KAAoB,CAAA;AAMpD,qCAAqC;AACrC,eAAO,MAAM,UAAU,KAAoB,CAAA;AAO3C,oCAAoC;AACpC,eAAO,MAAM,IAAI,KAAoB,CAAA;AAKrC,+FAA+F;AAC/F,eAAO,MAAM,SAAS,KAAoB,CAAA;AAK1C,gEAAgE;AAChE,eAAO,MAAM,SAAS,KAAoB,CAAA;AAK1C,oMAAoM;AACpM,eAAO,MAAM,WAAW,KAAoB,CAAA;AAO5C,sEAAsE;AACtE,eAAO,MAAM,UAAU,KAAoB,CAAA;AAM3C,qCAAqC;AACrC,eAAO,MAAM,KAAK,KAAoB,CAAA;AAKtC,gDAAgD;AAChD,eAAO,MAAM,SAAS,KAAoB,CAAA"}