@lukso/web-components 1.85.0 → 1.86.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 (99) hide show
  1. package/dist/components/index.cjs +13 -3
  2. package/dist/components/index.d.ts +2 -0
  3. package/dist/components/index.d.ts.map +1 -1
  4. package/dist/components/index.js +5 -3
  5. package/dist/components/lukso-button/index.cjs +8 -5
  6. package/dist/components/lukso-button/index.d.ts +1 -1
  7. package/dist/components/lukso-button/index.d.ts.map +1 -1
  8. package/dist/components/lukso-button/index.js +8 -5
  9. package/dist/components/lukso-button/lukso-button.stories.d.ts +2 -0
  10. package/dist/components/lukso-button/lukso-button.stories.d.ts.map +1 -1
  11. package/dist/components/lukso-card/index.cjs +3 -3
  12. package/dist/components/lukso-card/index.js +3 -3
  13. package/dist/components/lukso-checkbox/index.cjs +1 -1
  14. package/dist/components/lukso-checkbox/index.js +1 -1
  15. package/dist/components/lukso-dropdown/index.cjs +26 -0
  16. package/dist/components/lukso-dropdown/index.d.ts +28 -0
  17. package/dist/components/lukso-dropdown/index.d.ts.map +1 -0
  18. package/dist/components/lukso-dropdown/index.js +15 -0
  19. package/dist/components/lukso-dropdown/lukso-dropdown.stories.d.ts +9 -0
  20. package/dist/components/lukso-dropdown/lukso-dropdown.stories.d.ts.map +1 -0
  21. package/dist/components/lukso-dropdown-option/index.cjs +110 -0
  22. package/dist/components/lukso-dropdown-option/index.d.ts +19 -0
  23. package/dist/components/lukso-dropdown-option/index.d.ts.map +1 -0
  24. package/dist/components/lukso-dropdown-option/index.js +108 -0
  25. package/dist/components/lukso-dropdown-option/lukso-dropdown-option.stories.d.ts +7 -0
  26. package/dist/components/lukso-dropdown-option/lukso-dropdown-option.stories.d.ts.map +1 -0
  27. package/dist/components/lukso-footer/index.cjs +1 -1
  28. package/dist/components/lukso-footer/index.js +1 -1
  29. package/dist/components/lukso-icon/index.cjs +2 -2
  30. package/dist/components/lukso-icon/index.js +2 -2
  31. package/dist/components/lukso-image/index.cjs +2 -2
  32. package/dist/components/lukso-image/index.js +2 -2
  33. package/dist/components/lukso-input/index.cjs +2 -2
  34. package/dist/components/lukso-input/index.js +2 -2
  35. package/dist/components/lukso-modal/index.cjs +1 -1
  36. package/dist/components/lukso-modal/index.js +1 -1
  37. package/dist/components/lukso-navbar/index.cjs +3 -3
  38. package/dist/components/lukso-navbar/index.js +3 -3
  39. package/dist/components/lukso-pagination/index.cjs +2 -2
  40. package/dist/components/lukso-pagination/index.js +2 -2
  41. package/dist/components/lukso-profile/index.cjs +2 -2
  42. package/dist/components/lukso-profile/index.js +2 -2
  43. package/dist/components/lukso-progress/index.cjs +2 -2
  44. package/dist/components/lukso-progress/index.js +2 -2
  45. package/dist/components/lukso-sanitize/index.cjs +1 -1
  46. package/dist/components/lukso-sanitize/index.js +1 -1
  47. package/dist/components/lukso-search/index.cjs +62 -71
  48. package/dist/components/lukso-search/index.d.ts +1 -3
  49. package/dist/components/lukso-search/index.d.ts.map +1 -1
  50. package/dist/components/lukso-search/index.js +62 -71
  51. package/dist/components/lukso-select/index.cjs +29 -98
  52. package/dist/components/lukso-select/index.d.ts +0 -3
  53. package/dist/components/lukso-select/index.d.ts.map +1 -1
  54. package/dist/components/lukso-select/index.js +28 -97
  55. package/dist/components/lukso-share/index.cjs +1 -1
  56. package/dist/components/lukso-share/index.js +1 -1
  57. package/dist/components/lukso-switch/index.cjs +2 -2
  58. package/dist/components/lukso-switch/index.js +2 -2
  59. package/dist/components/lukso-tag/index.cjs +2 -2
  60. package/dist/components/lukso-tag/index.js +2 -2
  61. package/dist/components/lukso-terms/index.cjs +2 -2
  62. package/dist/components/lukso-terms/index.js +2 -2
  63. package/dist/components/lukso-test/index.cjs +1 -1
  64. package/dist/components/lukso-test/index.js +1 -1
  65. package/dist/components/lukso-tooltip/index.cjs +2 -2
  66. package/dist/components/lukso-tooltip/index.js +2 -2
  67. package/dist/components/lukso-username/index.cjs +2 -2
  68. package/dist/components/lukso-username/index.js +2 -2
  69. package/dist/components/lukso-wizard/index.cjs +1 -1
  70. package/dist/components/lukso-wizard/index.js +1 -1
  71. package/dist/index-30881141.js +141 -0
  72. package/dist/index-abf15ef1.cjs +143 -0
  73. package/dist/index-b2b49383.js +39 -0
  74. package/dist/{index-3b498928.cjs → index-bf97dd78.cjs} +1 -1
  75. package/dist/index-df36fb06.cjs +46 -0
  76. package/dist/{index-8043be8a.js → index-f1acf332.js} +1 -1
  77. package/dist/index.cjs +13 -3
  78. package/dist/index.js +5 -3
  79. package/dist/shared/tailwind-element/index.cjs +1 -1
  80. package/dist/shared/tailwind-element/index.js +1 -1
  81. package/dist/{style-map-ad97bcc3.js → style-map-6e8b083a.js} +1 -1
  82. package/dist/{style-map-a6d61d04.cjs → style-map-7ce21e2c.cjs} +1 -1
  83. package/dist/styles/main.css +1 -0
  84. package/dist/styles/main.css.map +1 -1
  85. package/dist/tailwind-config.cjs +1 -1
  86. package/dist/tailwind-config.js +1 -1
  87. package/package.json +11 -1
  88. package/tools/cn.cjs +1 -1
  89. package/tools/cn.js +1 -1
  90. package/tools/index.cjs +1 -1
  91. package/tools/index.js +1 -1
  92. package/tools/sass/colors.scss +1 -0
  93. package/tools/styles/main.css +1 -0
  94. package/tools/{tailwind-config-cece8e4d.cjs → tailwind-config-783c9054.cjs} +1 -1
  95. package/tools/{tailwind-config-effbdecc.js → tailwind-config-e386df1d.js} +1 -1
  96. package/tools/tailwind-config.cjs +1 -1
  97. package/tools/tailwind-config.js +1 -1
  98. package/dist/index-e653a9ff.cjs +0 -46
  99. package/dist/index-f72579d6.js +0 -39
@@ -1,4 +1,4 @@
1
- import { T as TailwindStyledElement, x, A } from '../../index-f72579d6.js';
1
+ import { T as TailwindStyledElement, x, A } from '../../index-b2b49383.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,11 +6,13 @@ import '../lukso-icon/index.js';
6
6
  import '../lukso-profile/index.js';
7
7
  import '../lukso-username/index.js';
8
8
  import '../lukso-input/index.js';
9
+ import '../../index-30881141.js';
10
+ import '../lukso-dropdown-option/index.js';
9
11
  import '../../bundle-mjs-fbc6e2a8.js';
10
- import '../../style-map-ad97bcc3.js';
12
+ import '../../style-map-6e8b083a.js';
11
13
  import '../../directive-2bb7789e.js';
12
14
  import '../lukso-image/index.js';
13
- import '../../index-8043be8a.js';
15
+ import '../../index-f1acf332.js';
14
16
  import '../../tailwind-config.js';
15
17
  import '../../cn-b54dcc61.js';
16
18
 
@@ -57,48 +59,21 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
57
59
  this.isDebouncing = false;
58
60
  this.resultsParsed = [];
59
61
  this.searchTerm = "";
60
- this.inputStyles = ce({
62
+ this.styles = ce({
61
63
  slots: {
62
- dropdownWrapper: "bg-neutral-100 border border-neutral-90 shadow-1xl z-50 flex absolute w-full flex-col gap-1 overflow-y-auto max-h-64",
63
64
  loading: "bg-neutral-95 w-full animate-pulse animation-delay-none"
64
65
  },
65
66
  variants: {
66
67
  size: {
67
68
  small: {
68
- dropdownWrapper: "rounded-8 p-2 mt-1",
69
69
  loading: "h-7 rounded-4"
70
70
  },
71
71
  medium: {
72
- dropdownWrapper: "rounded-12 p-3 mt-2",
73
72
  loading: "h-10 rounded-8"
74
73
  }
75
74
  }
76
75
  }
77
76
  });
78
- this.resultStyles = ce({
79
- slots: {
80
- resultString: "text-neutral-20 cursor-pointer hover:bg-neutral-98",
81
- resultProfile: "cursor-pointer hover:bg-neutral-98 flex gap-2 items-center"
82
- },
83
- variants: {
84
- selected: {
85
- true: {
86
- resultString: "bg-neutral-98",
87
- resultProfile: "bg-neutral-98"
88
- }
89
- },
90
- size: {
91
- small: {
92
- resultString: "paragraph-inter-12-regular rounded-4 py-1 px-2",
93
- resultProfile: "rounded-4 py-1 px-2"
94
- },
95
- medium: {
96
- resultString: "paragraph-inter-14-regular rounded-8 p-2",
97
- resultProfile: "rounded-8 p-2"
98
- }
99
- }
100
- }
101
- });
102
77
  }
103
78
  connectedCallback() {
104
79
  super.connectedCallback();
@@ -140,68 +115,84 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
140
115
  console.error("Unknown result type", result);
141
116
  }
142
117
  }
143
- return x`${this.dropdownWrapperTemplate(resultTemplates)}`;
118
+ return x`<lukso-dropdown
119
+ size=${this.size}
120
+ is-open
121
+ is-open-on-outside-click
122
+ is-full-width
123
+ >${resultTemplates}</lukso-dropdown
124
+ >`;
144
125
  }
145
126
  noResultsTemplate() {
146
- return x`${this.dropdownWrapperTemplate(
147
- x`<div class="paragraph-inter-14-semi-bold text-neutral-20 pl-1">
127
+ return x`<lukso-dropdown
128
+ size=${this.size}
129
+ is-open
130
+ is-open-on-outside-click
131
+ is-full-width
132
+ >${x`<div class="paragraph-inter-14-semi-bold text-neutral-20 pl-1">
148
133
  ${this.noResultsText}
149
- </div>`
150
- )}`;
134
+ </div>`}</lukso-dropdown
135
+ >`;
151
136
  }
152
137
  loadingTemplate() {
153
- const { loading } = this.inputStyles({
138
+ const { loading } = this.styles({
154
139
  size: this.size
155
140
  });
156
141
  if (this.showNoResults) {
157
- return x`${this.dropdownWrapperTemplate(x`
158
- <div role="status" class="flex flex-col gap-1">
159
- <div class=${loading()}></div>
160
- </div>
161
- `)}`;
142
+ return x`<lukso-dropdown
143
+ size=${this.size}
144
+ is-open
145
+ is-open-on-outside-click
146
+ is-full-width
147
+ >${x`
148
+ <div role="status" class="flex flex-col gap-1">
149
+ <div class=${loading()}></div>
150
+ </div>
151
+ `}</lukso-dropdown
152
+ >`;
162
153
  }
163
154
  if (this.resultsParsed.length === 0 || this.resultsParsed.length > 5) {
164
- return x`${this.dropdownWrapperTemplate(x`
155
+ return x`<lukso-dropdown
156
+ size=${this.size}
157
+ is-open
158
+ is-open-on-outside-click
159
+ is-full-width
160
+ >${x`
161
+ <div role="status" class="flex flex-col gap-1">
162
+ ${[...Array(5)].map(() => x`<div class=${loading()}></div>`)}
163
+ </div>
164
+ `}</lukso-dropdown
165
+ >`;
166
+ }
167
+ return x`<lukso-dropdown
168
+ size=${this.size}
169
+ is-open
170
+ is-open-on-outside-click
171
+ is-full-width
172
+ >${x`
165
173
  <div role="status" class="flex flex-col gap-1">
166
- ${[...Array(5)].map(() => x`<div class=${loading()}></div>`)}
174
+ ${this.resultsParsed.map(() => x`<div class=${loading()}></div>`)}
167
175
  </div>
168
- `)}`;
169
- }
170
- return x`${this.dropdownWrapperTemplate(x`
171
- <div role="status" class="flex flex-col gap-1">
172
- ${this.resultsParsed.map(() => x`<div class=${loading()}></div>`)}
173
- </div>
174
- `)}`;
175
- }
176
- dropdownWrapperTemplate(innerTemplate) {
177
- const { dropdownWrapper } = this.inputStyles({
178
- size: this.size
179
- });
180
- return x`<div class=${dropdownWrapper()}>${innerTemplate}</div>`;
176
+ `}</lukso-dropdown
177
+ >`;
181
178
  }
182
179
  resultStringTemplate(result, index) {
183
- const { resultString } = this.resultStyles({
184
- selected: this.selected === index + 1,
185
- size: this.size
186
- });
187
- return x`<div
180
+ return x`<lukso-dropdown-option
188
181
  data-id="${result.id}"
189
182
  data-index="${index + 1}"
190
- class=${resultString()}
183
+ ?is-selected=${this.selected === index + 1}
184
+ size=${this.size}
191
185
  @click=${() => this.handleSelect(result)}
192
186
  >
193
187
  ${result.value}
194
- </div>`;
188
+ </lukso-dropdown-option>`;
195
189
  }
196
190
  resultProfileTemplate(result, index) {
197
- const { resultProfile } = this.resultStyles({
198
- selected: this.selected === index + 1,
199
- size: this.size
200
- });
201
- return x`<div
191
+ return x`<lukso-dropdown-option
202
192
  data-id="${result.address}"
203
193
  data-index="${index + 1}"
204
- class=${resultProfile()}
194
+ ?is-selected=${this.selected === index + 1}
195
+ size=${this.size}
205
196
  @click=${() => this.handleSelect(result)}
206
197
  >
207
198
  <lukso-profile
@@ -217,7 +208,7 @@ let LuksoSearch = class extends TailwindStyledElement(style) {
217
208
  max-width="300"
218
209
  size="medium"
219
210
  ></lukso-username>
220
- </div>`;
211
+ </lukso-dropdown-option>`;
221
212
  }
222
213
  async handleOutsideDropdownClick(event) {
223
214
  const element = event.target;
@@ -2,28 +2,25 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-e653a9ff.cjs');
5
+ const shared_tailwindElement_index = require('../../index-df36fb06.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');
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-abf15ef1.cjs');
13
+ require('../lukso-dropdown-option/index.cjs');
12
14
  require('../../bundle-mjs-d58a83c6.cjs');
13
- require('../../style-map-a6d61d04.cjs');
15
+ require('../../style-map-7ce21e2c.cjs');
14
16
  require('../../directive-8278ab14.cjs');
15
17
  require('../lukso-image/index.cjs');
16
- require('../../index-3b498928.cjs');
18
+ require('../../index-bf97dd78.cjs');
17
19
  require('../../tailwind-config.cjs');
18
20
  require('../../cn-5ceac001.cjs');
19
21
 
20
22
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
21
23
 
22
- const uniqId = () => {
23
- const s4 = () => ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
24
- return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
25
- };
26
-
27
24
  var __defProp = Object.defineProperty;
28
25
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
29
26
  var __decorateClass = (decorators, target, key, kind) => {
@@ -95,65 +92,6 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
95
92
  }
96
93
  }
97
94
  });
98
- this.dropdownWrapperStyles = index.ce({
99
- base: `bg-neutral-100 border w-auto border-neutral-90 shadow-1xl z-50
100
- flex absolute flex-col gap-1 overflow-y-auto max-h-64 `,
101
- variants: {
102
- openTop: {
103
- true: "bottom-[48px] mb-2 mt-0"
104
- },
105
- size: {
106
- small: "rounded-8 p-2 mt-1 max-w-[200px] min-w-[120px]",
107
- medium: "rounded-12 p-3 mt-2 max-w-[300px] min-w-[200px]"
108
- },
109
- isRight: {
110
- true: "right-0"
111
- }
112
- }
113
- });
114
- this.optionsStyles = index.ce({
115
- base: `text-neutral-20 cursor-pointer
116
- whitespace-nowrap flex items-center truncate`,
117
- variants: {
118
- isSelected: {
119
- true: "bg-neutral-95"
120
- },
121
- isActive: {
122
- true: "bg-neutral-98"
123
- },
124
- isGroup: {
125
- true: ""
126
- },
127
- size: {
128
- small: "paragraph-inter-12-regular rounded-4 py-1 px-2 min-h-[28px]",
129
- medium: "paragraph-inter-14-regular rounded-8 p-2 min-h-[38px]"
130
- },
131
- isDisabled: {
132
- true: "opacity-60 cursor-not-allowed"
133
- },
134
- isReadonly: {
135
- true: "cursor-not-allowed",
136
- false: "hover:bg-neutral-98"
137
- }
138
- },
139
- compoundVariants: [
140
- {
141
- isGroup: true,
142
- size: "small",
143
- class: "pl-3"
144
- },
145
- {
146
- isGroup: true,
147
- size: "medium",
148
- class: "pl-4"
149
- },
150
- {
151
- isReadonly: false,
152
- isSelected: true,
153
- class: "hover:bg-neutral-95"
154
- }
155
- ]
156
- });
157
95
  this.iconStyles = index.ce({
158
96
  base: "absolute right-0 transition cursor-pointer",
159
97
  variants: {
@@ -170,7 +108,7 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
170
108
  }
171
109
  });
172
110
  if (!this.id) {
173
- this.id = uniqId();
111
+ this.id = components_luksoDropdown_index.uniqId();
174
112
  }
175
113
  }
176
114
  connectedCallback() {
@@ -278,15 +216,14 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
278
216
  console.error("Unknown option type", option);
279
217
  }
280
218
  }
281
- return shared_tailwindElement_index.x`${this.dropdownWrapperTemplate(optionTemplates)}`;
282
- }
283
- dropdownWrapperTemplate(innerTemplate) {
284
- const dropdownWrapperStyles = this.dropdownWrapperStyles({
285
- openTop: this.openTop,
286
- size: this.size,
287
- isRight: this.isRight
288
- });
289
- return shared_tailwindElement_index.x`<div class="${dropdownWrapperStyles}">${innerTemplate}</div>`;
219
+ return shared_tailwindElement_index.x`<lukso-dropdown
220
+ size=${this.size}
221
+ is-open
222
+ is-open-on-outside-click
223
+ ?is-right=${this.isRight}
224
+ ?open-top=${this.openTop}
225
+ >${optionTemplates}</lukso-dropdown
226
+ >`;
290
227
  }
291
228
  optionGroupedStringTemplate(option, index) {
292
229
  return shared_tailwindElement_index.x`<div
@@ -302,39 +239,33 @@ exports.LuksoSelect = class LuksoSelect extends shared_tailwindElement_index.Tai
302
239
  })}`;
303
240
  }
304
241
  optionStringTemplate(option, index) {
305
- const optionsStyles = this.optionsStyles({
306
- isSelected: !!this.valueParsed?.find((value) => value.id === option.id),
307
- isActive: this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id),
308
- size: this.size,
309
- isGroup: !!option.group,
310
- isDisabled: this.isDisabled,
311
- isReadonly: this.isReadonly
312
- });
313
- return shared_tailwindElement_index.x`<div
242
+ return shared_tailwindElement_index.x`<lukso-dropdown-option
314
243
  data-id="${option.id}"
315
244
  data-index="${index + 1}"
316
- class="${optionsStyles}"
245
+ ?is-selected=${!!this.valueParsed?.find((value) => value.id === option.id)}
246
+ ?is-active=${this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id)}
247
+ size=${this.size}
248
+ ?is-group=${!!option.group}
249
+ ?is-disabled=${this.isDisabled}
250
+ ?is-readonly=${this.isReadonly}
317
251
  @click=${() => this.handleSelect(option)}
318
252
  >
319
253
  ${this.optionStringValue(option)}
320
- </div>`;
254
+ </lukso-dropdown-option>`;
321
255
  }
322
256
  optionProfileTemplate(option, index) {
323
- const optionsStyles = this.optionsStyles({
324
- isSelected: !!this.valueParsed?.find((value) => value.id === option.id),
325
- isActive: this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id),
326
- size: this.size,
327
- isDisabled: this.isDisabled,
328
- isReadonly: this.isReadonly
329
- });
330
- return shared_tailwindElement_index.x`<div
257
+ return shared_tailwindElement_index.x`<lukso-dropdown-option
331
258
  data-id="${option.id}"
332
259
  data-index="${index + 1}"
333
- class="${optionsStyles}"
260
+ ?is-selected=${!!this.valueParsed?.find((value) => value.id === option.id)}
261
+ ?is-active=${this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id)}
262
+ size=${this.size}
263
+ ?is-disabled=${this.isDisabled}
264
+ ?is-readonly=${this.isReadonly}
334
265
  @click=${() => this.handleSelect(option)}
335
266
  >
336
267
  ${this.optionProfileValue(option)}
337
- </div>`;
268
+ </lukso-dropdown-option>`;
338
269
  }
339
270
  optionStringValue(option) {
340
271
  return option.value;
@@ -42,8 +42,6 @@ export declare class LuksoSelect extends LuksoSelect_base {
42
42
  constructor();
43
43
  private inputStyles;
44
44
  private counterStyles;
45
- private dropdownWrapperStyles;
46
- private optionsStyles;
47
45
  private iconStyles;
48
46
  connectedCallback(): void;
49
47
  disconnectedCallback(): void;
@@ -54,7 +52,6 @@ export declare class LuksoSelect extends LuksoSelect_base {
54
52
  descriptionTemplate(): TemplateResult<1>;
55
53
  errorTemplate(): TemplateResult<1>;
56
54
  optionsTemplate(): TemplateResult<1>;
57
- dropdownWrapperTemplate(innerTemplate: TemplateResult<1> | TemplateResult<1>[]): TemplateResult<1>;
58
55
  optionGroupedStringTemplate(option: SelectGroupedStringOption, index: number): TemplateResult<1>;
59
56
  optionStringTemplate(option: SelectStringOption, index: number): TemplateResult<1>;
60
57
  optionProfileTemplate(option: SelectProfileOption, index: number): TemplateResult<1>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-select/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAA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;IAQb,mBAAmB;IAQnB,aAAa;IAMb,eAAe;IA2Bf,2BAA2B,CACzB,MAAM,EAAE,yBAAyB,EACjC,KAAK,EAAE,MAAM;IAef,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM;IAiB9D,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM;IAgBhE,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,qBAAqB;IA2D7B,OAAO,CAAC,0BAA0B;YAUpB,qBAAqB;YAqCrB,YAAY;YAiBZ,UAAU;IAcxB,OAAO,CAAC,WAAW;IAQnB,MAAM;CA6BP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAA;KAC5B;CACF"}
@@ -1,25 +1,22 @@
1
- import { T as TailwindStyledElement, x, A } from '../../index-f72579d6.js';
1
+ import { T as TailwindStyledElement, x, A } from '../../index-b2b49383.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';
5
5
  import '../lukso-icon/index.js';
6
6
  import '../lukso-profile/index.js';
7
7
  import '../lukso-username/index.js';
8
+ import { u as uniqId } from '../../index-30881141.js';
9
+ import '../lukso-dropdown-option/index.js';
8
10
  import '../../bundle-mjs-fbc6e2a8.js';
9
- import '../../style-map-ad97bcc3.js';
11
+ import '../../style-map-6e8b083a.js';
10
12
  import '../../directive-2bb7789e.js';
11
13
  import '../lukso-image/index.js';
12
- import '../../index-8043be8a.js';
14
+ import '../../index-f1acf332.js';
13
15
  import '../../tailwind-config.js';
14
16
  import '../../cn-b54dcc61.js';
15
17
 
16
18
  const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
17
19
 
18
- const uniqId = () => {
19
- const s4 = () => ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
20
- return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
21
- };
22
-
23
20
  var __defProp = Object.defineProperty;
24
21
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
25
22
  var __decorateClass = (decorators, target, key, kind) => {
@@ -91,65 +88,6 @@ let LuksoSelect = class extends TailwindStyledElement(style) {
91
88
  }
92
89
  }
93
90
  });
94
- this.dropdownWrapperStyles = ce({
95
- base: `bg-neutral-100 border w-auto border-neutral-90 shadow-1xl z-50
96
- flex absolute flex-col gap-1 overflow-y-auto max-h-64 `,
97
- variants: {
98
- openTop: {
99
- true: "bottom-[48px] mb-2 mt-0"
100
- },
101
- size: {
102
- small: "rounded-8 p-2 mt-1 max-w-[200px] min-w-[120px]",
103
- medium: "rounded-12 p-3 mt-2 max-w-[300px] min-w-[200px]"
104
- },
105
- isRight: {
106
- true: "right-0"
107
- }
108
- }
109
- });
110
- this.optionsStyles = ce({
111
- base: `text-neutral-20 cursor-pointer
112
- whitespace-nowrap flex items-center truncate`,
113
- variants: {
114
- isSelected: {
115
- true: "bg-neutral-95"
116
- },
117
- isActive: {
118
- true: "bg-neutral-98"
119
- },
120
- isGroup: {
121
- true: ""
122
- },
123
- size: {
124
- small: "paragraph-inter-12-regular rounded-4 py-1 px-2 min-h-[28px]",
125
- medium: "paragraph-inter-14-regular rounded-8 p-2 min-h-[38px]"
126
- },
127
- isDisabled: {
128
- true: "opacity-60 cursor-not-allowed"
129
- },
130
- isReadonly: {
131
- true: "cursor-not-allowed",
132
- false: "hover:bg-neutral-98"
133
- }
134
- },
135
- compoundVariants: [
136
- {
137
- isGroup: true,
138
- size: "small",
139
- class: "pl-3"
140
- },
141
- {
142
- isGroup: true,
143
- size: "medium",
144
- class: "pl-4"
145
- },
146
- {
147
- isReadonly: false,
148
- isSelected: true,
149
- class: "hover:bg-neutral-95"
150
- }
151
- ]
152
- });
153
91
  this.iconStyles = ce({
154
92
  base: "absolute right-0 transition cursor-pointer",
155
93
  variants: {
@@ -274,15 +212,14 @@ let LuksoSelect = class extends TailwindStyledElement(style) {
274
212
  console.error("Unknown option type", option);
275
213
  }
276
214
  }
277
- return x`${this.dropdownWrapperTemplate(optionTemplates)}`;
278
- }
279
- dropdownWrapperTemplate(innerTemplate) {
280
- const dropdownWrapperStyles = this.dropdownWrapperStyles({
281
- openTop: this.openTop,
282
- size: this.size,
283
- isRight: this.isRight
284
- });
285
- return x`<div class="${dropdownWrapperStyles}">${innerTemplate}</div>`;
215
+ return x`<lukso-dropdown
216
+ size=${this.size}
217
+ is-open
218
+ is-open-on-outside-click
219
+ ?is-right=${this.isRight}
220
+ ?open-top=${this.openTop}
221
+ >${optionTemplates}</lukso-dropdown
222
+ >`;
286
223
  }
287
224
  optionGroupedStringTemplate(option, index) {
288
225
  return x`<div
@@ -298,39 +235,33 @@ let LuksoSelect = class extends TailwindStyledElement(style) {
298
235
  })}`;
299
236
  }
300
237
  optionStringTemplate(option, index) {
301
- const optionsStyles = this.optionsStyles({
302
- isSelected: !!this.valueParsed?.find((value) => value.id === option.id),
303
- isActive: this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id),
304
- size: this.size,
305
- isGroup: !!option.group,
306
- isDisabled: this.isDisabled,
307
- isReadonly: this.isReadonly
308
- });
309
- return x`<div
238
+ return x`<lukso-dropdown-option
310
239
  data-id="${option.id}"
311
240
  data-index="${index + 1}"
312
- class="${optionsStyles}"
241
+ ?is-selected=${!!this.valueParsed?.find((value) => value.id === option.id)}
242
+ ?is-active=${this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id)}
243
+ size=${this.size}
244
+ ?is-group=${!!option.group}
245
+ ?is-disabled=${this.isDisabled}
246
+ ?is-readonly=${this.isReadonly}
313
247
  @click=${() => this.handleSelect(option)}
314
248
  >
315
249
  ${this.optionStringValue(option)}
316
- </div>`;
250
+ </lukso-dropdown-option>`;
317
251
  }
318
252
  optionProfileTemplate(option, index) {
319
- const optionsStyles = this.optionsStyles({
320
- isSelected: !!this.valueParsed?.find((value) => value.id === option.id),
321
- isActive: this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id),
322
- size: this.size,
323
- isDisabled: this.isDisabled,
324
- isReadonly: this.isReadonly
325
- });
326
- return x`<div
253
+ return x`<lukso-dropdown-option
327
254
  data-id="${option.id}"
328
255
  data-index="${index + 1}"
329
- class="${optionsStyles}"
256
+ ?is-selected=${!!this.valueParsed?.find((value) => value.id === option.id)}
257
+ ?is-active=${this.selected === index + 1 && !this.valueParsed?.find((value) => value.id === option.id)}
258
+ size=${this.size}
259
+ ?is-disabled=${this.isDisabled}
260
+ ?is-readonly=${this.isReadonly}
330
261
  @click=${() => this.handleSelect(option)}
331
262
  >
332
263
  ${this.optionProfileValue(option)}
333
- </div>`;
264
+ </lukso-dropdown-option>`;
334
265
  }
335
266
  optionStringValue(option) {
336
267
  return option.value;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-e653a9ff.cjs');
5
+ const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
7
 
8
8
  const style = ":host {\n display: inline-flex\n}";
@@ -1,4 +1,4 @@
1
- import { T as TailwindStyledElement, x } from '../../index-f72579d6.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-b2b49383.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
3
 
4
4
  const style = ":host {\n display: inline-flex\n}";
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-e653a9ff.cjs');
5
+ const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
- const styleMap = require('../../style-map-a6d61d04.cjs');
7
+ const styleMap = require('../../style-map-7ce21e2c.cjs');
8
8
  const index = require('../../index-e9668573.cjs');
9
9
  require('../../directive-8278ab14.cjs');
10
10
 
@@ -1,6 +1,6 @@
1
- import { a as TailwindElement, x } from '../../index-f72579d6.js';
1
+ import { a as TailwindElement, x } from '../../index-b2b49383.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
- import { o } from '../../style-map-ad97bcc3.js';
3
+ import { o } from '../../style-map-6e8b083a.js';
4
4
  import { c as customClassMap } from '../../index-5e194caf.js';
5
5
  import '../../directive-2bb7789e.js';
6
6
 
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const shared_tailwindElement_index = require('../../index-e653a9ff.cjs');
5
+ const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
6
6
  const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
7
7
  const index = require('../../index-1d3f4a5a.cjs');
8
- const index$1 = require('../../index-3b498928.cjs');
8
+ const index$1 = require('../../index-bf97dd78.cjs');
9
9
  require('../../bundle-mjs-d58a83c6.cjs');
10
10
  require('../../directive-8278ab14.cjs');
11
11
 
@@ -1,7 +1,7 @@
1
- import { T as TailwindStyledElement, x } from '../../index-f72579d6.js';
1
+ import { T as TailwindStyledElement, x } from '../../index-b2b49383.js';
2
2
  import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
3
3
  import { c as ce } from '../../index-ca8e900d.js';
4
- import { c as customStyleMap } from '../../index-8043be8a.js';
4
+ import { c as customStyleMap } from '../../index-f1acf332.js';
5
5
  import '../../bundle-mjs-fbc6e2a8.js';
6
6
  import '../../directive-2bb7789e.js';
7
7