@statistikzh/leu 0.14.2 → 0.14.4

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 (528) hide show
  1. package/.eslintrc.json +23 -4
  2. package/.github/workflows/ci.yml +3 -0
  3. package/.github/workflows/release-please.yml +0 -1
  4. package/.prettierignore +1 -1
  5. package/.release-please-manifest.json +3 -0
  6. package/.storybook/{main.js → main.ts} +18 -2
  7. package/.storybook/{theme.js → theme.ts} +1 -0
  8. package/CHANGELOG.md +16 -0
  9. package/custom-elements-manifest.config.js +2 -2
  10. package/dist/Accordion.d.ts +32 -11
  11. package/dist/Accordion.js +96 -68
  12. package/dist/Button.d.ts +84 -33
  13. package/dist/Button.js +116 -136
  14. package/dist/ButtonGroup.d.ts +15 -10
  15. package/dist/ButtonGroup.js +65 -72
  16. package/dist/Checkbox.d.ts +41 -8
  17. package/dist/Checkbox.js +33 -45
  18. package/dist/CheckboxGroup.d.ts +21 -8
  19. package/dist/CheckboxGroup.js +31 -35
  20. package/dist/Chip.d.ts +23 -4
  21. package/dist/Chip.js +13 -17
  22. package/dist/ChipGroup.d.ts +43 -17
  23. package/dist/ChipGroup.js +87 -113
  24. package/dist/ChipLink.d.ts +28 -10
  25. package/dist/ChipLink.js +17 -24
  26. package/dist/ChipRemovable.d.ts +25 -6
  27. package/dist/ChipRemovable.js +32 -36
  28. package/dist/ChipSelectable.d.ts +41 -23
  29. package/dist/ChipSelectable.js +55 -69
  30. package/dist/Dialog.d.ts +39 -11
  31. package/dist/Dialog.js +48 -55
  32. package/dist/Dropdown.d.ts +44 -9
  33. package/dist/Dropdown.js +89 -96
  34. package/dist/Icon.d.ts +16 -9
  35. package/dist/Icon.js +117 -122
  36. package/dist/Input.d.ts +122 -34
  37. package/dist/Input.js +262 -342
  38. package/dist/LeuElement-x8UlIDDl.js +42 -0
  39. package/dist/LeuElement.d-BevHqLUu.d.ts +10 -0
  40. package/dist/Menu.d.ts +29 -10
  41. package/dist/Menu.js +111 -110
  42. package/dist/MenuItem.d.ts +69 -19
  43. package/dist/MenuItem.js +93 -109
  44. package/dist/Pagination.d.ts +46 -16
  45. package/dist/Pagination.js +101 -116
  46. package/dist/Popup.d.ts +55 -21
  47. package/dist/Popup.js +149 -178
  48. package/dist/Radio.d.ts +37 -8
  49. package/dist/Radio.js +30 -42
  50. package/dist/RadioGroup.d.ts +25 -7
  51. package/dist/RadioGroup.js +123 -128
  52. package/dist/Range.d.ts +62 -23
  53. package/dist/Range.js +154 -180
  54. package/dist/ScrollTop.d.ts +25 -14
  55. package/dist/ScrollTop.js +71 -75
  56. package/dist/Select.d.ts +55 -38
  57. package/dist/Select.js +310 -322
  58. package/dist/Spinner.d.ts +9 -4
  59. package/dist/Spinner.js +5 -5
  60. package/dist/Table.d.ts +61 -31
  61. package/dist/Table.js +160 -179
  62. package/dist/VisuallyHidden.d.ts +9 -4
  63. package/dist/VisuallyHidden.js +5 -5
  64. package/dist/components/accordion/Accordion.d.ts +49 -0
  65. package/dist/components/accordion/Accordion.d.ts.map +1 -0
  66. package/dist/components/accordion/leu-accordion.d.ts +8 -0
  67. package/dist/components/accordion/leu-accordion.d.ts.map +1 -0
  68. package/dist/components/accordion/stories/accordion.stories.d.ts +26 -0
  69. package/dist/components/accordion/stories/accordion.stories.d.ts.map +1 -0
  70. package/dist/components/accordion/test/accordion.test.d.ts +2 -0
  71. package/dist/components/accordion/test/accordion.test.d.ts.map +1 -0
  72. package/dist/components/button/Button.d.ts +93 -0
  73. package/dist/components/button/Button.d.ts.map +1 -0
  74. package/dist/components/button/leu-button.d.ts +8 -0
  75. package/dist/components/button/leu-button.d.ts.map +1 -0
  76. package/dist/components/button/stories/button.stories.d.ts +19 -0
  77. package/dist/components/button/stories/button.stories.d.ts.map +1 -0
  78. package/dist/components/button/test/button.test.d.ts +3 -0
  79. package/dist/components/button/test/button.test.d.ts.map +1 -0
  80. package/dist/components/button-group/ButtonGroup.d.ts +25 -0
  81. package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
  82. package/dist/components/button-group/leu-button-group.d.ts +8 -0
  83. package/dist/components/button-group/leu-button-group.d.ts.map +1 -0
  84. package/dist/components/button-group/stories/button-group.stories.d.ts +15 -0
  85. package/dist/components/button-group/stories/button-group.stories.d.ts.map +1 -0
  86. package/dist/components/button-group/test/button-group.test.d.ts +3 -0
  87. package/dist/components/button-group/test/button-group.test.d.ts.map +1 -0
  88. package/dist/components/checkbox/Checkbox.d.ts +43 -0
  89. package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
  90. package/dist/components/checkbox/CheckboxGroup.d.ts +23 -0
  91. package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -0
  92. package/dist/components/checkbox/leu-checkbox-group.d.ts +8 -0
  93. package/dist/components/checkbox/leu-checkbox-group.d.ts.map +1 -0
  94. package/dist/components/checkbox/leu-checkbox.d.ts +8 -0
  95. package/dist/components/checkbox/leu-checkbox.d.ts.map +1 -0
  96. package/dist/components/checkbox/stories/checkbox-group.stories.d.ts +29 -0
  97. package/dist/components/checkbox/stories/checkbox-group.stories.d.ts.map +1 -0
  98. package/dist/components/checkbox/stories/checkbox.stories.d.ts +22 -0
  99. package/dist/components/checkbox/stories/checkbox.stories.d.ts.map +1 -0
  100. package/dist/components/checkbox/test/checkbox-group.test.d.ts +3 -0
  101. package/dist/components/checkbox/test/checkbox-group.test.d.ts.map +1 -0
  102. package/dist/components/checkbox/test/checkbox.test.d.ts +2 -0
  103. package/dist/components/checkbox/test/checkbox.test.d.ts.map +1 -0
  104. package/dist/components/chip/Chip.d.ts +21 -0
  105. package/dist/components/chip/Chip.d.ts.map +1 -0
  106. package/dist/components/chip/ChipGroup.d.ts +58 -0
  107. package/dist/components/chip/ChipGroup.d.ts.map +1 -0
  108. package/dist/components/chip/ChipLink.d.ts +29 -0
  109. package/dist/components/chip/ChipLink.d.ts.map +1 -0
  110. package/dist/components/chip/ChipRemovable.d.ts +32 -0
  111. package/dist/components/chip/ChipRemovable.d.ts.map +1 -0
  112. package/dist/components/chip/ChipSelectable.d.ts +51 -0
  113. package/dist/components/chip/ChipSelectable.d.ts.map +1 -0
  114. package/dist/components/chip/exports.d.ts +5 -0
  115. package/dist/components/chip/exports.d.ts.map +1 -0
  116. package/dist/components/chip/leu-chip-group.d.ts +8 -0
  117. package/dist/components/chip/leu-chip-group.d.ts.map +1 -0
  118. package/dist/components/chip/leu-chip-link.d.ts +8 -0
  119. package/dist/components/chip/leu-chip-link.d.ts.map +1 -0
  120. package/dist/components/chip/leu-chip-removable.d.ts +8 -0
  121. package/dist/components/chip/leu-chip-removable.d.ts.map +1 -0
  122. package/dist/components/chip/leu-chip-selectable.d.ts +8 -0
  123. package/dist/components/chip/leu-chip-selectable.d.ts.map +1 -0
  124. package/dist/components/chip/stories/chip-group.stories.d.ts +40 -0
  125. package/dist/components/chip/stories/chip-group.stories.d.ts.map +1 -0
  126. package/dist/components/chip/stories/chip-link.stories.d.ts +27 -0
  127. package/dist/components/chip/stories/chip-link.stories.d.ts.map +1 -0
  128. package/dist/components/chip/stories/chip-removable.stories.d.ts +21 -0
  129. package/dist/components/chip/stories/chip-removable.stories.d.ts.map +1 -0
  130. package/dist/components/chip/stories/chip-selectable.stories.d.ts +35 -0
  131. package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +1 -0
  132. package/dist/components/chip/test/chip-group.test.d.ts +4 -0
  133. package/dist/components/chip/test/chip-group.test.d.ts.map +1 -0
  134. package/dist/components/chip/test/chip-link.test.d.ts +2 -0
  135. package/dist/components/chip/test/chip-link.test.d.ts.map +1 -0
  136. package/dist/components/chip/test/chip-removable.test.d.ts +2 -0
  137. package/dist/components/chip/test/chip-removable.test.d.ts.map +1 -0
  138. package/dist/components/chip/test/chip-selectable.test.d.ts +2 -0
  139. package/dist/components/chip/test/chip-selectable.test.d.ts.map +1 -0
  140. package/dist/components/chip/test/chip.test.d.ts +2 -0
  141. package/dist/components/chip/test/chip.test.d.ts.map +1 -0
  142. package/dist/components/dialog/Dialog.d.ts +41 -0
  143. package/dist/components/dialog/Dialog.d.ts.map +1 -0
  144. package/dist/components/dialog/leu-dialog.d.ts +8 -0
  145. package/dist/components/dialog/leu-dialog.d.ts.map +1 -0
  146. package/dist/components/dialog/stories/dialog.stories.d.ts +19 -0
  147. package/dist/components/dialog/stories/dialog.stories.d.ts.map +1 -0
  148. package/dist/components/dialog/test/dialog.test.d.ts +2 -0
  149. package/dist/components/dialog/test/dialog.test.d.ts.map +1 -0
  150. package/dist/components/dropdown/Dropdown.d.ts +49 -0
  151. package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
  152. package/dist/components/dropdown/leu-dropdown.d.ts +8 -0
  153. package/dist/components/dropdown/leu-dropdown.d.ts.map +1 -0
  154. package/dist/components/dropdown/stories/dropdown.stories.d.ts +25 -0
  155. package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +1 -0
  156. package/dist/components/dropdown/test/dropdown.test.d.ts +2 -0
  157. package/dist/components/dropdown/test/dropdown.test.d.ts.map +1 -0
  158. package/dist/components/icon/Icon.d.ts +23 -0
  159. package/dist/components/icon/Icon.d.ts.map +1 -0
  160. package/dist/components/icon/leu-icon.d.ts +8 -0
  161. package/dist/components/icon/leu-icon.d.ts.map +1 -0
  162. package/dist/components/icon/paths.d.ts +101 -0
  163. package/dist/components/icon/paths.d.ts.map +1 -0
  164. package/dist/components/icon/stories/icon.stories.d.ts +22 -0
  165. package/dist/components/icon/stories/icon.stories.d.ts.map +1 -0
  166. package/dist/components/icon/test/icon.test.d.ts +2 -0
  167. package/dist/components/icon/test/icon.test.d.ts.map +1 -0
  168. package/dist/components/input/Input.d.ts +239 -0
  169. package/dist/components/input/Input.d.ts.map +1 -0
  170. package/dist/components/input/leu-input.d.ts +8 -0
  171. package/dist/components/input/leu-input.d.ts.map +1 -0
  172. package/dist/components/input/stories/input.stories.d.ts +35 -0
  173. package/dist/components/input/stories/input.stories.d.ts.map +1 -0
  174. package/dist/components/input/test/input.test.d.ts +2 -0
  175. package/dist/components/input/test/input.test.d.ts.map +1 -0
  176. package/dist/components/menu/Menu.d.ts +44 -0
  177. package/dist/components/menu/Menu.d.ts.map +1 -0
  178. package/dist/components/menu/MenuItem.d.ts +88 -0
  179. package/dist/components/menu/MenuItem.d.ts.map +1 -0
  180. package/dist/components/menu/leu-menu-item.d.ts +8 -0
  181. package/dist/components/menu/leu-menu-item.d.ts.map +1 -0
  182. package/dist/components/menu/leu-menu.d.ts +8 -0
  183. package/dist/components/menu/leu-menu.d.ts.map +1 -0
  184. package/dist/components/menu/stories/menu-item.stories.d.ts +24 -0
  185. package/dist/components/menu/stories/menu-item.stories.d.ts.map +1 -0
  186. package/dist/components/menu/stories/menu.stories.d.ts +26 -0
  187. package/dist/components/menu/stories/menu.stories.d.ts.map +1 -0
  188. package/dist/components/menu/test/menu-item.test.d.ts +3 -0
  189. package/dist/components/menu/test/menu-item.test.d.ts.map +1 -0
  190. package/dist/components/menu/test/menu.test.d.ts +4 -0
  191. package/dist/components/menu/test/menu.test.d.ts.map +1 -0
  192. package/dist/components/pagination/Pagination.d.ts +59 -0
  193. package/dist/components/pagination/Pagination.d.ts.map +1 -0
  194. package/dist/components/pagination/leu-pagination.d.ts +8 -0
  195. package/dist/components/pagination/leu-pagination.d.ts.map +1 -0
  196. package/dist/components/pagination/stories/pagination.stories.d.ts +17 -0
  197. package/dist/components/pagination/stories/pagination.stories.d.ts.map +1 -0
  198. package/dist/components/pagination/test/pagination.test.d.ts +2 -0
  199. package/dist/components/pagination/test/pagination.test.d.ts.map +1 -0
  200. package/dist/components/popup/Popup.d.ts +66 -0
  201. package/dist/components/popup/Popup.d.ts.map +1 -0
  202. package/dist/components/popup/leu-popup.d.ts +8 -0
  203. package/dist/components/popup/leu-popup.d.ts.map +1 -0
  204. package/dist/components/popup/stories/popup.stories.d.ts +17 -0
  205. package/dist/components/popup/stories/popup.stories.d.ts.map +1 -0
  206. package/dist/components/popup/test/popup.test.d.ts +2 -0
  207. package/dist/components/popup/test/popup.test.d.ts.map +1 -0
  208. package/dist/components/radio/Radio.d.ts +39 -0
  209. package/dist/components/radio/Radio.d.ts.map +1 -0
  210. package/dist/components/radio/RadioGroup.d.ts +34 -0
  211. package/dist/components/radio/RadioGroup.d.ts.map +1 -0
  212. package/dist/components/radio/leu-radio-group.d.ts +8 -0
  213. package/dist/components/radio/leu-radio-group.d.ts.map +1 -0
  214. package/dist/components/radio/leu-radio.d.ts +8 -0
  215. package/dist/components/radio/leu-radio.d.ts.map +1 -0
  216. package/dist/components/radio/stories/radio-group.stories.d.ts +29 -0
  217. package/dist/components/radio/stories/radio-group.stories.d.ts.map +1 -0
  218. package/dist/components/radio/stories/radio.stories.d.ts +22 -0
  219. package/dist/components/radio/stories/radio.stories.d.ts.map +1 -0
  220. package/dist/components/radio/test/radio-group.test.d.ts +3 -0
  221. package/dist/components/radio/test/radio-group.test.d.ts.map +1 -0
  222. package/dist/components/radio/test/radio.test.d.ts +2 -0
  223. package/dist/components/radio/test/radio.test.d.ts.map +1 -0
  224. package/dist/components/range/Range.d.ts +95 -0
  225. package/dist/components/range/Range.d.ts.map +1 -0
  226. package/dist/components/range/leu-range.d.ts +8 -0
  227. package/dist/components/range/leu-range.d.ts.map +1 -0
  228. package/dist/components/range/stories/range-slider.stories.d.ts +26 -0
  229. package/dist/components/range/stories/range-slider.stories.d.ts.map +1 -0
  230. package/dist/components/range/test/range.test.d.ts +2 -0
  231. package/dist/components/range/test/range.test.d.ts.map +1 -0
  232. package/dist/components/scroll-top/ScrollTop.d.ts +25 -0
  233. package/dist/components/scroll-top/ScrollTop.d.ts.map +1 -0
  234. package/dist/components/scroll-top/leu-scroll-top.d.ts +8 -0
  235. package/dist/components/scroll-top/leu-scroll-top.d.ts.map +1 -0
  236. package/dist/components/scroll-top/stories/scroll-top.stories.d.ts +8 -0
  237. package/dist/components/scroll-top/stories/scroll-top.stories.d.ts.map +1 -0
  238. package/dist/components/scroll-top/test/scroll-top.test.d.ts +2 -0
  239. package/dist/components/scroll-top/test/scroll-top.test.d.ts.map +1 -0
  240. package/dist/components/select/Select.d.ts +145 -0
  241. package/dist/components/select/Select.d.ts.map +1 -0
  242. package/dist/components/select/leu-select.d.ts +8 -0
  243. package/dist/components/select/leu-select.d.ts.map +1 -0
  244. package/dist/components/select/stories/select.stories.d.ts +23 -0
  245. package/dist/components/select/stories/select.stories.d.ts.map +1 -0
  246. package/dist/components/select/test/fixtures.d.ts +2 -0
  247. package/dist/components/select/test/fixtures.d.ts.map +1 -0
  248. package/dist/components/select/test/select.test.d.ts +3 -0
  249. package/dist/components/select/test/select.test.d.ts.map +1 -0
  250. package/dist/components/spinner/Spinner.d.ts +10 -0
  251. package/dist/components/spinner/Spinner.d.ts.map +1 -0
  252. package/dist/components/spinner/leu-spinner.d.ts +8 -0
  253. package/dist/components/spinner/leu-spinner.d.ts.map +1 -0
  254. package/dist/components/spinner/stories/spinner.stories.d.ts +16 -0
  255. package/dist/components/spinner/stories/spinner.stories.d.ts.map +1 -0
  256. package/dist/components/spinner/test/spinner.test.d.ts +2 -0
  257. package/dist/components/spinner/test/spinner.test.d.ts.map +1 -0
  258. package/dist/components/table/Table.d.ts +65 -0
  259. package/dist/components/table/Table.d.ts.map +1 -0
  260. package/dist/components/table/leu-table.d.ts +8 -0
  261. package/dist/components/table/leu-table.d.ts.map +1 -0
  262. package/dist/components/table/stories/table.stories.d.ts +15 -0
  263. package/dist/components/table/stories/table.stories.d.ts.map +1 -0
  264. package/dist/components/table/test/table.test.d.ts +2 -0
  265. package/dist/components/table/test/table.test.d.ts.map +1 -0
  266. package/dist/components/visually-hidden/VisuallyHidden.d.ts +9 -0
  267. package/dist/components/visually-hidden/VisuallyHidden.d.ts.map +1 -0
  268. package/dist/components/visually-hidden/leu-visually-hidden.d.ts +8 -0
  269. package/dist/components/visually-hidden/leu-visually-hidden.d.ts.map +1 -0
  270. package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts +13 -0
  271. package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts.map +1 -0
  272. package/dist/components/visually-hidden/test/visually-hidden.test.d.ts +2 -0
  273. package/dist/components/visually-hidden/test/visually-hidden.test.d.ts.map +1 -0
  274. package/dist/hasSlotController-Bm2tipvG.js +53 -0
  275. package/dist/hasSlotController.d-emXwVXWF.d.ts +23 -0
  276. package/dist/index.d.ts +17 -20
  277. package/dist/index.d.ts.map +1 -1
  278. package/dist/index.js +3 -2
  279. package/dist/leu-accordion.d.ts +12 -2
  280. package/dist/leu-accordion.js +2 -1
  281. package/dist/leu-button-group.d.ts +12 -2
  282. package/dist/leu-button-group.js +1 -1
  283. package/dist/leu-button.d.ts +14 -2
  284. package/dist/leu-button.js +2 -2
  285. package/dist/leu-checkbox-group.d.ts +12 -2
  286. package/dist/leu-checkbox-group.js +1 -1
  287. package/dist/leu-checkbox.d.ts +13 -2
  288. package/dist/leu-checkbox.js +1 -1
  289. package/dist/leu-chip-group.d.ts +12 -2
  290. package/dist/leu-chip-group.js +2 -2
  291. package/dist/leu-chip-link.d.ts +13 -2
  292. package/dist/leu-chip-link.js +1 -1
  293. package/dist/leu-chip-removable.d.ts +14 -2
  294. package/dist/leu-chip-removable.js +1 -1
  295. package/dist/leu-chip-selectable.d.ts +13 -2
  296. package/dist/leu-chip-selectable.js +1 -1
  297. package/dist/leu-dialog.d.ts +14 -2
  298. package/dist/leu-dialog.js +2 -2
  299. package/dist/leu-dropdown.d.ts +18 -2
  300. package/dist/leu-dropdown.js +2 -2
  301. package/dist/leu-icon.d.ts +12 -2
  302. package/dist/leu-icon.js +1 -1
  303. package/dist/leu-input.d.ts +13 -2
  304. package/dist/leu-input.js +1 -1
  305. package/dist/leu-menu-item.d.ts +13 -2
  306. package/dist/leu-menu-item.js +1 -1
  307. package/dist/leu-menu.d.ts +14 -2
  308. package/dist/leu-menu.js +1 -1
  309. package/dist/leu-pagination.d.ts +16 -2
  310. package/dist/leu-pagination.js +2 -2
  311. package/dist/leu-popup.d.ts +12 -2
  312. package/dist/leu-popup.js +1 -1
  313. package/dist/leu-radio-group.d.ts +12 -2
  314. package/dist/leu-radio-group.js +1 -1
  315. package/dist/leu-radio.d.ts +12 -2
  316. package/dist/leu-radio.js +1 -1
  317. package/dist/leu-range.d.ts +12 -2
  318. package/dist/leu-range.js +1 -1
  319. package/dist/leu-scroll-top.d.ts +15 -2
  320. package/dist/leu-scroll-top.js +2 -2
  321. package/dist/leu-select.d.ts +19 -2
  322. package/dist/leu-select.js +2 -2
  323. package/dist/leu-spinner.d.ts +12 -2
  324. package/dist/leu-spinner.js +1 -1
  325. package/dist/leu-table.d.ts +17 -2
  326. package/dist/leu-table.js +2 -2
  327. package/dist/leu-visually-hidden.d.ts +12 -2
  328. package/dist/leu-visually-hidden.js +1 -1
  329. package/dist/lib/LeuElement.d.ts +8 -0
  330. package/dist/lib/LeuElement.d.ts.map +1 -0
  331. package/dist/lib/a11y.d.ts +11 -0
  332. package/dist/lib/a11y.d.ts.map +1 -0
  333. package/dist/lib/hasSlotController.d.ts +20 -0
  334. package/dist/lib/hasSlotController.d.ts.map +1 -0
  335. package/dist/lib/utils.d.ts +16 -0
  336. package/dist/lib/utils.d.ts.map +1 -0
  337. package/dist/styles/style.stories.d.ts +6 -0
  338. package/dist/styles/style.stories.d.ts.map +1 -0
  339. package/dist/vscode.html-custom-data.json +1 -1
  340. package/dist/vue/index.d.ts +1 -3
  341. package/dist/web-types.json +4 -5
  342. package/package.json +20 -13
  343. package/release-please-config.json +10 -0
  344. package/rollup.config.js +55 -25
  345. package/scripts/generate-component/generate.js +1 -1
  346. package/scripts/generate-component/templates/{[Name].js → [Name].ts} +3 -3
  347. package/src/components/accordion/{Accordion.js → Accordion.ts} +26 -21
  348. package/src/components/accordion/{leu-accordion.js → leu-accordion.ts} +6 -0
  349. package/src/components/accordion/stories/{accordion.stories.js → accordion.stories.ts} +10 -8
  350. package/src/components/button/{Button.js → Button.ts} +0 -1
  351. package/src/components/button/{leu-button.js → leu-button.ts} +6 -0
  352. package/src/components/button-group/{ButtonGroup.js → ButtonGroup.ts} +4 -8
  353. package/src/components/button-group/{leu-button-group.js → leu-button-group.ts} +6 -0
  354. package/src/components/checkbox/{Checkbox.js → Checkbox.ts} +0 -1
  355. package/src/components/checkbox/{CheckboxGroup.js → CheckboxGroup.ts} +0 -1
  356. package/src/components/checkbox/{leu-checkbox-group.js → leu-checkbox-group.ts} +6 -0
  357. package/src/components/checkbox/{leu-checkbox.js → leu-checkbox.ts} +6 -0
  358. package/src/components/chip/{Chip.js → Chip.ts} +0 -1
  359. package/src/components/chip/{ChipGroup.js → ChipGroup.ts} +0 -1
  360. package/src/components/chip/{leu-chip-group.js → leu-chip-group.ts} +6 -0
  361. package/src/components/chip/{leu-chip-link.js → leu-chip-link.ts} +6 -0
  362. package/src/components/chip/{leu-chip-removable.js → leu-chip-removable.ts} +6 -0
  363. package/src/components/chip/{leu-chip-selectable.js → leu-chip-selectable.ts} +6 -0
  364. package/src/components/dialog/{Dialog.js → Dialog.ts} +0 -1
  365. package/src/components/dialog/{leu-dialog.js → leu-dialog.ts} +6 -0
  366. package/src/components/dropdown/{Dropdown.js → Dropdown.ts} +0 -1
  367. package/src/components/dropdown/{leu-dropdown.js → leu-dropdown.ts} +6 -0
  368. package/src/components/icon/{Icon.js → Icon.ts} +0 -1
  369. package/src/components/icon/{leu-icon.js → leu-icon.ts} +6 -0
  370. package/src/components/input/{Input.js → Input.ts} +0 -1
  371. package/src/components/input/{leu-input.js → leu-input.ts} +6 -0
  372. package/src/components/menu/{Menu.js → Menu.ts} +2 -2
  373. package/src/components/menu/{MenuItem.js → MenuItem.ts} +0 -1
  374. package/src/components/menu/{leu-menu-item.js → leu-menu-item.ts} +6 -0
  375. package/src/components/menu/{leu-menu.js → leu-menu.ts} +6 -0
  376. package/src/components/pagination/{Pagination.js → Pagination.ts} +0 -1
  377. package/src/components/pagination/{leu-pagination.js → leu-pagination.ts} +6 -0
  378. package/src/components/popup/{Popup.js → Popup.ts} +0 -1
  379. package/src/components/popup/{leu-popup.js → leu-popup.ts} +6 -0
  380. package/src/components/radio/{Radio.js → Radio.ts} +0 -1
  381. package/src/components/radio/{RadioGroup.js → RadioGroup.ts} +0 -1
  382. package/src/components/radio/{leu-radio-group.js → leu-radio-group.ts} +6 -0
  383. package/src/components/radio/{leu-radio.js → leu-radio.ts} +6 -0
  384. package/src/components/range/{leu-range.js → leu-range.ts} +6 -0
  385. package/src/components/scroll-top/{ScrollTop.js → ScrollTop.ts} +0 -1
  386. package/src/components/scroll-top/{leu-scroll-top.js → leu-scroll-top.ts} +6 -0
  387. package/src/components/select/{Select.js → Select.ts} +18 -4
  388. package/src/components/select/{leu-select.js → leu-select.ts} +6 -0
  389. package/src/components/select/test/{fixtures.js → fixtures.ts} +1 -1
  390. package/src/components/select/test/{select.test.js → select.test.ts} +92 -0
  391. package/src/components/spinner/{leu-spinner.js → leu-spinner.ts} +6 -0
  392. package/src/components/table/{Table.js → Table.ts} +0 -1
  393. package/src/components/table/{leu-table.js → leu-table.ts} +6 -0
  394. package/src/components/visually-hidden/{VisuallyHidden.js → VisuallyHidden.ts} +0 -1
  395. package/src/components/visually-hidden/{leu-visually-hidden.js → leu-visually-hidden.ts} +6 -0
  396. package/src/docs/theme.mdx +14 -10
  397. package/src/global.d.ts +11 -0
  398. package/src/index.ts +17 -0
  399. package/src/lib/{LeuElement.js → LeuElement.ts} +15 -6
  400. package/src/lib/{a11y.js → a11y.ts} +2 -2
  401. package/src/lib/{hasSlotController.js → hasSlotController.ts} +12 -25
  402. package/stylelint.config.mjs +1 -1
  403. package/tsconfig.build.json +6 -4
  404. package/tsconfig.json +7 -10
  405. package/web-dev-server.config.mjs +11 -1
  406. package/web-test-runner.config.mjs +11 -2
  407. package/babel.config.json +0 -3
  408. package/dist/Accordion.d.ts.map +0 -1
  409. package/dist/Button.d.ts.map +0 -1
  410. package/dist/ButtonGroup.d.ts.map +0 -1
  411. package/dist/Checkbox.d.ts.map +0 -1
  412. package/dist/CheckboxGroup.d.ts.map +0 -1
  413. package/dist/Chip.d.ts.map +0 -1
  414. package/dist/ChipGroup.d.ts.map +0 -1
  415. package/dist/ChipLink.d.ts.map +0 -1
  416. package/dist/ChipRemovable.d.ts.map +0 -1
  417. package/dist/ChipSelectable.d.ts.map +0 -1
  418. package/dist/Dialog.d.ts.map +0 -1
  419. package/dist/Dropdown.d.ts.map +0 -1
  420. package/dist/Icon.d.ts.map +0 -1
  421. package/dist/Input.d.ts.map +0 -1
  422. package/dist/LeuElement-BI1CxItv.d.ts +0 -7
  423. package/dist/LeuElement-BI1CxItv.d.ts.map +0 -1
  424. package/dist/LeuElement-BI1CxItv.js +0 -70
  425. package/dist/Menu.d.ts.map +0 -1
  426. package/dist/MenuItem.d.ts.map +0 -1
  427. package/dist/Pagination.d.ts.map +0 -1
  428. package/dist/Popup.d.ts.map +0 -1
  429. package/dist/Radio.d.ts.map +0 -1
  430. package/dist/RadioGroup.d.ts.map +0 -1
  431. package/dist/Range.d.ts.map +0 -1
  432. package/dist/ScrollTop.d.ts.map +0 -1
  433. package/dist/Select.d.ts.map +0 -1
  434. package/dist/Spinner.d.ts.map +0 -1
  435. package/dist/Table.d.ts.map +0 -1
  436. package/dist/VisuallyHidden.d.ts.map +0 -1
  437. package/dist/hasSlotController-CCPfIEw1.d.ts +0 -38
  438. package/dist/hasSlotController-CCPfIEw1.d.ts.map +0 -1
  439. package/dist/hasSlotController-CCPfIEw1.js +0 -75
  440. package/dist/leu-accordion.d.ts.map +0 -1
  441. package/dist/leu-button-group.d.ts.map +0 -1
  442. package/dist/leu-button.d.ts.map +0 -1
  443. package/dist/leu-checkbox-group.d.ts.map +0 -1
  444. package/dist/leu-checkbox.d.ts.map +0 -1
  445. package/dist/leu-chip-group.d.ts.map +0 -1
  446. package/dist/leu-chip-link.d.ts.map +0 -1
  447. package/dist/leu-chip-removable.d.ts.map +0 -1
  448. package/dist/leu-chip-selectable.d.ts.map +0 -1
  449. package/dist/leu-dialog.d.ts.map +0 -1
  450. package/dist/leu-dropdown.d.ts.map +0 -1
  451. package/dist/leu-icon.d.ts.map +0 -1
  452. package/dist/leu-input.d.ts.map +0 -1
  453. package/dist/leu-menu-item.d.ts.map +0 -1
  454. package/dist/leu-menu.d.ts.map +0 -1
  455. package/dist/leu-pagination.d.ts.map +0 -1
  456. package/dist/leu-popup.d.ts.map +0 -1
  457. package/dist/leu-radio-group.d.ts.map +0 -1
  458. package/dist/leu-radio.d.ts.map +0 -1
  459. package/dist/leu-range.d.ts.map +0 -1
  460. package/dist/leu-scroll-top.d.ts.map +0 -1
  461. package/dist/leu-select.d.ts.map +0 -1
  462. package/dist/leu-spinner.d.ts.map +0 -1
  463. package/dist/leu-table.d.ts.map +0 -1
  464. package/dist/leu-visually-hidden.d.ts.map +0 -1
  465. package/index.js +0 -17
  466. /package/.storybook/{manager.js → manager.ts} +0 -0
  467. /package/.storybook/{preview.js → preview.ts} +0 -0
  468. /package/scripts/generate-component/templates/{[namespace]-[name].js → [namespace]-[name].ts} +0 -0
  469. /package/scripts/generate-component/templates/stories/{[name].stories.js → [name].stories.ts} +0 -0
  470. /package/scripts/generate-component/templates/test/{[name].test.js → [name].test.ts} +0 -0
  471. /package/src/components/accordion/test/{accordion.test.js → accordion.test.ts} +0 -0
  472. /package/src/components/button/stories/{button.stories.js → button.stories.ts} +0 -0
  473. /package/src/components/button/test/{button.test.js → button.test.ts} +0 -0
  474. /package/src/components/button-group/stories/{button-group.stories.js → button-group.stories.ts} +0 -0
  475. /package/src/components/button-group/test/{button-group.test.js → button-group.test.ts} +0 -0
  476. /package/src/components/checkbox/stories/{checkbox-group.stories.js → checkbox-group.stories.ts} +0 -0
  477. /package/src/components/checkbox/stories/{checkbox.stories.js → checkbox.stories.ts} +0 -0
  478. /package/src/components/checkbox/test/{checkbox-group.test.js → checkbox-group.test.ts} +0 -0
  479. /package/src/components/checkbox/test/{checkbox.test.js → checkbox.test.ts} +0 -0
  480. /package/src/components/chip/{ChipLink.js → ChipLink.ts} +0 -0
  481. /package/src/components/chip/{ChipRemovable.js → ChipRemovable.ts} +0 -0
  482. /package/src/components/chip/{ChipSelectable.js → ChipSelectable.ts} +0 -0
  483. /package/src/components/chip/{exports.js → exports.ts} +0 -0
  484. /package/src/components/chip/stories/{chip-group.stories.js → chip-group.stories.ts} +0 -0
  485. /package/src/components/chip/stories/{chip-link.stories.js → chip-link.stories.ts} +0 -0
  486. /package/src/components/chip/stories/{chip-removable.stories.js → chip-removable.stories.ts} +0 -0
  487. /package/src/components/chip/stories/{chip-selectable.stories.js → chip-selectable.stories.ts} +0 -0
  488. /package/src/components/chip/test/{chip-group.test.js → chip-group.test.ts} +0 -0
  489. /package/src/components/chip/test/{chip-link.test.js → chip-link.test.ts} +0 -0
  490. /package/src/components/chip/test/{chip-removable.test.js → chip-removable.test.ts} +0 -0
  491. /package/src/components/chip/test/{chip-selectable.test.js → chip-selectable.test.ts} +0 -0
  492. /package/src/components/chip/test/{chip.test.js → chip.test.ts} +0 -0
  493. /package/src/components/dialog/stories/{dialog.stories.js → dialog.stories.ts} +0 -0
  494. /package/src/components/dialog/test/{dialog.test.js → dialog.test.ts} +0 -0
  495. /package/src/components/dropdown/stories/{dropdown.stories.js → dropdown.stories.ts} +0 -0
  496. /package/src/components/dropdown/test/{dropdown.test.js → dropdown.test.ts} +0 -0
  497. /package/src/components/icon/{paths.js → paths.ts} +0 -0
  498. /package/src/components/icon/stories/{icon.stories.js → icon.stories.ts} +0 -0
  499. /package/src/components/icon/test/{icon.test.js → icon.test.ts} +0 -0
  500. /package/src/components/input/stories/{input.stories.js → input.stories.ts} +0 -0
  501. /package/src/components/input/test/{input.test.js → input.test.ts} +0 -0
  502. /package/src/components/menu/stories/{menu-item.stories.js → menu-item.stories.ts} +0 -0
  503. /package/src/components/menu/stories/{menu.stories.js → menu.stories.ts} +0 -0
  504. /package/src/components/menu/test/{menu-item.test.js → menu-item.test.ts} +0 -0
  505. /package/src/components/menu/test/{menu.test.js → menu.test.ts} +0 -0
  506. /package/src/components/pagination/stories/{pagination.stories.js → pagination.stories.ts} +0 -0
  507. /package/src/components/pagination/test/{pagination.test.js → pagination.test.ts} +0 -0
  508. /package/src/components/popup/stories/{popup.stories.js → popup.stories.ts} +0 -0
  509. /package/src/components/popup/test/{popup.test.js → popup.test.ts} +0 -0
  510. /package/src/components/radio/stories/{radio-group.stories.js → radio-group.stories.ts} +0 -0
  511. /package/src/components/radio/stories/{radio.stories.js → radio.stories.ts} +0 -0
  512. /package/src/components/radio/test/{radio-group.test.js → radio-group.test.ts} +0 -0
  513. /package/src/components/radio/test/{radio.test.js → radio.test.ts} +0 -0
  514. /package/src/components/range/{Range.js → Range.ts} +0 -0
  515. /package/src/components/range/stories/{range-slider.stories.js → range-slider.stories.ts} +0 -0
  516. /package/src/components/range/test/{range-test.js → range.test.ts} +0 -0
  517. /package/src/components/scroll-top/stories/{scroll-top.stories.js → scroll-top.stories.ts} +0 -0
  518. /package/src/components/scroll-top/test/{scroll-top.test.js → scroll-top.test.ts} +0 -0
  519. /package/src/components/select/stories/{select.stories.js → select.stories.ts} +0 -0
  520. /package/src/components/spinner/{Spinner.js → Spinner.ts} +0 -0
  521. /package/src/components/spinner/stories/{spinner.stories.js → spinner.stories.ts} +0 -0
  522. /package/src/components/spinner/test/{spinner.test.js → spinner.test.ts} +0 -0
  523. /package/src/components/table/stories/{table.stories.js → table.stories.ts} +0 -0
  524. /package/src/components/table/test/{table.test.js → table.test.ts} +0 -0
  525. /package/src/components/visually-hidden/stories/{visually-hidden.stories.js → visually-hidden.stories.ts} +0 -0
  526. /package/src/components/visually-hidden/test/{visually-hidden.test.js → visually-hidden.test.ts} +0 -0
  527. /package/src/lib/{utils.js → utils.ts} +0 -0
  528. /package/src/styles/{style.stories.js → style.stories.ts} +0 -0
@@ -1,3 +1,13 @@
1
- export { LeuVisuallyHidden };
2
1
  import { LeuVisuallyHidden } from './VisuallyHidden.js';
3
- //# sourceMappingURL=leu-visually-hidden.d.ts.map
2
+ import 'lit-html';
3
+ import 'lit';
4
+ import './LeuElement.d-BevHqLUu.js';
5
+
6
+ declare global {
7
+ interface HTMLElementTagNameMap {
8
+ "leu-visually-hidden": LeuVisuallyHidden;
9
+ }
10
+ }
11
+ //# sourceMappingURL=leu-visually-hidden.d.ts.map
12
+
13
+ export { LeuVisuallyHidden };
@@ -1,6 +1,6 @@
1
1
  import { LeuVisuallyHidden } from './VisuallyHidden.js';
2
- import './LeuElement-BI1CxItv.js';
3
2
  import 'lit';
3
+ import './LeuElement-x8UlIDDl.js';
4
4
 
5
5
  LeuVisuallyHidden.define("leu-visually-hidden");
6
6
 
@@ -0,0 +1,8 @@
1
+ import { CSSResultGroup, LitElement } from "lit";
2
+ export declare class LeuElement extends LitElement {
3
+ static version: string;
4
+ static dependencies: Record<string, typeof LeuElement>;
5
+ static styles: CSSResultGroup;
6
+ static define(name: string, constructor?: typeof LeuElement, options?: ElementDefinitionOptions): void;
7
+ }
8
+ //# sourceMappingURL=LeuElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LeuElement.d.ts","sourceRoot":"","sources":["../../src/lib/LeuElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAGhD,qBAAa,UAAW,SAAQ,UAAU;IACxC,MAAM,CAAC,OAAO,SAAkB;IAEhC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,UAAU,CAAC,CAAK;IAE3D,MAAM,CAAC,MAAM,EAAE,cAAc,CAAe;IAE5C,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,WAAW,oBAAO,EAClB,OAAO,GAAE,wBAA6B;CA6BzC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * All roles that are associated with a aria-checked attribute
3
+ * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
4
+ */
5
+ export declare const ARIA_CHECKED_ROLES: readonly ["checkbox", "menuitemcheckbox", "menuitemradio", "option", "radio", "switch"];
6
+ /**
7
+ * All roles that are associated with a aria-selected attribute
8
+ * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
9
+ */
10
+ export declare const ARIA_SELECTED_ROLES: readonly ["gridcell", "option", "row", "tab", "columnheader", "rowheader", "treeitem"];
11
+ //# sourceMappingURL=a11y.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../src/lib/a11y.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yFAOrB,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,mBAAmB,wFAQtB,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Thanks Shoelace!
3
+ * Source: https://github.com/shoelace-style/shoelace/blob/next/src/internal/slot.ts
4
+ */
5
+ import { ReactiveController, ReactiveControllerHost } from "lit";
6
+ /**
7
+ * A reactive controller that determines when slots exist.
8
+ */
9
+ export declare class HasSlotController implements ReactiveController {
10
+ host: ReactiveControllerHost & Element;
11
+ slotNames: string[];
12
+ constructor(host: ReactiveControllerHost & Element, slotNames: string[]);
13
+ private hasDefaultSlot;
14
+ private hasNamedSlot;
15
+ test(slotName: string): boolean;
16
+ hostConnected(): void;
17
+ hostDisconnected(): void;
18
+ private handleSlotChange;
19
+ }
20
+ //# sourceMappingURL=hasSlotController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hasSlotController.d.ts","sourceRoot":"","sources":["../../src/lib/hasSlotController.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAA;AAEhE;;GAEG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAA;IAEtC,SAAS,EAAE,MAAM,EAAE,CAAA;gBAEP,IAAI,EAAE,sBAAsB,GAAG,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE;IAOvE,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,YAAY;IAIpB,IAAI,CAAC,QAAQ,EAAE,MAAM;IAMrB,aAAa;IAIb,gBAAgB;IAOhB,OAAO,CAAC,gBAAgB,CAUvB;CACF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Return a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
3
+ * @param {Function} func - Your function
4
+ * @param {Number} timeout - Default is 500 ms
5
+ * @returns {Function} - Your function wrapped in a timeout function
6
+ */
7
+ declare const debounce: (func: any, timeout?: number) => (...args: any[]) => void;
8
+ /**
9
+ * Return a throttled function that only invokes func at most once per every wait milliseconds.
10
+ * @param {Function} func - Your function
11
+ * @param {Number} timeout - Default is 500 ms
12
+ * @returns {Function} - Your function wrapped in a timeout function
13
+ */
14
+ declare const throttle: (func: any, timeout?: number) => (...args: any[]) => void;
15
+ export { debounce, throttle };
16
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,QAAA,MAAM,QAAQ,2DAQb,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,QAAQ,2DAUb,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA"}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ title: string;
3
+ };
4
+ export default _default;
5
+ export declare const Regular: any;
6
+ //# sourceMappingURL=style.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.stories.d.ts","sourceRoot":"","sources":["../../src/styles/style.stories.ts"],"names":[],"mappings":";;;AAEA,wBAEC;AA0DD,eAAO,MAAM,OAAO,KAAoB,CAAA"}
@@ -23,7 +23,7 @@
23
23
  },
24
24
  {
25
25
  "name": "label",
26
- "description": "The label (title) of the accordion.",
26
+ "description": "The label (title) of the accordion",
27
27
  "values": []
28
28
  }
29
29
  ],
@@ -33,7 +33,7 @@ type LeuAccordionProps = {
33
33
  "label-prefix"?: LeuAccordion["labelPrefix"];
34
34
  /** The expanded state of the accordion. */
35
35
  open?: LeuAccordion["open"];
36
- /** The label (title) of the accordion. */
36
+ /** The label (title) of the accordion */
37
37
  label?: LeuAccordion["label"];
38
38
  };
39
39
 
@@ -65,8 +65,6 @@ type LeuButtonProps = {
65
65
  type LeuButtonGroupProps = {
66
66
  /** The value of the currenty selected (active) button */
67
67
  value?: LeuButtonGroup["value"];
68
- /** */
69
- _items?: LeuButtonGroup["_items"];
70
68
  /** When the value of the group changes by clicking a button */
71
69
  oninput?: (e: CustomEvent<CustomEvent>) => void;
72
70
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@statistikzh/leu",
4
- "version": "0.14.2",
4
+ "version": "0.14.4",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "name": "label",
31
- "description": "The label (title) of the accordion.",
31
+ "description": "The label (title) of the accordion",
32
32
  "value": { "type": "string", "default": "\"\"" }
33
33
  }
34
34
  ],
@@ -53,7 +53,7 @@
53
53
  },
54
54
  {
55
55
  "name": "label",
56
- "description": "The label (title) of the accordion.",
56
+ "description": "The label (title) of the accordion",
57
57
  "type": "string"
58
58
  },
59
59
  {
@@ -192,8 +192,7 @@
192
192
  "name": "value",
193
193
  "description": "The value of the currenty selected (active) button",
194
194
  "type": "string"
195
- },
196
- { "name": "_items", "type": "array" }
195
+ }
197
196
  ],
198
197
  "events": [
199
198
  {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI component library of the canton of zurich",
4
4
  "license": "MIT",
5
5
  "author": "statistikzh",
6
- "version": "0.14.2",
6
+ "version": "0.14.4",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -24,19 +24,19 @@
24
24
  "homepage": "https://github.com/statistikzh/leu/",
25
25
  "scripts": {
26
26
  "analyze": "cem analyze --config custom-elements-manifest.config.js",
27
- "build": "rimraf dist && npm run build:js && npm run build:types && npm run build:css && npm run analyze",
27
+ "build": "rimraf dist && npm run build:types && npm run build:js && npm run build:css && npm run analyze",
28
28
  "build:js": "rollup -c rollup.config.js",
29
29
  "build:types": "tsc -p tsconfig.build.json",
30
30
  "build:css": "postcss src/styles/theme.css -o dist/theme.css && cp dist/theme.css .storybook/static/",
31
31
  "watch:css": "nodemon --watch 'src/styles/*' -e css --exec npm run build:css",
32
32
  "lint": "npm run lint:eslint && npm run lint:prettier",
33
- "lint:eslint": "eslint --ext .js,.mjs,.html . --ignore-path .gitignore ",
34
- "lint:prettier": "prettier \"**/*.{js,mjs,md,mdx,html,json}\" --check",
35
- "lint:stylelint": "stylelint \"**/*.{js,css}\" --ignore-path .gitignore",
33
+ "lint:eslint": "eslint --ext .ts,.js,.mjs,.html . --ignore-path .gitignore ",
34
+ "lint:prettier": "prettier \"**/*.{.ts,js,mjs,md,mdx,html,json}\" --check",
35
+ "lint:stylelint": "stylelint \"**/*.{ts,js,css}\" --ignore-path .gitignore",
36
36
  "lint:types": "tsc",
37
37
  "format": "npm run format:eslint && npm run format:prettier",
38
- "format:eslint": "eslint --ext .js,.mjs,.html . --fix --ignore-path .gitignore",
39
- "format:prettier": "prettier \"**/*.{js,mjs,md,mdx,html,json}\" --write",
38
+ "format:eslint": "eslint --ext .ts,.js,.mjs,.html . --fix --ignore-path .gitignore",
39
+ "format:prettier": "prettier \"**/*.{ts,js,mjs,md,mdx,html,json}\" --write",
40
40
  "test": "web-test-runner --coverage",
41
41
  "test:watch": "web-test-runner --watch",
42
42
  "prepare": "husky",
@@ -46,17 +46,14 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@floating-ui/dom": "^1.6.13",
49
- "lit": "^3.1.4",
50
- "stylelint-config-recommended": "^15.0.0"
49
+ "lit": "^3.1.4"
51
50
  },
52
51
  "devDependencies": {
53
- "@babel/preset-env": "^7.26.9",
54
52
  "@commitlint/cli": "^19.7.1",
55
53
  "@commitlint/config-conventional": "^19.7.1",
56
54
  "@custom-elements-manifest/analyzer": "^0.10.4",
57
55
  "@open-wc/eslint-config": "^12.0.3",
58
56
  "@open-wc/testing": "^4.0.0",
59
- "@rollup/plugin-babel": "^6.0.4",
60
57
  "@rollup/plugin-commonjs": "^28.0.2",
61
58
  "@rollup/plugin-json": "^6.1.0",
62
59
  "@rollup/plugin-replace": "^6.0.2",
@@ -69,7 +66,11 @@
69
66
  "@storybook/manager-api": "^8.5.8",
70
67
  "@storybook/theming": "^8.5.8",
71
68
  "@storybook/web-components": "^8.5.8",
69
+ "@types/mocha": "^10.0.10",
70
+ "@typescript-eslint/eslint-plugin": "^8.34.0",
71
+ "@typescript-eslint/parser": "^8.34.0",
72
72
  "@web/dev-server": "^0.4.6",
73
+ "@web/dev-server-esbuild": "^1.0.4",
73
74
  "@web/dev-server-rollup": "^0.6.4",
74
75
  "@web/storybook-builder": "^0.2.1",
75
76
  "@web/storybook-framework-web-components": "^0.2.0",
@@ -97,11 +98,14 @@
97
98
  "react-syntax-highlighter": "^15.6.1",
98
99
  "rimraf": "^6.0.1",
99
100
  "rollup": "^4.34.8",
101
+ "rollup-plugin-dts": "^6.2.1",
100
102
  "rollup-plugin-postcss": "^4.0.2",
101
103
  "rollup-plugin-postcss-lit": "^2.1.0",
104
+ "rollup-plugin-typescript2": "^0.36.0",
102
105
  "sinon": "^19.0.2",
103
106
  "storybook": "^8.5.8",
104
107
  "stylelint": "^16.14.1",
108
+ "stylelint-config-recommended": "^15.0.0",
105
109
  "stylelint-config-standard": "^37.0.0",
106
110
  "typescript": "^5.7.3"
107
111
  },
@@ -109,10 +113,10 @@
109
113
  "semi": false
110
114
  },
111
115
  "lint-staged": {
112
- "*.{js,css}": [
116
+ "*.{ts,js,css}": [
113
117
  "stylelint --fix"
114
118
  ],
115
- "*.{js,mjs,html}": [
119
+ "*.{ts,js,mjs,html}": [
116
120
  "eslint --fix",
117
121
  "prettier --write"
118
122
  ],
@@ -120,5 +124,8 @@
120
124
  },
121
125
  "overrides": {
122
126
  "estree-walker": "2.0.2"
127
+ },
128
+ "esm.sh": {
129
+ "bundle": false
123
130
  }
124
131
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3
+ "release-type": "node",
4
+ "bump-minor-pre-major": true,
5
+ "bump-patch-for-minor-pre-major": true,
6
+ "last-release-sha": "c00695d82782cfa6e3fa0046e3a7deb31c14eb26",
7
+ "packages": {
8
+ ".": {}
9
+ }
10
+ }
package/rollup.config.js CHANGED
@@ -3,8 +3,9 @@ import path from "path"
3
3
  import { fileURLToPath } from "url"
4
4
  import postcss from "rollup-plugin-postcss"
5
5
  import postcssLit from "rollup-plugin-postcss-lit"
6
- import { babel } from "@rollup/plugin-babel"
7
6
  import replace from "@rollup/plugin-replace"
7
+ import typescript from "rollup-plugin-typescript2"
8
+ import { dts } from "rollup-plugin-dts"
8
9
 
9
10
  export const plugins = [
10
11
  {
@@ -35,30 +36,59 @@ export const plugins = [
35
36
  /**
36
37
  * @type {import("rollup").RollupOptions}
37
38
  */
38
- export default {
39
- // Select all files in a direct subdirectory of src/components
40
- // that have a name starting with
41
- // - a capital letter
42
- // - or "leu-"
43
- input: {
44
- index: "index.js",
45
- ...Object.fromEntries(
46
- globSync("src/components/*/{[A-Z],leu-}*.js", { nocase: false }).map(
47
- (file) => [
48
- path.basename(file, path.extname(file)),
49
- fileURLToPath(new URL(file, import.meta.url)),
50
- ],
39
+ export default [
40
+ {
41
+ // Select all files in a direct subdirectory of src/components
42
+ // that have a name starting with
43
+ // - a capital letter
44
+ // - or "leu-"
45
+ input: {
46
+ index: "src/index.ts",
47
+ ...Object.fromEntries(
48
+ globSync("src/components/*/{[A-Z],leu-}*.ts", { nocase: false }).map(
49
+ (file) => [
50
+ path.basename(file, path.extname(file)),
51
+ fileURLToPath(new URL(file, import.meta.url)),
52
+ ],
53
+ ),
51
54
  ),
52
- ),
55
+ },
56
+ output: {
57
+ dir: "./dist/",
58
+ format: "esm",
59
+ entryFileNames: "[name].js",
60
+ },
61
+ plugins: [
62
+ typescript({
63
+ tsconfig: fileURLToPath(
64
+ new URL("./tsconfig.build.json", import.meta.url),
65
+ ),
66
+ tsconfigOverride: {
67
+ compilerOptions: {
68
+ declarationMap: false,
69
+ emitDeclarationOnly: false,
70
+ declaration: false,
71
+ },
72
+ },
73
+ }),
74
+ ...plugins.map((p) => p.plugin(...p.args)),
75
+ ],
76
+ external: [/^lit(\/.*\.js)?$/, "@floating-ui/dom"],
53
77
  },
54
- output: {
55
- dir: "./dist/",
56
- format: "esm",
57
- entryFileNames: "[name].js",
78
+ {
79
+ input: {
80
+ ...Object.fromEntries(
81
+ globSync("dist/components/*/{[A-Z],leu-}*.d.ts", { nocase: false }).map(
82
+ (file) => [
83
+ path.basename(file, ".d.ts"),
84
+ fileURLToPath(new URL(file, import.meta.url)),
85
+ ],
86
+ ),
87
+ ),
88
+ },
89
+ output: {
90
+ dir: "./dist/",
91
+ },
92
+ plugins: [dts()],
58
93
  },
59
- plugins: [
60
- babel({ babelHelpers: "bundled" }),
61
- ...plugins.map((p) => p.plugin(...p.args)),
62
- ],
63
- external: [/^lit(\/.*\.js)?$/, "@floating-ui/dom"],
64
- }
94
+ ]
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- /* eslint-disable no-use-before-define */
2
+ /* eslint-disable @typescript-eslint/no-use-before-define */
3
3
 
4
4
  import arg from "arg"
5
5
  import fs from "fs"
@@ -1,4 +1,5 @@
1
1
  import { html } from "lit"
2
+ import { property } from "lit/decorators.js"
2
3
 
3
4
  import { LeuElement } from "../../lib/LeuElement.js"
4
5
 
@@ -15,9 +16,8 @@ export class Leu[Name] extends LeuElement {
15
16
  delegatesFocus: true,
16
17
  }
17
18
 
18
- static properties = {
19
- value: { type: String },
20
- }
19
+ @property({ type: String })
20
+ value: string = ""
21
21
 
22
22
  constructor() {
23
23
  super()
@@ -1,17 +1,14 @@
1
1
  import { nothing } from "lit"
2
2
  import { html, unsafeStatic } from "lit/static-html.js"
3
+ import { property } from "lit/decorators.js"
4
+
3
5
  import { LeuElement } from "../../lib/LeuElement.js"
4
6
 
5
- // @ts-ignore
6
7
  import styles from "./accordion.css"
7
8
 
8
9
  /**
9
10
  * @tagname leu-accordion
10
11
  * @slot content - The content of the accordion. No styles will be applied to the content.
11
- * @prop {number} headingLevel - The heading level of the accordion title. Must be between 1 and 6.
12
- * @prop {boolean} open - The expanded state of the accordion.
13
- * @prop {string} label - The label (title) of the accordion.
14
- * @prop {string} labelPrefix - The prefix of the accordion label. e.g. "01"
15
12
  * @attr {number} heading-level - The heading level of the accordion title. Must be between 1 and 6.
16
13
  * @attr {string} label-prefix - The prefix of the accordion label. e.g. "01"
17
14
  */
@@ -24,29 +21,37 @@ export class LeuAccordion extends LeuElement {
24
21
  delegatesFocus: true,
25
22
  }
26
23
 
27
- static properties = {
28
- headingLevel: { type: Number, attribute: "heading-level", reflect: true },
29
- open: { type: Boolean, reflect: true },
30
- label: { type: String, reflect: true },
31
- labelPrefix: { type: String, attribute: "label-prefix", reflect: true },
32
- }
24
+ /**
25
+ * The heading level of the accordion title. Must be between 1 and 6.
26
+ */
27
+ @property({ type: Number, attribute: "heading-level", reflect: true })
28
+ headingLevel = 2
33
29
 
34
- constructor() {
35
- super()
36
- this.headingLevel = 2
37
- this.open = false
38
- this.label = ""
39
- this.labelPrefix = ""
40
- }
30
+ /**
31
+ * The expanded state of the accordion.
32
+ */
33
+ @property({ type: Boolean, reflect: true })
34
+ open = false
35
+
36
+ /**
37
+ * The label (title) of the accordion
38
+ */
39
+ @property({ type: String, reflect: true })
40
+ label = ""
41
+
42
+ /**
43
+ * The prefix of the accordion label. e.g. "01"
44
+ */
45
+ @property({ type: String, attribute: "label-prefix", reflect: true })
46
+ labelPrefix = ""
41
47
 
42
48
  /**
43
49
  * Determines the heading tag of the accordion toggle.
44
50
  * The headingLevel shouldn't be used directly to render the heading tag
45
51
  * in order to avoid XSS issues.
46
- * @returns {string} The heading tag of the accordion toggle.
47
52
  * @internal
48
53
  */
49
- _getHeadingTag() {
54
+ private _getHeadingTag(): string {
50
55
  let level = 2
51
56
  if (this.headingLevel > 0 && this.headingLevel < 7) {
52
57
  level = Math.floor(this.headingLevel)
@@ -59,7 +64,7 @@ export class LeuAccordion extends LeuElement {
59
64
  * Toggles the accordion open state.
60
65
  * @internal
61
66
  */
62
- _handleToggleClick() {
67
+ private _handleToggleClick() {
63
68
  this.open = !this.open
64
69
  }
65
70
 
@@ -3,3 +3,9 @@ import { LeuAccordion } from "./Accordion.js"
3
3
  export { LeuAccordion }
4
4
 
5
5
  LeuAccordion.define("leu-accordion")
6
+
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ "leu-accordion": LeuAccordion
10
+ }
11
+ }
@@ -26,14 +26,16 @@ export default {
26
26
  }
27
27
 
28
28
  function Template(args) {
29
- return html` <leu-accordion
30
- heading-level=${ifDefined(args["heading-level"])}
31
- label=${ifDefined(args.label)}
32
- label-prefix=${ifDefined(args["label-prefix"])}
33
- ?open=${args.open}
34
- >
35
- <div slot="content">${args.content}</div>
36
- </leu-accordion>`
29
+ return html`
30
+ <leu-accordion
31
+ heading-level=${ifDefined(args["heading-level"])}
32
+ label=${ifDefined(args.label)}
33
+ label-prefix=${ifDefined(args["label-prefix"])}
34
+ ?open=${args.open}
35
+ >
36
+ <div slot="content">${args.content}</div>
37
+ </leu-accordion>
38
+ `
37
39
  }
38
40
 
39
41
  export const Regular = Template.bind({})
@@ -7,7 +7,6 @@ import { LeuElement } from "../../lib/LeuElement.js"
7
7
  import { HasSlotController } from "../../lib/hasSlotController.js"
8
8
  import { ARIA_CHECKED_ROLES, ARIA_SELECTED_ROLES } from "../../lib/a11y.js"
9
9
 
10
- // @ts-ignore
11
10
  import styles from "./button.css"
12
11
 
13
12
  /*
@@ -3,3 +3,9 @@ import { LeuButton } from "./Button.js"
3
3
  export { LeuButton }
4
4
 
5
5
  LeuButton.define("leu-button")
6
+
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ "leu-button": LeuButton
10
+ }
11
+ }
@@ -1,8 +1,8 @@
1
1
  import { html } from "lit"
2
2
  import { LeuElement } from "../../lib/LeuElement.js"
3
3
 
4
- // @ts-ignore
5
4
  import styles from "./button-group.css"
5
+ import { LeuButton } from "../button/Button.js"
6
6
 
7
7
  /**
8
8
  * @tagname leu-button-group
@@ -13,14 +13,10 @@ import styles from "./button-group.css"
13
13
  export class LeuButtonGroup extends LeuElement {
14
14
  static styles = [LeuElement.styles, styles]
15
15
 
16
- constructor() {
17
- super()
18
-
19
- this._items = []
20
- }
16
+ private _items: LeuButton[] = []
21
17
 
22
18
  /**
23
- * @param {import("../button/Button").LeuButton} button
19
+ * @param {import("../button/Button.js").LeuButton} button
24
20
  * @returns {string}
25
21
  */
26
22
  static getButtonValue(button) {
@@ -75,7 +71,7 @@ export class LeuButtonGroup extends LeuElement {
75
71
  }
76
72
 
77
73
  /**
78
- * @param {import("../button/Button").LeuButton} button
74
+ * @param {import("../button/Button.js").LeuButton} button
79
75
  */
80
76
  _handleButtonClick(button) {
81
77
  if (!button.active) {
@@ -3,3 +3,9 @@ import { LeuButtonGroup } from "./ButtonGroup.js"
3
3
  export { LeuButtonGroup }
4
4
 
5
5
  LeuButtonGroup.define("leu-button-group")
6
+
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ "leu-button-group": LeuButtonGroup
10
+ }
11
+ }
@@ -3,7 +3,6 @@ import { html } from "lit"
3
3
  import { LeuElement } from "../../lib/LeuElement.js"
4
4
  import { LeuIcon } from "../icon/Icon.js"
5
5
 
6
- // @ts-ignore
7
6
  import styles from "./checkbox.css"
8
7
 
9
8
  /**
@@ -3,7 +3,6 @@ import { classMap } from "lit/directives/class-map.js"
3
3
 
4
4
  import { LeuElement } from "../../lib/LeuElement.js"
5
5
 
6
- // @ts-ignore
7
6
  import styles from "./checkbox-group.css"
8
7
 
9
8
  /**
@@ -3,3 +3,9 @@ import { LeuCheckboxGroup } from "./CheckboxGroup.js"
3
3
  export { LeuCheckboxGroup }
4
4
 
5
5
  LeuCheckboxGroup.define("leu-checkbox-group")
6
+
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ "leu-checkbox-group": LeuCheckboxGroup
10
+ }
11
+ }
@@ -3,3 +3,9 @@ import { LeuCheckbox } from "./Checkbox.js"
3
3
  export { LeuCheckbox }
4
4
 
5
5
  LeuCheckbox.define("leu-checkbox")
6
+
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ "leu-checkbox": LeuCheckbox
10
+ }
11
+ }
@@ -1,6 +1,5 @@
1
1
  import { LeuElement } from "../../lib/LeuElement.js"
2
2
 
3
- // @ts-ignore
4
3
  import styles from "./chip.css"
5
4
 
6
5
  /* Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=21161-184433&mode=design&t=Kjo5VDiqivihn8dh-11 */