@statistikzh/leu 0.5.0 → 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 (240) hide show
  1. package/.husky/commit-msg +0 -3
  2. package/.husky/pre-commit +0 -3
  3. package/CHANGELOG.md +48 -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-da11d064.d.ts → Button-9692e403.d.ts} +10 -11
  11. package/dist/Button-9692e403.d.ts.map +1 -0
  12. package/dist/{Button-da11d064.js → Button-9692e403.js} +65 -62
  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 +73 -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.js.d.ts → index.d.ts} +3 -3
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/{index.js.js → index.js} +5 -14
  84. package/dist/leu-accordion.d.ts.map +1 -1
  85. package/dist/leu-accordion.js +2 -3
  86. package/dist/leu-breadcrumb.d.ts.map +1 -1
  87. package/dist/leu-breadcrumb.js +4 -10
  88. package/dist/leu-button-group.d.ts.map +1 -1
  89. package/dist/leu-button-group.js +2 -3
  90. package/dist/leu-button.d.ts +1 -1
  91. package/dist/leu-button.d.ts.map +1 -1
  92. package/dist/leu-button.js +4 -5
  93. package/dist/leu-checkbox-group.d.ts.map +1 -1
  94. package/dist/leu-checkbox-group.js +2 -3
  95. package/dist/leu-checkbox.d.ts.map +1 -1
  96. package/dist/leu-checkbox.js +3 -4
  97. package/dist/leu-chip-group.d.ts.map +1 -1
  98. package/dist/leu-chip-group.js +2 -3
  99. package/dist/leu-chip-link.d.ts.map +1 -1
  100. package/dist/leu-chip-link.js +2 -3
  101. package/dist/leu-chip-removable.d.ts.map +1 -1
  102. package/dist/leu-chip-removable.js +3 -4
  103. package/dist/leu-chip-selectable.d.ts.map +1 -1
  104. package/dist/leu-chip-selectable.js +2 -3
  105. package/dist/leu-dropdown.d.ts.map +1 -1
  106. package/dist/leu-dropdown.js +5 -10
  107. package/dist/leu-icon.d.ts +3 -0
  108. package/dist/leu-icon.d.ts.map +1 -0
  109. package/dist/leu-icon.js +7 -0
  110. package/dist/leu-input.d.ts.map +1 -1
  111. package/dist/leu-input.js +3 -4
  112. package/dist/leu-menu-item.d.ts.map +1 -1
  113. package/dist/leu-menu-item.js +3 -5
  114. package/dist/leu-menu.d.ts.map +1 -1
  115. package/dist/leu-menu.js +5 -3
  116. package/dist/leu-pagination.d.ts.map +1 -1
  117. package/dist/leu-pagination.js +4 -7
  118. package/dist/leu-popup.d.ts.map +1 -1
  119. package/dist/leu-popup.js +2 -3
  120. package/dist/leu-radio-group.d.ts.map +1 -1
  121. package/dist/leu-radio-group.js +2 -3
  122. package/dist/leu-radio.d.ts.map +1 -1
  123. package/dist/leu-radio.js +2 -3
  124. package/dist/leu-scroll-top.d.ts.map +1 -1
  125. package/dist/leu-scroll-top.js +4 -6
  126. package/dist/leu-select.d.ts.map +1 -1
  127. package/dist/leu-select.js +5 -13
  128. package/dist/leu-table.d.ts.map +1 -1
  129. package/dist/leu-table.js +4 -8
  130. package/dist/leu-visually-hidden.d.ts.map +1 -1
  131. package/dist/leu-visually-hidden.js +2 -3
  132. package/dist/theme.css +2 -0
  133. package/dist/vscode.html-custom-data.json +616 -0
  134. package/dist/vue/index.d.ts +682 -0
  135. package/dist/web-types.json +1211 -0
  136. package/package.json +10 -13
  137. package/rollup.config.js +1 -1
  138. package/scripts/generate-component/templates/[Name].js +6 -3
  139. package/scripts/generate-component/templates/test/[name].test.js +1 -1
  140. package/src/components/accordion/Accordion.js +13 -10
  141. package/src/components/accordion/leu-accordion.js +1 -2
  142. package/src/components/breadcrumb/Breadcrumb.js +31 -18
  143. package/src/components/breadcrumb/leu-breadcrumb.js +1 -2
  144. package/src/components/button/Button.js +45 -71
  145. package/src/components/button/button.css +19 -4
  146. package/src/components/button/leu-button.js +1 -2
  147. package/src/components/button/stories/button.stories.js +60 -19
  148. package/src/components/button/test/button.test.js +26 -63
  149. package/src/components/button-group/ButtonGroup.js +4 -2
  150. package/src/components/button-group/leu-button-group.js +1 -2
  151. package/src/components/checkbox/Checkbox.js +17 -11
  152. package/src/components/checkbox/CheckboxGroup.js +6 -3
  153. package/src/components/checkbox/leu-checkbox-group.js +1 -2
  154. package/src/components/checkbox/leu-checkbox.js +1 -2
  155. package/src/components/checkbox/stories/checkbox-group.stories.js +10 -26
  156. package/src/components/checkbox/stories/checkbox.stories.js +2 -7
  157. package/src/components/checkbox/test/checkbox-group.test.js +6 -21
  158. package/src/components/checkbox/test/checkbox.test.js +1 -12
  159. package/src/components/chip/Chip.js +5 -4
  160. package/src/components/chip/ChipGroup.js +10 -4
  161. package/src/components/chip/ChipLink.js +3 -7
  162. package/src/components/chip/ChipRemovable.js +8 -11
  163. package/src/components/chip/ChipSelectable.js +11 -17
  164. package/src/components/chip/chip.css +3 -4
  165. package/src/components/chip/leu-chip-group.js +1 -2
  166. package/src/components/chip/leu-chip-link.js +1 -2
  167. package/src/components/chip/leu-chip-removable.js +1 -2
  168. package/src/components/chip/leu-chip-selectable.js +1 -2
  169. package/src/components/chip/stories/chip-link.stories.js +3 -5
  170. package/src/components/chip/stories/chip-removable.stories.js +3 -4
  171. package/src/components/chip/stories/chip-selectable.stories.js +2 -2
  172. package/src/components/chip/test/chip-group.test.js +15 -30
  173. package/src/components/chip/test/chip-link.test.js +2 -6
  174. package/src/components/chip/test/chip-removable.test.js +4 -10
  175. package/src/components/chip/test/chip-selectable.test.js +3 -5
  176. package/src/components/dropdown/Dropdown.js +80 -26
  177. package/src/components/dropdown/dropdown.css +4 -0
  178. package/src/components/dropdown/leu-dropdown.js +1 -2
  179. package/src/components/dropdown/stories/dropdown.stories.js +30 -7
  180. package/src/components/dropdown/test/dropdown.test.js +5 -5
  181. package/src/components/icon/Icon.js +55 -0
  182. package/src/components/icon/icon.css +6 -0
  183. package/src/components/icon/leu-icon.js +5 -0
  184. package/src/components/icon/{icon.js → paths.js} +4 -37
  185. package/src/components/icon/stories/icon.stories.js +47 -0
  186. package/src/components/icon/test/icon.test.js +23 -40
  187. package/src/components/input/Input.js +21 -23
  188. package/src/components/input/input.css +4 -2
  189. package/src/components/input/leu-input.js +1 -2
  190. package/src/components/input/stories/input.stories.js +2 -2
  191. package/src/components/input/test/input.test.js +2 -0
  192. package/src/components/menu/Menu.js +143 -2
  193. package/src/components/menu/MenuItem.js +104 -52
  194. package/src/components/menu/leu-menu-item.js +1 -2
  195. package/src/components/menu/leu-menu.js +1 -2
  196. package/src/components/menu/menu-item.css +11 -4
  197. package/src/components/menu/stories/menu-item.stories.js +15 -4
  198. package/src/components/menu/stories/menu.stories.js +34 -7
  199. package/src/components/menu/test/menu-item.test.js +88 -82
  200. package/src/components/menu/test/menu.test.js +101 -8
  201. package/src/components/pagination/Pagination.js +27 -18
  202. package/src/components/pagination/leu-pagination.js +1 -2
  203. package/src/components/popup/Popup.js +39 -16
  204. package/src/components/popup/leu-popup.js +1 -2
  205. package/src/components/popup/popup.css +1 -0
  206. package/src/components/radio/Radio.js +12 -7
  207. package/src/components/radio/RadioGroup.js +6 -3
  208. package/src/components/radio/leu-radio-group.js +1 -2
  209. package/src/components/radio/leu-radio.js +1 -2
  210. package/src/components/radio/stories/radio-group.stories.js +5 -19
  211. package/src/components/radio/stories/radio.stories.js +2 -7
  212. package/src/components/radio/test/radio-group.test.js +6 -9
  213. package/src/components/radio/test/radio.test.js +3 -13
  214. package/src/components/scroll-top/ScrollTop.js +15 -5
  215. package/src/components/scroll-top/leu-scroll-top.js +1 -2
  216. package/src/components/select/Select.js +279 -175
  217. package/src/components/select/leu-select.js +1 -2
  218. package/src/components/select/select.css +20 -12
  219. package/src/components/select/stories/select.stories.js +16 -2
  220. package/src/components/select/test/select.test.js +191 -37
  221. package/src/components/table/Table.js +15 -9
  222. package/src/components/table/leu-table.js +1 -2
  223. package/src/components/table/table.css +3 -1
  224. package/src/components/visually-hidden/VisuallyHidden.js +6 -2
  225. package/src/components/visually-hidden/leu-visually-hidden.js +1 -2
  226. package/src/lib/LeuElement.js +23 -0
  227. package/src/lib/a11y.js +26 -0
  228. package/src/styles/custom-properties.css +2 -0
  229. package/web-test-runner.config.mjs +2 -0
  230. package/dist/Button-da11d064.d.ts.map +0 -1
  231. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +0 -3
  232. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +0 -1
  233. package/dist/_rollupPluginBabelHelpers-20f659f4.js +0 -30
  234. package/dist/defineElement-40372b4b.d.ts +0 -9
  235. package/dist/defineElement-40372b4b.d.ts.map +0 -1
  236. package/dist/defineElement-40372b4b.js +0 -15
  237. package/dist/icon-03e86700.d.ts +0 -11
  238. package/dist/icon-03e86700.d.ts.map +0 -1
  239. package/dist/index.js.d.ts.map +0 -1
  240. package/src/lib/defineElement.js +0 -13
package/.husky/commit-msg CHANGED
@@ -1,4 +1 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
1
  npx --no -- commitlint --edit ${1}
package/.husky/pre-commit CHANGED
@@ -1,4 +1 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
1
  npx lint-staged --verbose
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0](https://github.com/statistikZH/leu/compare/v0.5.1...v0.6.0) (2024-07-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **icon:** create an icon element ([0a8351c](https://github.com/statistikZH/leu/commit/0a8351c123c987572c2e187f492bf3a35ac53f27))
9
+ * **icon:** render a placeholder if the name of the icon is unknown or not set ([a7dae7c](https://github.com/statistikZH/leu/commit/a7dae7c318fd791ca1a0095487fe6ced64b51023))
10
+ * **menu-item:** implement getValue method ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
11
+ * **menu-item:** use hover and highlighted styling for focus too ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
12
+ * **menu:** avoid captured key events from navigating the whole page ([#191](https://github.com/statistikZH/leu/issues/191)) ([c40fc4e](https://github.com/statistikZH/leu/commit/c40fc4e4efbeafe3f30469adec1033484112e0d6))
13
+ * **menu:** implement roving tab index ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
14
+ * **menu:** move all focus handling to the menu component ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
15
+ * register dependency elements not before the dependent element ([4dfddcd](https://github.com/statistikZH/leu/commit/4dfddcd80e47bee5e047b3eee203d72e0e9d8fba))
16
+ * **select:** always close the popup when focus leaves the element ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
17
+ * **select:** set max height of the menu ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
18
+ * **select:** use arrow buttons to navigate to listbox from the text input field ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * buttons should inherit font-family ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
24
+ * **button:** set aria-expanded on the actual interactive element ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
25
+ * **dropdown:** replace hardcoded icon with a slot ([#189](https://github.com/statistikZH/leu/issues/189)) ([8954616](https://github.com/statistikZH/leu/commit/895461661a6b31a08868c166f3ed9474baed9a79))
26
+ * **icon:** mark icon as presentational so it won't be announced by screen readers ([#186](https://github.com/statistikZH/leu/issues/186)) ([5d3d427](https://github.com/statistikZH/leu/commit/5d3d427c8c856a0b01f9dfc9568065e64f2653fa))
27
+ * **icon:** remove faulty paths ([0a8351c](https://github.com/statistikZH/leu/commit/0a8351c123c987572c2e187f492bf3a35ac53f27))
28
+ * **input:** avoid overlap by hiding the label ([#182](https://github.com/statistikZH/leu/issues/182)) ([d4edc51](https://github.com/statistikZH/leu/commit/d4edc51a812f27a35e8ed2cb86df872dd91d2874))
29
+ * **menu-item:** allow disabled menu items to still be focusable ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
30
+ * **menu-item:** apply tab-index to the actual interactive element ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
31
+ * **menu-item:** only add aria attribute to the button element ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
32
+ * **menu-item:** remove deprecated properties before and after ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
33
+ * **menu-item:** use colors that are WCAG AA compliant ([5c59899](https://github.com/statistikZH/leu/commit/5c598990a40cd138bf47b1e0bf2c9026da1f4d87))
34
+ * **menu:** only add role when no role was defined before ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
35
+ * **popup:** define a z-index value for the popup content ([#184](https://github.com/statistikZH/leu/issues/184)) ([72ec681](https://github.com/statistikZH/leu/commit/72ec68109589759b5887f159a4df42ee265b4b65))
36
+ * **popup:** reflect properties to attributes ([#200](https://github.com/statistikZH/leu/issues/200)) ([44aec79](https://github.com/statistikZH/leu/commit/44aec79a8e8456240771da214d45440cc31891d7))
37
+ * **radio:** remove label property as it is not used anymore ([e105a6e](https://github.com/statistikZH/leu/commit/e105a6eec33392d5bddf0d32e9881375576597d6))
38
+ * **select:** add background to apply button ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
39
+ * **select:** move leu-menu element into the shadow dom so the role is fully controlled ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
40
+ * **select:** only call focus if the element is available ([5c59899](https://github.com/statistikZH/leu/commit/5c598990a40cd138bf47b1e0bf2c9026da1f4d87))
41
+ * **select:** set correct aria attributes ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
42
+
43
+ ## [0.5.1](https://github.com/statistikZH/leu/compare/v0.5.0...v0.5.1) (2024-05-23)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * **button:** truncate the label instead of wrapping it ([4118c0b](https://github.com/statistikZH/leu/commit/4118c0b117532615c5254d6849d8740ef43cb30f))
49
+ * **dropdown:** limit button width to allow the label to be truncated ([4118c0b](https://github.com/statistikZH/leu/commit/4118c0b117532615c5254d6849d8740ef43cb30f))
50
+
3
51
  ## [0.5.0](https://github.com/statistikZH/leu/compare/v0.4.0...v0.5.0) (2024-05-02)
4
52
 
5
53
 
@@ -1,22 +1,23 @@
1
1
  /**
2
2
  * @tagname leu-accordion
3
3
  * @slot content - The content of the accordion. No styles will be applied to the content.
4
- * @prop {Number} headingLevel - The heading level of the accordion title. Must be between 1 and 6.
5
- * @prop {Boolean} open - The expanded state of the accordion.
6
- * @prop {String} label - The label (title) of the accordion.
7
- * @prop {String} labelPrefix - The prefix of the accordion label. e.g. "01"
8
- * @attr {Number} heading-level - The heading level of the accordion title. Must be between 1 and 6.
9
- * @attr {String} label-prefix - The prefix of the accordion label. e.g. "01"
4
+ * @prop {number} headingLevel - The heading level of the accordion title. Must be between 1 and 6.
5
+ * @prop {boolean} open - The expanded state of the accordion.
6
+ * @prop {string} label - The label (title) of the accordion.
7
+ * @prop {string} labelPrefix - The prefix of the accordion label. e.g. "01"
8
+ * @attr {number} heading-level - The heading level of the accordion title. Must be between 1 and 6.
9
+ * @attr {string} label-prefix - The prefix of the accordion label. e.g. "01"
10
10
  */
11
- export class LeuAccordion extends LitElement {
11
+ export class LeuAccordion extends LeuElement {
12
12
  headingLevel: number;
13
13
  open: boolean;
14
14
  label: string;
15
+ labelPrefix: string;
15
16
  /**
16
17
  * Determines the heading tag of the accordion toggle.
17
18
  * The headingLevel shouldn't be used directly to render the heading tag
18
19
  * in order to avoid XSS issues.
19
- * @returns {String} The heading tag of the accordion toggle.
20
+ * @returns {string} The heading tag of the accordion toggle.
20
21
  * @internal
21
22
  */
22
23
  _getHeadingTag(): string;
@@ -27,5 +28,5 @@ export class LeuAccordion extends LitElement {
27
28
  _handleToggleClick(): void;
28
29
  render(): import("lit-html").TemplateResult;
29
30
  }
30
- import { LitElement } from 'lit';
31
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
31
32
  //# sourceMappingURL=Accordion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["Accordion.js"],"names":[],"mappings":"AA+JA;;;;;;;;;GASG;AACH;IAGI,qBAAqB;IACrB,cAAiB;IACjB,cAAe;IAGjB;;;;;;OAMG;IACH,yBAMC;IAED;;;OAGG;IACH,2BAEC;IACD,4CA2BC;CAEF;2BAnOwC,KAAK"}
1
+ {"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["Accordion.js"],"names":[],"mappings":"AA+JA;;;;;;;;;GASG;AACH;IAGI,qBAAqB;IACrB,cAAiB;IACjB,cAAe;IACf,oBAAqB;IAGvB;;;;;;OAMG;IACH,kBAHa,MAAM,CASlB;IAED;;;OAGG;IACH,2BAEC;IACD,4CA2BC;CAEF;gCArOqD,0BAA0B"}
package/dist/Accordion.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, nothing } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
2
+ import { css, nothing } from 'lit';
3
3
  import { html, unsafeStatic } from 'lit/static-html.js';
4
4
 
5
5
  var css_248z = css`:host,
@@ -160,26 +160,27 @@ slot[name="content"] {
160
160
  /**
161
161
  * @tagname leu-accordion
162
162
  * @slot content - The content of the accordion. No styles will be applied to the content.
163
- * @prop {Number} headingLevel - The heading level of the accordion title. Must be between 1 and 6.
164
- * @prop {Boolean} open - The expanded state of the accordion.
165
- * @prop {String} label - The label (title) of the accordion.
166
- * @prop {String} labelPrefix - The prefix of the accordion label. e.g. "01"
167
- * @attr {Number} heading-level - The heading level of the accordion title. Must be between 1 and 6.
168
- * @attr {String} label-prefix - The prefix of the accordion label. e.g. "01"
163
+ * @prop {number} headingLevel - The heading level of the accordion title. Must be between 1 and 6.
164
+ * @prop {boolean} open - The expanded state of the accordion.
165
+ * @prop {string} label - The label (title) of the accordion.
166
+ * @prop {string} labelPrefix - The prefix of the accordion label. e.g. "01"
167
+ * @attr {number} heading-level - The heading level of the accordion title. Must be between 1 and 6.
168
+ * @attr {string} label-prefix - The prefix of the accordion label. e.g. "01"
169
169
  */
170
- class LeuAccordion extends LitElement {
170
+ class LeuAccordion extends LeuElement {
171
171
  constructor() {
172
172
  super();
173
173
  this.headingLevel = 2;
174
174
  this.open = false;
175
175
  this.label = "";
176
+ this.labelPrefix = "";
176
177
  }
177
178
 
178
179
  /**
179
180
  * Determines the heading tag of the accordion toggle.
180
181
  * The headingLevel shouldn't be used directly to render the heading tag
181
182
  * in order to avoid XSS issues.
182
- * @returns {String} The heading tag of the accordion toggle.
183
+ * @returns {string} The heading tag of the accordion toggle.
183
184
  * @internal
184
185
  */
185
186
  _getHeadingTag() {
@@ -230,7 +231,7 @@ class LeuAccordion extends LitElement {
230
231
  _defineProperty(LeuAccordion, "styles", css_248z);
231
232
  /** @internal */
232
233
  _defineProperty(LeuAccordion, "shadowRootOptions", {
233
- ...LitElement.shadowRootOptions,
234
+ ...LeuElement.shadowRootOptions,
234
235
  delegatesFocus: true
235
236
  });
236
237
  _defineProperty(LeuAccordion, "properties", {
@@ -28,18 +28,18 @@
28
28
  *
29
29
  *
30
30
  * @prop {Array} items - Object array with { label, href }
31
- * @prop {Boolean} inverted - invert color on dark background
31
+ * @prop {boolean} inverted - invert color on dark background
32
32
  *
33
33
  * @tagname leu-breadcrumb
34
34
  */
35
- export class LeuBreadcrumb extends LitElement {
35
+ export class LeuBreadcrumb extends LeuElement {
36
36
  _lastContainerWidth: any;
37
37
  _showBackOnly: boolean;
38
38
  _isRecalculating: boolean;
39
39
  _hiddenItems: number;
40
40
  _isDropdownOpen: boolean;
41
41
  items: any[];
42
- /** @type {Boolean} - will be used on dark Background */
42
+ /** @type {boolean} - will be used on dark Background */
43
43
  inverted: boolean;
44
44
  /** @internal */
45
45
  _containerRef: import("lit-html/directives/ref.js").Ref<Element>;
@@ -64,6 +64,6 @@ export class LeuBreadcrumb extends LitElement {
64
64
  renderDropdown(): import("lit-html").TemplateResult<1> | typeof nothing;
65
65
  render(): import("lit-html").TemplateResult<1> | typeof nothing;
66
66
  }
67
- import { LitElement } from 'lit';
67
+ import { L as LeuElement } from './LeuElement-6de6f209.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":"AA+HA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IAOM,yBAA+C;IAO7C,uBAAyB;IACzB,0BAA6B;IAY7B,qBAAqB;IASvB,yBAA4C;IAW9C,aAAe;IACf,wDAAwD;IACxD,kBAAqB;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,wEAoCC;IACD,gEAiCC;CACF;2BA7W8C,KAAK;wBAAL,KAAK"}
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,21 +1,15 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, nothing, html } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
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';
5
- import { I as Icon } from './icon-03e86700.js';
6
- import './leu-menu.js';
7
- import './leu-menu-item.js';
8
- import './leu-popup.js';
9
- import './leu-visually-hidden.js';
10
5
  import { d as debounce } from './utils-65469421.js';
11
- import './defineElement-40372b4b.js';
12
- import './Menu.js';
13
- import './MenuItem.js';
14
- import 'lit/static-html.js';
6
+ import { LeuIcon } from './Icon.js';
7
+ import { LeuMenu } from './Menu.js';
8
+ import { LeuMenuItem } from './MenuItem.js';
9
+ import { LeuPopup } from './Popup.js';
10
+ import { LeuVisuallyHidden } from './VisuallyHidden.js';
15
11
  import 'lit/directives/if-defined.js';
16
- import './Popup.js';
17
12
  import '@floating-ui/dom';
18
- import './VisuallyHidden.js';
19
13
 
20
14
  var css_248z = css`:host,
21
15
  :host * {
@@ -26,8 +20,6 @@ var css_248z = css`:host,
26
20
  --breadcrumb-font-regular: var(--leu-font-family-regular);
27
21
  --breadcrumb-font-black: var(--leu-font-family-black);
28
22
 
29
- font-family: var(--leu-font-family-regular);
30
-
31
23
  font-family: var(--breadcrumb-font-regular);
32
24
  line-height: 1.5;
33
25
  color: var(--leu-color-black-100);
@@ -155,11 +147,11 @@ var css_248z = css`:host,
155
147
  *
156
148
  *
157
149
  * @prop {Array} items - Object array with { label, href }
158
- * @prop {Boolean} inverted - invert color on dark background
150
+ * @prop {boolean} inverted - invert color on dark background
159
151
  *
160
152
  * @tagname leu-breadcrumb
161
153
  */
162
- class LeuBreadcrumb extends LitElement {
154
+ class LeuBreadcrumb extends LeuElement {
163
155
  constructor() {
164
156
  super();
165
157
  /** @type {Array} */
@@ -207,7 +199,7 @@ class LeuBreadcrumb extends LitElement {
207
199
  window.removeEventListener("click", this._closeDropdown);
208
200
  });
209
201
  this.items = [];
210
- /** @type {Boolean} - will be used on dark Background */
202
+ /** @type {boolean} - will be used on dark Background */
211
203
  this.inverted = false;
212
204
 
213
205
  /** @internal */
@@ -297,7 +289,9 @@ class LeuBreadcrumb extends LitElement {
297
289
  if (this._dropdownItems.length === 0 && !this._isRecalculating) return nothing;
298
290
  return html`
299
291
  <li class="breadcrumbs__item" data-dropdown-toggle>
300
- <span class="breadcrumbs__icon">${Icon("angleRight")}</span>
292
+ <span class="breadcrumbs__icon"
293
+ ><leu-icon name="angleRight"></leu-icon
294
+ ></span>
301
295
  <leu-popup
302
296
  ?active=${this._isDropdownOpen}
303
297
  placement="bottom-start"
@@ -318,10 +312,9 @@ class LeuBreadcrumb extends LitElement {
318
312
  ${html`
319
313
  <leu-menu>
320
314
  ${this._dropdownItems.map(item => html`
321
- <leu-menu-item
322
- label=${item.label}
323
- href=${item.href}
324
- ></leu-menu-item>
315
+ <leu-menu-item href=${item.href}
316
+ >${item.label}</leu-menu-item
317
+ >
325
318
  `)}
326
319
  </leu-menu>
327
320
  `}
@@ -343,15 +336,17 @@ class LeuBreadcrumb extends LitElement {
343
336
  <leu-visually-hidden><h2>Sie sind hier:</h2></leu-visually-hidden>
344
337
  <ol class="breadcrumbs__list" ref=${ref(this._containerRef)}>
345
338
  ${showBackOnly ? html` <li class="breadcrumbs__item breadcrumbs__item--back">
346
- <span class="breadcrumbs__icon">${Icon("arrowLeft")}</span>
339
+ <span class="breadcrumbs__icon"
340
+ ><leu-icon name="arrowLeft"></leu-icon
341
+ ></span>
347
342
  <a class="breadcrumbs__link" href=${parentItem.href}
348
343
  >${parentItem.label}</a
349
344
  >
350
345
  </li>` : this._listItems.map((item, index, list) => html`
351
346
  <li class="breadcrumbs__item">
352
347
  ${index > 0 ? html`<span class="breadcrumbs__icon"
353
- >${Icon("angleRight")}</span
354
- >` // First list item doesn't have an arrow
348
+ ><leu-icon name="angleRight"></leu-icon
349
+ ></span>` // First list item doesn't have an arrow
355
350
  : nothing}
356
351
  ${index === list.length - 1 ? item.label // Last list item doesn't contain a link
357
352
  : html`<a class="breadcrumbs__link" href=${item.href}
@@ -365,6 +360,13 @@ class LeuBreadcrumb extends LitElement {
365
360
  `;
366
361
  }
367
362
  }
363
+ _defineProperty(LeuBreadcrumb, "dependencies", {
364
+ "leu-icon": LeuIcon,
365
+ "leu-menu": LeuMenu,
366
+ "leu-menu-item": LeuMenuItem,
367
+ "leu-popup": LeuPopup,
368
+ "leu-visually-hidden": LeuVisuallyHidden
369
+ });
368
370
  _defineProperty(LeuBreadcrumb, "styles", css_248z);
369
371
  _defineProperty(LeuBreadcrumb, "properties", {
370
372
  items: {
@@ -37,19 +37,20 @@ declare class HasSlotController implements ReactiveController {
37
37
  }
38
38
  /**
39
39
  * @tagname leu-button
40
+ * @slot before - The icon to display before the label
41
+ * @slot after - The icon to display after the label
42
+ * @slot - The label of the button or the icon if no label is set
40
43
  */
41
- declare class LeuButton extends LitElement {
44
+ declare class LeuButton extends LeuElement {
42
45
  label: any;
43
46
  /** @type {string} */
44
- icon: string;
45
- /** @type {("before" | "after")} - Only taken into account if Label and no Icon is set */
46
- iconPosition: ("before" | "after");
47
- /** @type {string} */
48
47
  size: string;
49
48
  /** @type {string} */
50
49
  variant: string;
51
50
  /** @type {"button" | "submit" | "reset"} */
52
51
  type: "button" | "submit" | "reset";
52
+ /** @type {string} */
53
+ componentRole: string;
53
54
  /** @type {boolean} */
54
55
  disabled: boolean;
55
56
  /** @type {boolean} - Only taken into account if no Label and an Icon is set */
@@ -65,20 +66,18 @@ declare class LeuButton extends LitElement {
65
66
  * @type {("true" | "false" | undefined)}
66
67
  */
67
68
  expanded: ("true" | "false" | undefined);
68
- getIconSize(): 16 | 24;
69
- renderIconBefore(): import("lit-html").TemplateResult<1> | typeof nothing;
70
- renderIconAfter(): import("lit-html").TemplateResult<1> | typeof nothing;
71
69
  renderExpandingIcon(): import("lit-html").TemplateResult<1> | typeof nothing;
72
70
  getAriaAttributes(): {
73
- role: any;
71
+ role: string;
74
72
  label: any;
75
73
  };
74
+ hasTextContent(): boolean;
76
75
  render(): import("lit-html").TemplateResult<1>;
77
76
  }
78
77
  declare const BUTTON_SIZES: string[];
79
78
  declare const BUTTON_TYPES: string[];
80
79
  declare const BUTTON_EXPANDED_OPTIONS: string[];
81
- import { LitElement } from 'lit';
80
+ import { L as LeuElement } from './LeuElement-6de6f209.js';
82
81
  import { nothing } from 'lit';
83
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 };
84
- //# sourceMappingURL=Button-da11d064.d.ts.map
83
+ //# sourceMappingURL=Button-9692e403.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button-9692e403.d.ts","sourceRoot":"","sources":["Button-9692e403.js"],"names":[],"mappings":";;;iCAaa,OAAO,KAAK,EAAE,kBAAkB;AAyW7C,wCAA0D;AAhX1D;;;GAGG;AAEH;;;;GAIG;AACH,2CAFgB,kBAAkB;IAGhC,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,8 +1,8 @@
1
- import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
2
- import { css, LitElement, html, nothing } from 'lit';
1
+ import { _ as _defineProperty, L as LeuElement } from './LeuElement-6de6f209.js';
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';
5
- import { I as Icon } from './icon-03e86700.js';
5
+ import { LeuIcon } from './Icon.js';
6
6
 
7
7
  /**
8
8
  * Thanks Shoelace!
@@ -76,6 +76,18 @@ class HasSlotController {
76
76
  }
77
77
  }
78
78
 
79
+ /**
80
+ * All roles that are associated with a aria-checked attribute
81
+ * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
82
+ */
83
+ const ARIA_CHECKED_ROLES = ["checkbox", "menuitemcheckbox", "menuitemradio", "option", "radio", "switch"];
84
+
85
+ /**
86
+ * All roles that are associated with a aria-selected attribute
87
+ * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
88
+ */
89
+ const ARIA_SELECTED_ROLES = ["gridcell", "option", "row", "tab", "columnheader", "rowheader", "treeitem"];
90
+
79
91
  var css_248z = css`:host {
80
92
  display: inline-block;
81
93
  }
@@ -90,12 +102,21 @@ button {
90
102
  cursor: pointer;
91
103
  border: 1px solid transparent;
92
104
  border-radius: 2px;
105
+
106
+ max-width: 100%;
93
107
  display: flex;
94
108
  align-items: center;
95
109
  -moz-column-gap: 8px;
96
110
  column-gap: 8px;
97
111
  }
98
112
 
113
+ .content {
114
+ flex: 1 1 0;
115
+ overflow: hidden;
116
+ text-overflow: ellipsis;
117
+ white-space: nowrap;
118
+ }
119
+
99
120
  button.round {
100
121
  border-radius: 50%;
101
122
  }
@@ -127,7 +148,7 @@ button.regular {
127
148
  line-height: 24px;
128
149
  }
129
150
 
130
- button.regular.icon {
151
+ button.regular.icon-only {
131
152
  padding: 12px;
132
153
  }
133
154
 
@@ -137,9 +158,11 @@ button.small {
137
158
  padding: 6px 24px;
138
159
  font-size: 14px;
139
160
  line-height: 20px;
161
+
162
+ --leu-icon-size: 1rem;
140
163
  }
141
164
 
142
- button.small.icon {
165
+ button.small.icon-only {
143
166
  padding: 8px;
144
167
  }
145
168
 
@@ -198,6 +221,8 @@ button.secondary:disabled {
198
221
  /* ghost */
199
222
 
200
223
  button.ghost {
224
+ --leu-icon-size: 1rem;
225
+
201
226
  background: transparent;
202
227
  padding: 0 0.5rem;
203
228
  color: var(--leu-color-black-60);
@@ -280,11 +305,13 @@ button.ghost.inverted:disabled {
280
305
 
281
306
  /* icon-wrapper */
282
307
 
283
- .icon-wrapper svg {
308
+ .icon-wrapper leu-icon {
284
309
  display: block;
285
310
  }
286
311
 
287
- .ghost .icon-wrapper--before, .ghost .icon-wrapper--after {
312
+ .ghost.icon-before .icon-wrapper--before,
313
+ .ghost.icon-after .icon-wrapper--after {
314
+ display: block;
288
315
  padding: 0.5rem;
289
316
  border-radius: 50%;
290
317
  background: var(--leu-color-black-transp-10);
@@ -354,41 +381,31 @@ Object.freeze(BUTTON_TYPES);
354
381
  const BUTTON_EXPANDED_OPTIONS = ["true", "false"];
355
382
  Object.freeze(BUTTON_EXPANDED_OPTIONS);
356
383
 
357
- /**
358
- * All roles that are associated with a aria-checked attribute
359
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
360
- */
361
- const ARIA_ROLES_CHECKED = ["checkbox", "menuitemcheckbox", "menuitemradio", "option", "radio", "switch"];
362
-
363
- /**
364
- * All roles that are associated with a aria-selected attribute
365
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
366
- */
367
- const ARIA_ROLES_SELECTED = ["gridcell", "option", "row", "tab", "columnheader", "rowheader", "treeitem"];
368
-
369
384
  /**
370
385
  * @tagname leu-button
386
+ * @slot before - The icon to display before the label
387
+ * @slot after - The icon to display after the label
388
+ * @slot - The label of the button or the icon if no label is set
371
389
  */
372
- class LeuButton extends LitElement {
390
+ class LeuButton extends LeuElement {
373
391
  constructor() {
374
392
  super();
375
393
  /** @type {string} */
376
394
  /**
377
395
  * @internal
378
396
  */
379
- _defineProperty(this, "hasSlotController", new HasSlotController(this, ["[default]"]));
397
+ _defineProperty(this, "hasSlotController", new HasSlotController(this, ["before", "after", "[default]"]));
380
398
  this.label = null;
381
399
  /** @type {string} */
382
- this.icon = null;
383
- /** @type {("before" | "after")} - Only taken into account if Label and no Icon is set */
384
- this.iconPosition = "before";
385
- /** @type {string} */
386
400
  this.size = "regular";
387
401
  /** @type {string} */
388
402
  this.variant = "primary";
389
403
  /** @type {"button" | "submit" | "reset"} */
390
404
  this.type = "button";
391
405
 
406
+ /** @type {string} */
407
+ this.componentRole = undefined;
408
+
392
409
  /** @type {boolean} */
393
410
  this.disabled = false;
394
411
  /** @type {boolean} - Only taken into account if no Label and an Icon is set */
@@ -407,29 +424,10 @@ class LeuButton extends LitElement {
407
424
  */
408
425
  this.expanded = undefined;
409
426
  }
410
- getIconSize() {
411
- return this.size === "small" || this.variant === "ghost" ? 16 : 24;
412
- }
413
- renderIconBefore() {
414
- if (this.icon && this.iconPosition === "before") {
415
- return html`<div class="icon-wrapper icon-wrapper--before">
416
- ${Icon(this.icon, this.getIconSize())}
417
- </div>`;
418
- }
419
- return nothing;
420
- }
421
- renderIconAfter() {
422
- if (this.icon && this.iconPosition === "after") {
423
- return html`<div class="icon-wrapper icon-wrapper--after">
424
- ${Icon(this.icon, this.getIconSize())}
425
- </div>`;
426
- }
427
- return nothing;
428
- }
429
427
  renderExpandingIcon() {
430
428
  if (typeof this.expanded !== "undefined" && this.variant === "ghost") {
431
429
  return html`<div class="icon-wrapper icon-wrapper--expanded">
432
- ${Icon("angleDropDown", 24)}
430
+ <leu-icon name="angleDropDown" size="24"></leu-icon>
433
431
  </div>`;
434
432
  }
435
433
  return nothing;
@@ -440,20 +438,28 @@ class LeuButton extends LitElement {
440
438
  label: this.label
441
439
  };
442
440
  if (this.componentRole) {
443
- if (ARIA_ROLES_CHECKED.includes(this.componentRole)) {
441
+ if (ARIA_CHECKED_ROLES.includes(this.componentRole)) {
444
442
  attributes.checked = this.active ? "true" : "false";
445
- } else if (ARIA_ROLES_SELECTED.includes(this.componentRole)) {
443
+ } else if (ARIA_SELECTED_ROLES.includes(this.componentRole)) {
446
444
  attributes.selected = this.active ? "true" : "false";
447
445
  }
448
446
  }
449
447
  return attributes;
450
448
  }
449
+ hasTextContent() {
450
+ return Array.from(this.childNodes).some(node => node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "");
451
+ }
451
452
  render() {
452
- const hasContent = this.hasSlotController.test("[default]");
453
+ const hasTextContent = this.hasTextContent();
454
+ const hasIconDefault = Boolean(this.querySelector("leu-icon"));
455
+ const hasIconBefore = this.hasSlotController.test("before");
456
+ const hasIconAfter = this.hasSlotController.test("after");
453
457
  const aria = this.getAriaAttributes();
454
458
  const cssClasses = {
455
- icon: !hasContent && this.icon,
456
- round: !hasContent && this.icon && this.round,
459
+ "icon-only": hasIconDefault && !hasTextContent,
460
+ "icon-before": hasIconBefore,
461
+ "icon-after": hasIconAfter,
462
+ round: this.round,
457
463
  active: this.active,
458
464
  inverted: this.inverted,
459
465
  [this.variant]: true,
@@ -464,24 +470,29 @@ class LeuButton extends LitElement {
464
470
  aria-label=${ifDefined(aria.label)}
465
471
  aria-selected=${ifDefined(aria.selected)}
466
472
  aria-checked=${ifDefined(aria.checked)}
473
+ aria-expanded=${ifDefined(this.expanded)}
467
474
  role=${ifDefined(aria.role)}
468
475
  class=${classMap(cssClasses)}
469
476
  ?disabled=${this.disabled}
470
477
  type=${this.type}
471
478
  >
472
- ${this.renderIconBefore()}
473
- <slot></slot>
474
- ${this.renderIconAfter()} ${this.renderExpandingIcon()}
479
+ <slot name="before" class="icon-wrapper icon-wrapper--before"></slot>
480
+ <span class="content"><slot></slot></span>
481
+ <slot name="after" class="icon-wrapper icon-wrapper--after"></slot>
482
+ ${this.renderExpandingIcon()}
475
483
  </button>
476
484
  `;
477
485
  }
478
486
  }
487
+ _defineProperty(LeuButton, "dependencies", {
488
+ "leu-icon": LeuIcon
489
+ });
479
490
  _defineProperty(LeuButton, "styles", css_248z);
480
491
  /**
481
492
  * @internal
482
493
  */
483
494
  _defineProperty(LeuButton, "shadowRootOptions", {
484
- ...LitElement.shadowRootOptions,
495
+ ...LeuElement.shadowRootOptions,
485
496
  delegatesFocus: true
486
497
  });
487
498
  _defineProperty(LeuButton, "properties", {
@@ -489,14 +500,6 @@ _defineProperty(LeuButton, "properties", {
489
500
  type: String,
490
501
  reflect: true
491
502
  },
492
- icon: {
493
- type: String,
494
- reflect: true
495
- },
496
- iconPosition: {
497
- type: String,
498
- reflect: true
499
- },
500
503
  size: {
501
504
  type: String,
502
505
  reflect: true
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-da11d064.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-9692e403.js";
2
2
  //# sourceMappingURL=Button.d.ts.map
package/dist/Button.js CHANGED
@@ -1,6 +1,6 @@
1
- import './_rollupPluginBabelHelpers-20f659f4.js';
1
+ import './LeuElement-6de6f209.js';
2
2
  import 'lit';
3
3
  import 'lit/directives/class-map.js';
4
4
  import 'lit/directives/if-defined.js';
5
- import './icon-03e86700.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-da11d064.js';
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';