@statistikzh/leu 0.6.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 (126) hide show
  1. package/.eslintrc.json +4 -1
  2. package/CHANGELOG.md +30 -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.d.ts.map +1 -1
  7. package/dist/Breadcrumb.js +3 -1
  8. package/dist/{Button-9692e403.d.ts → Button-3adfb3ed.d.ts} +2 -2
  9. package/dist/Button-3adfb3ed.d.ts.map +1 -0
  10. package/dist/{Button-9692e403.js → Button-3adfb3ed.js} +1 -1
  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.d.ts.map +1 -1
  15. package/dist/ButtonGroup.js +1 -1
  16. package/dist/Checkbox.d.ts +1 -1
  17. package/dist/Checkbox.d.ts.map +1 -1
  18. package/dist/Checkbox.js +3 -1
  19. package/dist/CheckboxGroup.d.ts +3 -2
  20. package/dist/CheckboxGroup.d.ts.map +1 -1
  21. package/dist/CheckboxGroup.js +6 -3
  22. package/dist/Chip.d.ts +1 -1
  23. package/dist/Chip.d.ts.map +1 -1
  24. package/dist/Chip.js +19 -17
  25. package/dist/ChipGroup.d.ts +8 -2
  26. package/dist/ChipGroup.d.ts.map +1 -1
  27. package/dist/ChipGroup.js +32 -5
  28. package/dist/ChipLink.js +1 -1
  29. package/dist/ChipRemovable.d.ts +7 -0
  30. package/dist/ChipRemovable.d.ts.map +1 -1
  31. package/dist/ChipRemovable.js +23 -3
  32. package/dist/ChipSelectable.d.ts +9 -1
  33. package/dist/ChipSelectable.d.ts.map +1 -1
  34. package/dist/ChipSelectable.js +23 -11
  35. package/dist/Dropdown.d.ts +1 -1
  36. package/dist/Dropdown.d.ts.map +1 -1
  37. package/dist/Dropdown.js +2 -2
  38. package/dist/Icon.d.ts +98 -2
  39. package/dist/Icon.d.ts.map +1 -1
  40. package/dist/Icon.js +1 -1
  41. package/dist/Input.d.ts +7 -2
  42. package/dist/Input.d.ts.map +1 -1
  43. package/dist/Input.js +16 -3
  44. package/dist/{LeuElement-6de6f209.d.ts → LeuElement-a20c5fd6.d.ts} +2 -2
  45. package/dist/LeuElement-a20c5fd6.d.ts.map +1 -0
  46. package/dist/LeuElement-a20c5fd6.js +52 -0
  47. package/dist/Menu.d.ts +2 -2
  48. package/dist/Menu.js +1 -1
  49. package/dist/MenuItem.d.ts +2 -2
  50. package/dist/MenuItem.js +4 -4
  51. package/dist/Pagination.d.ts +1 -1
  52. package/dist/Pagination.js +2 -2
  53. package/dist/Popup.d.ts +1 -1
  54. package/dist/Popup.d.ts.map +1 -1
  55. package/dist/Popup.js +3 -1
  56. package/dist/Radio.d.ts +1 -1
  57. package/dist/Radio.d.ts.map +1 -1
  58. package/dist/Radio.js +3 -1
  59. package/dist/RadioGroup.d.ts +1 -1
  60. package/dist/RadioGroup.d.ts.map +1 -1
  61. package/dist/RadioGroup.js +22 -10
  62. package/dist/ScrollTop.d.ts +1 -1
  63. package/dist/ScrollTop.js +2 -2
  64. package/dist/Select.d.ts +1 -1
  65. package/dist/Select.d.ts.map +1 -1
  66. package/dist/Select.js +4 -2
  67. package/dist/Table.d.ts +1 -1
  68. package/dist/Table.d.ts.map +1 -1
  69. package/dist/Table.js +4 -3
  70. package/dist/VisuallyHidden.d.ts +1 -1
  71. package/dist/VisuallyHidden.d.ts.map +1 -1
  72. package/dist/VisuallyHidden.js +5 -3
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.js +3 -3
  75. package/dist/leu-accordion.js +1 -1
  76. package/dist/leu-breadcrumb.js +1 -1
  77. package/dist/leu-button-group.js +1 -1
  78. package/dist/leu-button.d.ts +1 -1
  79. package/dist/leu-button.js +2 -2
  80. package/dist/leu-checkbox-group.js +1 -1
  81. package/dist/leu-checkbox.js +1 -1
  82. package/dist/leu-chip-group.js +1 -1
  83. package/dist/leu-chip-link.js +1 -1
  84. package/dist/leu-chip-removable.js +1 -1
  85. package/dist/leu-chip-selectable.js +1 -1
  86. package/dist/leu-dropdown.js +2 -2
  87. package/dist/leu-icon.js +1 -1
  88. package/dist/leu-input.js +1 -1
  89. package/dist/leu-menu-item.js +1 -1
  90. package/dist/leu-menu.js +1 -1
  91. package/dist/leu-pagination.js +2 -2
  92. package/dist/leu-popup.js +1 -1
  93. package/dist/leu-radio-group.js +1 -1
  94. package/dist/leu-radio.js +1 -1
  95. package/dist/leu-scroll-top.js +2 -2
  96. package/dist/leu-select.js +2 -2
  97. package/dist/leu-table.js +2 -2
  98. package/dist/leu-visually-hidden.js +1 -1
  99. package/dist/vscode.html-custom-data.json +32 -8
  100. package/dist/vue/index.d.ts +29 -9
  101. package/dist/web-types.json +236 -235
  102. package/package.json +4 -3
  103. package/rollup.config.js +9 -0
  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/chip/ChipGroup.js +28 -4
  107. package/src/components/chip/ChipRemovable.js +18 -0
  108. package/src/components/chip/ChipSelectable.js +24 -10
  109. package/src/components/chip/chip.css +16 -16
  110. package/src/components/chip/stories/chip-group.stories.js +6 -9
  111. package/src/components/chip/stories/chip-removable.stories.js +6 -2
  112. package/src/components/chip/stories/chip-selectable.stories.js +1 -1
  113. package/src/components/chip/test/chip-group.test.js +67 -0
  114. package/src/components/chip/test/chip-removable.test.js +36 -2
  115. package/src/components/chip/test/chip-selectable.test.js +18 -8
  116. package/src/components/input/Input.js +14 -1
  117. package/src/components/input/stories/input.stories.js +3 -3
  118. package/src/components/input/test/input.test.js +20 -0
  119. package/src/components/menu/MenuItem.js +1 -1
  120. package/src/components/menu/menu-item.css +2 -2
  121. package/src/components/radio/RadioGroup.js +15 -11
  122. package/src/components/radio/stories/radio-group.stories.js +3 -3
  123. package/src/lib/LeuElement.js +19 -11
  124. package/dist/Button-9692e403.d.ts.map +0 -1
  125. package/dist/LeuElement-6de6f209.d.ts.map +0 -1
  126. package/dist/LeuElement-6de6f209.js +0 -43
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,35 @@
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
+
19
+ ## [0.7.0](https://github.com/statistikZH/leu/compare/v0.6.0...v0.7.0) (2024-07-08)
20
+
21
+
22
+ ### Features
23
+
24
+ * **chip-group:** implement value setter ([dd1557a](https://github.com/statistikZH/leu/commit/dd1557ab1063ec7421a74057c489529b26e6d805))
25
+ * **input:** add inputAsNumber getter that matches the native inputs method with the same name ([552f1ff](https://github.com/statistikZH/leu/commit/552f1ff18680c6a2866c7813fe40c462ea834802))
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * **chip-group:** handle the chip children during the event capture phase ([552f1ff](https://github.com/statistikZH/leu/commit/552f1ff18680c6a2866c7813fe40c462ea834802))
31
+ * **radio-group:** handle the radio children during the event capture phase ([552f1ff](https://github.com/statistikZH/leu/commit/552f1ff18680c6a2866c7813fe40c462ea834802))
32
+
3
33
  ## [0.6.0](https://github.com/statistikZH/leu/compare/v0.5.1...v0.6.0) (2024-07-01)
4
34
 
5
35
 
@@ -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-6de6f209.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-6de6f209.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-6de6f209.js';
67
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
68
68
  import { nothing } from 'lit';
69
69
  //# sourceMappingURL=Breadcrumb.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["Breadcrumb.js"],"names":[],"mappings":"AAuHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IAOM,yBAA+C;IAO7C,uBAAyB;IACzB,0BAA6B;IAY7B,qBAAqB;IASvB,yBAA4C;IAW9C,aAAe;IACf,wDAAwD;IACxD,UADW,OAAO,CACG;IAErB,gBAAgB;IAChB,iEAAgC;IAehC,+BAEQ;IAEV,qBAEC;IACD,+CAOC;IAOD,gBAAgB;IAChB,sBAEC;IAED,gBAAgB;IAChB,4BAEC;IACD;;;;;OAKG;IACH,eAFa,IAAI,CA4BhB;IACD;;;OAGG;IACH,wEAqCC;IACD,gEAmCC;CACF;gCAzWqD,0BAA0B;wBAC7C,KAAK"}
1
+ {"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["Breadcrumb.js"],"names":[],"mappings":"AAyHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IAOM,yBAA+C;IAO7C,uBAAyB;IACzB,0BAA6B;IAY7B,qBAAqB;IASvB,yBAA4C;IAW9C,aAAe;IACf,wDAAwD;IACxD,UADW,OAAO,CACG;IAErB,gBAAgB;IAChB,iEAAgC;IAehC,+BAEQ;IAEV,qBAEC;IACD,+CAOC;IAOD,gBAAgB;IAChB,sBAEC;IAED,gBAAgB;IAChB,4BAEC;IACD;;;;;OAKG;IACH,eAFa,IAAI,CA4BhB;IACD;;;OAGG;IACH,wEAqCC;IACD,gEAmCC;CACF;gCA3WqD,0BAA0B;wBAC7C,KAAK"}
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.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';
@@ -20,6 +20,8 @@ var css_248z = css`:host,
20
20
  --breadcrumb-font-regular: var(--leu-font-family-regular);
21
21
  --breadcrumb-font-black: var(--leu-font-family-black);
22
22
 
23
+ font-family: var(--leu-font-family-regular);
24
+
23
25
  font-family: var(--breadcrumb-font-regular);
24
26
  line-height: 1.5;
25
27
  color: var(--leu-color-black-100);
@@ -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-6de6f209.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-9692e403.d.ts.map
83
+ //# sourceMappingURL=Button-3adfb3ed.d.ts.map
@@ -0,0 +1 @@
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-6de6f209.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-9692e403.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-6de6f209.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-9692e403.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-6de6f209.js';
23
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
24
24
  //# sourceMappingURL=ButtonGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["ButtonGroup.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH;IAME;;;OAGG;IACH,8BAHW,GAAoC,GAClC,MAAM,CAIlB;IATC,cAAgB;IAclB,4BAMC;IAVD,oBAGC;IAQD,0BA+BC;IAED;;OAEG;IACH,2BAFW,GAAoC,QAa9C;IACD,+CAMC;CACF;gCApGqD,0BAA0B"}
1
+ {"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["ButtonGroup.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH;IAME;;;OAGG;IACH,oCAFa,MAAM,CAIlB;IATC,cAAgB;IAclB,4BAMC;IAVD,oBAGC;IAQD,0BA+BC;IAED;;OAEG;IACH,sCAWC;IACD,+CAMC;CACF;gCApGqD,0BAA0B"}
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.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-6de6f209.js';
13
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
14
14
  //# sourceMappingURL=Checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["Checkbox.js"],"names":[],"mappings":"AA+FA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IACrB,aAAc;IACd,cAAe;IAEjB,+BAIC;IACD,8BAEC;IACD,+CAgBC;CACF;gCAnIqD,0BAA0B"}
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["Checkbox.js"],"names":[],"mappings":"AAiGA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IACrB,aAAc;IACd,cAAe;IAEjB,+BAIC;IACD,8BAEC;IACD,+CAgBC;CACF;gCArIqD,0BAA0B"}
package/dist/Checkbox.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.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
 
@@ -20,6 +20,8 @@ var css_248z = css`:host {
20
20
  align-items: flex-start;
21
21
  gap: 0.5rem;
22
22
 
23
+ font-family: var(--leu-font-family-regular);
24
+
23
25
  font-family: var(--checkbox-font-regular);
24
26
  }
25
27
 
@@ -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-6de6f209.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":"AAmCA;;GAEG;AACH;IAGI,oBAA+B;IAC/B,aAAe;IAEjB,mBAEC;IACD,yBAEC;IACD,oBAEC;IACD,+CAWC;CACF;gCAjEqD,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-6de6f209.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
 
@@ -6,6 +6,8 @@ var css_248z = css`:host {
6
6
  --group-font-regular: var(--leu-font-family-regular);
7
7
  --group-font-black: var(--leu-font-family-black);
8
8
 
9
+ font-family: var(--leu-font-family-regular);
10
+
9
11
  font-family: var(--group-font-regular);
10
12
  }
11
13
 
@@ -39,7 +41,8 @@ var css_248z = css`:host {
39
41
  class LeuCheckboxGroup extends LeuElement {
40
42
  constructor() {
41
43
  super();
42
- this.orientation = "HORIZONTAL";
44
+ /** @type {"horizontal" | "vertical"} */
45
+ this.orientation = "horizontal";
43
46
  this.items = [];
44
47
  }
45
48
  get value() {
@@ -54,7 +57,7 @@ class LeuCheckboxGroup extends LeuElement {
54
57
  render() {
55
58
  const fieldsetClasses = {
56
59
  fieldset: "true",
57
- "fieldset--vertical": this.orientation === "VERTICAL"
60
+ "fieldset--vertical": this.orientation === "vertical"
58
61
  };
59
62
  return html`
60
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-6de6f209.js';
4
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
5
5
  //# sourceMappingURL=Chip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["Chip.js"],"names":[],"mappings":"AAsJA;IAGI,kBAAqB;CAExB;gCA3JqD,0BAA0B"}
1
+ {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["Chip.js"],"names":[],"mappings":"AAwJA;IAGI,kBAAqB;CAExB;gCA7JqD,0BAA0B"}
package/dist/Chip.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.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,
@@ -11,17 +11,17 @@ var css_248z = css`:host,
11
11
  :host {
12
12
  --chip-background-color-default: var(--leu-color-black-transp-10);
13
13
  --chip-background-color-hover: var(--leu-color-black-transp-20);
14
- --chip-background-color-selected: var(--leu-color-black-100);
15
- --chip-background-color-selected-hover: var(--leu-color-black-transp-80);
14
+ --chip-background-color-checked: var(--leu-color-black-100);
15
+ --chip-background-color-checked-hover: var(--leu-color-black-transp-80);
16
16
 
17
17
  --chip-color-default: var(--leu-color-black-transp-60);
18
18
  --chip-color-hover: var(--leu-color-black-100);
19
- --chip-color-selected: var(--leu-color-black-0);
19
+ --chip-color-checked: var(--leu-color-black-0);
20
20
 
21
21
  --chip-radio-border-default: var(--leu-color-black-transp-40);
22
- --chip-radio-border-selected: var(--leu-color-black-0);
22
+ --chip-radio-border-checked: var(--leu-color-black-0);
23
23
  --chip-radio-background-default: var(--leu-color-black-0);
24
- --chip-radio-background-selected: var(--leu-color-func-cyan);
24
+ --chip-radio-background-checked: var(--leu-color-func-cyan);
25
25
 
26
26
  --chip-font-regular: var(--leu-font-family-regular);
27
27
  --chip-font-black: var(--leu-font-family-black);
@@ -33,6 +33,8 @@ var css_248z = css`:host,
33
33
 
34
34
  --leu-icon-size: 1rem;
35
35
 
36
+ font-family: var(--leu-font-family-regular);
37
+
36
38
  font-family: var(--chip-font-regular);
37
39
 
38
40
  /* Allow shrinking to achieve text truncation (ellipsis) */
@@ -45,14 +47,14 @@ var css_248z = css`:host,
45
47
 
46
48
  --chip-color-default: var(--leu-color-black-0);
47
49
  --chip-color-hover: var(--leu-color-black-0);
48
- --chip-color-selected: var(--leu-color-black-0);
50
+ --chip-color-checked: var(--leu-color-black-0);
49
51
  }
50
52
 
51
- :host([selected]) {
52
- --chip-background-color: var(--chip-background-color-selected);
53
- --chip-color: var(--chip-color-selected);
54
- --chip-radio-border: var(--chip-radio-border-selected);
55
- --chip-radio-background: var(--chip-radio-background-selected);
53
+ :host([checked]) {
54
+ --chip-background-color: var(--chip-background-color-checked);
55
+ --chip-color: var(--chip-color-checked);
56
+ --chip-radio-border: var(--chip-radio-border-checked);
57
+ --chip-radio-background: var(--chip-radio-background-checked);
56
58
  }
57
59
 
58
60
  .button {
@@ -101,10 +103,10 @@ var css_248z = css`:host,
101
103
  text-decoration: none;
102
104
  }
103
105
 
104
- :host([selected]) .button:hover,
105
- :host([selected]) .button:focus-visible {
106
- --chip-background-color: var(--chip-background-color-selected-hover);
107
- --chip-color: var(--chip-color-selected);
106
+ :host([checked]) .button:hover,
107
+ :host([checked]) .button:focus-visible {
108
+ --chip-background-color: var(--chip-background-color-checked-hover);
109
+ --chip-color: var(--chip-color-checked);
108
110
  }
109
111
 
110
112
  :host([href][size="large"]) .button {
@@ -132,7 +134,7 @@ var css_248z = css`:host,
132
134
  border-radius: 50%;
133
135
  }
134
136
 
135
- :host([variant="radio"][selected]) .button::before {
137
+ :host([variant="radio"][checked]) .button::before {
136
138
  border-width: 3px;
137
139
  }
138
140
 
@@ -10,7 +10,13 @@ export class LeuChipGroup extends LeuElement {
10
10
  label: string;
11
11
  /** @type {"single" | "multiple" | "none"} */
12
12
  selectionMode: "single" | "multiple" | "none";
13
- get value(): any[];
13
+ /**
14
+ * Checks the items with the given values.
15
+ * If the selectionMode is single, only the first item with the given value is checked.
16
+ * @param {string[]} valueList
17
+ */
18
+ set value(valueList: string[]);
19
+ get value(): string[];
14
20
  /**
15
21
  * Determines the heading tag of the accordion toggle.
16
22
  * The headingLevel shouldn't be used directly to render the heading tag
@@ -26,5 +32,5 @@ export const SELECTION_MODES: Readonly<{
26
32
  multiple: "multiple";
27
33
  none: "none";
28
34
  }>;
29
- import { L as LeuElement } from './LeuElement-6de6f209.js';
35
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
30
36
  //# sourceMappingURL=ChipGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipGroup.d.ts","sourceRoot":"","sources":["ChipGroup.js"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH;IAiBM,aAAkB;IAEpB,kBAAqB;IACrB,qBAAqB;IACrB,cAAe;IAKf,6CAA6C;IAC7C,eADW,QAAQ,GAAG,UAAU,GAAG,MAAM,CACA;IAU3C,mBAEC;IAED;;;;;;OAMG;IACH,yBAMC;IACD,4CAeC;CACF;AAlFD;;;;GAIG;gCA5BmD,0BAA0B"}
1
+ {"version":3,"file":"ChipGroup.d.ts","sourceRoot":"","sources":["ChipGroup.js"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH;IAiBM,aAAkB;IAEpB,kBAAqB;IACrB,qBAAqB;IACrB,cAAe;IAKf,6CAA6C;IAC7C,eADW,QAAQ,GAAG,UAAU,GAAG,MAAM,CACA;IA0B3C;;;;OAIG;IACH,+BAQC;IAjBD,sBAEC;IAiBD;;;;;;OAMG;IACH,yBAMC;IACD,4CAeC;CACF;AA7GD;;;;GAIG;gCA5BmD,0BAA0B"}
package/dist/ChipGroup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.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
 
@@ -40,7 +40,7 @@ class LeuChipGroup extends LeuElement {
40
40
  _defineProperty(this, "handleInput", e => {
41
41
  if (this.selectionMode === SELECTION_MODES.single) {
42
42
  this.items.forEach(item => {
43
- item.selected = item === e.target; // eslint-disable-line no-param-reassign
43
+ item.checked = item === e.target; // eslint-disable-line no-param-reassign
44
44
  });
45
45
  }
46
46
  });
@@ -64,14 +64,41 @@ class LeuChipGroup extends LeuElement {
64
64
  }
65
65
  connectedCallback() {
66
66
  super.connectedCallback();
67
- this.addEventListener("input", this.handleInput);
67
+
68
+ /**
69
+ * It is technically possible to add an event listener to the host element
70
+ * before it is connected to the dom. In that case the outside event listener would
71
+ * be called before the following event listener. But at this point multiple
72
+ * radio chips could be selected at the same time because `handleInput` hasn't been
73
+ * called yet. That's why we use the capture phase.
74
+ */
75
+ this.addEventListener("input", this.handleInput, {
76
+ capture: true
77
+ });
68
78
  }
69
79
  disconnectedCallback() {
70
80
  super.disconnectedCallback();
71
- this.removeEventListener("input", this.handleInput);
81
+ this.removeEventListener("input", this.handleInput, {
82
+ capture: true
83
+ });
72
84
  }
73
85
  get value() {
74
- return this.items.filter(i => i.selected).map(i => i.value);
86
+ return this.items.filter(i => i.checked).map(i => i.getValue());
87
+ }
88
+
89
+ /**
90
+ * Checks the items with the given values.
91
+ * If the selectionMode is single, only the first item with the given value is checked.
92
+ * @param {string[]} valueList
93
+ */
94
+ set value(valueList) {
95
+ let hasChanged = false;
96
+ for (const item of this.items) {
97
+ item.checked = hasChanged ? false : valueList.includes(item.value);
98
+ if (this.selectionMode === SELECTION_MODES.single && item.checked) {
99
+ hasChanged = true;
100
+ }
101
+ }
75
102
  }
76
103
 
77
104
  /**
package/dist/ChipLink.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty } from './LeuElement-6de6f209.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-6de6f209.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 };
@@ -4,6 +4,8 @@
4
4
  * @slot - The content of the chip
5
5
  * @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
6
6
  * @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
7
+ * @prop {boolean} checked - Whether the chip is selected.
8
+ * @prop {string} value - The value of the chip.
7
9
  */
8
10
  export class LeuChipSelectable extends LeuChipBase {
9
11
  size: string;
@@ -14,8 +16,14 @@ export class LeuChipSelectable extends LeuChipBase {
14
16
  * @default "toggle"
15
17
  */
16
18
  variant: string;
17
- selected: boolean;
19
+ checked: boolean;
20
+ value: string;
18
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;
19
27
  render(): import("lit-html").TemplateResult<1>;
20
28
  }
21
29
  export namespace SIZES {
@@ -1 +1 @@
1
- {"version":3,"file":"ChipSelectable.d.ts","sourceRoot":"","sources":["ChipSelectable.js"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH;IAGI,aAAyB;IAEzB;;;;;OAKG;IACH,gBAA8B;IAC9B,kBAAqB;IAKvB,oBAiBC;IACD,+CAQC;CACF;;;;;;;;;4BA9D2B,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-6de6f209.js';
1
+ import { _ as _defineProperty } from './LeuElement-a20c5fd6.js';
2
2
  import { html } from 'lit';
3
3
  import { LeuChipBase } from './Chip.js';
4
4
 
@@ -17,6 +17,8 @@ const VARIANTS = {
17
17
  * @slot - The content of the chip
18
18
  * @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
19
19
  * @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
20
+ * @prop {boolean} checked - Whether the chip is selected.
21
+ * @prop {string} value - The value of the chip.
20
22
  */
21
23
  class LeuChipSelectable extends LeuChipBase {
22
24
  constructor() {
@@ -30,34 +32,44 @@ class LeuChipSelectable extends LeuChipBase {
30
32
  * @default "toggle"
31
33
  */
32
34
  this.variant = VARIANTS.toggle;
33
- this.selected = false;
35
+ this.checked = false;
36
+ this.value = "";
34
37
  if (this.variant === VARIANTS.radio && this.size === SIZES.small) {
35
38
  console.warn("Small size has no effect on radio variant");
36
39
  }
37
40
  }
38
41
  handleClick() {
39
- let nextSelectedState = this.selected;
42
+ let nextcheckedState = this.checked;
40
43
  if (this.variant === VARIANTS.radio) {
41
- nextSelectedState = true;
44
+ nextcheckedState = true;
42
45
  } else {
43
- nextSelectedState = !this.selected;
46
+ nextcheckedState = !this.checked;
44
47
  }
45
- if (nextSelectedState !== this.selected) {
46
- this.selected = nextSelectedState;
48
+ if (nextcheckedState !== this.checked) {
49
+ this.checked = nextcheckedState;
47
50
  this.dispatchEvent(new CustomEvent("input", {
48
51
  detail: {
49
- selected: this.selected
52
+ checked: this.checked,
53
+ value: this.getValue()
50
54
  },
51
55
  bubbles: true,
52
56
  composed: true
53
57
  }));
54
58
  }
55
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
+ }
56
68
  render() {
57
69
  return html`<button
58
- @click=${e => this.handleClick(e)}
70
+ @click=${() => this.handleClick()}
59
71
  class="button"
60
- aria-pressed=${this.selected ? "true" : "false"}
72
+ aria-pressed=${this.checked ? "true" : "false"}
61
73
  >
62
74
  <span class="label"><slot></slot></span>
63
75
  </button>`;
@@ -73,7 +85,7 @@ _defineProperty(LeuChipSelectable, "properties", {
73
85
  type: String,
74
86
  reflect: true
75
87
  },
76
- selected: {
88
+ checked: {
77
89
  type: Boolean,
78
90
  reflect: true
79
91
  },
@@ -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-6de6f209.js';
18
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
19
19
  //# sourceMappingURL=Dropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["Dropdown.js"],"names":[],"mappings":"AAkCA;;GAEG;AACH;IAMQ,kBAAqB;IAqBzB,cAAe;IAGf,kEAAkE;IAClE,YADW,OAAO,oBAAoB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CACjC;IAkB/B,gCAIC;IACD,iDAYC;IACD,2BAEC;IAED;;OAEG;IACH,YAFa,GAA8B,CAI1C;IACD,+CA6BC;CACF;gCAhJqD,0BAA0B"}
1
+ {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["Dropdown.js"],"names":[],"mappings":"AAkCA;;GAEG;AACH;IAMQ,kBAAqB;IAqBzB,cAAe;IAGf,kEAAkE;IAClE,YADW,OAAO,oBAAoB,EAAE,GAAG,CAAC,iBAAiB,CAAC,CACjC;IAkB/B,gCAIC;IACD,iDAYC;IACD,2BAEC;IAED;;OAEG;IACH,gBAEC;IACD,+CA6BC;CACF;gCAhJqD,0BAA0B"}
package/dist/Dropdown.js CHANGED
@@ -1,7 +1,7 @@
1
- import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.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-9692e403.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';