@statistikzh/leu 0.14.4 → 0.15.1

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 (148) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/dist/Accordion.js +2 -30
  4. package/dist/Button.d.ts +56 -68
  5. package/dist/Button.js +74 -52
  6. package/dist/ButtonGroup.d.ts +9 -9
  7. package/dist/ButtonGroup.js +30 -20
  8. package/dist/ChartWrapper.d.ts +38 -0
  9. package/dist/ChartWrapper.js +164 -0
  10. package/dist/Checkbox.d.ts +6 -21
  11. package/dist/Checkbox.js +17 -9
  12. package/dist/CheckboxGroup.d.ts +13 -14
  13. package/dist/CheckboxGroup.js +18 -11
  14. package/dist/Chip.js +1 -1
  15. package/dist/ChipGroup.js +1 -1
  16. package/dist/ChipLink.js +1 -1
  17. package/dist/ChipRemovable.js +1 -1
  18. package/dist/ChipSelectable.js +1 -1
  19. package/dist/Dialog.js +1 -1
  20. package/dist/Dropdown.js +3 -1
  21. package/dist/Icon.js +1 -1
  22. package/dist/Input.js +1 -1
  23. package/dist/{LeuElement-x8UlIDDl.js → LeuElement-B84x5CPL.js} +1 -1
  24. package/dist/Menu.js +1 -1
  25. package/dist/MenuItem.js +1 -1
  26. package/dist/Pagination.d.ts +40 -28
  27. package/dist/Pagination.js +39 -14
  28. package/dist/Placeholder.d.ts +27 -0
  29. package/dist/Placeholder.js +90 -0
  30. package/dist/Popup.js +1 -1
  31. package/dist/Radio.d.ts +6 -21
  32. package/dist/Radio.js +17 -9
  33. package/dist/RadioGroup.d.ts +28 -23
  34. package/dist/RadioGroup.js +29 -16
  35. package/dist/Range.js +1 -1
  36. package/dist/ScrollTop.d.ts +0 -1
  37. package/dist/ScrollTop.js +3 -1
  38. package/dist/Select.js +3 -1
  39. package/dist/Spinner.js +1 -1
  40. package/dist/Table.d.ts +0 -1
  41. package/dist/Table.js +3 -1
  42. package/dist/VisuallyHidden.js +1 -1
  43. package/dist/_tslib-CNEFicEt.js +30 -0
  44. package/dist/components/button/Button.d.ts +55 -67
  45. package/dist/components/button/Button.d.ts.map +1 -1
  46. package/dist/components/button/stories/button.stories.d.ts.map +1 -1
  47. package/dist/components/button-group/ButtonGroup.d.ts +9 -9
  48. package/dist/components/button-group/ButtonGroup.d.ts.map +1 -1
  49. package/dist/components/chart-wrapper/ChartWrapper.d.ts +34 -0
  50. package/dist/components/chart-wrapper/ChartWrapper.d.ts.map +1 -0
  51. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts +3 -0
  52. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts.map +1 -0
  53. package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts +47 -0
  54. package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts.map +1 -0
  55. package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts +2 -0
  56. package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts.map +1 -0
  57. package/dist/components/checkbox/Checkbox.d.ts +6 -21
  58. package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
  59. package/dist/components/checkbox/CheckboxGroup.d.ts +13 -14
  60. package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
  61. package/dist/components/icon/stories/icon.stories.d.ts +10 -0
  62. package/dist/components/icon/stories/icon.stories.d.ts.map +1 -1
  63. package/dist/components/pagination/Pagination.d.ts +40 -27
  64. package/dist/components/pagination/Pagination.d.ts.map +1 -1
  65. package/dist/components/pagination/stories/pagination.stories.d.ts +10 -2
  66. package/dist/components/pagination/stories/pagination.stories.d.ts.map +1 -1
  67. package/dist/components/placeholder/Placeholder.d.ts +23 -0
  68. package/dist/components/placeholder/Placeholder.d.ts.map +1 -0
  69. package/dist/components/placeholder/leu-placeholder.d.ts +3 -0
  70. package/dist/components/placeholder/leu-placeholder.d.ts.map +1 -0
  71. package/dist/components/placeholder/stories/placeholder.stories.d.ts +27 -0
  72. package/dist/components/placeholder/stories/placeholder.stories.d.ts.map +1 -0
  73. package/dist/components/placeholder/test/placeholder.test.d.ts +2 -0
  74. package/dist/components/placeholder/test/placeholder.test.d.ts.map +1 -0
  75. package/dist/components/radio/Radio.d.ts +6 -21
  76. package/dist/components/radio/Radio.d.ts.map +1 -1
  77. package/dist/components/radio/RadioGroup.d.ts +28 -23
  78. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  79. package/dist/index.d.ts +1 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +5 -2
  82. package/dist/leu-accordion.js +2 -1
  83. package/dist/leu-button-group.js +8 -1
  84. package/dist/leu-button.d.ts +0 -1
  85. package/dist/leu-button.js +3 -1
  86. package/dist/leu-chart-wrapper.d.ts +6 -0
  87. package/dist/leu-chart-wrapper.js +11 -0
  88. package/dist/leu-checkbox-group.js +5 -1
  89. package/dist/leu-checkbox.js +3 -1
  90. package/dist/leu-chip-group.js +1 -1
  91. package/dist/leu-chip-link.js +1 -1
  92. package/dist/leu-chip-removable.js +1 -1
  93. package/dist/leu-chip-selectable.js +1 -1
  94. package/dist/leu-dialog.js +1 -1
  95. package/dist/leu-dropdown.js +3 -1
  96. package/dist/leu-icon.js +1 -1
  97. package/dist/leu-input.js +1 -1
  98. package/dist/leu-menu-item.js +1 -1
  99. package/dist/leu-menu.js +1 -1
  100. package/dist/leu-pagination.d.ts +0 -1
  101. package/dist/leu-pagination.js +3 -1
  102. package/dist/leu-placeholder.d.ts +4 -0
  103. package/dist/leu-placeholder.js +7 -0
  104. package/dist/leu-popup.js +1 -1
  105. package/dist/leu-radio-group.js +4 -1
  106. package/dist/leu-radio.js +3 -1
  107. package/dist/leu-range.js +1 -1
  108. package/dist/leu-scroll-top.d.ts +0 -1
  109. package/dist/leu-scroll-top.js +3 -1
  110. package/dist/leu-select.js +3 -1
  111. package/dist/leu-spinner.js +1 -1
  112. package/dist/leu-table.d.ts +0 -1
  113. package/dist/leu-table.js +3 -1
  114. package/dist/leu-visually-hidden.js +1 -1
  115. package/dist/lib/a11y.d.ts +2 -2
  116. package/dist/theme.css +18 -18
  117. package/dist/vscode.html-custom-data.json +95 -25
  118. package/dist/vue/index.d.ts +86 -46
  119. package/dist/web-types.json +222 -80
  120. package/package.json +1 -1
  121. package/release-please-config.json +1 -2
  122. package/scripts/generate-component/templates/stories/[name].stories.ts +17 -4
  123. package/scripts/postcss-leu-font-styles.cjs +10 -10
  124. package/src/components/button/Button.ts +95 -79
  125. package/src/components/button/stories/button.stories.ts +5 -6
  126. package/src/components/button-group/ButtonGroup.ts +18 -13
  127. package/src/components/chart-wrapper/ChartWrapper.ts +78 -0
  128. package/src/components/chart-wrapper/chart-wrapper.css +87 -0
  129. package/src/components/chart-wrapper/leu-chart-wrapper.ts +5 -0
  130. package/src/components/chart-wrapper/stories/chart-wrapper.stories.ts +58 -0
  131. package/src/components/chart-wrapper/test/chart-wrapper.test.ts +77 -0
  132. package/src/components/checkbox/Checkbox.ts +13 -15
  133. package/src/components/checkbox/CheckboxGroup.ts +20 -16
  134. package/src/components/icon/stories/icon.stories.ts +27 -0
  135. package/src/components/pagination/Pagination.ts +45 -32
  136. package/src/components/pagination/stories/pagination.stories.ts +28 -17
  137. package/src/components/placeholder/Placeholder.ts +33 -0
  138. package/src/components/placeholder/leu-placeholder.ts +5 -0
  139. package/src/components/placeholder/placeholder.css +59 -0
  140. package/src/components/placeholder/stories/placeholder.stories.ts +34 -0
  141. package/src/components/placeholder/test/placeholder.test.ts +31 -0
  142. package/src/components/radio/Radio.ts +13 -15
  143. package/src/components/radio/RadioGroup.ts +42 -28
  144. package/src/docs/contributing.mdx +1 -1
  145. package/src/index.ts +1 -0
  146. package/src/lib/a11y.ts +2 -2
  147. package/src/styles/theme.css +89 -1
  148. package/src/styles/custom-properties.css +0 -89
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.14.4"
2
+ ".": "0.15.1"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.1](https://github.com/statistikZH/leu/compare/leu-v0.15.0...leu-v0.15.1) (2025-07-03)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **chart-wrapper:** fix directory name and add export ([9ec09fb](https://github.com/statistikZH/leu/commit/9ec09fbd715ee71977f52632627ca10a77115f53))
9
+ * **chart-wrapper:** reset user agent default styling ([f1cd090](https://github.com/statistikZH/leu/commit/f1cd0900a096a7ac5cc60faffc6c56ebf9363909))
10
+ * **theme:** explicitly define a font weight to avoid font synthesis ([2605cc9](https://github.com/statistikZH/leu/commit/2605cc9105c1b0e9439f272d09b5ec7d5f81ba33))
11
+
12
+ ## [0.15.0](https://github.com/statistikZH/leu/compare/leu-v0.14.4...leu-v0.15.0) (2025-07-03)
13
+
14
+
15
+ ### Features
16
+
17
+ * **chart-wrapper:** create a chart wrapper component ([2478fd0](https://github.com/statistikZH/leu/commit/2478fd0d76631d43c650ecb82ae275386243c438))
18
+ * **placeholder:** implement placeholder component ([22aa5e2](https://github.com/statistikZH/leu/commit/22aa5e2cac68bf1fdb0bcbd345307e04cc5b9fad))
19
+
3
20
  ## [0.14.4](https://github.com/statistikZH/leu/compare/leu-v0.14.3...leu-v0.14.4) (2025-06-18)
4
21
 
5
22
 
package/dist/Accordion.js CHANGED
@@ -1,36 +1,8 @@
1
+ import { _ as __decorate } from './_tslib-CNEFicEt.js';
1
2
  import { css, nothing } from 'lit';
2
3
  import { unsafeStatic, html } from 'lit/static-html.js';
3
4
  import { property } from 'lit/decorators.js';
4
- import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
5
-
6
- /******************************************************************************
7
- Copyright (c) Microsoft Corporation.
8
-
9
- Permission to use, copy, modify, and/or distribute this software for any
10
- purpose with or without fee is hereby granted.
11
-
12
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
13
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
15
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
- PERFORMANCE OF THIS SOFTWARE.
19
- ***************************************************************************** */
20
- /* global Reflect, Promise, SuppressedError, Symbol */
21
-
22
-
23
- function __decorate(decorators, target, key, desc) {
24
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
25
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
26
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
27
- return c > 3 && r && Object.defineProperty(target, key, r), r;
28
- }
29
-
30
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
31
- var e = new Error(message);
32
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
33
- };
5
+ import { L as LeuElement } from './LeuElement-B84x5CPL.js';
34
6
 
35
7
  var css_248z = css`:host {
36
8
  --accordion-font-regular: var(--leu-font-family-regular);
package/dist/Button.d.ts CHANGED
@@ -1,31 +1,20 @@
1
1
  import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
- import { nothing } from 'lit';
4
3
  import { LeuIcon } from './Icon.js';
5
4
  import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
6
- import { H as HasSlotController } from './hasSlotController.d-emXwVXWF.js';
7
5
 
8
- declare const BUTTON_VARIANTS: string[];
9
-
10
- declare const BUTTON_SIZES: string[];
11
-
12
- declare const BUTTON_TYPES: string[];
13
-
14
- declare const BUTTON_EXPANDED_OPTIONS: string[];
15
6
  /**
16
7
  * @tagname leu-button
17
8
  * @slot before - The icon to display before the label
18
9
  * @slot after - The icon to display after the label
19
10
  * @slot - The label of the button or the icon if no label is set
11
+ * @see https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=4-1444&mode=design&t=xu5Vii8jXKKCKDez-0
20
12
  */
21
13
  declare class LeuButton extends LeuElement {
22
14
  static dependencies: {
23
15
  "leu-icon": typeof LeuIcon;
24
16
  };
25
17
  static styles: lit.CSSResultGroup[];
26
- /**
27
- * @internal
28
- */
29
18
  static shadowRootOptions: {
30
19
  delegatesFocus: boolean;
31
20
  mode: ShadowRootMode;
@@ -34,64 +23,63 @@ declare class LeuButton extends LeuElement {
34
23
  customElements?: CustomElementRegistry;
35
24
  registry?: CustomElementRegistry;
36
25
  };
26
+ private hasSlotController;
37
27
  /**
38
- * @internal
28
+ * `aria-label` of the underlying button elements.
29
+ * Use it to provide a label when only an icon is visible.
39
30
  */
40
- hasSlotController: HasSlotController;
41
- static properties: {
42
- label: {
43
- type: StringConstructor;
44
- reflect: boolean;
45
- };
46
- size: {
47
- type: StringConstructor;
48
- reflect: boolean;
49
- };
50
- variant: {
51
- type: StringConstructor;
52
- reflect: boolean;
53
- };
54
- type: {
55
- type: StringConstructor;
56
- reflect: boolean;
57
- };
58
- componentRole: {
59
- type: StringConstructor;
60
- reflect: boolean;
61
- };
62
- disabled: {
63
- type: BooleanConstructor;
64
- reflect: boolean;
65
- };
66
- round: {
67
- type: BooleanConstructor;
68
- reflect: boolean;
69
- };
70
- active: {
71
- type: BooleanConstructor;
72
- reflect: boolean;
73
- };
74
- inverted: {
75
- type: BooleanConstructor;
76
- reflect: boolean;
77
- };
78
- expanded: {
79
- type: StringConstructor;
80
- reflect: boolean;
81
- };
82
- fluid: {
83
- type: BooleanConstructor;
84
- reflect: boolean;
85
- };
86
- };
87
- constructor();
88
- renderExpandingIcon(): typeof nothing | lit_html.TemplateResult<1>;
89
- getAriaAttributes(): {
90
- role: any;
91
- label: any;
92
- };
93
- hasTextContent(): boolean;
31
+ label: null | string;
32
+ /**
33
+ * The size of the button.
34
+ */
35
+ size: "regular" | "small";
36
+ /**
37
+ * The visual variant of the button.
38
+ */
39
+ variant: "primary" | "secondary" | "ghost";
40
+ /**
41
+ * The `type` of the underlying button element.
42
+ */
43
+ type: "button" | "submit" | "reset";
44
+ /**
45
+ * The `role` of the underlying button element.
46
+ */
47
+ componentRole?: string;
48
+ /**
49
+ * Whether the button is disabled or not.
50
+ * @type {boolean}
51
+ */
52
+ disabled: boolean;
53
+ /**
54
+ * Whether the button should be round.
55
+ * Can only be applied when the button contains an icon without a visible label.
56
+ * @type {boolean}
57
+ */
58
+ round: boolean;
59
+ /**
60
+ * Whether the button is active or not.
61
+ * Depending on the `componentRole`, it applies `aria-checked` or `aria-selected` to the underlying button element.
62
+ */
63
+ active: boolean;
64
+ /**
65
+ * Wheter the colors should be inverted. For use on dark backgrounds.
66
+ */
67
+ inverted: boolean;
68
+ /**
69
+ * Whether the button is expanded or not.
70
+ * Only has an effect on the variant `ghost` to show an expanding icon.
71
+ * If the property is not set, the icon will not be shown.
72
+ * If it is set, the icon will either show an expanded or collapsed state.
73
+ */
74
+ expanded?: "true" | "false";
75
+ /**
76
+ * Alters the shape of the button to be full width of its parent container
77
+ */
78
+ fluid: boolean;
79
+ private renderExpandingIcon;
80
+ private getAriaAttributes;
81
+ private hasTextContent;
94
82
  render(): lit_html.TemplateResult<1>;
95
83
  }
96
84
 
97
- export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton };
85
+ export { LeuButton };
package/dist/Button.js CHANGED
@@ -1,13 +1,15 @@
1
+ import { _ as __decorate } from './_tslib-CNEFicEt.js';
1
2
  import { css, html, nothing } from 'lit';
2
3
  import { classMap } from 'lit/directives/class-map.js';
3
4
  import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import { property } from 'lit/decorators.js';
4
6
  import { LeuIcon } from './Icon.js';
5
- import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
7
+ import { L as LeuElement } from './LeuElement-B84x5CPL.js';
6
8
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
7
9
 
8
10
  /**
9
11
  * All roles that are associated with a aria-checked attribute
10
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
12
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
11
13
  */
12
14
  const ARIA_CHECKED_ROLES = [
13
15
  "checkbox",
@@ -19,7 +21,7 @@ const ARIA_CHECKED_ROLES = [
19
21
  ];
20
22
  /**
21
23
  * All roles that are associated with a aria-selected attribute
22
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
24
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
23
25
  */
24
26
  const ARIA_SELECTED_ROLES = [
25
27
  "gridcell",
@@ -334,60 +336,62 @@ button.ghost.inverted:disabled {
334
336
  }
335
337
  `;
336
338
 
337
- /*
338
- Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=4-1444&mode=design&t=xu5Vii8jXKKCKDez-0
339
- Live Demo: zh.ch
340
- */
341
- const BUTTON_VARIANTS = ["primary", "secondary", "ghost"];
342
- Object.freeze(BUTTON_VARIANTS);
343
- const BUTTON_SIZES = ["regular", "small"];
344
- Object.freeze(BUTTON_SIZES);
345
- const BUTTON_TYPES = ["button", "submit", "reset"];
346
- Object.freeze(BUTTON_TYPES);
347
- const BUTTON_EXPANDED_OPTIONS = ["true", "false"];
348
- Object.freeze(BUTTON_EXPANDED_OPTIONS);
349
339
  /**
350
340
  * @tagname leu-button
351
341
  * @slot before - The icon to display before the label
352
342
  * @slot after - The icon to display after the label
353
343
  * @slot - The label of the button or the icon if no label is set
344
+ * @see https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=4-1444&mode=design&t=xu5Vii8jXKKCKDez-0
354
345
  */
355
346
  class LeuButton extends LeuElement {
356
347
  constructor() {
357
- super();
358
- /**
359
- * @internal
360
- */
348
+ super(...arguments);
361
349
  this.hasSlotController = new HasSlotController(this, [
362
350
  "before",
363
351
  "after",
364
352
  "[default]",
365
353
  ]);
366
- /** @type {string} */
354
+ /**
355
+ * `aria-label` of the underlying button elements.
356
+ * Use it to provide a label when only an icon is visible.
357
+ */
367
358
  this.label = null;
368
- /** @type {string} */
359
+ /**
360
+ * The size of the button.
361
+ */
369
362
  this.size = "regular";
370
- /** @type {string} */
363
+ /**
364
+ * The visual variant of the button.
365
+ */
371
366
  this.variant = "primary";
372
- /** @type {"button" | "submit" | "reset"} */
367
+ /**
368
+ * The `type` of the underlying button element.
369
+ */
373
370
  this.type = "button";
374
- /** @type {string} */
375
- this.componentRole = undefined;
376
- /** @type {boolean} */
371
+ /**
372
+ * Whether the button is disabled or not.
373
+ * @type {boolean}
374
+ */
377
375
  this.disabled = false;
378
- /** @type {boolean} - Only taken into account if no Label and an Icon is set */
376
+ /**
377
+ * Whether the button should be round.
378
+ * Can only be applied when the button contains an icon without a visible label.
379
+ * @type {boolean}
380
+ */
379
381
  this.round = false;
380
- /** @type {boolean} */
382
+ /**
383
+ * Whether the button is active or not.
384
+ * Depending on the `componentRole`, it applies `aria-checked` or `aria-selected` to the underlying button element.
385
+ */
381
386
  this.active = false;
382
- /** @type {boolean} - will be used on dark Background */
387
+ /**
388
+ * Wheter the colors should be inverted. For use on dark backgrounds.
389
+ */
383
390
  this.inverted = false;
384
- /** @type {boolean} - Alters the shape of the button to be full width of its parent container */
385
- this.fluid = false;
386
391
  /**
387
- * Only taken into account if variant is "ghost"
388
- * @type {("true" | "false" | undefined)}
392
+ * Alters the shape of the button to be full width of its parent container
389
393
  */
390
- this.expanded = undefined;
394
+ this.fluid = false;
391
395
  }
392
396
  renderExpandingIcon() {
393
397
  if (typeof this.expanded !== "undefined" && this.variant === "ghost") {
@@ -402,6 +406,7 @@ class LeuButton extends LeuElement {
402
406
  role: this.componentRole,
403
407
  label: this.label,
404
408
  };
409
+ // TODO: checked and selected roles are not mutually exclusive
405
410
  if (this.componentRole) {
406
411
  if (ARIA_CHECKED_ROLES.includes(this.componentRole)) {
407
412
  attributes.checked = this.active ? "true" : "false";
@@ -459,25 +464,42 @@ LeuButton.dependencies = {
459
464
  "leu-icon": LeuIcon,
460
465
  };
461
466
  LeuButton.styles = [LeuElement.styles, css_248z];
462
- /**
463
- * @internal
464
- */
465
467
  LeuButton.shadowRootOptions = {
466
468
  ...LeuElement.shadowRootOptions,
467
469
  delegatesFocus: true,
468
470
  };
469
- LeuButton.properties = {
470
- label: { type: String, reflect: true },
471
- size: { type: String, reflect: true },
472
- variant: { type: String, reflect: true },
473
- type: { type: String, reflect: true },
474
- componentRole: { type: String, reflect: true },
475
- disabled: { type: Boolean, reflect: true },
476
- round: { type: Boolean, reflect: true },
477
- active: { type: Boolean, reflect: true },
478
- inverted: { type: Boolean, reflect: true },
479
- expanded: { type: String, reflect: true },
480
- fluid: { type: Boolean, reflect: true },
481
- };
482
-
483
- export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton };
471
+ __decorate([
472
+ property({ type: String, reflect: true })
473
+ ], LeuButton.prototype, "label", void 0);
474
+ __decorate([
475
+ property({ type: String, reflect: true })
476
+ ], LeuButton.prototype, "size", void 0);
477
+ __decorate([
478
+ property({ type: String, reflect: true })
479
+ ], LeuButton.prototype, "variant", void 0);
480
+ __decorate([
481
+ property({ type: String, reflect: true })
482
+ ], LeuButton.prototype, "type", void 0);
483
+ __decorate([
484
+ property({ type: String, reflect: true })
485
+ ], LeuButton.prototype, "componentRole", void 0);
486
+ __decorate([
487
+ property({ type: Boolean, reflect: true })
488
+ ], LeuButton.prototype, "disabled", void 0);
489
+ __decorate([
490
+ property({ type: Boolean, reflect: true })
491
+ ], LeuButton.prototype, "round", void 0);
492
+ __decorate([
493
+ property({ type: Boolean, reflect: true })
494
+ ], LeuButton.prototype, "active", void 0);
495
+ __decorate([
496
+ property({ type: Boolean, reflect: true })
497
+ ], LeuButton.prototype, "inverted", void 0);
498
+ __decorate([
499
+ property({ type: String, reflect: true })
500
+ ], LeuButton.prototype, "expanded", void 0);
501
+ __decorate([
502
+ property({ type: Boolean, reflect: true })
503
+ ], LeuButton.prototype, "fluid", void 0);
504
+
505
+ export { LeuButton };
@@ -3,26 +3,26 @@ import * as lit from 'lit';
3
3
  import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
4
4
 
5
5
  /**
6
+ * A radio input-like button group component.
7
+ * It allows only one button to be active at a time.
6
8
  * @tagname leu-button-group
7
9
  * @slot - Slot for the buttons
8
- * @prop {string} value - The value of the currenty selected (active) button
9
10
  * @fires input - When the value of the group changes by clicking a button
10
11
  */
11
12
  declare class LeuButtonGroup extends LeuElement {
12
13
  static styles: lit.CSSResultGroup[];
13
14
  private _items;
14
15
  /**
15
- * @param {import("../button/Button.js").LeuButton} button
16
- * @returns {string}
16
+ * Retrieves the value or the text content of a given LeuButton element.
17
17
  */
18
- static getButtonValue(button: any): any;
19
- get value(): any;
20
- set value(newValue: any);
21
- _handleSlotChange(): void;
18
+ private static getButtonValue;
22
19
  /**
23
- * @param {import("../button/Button.js").LeuButton} button
20
+ * The value of the currently selected (active) button
24
21
  */
25
- _handleButtonClick(button: any): void;
22
+ get value(): string;
23
+ set value(newValue: string);
24
+ private _handleSlotChange;
25
+ private _handleButtonClick;
26
26
  render(): lit_html.TemplateResult<1>;
27
27
  }
28
28
 
@@ -1,5 +1,12 @@
1
1
  import { css, html } from 'lit';
2
- import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
2
+ import { L as LeuElement } from './LeuElement-B84x5CPL.js';
3
+ import { LeuButton } from './Button.js';
4
+ import './_tslib-CNEFicEt.js';
5
+ import 'lit/directives/class-map.js';
6
+ import 'lit/directives/if-defined.js';
7
+ import 'lit/decorators.js';
8
+ import './Icon.js';
9
+ import './hasSlotController-Bm2tipvG.js';
3
10
 
4
11
  var css_248z = css`.group {
5
12
  display: flex;
@@ -9,23 +16,37 @@ var css_248z = css`.group {
9
16
  `;
10
17
 
11
18
  /**
19
+ * A radio input-like button group component.
20
+ * It allows only one button to be active at a time.
12
21
  * @tagname leu-button-group
13
22
  * @slot - Slot for the buttons
14
- * @prop {string} value - The value of the currenty selected (active) button
15
23
  * @fires input - When the value of the group changes by clicking a button
16
24
  */
17
25
  class LeuButtonGroup extends LeuElement {
18
26
  constructor() {
19
27
  super(...arguments);
20
28
  this._items = [];
29
+ this._handleButtonClick = (event) => {
30
+ const button = event.currentTarget;
31
+ if (!button.active) {
32
+ this.value = LeuButtonGroup.getButtonValue(button);
33
+ this.dispatchEvent(new CustomEvent("input", {
34
+ bubbles: true,
35
+ composed: true,
36
+ detail: { value: LeuButtonGroup.getButtonValue(button) },
37
+ }));
38
+ }
39
+ };
21
40
  }
22
41
  /**
23
- * @param {import("../button/Button.js").LeuButton} button
24
- * @returns {string}
42
+ * Retrieves the value or the text content of a given LeuButton element.
25
43
  */
26
44
  static getButtonValue(button) {
27
- return button.getAttribute("value") ?? button.innerText.trim();
45
+ return button.getAttribute("value") ?? button.textContent.trim();
28
46
  }
47
+ /**
48
+ * The value of the currently selected (active) button
49
+ */
29
50
  get value() {
30
51
  const activeButton = this._items.find((item) => item.active);
31
52
  return activeButton ? LeuButtonGroup.getButtonValue(activeButton) : null;
@@ -47,11 +68,13 @@ class LeuButtonGroup extends LeuElement {
47
68
  item.removeEventListener("click", this._handleButtonClick);
48
69
  });
49
70
  const slot = this.shadowRoot.querySelector("slot");
50
- this._items = slot.assignedElements({ flatten: true });
71
+ this._items = slot
72
+ .assignedElements({ flatten: true })
73
+ .filter((el) => el instanceof LeuButton);
51
74
  let foundActiveButtonBefore = false;
52
75
  this._items.forEach((item) => {
53
76
  /* eslint-disable no-param-reassign */
54
- item.addEventListener("click", () => this._handleButtonClick(item));
77
+ item.addEventListener("click", this._handleButtonClick);
55
78
  item.componentRole = "menuitemradio";
56
79
  /**
57
80
  * In case there are multiple active buttons
@@ -66,19 +89,6 @@ class LeuButtonGroup extends LeuElement {
66
89
  /* eslint-enable no-param-reassign */
67
90
  });
68
91
  }
69
- /**
70
- * @param {import("../button/Button.js").LeuButton} button
71
- */
72
- _handleButtonClick(button) {
73
- if (!button.active) {
74
- this.value = LeuButtonGroup.getButtonValue(button);
75
- this.dispatchEvent(new CustomEvent("input", {
76
- bubbles: true,
77
- composed: true,
78
- detail: { value: LeuButtonGroup.getButtonValue(button) },
79
- }));
80
- }
81
- }
82
92
  render() {
83
93
  return html `
84
94
  <div role="menubar" class="group">
@@ -0,0 +1,38 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
4
+ import { H as HasSlotController } from './hasSlotController.d-emXwVXWF.js';
5
+ import { LeuSpinner } from './Spinner.js';
6
+
7
+ /**
8
+ * A wrapper element for charts.
9
+ * @tagname leu-chart-wrapper
10
+ * @slot title - The title of the chart. Use a heading tag (h2-4) depending on your context.
11
+ * @slot description - A description of the chart. Content is wrapped in a `<p>` tag by the component.
12
+ * @slot chart - The actual chart
13
+ * @slot caption - A caption for the chart, e.g. a source or explanation of the data.
14
+ * @slot download - A download button or dropdown to export the chart in different formats.
15
+ */
16
+ declare class LeuChartWrapper extends LeuElement {
17
+ static styles: lit.CSSResultGroup[];
18
+ static shadowRootOptions: {
19
+ delegatesFocus: boolean;
20
+ mode: ShadowRootMode;
21
+ serializable?: boolean;
22
+ slotAssignment?: SlotAssignmentMode;
23
+ customElements?: CustomElementRegistry;
24
+ registry?: CustomElementRegistry;
25
+ };
26
+ static dependencies: {
27
+ "leu-spinner": typeof LeuSpinner;
28
+ };
29
+ /**
30
+ * Whether the chart is currently loading or not.
31
+ * When set to `true`, a spinner will be shown in the chart container.
32
+ */
33
+ pending: boolean;
34
+ hasSlotController: HasSlotController;
35
+ render(): lit_html.TemplateResult<1>;
36
+ }
37
+
38
+ export { LeuChartWrapper };