@statistikzh/leu 0.7.0 → 0.8.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 (104) hide show
  1. package/.eslintrc.json +4 -1
  2. package/CHANGELOG.md +16 -0
  3. package/dist/Accordion.d.ts +1 -1
  4. package/dist/Accordion.js +1 -1
  5. package/dist/Breadcrumb.d.ts +1 -1
  6. package/dist/Breadcrumb.js +1 -1
  7. package/dist/{Button-7370f901.d.ts → Button-3adfb3ed.d.ts} +2 -2
  8. package/dist/{Button-7370f901.d.ts.map → Button-3adfb3ed.d.ts.map} +1 -1
  9. package/dist/{Button-7370f901.js → Button-3adfb3ed.js} +1 -1
  10. package/dist/Button.d.ts +1 -1
  11. package/dist/Button.js +2 -2
  12. package/dist/ButtonGroup.d.ts +1 -1
  13. package/dist/ButtonGroup.js +1 -1
  14. package/dist/Checkbox.d.ts +1 -1
  15. package/dist/Checkbox.js +1 -1
  16. package/dist/CheckboxGroup.d.ts +3 -2
  17. package/dist/CheckboxGroup.d.ts.map +1 -1
  18. package/dist/CheckboxGroup.js +4 -3
  19. package/dist/Chip.d.ts +1 -1
  20. package/dist/Chip.js +1 -1
  21. package/dist/ChipGroup.d.ts +1 -1
  22. package/dist/ChipGroup.js +2 -2
  23. package/dist/ChipLink.js +1 -1
  24. package/dist/ChipRemovable.d.ts +7 -0
  25. package/dist/ChipRemovable.d.ts.map +1 -1
  26. package/dist/ChipRemovable.js +23 -3
  27. package/dist/ChipSelectable.d.ts +6 -0
  28. package/dist/ChipSelectable.d.ts.map +1 -1
  29. package/dist/ChipSelectable.js +12 -2
  30. package/dist/Dropdown.d.ts +1 -1
  31. package/dist/Dropdown.js +2 -2
  32. package/dist/Icon.d.ts +1 -1
  33. package/dist/Icon.js +1 -1
  34. package/dist/Input.d.ts +1 -1
  35. package/dist/Input.js +1 -1
  36. package/dist/{LeuElement-ba5ea33d.d.ts → LeuElement-a20c5fd6.d.ts} +1 -1
  37. package/dist/LeuElement-a20c5fd6.d.ts.map +1 -0
  38. package/dist/{LeuElement-ba5ea33d.js → LeuElement-a20c5fd6.js} +12 -9
  39. package/dist/Menu.d.ts +1 -1
  40. package/dist/Menu.js +1 -1
  41. package/dist/MenuItem.d.ts +1 -1
  42. package/dist/MenuItem.js +4 -4
  43. package/dist/Pagination.d.ts +1 -1
  44. package/dist/Pagination.js +2 -2
  45. package/dist/Popup.d.ts +1 -1
  46. package/dist/Popup.js +1 -1
  47. package/dist/Radio.d.ts +1 -1
  48. package/dist/Radio.js +1 -1
  49. package/dist/RadioGroup.d.ts +1 -1
  50. package/dist/RadioGroup.d.ts.map +1 -1
  51. package/dist/RadioGroup.js +4 -3
  52. package/dist/ScrollTop.d.ts +1 -1
  53. package/dist/ScrollTop.js +2 -2
  54. package/dist/Select.d.ts +1 -1
  55. package/dist/Select.js +2 -2
  56. package/dist/Table.d.ts +1 -1
  57. package/dist/Table.js +2 -2
  58. package/dist/VisuallyHidden.d.ts +1 -1
  59. package/dist/VisuallyHidden.js +1 -1
  60. package/dist/index.d.ts +1 -1
  61. package/dist/index.js +2 -2
  62. package/dist/leu-accordion.js +1 -1
  63. package/dist/leu-breadcrumb.js +1 -1
  64. package/dist/leu-button-group.js +1 -1
  65. package/dist/leu-button.d.ts +1 -1
  66. package/dist/leu-button.js +2 -2
  67. package/dist/leu-checkbox-group.js +1 -1
  68. package/dist/leu-checkbox.js +1 -1
  69. package/dist/leu-chip-group.js +1 -1
  70. package/dist/leu-chip-link.js +1 -1
  71. package/dist/leu-chip-removable.js +1 -1
  72. package/dist/leu-chip-selectable.js +1 -1
  73. package/dist/leu-dropdown.js +2 -2
  74. package/dist/leu-icon.js +1 -1
  75. package/dist/leu-input.js +1 -1
  76. package/dist/leu-menu-item.js +1 -1
  77. package/dist/leu-menu.js +1 -1
  78. package/dist/leu-pagination.js +2 -2
  79. package/dist/leu-popup.js +1 -1
  80. package/dist/leu-radio-group.js +1 -1
  81. package/dist/leu-radio.js +1 -1
  82. package/dist/leu-scroll-top.js +2 -2
  83. package/dist/leu-select.js +2 -2
  84. package/dist/leu-table.js +2 -2
  85. package/dist/leu-visually-hidden.js +1 -1
  86. package/dist/vscode.html-custom-data.json +15 -4
  87. package/dist/vue/index.d.ts +8 -0
  88. package/dist/web-types.json +30 -8
  89. package/package.json +2 -1
  90. package/rollup.config.js +9 -0
  91. package/src/components/checkbox/CheckboxGroup.js +3 -2
  92. package/src/components/checkbox/stories/checkbox-group.stories.js +3 -3
  93. package/src/components/chip/ChipGroup.js +1 -1
  94. package/src/components/chip/ChipRemovable.js +18 -0
  95. package/src/components/chip/ChipSelectable.js +13 -1
  96. package/src/components/chip/stories/chip-removable.stories.js +6 -2
  97. package/src/components/chip/test/chip-removable.test.js +36 -2
  98. package/src/components/chip/test/chip-selectable.test.js +11 -1
  99. package/src/components/menu/MenuItem.js +1 -1
  100. package/src/components/menu/menu-item.css +2 -2
  101. package/src/components/radio/RadioGroup.js +3 -2
  102. package/src/components/radio/stories/radio-group.stories.js +3 -3
  103. package/src/lib/LeuElement.js +19 -11
  104. package/dist/LeuElement-ba5ea33d.d.ts.map +0 -1
package/.eslintrc.json CHANGED
@@ -23,5 +23,8 @@
23
23
  "no-console": "off"
24
24
  }
25
25
  }
26
- ]
26
+ ],
27
+ "globals": {
28
+ "__LEU_VERSION__": "readonly"
29
+ }
27
30
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.0](https://github.com/statistikZH/leu/compare/v0.7.0...v0.8.0) (2024-07-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * **chip:** add getValue method that returns either the value or the text content of the chip ([78eb332](https://github.com/statistikZH/leu/commit/78eb332e6b0da18cfdff45cbd9f3e7cc9514b9ea))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **checkbox-group:** use lowercase values for orientation attribute ([da68c5e](https://github.com/statistikZH/leu/commit/da68c5e68683e8672712c1bd36134df2eabc4cfb))
14
+ * don't define dependencies in the constructor. add version variable for better comparison ([14eda96](https://github.com/statistikZH/leu/commit/14eda96dcbdcd86124a4e42a9a32d472b44416db))
15
+ * **menu-item:** apply correct active colors to match style guide and to be wcag compliant ([#211](https://github.com/statistikZH/leu/issues/211)) ([1f8e957](https://github.com/statistikZH/leu/commit/1f8e95749ae4faaf87fce29924ba5b35724f8e4d))
16
+ * **menu-item:** use textContent instead of innerText to avoid triggering a reflow ([78eb332](https://github.com/statistikZH/leu/commit/78eb332e6b0da18cfdff45cbd9f3e7cc9514b9ea))
17
+ * **radio-group:** use lowercase values for orientation attribute ([da68c5e](https://github.com/statistikZH/leu/commit/da68c5e68683e8672712c1bd36134df2eabc4cfb))
18
+
3
19
  ## [0.7.0](https://github.com/statistikZH/leu/compare/v0.6.0...v0.7.0) (2024-07-08)
4
20
 
5
21
 
@@ -28,5 +28,5 @@ export class LeuAccordion extends LeuElement {
28
28
  _handleToggleClick(): void;
29
29
  render(): import("lit-html").TemplateResult;
30
30
  }
31
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
31
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
32
32
  //# sourceMappingURL=Accordion.d.ts.map
package/dist/Accordion.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, nothing } from 'lit';
3
3
  import { html, unsafeStatic } from 'lit/static-html.js';
4
4
 
@@ -64,6 +64,6 @@ export class LeuBreadcrumb extends LeuElement {
64
64
  renderDropdown(): import("lit-html").TemplateResult<1> | typeof nothing;
65
65
  render(): import("lit-html").TemplateResult<1> | typeof nothing;
66
66
  }
67
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
67
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
68
68
  import { nothing } from 'lit';
69
69
  //# sourceMappingURL=Breadcrumb.d.ts.map
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, nothing, html } from 'lit';
3
3
  import { createRef, ref } from 'lit/directives/ref.js';
4
4
  import { classMap } from 'lit/directives/class-map.js';
@@ -77,7 +77,7 @@ declare class LeuButton extends LeuElement {
77
77
  declare const BUTTON_SIZES: string[];
78
78
  declare const BUTTON_TYPES: string[];
79
79
  declare const BUTTON_EXPANDED_OPTIONS: string[];
80
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
80
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
81
81
  import { nothing } from 'lit';
82
82
  export { BUTTON_VARIANTS as B, HasSlotController as H, LeuButton as L, BUTTON_SIZES as a, BUTTON_TYPES as b, BUTTON_EXPANDED_OPTIONS as c };
83
- //# sourceMappingURL=Button-7370f901.d.ts.map
83
+ //# sourceMappingURL=Button-3adfb3ed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button-7370f901.d.ts","sourceRoot":"","sources":["Button-7370f901.js"],"names":[],"mappings":";;;iCAaa,OAAO,KAAK,EAAE,kBAAkB;AAyW7C,wCAA0D;AAhX1D;;;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;AAmTD;;;;;GAKG;AACH;IAQI,WAAiB;IACjB,qBAAqB;IACrB,MADW,MAAM,CACI;IACrB,qBAAqB;IACrB,SADW,MAAM,CACO;IACxB,4CAA4C;IAC5C,MADW,QAAQ,GAAG,QAAQ,GAAG,OAAO,CACpB;IAEpB,qBAAqB;IACrB,eADW,MAAM,CACa;IAE9B,sBAAsB;IACtB,UADW,OAAO,CACG;IACrB,+EAA+E;IAC/E,OADW,OAAO,CACA;IAClB,sBAAsB;IACtB,QADW,OAAO,CACC;IACnB,wDAAwD;IACxD,UADW,OAAO,CACG;IAErB,gGAAgG;IAChG,OADW,OAAO,CACA;IAElB;;;OAGG;IACH,UAFU,CAAC,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAEf;IAE3B,6EAOC;IACD;;;MAaC;IACD,0BAEC;IACD,+CAiCC;CACF;AA7GD,qCAA0C;AAE1C,qCAAmD;AAEnD,gDAAkD;gCA5XI,0BAA0B;wBAC7C,KAAK"}
1
+ {"version":3,"file":"Button-3adfb3ed.d.ts","sourceRoot":"","sources":["Button-3adfb3ed.js"],"names":[],"mappings":";;;iCAaa,OAAO,KAAK,EAAE,kBAAkB;AAyW7C,wCAA0D;AAhX1D;;;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;AAmTD;;;;;GAKG;AACH;IAQI,WAAiB;IACjB,qBAAqB;IACrB,MADW,MAAM,CACI;IACrB,qBAAqB;IACrB,SADW,MAAM,CACO;IACxB,4CAA4C;IAC5C,MADW,QAAQ,GAAG,QAAQ,GAAG,OAAO,CACpB;IAEpB,qBAAqB;IACrB,eADW,MAAM,CACa;IAE9B,sBAAsB;IACtB,UADW,OAAO,CACG;IACrB,+EAA+E;IAC/E,OADW,OAAO,CACA;IAClB,sBAAsB;IACtB,QADW,OAAO,CACC;IACnB,wDAAwD;IACxD,UADW,OAAO,CACG;IAErB,gGAAgG;IAChG,OADW,OAAO,CACA;IAElB;;;OAGG;IACH,UAFU,CAAC,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAEf;IAE3B,6EAOC;IACD;;;MAaC;IACD,0BAEC;IACD,+CAiCC;CACF;AA7GD,qCAA0C;AAE1C,qCAAmD;AAEnD,gDAAkD;gCA5XI,0BAA0B;wBAC7C,KAAK"}
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html, nothing } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
package/dist/Button.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from "./Button-7370f901.js";
1
+ export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from "./Button-3adfb3ed.js";
2
2
  //# sourceMappingURL=Button.d.ts.map
package/dist/Button.js CHANGED
@@ -1,6 +1,6 @@
1
- import './LeuElement-ba5ea33d.js';
1
+ import './LeuElement-a20c5fd6.js';
2
2
  import 'lit';
3
3
  import 'lit/directives/class-map.js';
4
4
  import 'lit/directives/if-defined.js';
5
5
  import './Icon.js';
6
- export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from './Button-7370f901.js';
6
+ export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from './Button-3adfb3ed.js';
@@ -20,5 +20,5 @@ export class LeuButtonGroup extends LeuElement {
20
20
  _handleButtonClick(button: any): void;
21
21
  render(): import("lit-html").TemplateResult<1>;
22
22
  }
23
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
23
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
24
24
  //# sourceMappingURL=ButtonGroup.d.ts.map
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
 
4
4
  var css_248z = css`:host,
@@ -10,5 +10,5 @@ export class LeuCheckbox extends LeuElement {
10
10
  handleInput(event: any): void;
11
11
  render(): import("lit-html").TemplateResult<1>;
12
12
  }
13
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
13
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
14
14
  //# sourceMappingURL=Checkbox.d.ts.map
package/dist/Checkbox.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
  import { LeuIcon } from './Icon.js';
4
4
 
@@ -2,12 +2,13 @@
2
2
  * @tagname leu-checkbox-group
3
3
  */
4
4
  export class LeuCheckboxGroup extends LeuElement {
5
- orientation: string;
5
+ /** @type {"horizontal" | "vertical"} */
6
+ orientation: "horizontal" | "vertical";
6
7
  items: any[];
7
8
  get value(): any[];
8
9
  handleSlotChange(): void;
9
10
  handleItems(): void;
10
11
  render(): import("lit-html").TemplateResult<1>;
11
12
  }
12
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
13
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
13
14
  //# sourceMappingURL=CheckboxGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["CheckboxGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAGI,oBAA+B;IAC/B,aAAe;IAEjB,mBAEC;IACD,yBAEC;IACD,oBAEC;IACD,+CAWC;CACF;gCAnEqD,0BAA0B"}
1
+ {"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["CheckboxGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAGI,wCAAwC;IACxC,aADW,YAAY,GAAG,UAAU,CACL;IAC/B,aAAe;IAEjB,mBAEC;IACD,yBAEC;IACD,oBAEC;IACD,+CAWC;CACF;gCApEqD,0BAA0B"}
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
 
@@ -41,7 +41,8 @@ var css_248z = css`:host {
41
41
  class LeuCheckboxGroup extends LeuElement {
42
42
  constructor() {
43
43
  super();
44
- this.orientation = "HORIZONTAL";
44
+ /** @type {"horizontal" | "vertical"} */
45
+ this.orientation = "horizontal";
45
46
  this.items = [];
46
47
  }
47
48
  get value() {
@@ -56,7 +57,7 @@ class LeuCheckboxGroup extends LeuElement {
56
57
  render() {
57
58
  const fieldsetClasses = {
58
59
  fieldset: "true",
59
- "fieldset--vertical": this.orientation === "VERTICAL"
60
+ "fieldset--vertical": this.orientation === "vertical"
60
61
  };
61
62
  return html`
62
63
  <fieldset class=${classMap(fieldsetClasses)}>
package/dist/Chip.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export class LeuChipBase extends LeuElement {
2
2
  inverted: boolean;
3
3
  }
4
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
4
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
5
5
  //# sourceMappingURL=Chip.d.ts.map
package/dist/Chip.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css } from 'lit';
3
3
 
4
4
  var css_248z = css`:host,
@@ -32,5 +32,5 @@ export const SELECTION_MODES: Readonly<{
32
32
  multiple: "multiple";
33
33
  none: "none";
34
34
  }>;
35
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
35
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
36
36
  //# sourceMappingURL=ChipGroup.d.ts.map
package/dist/ChipGroup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { html, unsafeStatic } from 'lit/static-html.js';
3
3
  import { css } from 'lit';
4
4
 
@@ -83,7 +83,7 @@ class LeuChipGroup extends LeuElement {
83
83
  });
84
84
  }
85
85
  get value() {
86
- return this.items.filter(i => i.checked).map(i => i.value);
86
+ return this.items.filter(i => i.checked).map(i => i.getValue());
87
87
  }
88
88
 
89
89
  /**
package/dist/ChipLink.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty } from './LeuElement-a20c5fd6.js';
2
2
  import { html } from 'lit';
3
3
  import { LeuChipBase } from './Chip.js';
4
4
 
@@ -2,8 +2,15 @@
2
2
  * @slot - The content of the chip
3
3
  * @tagname leu-chip-removable
4
4
  * @fires remove - Dispatched when the user clicks on the chip
5
+ * @prop {string} value - The value of the chip.
5
6
  */
6
7
  export class LeuChipRemovable extends LeuChipBase {
8
+ value: string;
9
+ /**
10
+ * Returns the value of the chip. If `value` is not set, it will return the text content
11
+ * @returns {string}
12
+ */
13
+ getValue(): string;
7
14
  handleClick(): void;
8
15
  render(): import("lit-html").TemplateResult<1>;
9
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChipRemovable.d.ts","sourceRoot":"","sources":["ChipRemovable.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;IACE,oBAMC;IACD,+CAKC;CACF;4BAtB2B,WAAW"}
1
+ {"version":3,"file":"ChipRemovable.d.ts","sourceRoot":"","sources":["ChipRemovable.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH;IAGI,cAAe;IAGjB;;;OAGG;IACH,YAFa,MAAM,CAIlB;IACD,oBASC;IACD,+CAKC;CACF;4BAtC2B,WAAW"}
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty } from './LeuElement-a20c5fd6.js';
2
2
  import { html } from 'lit';
3
3
  import { LeuChipBase } from './Chip.js';
4
4
  import { LeuIcon } from './Icon.js';
@@ -7,12 +7,28 @@ import { LeuIcon } from './Icon.js';
7
7
  * @slot - The content of the chip
8
8
  * @tagname leu-chip-removable
9
9
  * @fires remove - Dispatched when the user clicks on the chip
10
+ * @prop {string} value - The value of the chip.
10
11
  */
11
12
  class LeuChipRemovable extends LeuChipBase {
13
+ constructor() {
14
+ super();
15
+ this.value = "";
16
+ }
17
+
18
+ /**
19
+ * Returns the value of the chip. If `value` is not set, it will return the text content
20
+ * @returns {string}
21
+ */
22
+ getValue() {
23
+ return this.value || this.textContent.trim();
24
+ }
12
25
  handleClick() {
13
26
  const customEvent = new CustomEvent("leu:remove", {
14
27
  bubbles: true,
15
- composed: true
28
+ composed: true,
29
+ detail: {
30
+ value: this.getValue()
31
+ }
16
32
  });
17
33
  this.dispatchEvent(customEvent);
18
34
  }
@@ -27,7 +43,11 @@ _defineProperty(LeuChipRemovable, "dependencies", {
27
43
  "leu-icon": LeuIcon
28
44
  });
29
45
  _defineProperty(LeuChipRemovable, "properties", {
30
- ...LeuChipBase.properties
46
+ ...LeuChipBase.properties,
47
+ value: {
48
+ type: String,
49
+ reflect: true
50
+ }
31
51
  });
32
52
 
33
53
  export { LeuChipRemovable };
@@ -17,7 +17,13 @@ export class LeuChipSelectable extends LeuChipBase {
17
17
  */
18
18
  variant: string;
19
19
  checked: boolean;
20
+ value: string;
20
21
  handleClick(): void;
22
+ /**
23
+ * Returns the value of the chip. If `value` is not set, it will return the text content
24
+ * @returns {string}
25
+ */
26
+ getValue(): string;
21
27
  render(): import("lit-html").TemplateResult<1>;
22
28
  }
23
29
  export namespace SIZES {
@@ -1 +1 @@
1
- {"version":3,"file":"ChipSelectable.d.ts","sourceRoot":"","sources":["ChipSelectable.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH;IAGI,aAAyB;IAEzB;;;;;OAKG;IACH,gBAA8B;IAC9B,iBAAoB;IAKtB,oBAiBC;IACD,+CAQC;CACF;;;;;;;;;4BAhE2B,WAAW"}
1
+ {"version":3,"file":"ChipSelectable.d.ts","sourceRoot":"","sources":["ChipSelectable.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH;IAGI,aAAyB;IAEzB;;;;;OAKG;IACH,gBAA8B;IAC9B,iBAAoB;IACpB,cAAe;IAKjB,oBAkBC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IACD,+CAQC;CACF;;;;;;;;;4BA1E2B,WAAW"}
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty } from './LeuElement-a20c5fd6.js';
2
2
  import { html } from 'lit';
3
3
  import { LeuChipBase } from './Chip.js';
4
4
 
@@ -33,6 +33,7 @@ class LeuChipSelectable extends LeuChipBase {
33
33
  */
34
34
  this.variant = VARIANTS.toggle;
35
35
  this.checked = false;
36
+ this.value = "";
36
37
  if (this.variant === VARIANTS.radio && this.size === SIZES.small) {
37
38
  console.warn("Small size has no effect on radio variant");
38
39
  }
@@ -48,13 +49,22 @@ class LeuChipSelectable extends LeuChipBase {
48
49
  this.checked = nextcheckedState;
49
50
  this.dispatchEvent(new CustomEvent("input", {
50
51
  detail: {
51
- checked: this.checked
52
+ checked: this.checked,
53
+ value: this.getValue()
52
54
  },
53
55
  bubbles: true,
54
56
  composed: true
55
57
  }));
56
58
  }
57
59
  }
60
+
61
+ /**
62
+ * Returns the value of the chip. If `value` is not set, it will return the text content
63
+ * @returns {string}
64
+ */
65
+ getValue() {
66
+ return this.value || this.textContent.trim();
67
+ }
58
68
  render() {
59
69
  return html`<button
60
70
  @click=${() => this.handleClick()}
@@ -15,5 +15,5 @@ export class LeuDropdown extends LeuElement {
15
15
  _getMenu(): any;
16
16
  render(): import("lit-html").TemplateResult<1>;
17
17
  }
18
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
18
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
19
19
  //# sourceMappingURL=Dropdown.d.ts.map
package/dist/Dropdown.js CHANGED
@@ -1,7 +1,7 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html, nothing } from 'lit';
3
3
  import { createRef, ref } from 'lit/directives/ref.js';
4
- import { H as HasSlotController, L as LeuButton } from './Button-7370f901.js';
4
+ import { H as HasSlotController, L as LeuButton } from './Button-3adfb3ed.js';
5
5
  import { LeuMenu } from './Menu.js';
6
6
  import { LeuMenuItem } from './MenuItem.js';
7
7
  import { LeuPopup } from './Popup.js';
package/dist/Icon.d.ts CHANGED
@@ -112,5 +112,5 @@ export class LeuIcon extends LeuElement {
112
112
  name: any | "";
113
113
  render(): import("lit-html").TemplateResult<1>;
114
114
  }
115
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
115
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
116
116
  //# sourceMappingURL=Icon.d.ts.map
package/dist/Icon.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html, svg } from 'lit';
3
3
 
4
4
  var css_248z = css`svg,
package/dist/Input.d.ts CHANGED
@@ -145,6 +145,6 @@ export const SIZES: Readonly<{
145
145
  SMALL: "small";
146
146
  REGULAR: "regular";
147
147
  }>;
148
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
148
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
149
149
  import { nothing } from 'lit';
150
150
  //# sourceMappingURL=Input.d.ts.map
package/dist/Input.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, nothing, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
@@ -4,4 +4,4 @@ declare class LeuElement extends LitElement {
4
4
  declare function _defineProperty(obj: any, key: any, value: any): any;
5
5
  import { LitElement } from 'lit';
6
6
  export { LeuElement as L, _defineProperty as _ };
7
- //# sourceMappingURL=LeuElement-ba5ea33d.d.ts.map
7
+ //# sourceMappingURL=LeuElement-a20c5fd6.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeuElement-a20c5fd6.d.ts","sourceRoot":"","sources":["LeuElement-a20c5fd6.js"],"names":[],"mappings":"AA+BA;IACE,8EAcC;CACF;AA7CD,sEAaC;2BAf0B,KAAK"}
@@ -31,19 +31,22 @@ function _toPropertyKey(arg) {
31
31
 
32
32
  class LeuElement extends LitElement {
33
33
  static define(name, constructor = this, options = {}) {
34
- if (!customElements.get(name)) {
34
+ Object.entries(this.dependencies).forEach(([n, c]) => c.define(n));
35
+ const currentlyRegisteredConstructor = customElements.get(name);
36
+ if (currentlyRegisteredConstructor === undefined) {
35
37
  customElements.define(name, constructor, options);
36
- } else {
37
- console.info(`${name} is already defined`);
38
+ return;
39
+ }
40
+ if (currentlyRegisteredConstructor !== constructor) {
41
+ console.warn(`The custom element with the name <${name}> is already registered with a different constructor. This can happen when the same element has been loaded from different modules (e.g. multiple CDN requests or bundles).`);
42
+ return;
43
+ }
44
+ if (currentlyRegisteredConstructor.version !== constructor.version) {
45
+ console.warn(`The custom element with the name <${name}> is already defined with the same constructor but a different version (${currentlyRegisteredConstructor.version}).`);
38
46
  }
39
- }
40
- constructor() {
41
- super();
42
- Object.entries(this.constructor.dependencies).forEach(([name, component]) => {
43
- this.constructor.define(name, component);
44
- });
45
47
  }
46
48
  }
49
+ _defineProperty(LeuElement, "version", "0.8.0");
47
50
  _defineProperty(LeuElement, "dependencies", {});
48
51
 
49
52
  export { LeuElement as L, _defineProperty as _ };
package/dist/Menu.d.ts CHANGED
@@ -25,6 +25,6 @@ export class LeuMenu extends LeuElement {
25
25
  updated(changedProperties: any): void;
26
26
  render(): import("lit-html").TemplateResult<1>;
27
27
  }
28
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
28
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
29
29
  import { LeuMenuItem } from './MenuItem.js';
30
30
  //# sourceMappingURL=Menu.d.ts.map
package/dist/Menu.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
  import { LeuMenuItem } from './MenuItem.js';
4
4
  import 'lit/directives/if-defined.js';
@@ -34,5 +34,5 @@ export class LeuMenuItem extends LeuElement {
34
34
  _renderButton(content: any): import("lit-html").TemplateResult<1>;
35
35
  render(): import("lit-html").TemplateResult<1>;
36
36
  }
37
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
37
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
38
38
  //# sourceMappingURL=MenuItem.d.ts.map
package/dist/MenuItem.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
  import { ifDefined } from 'lit/directives/if-defined.js';
4
4
  import { LeuIcon } from './Icon.js';
@@ -11,10 +11,10 @@ var css_248z = css`:host,
11
11
  :host {
12
12
  --background: var(--leu-color-black-0);
13
13
  --background-hover: var(--leu-color-black-10);
14
- --background-active: var(--leu-color-accent-blue);
14
+ --background-active: var(--leu-color-func-cyan);
15
15
  --background-disabled: var(--leu-color-black-black-0);
16
16
  --color: var(--leu-color-black-transp-60);
17
- --color-active: var(--leu-color-black-0);
17
+ --color-active: var(--leu-color-black-100);
18
18
  --color-disabled: var(--leu-color-black-transp-20);
19
19
  --font-regular: var(--leu-font-family-regular);
20
20
  --font-black: var(--leu-font-family-black);
@@ -137,7 +137,7 @@ class LeuMenuItem extends LeuElement {
137
137
  * @returns {string}
138
138
  */
139
139
  getValue() {
140
- return this.value || this.innerText;
140
+ return this.value || this.textContent.trim();
141
141
  }
142
142
  _getAria() {
143
143
  const commonAttributes = {
@@ -30,5 +30,5 @@ export class LeuPagination extends LeuElement {
30
30
  _handleKeyDown(event: any): void;
31
31
  render(): import("lit-html").TemplateResult<1>;
32
32
  }
33
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
33
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
34
34
  //# sourceMappingURL=Pagination.d.ts.map
@@ -1,7 +1,7 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
  import { live } from 'lit/directives/live.js';
4
- import { L as LeuButton } from './Button-7370f901.js';
4
+ import { L as LeuButton } from './Button-3adfb3ed.js';
5
5
  import { LeuVisuallyHidden } from './VisuallyHidden.js';
6
6
  import { LeuIcon } from './Icon.js';
7
7
  import 'lit/directives/class-map.js';
package/dist/Popup.d.ts CHANGED
@@ -32,5 +32,5 @@ export class LeuPopup extends LeuElement {
32
32
  handleAnchorChange(): void;
33
33
  render(): import("lit-html").TemplateResult<1>;
34
34
  }
35
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
35
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
36
36
  //# sourceMappingURL=Popup.d.ts.map
package/dist/Popup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
  import { autoUpdate, size, flip, shift, computePosition } from '@floating-ui/dom';
4
4
 
package/dist/Radio.d.ts CHANGED
@@ -10,5 +10,5 @@ export class LeuRadio extends LeuElement {
10
10
  handleInput(event: any): void;
11
11
  render(): import("lit-html").TemplateResult<1>;
12
12
  }
13
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
13
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
14
14
  //# sourceMappingURL=Radio.d.ts.map
package/dist/Radio.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
 
4
4
  var css_248z = css`:host {
@@ -16,5 +16,5 @@ export class LeuRadioGroup extends LeuElement {
16
16
  initializeIndex(): void;
17
17
  render(): import("lit-html").TemplateResult<1>;
18
18
  }
19
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
19
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
20
20
  //# sourceMappingURL=RadioGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["RadioGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAIM,sBAAiD;IA2BnD,oBAA+B;IAE/B,aAAe;IAEjB,iBAGC;IAUD,0BAaC;IACD,6BAMC;IACD,yBAEC;IACD,qCAIC;IACD,yDAaC;IACD,oBAQC;IACD,oBAIC;IACD,wBAIC;IACD,+CAWC;CACF;gCAlKqD,0BAA0B"}
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["RadioGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAKM,sBAAiD;IA2BnD,oBAA+B;IAE/B,aAAe;IAEjB,iBAGC;IAUD,0BAaC;IACD,6BAMC;IACD,yBAEC;IACD,qCAIC;IACD,yDAaC;IACD,oBAQC;IACD,oBAIC;IACD,wBAIC;IACD,+CAWC;CACF;gCAnKqD,0BAA0B"}
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.js';
2
2
  import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
 
@@ -41,6 +41,7 @@ var css_248z = css`:host {
41
41
  class LeuRadioGroup extends LeuElement {
42
42
  constructor() {
43
43
  super();
44
+ /** @type {"horizontal" | "vertical"} */
44
45
  _defineProperty(this, "handleFocusIn", e => {
45
46
  this._currentIndex = this.items.indexOf(e.target);
46
47
  });
@@ -69,7 +70,7 @@ class LeuRadioGroup extends LeuElement {
69
70
  item.checked = item === e.target; // eslint-disable-line no-param-reassign
70
71
  });
71
72
  });
72
- this.orientation = "HORIZONTAL";
73
+ this.orientation = "horizontal";
73
74
  this._currentIndex = 0;
74
75
  this.items = [];
75
76
  }
@@ -151,7 +152,7 @@ class LeuRadioGroup extends LeuElement {
151
152
  render() {
152
153
  const fieldsetClasses = {
153
154
  fieldset: "true",
154
- "fieldset--vertical": this.orientation === "VERTICAL"
155
+ "fieldset--vertical": this.orientation === "vertical"
155
156
  };
156
157
  return html`
157
158
  <fieldset class=${classMap(fieldsetClasses)}>
@@ -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-ba5ea33d.js';
18
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
19
19
  //# sourceMappingURL=ScrollTop.d.ts.map
package/dist/ScrollTop.js CHANGED
@@ -1,7 +1,7 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-ba5ea33d.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-a20c5fd6.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-7370f901.js';
4
+ import { L as LeuButton } from './Button-3adfb3ed.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';