@statistikzh/leu 0.5.1 → 0.6.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 (236) hide show
  1. package/.husky/commit-msg +0 -3
  2. package/.husky/pre-commit +0 -3
  3. package/CHANGELOG.md +40 -0
  4. package/dist/Accordion.d.ts +10 -9
  5. package/dist/Accordion.d.ts.map +1 -1
  6. package/dist/Accordion.js +12 -11
  7. package/dist/Breadcrumb.d.ts +4 -4
  8. package/dist/Breadcrumb.d.ts.map +1 -1
  9. package/dist/Breadcrumb.js +28 -26
  10. package/dist/{Button-5326c982.d.ts → Button-9692e403.d.ts} +10 -11
  11. package/dist/Button-9692e403.d.ts.map +1 -0
  12. package/dist/{Button-5326c982.js → Button-9692e403.js} +57 -67
  13. package/dist/Button.d.ts +1 -1
  14. package/dist/Button.js +3 -3
  15. package/dist/ButtonGroup.d.ts +2 -2
  16. package/dist/ButtonGroup.d.ts.map +1 -1
  17. package/dist/ButtonGroup.js +3 -3
  18. package/dist/Checkbox.d.ts +4 -3
  19. package/dist/Checkbox.d.ts.map +1 -1
  20. package/dist/Checkbox.js +14 -19
  21. package/dist/CheckboxGroup.d.ts +2 -2
  22. package/dist/CheckboxGroup.d.ts.map +1 -1
  23. package/dist/CheckboxGroup.js +4 -6
  24. package/dist/Chip.d.ts +2 -2
  25. package/dist/Chip.d.ts.map +1 -1
  26. package/dist/Chip.js +6 -13
  27. package/dist/ChipGroup.d.ts +9 -7
  28. package/dist/ChipGroup.d.ts.map +1 -1
  29. package/dist/ChipGroup.js +8 -5
  30. package/dist/ChipLink.d.ts +2 -1
  31. package/dist/ChipLink.d.ts.map +1 -1
  32. package/dist/ChipLink.js +4 -7
  33. package/dist/ChipRemovable.d.ts +0 -2
  34. package/dist/ChipRemovable.d.ts.map +1 -1
  35. package/dist/ChipRemovable.js +8 -11
  36. package/dist/ChipSelectable.d.ts +9 -1
  37. package/dist/ChipSelectable.d.ts.map +1 -1
  38. package/dist/ChipSelectable.js +12 -16
  39. package/dist/Dropdown.d.ts +9 -5
  40. package/dist/Dropdown.d.ts.map +1 -1
  41. package/dist/Dropdown.js +68 -32
  42. package/dist/Icon.d.ts +20 -0
  43. package/dist/Icon.d.ts.map +1 -0
  44. package/dist/{icon-03e86700.js → Icon.js} +61 -32
  45. package/dist/Input.d.ts +7 -16
  46. package/dist/Input.d.ts.map +1 -1
  47. package/dist/Input.js +24 -28
  48. package/dist/LeuElement-6de6f209.d.ts +7 -0
  49. package/dist/LeuElement-6de6f209.d.ts.map +1 -0
  50. package/dist/LeuElement-6de6f209.js +43 -0
  51. package/dist/Menu.d.ts +24 -2
  52. package/dist/Menu.d.ts.map +1 -1
  53. package/dist/Menu.js +120 -3
  54. package/dist/MenuItem.d.ts +28 -11
  55. package/dist/MenuItem.d.ts.map +1 -1
  56. package/dist/MenuItem.js +110 -63
  57. package/dist/Pagination.d.ts +10 -3
  58. package/dist/Pagination.d.ts.map +1 -1
  59. package/dist/Pagination.js +24 -21
  60. package/dist/Popup.d.ts +21 -3
  61. package/dist/Popup.d.ts.map +1 -1
  62. package/dist/Popup.js +44 -19
  63. package/dist/Radio.d.ts +4 -2
  64. package/dist/Radio.d.ts.map +1 -1
  65. package/dist/Radio.js +9 -16
  66. package/dist/RadioGroup.d.ts +2 -2
  67. package/dist/RadioGroup.d.ts.map +1 -1
  68. package/dist/RadioGroup.js +4 -6
  69. package/dist/ScrollTop.d.ts +2 -2
  70. package/dist/ScrollTop.d.ts.map +1 -1
  71. package/dist/ScrollTop.js +10 -8
  72. package/dist/Select.d.ts +75 -37
  73. package/dist/Select.d.ts.map +1 -1
  74. package/dist/Select.js +279 -183
  75. package/dist/Table.d.ts +2 -6
  76. package/dist/Table.d.ts.map +1 -1
  77. package/dist/Table.js +17 -18
  78. package/dist/VisuallyHidden.d.ts +2 -2
  79. package/dist/VisuallyHidden.d.ts.map +1 -1
  80. package/dist/VisuallyHidden.js +5 -7
  81. package/dist/index.d.ts +2 -2
  82. package/dist/index.js +5 -14
  83. package/dist/leu-accordion.d.ts.map +1 -1
  84. package/dist/leu-accordion.js +2 -3
  85. package/dist/leu-breadcrumb.d.ts.map +1 -1
  86. package/dist/leu-breadcrumb.js +4 -10
  87. package/dist/leu-button-group.d.ts.map +1 -1
  88. package/dist/leu-button-group.js +2 -3
  89. package/dist/leu-button.d.ts +1 -1
  90. package/dist/leu-button.d.ts.map +1 -1
  91. package/dist/leu-button.js +4 -5
  92. package/dist/leu-checkbox-group.d.ts.map +1 -1
  93. package/dist/leu-checkbox-group.js +2 -3
  94. package/dist/leu-checkbox.d.ts.map +1 -1
  95. package/dist/leu-checkbox.js +3 -4
  96. package/dist/leu-chip-group.d.ts.map +1 -1
  97. package/dist/leu-chip-group.js +2 -3
  98. package/dist/leu-chip-link.d.ts.map +1 -1
  99. package/dist/leu-chip-link.js +2 -3
  100. package/dist/leu-chip-removable.d.ts.map +1 -1
  101. package/dist/leu-chip-removable.js +3 -4
  102. package/dist/leu-chip-selectable.d.ts.map +1 -1
  103. package/dist/leu-chip-selectable.js +2 -3
  104. package/dist/leu-dropdown.d.ts.map +1 -1
  105. package/dist/leu-dropdown.js +5 -10
  106. package/dist/leu-icon.d.ts +3 -0
  107. package/dist/leu-icon.d.ts.map +1 -0
  108. package/dist/leu-icon.js +7 -0
  109. package/dist/leu-input.d.ts.map +1 -1
  110. package/dist/leu-input.js +3 -4
  111. package/dist/leu-menu-item.d.ts.map +1 -1
  112. package/dist/leu-menu-item.js +3 -5
  113. package/dist/leu-menu.d.ts.map +1 -1
  114. package/dist/leu-menu.js +5 -3
  115. package/dist/leu-pagination.d.ts.map +1 -1
  116. package/dist/leu-pagination.js +4 -7
  117. package/dist/leu-popup.d.ts.map +1 -1
  118. package/dist/leu-popup.js +2 -3
  119. package/dist/leu-radio-group.d.ts.map +1 -1
  120. package/dist/leu-radio-group.js +2 -3
  121. package/dist/leu-radio.d.ts.map +1 -1
  122. package/dist/leu-radio.js +2 -3
  123. package/dist/leu-scroll-top.d.ts.map +1 -1
  124. package/dist/leu-scroll-top.js +4 -6
  125. package/dist/leu-select.d.ts.map +1 -1
  126. package/dist/leu-select.js +5 -13
  127. package/dist/leu-table.d.ts.map +1 -1
  128. package/dist/leu-table.js +4 -8
  129. package/dist/leu-visually-hidden.d.ts.map +1 -1
  130. package/dist/leu-visually-hidden.js +2 -3
  131. package/dist/theme.css +2 -0
  132. package/dist/vscode.html-custom-data.json +116 -79
  133. package/dist/vue/index.d.ts +80 -76
  134. package/dist/web-types.json +405 -270
  135. package/package.json +9 -12
  136. package/scripts/generate-component/templates/[Name].js +6 -3
  137. package/scripts/generate-component/templates/test/[name].test.js +1 -1
  138. package/src/components/accordion/Accordion.js +13 -10
  139. package/src/components/accordion/leu-accordion.js +1 -2
  140. package/src/components/breadcrumb/Breadcrumb.js +31 -18
  141. package/src/components/breadcrumb/leu-breadcrumb.js +1 -2
  142. package/src/components/button/Button.js +45 -71
  143. package/src/components/button/button.css +11 -9
  144. package/src/components/button/leu-button.js +1 -2
  145. package/src/components/button/stories/button.stories.js +60 -19
  146. package/src/components/button/test/button.test.js +26 -63
  147. package/src/components/button-group/ButtonGroup.js +4 -2
  148. package/src/components/button-group/leu-button-group.js +1 -2
  149. package/src/components/checkbox/Checkbox.js +17 -11
  150. package/src/components/checkbox/CheckboxGroup.js +6 -3
  151. package/src/components/checkbox/leu-checkbox-group.js +1 -2
  152. package/src/components/checkbox/leu-checkbox.js +1 -2
  153. package/src/components/checkbox/stories/checkbox-group.stories.js +10 -26
  154. package/src/components/checkbox/stories/checkbox.stories.js +2 -7
  155. package/src/components/checkbox/test/checkbox-group.test.js +6 -21
  156. package/src/components/checkbox/test/checkbox.test.js +1 -12
  157. package/src/components/chip/Chip.js +5 -4
  158. package/src/components/chip/ChipGroup.js +10 -4
  159. package/src/components/chip/ChipLink.js +3 -7
  160. package/src/components/chip/ChipRemovable.js +8 -11
  161. package/src/components/chip/ChipSelectable.js +11 -17
  162. package/src/components/chip/chip.css +3 -4
  163. package/src/components/chip/leu-chip-group.js +1 -2
  164. package/src/components/chip/leu-chip-link.js +1 -2
  165. package/src/components/chip/leu-chip-removable.js +1 -2
  166. package/src/components/chip/leu-chip-selectable.js +1 -2
  167. package/src/components/chip/stories/chip-link.stories.js +3 -5
  168. package/src/components/chip/stories/chip-removable.stories.js +3 -4
  169. package/src/components/chip/stories/chip-selectable.stories.js +2 -2
  170. package/src/components/chip/test/chip-group.test.js +15 -30
  171. package/src/components/chip/test/chip-link.test.js +2 -6
  172. package/src/components/chip/test/chip-removable.test.js +4 -10
  173. package/src/components/chip/test/chip-selectable.test.js +3 -5
  174. package/src/components/dropdown/Dropdown.js +79 -26
  175. package/src/components/dropdown/leu-dropdown.js +1 -2
  176. package/src/components/dropdown/stories/dropdown.stories.js +30 -7
  177. package/src/components/dropdown/test/dropdown.test.js +5 -5
  178. package/src/components/icon/Icon.js +55 -0
  179. package/src/components/icon/icon.css +6 -0
  180. package/src/components/icon/leu-icon.js +5 -0
  181. package/src/components/icon/{icon.js → paths.js} +4 -37
  182. package/src/components/icon/stories/icon.stories.js +47 -0
  183. package/src/components/icon/test/icon.test.js +23 -40
  184. package/src/components/input/Input.js +21 -23
  185. package/src/components/input/input.css +4 -2
  186. package/src/components/input/leu-input.js +1 -2
  187. package/src/components/input/stories/input.stories.js +2 -2
  188. package/src/components/input/test/input.test.js +2 -0
  189. package/src/components/menu/Menu.js +143 -2
  190. package/src/components/menu/MenuItem.js +104 -52
  191. package/src/components/menu/leu-menu-item.js +1 -2
  192. package/src/components/menu/leu-menu.js +1 -2
  193. package/src/components/menu/menu-item.css +11 -4
  194. package/src/components/menu/stories/menu-item.stories.js +15 -4
  195. package/src/components/menu/stories/menu.stories.js +34 -7
  196. package/src/components/menu/test/menu-item.test.js +88 -82
  197. package/src/components/menu/test/menu.test.js +101 -8
  198. package/src/components/pagination/Pagination.js +27 -18
  199. package/src/components/pagination/leu-pagination.js +1 -2
  200. package/src/components/popup/Popup.js +39 -16
  201. package/src/components/popup/leu-popup.js +1 -2
  202. package/src/components/popup/popup.css +1 -0
  203. package/src/components/radio/Radio.js +12 -7
  204. package/src/components/radio/RadioGroup.js +6 -3
  205. package/src/components/radio/leu-radio-group.js +1 -2
  206. package/src/components/radio/leu-radio.js +1 -2
  207. package/src/components/radio/stories/radio-group.stories.js +5 -19
  208. package/src/components/radio/stories/radio.stories.js +2 -7
  209. package/src/components/radio/test/radio-group.test.js +6 -9
  210. package/src/components/radio/test/radio.test.js +3 -13
  211. package/src/components/scroll-top/ScrollTop.js +15 -5
  212. package/src/components/scroll-top/leu-scroll-top.js +1 -2
  213. package/src/components/select/Select.js +279 -175
  214. package/src/components/select/leu-select.js +1 -2
  215. package/src/components/select/select.css +20 -12
  216. package/src/components/select/stories/select.stories.js +16 -2
  217. package/src/components/select/test/select.test.js +191 -37
  218. package/src/components/table/Table.js +15 -9
  219. package/src/components/table/leu-table.js +1 -2
  220. package/src/components/table/table.css +3 -1
  221. package/src/components/visually-hidden/VisuallyHidden.js +6 -2
  222. package/src/components/visually-hidden/leu-visually-hidden.js +1 -2
  223. package/src/lib/LeuElement.js +23 -0
  224. package/src/lib/a11y.js +26 -0
  225. package/src/styles/custom-properties.css +2 -0
  226. package/web-test-runner.config.mjs +2 -0
  227. package/dist/Button-5326c982.d.ts.map +0 -1
  228. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +0 -3
  229. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +0 -1
  230. package/dist/_rollupPluginBabelHelpers-20f659f4.js +0 -30
  231. package/dist/defineElement-40372b4b.d.ts +0 -9
  232. package/dist/defineElement-40372b4b.d.ts.map +0 -1
  233. package/dist/defineElement-40372b4b.js +0 -15
  234. package/dist/icon-03e86700.d.ts +0 -11
  235. package/dist/icon-03e86700.d.ts.map +0 -1
  236. package/src/lib/defineElement.js +0 -13
@@ -4,7 +4,7 @@
4
4
  * @prop {string} value - The value of the currenty selected (active) button
5
5
  * @fires input - When the value of the group changes by clicking a button
6
6
  */
7
- export class LeuButtonGroup extends LitElement {
7
+ export class LeuButtonGroup extends LeuElement {
8
8
  /**
9
9
  * @param {import("../button/Button").LeuButton} button
10
10
  * @returns {string}
@@ -20,5 +20,5 @@ export class LeuButtonGroup extends LitElement {
20
20
  _handleButtonClick(button: any): void;
21
21
  render(): import("lit-html").TemplateResult<1>;
22
22
  }
23
- import { LitElement } from 'lit';
23
+ import { L as LeuElement } from './LeuElement-6de6f209.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,oCAFa,MAAM,CAIlB;IATC,cAAgB;IAclB,4BAMC;IAVD,oBAGC;IAQD,0BA+BC;IAED;;OAEG;IACH,sCAWC;IACD,+CAMC;CACF;2BAnGqC,KAAK"}
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,5 +1,5 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, html } from 'lit';
3
3
 
4
4
  var css_248z = css`:host,
5
5
  :host * {
@@ -19,7 +19,7 @@ var css_248z = css`:host,
19
19
  * @prop {string} value - The value of the currenty selected (active) button
20
20
  * @fires input - When the value of the group changes by clicking a button
21
21
  */
22
- class LeuButtonGroup extends LitElement {
22
+ class LeuButtonGroup extends LeuElement {
23
23
  constructor() {
24
24
  super();
25
25
  this._items = [];
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * @tagname leu-checkbox
3
3
  */
4
- export class LeuCheckbox extends LitElement {
4
+ export class LeuCheckbox extends LeuElement {
5
5
  checked: boolean;
6
6
  disabled: boolean;
7
- checkIcon: import("lit-html").TemplateResult<1>;
7
+ name: string;
8
+ value: string;
8
9
  handleChange(event: any): void;
9
10
  handleInput(event: any): void;
10
11
  render(): import("lit-html").TemplateResult<1>;
11
12
  }
12
- import { LitElement } from 'lit';
13
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
13
14
  //# sourceMappingURL=Checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["Checkbox.js"],"names":[],"mappings":"AAiGA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IACrB,gDAA8B;IAEhC,+BAIC;IACD,8BAEC;IACD,+CAgBC;CACF;2BAnIqC,KAAK"}
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"}
package/dist/Checkbox.js CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html } from 'lit';
3
- import { I as Icon } from './icon-03e86700.js';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, html } from 'lit';
3
+ import { LeuIcon } from './Icon.js';
4
4
 
5
5
  var css_248z = css`:host {
6
6
  --checkbox-color: var(--leu-color-black-40);
@@ -20,8 +20,6 @@ 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
-
25
23
  font-family: var(--checkbox-font-regular);
26
24
  }
27
25
 
@@ -98,12 +96,13 @@ var css_248z = css`:host {
98
96
  /**
99
97
  * @tagname leu-checkbox
100
98
  */
101
- class LeuCheckbox extends LitElement {
99
+ class LeuCheckbox extends LeuElement {
102
100
  constructor() {
103
101
  super();
104
102
  this.checked = false;
105
103
  this.disabled = false;
106
- this.checkIcon = Icon("check");
104
+ this.name = "";
105
+ this.value = "";
107
106
  }
108
107
  handleChange(event) {
109
108
  this.checked = event.target.checked;
@@ -116,7 +115,7 @@ class LeuCheckbox extends LitElement {
116
115
  render() {
117
116
  return html`
118
117
  <input
119
- id=${this.identifier}
118
+ id=${`checkbox-${this.name}`}
120
119
  class="checkbox"
121
120
  type="checkbox"
122
121
  name="${this.name}"
@@ -126,14 +125,18 @@ class LeuCheckbox extends LitElement {
126
125
  ?disabled=${this.disabled}
127
126
  .value=${this.value}
128
127
  />
129
- <label for=${this.identifier} class="label">${this.label}</label>
130
- <div class="icon">${this.checkIcon}</div>
128
+ <label for=${`checkbox-${this.name}`} class="label"><slot></slot></label>
129
+ <leu-icon class="icon" name="check"></leu-icon>
131
130
  `;
132
131
  }
133
132
  }
133
+ _defineProperty(LeuCheckbox, "dependencies", {
134
+ "leu-icon": LeuIcon
135
+ });
134
136
  _defineProperty(LeuCheckbox, "styles", css_248z);
137
+ /** @internal */
135
138
  _defineProperty(LeuCheckbox, "shadowRootOptions", {
136
- ...LitElement.shadowRootOptions,
139
+ ...LeuElement.shadowRootOptions,
137
140
  delegatesFocus: true
138
141
  });
139
142
  _defineProperty(LeuCheckbox, "properties", {
@@ -145,10 +148,6 @@ _defineProperty(LeuCheckbox, "properties", {
145
148
  type: Boolean,
146
149
  reflect: true
147
150
  },
148
- identifier: {
149
- type: String,
150
- reflect: true
151
- },
152
151
  value: {
153
152
  type: String,
154
153
  reflect: true
@@ -156,10 +155,6 @@ _defineProperty(LeuCheckbox, "properties", {
156
155
  name: {
157
156
  type: String,
158
157
  reflect: true
159
- },
160
- label: {
161
- type: String,
162
- reflect: true
163
158
  }
164
159
  });
165
160
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @tagname leu-checkbox-group
3
3
  */
4
- export class LeuCheckboxGroup extends LitElement {
4
+ export class LeuCheckboxGroup extends LeuElement {
5
5
  orientation: string;
6
6
  items: any[];
7
7
  get value(): any[];
@@ -9,5 +9,5 @@ export class LeuCheckboxGroup extends LitElement {
9
9
  handleItems(): void;
10
10
  render(): import("lit-html").TemplateResult<1>;
11
11
  }
12
- import { LitElement } from 'lit';
12
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
13
13
  //# 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;2BAlEqC,KAAK"}
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,13 +1,11 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
 
5
5
  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
-
11
9
  font-family: var(--group-font-regular);
12
10
  }
13
11
 
@@ -38,7 +36,7 @@ var css_248z = css`:host {
38
36
  /**
39
37
  * @tagname leu-checkbox-group
40
38
  */
41
- class LeuCheckboxGroup extends LitElement {
39
+ class LeuCheckboxGroup extends LeuElement {
42
40
  constructor() {
43
41
  super();
44
42
  this.orientation = "HORIZONTAL";
@@ -51,7 +49,7 @@ class LeuCheckboxGroup extends LitElement {
51
49
  this.handleItems();
52
50
  }
53
51
  handleItems() {
54
- this.items = [...this.querySelectorAll(":scope > *:not([slot])")];
52
+ this.items = Array.from(this.querySelectorAll(":scope > *:not([slot])"));
55
53
  }
56
54
  render() {
57
55
  const fieldsetClasses = {
package/dist/Chip.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export class LeuChipBase extends LitElement {
1
+ export class LeuChipBase extends LeuElement {
2
2
  inverted: boolean;
3
3
  }
4
- import { LitElement } from 'lit';
4
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
5
5
  //# sourceMappingURL=Chip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["Chip.js"],"names":[],"mappings":"AAyJA;IAGI,kBAAqB;CAExB;2BA7J+B,KAAK"}
1
+ {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["Chip.js"],"names":[],"mappings":"AAsJA;IAGI,kBAAqB;CAExB;gCA3JqD,0BAA0B"}
package/dist/Chip.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css } from 'lit';
3
3
 
4
4
  var css_248z = css`:host,
5
5
  :host *,
@@ -31,7 +31,7 @@ var css_248z = css`:host,
31
31
  --chip-radio-border: var(--chip-radio-border-default);
32
32
  --chip-radio-background: var(--chip-radio-background-default);
33
33
 
34
- font-family: var(--leu-font-family-regular);
34
+ --leu-icon-size: 1rem;
35
35
 
36
36
  font-family: var(--chip-font-regular);
37
37
 
@@ -65,6 +65,7 @@ var css_248z = css`:host,
65
65
  padding: 0.5rem 1rem;
66
66
 
67
67
  color: var(--chip-color);
68
+ font-family: inherit;
68
69
  font-size: 0.875rem;
69
70
  line-height: 1rem;
70
71
 
@@ -143,15 +144,11 @@ var css_248z = css`:host,
143
144
  text-overflow: ellipsis;
144
145
  white-space: nowrap;
145
146
  }
146
-
147
- .icon svg {
148
- display: block;
149
- }
150
147
  `;
151
148
 
152
149
  /* Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=21161-184433&mode=design&t=Kjo5VDiqivihn8dh-11 */
153
150
 
154
- class LeuChipBase extends LitElement {
151
+ class LeuChipBase extends LeuElement {
155
152
  constructor() {
156
153
  super();
157
154
  this.inverted = false;
@@ -160,17 +157,13 @@ class LeuChipBase extends LitElement {
160
157
  _defineProperty(LeuChipBase, "styles", css_248z);
161
158
  /** @internal */
162
159
  _defineProperty(LeuChipBase, "shadowRootOptions", {
163
- ...LitElement.shadowRootOptions,
160
+ ...LeuElement.shadowRootOptions,
164
161
  delegatesFocus: true
165
162
  });
166
163
  _defineProperty(LeuChipBase, "properties", {
167
164
  inverted: {
168
165
  type: Boolean,
169
166
  reflect: true
170
- },
171
- label: {
172
- type: String,
173
- reflect: true
174
167
  }
175
168
  });
176
169
 
@@ -3,11 +3,13 @@
3
3
  * @cssproperty --leu-chip-group-gap - The gap between the chips
4
4
  * @tagname leu-chip-group
5
5
  */
6
- export class LeuChipGroup extends LitElement {
6
+ export class LeuChipGroup extends LeuElement {
7
7
  items: any[];
8
8
  inverted: boolean;
9
9
  headingLevel: number;
10
10
  label: string;
11
+ /** @type {"single" | "multiple" | "none"} */
12
+ selectionMode: "single" | "multiple" | "none";
11
13
  get value(): any[];
12
14
  /**
13
15
  * Determines the heading tag of the accordion toggle.
@@ -19,10 +21,10 @@ export class LeuChipGroup extends LitElement {
19
21
  _getHeadingTag(): string;
20
22
  render(): import("lit-html").TemplateResult;
21
23
  }
22
- export namespace SELECTION_MODES {
23
- let single: string;
24
- let multiple: string;
25
- let none: string;
26
- }
27
- import { LitElement } from 'lit';
24
+ export const SELECTION_MODES: Readonly<{
25
+ single: "single";
26
+ multiple: "multiple";
27
+ none: "none";
28
+ }>;
29
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
28
30
  //# 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;IAajB,mBAEC;IAED;;;;;;OAMG;IACH,yBAMC;IACD,4CAeC;CACF;;;;;;2BAtG+B,KAAK"}
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"}
package/dist/ChipGroup.js CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
3
2
  import { html, unsafeStatic } from 'lit/static-html.js';
3
+ import { css } from 'lit';
4
4
 
5
5
  var css_248z = css`.label {
6
6
  margin: 0 0 0.5rem;
@@ -22,18 +22,18 @@ var css_248z = css`.label {
22
22
 
23
23
  /* Figma https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=131766-248643&mode=design&t=Kjo5VDiqivihn8dh-11 */
24
24
 
25
- const SELECTION_MODES = {
25
+ const SELECTION_MODES = Object.freeze({
26
26
  single: "single",
27
27
  multiple: "multiple",
28
28
  none: "none"
29
- };
29
+ });
30
30
 
31
31
  /**
32
32
  * @slot - Place leu-chip-* elements inside this slot
33
33
  * @cssproperty --leu-chip-group-gap - The gap between the chips
34
34
  * @tagname leu-chip-group
35
35
  */
36
- class LeuChipGroup extends LitElement {
36
+ class LeuChipGroup extends LeuElement {
37
37
  constructor() {
38
38
  super();
39
39
  /** @internal */
@@ -58,6 +58,9 @@ class LeuChipGroup extends LitElement {
58
58
 
59
59
  /** @internal */
60
60
  this.items = [];
61
+
62
+ /** @type {"single" | "multiple" | "none"} */
63
+ this.selectionMode = SELECTION_MODES.none;
61
64
  }
62
65
  connectedCallback() {
63
66
  super.connectedCallback();
@@ -1,6 +1,7 @@
1
1
  /**
2
- * @slot - The content of the chip
3
2
  * @tagname leu-chip-link
3
+ * @slot - The content of the chip
4
+ * @prop {keyof typeof SIZES} size - The size of the chip
4
5
  */
5
6
  export class LeuChipLink extends LeuChipBase {
6
7
  size: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ChipLink.d.ts","sourceRoot":"","sources":["ChipLink.js"],"names":[],"mappings":"AASA;;;GAGG;AACH;IAII,aAAyB;IACzB,aAAc;IAEhB,+CAIC;CACF;;;;;4BAvB2B,WAAW"}
1
+ {"version":3,"file":"ChipLink.d.ts","sourceRoot":"","sources":["ChipLink.js"],"names":[],"mappings":"AASA;;;;GAIG;AACH;IAII,aAAyB;IACzB,aAAc;IAEhB,+CAIC;CACF;;;;;4BAxB2B,WAAW"}
package/dist/ChipLink.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
1
+ import { _ as _defineProperty } from './LeuElement-6de6f209.js';
2
2
  import { html } from 'lit';
3
3
  import { LeuChipBase } from './Chip.js';
4
4
 
@@ -8,8 +8,9 @@ const SIZES = {
8
8
  };
9
9
 
10
10
  /**
11
- * @slot - The content of the chip
12
11
  * @tagname leu-chip-link
12
+ * @slot - The content of the chip
13
+ * @prop {keyof typeof SIZES} size - The size of the chip
13
14
  */
14
15
  class LeuChipLink extends LeuChipBase {
15
16
  constructor() {
@@ -20,16 +21,12 @@ class LeuChipLink extends LeuChipBase {
20
21
  }
21
22
  render() {
22
23
  return html`<a href=${this.href} class="button">
23
- <span class="label">${this.label}</span>
24
+ <span class="label"><slot></slot></span>
24
25
  </a>`;
25
26
  }
26
27
  }
27
28
  _defineProperty(LeuChipLink, "properties", {
28
29
  ...LeuChipBase.properties,
29
- /**
30
- * The size of the chip
31
- * @type {keyof typeof SIZES}
32
- */
33
30
  size: {
34
31
  type: String,
35
32
  reflect: true
@@ -4,8 +4,6 @@
4
4
  * @fires remove - Dispatched when the user clicks on the chip
5
5
  */
6
6
  export class LeuChipRemovable extends LeuChipBase {
7
- /** @internal */
8
- _removeIcon: import("lit-html").TemplateResult<1>;
9
7
  handleClick(): void;
10
8
  render(): import("lit-html").TemplateResult<1>;
11
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChipRemovable.d.ts","sourceRoot":"","sources":["ChipRemovable.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;IAII,gBAAgB;IAChB,kDAAoC;IAEtC,oBAMC;IACD,+CAKC;CACF;4BA5B2B,WAAW"}
1
+ {"version":3,"file":"ChipRemovable.d.ts","sourceRoot":"","sources":["ChipRemovable.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;IACE,oBAMC;IACD,+CAKC;CACF;4BAtB2B,WAAW"}
@@ -1,7 +1,7 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
1
+ import { _ as _defineProperty } from './LeuElement-6de6f209.js';
2
2
  import { html } from 'lit';
3
3
  import { LeuChipBase } from './Chip.js';
4
- import { I as Icon } from './icon-03e86700.js';
4
+ import { LeuIcon } from './Icon.js';
5
5
 
6
6
  /**
7
7
  * @slot - The content of the chip
@@ -9,26 +9,23 @@ import { I as Icon } from './icon-03e86700.js';
9
9
  * @fires remove - Dispatched when the user clicks on the chip
10
10
  */
11
11
  class LeuChipRemovable extends LeuChipBase {
12
- constructor() {
13
- super();
14
-
15
- /** @internal */
16
- this._removeIcon = Icon("close", 16);
17
- }
18
12
  handleClick() {
19
13
  const customEvent = new CustomEvent("leu:remove", {
20
- bubble: true,
14
+ bubbles: true,
21
15
  composed: true
22
16
  });
23
17
  this.dispatchEvent(customEvent);
24
18
  }
25
19
  render() {
26
20
  return html`<button @click=${e => this.handleClick(e)} class="button">
27
- <span class="label">${this.label}</span>
28
- <div class="icon">${this._removeIcon}</div>
21
+ <span class="label"><slot></slot></span>
22
+ <leu-icon name="close" class="icon"></leu-icon>
29
23
  </button>`;
30
24
  }
31
25
  }
26
+ _defineProperty(LeuChipRemovable, "dependencies", {
27
+ "leu-icon": LeuIcon
28
+ });
32
29
  _defineProperty(LeuChipRemovable, "properties", {
33
30
  ...LeuChipBase.properties
34
31
  });
@@ -1,10 +1,18 @@
1
1
  /**
2
2
  * A chip component that can be selected.
3
- * @slot - The content of the chip
4
3
  * @tagname leu-chip-selectable
4
+ * @slot - The content of the chip
5
+ * @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
6
+ * @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
5
7
  */
6
8
  export class LeuChipSelectable extends LeuChipBase {
7
9
  size: string;
10
+ /**
11
+ * The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
12
+ * - `toggle`: The chip behaves like a toggle button.
13
+ * - `radio`: The chip behaves like a radio button.
14
+ * @default "toggle"
15
+ */
8
16
  variant: string;
9
17
  selected: boolean;
10
18
  handleClick(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ChipSelectable.d.ts","sourceRoot":"","sources":["ChipSelectable.js"],"names":[],"mappings":"AAaA;;;;GAIG;AACH;IAGI,aAAyB;IACzB,gBAA8B;IAC9B,kBAAqB;IAKvB,oBAiBC;IACD,+CAQC;CACF;;;;;;;;;4BArD2B,WAAW"}
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,4 +1,4 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
1
+ import { _ as _defineProperty } from './LeuElement-6de6f209.js';
2
2
  import { html } from 'lit';
3
3
  import { LeuChipBase } from './Chip.js';
4
4
 
@@ -13,13 +13,22 @@ const VARIANTS = {
13
13
 
14
14
  /**
15
15
  * A chip component that can be selected.
16
- * @slot - The content of the chip
17
16
  * @tagname leu-chip-selectable
17
+ * @slot - The content of the chip
18
+ * @prop {keyof typeof SIZES} size - The size of the chip. Not supported for radio variant.
19
+ * @prop {keyof typeof VARIANTS} variant - `toggle` or `radio`. Determines if only one or multiple chips can be selected.
18
20
  */
19
21
  class LeuChipSelectable extends LeuChipBase {
20
22
  constructor() {
21
23
  super();
22
24
  this.size = SIZES.regular;
25
+
26
+ /**
27
+ * The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
28
+ * - `toggle`: The chip behaves like a toggle button.
29
+ * - `radio`: The chip behaves like a radio button.
30
+ * @default "toggle"
31
+ */
23
32
  this.variant = VARIANTS.toggle;
24
33
  this.selected = false;
25
34
  if (this.variant === VARIANTS.radio && this.size === SIZES.small) {
@@ -50,29 +59,16 @@ class LeuChipSelectable extends LeuChipBase {
50
59
  class="button"
51
60
  aria-pressed=${this.selected ? "true" : "false"}
52
61
  >
53
- <span class="label">${this.label}</span>
62
+ <span class="label"><slot></slot></span>
54
63
  </button>`;
55
64
  }
56
65
  }
57
66
  _defineProperty(LeuChipSelectable, "properties", {
58
67
  ...LeuChipBase.properties,
59
- /**
60
- * The size of the chip. Not supported for radio variant.
61
- * @type {keyof typeof SIZES}
62
- * @default "regular"
63
- */
64
68
  size: {
65
69
  type: String,
66
70
  reflect: true
67
71
  },
68
- /**
69
- * The variant of the chip. Has an effect not only on the visual appearance but also on the behavior.
70
- * - `toggle`: The chip behaves like a toggle button.
71
- * - `radio`: The chip behaves like a radio button.
72
- *
73
- * @type {keyof typeof VARIANTS}
74
- * @default "toggle"
75
- */
76
72
  variant: {
77
73
  type: String,
78
74
  reflect: true
@@ -1,15 +1,19 @@
1
1
  /**
2
2
  * @tagname leu-dropdown
3
3
  */
4
- export class LeuDropdown extends LitElement {
4
+ export class LeuDropdown extends LeuElement {
5
5
  expanded: boolean;
6
6
  label: string;
7
- menuItems: any[];
7
+ /** @type {import("lit/directives/ref").Ref<HTMLButtonElement>} */
8
+ _toggleRef: import("lit/directives/ref").Ref<HTMLButtonElement>;
8
9
  _keyUpHandler(event: any): void;
9
- _handleSlotChange(): void;
10
- _removeMenuItemListeners(): void;
10
+ _keyDownToggleHandler(event: any): Promise<void>;
11
11
  _handleToggleClick(): void;
12
+ /**
13
+ * @returns {import("../menu/Menu").LeuMenu}
14
+ */
15
+ _getMenu(): any;
12
16
  render(): import("lit-html").TemplateResult<1>;
13
17
  }
14
- import { LitElement } from 'lit';
18
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
15
19
  //# sourceMappingURL=Dropdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["Dropdown.js"],"names":[],"mappings":"AAuCA;;GAEG;AACH;IAKQ,kBAAqB;IAMzB,cAAe;IAEf,iBAAmB;IAarB,gCAIC;IACD,0BAIC;IACD,iCAIC;IACD,2BAEC;IACD,+CA2BC;CACF;2BAjHqC,KAAK"}
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"}