@statistikzh/leu 0.5.1 → 0.7.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 +54 -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 -24
  10. package/dist/{Button-5326c982.d.ts → Button-7370f901.d.ts} +10 -11
  11. package/dist/Button-7370f901.d.ts.map +1 -0
  12. package/dist/{Button-5326c982.js → Button-7370f901.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 -17
  21. package/dist/CheckboxGroup.d.ts +2 -2
  22. package/dist/CheckboxGroup.d.ts.map +1 -1
  23. package/dist/CheckboxGroup.js +4 -4
  24. package/dist/Chip.d.ts +2 -2
  25. package/dist/Chip.d.ts.map +1 -1
  26. package/dist/Chip.js +23 -28
  27. package/dist/ChipGroup.d.ts +16 -8
  28. package/dist/ChipGroup.d.ts.map +1 -1
  29. package/dist/ChipGroup.js +39 -9
  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 +12 -2
  37. package/dist/ChipSelectable.d.ts.map +1 -1
  38. package/dist/ChipSelectable.js +24 -26
  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 +116 -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 +13 -17
  46. package/dist/Input.d.ts.map +1 -1
  47. package/dist/Input.js +33 -24
  48. package/dist/LeuElement-ba5ea33d.d.ts +7 -0
  49. package/dist/LeuElement-ba5ea33d.d.ts.map +1 -0
  50. package/dist/{_rollupPluginBabelHelpers-20f659f4.js → LeuElement-ba5ea33d.js} +20 -1
  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 -17
  63. package/dist/Radio.d.ts +4 -2
  64. package/dist/Radio.d.ts.map +1 -1
  65. package/dist/Radio.js +9 -14
  66. package/dist/RadioGroup.d.ts +2 -2
  67. package/dist/RadioGroup.d.ts.map +1 -1
  68. package/dist/RadioGroup.js +20 -11
  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 -181
  75. package/dist/Table.d.ts +2 -6
  76. package/dist/Table.d.ts.map +1 -1
  77. package/dist/Table.js +16 -16
  78. package/dist/VisuallyHidden.d.ts +2 -2
  79. package/dist/VisuallyHidden.d.ts.map +1 -1
  80. package/dist/VisuallyHidden.js +3 -3
  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 +124 -74
  133. package/dist/vue/index.d.ts +83 -67
  134. package/dist/web-types.json +256 -142
  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 +38 -8
  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 +23 -27
  162. package/src/components/chip/chip.css +19 -20
  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-group.stories.js +6 -9
  168. package/src/components/chip/stories/chip-link.stories.js +3 -5
  169. package/src/components/chip/stories/chip-removable.stories.js +3 -4
  170. package/src/components/chip/stories/chip-selectable.stories.js +3 -3
  171. package/src/components/chip/test/chip-group.test.js +82 -30
  172. package/src/components/chip/test/chip-link.test.js +2 -6
  173. package/src/components/chip/test/chip-removable.test.js +4 -10
  174. package/src/components/chip/test/chip-selectable.test.js +10 -12
  175. package/src/components/dropdown/Dropdown.js +79 -26
  176. package/src/components/dropdown/leu-dropdown.js +1 -2
  177. package/src/components/dropdown/stories/dropdown.stories.js +30 -7
  178. package/src/components/dropdown/test/dropdown.test.js +5 -5
  179. package/src/components/icon/Icon.js +55 -0
  180. package/src/components/icon/icon.css +6 -0
  181. package/src/components/icon/leu-icon.js +5 -0
  182. package/src/components/icon/{icon.js → paths.js} +4 -37
  183. package/src/components/icon/stories/icon.stories.js +47 -0
  184. package/src/components/icon/test/icon.test.js +23 -40
  185. package/src/components/input/Input.js +31 -20
  186. package/src/components/input/input.css +4 -2
  187. package/src/components/input/leu-input.js +1 -2
  188. package/src/components/input/stories/input.stories.js +5 -5
  189. package/src/components/input/test/input.test.js +22 -0
  190. package/src/components/menu/Menu.js +143 -2
  191. package/src/components/menu/MenuItem.js +104 -52
  192. package/src/components/menu/leu-menu-item.js +1 -2
  193. package/src/components/menu/leu-menu.js +1 -2
  194. package/src/components/menu/menu-item.css +11 -4
  195. package/src/components/menu/stories/menu-item.stories.js +15 -4
  196. package/src/components/menu/stories/menu.stories.js +34 -7
  197. package/src/components/menu/test/menu-item.test.js +88 -82
  198. package/src/components/menu/test/menu.test.js +101 -8
  199. package/src/components/pagination/Pagination.js +27 -18
  200. package/src/components/pagination/leu-pagination.js +1 -2
  201. package/src/components/popup/Popup.js +39 -16
  202. package/src/components/popup/leu-popup.js +1 -2
  203. package/src/components/popup/popup.css +1 -0
  204. package/src/components/radio/Radio.js +12 -7
  205. package/src/components/radio/RadioGroup.js +18 -12
  206. package/src/components/radio/leu-radio-group.js +1 -2
  207. package/src/components/radio/leu-radio.js +1 -2
  208. package/src/components/radio/stories/radio-group.stories.js +5 -19
  209. package/src/components/radio/stories/radio.stories.js +2 -7
  210. package/src/components/radio/test/radio-group.test.js +6 -9
  211. package/src/components/radio/test/radio.test.js +3 -13
  212. package/src/components/scroll-top/ScrollTop.js +15 -5
  213. package/src/components/scroll-top/leu-scroll-top.js +1 -2
  214. package/src/components/select/Select.js +279 -175
  215. package/src/components/select/leu-select.js +1 -2
  216. package/src/components/select/select.css +20 -12
  217. package/src/components/select/stories/select.stories.js +16 -2
  218. package/src/components/select/test/select.test.js +191 -37
  219. package/src/components/table/Table.js +15 -9
  220. package/src/components/table/leu-table.js +1 -2
  221. package/src/components/table/table.css +3 -1
  222. package/src/components/visually-hidden/VisuallyHidden.js +6 -2
  223. package/src/components/visually-hidden/leu-visually-hidden.js +1 -2
  224. package/src/lib/LeuElement.js +23 -0
  225. package/src/lib/a11y.js +26 -0
  226. package/src/styles/custom-properties.css +2 -0
  227. package/web-test-runner.config.mjs +2 -0
  228. package/dist/Button-5326c982.d.ts.map +0 -1
  229. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +0 -3
  230. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +0 -1
  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
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,59 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.0](https://github.com/statistikZH/leu/compare/v0.6.0...v0.7.0) (2024-07-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * **chip-group:** implement value setter ([dd1557a](https://github.com/statistikZH/leu/commit/dd1557ab1063ec7421a74057c489529b26e6d805))
9
+ * **input:** add inputAsNumber getter that matches the native inputs method with the same name ([552f1ff](https://github.com/statistikZH/leu/commit/552f1ff18680c6a2866c7813fe40c462ea834802))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **chip-group:** handle the chip children during the event capture phase ([552f1ff](https://github.com/statistikZH/leu/commit/552f1ff18680c6a2866c7813fe40c462ea834802))
15
+ * **radio-group:** handle the radio children during the event capture phase ([552f1ff](https://github.com/statistikZH/leu/commit/552f1ff18680c6a2866c7813fe40c462ea834802))
16
+
17
+ ## [0.6.0](https://github.com/statistikZH/leu/compare/v0.5.1...v0.6.0) (2024-07-01)
18
+
19
+
20
+ ### Features
21
+
22
+ * **icon:** create an icon element ([0a8351c](https://github.com/statistikZH/leu/commit/0a8351c123c987572c2e187f492bf3a35ac53f27))
23
+ * **icon:** render a placeholder if the name of the icon is unknown or not set ([a7dae7c](https://github.com/statistikZH/leu/commit/a7dae7c318fd791ca1a0095487fe6ced64b51023))
24
+ * **menu-item:** implement getValue method ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
25
+ * **menu-item:** use hover and highlighted styling for focus too ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
26
+ * **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))
27
+ * **menu:** implement roving tab index ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
28
+ * **menu:** move all focus handling to the menu component ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
29
+ * register dependency elements not before the dependent element ([4dfddcd](https://github.com/statistikZH/leu/commit/4dfddcd80e47bee5e047b3eee203d72e0e9d8fba))
30
+ * **select:** always close the popup when focus leaves the element ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
31
+ * **select:** set max height of the menu ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
32
+ * **select:** use arrow buttons to navigate to listbox from the text input field ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * buttons should inherit font-family ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
38
+ * **button:** set aria-expanded on the actual interactive element ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
39
+ * **dropdown:** replace hardcoded icon with a slot ([#189](https://github.com/statistikZH/leu/issues/189)) ([8954616](https://github.com/statistikZH/leu/commit/895461661a6b31a08868c166f3ed9474baed9a79))
40
+ * **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))
41
+ * **icon:** remove faulty paths ([0a8351c](https://github.com/statistikZH/leu/commit/0a8351c123c987572c2e187f492bf3a35ac53f27))
42
+ * **input:** avoid overlap by hiding the label ([#182](https://github.com/statistikZH/leu/issues/182)) ([d4edc51](https://github.com/statistikZH/leu/commit/d4edc51a812f27a35e8ed2cb86df872dd91d2874))
43
+ * **menu-item:** allow disabled menu items to still be focusable ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
44
+ * **menu-item:** apply tab-index to the actual interactive element ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
45
+ * **menu-item:** only add aria attribute to the button element ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
46
+ * **menu-item:** remove deprecated properties before and after ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
47
+ * **menu-item:** use colors that are WCAG AA compliant ([5c59899](https://github.com/statistikZH/leu/commit/5c598990a40cd138bf47b1e0bf2c9026da1f4d87))
48
+ * **menu:** only add role when no role was defined before ([78c3e68](https://github.com/statistikZH/leu/commit/78c3e6898a5ec4e88a13e698aca6f6caef653645))
49
+ * **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))
50
+ * **popup:** reflect properties to attributes ([#200](https://github.com/statistikZH/leu/issues/200)) ([44aec79](https://github.com/statistikZH/leu/commit/44aec79a8e8456240771da214d45440cc31891d7))
51
+ * **radio:** remove label property as it is not used anymore ([e105a6e](https://github.com/statistikZH/leu/commit/e105a6eec33392d5bddf0d32e9881375576597d6))
52
+ * **select:** add background to apply button ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
53
+ * **select:** move leu-menu element into the shadow dom so the role is fully controlled ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
54
+ * **select:** only call focus if the element is available ([5c59899](https://github.com/statistikZH/leu/commit/5c598990a40cd138bf47b1e0bf2c9026da1f4d87))
55
+ * **select:** set correct aria attributes ([9846e87](https://github.com/statistikZH/leu/commit/9846e8709a81afce6074860fb597e42f394582d9))
56
+
3
57
  ## [0.5.1](https://github.com/statistikZH/leu/compare/v0.5.0...v0.5.1) (2024-05-23)
4
58
 
5
59
 
@@ -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-ba5ea33d.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-ba5ea33d.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-ba5ea33d.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":"AAyHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IAOM,yBAA+C;IAO7C,uBAAyB;IACzB,0BAA6B;IAY7B,qBAAqB;IASvB,yBAA4C;IAW9C,aAAe;IACf,wDAAwD;IACxD,UADW,OAAO,CACG;IAErB,gBAAgB;IAChB,iEAAgC;IAehC,+BAEQ;IAEV,qBAEC;IACD,+CAOC;IAOD,gBAAgB;IAChB,sBAEC;IAED,gBAAgB;IAChB,4BAEC;IACD;;;;;OAKG;IACH,eAFa,IAAI,CA4BhB;IACD;;;OAGG;IACH,wEAqCC;IACD,gEAmCC;CACF;gCA3WqD,0BAA0B;wBAC7C,KAAK"}
@@ -1,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-ba5ea33d.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 * {
@@ -155,11 +149,11 @@ var css_248z = css`:host,
155
149
  *
156
150
  *
157
151
  * @prop {Array} items - Object array with { label, href }
158
- * @prop {Boolean} inverted - invert color on dark background
152
+ * @prop {boolean} inverted - invert color on dark background
159
153
  *
160
154
  * @tagname leu-breadcrumb
161
155
  */
162
- class LeuBreadcrumb extends LitElement {
156
+ class LeuBreadcrumb extends LeuElement {
163
157
  constructor() {
164
158
  super();
165
159
  /** @type {Array} */
@@ -207,7 +201,7 @@ class LeuBreadcrumb extends LitElement {
207
201
  window.removeEventListener("click", this._closeDropdown);
208
202
  });
209
203
  this.items = [];
210
- /** @type {Boolean} - will be used on dark Background */
204
+ /** @type {boolean} - will be used on dark Background */
211
205
  this.inverted = false;
212
206
 
213
207
  /** @internal */
@@ -297,7 +291,9 @@ class LeuBreadcrumb extends LitElement {
297
291
  if (this._dropdownItems.length === 0 && !this._isRecalculating) return nothing;
298
292
  return html`
299
293
  <li class="breadcrumbs__item" data-dropdown-toggle>
300
- <span class="breadcrumbs__icon">${Icon("angleRight")}</span>
294
+ <span class="breadcrumbs__icon"
295
+ ><leu-icon name="angleRight"></leu-icon
296
+ ></span>
301
297
  <leu-popup
302
298
  ?active=${this._isDropdownOpen}
303
299
  placement="bottom-start"
@@ -318,10 +314,9 @@ class LeuBreadcrumb extends LitElement {
318
314
  ${html`
319
315
  <leu-menu>
320
316
  ${this._dropdownItems.map(item => html`
321
- <leu-menu-item
322
- label=${item.label}
323
- href=${item.href}
324
- ></leu-menu-item>
317
+ <leu-menu-item href=${item.href}
318
+ >${item.label}</leu-menu-item
319
+ >
325
320
  `)}
326
321
  </leu-menu>
327
322
  `}
@@ -343,15 +338,17 @@ class LeuBreadcrumb extends LitElement {
343
338
  <leu-visually-hidden><h2>Sie sind hier:</h2></leu-visually-hidden>
344
339
  <ol class="breadcrumbs__list" ref=${ref(this._containerRef)}>
345
340
  ${showBackOnly ? html` <li class="breadcrumbs__item breadcrumbs__item--back">
346
- <span class="breadcrumbs__icon">${Icon("arrowLeft")}</span>
341
+ <span class="breadcrumbs__icon"
342
+ ><leu-icon name="arrowLeft"></leu-icon
343
+ ></span>
347
344
  <a class="breadcrumbs__link" href=${parentItem.href}
348
345
  >${parentItem.label}</a
349
346
  >
350
347
  </li>` : this._listItems.map((item, index, list) => html`
351
348
  <li class="breadcrumbs__item">
352
349
  ${index > 0 ? html`<span class="breadcrumbs__icon"
353
- >${Icon("angleRight")}</span
354
- >` // First list item doesn't have an arrow
350
+ ><leu-icon name="angleRight"></leu-icon
351
+ ></span>` // First list item doesn't have an arrow
355
352
  : nothing}
356
353
  ${index === list.length - 1 ? item.label // Last list item doesn't contain a link
357
354
  : html`<a class="breadcrumbs__link" href=${item.href}
@@ -365,6 +362,13 @@ class LeuBreadcrumb extends LitElement {
365
362
  `;
366
363
  }
367
364
  }
365
+ _defineProperty(LeuBreadcrumb, "dependencies", {
366
+ "leu-icon": LeuIcon,
367
+ "leu-menu": LeuMenu,
368
+ "leu-menu-item": LeuMenuItem,
369
+ "leu-popup": LeuPopup,
370
+ "leu-visually-hidden": LeuVisuallyHidden
371
+ });
368
372
  _defineProperty(LeuBreadcrumb, "styles", css_248z);
369
373
  _defineProperty(LeuBreadcrumb, "properties", {
370
374
  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-ba5ea33d.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-5326c982.d.ts.map
83
+ //# sourceMappingURL=Button-7370f901.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button-7370f901.d.ts","sourceRoot":"","sources":["Button-7370f901.js"],"names":[],"mappings":";;;iCAaa,OAAO,KAAK,EAAE,kBAAkB;AAyW7C,wCAA0D;AAhX1D;;;GAGG;AAEH;;;;GAIG;AACH;IACE,uCAcC;IAHC,UAAgB;IAEhB,eAA0B;IAG5B;;;OAGG;IACH,uBAeC;IAED;;;;OAIG;IACH,qBAEC;IAED;;;OAGG;IACH,gCAEC;IACD,sBAEC;IACD,yBAEC;CACF;AAmTD;;;;;GAKG;AACH;IAQI,WAAiB;IACjB,qBAAqB;IACrB,MADW,MAAM,CACI;IACrB,qBAAqB;IACrB,SADW,MAAM,CACO;IACxB,4CAA4C;IAC5C,MADW,QAAQ,GAAG,QAAQ,GAAG,OAAO,CACpB;IAEpB,qBAAqB;IACrB,eADW,MAAM,CACa;IAE9B,sBAAsB;IACtB,UADW,OAAO,CACG;IACrB,+EAA+E;IAC/E,OADW,OAAO,CACA;IAClB,sBAAsB;IACtB,QADW,OAAO,CACC;IACnB,wDAAwD;IACxD,UADW,OAAO,CACG;IAErB,gGAAgG;IAChG,OADW,OAAO,CACA;IAElB;;;OAGG;IACH,UAFU,CAAC,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAEf;IAE3B,6EAOC;IACD;;;MAaC;IACD,0BAEC;IACD,+CAiCC;CACF;AA7GD,qCAA0C;AAE1C,qCAAmD;AAEnD,gDAAkD;gCA5XI,0BAA0B;wBAC7C,KAAK"}
@@ -1,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-ba5ea33d.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
  }
@@ -98,17 +110,13 @@ button {
98
110
  column-gap: 8px;
99
111
  }
100
112
 
101
- .label {
113
+ .content {
102
114
  flex: 1 1 0;
103
115
  overflow: hidden;
104
116
  text-overflow: ellipsis;
105
117
  white-space: nowrap;
106
118
  }
107
119
 
108
- .icon .label {
109
- display: none;
110
- }
111
-
112
120
  button.round {
113
121
  border-radius: 50%;
114
122
  }
@@ -140,7 +148,7 @@ button.regular {
140
148
  line-height: 24px;
141
149
  }
142
150
 
143
- button.regular.icon {
151
+ button.regular.icon-only {
144
152
  padding: 12px;
145
153
  }
146
154
 
@@ -150,9 +158,11 @@ button.small {
150
158
  padding: 6px 24px;
151
159
  font-size: 14px;
152
160
  line-height: 20px;
161
+
162
+ --leu-icon-size: 1rem;
153
163
  }
154
164
 
155
- button.small.icon {
165
+ button.small.icon-only {
156
166
  padding: 8px;
157
167
  }
158
168
 
@@ -211,6 +221,8 @@ button.secondary:disabled {
211
221
  /* ghost */
212
222
 
213
223
  button.ghost {
224
+ --leu-icon-size: 1rem;
225
+
214
226
  background: transparent;
215
227
  padding: 0 0.5rem;
216
228
  color: var(--leu-color-black-60);
@@ -293,11 +305,13 @@ button.ghost.inverted:disabled {
293
305
 
294
306
  /* icon-wrapper */
295
307
 
296
- .icon-wrapper svg {
308
+ .icon-wrapper leu-icon {
297
309
  display: block;
298
310
  }
299
311
 
300
- .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;
301
315
  padding: 0.5rem;
302
316
  border-radius: 50%;
303
317
  background: var(--leu-color-black-transp-10);
@@ -367,41 +381,31 @@ Object.freeze(BUTTON_TYPES);
367
381
  const BUTTON_EXPANDED_OPTIONS = ["true", "false"];
368
382
  Object.freeze(BUTTON_EXPANDED_OPTIONS);
369
383
 
370
- /**
371
- * All roles that are associated with a aria-checked attribute
372
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
373
- */
374
- const ARIA_ROLES_CHECKED = ["checkbox", "menuitemcheckbox", "menuitemradio", "option", "radio", "switch"];
375
-
376
- /**
377
- * All roles that are associated with a aria-selected attribute
378
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
379
- */
380
- const ARIA_ROLES_SELECTED = ["gridcell", "option", "row", "tab", "columnheader", "rowheader", "treeitem"];
381
-
382
384
  /**
383
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
384
389
  */
385
- class LeuButton extends LitElement {
390
+ class LeuButton extends LeuElement {
386
391
  constructor() {
387
392
  super();
388
393
  /** @type {string} */
389
394
  /**
390
395
  * @internal
391
396
  */
392
- _defineProperty(this, "hasSlotController", new HasSlotController(this, ["[default]"]));
397
+ _defineProperty(this, "hasSlotController", new HasSlotController(this, ["before", "after", "[default]"]));
393
398
  this.label = null;
394
399
  /** @type {string} */
395
- this.icon = null;
396
- /** @type {("before" | "after")} - Only taken into account if Label and no Icon is set */
397
- this.iconPosition = "before";
398
- /** @type {string} */
399
400
  this.size = "regular";
400
401
  /** @type {string} */
401
402
  this.variant = "primary";
402
403
  /** @type {"button" | "submit" | "reset"} */
403
404
  this.type = "button";
404
405
 
406
+ /** @type {string} */
407
+ this.componentRole = undefined;
408
+
405
409
  /** @type {boolean} */
406
410
  this.disabled = false;
407
411
  /** @type {boolean} - Only taken into account if no Label and an Icon is set */
@@ -420,29 +424,10 @@ class LeuButton extends LitElement {
420
424
  */
421
425
  this.expanded = undefined;
422
426
  }
423
- getIconSize() {
424
- return this.size === "small" || this.variant === "ghost" ? 16 : 24;
425
- }
426
- renderIconBefore() {
427
- if (this.icon && this.iconPosition === "before") {
428
- return html`<div class="icon-wrapper icon-wrapper--before">
429
- ${Icon(this.icon, this.getIconSize())}
430
- </div>`;
431
- }
432
- return nothing;
433
- }
434
- renderIconAfter() {
435
- if (this.icon && this.iconPosition === "after") {
436
- return html`<div class="icon-wrapper icon-wrapper--after">
437
- ${Icon(this.icon, this.getIconSize())}
438
- </div>`;
439
- }
440
- return nothing;
441
- }
442
427
  renderExpandingIcon() {
443
428
  if (typeof this.expanded !== "undefined" && this.variant === "ghost") {
444
429
  return html`<div class="icon-wrapper icon-wrapper--expanded">
445
- ${Icon("angleDropDown", 24)}
430
+ <leu-icon name="angleDropDown" size="24"></leu-icon>
446
431
  </div>`;
447
432
  }
448
433
  return nothing;
@@ -453,20 +438,28 @@ class LeuButton extends LitElement {
453
438
  label: this.label
454
439
  };
455
440
  if (this.componentRole) {
456
- if (ARIA_ROLES_CHECKED.includes(this.componentRole)) {
441
+ if (ARIA_CHECKED_ROLES.includes(this.componentRole)) {
457
442
  attributes.checked = this.active ? "true" : "false";
458
- } else if (ARIA_ROLES_SELECTED.includes(this.componentRole)) {
443
+ } else if (ARIA_SELECTED_ROLES.includes(this.componentRole)) {
459
444
  attributes.selected = this.active ? "true" : "false";
460
445
  }
461
446
  }
462
447
  return attributes;
463
448
  }
449
+ hasTextContent() {
450
+ return Array.from(this.childNodes).some(node => node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "");
451
+ }
464
452
  render() {
465
- 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");
466
457
  const aria = this.getAriaAttributes();
467
458
  const cssClasses = {
468
- icon: !hasContent && this.icon,
469
- round: !hasContent && this.icon && this.round,
459
+ "icon-only": hasIconDefault && !hasTextContent,
460
+ "icon-before": hasIconBefore,
461
+ "icon-after": hasIconAfter,
462
+ round: this.round,
470
463
  active: this.active,
471
464
  inverted: this.inverted,
472
465
  [this.variant]: true,
@@ -477,24 +470,29 @@ class LeuButton extends LitElement {
477
470
  aria-label=${ifDefined(aria.label)}
478
471
  aria-selected=${ifDefined(aria.selected)}
479
472
  aria-checked=${ifDefined(aria.checked)}
473
+ aria-expanded=${ifDefined(this.expanded)}
480
474
  role=${ifDefined(aria.role)}
481
475
  class=${classMap(cssClasses)}
482
476
  ?disabled=${this.disabled}
483
477
  type=${this.type}
484
478
  >
485
- ${this.renderIconBefore()}
486
- <span class="label"><slot></slot></span>
487
- ${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()}
488
483
  </button>
489
484
  `;
490
485
  }
491
486
  }
487
+ _defineProperty(LeuButton, "dependencies", {
488
+ "leu-icon": LeuIcon
489
+ });
492
490
  _defineProperty(LeuButton, "styles", css_248z);
493
491
  /**
494
492
  * @internal
495
493
  */
496
494
  _defineProperty(LeuButton, "shadowRootOptions", {
497
- ...LitElement.shadowRootOptions,
495
+ ...LeuElement.shadowRootOptions,
498
496
  delegatesFocus: true
499
497
  });
500
498
  _defineProperty(LeuButton, "properties", {
@@ -502,14 +500,6 @@ _defineProperty(LeuButton, "properties", {
502
500
  type: String,
503
501
  reflect: true
504
502
  },
505
- icon: {
506
- type: String,
507
- reflect: true
508
- },
509
- iconPosition: {
510
- type: String,
511
- reflect: true
512
- },
513
503
  size: {
514
504
  type: String,
515
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-5326c982.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-7370f901.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-ba5ea33d.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-5326c982.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-7370f901.js';