@statistikzh/leu 0.24.2 → 0.25.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 (532) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/.storybook/main.ts +18 -53
  3. package/.storybook/manager.ts +1 -4
  4. package/.storybook/preview.ts +23 -16
  5. package/.storybook/theme.ts +1 -1
  6. package/CHANGELOG.md +14 -0
  7. package/dist/Accordion-CDNyrB8d.js +241 -0
  8. package/dist/Accordion.d.ts +44 -44
  9. package/dist/Accordion.js +2 -249
  10. package/dist/Button-DSGPIcjm.d.ts +93 -0
  11. package/dist/Button-EdS9xr2J.js +524 -0
  12. package/dist/Button.d.ts +2 -85
  13. package/dist/Button.js +4 -504
  14. package/dist/ButtonGroup-BQqf8o_d.js +88 -0
  15. package/dist/ButtonGroup.d.ts +19 -19
  16. package/dist/ButtonGroup.js +5 -101
  17. package/dist/ChartWrapper-LiNHTNRw.js +158 -0
  18. package/dist/ChartWrapper.d.ts +26 -26
  19. package/dist/ChartWrapper.js +3 -163
  20. package/dist/Checkbox-BtDWmPab.js +198 -0
  21. package/dist/Checkbox.d.ts +35 -27
  22. package/dist/Checkbox.js +4 -157
  23. package/dist/CheckboxGroup-C8MbwW9u.js +81 -0
  24. package/dist/CheckboxGroup.d.ts +18 -18
  25. package/dist/CheckboxGroup.js +5 -82
  26. package/dist/Chip-Ch09jjYi.js +171 -0
  27. package/dist/Chip-DLKM9P7v.d.ts +18 -0
  28. package/dist/Chip.d.ts +2 -18
  29. package/dist/Chip.js +2 -166
  30. package/dist/ChipGroup-PvqVW-tm.js +125 -0
  31. package/dist/ChipGroup-Ta8Ht4jc.d.ts +42 -0
  32. package/dist/ChipGroup.d.ts +2 -43
  33. package/dist/ChipGroup.js +3 -132
  34. package/dist/ChipLink-BAxyQO2M.d.ts +17 -0
  35. package/dist/ChipLink.d.ts +2 -18
  36. package/dist/ChipLink.js +28 -28
  37. package/dist/ChipRemovable-DBjwt0CH.d.ts +25 -0
  38. package/dist/ChipRemovable.d.ts +2 -26
  39. package/dist/ChipRemovable.js +42 -43
  40. package/dist/ChipSelectable-CMJNcE4U.d.ts +32 -0
  41. package/dist/ChipSelectable.d.ts +2 -33
  42. package/dist/ChipSelectable.js +63 -72
  43. package/dist/Dialog-CV1JTkCn.js +241 -0
  44. package/dist/Dialog.d.ts +28 -28
  45. package/dist/Dialog.js +3 -240
  46. package/dist/Dropdown-DpFdFbA1.js +155 -0
  47. package/dist/Dropdown.d.ts +39 -41
  48. package/dist/Dropdown.js +8 -157
  49. package/dist/FileInput-5apX17JT.js +344 -0
  50. package/dist/FileInput.d.ts +56 -57
  51. package/dist/FileInput.js +6 -383
  52. package/dist/FormAssociatedMixin-BbFlza53.js +58 -0
  53. package/dist/FormAssociatedMixin-Cc74LjbC.d.ts +22 -0
  54. package/dist/Icon-DhAvH0XM.js +186 -0
  55. package/dist/Icon-Op80LrrO.d.ts +151 -0
  56. package/dist/Icon.d.ts +2 -4
  57. package/dist/Icon.js +2 -188
  58. package/dist/Input-CnEz-2dK.js +610 -0
  59. package/dist/Input-D2THgo7c.d.ts +169 -0
  60. package/dist/Input.d.ts +2 -166
  61. package/dist/Input.js +4 -626
  62. package/dist/LeuElement-B7NJzWwP.js +46 -0
  63. package/dist/LeuElement-pJFU18Xm.d.ts +11 -0
  64. package/dist/Menu-CQdx1ef3.d.ts +43 -0
  65. package/dist/Menu-DpiheIPk.js +136 -0
  66. package/dist/Menu.d.ts +2 -44
  67. package/dist/Menu.js +4 -157
  68. package/dist/MenuItem-CZTqGg5R.js +219 -0
  69. package/dist/MenuItem-QcgnRk_7.d.ts +63 -0
  70. package/dist/MenuItem.d.ts +2 -64
  71. package/dist/MenuItem.js +3 -227
  72. package/dist/Message-J4Kj7yHE.js +252 -0
  73. package/dist/Message.d.ts +53 -53
  74. package/dist/Message.js +3 -267
  75. package/dist/Pagination-Be8TcBoC.d.ts +76 -0
  76. package/dist/Pagination-CWqgusWZ.js +226 -0
  77. package/dist/Pagination.d.ts +2 -76
  78. package/dist/Pagination.js +6 -240
  79. package/dist/Placeholder-DMN6sMbp.js +95 -0
  80. package/dist/Placeholder.d.ts +15 -15
  81. package/dist/Placeholder.js +2 -89
  82. package/dist/Popup-Btgm2a3D.d.ts +61 -0
  83. package/dist/Popup-JQjuj26v.js +195 -0
  84. package/dist/Popup.d.ts +2 -62
  85. package/dist/Popup.js +2 -233
  86. package/dist/ProgressBar-CzN3fqiH.js +167 -0
  87. package/dist/ProgressBar.d.ts +21 -21
  88. package/dist/ProgressBar.js +2 -165
  89. package/dist/Radio-CX8aCsff.js +160 -0
  90. package/dist/Radio.d.ts +22 -22
  91. package/dist/Radio.js +2 -151
  92. package/dist/RadioGroup-CgEWQnC4.js +171 -0
  93. package/dist/RadioGroup.d.ts +35 -35
  94. package/dist/RadioGroup.js +3 -182
  95. package/dist/Range-DoW_ZdKm.js +496 -0
  96. package/dist/Range.d.ts +112 -112
  97. package/dist/Range.js +2 -586
  98. package/dist/ScrollTop-DxChetWq.js +130 -0
  99. package/dist/ScrollTop.d.ts +21 -21
  100. package/dist/ScrollTop.js +5 -134
  101. package/dist/Select-BCx79gOH.js +618 -0
  102. package/dist/Select.d.ts +130 -132
  103. package/dist/Select.js +9 -675
  104. package/dist/Spinner-CMo_o6Fy.d.ts +14 -0
  105. package/dist/Spinner-DJR4gv3Y.js +56 -0
  106. package/dist/Spinner.d.ts +2 -14
  107. package/dist/Spinner.js +2 -52
  108. package/dist/Table-DZz1ic3j.js +392 -0
  109. package/dist/Table.d.ts +61 -63
  110. package/dist/Table.js +7 -427
  111. package/dist/Tag-DsZS_8pl.js +76 -0
  112. package/dist/Tag.d.ts +8 -8
  113. package/dist/Tag.js +2 -74
  114. package/dist/VisuallyHidden-BkllVjlz.js +29 -0
  115. package/dist/VisuallyHidden-OeQvhxYn.d.ts +13 -0
  116. package/dist/VisuallyHidden.d.ts +2 -13
  117. package/dist/VisuallyHidden.js +2 -25
  118. package/dist/decorate-DwpAc4D0.js +9 -0
  119. package/dist/hasSlotController-BLtZurRh.d.ts +19 -0
  120. package/dist/hasSlotController-DjdfnOQp.js +38 -0
  121. package/dist/index.d.ts +33 -30
  122. package/dist/index.js +35 -45
  123. package/dist/leu-accordion.d.ts +7 -10
  124. package/dist/leu-accordion.js +4 -8
  125. package/dist/leu-button-group.d.ts +7 -10
  126. package/dist/leu-button-group.js +7 -12
  127. package/dist/leu-button.d.ts +7 -11
  128. package/dist/leu-button.js +6 -11
  129. package/dist/leu-chart-wrapper.d.ts +7 -12
  130. package/dist/leu-chart-wrapper.js +5 -9
  131. package/dist/leu-checkbox-group.d.ts +7 -10
  132. package/dist/leu-checkbox-group.js +7 -10
  133. package/dist/leu-checkbox.d.ts +7 -11
  134. package/dist/leu-checkbox.js +6 -8
  135. package/dist/leu-chip-group.d.ts +7 -12
  136. package/dist/leu-chip-group.js +5 -10
  137. package/dist/leu-chip-link.d.ts +7 -11
  138. package/dist/leu-chip-link.js +5 -8
  139. package/dist/leu-chip-removable.d.ts +7 -12
  140. package/dist/leu-chip-removable.js +6 -9
  141. package/dist/leu-chip-selectable.d.ts +7 -11
  142. package/dist/leu-chip-selectable.js +5 -8
  143. package/dist/leu-dialog.d.ts +7 -13
  144. package/dist/leu-dialog.js +5 -11
  145. package/dist/leu-dropdown.d.ts +7 -18
  146. package/dist/leu-dropdown.js +10 -17
  147. package/dist/leu-file-input.d.ts +7 -13
  148. package/dist/leu-file-input.js +8 -13
  149. package/dist/leu-icon.d.ts +7 -10
  150. package/dist/leu-icon.js +4 -7
  151. package/dist/leu-input.d.ts +7 -12
  152. package/dist/leu-input.js +6 -12
  153. package/dist/leu-menu-item.d.ts +7 -11
  154. package/dist/leu-menu-item.js +5 -9
  155. package/dist/leu-menu.d.ts +7 -12
  156. package/dist/leu-menu.js +6 -10
  157. package/dist/leu-message.d.ts +7 -11
  158. package/dist/leu-message.js +5 -10
  159. package/dist/leu-pagination.d.ts +7 -13
  160. package/dist/leu-pagination.js +8 -14
  161. package/dist/leu-placeholder.d.ts +7 -10
  162. package/dist/leu-placeholder.js +4 -5
  163. package/dist/leu-popup.d.ts +7 -11
  164. package/dist/leu-popup.js +4 -8
  165. package/dist/leu-progress-bar.d.ts +7 -10
  166. package/dist/leu-progress-bar.js +4 -8
  167. package/dist/leu-radio-group.d.ts +7 -10
  168. package/dist/leu-radio-group.js +5 -9
  169. package/dist/leu-radio.d.ts +7 -10
  170. package/dist/leu-radio.js +4 -7
  171. package/dist/leu-range.d.ts +7 -10
  172. package/dist/leu-range.js +4 -9
  173. package/dist/leu-scroll-top.d.ts +7 -12
  174. package/dist/leu-scroll-top.js +7 -13
  175. package/dist/leu-select.d.ts +7 -19
  176. package/dist/leu-select.js +11 -19
  177. package/dist/leu-spinner.d.ts +7 -10
  178. package/dist/leu-spinner.js +4 -5
  179. package/dist/leu-table.d.ts +7 -14
  180. package/dist/leu-table.js +9 -17
  181. package/dist/leu-tag.d.ts +7 -10
  182. package/dist/leu-tag.js +4 -7
  183. package/dist/leu-visually-hidden.d.ts +7 -10
  184. package/dist/leu-visually-hidden.js +4 -5
  185. package/dist/utils-hfk5Nwy8.js +28 -0
  186. package/dist/vscode.html-custom-data.json +2 -8
  187. package/dist/vue/index.d.ts +3 -9
  188. package/dist/web-types.json +8 -24
  189. package/eslint.config.mjs +79 -0
  190. package/package.json +44 -60
  191. package/scripts/generate-component/templates/stories/[name].stories.ts +1 -1
  192. package/src/components/accordion/Accordion.ts +1 -1
  193. package/src/components/button/Button.ts +62 -3
  194. package/src/components/button/test/button.test.ts +185 -7
  195. package/src/components/button-group/ButtonGroup.ts +1 -6
  196. package/src/components/button-group/stories/button-group.stories.ts +1 -1
  197. package/src/components/chart-wrapper/ChartWrapper.ts +1 -1
  198. package/src/components/chart-wrapper/stories/chart-wrapper.stories.ts +1 -1
  199. package/src/components/checkbox/Checkbox.ts +76 -12
  200. package/src/components/checkbox/CheckboxGroup.ts +1 -1
  201. package/src/components/checkbox/checkbox.css +4 -0
  202. package/src/components/checkbox/stories/checkbox.stories.ts +26 -3
  203. package/src/components/checkbox/test/checkbox.test.ts +147 -3
  204. package/src/components/chip/Chip.ts +1 -1
  205. package/src/components/chip/ChipGroup.ts +2 -2
  206. package/src/components/chip/stories/chip-removable.stories.ts +1 -1
  207. package/src/components/chip/test/chip-removable.test.ts +2 -2
  208. package/src/components/dialog/Dialog.ts +1 -1
  209. package/src/components/dialog/stories/dialog.stories.ts +0 -2
  210. package/src/components/dropdown/Dropdown.ts +1 -1
  211. package/src/components/dropdown/stories/dropdown.stories.ts +1 -1
  212. package/src/components/file-input/FileInput.ts +18 -20
  213. package/src/components/file-input/stories/file-input.stories.ts +2 -2
  214. package/src/components/file-input/test/file-input.test.ts +14 -1
  215. package/src/components/icon/Icon.ts +1 -1
  216. package/src/components/input/Input.ts +18 -7
  217. package/src/components/input/stories/input.stories.ts +24 -21
  218. package/src/components/menu/Menu.ts +4 -4
  219. package/src/components/menu/MenuItem.ts +1 -1
  220. package/src/components/menu/stories/menu-item.stories.ts +0 -2
  221. package/src/components/message/Message.ts +1 -1
  222. package/src/components/message/stories/message.stories.ts +2 -2
  223. package/src/components/pagination/Pagination.ts +1 -1
  224. package/src/components/pagination/stories/pagination.stories.ts +3 -3
  225. package/src/components/pagination/test/pagination.test.ts +1 -1
  226. package/src/components/placeholder/Placeholder.ts +1 -1
  227. package/src/components/placeholder/stories/placeholder.stories.ts +1 -1
  228. package/src/components/popup/Popup.ts +1 -1
  229. package/src/components/progress-bar/ProgressBar.ts +1 -1
  230. package/src/components/progress-bar/stories/progress-bar.stories.ts +1 -1
  231. package/src/components/radio/Radio.ts +1 -1
  232. package/src/components/radio/RadioGroup.ts +5 -5
  233. package/src/components/range/Range.ts +1 -1
  234. package/src/components/range/stories/range.stories.ts +2 -2
  235. package/src/components/scroll-top/ScrollTop.ts +1 -1
  236. package/src/components/select/Select.ts +2 -5
  237. package/src/components/spinner/Spinner.ts +1 -1
  238. package/src/components/table/Table.ts +1 -1
  239. package/src/components/tag/Tag.ts +1 -1
  240. package/src/components/tag/stories/tag.stories.ts +1 -1
  241. package/src/components/visually-hidden/VisuallyHidden.ts +1 -1
  242. package/src/docs/contributing.mdx +1 -1
  243. package/src/docs/installation.mdx +1 -1
  244. package/src/docs/theme.mdx +1 -1
  245. package/src/docs/usage.mdx +1 -1
  246. package/src/global.d.ts +1 -1
  247. package/src/lib/LeuElement.ts +1 -1
  248. package/src/lib/mixins/FormAssociatedMixin.ts +115 -0
  249. package/src/lib/styleMap.ts +1 -1
  250. package/tsdown.config.ts +35 -0
  251. package/web-test-runner.config.mjs +20 -2
  252. package/.eslintrc.json +0 -57
  253. package/dist/Icon.d-itcQ94ym.d.ts +0 -151
  254. package/dist/LeuElement-BfXSO7MN.js +0 -42
  255. package/dist/LeuElement.d-BevHqLUu.d.ts +0 -10
  256. package/dist/_tslib-CNEFicEt.js +0 -30
  257. package/dist/components/accordion/Accordion.d.ts +0 -49
  258. package/dist/components/accordion/Accordion.d.ts.map +0 -1
  259. package/dist/components/accordion/leu-accordion.d.ts +0 -8
  260. package/dist/components/accordion/leu-accordion.d.ts.map +0 -1
  261. package/dist/components/accordion/stories/accordion.stories.d.ts +0 -26
  262. package/dist/components/accordion/stories/accordion.stories.d.ts.map +0 -1
  263. package/dist/components/accordion/test/accordion.test.d.ts +0 -2
  264. package/dist/components/accordion/test/accordion.test.d.ts.map +0 -1
  265. package/dist/components/button/Button.d.ts +0 -81
  266. package/dist/components/button/Button.d.ts.map +0 -1
  267. package/dist/components/button/leu-button.d.ts +0 -8
  268. package/dist/components/button/leu-button.d.ts.map +0 -1
  269. package/dist/components/button/stories/button.stories.d.ts +0 -19
  270. package/dist/components/button/stories/button.stories.d.ts.map +0 -1
  271. package/dist/components/button/test/button.test.d.ts +0 -3
  272. package/dist/components/button/test/button.test.d.ts.map +0 -1
  273. package/dist/components/button-group/ButtonGroup.d.ts +0 -25
  274. package/dist/components/button-group/ButtonGroup.d.ts.map +0 -1
  275. package/dist/components/button-group/leu-button-group.d.ts +0 -8
  276. package/dist/components/button-group/leu-button-group.d.ts.map +0 -1
  277. package/dist/components/button-group/stories/button-group.stories.d.ts +0 -15
  278. package/dist/components/button-group/stories/button-group.stories.d.ts.map +0 -1
  279. package/dist/components/button-group/test/button-group.test.d.ts +0 -3
  280. package/dist/components/button-group/test/button-group.test.d.ts.map +0 -1
  281. package/dist/components/chart-wrapper/ChartWrapper.d.ts +0 -34
  282. package/dist/components/chart-wrapper/ChartWrapper.d.ts.map +0 -1
  283. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts +0 -8
  284. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts.map +0 -1
  285. package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts +0 -47
  286. package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts.map +0 -1
  287. package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts +0 -2
  288. package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts.map +0 -1
  289. package/dist/components/checkbox/Checkbox.d.ts +0 -28
  290. package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
  291. package/dist/components/checkbox/CheckboxGroup.d.ts +0 -22
  292. package/dist/components/checkbox/CheckboxGroup.d.ts.map +0 -1
  293. package/dist/components/checkbox/leu-checkbox-group.d.ts +0 -8
  294. package/dist/components/checkbox/leu-checkbox-group.d.ts.map +0 -1
  295. package/dist/components/checkbox/leu-checkbox.d.ts +0 -8
  296. package/dist/components/checkbox/leu-checkbox.d.ts.map +0 -1
  297. package/dist/components/checkbox/stories/checkbox-group.stories.d.ts +0 -29
  298. package/dist/components/checkbox/stories/checkbox-group.stories.d.ts.map +0 -1
  299. package/dist/components/checkbox/stories/checkbox.stories.d.ts +0 -22
  300. package/dist/components/checkbox/stories/checkbox.stories.d.ts.map +0 -1
  301. package/dist/components/checkbox/test/checkbox-group.test.d.ts +0 -3
  302. package/dist/components/checkbox/test/checkbox-group.test.d.ts.map +0 -1
  303. package/dist/components/checkbox/test/checkbox.test.d.ts +0 -2
  304. package/dist/components/checkbox/test/checkbox.test.d.ts.map +0 -1
  305. package/dist/components/chip/Chip.d.ts +0 -15
  306. package/dist/components/chip/Chip.d.ts.map +0 -1
  307. package/dist/components/chip/ChipGroup.d.ts +0 -38
  308. package/dist/components/chip/ChipGroup.d.ts.map +0 -1
  309. package/dist/components/chip/ChipLink.d.ts +0 -13
  310. package/dist/components/chip/ChipLink.d.ts.map +0 -1
  311. package/dist/components/chip/ChipRemovable.d.ts +0 -21
  312. package/dist/components/chip/ChipRemovable.d.ts.map +0 -1
  313. package/dist/components/chip/ChipSelectable.d.ts +0 -28
  314. package/dist/components/chip/ChipSelectable.d.ts.map +0 -1
  315. package/dist/components/chip/exports.d.ts +0 -5
  316. package/dist/components/chip/exports.d.ts.map +0 -1
  317. package/dist/components/chip/leu-chip-group.d.ts +0 -8
  318. package/dist/components/chip/leu-chip-group.d.ts.map +0 -1
  319. package/dist/components/chip/leu-chip-link.d.ts +0 -8
  320. package/dist/components/chip/leu-chip-link.d.ts.map +0 -1
  321. package/dist/components/chip/leu-chip-removable.d.ts +0 -8
  322. package/dist/components/chip/leu-chip-removable.d.ts.map +0 -1
  323. package/dist/components/chip/leu-chip-selectable.d.ts +0 -8
  324. package/dist/components/chip/leu-chip-selectable.d.ts.map +0 -1
  325. package/dist/components/chip/stories/chip-group.stories.d.ts +0 -40
  326. package/dist/components/chip/stories/chip-group.stories.d.ts.map +0 -1
  327. package/dist/components/chip/stories/chip-link.stories.d.ts +0 -27
  328. package/dist/components/chip/stories/chip-link.stories.d.ts.map +0 -1
  329. package/dist/components/chip/stories/chip-removable.stories.d.ts +0 -21
  330. package/dist/components/chip/stories/chip-removable.stories.d.ts.map +0 -1
  331. package/dist/components/chip/stories/chip-selectable.stories.d.ts +0 -35
  332. package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +0 -1
  333. package/dist/components/chip/test/chip-group.test.d.ts +0 -4
  334. package/dist/components/chip/test/chip-group.test.d.ts.map +0 -1
  335. package/dist/components/chip/test/chip-link.test.d.ts +0 -2
  336. package/dist/components/chip/test/chip-link.test.d.ts.map +0 -1
  337. package/dist/components/chip/test/chip-removable.test.d.ts +0 -2
  338. package/dist/components/chip/test/chip-removable.test.d.ts.map +0 -1
  339. package/dist/components/chip/test/chip-selectable.test.d.ts +0 -2
  340. package/dist/components/chip/test/chip-selectable.test.d.ts.map +0 -1
  341. package/dist/components/chip/test/chip.test.d.ts +0 -2
  342. package/dist/components/chip/test/chip.test.d.ts.map +0 -1
  343. package/dist/components/dialog/Dialog.d.ts +0 -29
  344. package/dist/components/dialog/Dialog.d.ts.map +0 -1
  345. package/dist/components/dialog/leu-dialog.d.ts +0 -8
  346. package/dist/components/dialog/leu-dialog.d.ts.map +0 -1
  347. package/dist/components/dialog/stories/dialog.stories.d.ts +0 -19
  348. package/dist/components/dialog/stories/dialog.stories.d.ts.map +0 -1
  349. package/dist/components/dialog/test/dialog.test.d.ts +0 -2
  350. package/dist/components/dialog/test/dialog.test.d.ts.map +0 -1
  351. package/dist/components/dropdown/Dropdown.d.ts +0 -40
  352. package/dist/components/dropdown/Dropdown.d.ts.map +0 -1
  353. package/dist/components/dropdown/leu-dropdown.d.ts +0 -8
  354. package/dist/components/dropdown/leu-dropdown.d.ts.map +0 -1
  355. package/dist/components/dropdown/stories/dropdown.stories.d.ts +0 -25
  356. package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +0 -1
  357. package/dist/components/dropdown/test/dropdown.test.d.ts +0 -2
  358. package/dist/components/dropdown/test/dropdown.test.d.ts.map +0 -1
  359. package/dist/components/file-input/FileInput.d.ts +0 -62
  360. package/dist/components/file-input/FileInput.d.ts.map +0 -1
  361. package/dist/components/file-input/leu-file-input.d.ts +0 -8
  362. package/dist/components/file-input/leu-file-input.d.ts.map +0 -1
  363. package/dist/components/file-input/stories/file-input.stories.d.ts +0 -34
  364. package/dist/components/file-input/stories/file-input.stories.d.ts.map +0 -1
  365. package/dist/components/file-input/test/file-input.test.d.ts +0 -2
  366. package/dist/components/file-input/test/file-input.test.d.ts.map +0 -1
  367. package/dist/components/icon/Icon.d.ts +0 -20
  368. package/dist/components/icon/Icon.d.ts.map +0 -1
  369. package/dist/components/icon/leu-icon.d.ts +0 -8
  370. package/dist/components/icon/leu-icon.d.ts.map +0 -1
  371. package/dist/components/icon/paths.d.ts +0 -127
  372. package/dist/components/icon/paths.d.ts.map +0 -1
  373. package/dist/components/icon/stories/icon.stories.d.ts +0 -32
  374. package/dist/components/icon/stories/icon.stories.d.ts.map +0 -1
  375. package/dist/components/icon/test/icon.test.d.ts +0 -2
  376. package/dist/components/icon/test/icon.test.d.ts.map +0 -1
  377. package/dist/components/input/Input.d.ts +0 -163
  378. package/dist/components/input/Input.d.ts.map +0 -1
  379. package/dist/components/input/leu-input.d.ts +0 -8
  380. package/dist/components/input/leu-input.d.ts.map +0 -1
  381. package/dist/components/input/stories/input.stories.d.ts +0 -35
  382. package/dist/components/input/stories/input.stories.d.ts.map +0 -1
  383. package/dist/components/input/test/input.test.d.ts +0 -2
  384. package/dist/components/input/test/input.test.d.ts.map +0 -1
  385. package/dist/components/menu/Menu.d.ts +0 -39
  386. package/dist/components/menu/Menu.d.ts.map +0 -1
  387. package/dist/components/menu/MenuItem.d.ts +0 -61
  388. package/dist/components/menu/MenuItem.d.ts.map +0 -1
  389. package/dist/components/menu/leu-menu-item.d.ts +0 -8
  390. package/dist/components/menu/leu-menu-item.d.ts.map +0 -1
  391. package/dist/components/menu/leu-menu.d.ts +0 -8
  392. package/dist/components/menu/leu-menu.d.ts.map +0 -1
  393. package/dist/components/menu/stories/menu-item.stories.d.ts +0 -24
  394. package/dist/components/menu/stories/menu-item.stories.d.ts.map +0 -1
  395. package/dist/components/menu/stories/menu.stories.d.ts +0 -26
  396. package/dist/components/menu/stories/menu.stories.d.ts.map +0 -1
  397. package/dist/components/menu/test/menu-item.test.d.ts +0 -3
  398. package/dist/components/menu/test/menu-item.test.d.ts.map +0 -1
  399. package/dist/components/menu/test/menu.test.d.ts +0 -4
  400. package/dist/components/menu/test/menu.test.d.ts.map +0 -1
  401. package/dist/components/message/Message.d.ts +0 -59
  402. package/dist/components/message/Message.d.ts.map +0 -1
  403. package/dist/components/message/leu-message.d.ts +0 -8
  404. package/dist/components/message/leu-message.d.ts.map +0 -1
  405. package/dist/components/message/stories/message.stories.d.ts +0 -179
  406. package/dist/components/message/stories/message.stories.d.ts.map +0 -1
  407. package/dist/components/message/test/message.test.d.ts +0 -2
  408. package/dist/components/message/test/message.test.d.ts.map +0 -1
  409. package/dist/components/pagination/Pagination.d.ts +0 -72
  410. package/dist/components/pagination/Pagination.d.ts.map +0 -1
  411. package/dist/components/pagination/leu-pagination.d.ts +0 -8
  412. package/dist/components/pagination/leu-pagination.d.ts.map +0 -1
  413. package/dist/components/pagination/stories/pagination.stories.d.ts +0 -25
  414. package/dist/components/pagination/stories/pagination.stories.d.ts.map +0 -1
  415. package/dist/components/pagination/test/pagination.test.d.ts +0 -2
  416. package/dist/components/pagination/test/pagination.test.d.ts.map +0 -1
  417. package/dist/components/placeholder/Placeholder.d.ts +0 -23
  418. package/dist/components/placeholder/Placeholder.d.ts.map +0 -1
  419. package/dist/components/placeholder/leu-placeholder.d.ts +0 -8
  420. package/dist/components/placeholder/leu-placeholder.d.ts.map +0 -1
  421. package/dist/components/placeholder/stories/placeholder.stories.d.ts +0 -27
  422. package/dist/components/placeholder/stories/placeholder.stories.d.ts.map +0 -1
  423. package/dist/components/placeholder/test/placeholder.test.d.ts +0 -2
  424. package/dist/components/placeholder/test/placeholder.test.d.ts.map +0 -1
  425. package/dist/components/popup/Popup.d.ts +0 -57
  426. package/dist/components/popup/Popup.d.ts.map +0 -1
  427. package/dist/components/popup/leu-popup.d.ts +0 -8
  428. package/dist/components/popup/leu-popup.d.ts.map +0 -1
  429. package/dist/components/popup/stories/popup.stories.d.ts +0 -28
  430. package/dist/components/popup/stories/popup.stories.d.ts.map +0 -1
  431. package/dist/components/popup/test/popup.test.d.ts +0 -2
  432. package/dist/components/popup/test/popup.test.d.ts.map +0 -1
  433. package/dist/components/progress-bar/ProgressBar.d.ts +0 -25
  434. package/dist/components/progress-bar/ProgressBar.d.ts.map +0 -1
  435. package/dist/components/progress-bar/leu-progress-bar.d.ts +0 -8
  436. package/dist/components/progress-bar/leu-progress-bar.d.ts.map +0 -1
  437. package/dist/components/progress-bar/stories/progress-bar.stories.d.ts +0 -48
  438. package/dist/components/progress-bar/stories/progress-bar.stories.d.ts.map +0 -1
  439. package/dist/components/progress-bar/test/progress-bar.test.d.ts +0 -2
  440. package/dist/components/progress-bar/test/progress-bar.test.d.ts.map +0 -1
  441. package/dist/components/radio/Radio.d.ts +0 -24
  442. package/dist/components/radio/Radio.d.ts.map +0 -1
  443. package/dist/components/radio/RadioGroup.d.ts +0 -39
  444. package/dist/components/radio/RadioGroup.d.ts.map +0 -1
  445. package/dist/components/radio/leu-radio-group.d.ts +0 -8
  446. package/dist/components/radio/leu-radio-group.d.ts.map +0 -1
  447. package/dist/components/radio/leu-radio.d.ts +0 -8
  448. package/dist/components/radio/leu-radio.d.ts.map +0 -1
  449. package/dist/components/radio/stories/radio-group.stories.d.ts +0 -29
  450. package/dist/components/radio/stories/radio-group.stories.d.ts.map +0 -1
  451. package/dist/components/radio/stories/radio.stories.d.ts +0 -22
  452. package/dist/components/radio/stories/radio.stories.d.ts.map +0 -1
  453. package/dist/components/radio/test/radio-group.test.d.ts +0 -3
  454. package/dist/components/radio/test/radio-group.test.d.ts.map +0 -1
  455. package/dist/components/radio/test/radio.test.d.ts +0 -2
  456. package/dist/components/radio/test/radio.test.d.ts.map +0 -1
  457. package/dist/components/range/Range.d.ts +0 -116
  458. package/dist/components/range/Range.d.ts.map +0 -1
  459. package/dist/components/range/leu-range.d.ts +0 -8
  460. package/dist/components/range/leu-range.d.ts.map +0 -1
  461. package/dist/components/range/stories/range.stories.d.ts +0 -231
  462. package/dist/components/range/stories/range.stories.d.ts.map +0 -1
  463. package/dist/components/range/test/range.test.d.ts +0 -2
  464. package/dist/components/range/test/range.test.d.ts.map +0 -1
  465. package/dist/components/scroll-top/ScrollTop.d.ts +0 -23
  466. package/dist/components/scroll-top/ScrollTop.d.ts.map +0 -1
  467. package/dist/components/scroll-top/leu-scroll-top.d.ts +0 -8
  468. package/dist/components/scroll-top/leu-scroll-top.d.ts.map +0 -1
  469. package/dist/components/scroll-top/stories/scroll-top.stories.d.ts +0 -8
  470. package/dist/components/scroll-top/stories/scroll-top.stories.d.ts.map +0 -1
  471. package/dist/components/scroll-top/test/scroll-top.test.d.ts +0 -2
  472. package/dist/components/scroll-top/test/scroll-top.test.d.ts.map +0 -1
  473. package/dist/components/select/Select.d.ts +0 -145
  474. package/dist/components/select/Select.d.ts.map +0 -1
  475. package/dist/components/select/leu-select.d.ts +0 -8
  476. package/dist/components/select/leu-select.d.ts.map +0 -1
  477. package/dist/components/select/stories/select.stories.d.ts +0 -23
  478. package/dist/components/select/stories/select.stories.d.ts.map +0 -1
  479. package/dist/components/select/test/fixtures.d.ts +0 -2
  480. package/dist/components/select/test/fixtures.d.ts.map +0 -1
  481. package/dist/components/select/test/select.test.d.ts +0 -3
  482. package/dist/components/select/test/select.test.d.ts.map +0 -1
  483. package/dist/components/spinner/Spinner.d.ts +0 -10
  484. package/dist/components/spinner/Spinner.d.ts.map +0 -1
  485. package/dist/components/spinner/leu-spinner.d.ts +0 -8
  486. package/dist/components/spinner/leu-spinner.d.ts.map +0 -1
  487. package/dist/components/spinner/stories/spinner.stories.d.ts +0 -16
  488. package/dist/components/spinner/stories/spinner.stories.d.ts.map +0 -1
  489. package/dist/components/spinner/test/spinner.test.d.ts +0 -2
  490. package/dist/components/spinner/test/spinner.test.d.ts.map +0 -1
  491. package/dist/components/table/Table.d.ts +0 -65
  492. package/dist/components/table/Table.d.ts.map +0 -1
  493. package/dist/components/table/leu-table.d.ts +0 -8
  494. package/dist/components/table/leu-table.d.ts.map +0 -1
  495. package/dist/components/table/stories/table.stories.d.ts +0 -15
  496. package/dist/components/table/stories/table.stories.d.ts.map +0 -1
  497. package/dist/components/table/test/table.test.d.ts +0 -2
  498. package/dist/components/table/test/table.test.d.ts.map +0 -1
  499. package/dist/components/tag/Tag.d.ts +0 -13
  500. package/dist/components/tag/Tag.d.ts.map +0 -1
  501. package/dist/components/tag/leu-tag.d.ts +0 -8
  502. package/dist/components/tag/leu-tag.d.ts.map +0 -1
  503. package/dist/components/tag/stories/tag.stories.d.ts +0 -136
  504. package/dist/components/tag/stories/tag.stories.d.ts.map +0 -1
  505. package/dist/components/tag/test/tag.test.d.ts +0 -2
  506. package/dist/components/tag/test/tag.test.d.ts.map +0 -1
  507. package/dist/components/visually-hidden/VisuallyHidden.d.ts +0 -9
  508. package/dist/components/visually-hidden/VisuallyHidden.d.ts.map +0 -1
  509. package/dist/components/visually-hidden/leu-visually-hidden.d.ts +0 -8
  510. package/dist/components/visually-hidden/leu-visually-hidden.d.ts.map +0 -1
  511. package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts +0 -13
  512. package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts.map +0 -1
  513. package/dist/components/visually-hidden/test/visually-hidden.test.d.ts +0 -2
  514. package/dist/components/visually-hidden/test/visually-hidden.test.d.ts.map +0 -1
  515. package/dist/hasSlotController-Bm2tipvG.js +0 -53
  516. package/dist/hasSlotController.d-emXwVXWF.d.ts +0 -23
  517. package/dist/index.d.ts.map +0 -1
  518. package/dist/lib/LeuElement.d.ts +0 -8
  519. package/dist/lib/LeuElement.d.ts.map +0 -1
  520. package/dist/lib/a11y.d.ts +0 -11
  521. package/dist/lib/a11y.d.ts.map +0 -1
  522. package/dist/lib/hasSlotController.d.ts +0 -20
  523. package/dist/lib/hasSlotController.d.ts.map +0 -1
  524. package/dist/lib/styleMap.d.ts +0 -61
  525. package/dist/lib/styleMap.d.ts.map +0 -1
  526. package/dist/lib/utils.d.ts +0 -23
  527. package/dist/lib/utils.d.ts.map +0 -1
  528. package/dist/styles/style.stories.d.ts +0 -6
  529. package/dist/styles/style.stories.d.ts.map +0 -1
  530. package/dist/utils-DBGsNSJW.js +0 -33
  531. package/rollup.config.js +0 -94
  532. package/web-dev-server.config.mjs +0 -30
package/dist/Chip.js CHANGED
@@ -1,167 +1,3 @@
1
- import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
- import { property } from 'lit/decorators.js';
3
- import { L as LeuElement } from './LeuElement-BfXSO7MN.js';
4
- import { css } from 'lit';
5
-
6
- var css_248z = css`:host *::before,
7
- :host *::after {
8
- box-sizing: border-box;
9
- }
10
-
11
- :host {
12
- --chip-background-color-default: var(--leu-color-black-transp-10);
13
- --chip-background-color-hover: var(--leu-color-black-transp-20);
14
- --chip-background-color-checked: var(--leu-color-black-100);
15
- --chip-background-color-checked-hover: var(--leu-color-black-transp-80);
16
-
17
- --chip-color-default: var(--leu-color-black-transp-60);
18
- --chip-color-hover: var(--leu-color-black-100);
19
- --chip-color-checked: var(--leu-color-black-0);
20
-
21
- --chip-radio-border-default: var(--leu-color-black-transp-40);
22
- --chip-radio-border-checked: var(--leu-color-black-0);
23
- --chip-radio-background-default: var(--leu-color-black-0);
24
- --chip-radio-background-checked: var(--leu-color-func-cyan);
25
-
26
- --chip-font-regular: var(--leu-font-family-regular);
27
- --chip-font-black: var(--leu-font-family-black);
28
-
29
- --chip-background-color: var(--chip-background-color-default);
30
- --chip-color: var(--chip-color-default);
31
- --chip-radio-border: var(--chip-radio-border-default);
32
- --chip-radio-background: var(--chip-radio-background-default);
33
-
34
- --leu-icon-size: 1rem;
35
-
36
- font-family: var(--chip-font-regular);
37
-
38
- /* Allow shrinking to achieve text truncation (ellipsis) */
39
- min-width: 0;
40
- }
41
-
42
- :host([inverted]) {
43
- --chip-background-color: var(--leu-color-black-transp-20);
44
- --chip-background-color-hover: var(--leu-color-black-transp-40);
45
-
46
- --chip-color-default: var(--leu-color-black-0);
47
- --chip-color-hover: var(--leu-color-black-0);
48
- --chip-color-checked: var(--leu-color-black-0);
49
- }
50
-
51
- :host([checked]) {
52
- --chip-background-color: var(--chip-background-color-checked);
53
- --chip-color: var(--chip-color-checked);
54
- --chip-radio-border: var(--chip-radio-border-checked);
55
- --chip-radio-background: var(--chip-radio-background-checked);
56
- }
57
-
58
- .button {
59
- -webkit-appearance: none;
60
- -moz-appearance: none;
61
- appearance: none;
62
- border: none;
63
- border-radius: 1rem;
64
- background-color: var(--chip-background-color);
65
- padding: 8px 1rem;
66
-
67
- color: var(--chip-color);
68
- font-family: inherit;
69
- font-size: 0.875rem;
70
- line-height: 1rem;
71
-
72
- cursor: pointer;
73
-
74
- display: inline-flex;
75
- gap: 0.5rem;
76
- align-items: center;
77
-
78
- /* Allow shrinking to achieve text truncation (ellipsis) */
79
- min-width: 0;
80
- max-width: 100%;
81
- }
82
-
83
- .button:hover,
84
- .button:focus-visible {
85
- --chip-background-color: var(--chip-background-color-hover);
86
- --chip-color: var(--chip-color-hover);
87
- }
88
-
89
- .button:focus-visible {
90
- outline: 2px solid var(--leu-color-func-cyan);
91
- outline-offset: 2px;
92
- }
93
-
94
- :host([href]) .button {
95
- border-radius: 1.25rem;
96
- padding: 0.5rem 1rem;
97
-
98
- font-family: var(--chip-font-black);
99
- font-size: 1.125rem;
100
- line-height: 1.5rem;
101
- -webkit-text-decoration: none;
102
- text-decoration: none;
103
- }
104
-
105
- :host([checked]) .button:hover,
106
- :host([checked]) .button:focus-visible {
107
- --chip-background-color: var(--chip-background-color-checked-hover);
108
- --chip-color: var(--chip-color-checked);
109
- }
110
-
111
- :host([href][size="large"]) .button {
112
- border-radius: 1.5rem;
113
- padding: 0.3125rem 1.5rem;
114
-
115
- font-size: 2rem;
116
- line-height: 2.375rem;
117
- }
118
-
119
- :host([size="small"]:not([variant="radio"])) .button {
120
- padding: 0.3125rem 0.75rem;
121
-
122
- font-size: 0.75rem;
123
- line-height: 1.25rem;
124
- }
125
-
126
- :host([variant="radio"]) .button::before {
127
- content: "";
128
- flex: 0 0 1rem;
129
- width: 1rem;
130
- height: 1rem;
131
- background-color: var(--chip-radio-background);
132
- border: 2px solid var(--chip-radio-border);
133
- border-radius: 50%;
134
- }
135
-
136
- :host([variant="radio"][checked]) .button::before {
137
- border-width: 3px;
138
- }
139
-
140
- .label {
141
- position: relative;
142
- top: -0.0625rem;
143
-
144
- overflow: hidden;
145
- text-overflow: ellipsis;
146
- white-space: nowrap;
147
- }
148
- `;
149
-
150
- /* Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=21161-184433&mode=design&t=Kjo5VDiqivihn8dh-11 */
151
- class LeuChipBase extends LeuElement {
152
- constructor() {
153
- super(...arguments);
154
- this.inverted = false;
155
- }
156
- }
157
- LeuChipBase.styles = [LeuElement.styles, css_248z];
158
- /** @internal */
159
- LeuChipBase.shadowRootOptions = {
160
- ...LeuElement.shadowRootOptions,
161
- delegatesFocus: true,
162
- };
163
- __decorate([
164
- property({ type: Boolean, reflect: true })
165
- ], LeuChipBase.prototype, "inverted", void 0);
166
-
1
+ import "./LeuElement-B7NJzWwP.js";
2
+ import { t as LeuChipBase } from "./Chip-Ch09jjYi.js";
167
3
  export { LeuChipBase };
@@ -0,0 +1,125 @@
1
+ import { t as LeuElement } from "./LeuElement-B7NJzWwP.js";
2
+ import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
+ import { LeuChipSelectable } from "./ChipSelectable.js";
4
+ import { css } from "lit";
5
+ import { html as html$1, unsafeStatic } from "lit/static-html.js";
6
+ import { property } from "lit/decorators.js";
7
+ //#region src/components/chip/chip-group.css?inline
8
+ var chip_group_default = css`.label {
9
+ margin: 0 0 0.5rem;
10
+ font: var(--leu-t-curve-tiny-black-font);
11
+ color: var(--leu-color-black-100);
12
+ }
13
+
14
+ :host([inverted]) .label {
15
+ color: var(--leu-color-black-0);
16
+ }
17
+
18
+ .group {
19
+ display: flex;
20
+ flex-wrap: wrap;
21
+ gap: 0.5rem;
22
+ gap: var(--leu-chip-group-gap, 0.5rem);
23
+ }
24
+ `;
25
+ //#endregion
26
+ //#region src/components/chip/ChipGroup.ts
27
+ /**
28
+ * @slot - Place leu-chip-* elements inside this slot
29
+ * @cssproperty --leu-chip-group-gap - The gap between the chips
30
+ * @tagname leu-chip-group
31
+ */
32
+ var LeuChipGroup = class extends LeuElement {
33
+ constructor(..._args) {
34
+ super(..._args);
35
+ this.inverted = false;
36
+ this.selectionMode = "none";
37
+ this.headingLevel = 2;
38
+ this.label = "";
39
+ this.selectableItems = [];
40
+ this.handleInput = (e) => {
41
+ if (this.selectionMode === "single") this.selectableItems.forEach((item) => {
42
+ item.checked = item === e.target;
43
+ });
44
+ };
45
+ this.handleSlotChange = (e) => {
46
+ this.selectableItems = e.target.assignedElements({ flatten: true }).filter((el) => el instanceof LeuChipSelectable);
47
+ };
48
+ }
49
+ static {
50
+ this.styles = [LeuElement.styles, chip_group_default];
51
+ }
52
+ connectedCallback() {
53
+ super.connectedCallback();
54
+ /**
55
+ * It is technically possible to add an event listener to the host element
56
+ * before it is connected to the dom. In that case the outside event listener would
57
+ * be called before the following event listener. But at this point multiple
58
+ * radio chips could be selected at the same time because `handleInput` hasn't been
59
+ * called yet. That's why we use the capture phase.
60
+ */
61
+ this.addEventListener("input", this.handleInput, { capture: true });
62
+ }
63
+ disconnectedCallback() {
64
+ super.disconnectedCallback();
65
+ this.removeEventListener("input", this.handleInput, { capture: true });
66
+ }
67
+ get value() {
68
+ return this.selectableItems.filter((i) => i.checked).map((i) => i.getValue());
69
+ }
70
+ /**
71
+ * Checks the items with the given values.
72
+ * If the selectionMode is single, only the first item with the given value is checked.
73
+ */
74
+ set value(valueList) {
75
+ let hasChanged = false;
76
+ for (const item of this.selectableItems) {
77
+ item.checked = hasChanged ? false : valueList.includes(item.value);
78
+ if (this.selectionMode === "single" && item.checked) hasChanged = true;
79
+ }
80
+ }
81
+ /**
82
+ * Determines the heading tag of the accordion toggle.
83
+ * The headingLevel shouldn't be used directly to render the heading tag
84
+ * in order to avoid XSS issues.
85
+ * @internal
86
+ */
87
+ _getHeadingTag() {
88
+ let level = 2;
89
+ if (this.headingLevel > 0 && this.headingLevel < 7) level = this.headingLevel;
90
+ return `h${level}`;
91
+ }
92
+ render() {
93
+ const hTag = this._getHeadingTag();
94
+ return html$1`
95
+ ${this.label ? html$1`<${unsafeStatic(hTag)} class="label">
96
+ <span class="label">${this.label}</span>
97
+ </${unsafeStatic(hTag)}>` : ""}
98
+ <slot
99
+ class="group"
100
+ part="group"
101
+ @slotchange=${this.handleSlotChange}
102
+ ></slot>
103
+ `;
104
+ }
105
+ };
106
+ __decorate([property({
107
+ type: Boolean,
108
+ reflect: true
109
+ })], LeuChipGroup.prototype, "inverted", void 0);
110
+ __decorate([property({
111
+ type: String,
112
+ attribute: "selection-mode",
113
+ reflect: true
114
+ })], LeuChipGroup.prototype, "selectionMode", void 0);
115
+ __decorate([property({
116
+ type: Number,
117
+ attribute: "heading-level",
118
+ reflect: true
119
+ })], LeuChipGroup.prototype, "headingLevel", void 0);
120
+ __decorate([property({
121
+ type: String,
122
+ reflect: true
123
+ })], LeuChipGroup.prototype, "label", void 0);
124
+ //#endregion
125
+ export { LeuChipGroup as t };
@@ -0,0 +1,42 @@
1
+ import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
2
+ import { t as LeuChipSelectable } from "./ChipSelectable-CMJNcE4U.js";
3
+ import * as lit_html0 from "lit-html";
4
+
5
+ //#region src/components/chip/ChipGroup.d.ts
6
+ /**
7
+ * @slot - Place leu-chip-* elements inside this slot
8
+ * @cssproperty --leu-chip-group-gap - The gap between the chips
9
+ * @tagname leu-chip-group
10
+ */
11
+ declare class LeuChipGroup extends LeuElement {
12
+ static styles: any[];
13
+ inverted: boolean;
14
+ selectionMode: "single" | "multiple" | "none";
15
+ headingLevel: number;
16
+ label: string;
17
+ protected selectableItems: Array<LeuChipSelectable>;
18
+ connectedCallback(): void;
19
+ disconnectedCallback(): void;
20
+ get value(): string[];
21
+ /**
22
+ * Checks the items with the given values.
23
+ * If the selectionMode is single, only the first item with the given value is checked.
24
+ */
25
+ set value(valueList: string[]);
26
+ /**
27
+ * Determines the heading tag of the accordion toggle.
28
+ * The headingLevel shouldn't be used directly to render the heading tag
29
+ * in order to avoid XSS issues.
30
+ * @internal
31
+ */
32
+ protected _getHeadingTag(): string;
33
+ protected handleInput: (e: Event & {
34
+ target: LeuChipSelectable;
35
+ }) => void;
36
+ protected handleSlotChange: (e: Event & {
37
+ target: HTMLSlotElement;
38
+ }) => void;
39
+ render(): lit_html0.TemplateResult;
40
+ }
41
+ //#endregion
42
+ export { LeuChipGroup as t };
@@ -1,43 +1,2 @@
1
- import * as lit_html from 'lit-html';
2
- import * as lit from 'lit';
3
- import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
4
- import { LeuChipSelectable } from './ChipSelectable.js';
5
- import './Chip.js';
6
-
7
- /**
8
- * @slot - Place leu-chip-* elements inside this slot
9
- * @cssproperty --leu-chip-group-gap - The gap between the chips
10
- * @tagname leu-chip-group
11
- */
12
- declare class LeuChipGroup extends LeuElement {
13
- static styles: lit.CSSResultGroup[];
14
- inverted: boolean;
15
- selectionMode: "single" | "multiple" | "none";
16
- headingLevel: number;
17
- label: string;
18
- protected selectableItems: Array<LeuChipSelectable>;
19
- connectedCallback(): void;
20
- disconnectedCallback(): void;
21
- get value(): string[];
22
- /**
23
- * Checks the items with the given values.
24
- * If the selectionMode is single, only the first item with the given value is checked.
25
- */
26
- set value(valueList: string[]);
27
- /**
28
- * Determines the heading tag of the accordion toggle.
29
- * The headingLevel shouldn't be used directly to render the heading tag
30
- * in order to avoid XSS issues.
31
- * @internal
32
- */
33
- protected _getHeadingTag(): string;
34
- protected handleInput: (e: Event & {
35
- target: LeuChipSelectable;
36
- }) => void;
37
- protected handleSlotChange: (e: Event & {
38
- target: HTMLSlotElement;
39
- }) => void;
40
- render(): lit_html.TemplateResult;
41
- }
42
-
43
- export { LeuChipGroup };
1
+ import { t as LeuChipGroup } from "./ChipGroup-Ta8Ht4jc.js";
2
+ export { LeuChipGroup };
package/dist/ChipGroup.js CHANGED
@@ -1,133 +1,4 @@
1
- import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
- import { unsafeStatic, html } from 'lit/static-html.js';
3
- import { property } from 'lit/decorators.js';
4
- import { L as LeuElement } from './LeuElement-BfXSO7MN.js';
5
- import { css } from 'lit';
6
- import { LeuChipSelectable } from './ChipSelectable.js';
7
- import './Chip.js';
8
-
9
- var css_248z = css`.label {
10
- margin: 0 0 0.5rem;
11
- font: var(--leu-t-curve-tiny-black-font);
12
- color: var(--leu-color-black-100);
13
- }
14
-
15
- :host([inverted]) .label {
16
- color: var(--leu-color-black-0);
17
- }
18
-
19
- .group {
20
- display: flex;
21
- flex-wrap: wrap;
22
- gap: 0.5rem;
23
- gap: var(--leu-chip-group-gap, 0.5rem);
24
- }
25
- `;
26
-
27
- /**
28
- * @slot - Place leu-chip-* elements inside this slot
29
- * @cssproperty --leu-chip-group-gap - The gap between the chips
30
- * @tagname leu-chip-group
31
- */
32
- class LeuChipGroup extends LeuElement {
33
- constructor() {
34
- super(...arguments);
35
- this.inverted = false;
36
- this.selectionMode = "none";
37
- this.headingLevel = 2;
38
- this.label = "";
39
- this.selectableItems = [];
40
- this.handleInput = (e) => {
41
- if (this.selectionMode === "single") {
42
- this.selectableItems.forEach((item) => {
43
- item.checked = item === e.target; // eslint-disable-line no-param-reassign
44
- });
45
- }
46
- };
47
- this.handleSlotChange = (e) => {
48
- const slot = e.target;
49
- const items = slot
50
- .assignedElements({ flatten: true })
51
- .filter((el) => el instanceof LeuChipSelectable);
52
- this.selectableItems = items;
53
- };
54
- }
55
- connectedCallback() {
56
- super.connectedCallback();
57
- /**
58
- * It is technically possible to add an event listener to the host element
59
- * before it is connected to the dom. In that case the outside event listener would
60
- * be called before the following event listener. But at this point multiple
61
- * radio chips could be selected at the same time because `handleInput` hasn't been
62
- * called yet. That's why we use the capture phase.
63
- */
64
- this.addEventListener("input", this.handleInput, { capture: true });
65
- }
66
- disconnectedCallback() {
67
- super.disconnectedCallback();
68
- this.removeEventListener("input", this.handleInput, { capture: true });
69
- }
70
- get value() {
71
- return this.selectableItems
72
- .filter((i) => i.checked)
73
- .map((i) => i.getValue());
74
- }
75
- /**
76
- * Checks the items with the given values.
77
- * If the selectionMode is single, only the first item with the given value is checked.
78
- */
79
- set value(valueList) {
80
- let hasChanged = false;
81
- for (const item of this.selectableItems) {
82
- item.checked = hasChanged ? false : valueList.includes(item.value);
83
- if (this.selectionMode === "single" && item.checked) {
84
- hasChanged = true;
85
- }
86
- }
87
- }
88
- /**
89
- * Determines the heading tag of the accordion toggle.
90
- * The headingLevel shouldn't be used directly to render the heading tag
91
- * in order to avoid XSS issues.
92
- * @internal
93
- */
94
- _getHeadingTag() {
95
- let level = 2;
96
- if (this.headingLevel > 0 && this.headingLevel < 7) {
97
- level = this.headingLevel;
98
- }
99
- return `h${level}`;
100
- }
101
- render() {
102
- const hTag = this._getHeadingTag();
103
- /* The eslint rules don't recognize html import from lit/static-html.js */
104
- /* eslint-disable lit/binding-positions, lit/no-invalid-html */
105
- return html `
106
- ${this.label
107
- ? html `<${unsafeStatic(hTag)} class="label">
108
- <span class="label">${this.label}</span>
109
- </${unsafeStatic(hTag)}>`
110
- : ""}
111
- <slot
112
- class="group"
113
- part="group"
114
- @slotchange=${this.handleSlotChange}
115
- ></slot>
116
- `;
117
- }
118
- }
119
- LeuChipGroup.styles = [LeuElement.styles, css_248z];
120
- __decorate([
121
- property({ type: Boolean, reflect: true })
122
- ], LeuChipGroup.prototype, "inverted", void 0);
123
- __decorate([
124
- property({ type: String, attribute: "selection-mode", reflect: true })
125
- ], LeuChipGroup.prototype, "selectionMode", void 0);
126
- __decorate([
127
- property({ type: Number, attribute: "heading-level", reflect: true })
128
- ], LeuChipGroup.prototype, "headingLevel", void 0);
129
- __decorate([
130
- property({ type: String, reflect: true })
131
- ], LeuChipGroup.prototype, "label", void 0);
132
-
1
+ import "./LeuElement-B7NJzWwP.js";
2
+ import { t as LeuChipGroup } from "./ChipGroup-PvqVW-tm.js";
3
+ import "./Chip-Ch09jjYi.js";
133
4
  export { LeuChipGroup };
@@ -0,0 +1,17 @@
1
+ import { t as LeuChipBase } from "./Chip-DLKM9P7v.js";
2
+ import * as lit_html0 from "lit-html";
3
+
4
+ //#region src/components/chip/ChipLink.d.ts
5
+ /**
6
+ * @tagname leu-chip-link
7
+ * @slot - The content of the chip
8
+ */
9
+ declare class LeuChipLink extends LeuChipBase {
10
+ /** The size of the chip */
11
+ size: "regular" | "large";
12
+ /** The URL that the chip links to */
13
+ href: string;
14
+ render(): lit_html0.TemplateResult<1>;
15
+ }
16
+ //#endregion
17
+ export { LeuChipLink as t };
@@ -1,18 +1,2 @@
1
- import * as lit_html from 'lit-html';
2
- import { LeuChipBase } from './Chip.js';
3
- import 'lit';
4
- import './LeuElement.d-BevHqLUu.js';
5
-
6
- /**
7
- * @tagname leu-chip-link
8
- * @slot - The content of the chip
9
- */
10
- declare class LeuChipLink extends LeuChipBase {
11
- /** The size of the chip */
12
- size: "regular" | "large";
13
- /** The URL that the chip links to */
14
- href: string;
15
- render(): lit_html.TemplateResult<1>;
16
- }
17
-
18
- export { LeuChipLink };
1
+ import { t as LeuChipLink } from "./ChipLink-BAxyQO2M.js";
2
+ export { LeuChipLink };
package/dist/ChipLink.js CHANGED
@@ -1,32 +1,32 @@
1
- import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
- import { html } from 'lit';
3
- import { property } from 'lit/decorators.js';
4
- import { LeuChipBase } from './Chip.js';
5
- import './LeuElement-BfXSO7MN.js';
6
-
1
+ import "./LeuElement-B7NJzWwP.js";
2
+ import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
+ import { t as LeuChipBase } from "./Chip-Ch09jjYi.js";
4
+ import { html } from "lit";
5
+ import { property } from "lit/decorators.js";
6
+ //#region src/components/chip/ChipLink.ts
7
7
  /**
8
- * @tagname leu-chip-link
9
- * @slot - The content of the chip
10
- */
11
- class LeuChipLink extends LeuChipBase {
12
- constructor() {
13
- super(...arguments);
14
- /** The size of the chip */
15
- this.size = "regular";
16
- /** The URL that the chip links to */
17
- this.href = "";
18
- }
19
- render() {
20
- return html `<a href=${this.href} class="button">
8
+ * @tagname leu-chip-link
9
+ * @slot - The content of the chip
10
+ */
11
+ var LeuChipLink = class extends LeuChipBase {
12
+ constructor(..._args) {
13
+ super(..._args);
14
+ this.size = "regular";
15
+ this.href = "";
16
+ }
17
+ render() {
18
+ return html`<a href=${this.href} class="button">
21
19
  <span class="label"><slot></slot></span>
22
20
  </a>`;
23
- }
24
- }
25
- __decorate([
26
- property({ type: String, reflect: true })
27
- ], LeuChipLink.prototype, "size", void 0);
28
- __decorate([
29
- property({ type: String, reflect: true })
30
- ], LeuChipLink.prototype, "href", void 0);
31
-
21
+ }
22
+ };
23
+ __decorate([property({
24
+ type: String,
25
+ reflect: true
26
+ })], LeuChipLink.prototype, "size", void 0);
27
+ __decorate([property({
28
+ type: String,
29
+ reflect: true
30
+ })], LeuChipLink.prototype, "href", void 0);
31
+ //#endregion
32
32
  export { LeuChipLink };
@@ -0,0 +1,25 @@
1
+ import { t as LeuIcon } from "./Icon-Op80LrrO.js";
2
+ import { t as LeuChipBase } from "./Chip-DLKM9P7v.js";
3
+ import * as lit_html0 from "lit-html";
4
+
5
+ //#region src/components/chip/ChipRemovable.d.ts
6
+ /**
7
+ * @slot - The content of the chip
8
+ * @tagname leu-chip-removable
9
+ * @fires remove - Dispatched when the user clicks on the chip
10
+ * @prop {string} value - The value of the chip.
11
+ */
12
+ declare class LeuChipRemovable extends LeuChipBase {
13
+ static dependencies: {
14
+ "leu-icon": typeof LeuIcon;
15
+ };
16
+ value: string;
17
+ /**
18
+ * Returns the value of the chip. If `value` is not set, it will return the text content
19
+ */
20
+ getValue(): string;
21
+ protected handleClick(): void;
22
+ render(): lit_html0.TemplateResult<1>;
23
+ }
24
+ //#endregion
25
+ export { LeuChipRemovable as t };
@@ -1,26 +1,2 @@
1
- import * as lit_html from 'lit-html';
2
- import { LeuChipBase } from './Chip.js';
3
- import { L as LeuIcon } from './Icon.d-itcQ94ym.js';
4
- import 'lit';
5
- import './LeuElement.d-BevHqLUu.js';
6
-
7
- /**
8
- * @slot - The content of the chip
9
- * @tagname leu-chip-removable
10
- * @fires remove - Dispatched when the user clicks on the chip
11
- * @prop {string} value - The value of the chip.
12
- */
13
- declare class LeuChipRemovable extends LeuChipBase {
14
- static dependencies: {
15
- "leu-icon": typeof LeuIcon;
16
- };
17
- value: string;
18
- /**
19
- * Returns the value of the chip. If `value` is not set, it will return the text content
20
- */
21
- getValue(): string;
22
- protected handleClick(): void;
23
- render(): lit_html.TemplateResult<1>;
24
- }
25
-
26
- export { LeuChipRemovable };
1
+ import { t as LeuChipRemovable } from "./ChipRemovable-DBjwt0CH.js";
2
+ export { LeuChipRemovable };