@statistikzh/leu 0.7.0 → 0.9.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 (132) hide show
  1. package/.eslintrc.json +4 -1
  2. package/.github/workflows/release-please.yml +3 -3
  3. package/CHANGELOG.md +35 -0
  4. package/dist/Accordion.d.ts +1 -1
  5. package/dist/Accordion.js +1 -1
  6. package/dist/Breadcrumb.d.ts +1 -1
  7. package/dist/Breadcrumb.js +1 -1
  8. package/dist/{Button-7370f901.d.ts → Button-5a8009c5.d.ts} +2 -2
  9. package/dist/{Button-7370f901.d.ts.map → Button-5a8009c5.d.ts.map} +1 -1
  10. package/dist/{Button-7370f901.js → Button-5a8009c5.js} +3 -4
  11. package/dist/Button.d.ts +1 -1
  12. package/dist/Button.js +2 -2
  13. package/dist/ButtonGroup.d.ts +1 -1
  14. package/dist/ButtonGroup.js +1 -1
  15. package/dist/Checkbox.d.ts +1 -1
  16. package/dist/Checkbox.js +2 -2
  17. package/dist/CheckboxGroup.d.ts +3 -2
  18. package/dist/CheckboxGroup.d.ts.map +1 -1
  19. package/dist/CheckboxGroup.js +4 -3
  20. package/dist/Chip.d.ts +1 -1
  21. package/dist/Chip.js +1 -1
  22. package/dist/ChipGroup.d.ts +1 -1
  23. package/dist/ChipGroup.js +2 -2
  24. package/dist/ChipLink.js +1 -1
  25. package/dist/ChipRemovable.d.ts +7 -0
  26. package/dist/ChipRemovable.d.ts.map +1 -1
  27. package/dist/ChipRemovable.js +23 -3
  28. package/dist/ChipSelectable.d.ts +6 -0
  29. package/dist/ChipSelectable.d.ts.map +1 -1
  30. package/dist/ChipSelectable.js +12 -2
  31. package/dist/Dropdown.d.ts +1 -1
  32. package/dist/Dropdown.js +3 -3
  33. package/dist/Icon.d.ts +1 -1
  34. package/dist/Icon.js +1 -1
  35. package/dist/Input.d.ts +1 -1
  36. package/dist/Input.js +1 -1
  37. package/dist/{LeuElement-ba5ea33d.d.ts → LeuElement-7ab5ef5e.d.ts} +1 -1
  38. package/dist/LeuElement-7ab5ef5e.d.ts.map +1 -0
  39. package/dist/{LeuElement-ba5ea33d.js → LeuElement-7ab5ef5e.js} +12 -9
  40. package/dist/Menu.d.ts +1 -1
  41. package/dist/Menu.js +1 -1
  42. package/dist/MenuItem.d.ts +5 -1
  43. package/dist/MenuItem.d.ts.map +1 -1
  44. package/dist/MenuItem.js +21 -6
  45. package/dist/Pagination.d.ts +1 -1
  46. package/dist/Pagination.js +2 -2
  47. package/dist/Popup.d.ts +1 -1
  48. package/dist/Popup.js +1 -1
  49. package/dist/Radio.d.ts +1 -1
  50. package/dist/Radio.js +2 -2
  51. package/dist/RadioGroup.d.ts +1 -1
  52. package/dist/RadioGroup.d.ts.map +1 -1
  53. package/dist/RadioGroup.js +4 -3
  54. package/dist/ScrollTop.d.ts +1 -1
  55. package/dist/ScrollTop.js +2 -2
  56. package/dist/Select.d.ts +1 -1
  57. package/dist/Select.d.ts.map +1 -1
  58. package/dist/Select.js +9 -5
  59. package/dist/Spinner.d.ts +9 -0
  60. package/dist/Spinner.d.ts.map +1 -0
  61. package/dist/Spinner.js +53 -0
  62. package/dist/Table.d.ts +1 -1
  63. package/dist/Table.js +2 -2
  64. package/dist/VisuallyHidden.d.ts +1 -1
  65. package/dist/VisuallyHidden.js +1 -1
  66. package/dist/index.d.ts +1 -1
  67. package/dist/index.js +2 -2
  68. package/dist/leu-accordion.js +1 -1
  69. package/dist/leu-breadcrumb.js +1 -1
  70. package/dist/leu-button-group.js +1 -1
  71. package/dist/leu-button.d.ts +1 -1
  72. package/dist/leu-button.js +2 -2
  73. package/dist/leu-checkbox-group.js +1 -1
  74. package/dist/leu-checkbox.js +1 -1
  75. package/dist/leu-chip-group.js +1 -1
  76. package/dist/leu-chip-link.js +1 -1
  77. package/dist/leu-chip-removable.js +1 -1
  78. package/dist/leu-chip-selectable.js +1 -1
  79. package/dist/leu-dropdown.js +2 -2
  80. package/dist/leu-icon.js +1 -1
  81. package/dist/leu-input.js +1 -1
  82. package/dist/leu-menu-item.js +1 -1
  83. package/dist/leu-menu.js +1 -1
  84. package/dist/leu-pagination.js +2 -2
  85. package/dist/leu-popup.js +1 -1
  86. package/dist/leu-radio-group.js +1 -1
  87. package/dist/leu-radio.js +1 -1
  88. package/dist/leu-scroll-top.js +2 -2
  89. package/dist/leu-select.js +2 -2
  90. package/dist/leu-spinner.d.ts +3 -0
  91. package/dist/leu-spinner.d.ts.map +1 -0
  92. package/dist/leu-spinner.js +7 -0
  93. package/dist/leu-table.js +2 -2
  94. package/dist/leu-visually-hidden.js +1 -1
  95. package/dist/theme.css +52 -25
  96. package/dist/vscode.html-custom-data.json +31 -4
  97. package/dist/vue/index.d.ts +23 -0
  98. package/dist/web-types.json +48 -8
  99. package/package.json +2 -1
  100. package/rollup.config.js +9 -0
  101. package/scripts/generate-component/templates/[namespace]-[name].js +1 -2
  102. package/src/components/button/button.css +2 -3
  103. package/src/components/checkbox/Checkbox.js +1 -1
  104. package/src/components/checkbox/CheckboxGroup.js +3 -2
  105. package/src/components/checkbox/stories/checkbox-group.stories.js +3 -3
  106. package/src/components/checkbox/stories/checkbox.stories.js +7 -2
  107. package/src/components/chip/ChipGroup.js +1 -1
  108. package/src/components/chip/ChipRemovable.js +18 -0
  109. package/src/components/chip/ChipSelectable.js +13 -1
  110. package/src/components/chip/stories/chip-removable.stories.js +6 -2
  111. package/src/components/chip/test/chip-removable.test.js +36 -2
  112. package/src/components/chip/test/chip-selectable.test.js +11 -1
  113. package/src/components/dropdown/Dropdown.js +1 -1
  114. package/src/components/dropdown/test/dropdown.test.js +20 -3
  115. package/src/components/menu/MenuItem.js +22 -3
  116. package/src/components/menu/menu-item.css +2 -2
  117. package/src/components/menu/stories/menu-item.stories.js +18 -8
  118. package/src/components/menu/test/menu-item.test.js +23 -0
  119. package/src/components/radio/Radio.js +1 -1
  120. package/src/components/radio/RadioGroup.js +3 -2
  121. package/src/components/radio/stories/radio-group.stories.js +3 -3
  122. package/src/components/radio/stories/radio.stories.js +7 -1
  123. package/src/components/select/Select.js +8 -6
  124. package/src/components/select/test/select.test.js +30 -0
  125. package/src/components/spinner/Spinner.js +31 -0
  126. package/src/components/spinner/leu-spinner.js +5 -0
  127. package/src/components/spinner/spinner.css +20 -0
  128. package/src/components/spinner/stories/spinner.stories.js +29 -0
  129. package/src/components/spinner/test/spinner.test.js +30 -0
  130. package/src/lib/LeuElement.js +19 -11
  131. package/src/styles/custom-properties.css +8 -3
  132. 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
  }
@@ -13,17 +13,17 @@ jobs:
13
13
  release-please:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
- - uses: google-github-actions/release-please-action@v3
16
+ - uses: google-github-actions/release-please-action@v4
17
17
  id: release
18
18
  with:
19
19
  release-type: node
20
- package-name: "@statistikzh/leu"
20
+ token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
21
21
  # The logic below handles the npm publication:
22
22
  - uses: actions/checkout@v4
23
23
  # these if statements ensure that a publication only occurs when
24
24
  # a new release is created:
25
25
  if: ${{ steps.release.outputs.release_created }}
26
- - uses: actions/setup-node@v3
26
+ - uses: actions/setup-node@v4
27
27
  with:
28
28
  node-version: "20.x"
29
29
  registry-url: "https://registry.npmjs.org"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.0](https://github.com/statistikZH/leu/compare/v0.8.0...v0.9.0) (2024-07-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * **menu-item:** add multipleSelection property to display a check icon ([#227](https://github.com/statistikZH/leu/issues/227)) ([02358cc](https://github.com/statistikZH/leu/commit/02358ccf5de5cb714adefc8de90d8f799dc58692))
9
+ * **spinner:** implement spinner animation element ([ba6257e](https://github.com/statistikZH/leu/commit/ba6257e6f46c021767f90384eaac19e203517b0d))
10
+ * **theme:** add :host pseudo class so that the theme can be used in a shadow root ([#221](https://github.com/statistikZH/leu/issues/221)) ([66e4676](https://github.com/statistikZH/leu/commit/66e4676be80ac79a137452d1f57d51394d3f4146))
11
+ * use new zh web typeface inter ([#224](https://github.com/statistikZH/leu/issues/224)) ([820deca](https://github.com/statistikZH/leu/commit/820deca357889fa11ac145ae0f203e2137c97a15))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **button:** remove border to match sizes of the design system ([#223](https://github.com/statistikZH/leu/issues/223)) ([9fa2cbb](https://github.com/statistikZH/leu/commit/9fa2cbbf919e02f71a150b974bc97563a75048c0))
17
+ * **checkbox:** avoid 'undefined' values and fallback to an empty string ([2f9f95f](https://github.com/statistikZH/leu/commit/2f9f95f50b56469a5ade01d4b5f5816a858028e3))
18
+ * **dropdown:** properly handle the document click events when the element is used in a shadow dom ([0c6c5a9](https://github.com/statistikZH/leu/commit/0c6c5a915b136f8fdbad300f719bb852d09fe220))
19
+ * **radio:** avoid 'undefined' values and fallback to an empty string ([2f9f95f](https://github.com/statistikZH/leu/commit/2f9f95f50b56469a5ade01d4b5f5816a858028e3))
20
+ * **select:** properly handle the document click events when the element is used in a shadow dom ([0c6c5a9](https://github.com/statistikZH/leu/commit/0c6c5a915b136f8fdbad300f719bb852d09fe220))
21
+
22
+ ## [0.8.0](https://github.com/statistikZH/leu/compare/v0.7.0...v0.8.0) (2024-07-16)
23
+
24
+
25
+ ### Features
26
+
27
+ * **chip:** add getValue method that returns either the value or the text content of the chip ([78eb332](https://github.com/statistikZH/leu/commit/78eb332e6b0da18cfdff45cbd9f3e7cc9514b9ea))
28
+
29
+
30
+ ### Bug Fixes
31
+
32
+ * **checkbox-group:** use lowercase values for orientation attribute ([da68c5e](https://github.com/statistikZH/leu/commit/da68c5e68683e8672712c1bd36134df2eabc4cfb))
33
+ * don't define dependencies in the constructor. add version variable for better comparison ([14eda96](https://github.com/statistikZH/leu/commit/14eda96dcbdcd86124a4e42a9a32d472b44416db))
34
+ * **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))
35
+ * **menu-item:** use textContent instead of innerText to avoid triggering a reflow ([78eb332](https://github.com/statistikZH/leu/commit/78eb332e6b0da18cfdff45cbd9f3e7cc9514b9ea))
36
+ * **radio-group:** use lowercase values for orientation attribute ([da68c5e](https://github.com/statistikZH/leu/commit/da68c5e68683e8672712c1bd36134df2eabc4cfb))
37
+
3
38
  ## [0.7.0](https://github.com/statistikZH/leu/compare/v0.6.0...v0.7.0) (2024-07-08)
4
39
 
5
40
 
@@ -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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-5a8009c5.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-5a8009c5.d.ts","sourceRoot":"","sources":["Button-5a8009c5.js"],"names":[],"mappings":";;;iCAaa,OAAO,KAAK,EAAE,kBAAkB;AAwW7C,wCAA0D;AA/W1D;;;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;AAkTD;;;;;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;gCA3XI,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-7ab5ef5e.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';
@@ -100,7 +100,7 @@ button {
100
100
  appearance: none;
101
101
  transition: background 0.1s ease;
102
102
  cursor: pointer;
103
- border: 1px solid transparent;
103
+ border: none;
104
104
  border-radius: 2px;
105
105
 
106
106
  max-width: 100%;
@@ -126,12 +126,11 @@ button:disabled {
126
126
  }
127
127
 
128
128
  button:focus-visible {
129
- border: 1px solid var(--leu-color-black-0);
130
129
  outline: 2px solid var(--leu-color-func-cyan);
130
+ outline-offset: 2px;
131
131
  }
132
132
 
133
133
  button.inverted:focus-visible {
134
- border: 1px solid var(--leu-color-black-100);
135
134
  outline: 2px solid var(--leu-color-black-0);
136
135
  }
137
136
 
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-5a8009c5.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-7ab5ef5e.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-5a8009c5.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.js';
2
2
  import { css, html } from 'lit';
3
3
  import { LeuIcon } from './Icon.js';
4
4
 
@@ -125,7 +125,7 @@ class LeuCheckbox extends LeuElement {
125
125
  @input=${this.handleInput}
126
126
  .checked=${this.checked}
127
127
  ?disabled=${this.disabled}
128
- .value=${this.value}
128
+ .value=${this.value ?? ""}
129
129
  />
130
130
  <label for=${`checkbox-${this.name}`} class="label"><slot></slot></label>
131
131
  <leu-icon class="icon" name="check"></leu-icon>
@@ -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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-5a8009c5.js';
5
5
  import { LeuMenu } from './Menu.js';
6
6
  import { LeuMenuItem } from './MenuItem.js';
7
7
  import { LeuPopup } from './Popup.js';
@@ -40,7 +40,7 @@ class LeuDropdown extends LeuElement {
40
40
  super();
41
41
  _defineProperty(this, "hasSlotController", new HasSlotController(this, ["icon"]));
42
42
  _defineProperty(this, "_documentClickHandler", event => {
43
- if (!this.contains(event.target)) {
43
+ if (!event.composedPath().includes(this)) {
44
44
  this.expanded = false;
45
45
  }
46
46
  });
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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.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-7ab5ef5e.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeuElement-7ab5ef5e.d.ts","sourceRoot":"","sources":["LeuElement-7ab5ef5e.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.9.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-7ab5ef5e.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-7ab5ef5e.js';
2
2
  import { css, html } from 'lit';
3
3
  import { LeuMenuItem } from './MenuItem.js';
4
4
  import 'lit/directives/if-defined.js';
@@ -6,6 +6,7 @@ export type MenuItemRole = 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | '
6
6
  * @tagname leu-menu-item
7
7
  * @slot - The label of the menu item
8
8
  * @property {boolean} active - Defines if the item is selected or checked
9
+ * @property {boolean} multipleSelection - If the item is part of a multiple selection. Renders a checkmark before the label when active
9
10
  * @property {boolean} disabled - Disables the underlying button or link
10
11
  * @property {string} value - The value of the item. It must not contain commas. See `getValue()`
11
12
  * @property {string} href - The href of the underlying link
@@ -15,6 +16,7 @@ export type MenuItemRole = 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | '
15
16
  export class LeuMenuItem extends LeuElement {
16
17
  active: boolean;
17
18
  disabled: boolean;
19
+ multipleSelection: boolean;
18
20
  value: any;
19
21
  href: any;
20
22
  tabbable: any;
@@ -32,7 +34,9 @@ export class LeuMenuItem extends LeuElement {
32
34
  _getTabIndex(): 0 | -1;
33
35
  _renderLink(content: any): import("lit-html").TemplateResult<1>;
34
36
  _renderButton(content: any): import("lit-html").TemplateResult<1>;
37
+ _renderBeforeSlotDefault(): import("lit-html").TemplateResult<1> | typeof nothing;
35
38
  render(): import("lit-html").TemplateResult<1>;
36
39
  }
37
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
40
+ import { L as LeuElement } from './LeuElement-7ab5ef5e.js';
41
+ import { nothing } from 'lit';
38
42
  //# sourceMappingURL=MenuItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["MenuItem.js"],"names":[],"mappings":"2BA8Fa,UAAU,GAAG,kBAAkB,GAAG,eAAe,GAAG,QAAQ,GAAG,MAAM;AADlF;;GAEG;AAEH;;;;;;;;;GASG;AACH;IAGI,gBAAmB;IACnB,kBAAqB;IACrB,WAAsB;IACtB,UAAqB;IACrB,cAAyB;IAEzB,2BAA2B;IAC3B,eADW,YAAY,CACQ;IAUjC,+BAKC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IACD;;MAaC;IACD,uBAKC;IACD,gEAYC;IACD,kEAYC;IACD,+CAOC;CACF;gCAnMqD,0BAA0B"}
1
+ {"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["MenuItem.js"],"names":[],"mappings":"2BA8Fa,UAAU,GAAG,kBAAkB,GAAG,eAAe,GAAG,QAAQ,GAAG,MAAM;AADlF;;GAEG;AAEH;;;;;;;;;;GAUG;AACH;IAGI,gBAAmB;IACnB,kBAAqB;IACrB,2BAA8B;IAC9B,WAAsB;IACtB,UAAqB;IACrB,cAAyB;IAEzB,2BAA2B;IAC3B,eADW,YAAY,CACQ;IAUjC,+BAKC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IACD;;MAaC;IACD,uBAKC;IACD,gEAYC;IACD,kEAYC;IACD,kFAKC;IACD,+CASC;CACF;gCA7MqD,0BAA0B;wBAC7C,KAAK"}