@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/dist/Select.d.ts CHANGED
@@ -131,6 +131,6 @@ export class LeuSelect extends LeuElement {
131
131
  _renderToggleButton(): import("lit-html").TemplateResult<1>;
132
132
  render(): import("lit-html").TemplateResult<1>;
133
133
  }
134
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
134
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
135
135
  import { nothing } from 'lit';
136
136
  //# sourceMappingURL=Select.d.ts.map
package/dist/Select.js CHANGED
@@ -1,9 +1,9 @@
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 { createRef, ref } from 'lit/directives/ref.js';
5
5
  import { ifDefined } from 'lit/directives/if-defined.js';
6
- import { H as HasSlotController, L as LeuButton } from './Button-7370f901.js';
6
+ import { H as HasSlotController, L as LeuButton } from './Button-3adfb3ed.js';
7
7
  import { LeuMenu } from './Menu.js';
8
8
  import { LeuMenuItem } from './MenuItem.js';
9
9
  import { LeuIcon } from './Icon.js';
package/dist/Table.d.ts CHANGED
@@ -40,5 +40,5 @@ export class LeuTable extends LeuElement {
40
40
  get _data(): any[];
41
41
  render(): import("lit-html").TemplateResult<1>;
42
42
  }
43
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
43
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
44
44
  //# sourceMappingURL=Table.d.ts.map
package/dist/Table.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, nothing } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import { styleMap } from 'lit/directives/style-map.js';
@@ -6,7 +6,7 @@ import { createRef, ref } from 'lit/directives/ref.js';
6
6
  import { LeuIcon } from './Icon.js';
7
7
  import { LeuPagination } from './Pagination.js';
8
8
  import 'lit/directives/live.js';
9
- import './Button-7370f901.js';
9
+ import './Button-3adfb3ed.js';
10
10
  import 'lit/directives/if-defined.js';
11
11
  import './VisuallyHidden.js';
12
12
 
@@ -4,5 +4,5 @@
4
4
  export class LeuVisuallyHidden extends LeuElement {
5
5
  render(): import("lit-html").TemplateResult<1>;
6
6
  }
7
- import { L as LeuElement } from './LeuElement-ba5ea33d.js';
7
+ import { L as LeuElement } from './LeuElement-a20c5fd6.js';
8
8
  //# sourceMappingURL=VisuallyHidden.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 {
package/dist/index.d.ts CHANGED
@@ -16,6 +16,6 @@ export { LeuRadio } from "./Radio.js";
16
16
  export { LeuRadioGroup } from "./RadioGroup.js";
17
17
  export { LeuSelect } from "./Select.js";
18
18
  export { LeuTable } from "./Table.js";
19
- export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from "./Button-7370f901.js";
19
+ export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from "./Button-3adfb3ed.js";
20
20
  export { LeuInput, SIZES } from "./Input.js";
21
21
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { LeuAccordion } from './Accordion.js';
2
2
  export { LeuBreadcrumb } from './Breadcrumb.js';
3
- export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from './Button-7370f901.js';
3
+ export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from './Button-3adfb3ed.js';
4
4
  export { LeuButtonGroup } from './ButtonGroup.js';
5
5
  export { LeuCheckbox } from './Checkbox.js';
6
6
  export { LeuCheckboxGroup } from './CheckboxGroup.js';
@@ -18,7 +18,7 @@ export { LeuRadio } from './Radio.js';
18
18
  export { LeuRadioGroup } from './RadioGroup.js';
19
19
  export { LeuSelect } from './Select.js';
20
20
  export { LeuTable } from './Table.js';
21
- import './LeuElement-ba5ea33d.js';
21
+ import './LeuElement-a20c5fd6.js';
22
22
  import 'lit';
23
23
  import 'lit/static-html.js';
24
24
  import 'lit/directives/ref.js';
@@ -1,5 +1,5 @@
1
1
  import { LeuAccordion } from './Accordion.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/static-html.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { LeuBreadcrumb } from './Breadcrumb.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/ref.js';
5
5
  import 'lit/directives/class-map.js';
@@ -1,5 +1,5 @@
1
1
  import { LeuButtonGroup } from './ButtonGroup.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
 
5
5
  LeuButtonGroup.define("leu-button-group");
@@ -1,3 +1,3 @@
1
1
  export { LeuButton };
2
- import { L as LeuButton } from './Button-7370f901.js';
2
+ import { L as LeuButton } from './Button-3adfb3ed.js';
3
3
  //# sourceMappingURL=leu-button.d.ts.map
@@ -1,5 +1,5 @@
1
- import { L as LeuButton } from './Button-7370f901.js';
2
- import './LeuElement-ba5ea33d.js';
1
+ import { L as LeuButton } from './Button-3adfb3ed.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/class-map.js';
5
5
  import 'lit/directives/if-defined.js';
@@ -1,5 +1,5 @@
1
1
  import { LeuCheckboxGroup } from './CheckboxGroup.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/class-map.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { LeuCheckbox } from './Checkbox.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import './Icon.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { LeuChipGroup } from './ChipGroup.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/static-html.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { LeuChipLink } from './ChipLink.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import './Chip.js';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { LeuChipRemovable } from './ChipRemovable.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import './Chip.js';
5
5
  import './Icon.js';
@@ -1,5 +1,5 @@
1
1
  import { LeuChipSelectable } from './ChipSelectable.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import './Chip.js';
5
5
 
@@ -1,8 +1,8 @@
1
1
  import { LeuDropdown } from './Dropdown.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/ref.js';
5
- import './Button-7370f901.js';
5
+ import './Button-3adfb3ed.js';
6
6
  import 'lit/directives/class-map.js';
7
7
  import 'lit/directives/if-defined.js';
8
8
  import './Icon.js';
package/dist/leu-icon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LeuIcon } from './Icon.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
 
5
5
  LeuIcon.define("leu-icon");
package/dist/leu-input.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LeuInput } from './Input.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/class-map.js';
5
5
  import 'lit/directives/if-defined.js';
@@ -1,5 +1,5 @@
1
1
  import { LeuMenuItem } from './MenuItem.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/if-defined.js';
5
5
  import './Icon.js';
package/dist/leu-menu.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LeuMenu } from './Menu.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import './MenuItem.js';
5
5
  import 'lit/directives/if-defined.js';
@@ -1,8 +1,8 @@
1
1
  import { LeuPagination } from './Pagination.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/live.js';
5
- import './Button-7370f901.js';
5
+ import './Button-3adfb3ed.js';
6
6
  import 'lit/directives/class-map.js';
7
7
  import 'lit/directives/if-defined.js';
8
8
  import './Icon.js';
package/dist/leu-popup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LeuPopup } from './Popup.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import '@floating-ui/dom';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { LeuRadioGroup } from './RadioGroup.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/class-map.js';
5
5
 
package/dist/leu-radio.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LeuRadio } from './Radio.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
 
5
5
  LeuRadio.define("leu-radio");
@@ -1,8 +1,8 @@
1
1
  import { LeuScrollTop } from './ScrollTop.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/class-map.js';
5
- import './Button-7370f901.js';
5
+ import './Button-3adfb3ed.js';
6
6
  import 'lit/directives/if-defined.js';
7
7
  import './Icon.js';
8
8
  import './utils-65469421.js';
@@ -1,10 +1,10 @@
1
1
  import { LeuSelect } from './Select.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/class-map.js';
5
5
  import 'lit/directives/ref.js';
6
6
  import 'lit/directives/if-defined.js';
7
- import './Button-7370f901.js';
7
+ import './Button-3adfb3ed.js';
8
8
  import './Icon.js';
9
9
  import './Menu.js';
10
10
  import './MenuItem.js';
package/dist/leu-table.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LeuTable } from './Table.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
  import 'lit/directives/class-map.js';
5
5
  import 'lit/directives/style-map.js';
@@ -7,7 +7,7 @@ import 'lit/directives/ref.js';
7
7
  import './Icon.js';
8
8
  import './Pagination.js';
9
9
  import 'lit/directives/live.js';
10
- import './Button-7370f901.js';
10
+ import './Button-3adfb3ed.js';
11
11
  import 'lit/directives/if-defined.js';
12
12
  import './VisuallyHidden.js';
13
13
 
@@ -1,5 +1,5 @@
1
1
  import { LeuVisuallyHidden } from './VisuallyHidden.js';
2
- import './LeuElement-ba5ea33d.js';
2
+ import './LeuElement-a20c5fd6.js';
3
3
  import 'lit';
4
4
 
5
5
  LeuVisuallyHidden.define("leu-visually-hidden");
@@ -141,7 +141,10 @@
141
141
  "name": "leu-checkbox-group",
142
142
  "description": "\n---\n",
143
143
  "attributes": [
144
- { "name": "orientation", "values": [] },
144
+ {
145
+ "name": "orientation",
146
+ "values": [{ "name": "horizontal" }, { "name": "vertical" }]
147
+ },
145
148
  { "name": "label", "values": [] }
146
149
  ],
147
150
  "references": [
@@ -196,9 +199,14 @@
196
199
  },
197
200
  {
198
201
  "name": "leu-chip-removable",
199
- "description": "\n---\n\n\n### **Events:**\n - **remove** - Dispatched when the user clicks on the chip\n\n### **Slots:**\n - _default_ - The content of the chip",
202
+ "description": "\n---\n\n\n### **Events:**\n - **remove** - Dispatched when the user clicks on the chip\n\n### **Methods:**\n - **getValue(): _string_** - Returns the value of the chip. If `value` is not set, it will return the text content\n\n### **Slots:**\n - _default_ - The content of the chip",
200
203
  "attributes": [
201
204
  { "name": "", "values": [] },
205
+ {
206
+ "name": "value",
207
+ "description": "The value of the chip.",
208
+ "values": []
209
+ },
202
210
  { "name": "inverted", "values": [] }
203
211
  ],
204
212
  "references": [
@@ -210,7 +218,7 @@
210
218
  },
211
219
  {
212
220
  "name": "leu-chip-selectable",
213
- "description": "A chip component that can be selected.\n---\n\n\n### **Events:**\n - **input** - undefined\n\n### **Slots:**\n - _default_ - The content of the chip",
221
+ "description": "A chip component that can be selected.\n---\n\n\n### **Events:**\n - **input** - undefined\n\n### **Methods:**\n - **getValue(): _string_** - Returns the value of the chip. If `value` is not set, it will return the text content\n\n### **Slots:**\n - _default_ - The content of the chip",
214
222
  "attributes": [
215
223
  { "name": "", "values": [] },
216
224
  {
@@ -516,7 +524,10 @@
516
524
  "name": "leu-radio-group",
517
525
  "description": "\n---\n",
518
526
  "attributes": [
519
- { "name": "orientation", "values": [] },
527
+ {
528
+ "name": "orientation",
529
+ "values": [{ "name": "horizontal" }, { "name": "vertical" }]
530
+ },
520
531
  { "name": "label", "values": [] }
521
532
  ],
522
533
  "references": [
@@ -142,6 +142,8 @@ type LeuChipLinkProps = {
142
142
  type LeuChipRemovableProps = {
143
143
  /** */
144
144
  ""?: LeuChipRemovable[""];
145
+ /** The value of the chip. */
146
+ value?: LeuChipRemovable["value"];
145
147
  /** */
146
148
  inverted?: LeuChipRemovable["inverted"];
147
149
  /** */
@@ -530,6 +532,9 @@ export type CustomElements = {
530
532
  * ### **Events:**
531
533
  * - **remove** - Dispatched when the user clicks on the chip
532
534
  *
535
+ * ### **Methods:**
536
+ * - **getValue(): _string_** - Returns the value of the chip. If `value` is not set, it will return the text content
537
+ *
533
538
  * ### **Slots:**
534
539
  * - _default_ - The content of the chip
535
540
  */
@@ -543,6 +548,9 @@ export type CustomElements = {
543
548
  * ### **Events:**
544
549
  * - **input** - undefined
545
550
  *
551
+ * ### **Methods:**
552
+ * - **getValue(): _string_** - Returns the value of the chip. If `value` is not set, it will return the text content
553
+ *
546
554
  * ### **Slots:**
547
555
  * - _default_ - The content of the chip
548
556
  */
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@statistikzh/leu",
4
- "version": "0.7.0",
4
+ "version": "0.8.0",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -286,14 +286,20 @@
286
286
  "attributes": [
287
287
  {
288
288
  "name": "orientation",
289
- "value": { "type": "string", "default": "\"HORIZONTAL\"" }
289
+ "value": {
290
+ "type": "\"horizontal\" | \"vertical\"",
291
+ "default": "\"horizontal\""
292
+ }
290
293
  },
291
294
  { "name": "label", "value": { "type": "string" } }
292
295
  ],
293
296
  "events": [],
294
297
  "js": {
295
298
  "properties": [
296
- { "name": "orientation", "value": { "type": "string" } },
299
+ {
300
+ "name": "orientation",
301
+ "value": { "type": "\"horizontal\" | \"vertical\"" }
302
+ },
297
303
  { "name": "label", "value": { "type": "string" } }
298
304
  ],
299
305
  "events": []
@@ -379,10 +385,15 @@
379
385
  },
380
386
  {
381
387
  "name": "leu-chip-removable",
382
- "description": "\n---\n\n\n### **Events:**\n - **remove** - Dispatched when the user clicks on the chip\n\n### **Slots:**\n - _default_ - The content of the chip",
388
+ "description": "\n---\n\n\n### **Events:**\n - **remove** - Dispatched when the user clicks on the chip\n\n### **Methods:**\n - **getValue(): _string_** - Returns the value of the chip. If `value` is not set, it will return the text content\n\n### **Slots:**\n - _default_ - The content of the chip",
383
389
  "doc-url": "",
384
390
  "attributes": [
385
391
  { "name": "", "value": { "type": "string" } },
392
+ {
393
+ "name": "value",
394
+ "description": "The value of the chip.",
395
+ "value": { "type": "string", "default": "\"\"" }
396
+ },
386
397
  {
387
398
  "name": "inverted",
388
399
  "value": { "type": "boolean", "default": "false" }
@@ -398,6 +409,11 @@
398
409
  "js": {
399
410
  "properties": [
400
411
  { "name": "", "value": {} },
412
+ {
413
+ "name": "value",
414
+ "description": "The value of the chip.",
415
+ "value": { "type": "string" }
416
+ },
401
417
  { "name": "inverted", "value": { "type": "boolean" } }
402
418
  ],
403
419
  "events": [
@@ -410,7 +426,7 @@
410
426
  },
411
427
  {
412
428
  "name": "leu-chip-selectable",
413
- "description": "A chip component that can be selected.\n---\n\n\n### **Events:**\n - **input** - undefined\n\n### **Slots:**\n - _default_ - The content of the chip",
429
+ "description": "A chip component that can be selected.\n---\n\n\n### **Events:**\n - **input** - undefined\n\n### **Methods:**\n - **getValue(): _string_** - Returns the value of the chip. If `value` is not set, it will return the text content\n\n### **Slots:**\n - _default_ - The content of the chip",
414
430
  "doc-url": "",
415
431
  "attributes": [
416
432
  { "name": "", "value": { "type": "string" } },
@@ -435,7 +451,7 @@
435
451
  {
436
452
  "name": "value",
437
453
  "description": "The value of the chip.",
438
- "value": { "type": "string" }
454
+ "value": { "type": "string", "default": "\"\"" }
439
455
  },
440
456
  {
441
457
  "name": "inverted",
@@ -990,14 +1006,20 @@
990
1006
  "attributes": [
991
1007
  {
992
1008
  "name": "orientation",
993
- "value": { "type": "string", "default": "\"HORIZONTAL\"" }
1009
+ "value": {
1010
+ "type": "\"horizontal\" | \"vertical\"",
1011
+ "default": "\"horizontal\""
1012
+ }
994
1013
  },
995
1014
  { "name": "label", "value": { "type": "string" } }
996
1015
  ],
997
1016
  "events": [],
998
1017
  "js": {
999
1018
  "properties": [
1000
- { "name": "orientation", "value": { "type": "string" } },
1019
+ {
1020
+ "name": "orientation",
1021
+ "value": { "type": "\"horizontal\" | \"vertical\"" }
1022
+ },
1001
1023
  { "name": "label", "value": { "type": "string" } }
1002
1024
  ],
1003
1025
  "events": []
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI component library of the canton of zurich",
4
4
  "license": "MIT",
5
5
  "author": "statistikzh",
6
- "version": "0.7.0",
6
+ "version": "0.8.0",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -58,6 +58,7 @@
58
58
  "@rollup/plugin-babel": "^6.0.4",
59
59
  "@rollup/plugin-commonjs": "^25.0.7",
60
60
  "@rollup/plugin-json": "^6.0.0",
61
+ "@rollup/plugin-replace": "^5.0.7",
61
62
  "@rollup/plugin-typescript": "^11.1.6",
62
63
  "@storybook/addon-designs": "^7.0.9",
63
64
  "@storybook/addon-essentials": "^7.6.17",
package/rollup.config.js CHANGED
@@ -4,8 +4,17 @@ import { fileURLToPath } from "url"
4
4
  import postcss from "rollup-plugin-postcss"
5
5
  import postcssLit from "rollup-plugin-postcss-lit"
6
6
  import { babel } from "@rollup/plugin-babel"
7
+ import replace from "@rollup/plugin-replace"
7
8
 
8
9
  export const plugins = [
10
+ {
11
+ plugin: replace,
12
+ args: [
13
+ {
14
+ __LEU_VERSION__: JSON.stringify(process.env.npm_package_version),
15
+ },
16
+ ],
17
+ },
9
18
  {
10
19
  plugin: postcss,
11
20
  args: [
@@ -19,7 +19,8 @@ export class LeuCheckboxGroup extends LeuElement {
19
19
 
20
20
  constructor() {
21
21
  super()
22
- this.orientation = "HORIZONTAL"
22
+ /** @type {"horizontal" | "vertical"} */
23
+ this.orientation = "horizontal"
23
24
  this.items = []
24
25
  }
25
26
 
@@ -38,7 +39,7 @@ export class LeuCheckboxGroup extends LeuElement {
38
39
  render() {
39
40
  const fieldsetClasses = {
40
41
  fieldset: "true",
41
- "fieldset--vertical": this.orientation === "VERTICAL",
42
+ "fieldset--vertical": this.orientation === "vertical",
42
43
  }
43
44
 
44
45
  return html`
@@ -9,7 +9,7 @@ export default {
9
9
  argTypes: {
10
10
  legend: { control: "text" },
11
11
  orientation: {
12
- options: ["VERTICAL", "HORIZONTAL"],
12
+ options: ["vertical", "horizontal"],
13
13
  control: { type: "checkbox" },
14
14
  },
15
15
  },
@@ -49,11 +49,11 @@ HorizontalLabel.args = {
49
49
 
50
50
  export const Vertical = Template.bind({})
51
51
  Vertical.args = {
52
- orientation: "VERTICAL",
52
+ orientation: "vertical",
53
53
  }
54
54
 
55
55
  export const VerticalLabel = Template.bind({})
56
56
  VerticalLabel.args = {
57
- orientation: "VERTICAL",
57
+ orientation: "vertical",
58
58
  label: "Anrede",
59
59
  }
@@ -62,7 +62,7 @@ export class LeuChipGroup extends LeuElement {
62
62
  }
63
63
 
64
64
  get value() {
65
- return this.items.filter((i) => i.checked).map((i) => i.value)
65
+ return this.items.filter((i) => i.checked).map((i) => i.getValue())
66
66
  }
67
67
 
68
68
  /**
@@ -7,6 +7,7 @@ import { LeuIcon } from "../icon/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
  export class LeuChipRemovable extends LeuChipBase {
12
13
  static dependencies = {
@@ -15,12 +16,29 @@ export class LeuChipRemovable extends LeuChipBase {
15
16
 
16
17
  static properties = {
17
18
  ...LeuChipBase.properties,
19
+ value: { type: String, reflect: true },
20
+ }
21
+
22
+ constructor() {
23
+ super()
24
+ this.value = ""
25
+ }
26
+
27
+ /**
28
+ * Returns the value of the chip. If `value` is not set, it will return the text content
29
+ * @returns {string}
30
+ */
31
+ getValue() {
32
+ return this.value || this.textContent.trim()
18
33
  }
19
34
 
20
35
  handleClick() {
21
36
  const customEvent = new CustomEvent("leu:remove", {
22
37
  bubbles: true,
23
38
  composed: true,
39
+ detail: {
40
+ value: this.getValue(),
41
+ },
24
42
  })
25
43
  this.dispatchEvent(customEvent)
26
44
  }