@statistikzh/leu 0.9.0 → 0.11.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 (127) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/Accordion.d.ts +1 -1
  3. package/dist/Accordion.js +1 -1
  4. package/dist/Breadcrumb.d.ts +1 -1
  5. package/dist/Breadcrumb.js +1 -1
  6. package/dist/Button.d.ts +45 -1
  7. package/dist/Button.d.ts.map +1 -1
  8. package/dist/Button.js +473 -6
  9. package/dist/ButtonGroup.d.ts +1 -1
  10. package/dist/ButtonGroup.js +1 -1
  11. package/dist/Checkbox.d.ts +1 -1
  12. package/dist/Checkbox.js +1 -1
  13. package/dist/CheckboxGroup.d.ts +1 -1
  14. package/dist/CheckboxGroup.js +1 -1
  15. package/dist/Chip.d.ts +1 -1
  16. package/dist/Chip.js +1 -1
  17. package/dist/ChipGroup.d.ts +1 -1
  18. package/dist/ChipGroup.js +2 -2
  19. package/dist/ChipLink.js +1 -1
  20. package/dist/ChipRemovable.js +1 -1
  21. package/dist/ChipSelectable.js +1 -1
  22. package/dist/Dialog.d.ts +17 -0
  23. package/dist/Dialog.d.ts.map +1 -0
  24. package/dist/Dialog.js +255 -0
  25. package/dist/Dropdown.d.ts +1 -1
  26. package/dist/Dropdown.d.ts.map +1 -1
  27. package/dist/Dropdown.js +3 -2
  28. package/dist/Icon.d.ts +1 -1
  29. package/dist/Icon.js +1 -1
  30. package/dist/Input.d.ts +1 -1
  31. package/dist/Input.d.ts.map +1 -1
  32. package/dist/Input.js +3 -1
  33. package/dist/{LeuElement-7ab5ef5e.d.ts → LeuElement-78b4a998.d.ts} +1 -1
  34. package/dist/LeuElement-78b4a998.d.ts.map +1 -0
  35. package/dist/{LeuElement-7ab5ef5e.js → LeuElement-78b4a998.js} +1 -1
  36. package/dist/Menu.d.ts +1 -1
  37. package/dist/Menu.js +1 -1
  38. package/dist/MenuItem.d.ts +1 -1
  39. package/dist/MenuItem.js +1 -1
  40. package/dist/Pagination.d.ts +1 -1
  41. package/dist/Pagination.d.ts.map +1 -1
  42. package/dist/Pagination.js +3 -2
  43. package/dist/Popup.d.ts +1 -1
  44. package/dist/Popup.js +1 -1
  45. package/dist/Radio.d.ts +1 -1
  46. package/dist/Radio.js +1 -1
  47. package/dist/RadioGroup.d.ts +1 -1
  48. package/dist/RadioGroup.js +1 -1
  49. package/dist/Range.d.ts +60 -0
  50. package/dist/Range.d.ts.map +1 -0
  51. package/dist/Range.js +414 -0
  52. package/dist/ScrollTop.d.ts +1 -1
  53. package/dist/ScrollTop.d.ts.map +1 -1
  54. package/dist/ScrollTop.js +3 -2
  55. package/dist/Select.d.ts +1 -1
  56. package/dist/Select.d.ts.map +1 -1
  57. package/dist/Select.js +3 -2
  58. package/dist/Spinner.d.ts +1 -1
  59. package/dist/Spinner.js +1 -1
  60. package/dist/Table.d.ts +1 -1
  61. package/dist/Table.d.ts.map +1 -1
  62. package/dist/Table.js +3 -2
  63. package/dist/VisuallyHidden.d.ts +1 -1
  64. package/dist/VisuallyHidden.js +1 -1
  65. package/dist/hasSlotController-fd1950b4.d.ts +38 -0
  66. package/dist/hasSlotController-fd1950b4.d.ts.map +1 -0
  67. package/dist/hasSlotController-fd1950b4.js +75 -0
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +3 -2
  70. package/dist/leu-accordion.js +1 -1
  71. package/dist/leu-breadcrumb.js +1 -1
  72. package/dist/leu-button-group.js +1 -1
  73. package/dist/leu-button.d.ts +1 -1
  74. package/dist/leu-button.d.ts.map +1 -1
  75. package/dist/leu-button.js +3 -2
  76. package/dist/leu-checkbox-group.js +1 -1
  77. package/dist/leu-checkbox.js +1 -1
  78. package/dist/leu-chip-group.js +1 -1
  79. package/dist/leu-chip-link.js +1 -1
  80. package/dist/leu-chip-removable.js +1 -1
  81. package/dist/leu-chip-selectable.js +1 -1
  82. package/dist/leu-dialog.d.ts +3 -0
  83. package/dist/leu-dialog.d.ts.map +1 -0
  84. package/dist/leu-dialog.js +11 -0
  85. package/dist/leu-dropdown.js +3 -2
  86. package/dist/leu-icon.js +1 -1
  87. package/dist/leu-input.js +1 -1
  88. package/dist/leu-menu-item.js +1 -1
  89. package/dist/leu-menu.js +1 -1
  90. package/dist/leu-pagination.js +3 -2
  91. package/dist/leu-popup.js +1 -1
  92. package/dist/leu-radio-group.js +1 -1
  93. package/dist/leu-radio.js +1 -1
  94. package/dist/leu-range.d.ts +3 -0
  95. package/dist/leu-range.d.ts.map +1 -0
  96. package/dist/leu-range.js +7 -0
  97. package/dist/leu-scroll-top.js +3 -2
  98. package/dist/leu-select.js +3 -2
  99. package/dist/leu-spinner.js +1 -1
  100. package/dist/leu-table.js +3 -2
  101. package/dist/leu-visually-hidden.js +1 -1
  102. package/dist/theme.css +318 -192
  103. package/dist/vscode.html-custom-data.json +35 -0
  104. package/dist/vue/index.d.ts +60 -0
  105. package/dist/web-types.json +73 -1
  106. package/package.json +1 -1
  107. package/rollup.config.js +4 -1
  108. package/scripts/postcss-leu-font-styles.cjs +29 -35
  109. package/src/components/chip/chip-group.css +1 -1
  110. package/src/components/dialog/Dialog.js +100 -0
  111. package/src/components/dialog/dialog.css +162 -0
  112. package/src/components/dialog/leu-dialog.js +5 -0
  113. package/src/components/dialog/stories/dialog.stories.js +144 -0
  114. package/src/components/dialog/test/dialog.test.js +85 -0
  115. package/src/components/input/input.css +2 -0
  116. package/src/components/range/Range.js +237 -0
  117. package/src/components/range/leu-range.js +5 -0
  118. package/src/components/range/range.css +181 -0
  119. package/src/components/range/stories/range-slider.stories.js +142 -0
  120. package/src/components/range/test/range-test.js +24 -0
  121. package/src/styles/custom-properties.css +27 -0
  122. package/src/styles/font-definitions.json +27 -19
  123. package/src/styles/style.stories.js +61 -0
  124. package/dist/Button-5a8009c5.d.ts +0 -83
  125. package/dist/Button-5a8009c5.d.ts.map +0 -1
  126. package/dist/Button-5a8009c5.js +0 -544
  127. package/dist/LeuElement-7ab5ef5e.d.ts.map +0 -1
package/dist/Range.js ADDED
@@ -0,0 +1,414 @@
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-78b4a998.js';
2
+ import { css, html } from 'lit';
3
+
4
+ var css_248z = css`:host {
5
+ --range-color: var(--leu-color-black-40);
6
+ --range-color-disabled: var(--leu-color-black-20);
7
+ --range-color-focus: var(--leu-color-func-cyan);
8
+
9
+ --range-track-background-color: var(--leu-color-black-10);
10
+ --range-track-height: 4px;
11
+ --range-track-radius: var(--range-track-height);
12
+
13
+ --range-track-value-color: var(--leu-color-func-cyan);
14
+ --range-track-value-width: 0;
15
+ --range-track-value-min: 0;
16
+
17
+ --range-thumb-color: var(--leu-color-black-0);
18
+ --range-thumb-border-color: var(--range-color);
19
+ --range-thumb-hover-border-color: var(--leu-color-black-100);
20
+ --range-thumb-diameter: 32px;
21
+
22
+ --range-value-color: var(--leu-color-black-100);
23
+ --range-value-color-disabled: var(--range-color-disabled);
24
+
25
+ --range-font-regular: var(--leu-font-family-regular);
26
+ --range-font-black: var(--leu-font-family-black);
27
+
28
+ display: block;
29
+ box-sizing: border-box;
30
+
31
+ font-family: var(--leu-font-family-regular);
32
+
33
+ font-family: var(--range-font-regular);
34
+ }
35
+
36
+ :host([disabled]) {
37
+ --range-track-background: var(--range-color-disabled);
38
+ --range-track-value-color: var(--range-color-disabled);
39
+ --range-thumb-border-color: var(--range-color-disabled);
40
+ --range-thumb-hover-border-color: var(--range-color-disabled);
41
+ --range-value-color: var(--range-value-color-disabled);
42
+ }
43
+
44
+ /*************************** */
45
+
46
+ .label {
47
+ display: inline-block;
48
+ margin-bottom: 0.5rem;
49
+ color: var(--leu-color-black-100);
50
+ font: var(--leu-t-regular-regular-font);
51
+ }
52
+
53
+ .outputs {
54
+ position: relative;
55
+ height: 1.5rem;
56
+ margin-bottom: 0.25rem;
57
+ }
58
+
59
+ .output {
60
+ position: absolute;
61
+
62
+ text-align: center;
63
+ font: var(--leu-t-tiny-black-font);
64
+ color: var(--range-value-color);
65
+
66
+ min-width: var(--range-thumb-diameter);
67
+
68
+ --_stop: calc(100% - var(--range-thumb-diameter));
69
+ --_start: 0%;
70
+
71
+ left: calc(var(--value) * (calc(100% - var(--range-thumb-diameter)) - 0%) + 0%);
72
+
73
+ left: calc(var(--value) * (var(--_stop) - var(--_start)) + var(--_start));
74
+ transform: translateX(calc(-50% + var(--range-thumb-diameter) / 2));
75
+ }
76
+
77
+ .inputs {
78
+ position: relative;
79
+ }
80
+
81
+ .range {
82
+ -webkit-appearance: none;
83
+ -moz-appearance: none;
84
+ appearance: none;
85
+ width: 100%;
86
+ height: var(--range-thumb-diameter);
87
+ padding: 0;
88
+ margin: 0;
89
+ background: transparent;
90
+
91
+ --_track-background: linear-gradient(
92
+ to right,
93
+ var(--range-track-background-color) calc(var(--low) * 100%),
94
+ var(--range-track-value-color) 0,
95
+ var(--range-track-value-color) calc(var(--high) * 100%),
96
+ var(--range-track-background-color) 0
97
+ );
98
+ }
99
+
100
+ .range--ghost {
101
+ position: absolute;
102
+ top: 0;
103
+ left: 0;
104
+ z-index: 1;
105
+ pointer-events: none;
106
+ }
107
+
108
+ .range:focus {
109
+ outline: none;
110
+ }
111
+
112
+ /* Thumb */
113
+
114
+ .range::-moz-range-thumb {
115
+ cursor: pointer;
116
+ background: var(--range-thumb-color);
117
+
118
+ border: 2px var(--range-thumb-border-color) solid;
119
+ border-radius: 50%;
120
+
121
+ height: var(--range-thumb-diameter);
122
+ width: var(--range-thumb-diameter);
123
+
124
+ pointer-events: all;
125
+ }
126
+
127
+ .range:disabled::-moz-range-thumb {
128
+ cursor: not-allowed;
129
+ }
130
+
131
+ .range:focus-visible::-moz-range-thumb {
132
+ outline: 2px solid var(--range-color-focus);
133
+ outline-offset: 2px;
134
+ }
135
+
136
+ .range::-moz-range-thumb:hover,
137
+ .range:focus-visible::-moz-range-thumb {
138
+ border-color: var(--range-thumb-hover-border-color);
139
+ }
140
+
141
+ .range::-webkit-slider-thumb {
142
+ -webkit-appearance: none;
143
+ appearance: none;
144
+ cursor: pointer;
145
+ background: var(--range-thumb-color);
146
+
147
+ border: 2px var(--range-thumb-border-color) solid;
148
+ border-radius: 50%;
149
+
150
+ height: var(--range-thumb-diameter);
151
+ width: var(--range-thumb-diameter);
152
+ margin-top: calc(var(--range-thumb-diameter) / -2 + 2px);
153
+
154
+ pointer-events: all;
155
+ }
156
+
157
+ .range:disabled::-webkit-slider-thumb {
158
+ cursor: not-allowed;
159
+ }
160
+
161
+ .range:focus::-webkit-slider-thumb {
162
+ outline: 2px solid var(--range-color-focus);
163
+ outline-offset: 2px;
164
+ }
165
+
166
+ .range:focus::-webkit-slider-thumb,
167
+ .range::-webkit-slider-thumb:hover {
168
+ border-color: var(--range-thumb-hover-border-color);
169
+ }
170
+
171
+ /* Track */
172
+
173
+ .range::-moz-range-track {
174
+ background: var(--_track-background);
175
+ border-radius: var(--range-track-radius);
176
+ height: var(--range-track-height);
177
+ }
178
+
179
+ .range--ghost::-moz-range-track {
180
+ background: transparent;
181
+ }
182
+
183
+ .range::-webkit-slider-runnable-track {
184
+ background: var(--_track-background);
185
+ border-radius: var(--range-track-radius);
186
+ height: var(--range-track-height);
187
+ }
188
+
189
+ .range--ghost::-webkit-slider-runnable-track {
190
+ background: transparent;
191
+ }
192
+ `;
193
+
194
+ const defaultValueConverter = {
195
+ fromAttribute(value) {
196
+ return value.split(",").map(v => Number(v.trim()));
197
+ },
198
+ toAttribute(value) {
199
+ return value.join(",");
200
+ }
201
+ };
202
+ const RANGE_LABELS = ["Von", "Bis"];
203
+
204
+ /**
205
+ * @tagname leu-range
206
+ */
207
+ class LeuRange extends LeuElement {
208
+ constructor() {
209
+ super();
210
+ this.defaultValue = [50];
211
+ this.min = 0;
212
+ this.max = 100;
213
+ this.step = 1;
214
+ this.name = "";
215
+ this.label = "";
216
+ this.disabled = false;
217
+ this.multiple = false;
218
+ }
219
+ updated() {
220
+ this._updateStyles();
221
+ }
222
+ _updateStyles() {
223
+ const normalizedRange = this._getNormalizedRange();
224
+ this.style.setProperty("--low", normalizedRange[0].toString());
225
+ this.style.setProperty("--high", normalizedRange[1].toString());
226
+ const inputs = this.multiple ? [this._getBaseInput(), this._getGhostInput()] : [this._getBaseInput()];
227
+ inputs.forEach(input => {
228
+ /** @type {HTMLOutputElement} */
229
+ const output = this.shadowRoot.querySelector(`.output[for=${input.id}]`);
230
+ const normalizedValue = this._getNormalizedValue(input.valueAsNumber);
231
+ output.style.setProperty("--value", normalizedValue.toString());
232
+ output.value = input.value;
233
+ });
234
+ }
235
+ get value() {
236
+ const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
237
+ return inputs.map(input => input.value).join(",");
238
+ }
239
+
240
+ /**
241
+ * Sets the value of the underlying input element(s).
242
+ * The value has to be an array if "multiple" range is used.
243
+ * Otherwise it has to be a string.
244
+ * @param {string | Array} value
245
+ */
246
+ set value(value) {
247
+ if (this.multiple && Array.isArray(value)) {
248
+ const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
249
+ value.forEach((v, i) => {
250
+ inputs[i].value = v;
251
+ });
252
+ this._updateStyles();
253
+ } else if (!this.multiple) {
254
+ this._getBaseInput().value = value;
255
+ this._updateStyles();
256
+ }
257
+ }
258
+ get valueAsArray() {
259
+ return Array.from(this.shadowRoot.querySelectorAll("input")).map(input => input.valueAsNumber);
260
+ }
261
+ get valueLow() {
262
+ const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
263
+ if (this.multiple) {
264
+ return inputs.map(input => input.valueAsNumber).sort((a, b) => a - b)[0];
265
+ }
266
+ return inputs[0].value;
267
+ }
268
+ get valueHigh() {
269
+ const inputs = Array.from(this.shadowRoot.querySelectorAll("input"));
270
+ if (this.multiple) {
271
+ return inputs.map(input => input.valueAsNumber).sort((a, b) => a - b)[1];
272
+ }
273
+ return inputs[0].value;
274
+ }
275
+
276
+ /**
277
+ * @returns {HTMLInputElement | null}
278
+ */
279
+ _getBaseInput() {
280
+ return this.shadowRoot.querySelector(".range--base");
281
+ }
282
+
283
+ /**
284
+ * @returns {HTMLInputElement | null}
285
+ */
286
+ _getGhostInput() {
287
+ return this.shadowRoot.querySelector(".range--ghost");
288
+ }
289
+
290
+ /**
291
+ *
292
+ * @param {number} _index
293
+ * @param {InputEvent & {target: HTMLInputElement}} _e
294
+ */
295
+ _handleInput(_index, _e) {
296
+ this._updateStyles();
297
+ }
298
+
299
+ /**
300
+ *
301
+ * @param {number} value
302
+ * @returns {number}
303
+ */
304
+ _getNormalizedValue(value) {
305
+ return (value - this.min) / (this.max - this.min);
306
+ }
307
+ _getNormalizedRange() {
308
+ if (this.multiple) {
309
+ return this.valueAsArray.map(value => this._getNormalizedValue(value)).sort((a, b) => a - b);
310
+ }
311
+ return [0, this._getNormalizedValue(this.valueAsArray[0])];
312
+ }
313
+
314
+ /**
315
+ * Determine if the "click" (pointer event) is closer the
316
+ * the value of the other input element. Swap the values if this is the case.
317
+ * @param {PointerEvent & {target: HTMLInputElement}} e
318
+ */
319
+ _handlePointerDown(e) {
320
+ const clickValue = this.min + (this.max - this.min) * e.offsetX / this.offsetWidth;
321
+ const middleValue = (this.valueAsArray[0] + this.valueAsArray[1]) / 2;
322
+ if (e.target.valueAsNumber === this.valueLow === clickValue > middleValue) {
323
+ /**
324
+ * As the pointerdown event is fired before the input event, we first overwrite the value
325
+ * of the input element that was not clicked on. The active input element will update itself.
326
+ */
327
+ // this._value = [e.target.valueAsNumber, e.target.valueAsNumber]
328
+ this._getGhostInput().value = e.target.value;
329
+ }
330
+ }
331
+ render() {
332
+ const inputs = this.multiple ? ["base", "ghost"] : ["base"];
333
+ const {
334
+ multiple,
335
+ disabled,
336
+ label,
337
+ defaultValue
338
+ } = this;
339
+ return html`
340
+ <div
341
+ role=${multiple ? "group" : undefined}
342
+ aria-labelledby=${multiple ? "group-label" : undefined}
343
+ >
344
+ ${multiple ? html`<span id="group-label" class="label">${label}</span>` : html`<label for="input-base" class="label">${label}</label>`}
345
+ <div class="outputs">
346
+ ${inputs.map((type, index) => html`<output
347
+ class="output"
348
+ for="input-${type}"
349
+ value=${defaultValue[index]}
350
+ ></output>`)}
351
+ </div>
352
+ <div class="inputs">
353
+ ${inputs.map((type, index) => html`
354
+ <input
355
+ @input=${e => this._handleInput(index, e)}
356
+ @pointerdown=${multiple && !disabled && index === 0 ? this._handlePointerDown : undefined}
357
+ type="range"
358
+ class="range range--${type}"
359
+ id="input-${type}"
360
+ name=${this.name}
361
+ min=${this.min}
362
+ max=${this.max}
363
+ step=${this.step}
364
+ aria-label=${multiple ? RANGE_LABELS[index] : undefined}
365
+ ?disabled=${disabled}
366
+ .value=${defaultValue[index].toString()}
367
+ />
368
+ `)}
369
+ </div>
370
+ </div>
371
+ `;
372
+ }
373
+ }
374
+ _defineProperty(LeuRange, "styles", css_248z);
375
+ _defineProperty(LeuRange, "shadowRootOptions", {
376
+ ...LeuElement.shadowRootOptions,
377
+ delegatesFocus: true
378
+ });
379
+ _defineProperty(LeuRange, "properties", {
380
+ defaultValue: {
381
+ converter: defaultValueConverter,
382
+ attribute: "value"
383
+ },
384
+ min: {
385
+ type: Number,
386
+ reflect: true
387
+ },
388
+ max: {
389
+ type: Number,
390
+ reflect: true
391
+ },
392
+ step: {
393
+ type: Number,
394
+ reflect: true
395
+ },
396
+ name: {
397
+ type: String,
398
+ reflect: true
399
+ },
400
+ label: {
401
+ type: String,
402
+ reflect: true
403
+ },
404
+ disabled: {
405
+ type: Boolean,
406
+ reflect: true
407
+ },
408
+ multiple: {
409
+ type: Boolean,
410
+ reflect: true
411
+ }
412
+ });
413
+
414
+ export { LeuRange };
@@ -15,5 +15,5 @@ export class LeuScrollTop extends LeuElement {
15
15
  _scrollListener: Function;
16
16
  render(): import("lit-html").TemplateResult<1>;
17
17
  }
18
- import { L as LeuElement } from './LeuElement-7ab5ef5e.js';
18
+ import { L as LeuElement } from './LeuElement-78b4a998.js';
19
19
  //# sourceMappingURL=ScrollTop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollTop.d.ts","sourceRoot":"","sources":["ScrollTop.js"],"names":[],"mappings":"AA4CA;;GAEG;AACH;IAwCE,2BAMC;IAtCO,qBAAwB;IAM5B;;;;OAIG;IACH,qBAA2E;IAC3E,kBAA+B;IAQjC,gBAAgB;IAChB,0BAAgC;IAkBlC,+CAgBC;CACF;gCA/GqD,0BAA0B"}
1
+ {"version":3,"file":"ScrollTop.d.ts","sourceRoot":"","sources":["ScrollTop.js"],"names":[],"mappings":"AA6CA;;GAEG;AACH;IAwCE,2BAMC;IAtCO,qBAAwB;IAM5B;;;;OAIG;IACH,qBAA2E;IAC3E,kBAA+B;IAQjC,gBAAgB;IAChB,0BAAgC;IAkBlC,+CAgBC;CACF;gCAhHqD,0BAA0B"}
package/dist/ScrollTop.js CHANGED
@@ -1,10 +1,11 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-7ab5ef5e.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-78b4a998.js';
2
2
  import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
- import { L as LeuButton } from './Button-5a8009c5.js';
4
+ import { LeuButton } from './Button.js';
5
5
  import { LeuIcon } from './Icon.js';
6
6
  import { t as throttle } from './utils-65469421.js';
7
7
  import 'lit/directives/if-defined.js';
8
+ import './hasSlotController-fd1950b4.js';
8
9
 
9
10
  var css_248z = css`.scroll-top {
10
11
  overflow: hidden;
package/dist/Select.d.ts CHANGED
@@ -131,6 +131,6 @@ export class LeuSelect extends LeuElement {
131
131
  _renderToggleButton(): import("lit-html").TemplateResult<1>;
132
132
  render(): import("lit-html").TemplateResult<1>;
133
133
  }
134
- import { L as LeuElement } from './LeuElement-7ab5ef5e.js';
134
+ import { L as LeuElement } from './LeuElement-78b4a998.js';
135
135
  import { nothing } from 'lit';
136
136
  //# sourceMappingURL=Select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["Select.js"],"names":[],"mappings":"AA6PA;;;;;;;;;;;;;GAaG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmDC;IACD,wCAKC;IA4BC,cAAiB;IACjB,kBAAqB;IAErB,kBAAqB;IACrB,mBAAsB;IACtB,oBAAuB;IACvB,aAAe;IACf,cAAe;IACf,aAAc;IAEd,gBAAgB;IAChB,sBAAuB;IAEvB,gBAAgB;IAChB,2BAA6B;IAE7B,gBAAgB;IAChB,6BAAgC;IAEhC,gBAAgB;IAChB,sBAAuB;IAEvB;;OAEG;IACH,kBAFU,OAAO,oBAAoB,EAAE,GAAG,KAAmC,CAE1C;IACnC;;OAEG;IACH,kBAFU,OAAO,oBAAoB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAE1B;IAEnC;;OAEG;IACH,UAFU,OAAO,oBAAoB,EAAE,GAAG,KAAgC,CAE/C;IAU7B,sCAqBC;IAED;;;;OAIG;IACH,8CA6BC;IACD;;;OAGG;IACH,4BAFW,aAAa,iBAcvB;IAED;;;OAGG;IACH,iCAFW,aAAa,QAQvB;IAED;;;OAGG;IACH,oBAFa,uBAAgB,CAO5B;IACD,wBAMC;IACD,yBAMC;IACD,8BAOC;IACD,wBAIC;IACD,uBAMC;IACD,qCAEC;IAED;;;;OAIG;IACH,4CAEC;IACD,uCAoBC;IAED;;OAEG;IACH,uCAIC;IACD,4EAaC;IACD,4EAeC;IACD,4DAmCC;IACD,+CAmDC;CACF;gCAjrBqD,0BAA0B;wBAC7C,KAAK"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["Select.js"],"names":[],"mappings":"AA8PA;;;;;;;;;;;;;GAaG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmDC;IACD,wCAKC;IA4BC,cAAiB;IACjB,kBAAqB;IAErB,kBAAqB;IACrB,mBAAsB;IACtB,oBAAuB;IACvB,aAAe;IACf,cAAe;IACf,aAAc;IAEd,gBAAgB;IAChB,sBAAuB;IAEvB,gBAAgB;IAChB,2BAA6B;IAE7B,gBAAgB;IAChB,6BAAgC;IAEhC,gBAAgB;IAChB,sBAAuB;IAEvB;;OAEG;IACH,kBAFU,OAAO,oBAAoB,EAAE,GAAG,KAAmC,CAE1C;IACnC;;OAEG;IACH,kBAFU,OAAO,oBAAoB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAE1B;IAEnC;;OAEG;IACH,UAFU,OAAO,oBAAoB,EAAE,GAAG,KAAgC,CAE/C;IAU7B,sCAqBC;IAED;;;;OAIG;IACH,8CA6BC;IACD;;;OAGG;IACH,4BAFW,aAAa,iBAcvB;IAED;;;OAGG;IACH,iCAFW,aAAa,QAQvB;IAED;;;OAGG;IACH,oBAFa,uBAAgB,CAO5B;IACD,wBAMC;IACD,yBAMC;IACD,8BAOC;IACD,wBAIC;IACD,uBAMC;IACD,qCAEC;IAED;;;;OAIG;IACH,4CAEC;IACD,uCAoBC;IAED;;OAEG;IACH,uCAIC;IACD,4EAaC;IACD,4EAeC;IACD,4DAmCC;IACD,+CAmDC;CACF;gCAlrBqD,0BAA0B;wBAC7C,KAAK"}
package/dist/Select.js CHANGED
@@ -1,9 +1,10 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-7ab5ef5e.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-78b4a998.js';
2
2
  import { css, nothing, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import { createRef, ref } from 'lit/directives/ref.js';
5
5
  import { ifDefined } from 'lit/directives/if-defined.js';
6
- import { H as HasSlotController, L as LeuButton } from './Button-5a8009c5.js';
6
+ import { H as HasSlotController } from './hasSlotController-fd1950b4.js';
7
+ import { LeuButton } from './Button.js';
7
8
  import { LeuMenu } from './Menu.js';
8
9
  import { LeuMenuItem } from './MenuItem.js';
9
10
  import { LeuIcon } from './Icon.js';
package/dist/Spinner.d.ts CHANGED
@@ -5,5 +5,5 @@
5
5
  export class LeuSpinner extends LeuElement {
6
6
  render(): import("lit-html").TemplateResult<1>;
7
7
  }
8
- import { L as LeuElement } from './LeuElement-7ab5ef5e.js';
8
+ import { L as LeuElement } from './LeuElement-78b4a998.js';
9
9
  //# sourceMappingURL=Spinner.d.ts.map
package/dist/Spinner.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-7ab5ef5e.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-78b4a998.js';
2
2
  import { css, html } from 'lit';
3
3
 
4
4
  var css_248z = css`@keyframes leu-spinner-rotate {
package/dist/Table.d.ts CHANGED
@@ -40,5 +40,5 @@ export class LeuTable extends LeuElement {
40
40
  get _data(): any[];
41
41
  render(): import("lit-html").TemplateResult<1>;
42
42
  }
43
- import { L as LeuElement } from './LeuElement-7ab5ef5e.js';
43
+ import { L as LeuElement } from './LeuElement-78b4a998.js';
44
44
  //# sourceMappingURL=Table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["Table.js"],"names":[],"mappings":"AAoHA;;GAEG;AACH;IAGI,oBAAoB;IACpB,eAAiB;IACjB,oBAAoB;IACpB,YAAc;IACd,sBAAsB;IACtB,mBADW,OAAO,CACY;IAC9B,qBAAqB;IACrB,cADW,MAAM,CACO;IACxB,qBAAqB;IACrB,WADW,MAAM,CACI;IACrB,sBAAsB;IACtB,cADW,OAAO,CACO;IACzB,qBAAqB;IACrB,OADW,MAAM,CACA;IAEjB,gBAAgB;IAChB,qBAAwB;IACxB,gBAAgB;IAChB,sBAAyB;IACzB,gBAAgB;IAChB,8DAA6B;IAE7B,gBAAgB;IAChB,cAAc;IACd,gCAEE;IAKJ,oEAKC;IACD,qBAGC;IACD,gCAGC;IACD,8BAEC;IACD,8GAQC;IACD,4BAEC;IACD,0BAQC;IAFG,kBAAsB;IAG1B,sDAIC;IACD,0DAEC;IACD,sBAEC;IACD,yBAMC;IACD,mBAEC;IACD,+CA6DC;CACF;gCAlRqD,0BAA0B"}
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["Table.js"],"names":[],"mappings":"AAqHA;;GAEG;AACH;IAGI,oBAAoB;IACpB,eAAiB;IACjB,oBAAoB;IACpB,YAAc;IACd,sBAAsB;IACtB,mBADW,OAAO,CACY;IAC9B,qBAAqB;IACrB,cADW,MAAM,CACO;IACxB,qBAAqB;IACrB,WADW,MAAM,CACI;IACrB,sBAAsB;IACtB,cADW,OAAO,CACO;IACzB,qBAAqB;IACrB,OADW,MAAM,CACA;IAEjB,gBAAgB;IAChB,qBAAwB;IACxB,gBAAgB;IAChB,sBAAyB;IACzB,gBAAgB;IAChB,8DAA6B;IAE7B,gBAAgB;IAChB,cAAc;IACd,gCAEE;IAKJ,oEAKC;IACD,qBAGC;IACD,gCAGC;IACD,8BAEC;IACD,8GAQC;IACD,4BAEC;IACD,0BAQC;IAFG,kBAAsB;IAG1B,sDAIC;IACD,0DAEC;IACD,sBAEC;IACD,yBAMC;IACD,mBAEC;IACD,+CA6DC;CACF;gCAnRqD,0BAA0B"}
package/dist/Table.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-7ab5ef5e.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-78b4a998.js';
2
2
  import { css, html, nothing } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import { styleMap } from 'lit/directives/style-map.js';
@@ -6,8 +6,9 @@ import { createRef, ref } from 'lit/directives/ref.js';
6
6
  import { LeuIcon } from './Icon.js';
7
7
  import { LeuPagination } from './Pagination.js';
8
8
  import 'lit/directives/live.js';
9
- import './Button-5a8009c5.js';
9
+ import './Button.js';
10
10
  import 'lit/directives/if-defined.js';
11
+ import './hasSlotController-fd1950b4.js';
11
12
  import './VisuallyHidden.js';
12
13
 
13
14
  var css_248z = css`:host {
@@ -4,5 +4,5 @@
4
4
  export class LeuVisuallyHidden extends LeuElement {
5
5
  render(): import("lit-html").TemplateResult<1>;
6
6
  }
7
- import { L as LeuElement } from './LeuElement-7ab5ef5e.js';
7
+ import { L as LeuElement } from './LeuElement-78b4a998.js';
8
8
  //# sourceMappingURL=VisuallyHidden.d.ts.map
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-7ab5ef5e.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-78b4a998.js';
2
2
  import { css, html } from 'lit';
3
3
 
4
4
  var css_248z = css`:host {
@@ -0,0 +1,38 @@
1
+ export { HasSlotController as H };
2
+ /**
3
+ * A reactive controller that determines when slots exist.
4
+ */
5
+ export type ReactiveController = import("lit").ReactiveController;
6
+ /**
7
+ * Thanks Shoelace!
8
+ * Source: https://github.com/shoelace-style/shoelace/blob/next/src/internal/slot.ts
9
+ */
10
+ /**
11
+ * A reactive controller that determines when slots exist.
12
+ * @typedef {import("lit").ReactiveController} ReactiveController
13
+ * @implements {ReactiveController}
14
+ */
15
+ declare class HasSlotController implements ReactiveController {
16
+ constructor(host: any, slotNames: any);
17
+ host: any;
18
+ slotNames: any;
19
+ /**
20
+ * @private
21
+ * @returns {Boolean}
22
+ */
23
+ private hasDefaultSlot;
24
+ /**
25
+ * @private
26
+ * @param {String} name
27
+ * @returns {Boolean}
28
+ */
29
+ private hasNamedSlot;
30
+ /**
31
+ * @param {String} slotName
32
+ * @returns {Boolean}
33
+ */
34
+ test(slotName: string): boolean;
35
+ hostConnected(): void;
36
+ hostDisconnected(): void;
37
+ }
38
+ //# sourceMappingURL=hasSlotController-fd1950b4.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasSlotController-fd1950b4.d.ts","sourceRoot":"","sources":["hasSlotController-fd1950b4.js"],"names":[],"mappings":";;;;iCASa,OAAO,KAAK,EAAE,kBAAkB;AAP7C;;;GAGG;AAEH;;;;GAIG;AACH;IACE,uCAcC;IAHC,UAAgB;IAEhB,eAA0B;IAG5B;;;OAGG;IACH,uBAeC;IAED;;;;OAIG;IACH,qBAEC;IAED;;;OAGG;IACH,gCAEC;IACD,sBAEC;IACD,yBAEC;CACF"}
@@ -0,0 +1,75 @@
1
+ import { _ as _defineProperty } from './LeuElement-78b4a998.js';
2
+
3
+ /**
4
+ * Thanks Shoelace!
5
+ * Source: https://github.com/shoelace-style/shoelace/blob/next/src/internal/slot.ts
6
+ */
7
+
8
+ /**
9
+ * A reactive controller that determines when slots exist.
10
+ * @typedef {import("lit").ReactiveController} ReactiveController
11
+ * @implements {ReactiveController}
12
+ */
13
+ class HasSlotController {
14
+ constructor(host, slotNames) {
15
+ /**
16
+ * @private
17
+ * @param {Event} event
18
+ */
19
+ _defineProperty(this, "handleSlotChange", event => {
20
+ const slot = event.target;
21
+ if (slot instanceof HTMLSlotElement && (this.slotNames.includes("[default]") && !slot.name || slot.name && this.slotNames.includes(slot.name))) {
22
+ this.host.requestUpdate();
23
+ }
24
+ });
25
+ this.host = host;
26
+ host.addController(this);
27
+ this.slotNames = slotNames;
28
+ }
29
+
30
+ /**
31
+ * @private
32
+ * @returns {Boolean}
33
+ */
34
+ hasDefaultSlot() {
35
+ return [...this.host.childNodes].some(node => {
36
+ if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "") {
37
+ return true;
38
+ }
39
+ if (node.nodeType === node.ELEMENT_NODE) {
40
+ const el = node;
41
+
42
+ // If it doesn't have a slot attribute, it's part of the default slot
43
+ if (!el.hasAttribute("slot")) {
44
+ return true;
45
+ }
46
+ }
47
+ return false;
48
+ });
49
+ }
50
+
51
+ /**
52
+ * @private
53
+ * @param {String} name
54
+ * @returns {Boolean}
55
+ */
56
+ hasNamedSlot(name) {
57
+ return this.host.querySelector(`:scope > [slot="${name}"]`) !== null;
58
+ }
59
+
60
+ /**
61
+ * @param {String} slotName
62
+ * @returns {Boolean}
63
+ */
64
+ test(slotName) {
65
+ return slotName === "[default]" ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);
66
+ }
67
+ hostConnected() {
68
+ this.host.shadowRoot.addEventListener("slotchange", this.handleSlotChange);
69
+ }
70
+ hostDisconnected() {
71
+ this.host.shadowRoot.removeEventListener("slotchange", this.handleSlotChange);
72
+ }
73
+ }
74
+
75
+ export { HasSlotController as H };
package/dist/index.d.ts CHANGED
@@ -16,6 +16,6 @@ export { LeuRadio } from "./Radio.js";
16
16
  export { LeuRadioGroup } from "./RadioGroup.js";
17
17
  export { LeuSelect } from "./Select.js";
18
18
  export { LeuTable } from "./Table.js";
19
- export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from "./Button-5a8009c5.js";
19
+ export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton } from "./Button.js";
20
20
  export { LeuInput, SIZES } from "./Input.js";
21
21
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { LeuAccordion } from './Accordion.js';
2
2
  export { LeuBreadcrumb } from './Breadcrumb.js';
3
- export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from './Button-5a8009c5.js';
3
+ export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton } from './Button.js';
4
4
  export { LeuButtonGroup } from './ButtonGroup.js';
5
5
  export { LeuCheckbox } from './Checkbox.js';
6
6
  export { LeuCheckboxGroup } from './CheckboxGroup.js';
@@ -18,7 +18,7 @@ export { LeuRadio } from './Radio.js';
18
18
  export { LeuRadioGroup } from './RadioGroup.js';
19
19
  export { LeuSelect } from './Select.js';
20
20
  export { LeuTable } from './Table.js';
21
- import './LeuElement-7ab5ef5e.js';
21
+ import './LeuElement-78b4a998.js';
22
22
  import 'lit';
23
23
  import 'lit/static-html.js';
24
24
  import 'lit/directives/ref.js';
@@ -27,6 +27,7 @@ import './utils-65469421.js';
27
27
  import './Icon.js';
28
28
  import './VisuallyHidden.js';
29
29
  import 'lit/directives/if-defined.js';
30
+ import './hasSlotController-fd1950b4.js';
30
31
  import './Chip.js';
31
32
  import 'lit/directives/live.js';
32
33
  import '@floating-ui/dom';