@statistikzh/leu 0.27.0 → 0.28.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 (202) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/.storybook/main.ts +1 -1
  3. package/.storybook/preview.ts +6 -4
  4. package/.storybook/static/global.css +5 -0
  5. package/CHANGELOG.md +23 -0
  6. package/dist/{Accordion-DLsqXcK8.js → Accordion-D9kLsiBW.js} +1 -1
  7. package/dist/Accordion.d.ts +1 -1
  8. package/dist/Accordion.js +2 -2
  9. package/dist/{Button-BgNUxmo_.d.ts → Button-DcuvEVkC.d.ts} +14 -12
  10. package/dist/{Button-BSyDL_cV.js → Button-DyNVOHCd.js} +90 -82
  11. package/dist/Button.d.ts +1 -1
  12. package/dist/Button.js +4 -4
  13. package/dist/{ButtonGroup-BmSvl-Oc.js → ButtonGroup-MEh4vb5a.js} +2 -2
  14. package/dist/ButtonGroup.d.ts +1 -1
  15. package/dist/ButtonGroup.js +5 -5
  16. package/dist/{ChartWrapper-CvDvQsd5.js → ChartWrapper-DAl91BIN.js} +2 -2
  17. package/dist/ChartWrapper.d.ts +3 -3
  18. package/dist/ChartWrapper.js +3 -3
  19. package/dist/{Checkbox-Cl_X6gBJ.js → Checkbox-CGGyUW9U.js} +2 -2
  20. package/dist/Checkbox.d.ts +3 -3
  21. package/dist/Checkbox.js +3 -3
  22. package/dist/{CheckboxGroup-BKhOmZYX.js → CheckboxGroup-DXt5iMdj.js} +2 -2
  23. package/dist/CheckboxGroup.d.ts +1 -1
  24. package/dist/CheckboxGroup.js +4 -4
  25. package/dist/{Chip-McVP3N_x.js → Chip-BGs71WGH.js} +1 -1
  26. package/dist/{Chip-DLKM9P7v.d.ts → Chip-DVGjEPJE.d.ts} +1 -1
  27. package/dist/Chip.d.ts +1 -1
  28. package/dist/Chip.js +2 -2
  29. package/dist/{ChipGroup-Ta8Ht4jc.d.ts → ChipGroup-BK5BYM0X.d.ts} +2 -2
  30. package/dist/{ChipGroup-DUGavZeU.js → ChipGroup-BcGyusP-.js} +1 -1
  31. package/dist/ChipGroup.d.ts +1 -1
  32. package/dist/ChipGroup.js +3 -3
  33. package/dist/{ChipLink-BAxyQO2M.d.ts → ChipLink-BdG2o-nk.d.ts} +1 -1
  34. package/dist/ChipLink.d.ts +1 -1
  35. package/dist/ChipLink.js +2 -2
  36. package/dist/{ChipRemovable-DBjwt0CH.d.ts → ChipRemovable-CCwSQTAL.d.ts} +2 -2
  37. package/dist/ChipRemovable.d.ts +1 -1
  38. package/dist/ChipRemovable.js +3 -3
  39. package/dist/{ChipSelectable-CMJNcE4U.d.ts → ChipSelectable-BQ3VLVi5.d.ts} +1 -1
  40. package/dist/ChipSelectable.d.ts +1 -1
  41. package/dist/ChipSelectable.js +2 -2
  42. package/dist/{Dialog-BlDd4T2u.js → Dialog-BzuyL1U3.js} +2 -2
  43. package/dist/Dialog.d.ts +3 -3
  44. package/dist/Dialog.js +3 -3
  45. package/dist/{Dropdown-BLxSIe6p.js → Dropdown-plyBTM15.js} +5 -5
  46. package/dist/Dropdown.d.ts +6 -6
  47. package/dist/Dropdown.js +8 -8
  48. package/dist/{FileInput-DntYrpZ-.js → FileInput-BT3Fe-0J.js} +4 -4
  49. package/dist/FileInput.d.ts +5 -5
  50. package/dist/FileInput.js +6 -6
  51. package/dist/{Icon-Op80LrrO.d.ts → Icon-CUfh3eb3.d.ts} +1 -1
  52. package/dist/{Icon-CbZXpyHU.js → Icon-D83qesg5.js} +1 -1
  53. package/dist/Icon.d.ts +1 -1
  54. package/dist/Icon.js +2 -2
  55. package/dist/{Input-DBXX7ev8.js → Input-D7zS50oz.js} +2 -2
  56. package/dist/{Input-CeaAOB4p.d.ts → Input-fEiQvGDF.d.ts} +3 -3
  57. package/dist/Input.d.ts +1 -1
  58. package/dist/Input.js +3 -3
  59. package/dist/{LeuElement-k4RjIeoG.js → LeuElement-DQI8cqZV.js} +1 -1
  60. package/dist/{Menu-Cu8eIF1T.js → Menu-DRU1LiMM.js} +2 -2
  61. package/dist/{Menu-CQdx1ef3.d.ts → Menu-Z2b7dsB5.d.ts} +2 -2
  62. package/dist/Menu.d.ts +1 -1
  63. package/dist/Menu.js +4 -4
  64. package/dist/{MenuItem-Cs3KFhJm.js → MenuItem-DCttylRO.js} +2 -2
  65. package/dist/{MenuItem-QcgnRk_7.d.ts → MenuItem-LY4TRIho.d.ts} +2 -2
  66. package/dist/MenuItem.d.ts +1 -1
  67. package/dist/MenuItem.js +3 -3
  68. package/dist/{Message-C6Zlk_2p.js → Message-0NxnKEqw.js} +2 -2
  69. package/dist/Message.d.ts +2 -2
  70. package/dist/Message.js +3 -3
  71. package/dist/{Pagination-CqkHh-Vd.d.ts → Pagination-9eZ8WMvR.d.ts} +4 -4
  72. package/dist/{Pagination-CB2eVlXk.js → Pagination-CIy7YvWE.js} +4 -4
  73. package/dist/Pagination.d.ts +1 -1
  74. package/dist/Pagination.js +6 -6
  75. package/dist/{Placeholder-DHMexMhK.js → Placeholder-Dol_X5Hp.js} +1 -1
  76. package/dist/Placeholder.d.ts +1 -1
  77. package/dist/Placeholder.js +2 -2
  78. package/dist/{Popup-Btgm2a3D.d.ts → Popup-B5iDSLIO.d.ts} +1 -1
  79. package/dist/{Popup-8jhVy8gB.js → Popup-nJrJHGSy.js} +1 -1
  80. package/dist/Popup.d.ts +1 -1
  81. package/dist/Popup.js +2 -2
  82. package/dist/{ProgressBar-CG0_lHfS.js → ProgressBar-Dmq9veqU.js} +1 -1
  83. package/dist/ProgressBar.d.ts +1 -1
  84. package/dist/ProgressBar.js +2 -2
  85. package/dist/{Radio-DG3xqP3s.js → Radio-W5ck_IJI.js} +1 -1
  86. package/dist/Radio.d.ts +1 -1
  87. package/dist/Radio.js +2 -2
  88. package/dist/{RadioGroup-BKCp9ICX.js → RadioGroup-De5x2YCO.js} +2 -2
  89. package/dist/RadioGroup.d.ts +1 -1
  90. package/dist/RadioGroup.js +3 -3
  91. package/dist/{Range-7LrESv4K.js → Range-NCdfDkeD.js} +1 -1
  92. package/dist/Range.d.ts +1 -1
  93. package/dist/Range.js +2 -2
  94. package/dist/{ScrollTop-CJJsfniA.js → ScrollTop-DwcNIKmN.js} +3 -3
  95. package/dist/ScrollTop.d.ts +3 -3
  96. package/dist/ScrollTop.js +5 -5
  97. package/dist/{Select-CxEDXIBn.js → Select-Bpicra9q.js} +7 -8
  98. package/dist/Select.d.ts +9 -9
  99. package/dist/Select.js +9 -9
  100. package/dist/{Spinner-VhKfzI3Q.js → Spinner-BBiVZxFH.js} +1 -1
  101. package/dist/{Spinner-CrM1enM0.d.ts → Spinner-DHYaX6-Y.d.ts} +1 -1
  102. package/dist/Spinner.d.ts +1 -1
  103. package/dist/Spinner.js +2 -2
  104. package/dist/Tab-CN97q0nj.d.ts +30 -0
  105. package/dist/Tab-Ce9nrDok.js +117 -0
  106. package/dist/Tab.d.ts +2 -0
  107. package/dist/Tab.js +3 -0
  108. package/dist/TabGroup-C-cd4Wcx.js +248 -0
  109. package/dist/TabGroup.d.ts +64 -0
  110. package/dist/TabGroup.js +5 -0
  111. package/dist/TabPanel-BW1ydVBT.js +65 -0
  112. package/dist/TabPanel-DQgWP7LO.d.ts +26 -0
  113. package/dist/TabPanel.d.ts +2 -0
  114. package/dist/TabPanel.js +3 -0
  115. package/dist/{Table-rg_JCtsA.js → Table-DiYqIzBu.js} +3 -3
  116. package/dist/Table.d.ts +3 -3
  117. package/dist/Table.js +7 -7
  118. package/dist/{Tag-BROUaDAZ.js → Tag-Ct8Hhv7W.js} +1 -1
  119. package/dist/Tag.d.ts +1 -1
  120. package/dist/Tag.js +2 -2
  121. package/dist/{VisuallyHidden-OeQvhxYn.d.ts → VisuallyHidden-CB7aRJzF.d.ts} +1 -1
  122. package/dist/{VisuallyHidden-Co_txzxB.js → VisuallyHidden-CpYXyuC7.js} +1 -1
  123. package/dist/VisuallyHidden.d.ts +1 -1
  124. package/dist/VisuallyHidden.js +2 -2
  125. package/dist/index.d.ts +14 -14
  126. package/dist/index.js +30 -30
  127. package/dist/leu-accordion.js +2 -2
  128. package/dist/leu-button-group.js +5 -5
  129. package/dist/leu-button.d.ts +1 -1
  130. package/dist/leu-button.js +4 -4
  131. package/dist/leu-chart-wrapper.js +3 -3
  132. package/dist/leu-checkbox-group.js +4 -4
  133. package/dist/leu-checkbox.js +3 -3
  134. package/dist/leu-chip-group.d.ts +1 -1
  135. package/dist/leu-chip-group.js +3 -3
  136. package/dist/leu-chip-link.d.ts +1 -1
  137. package/dist/leu-chip-link.js +2 -2
  138. package/dist/leu-chip-removable.d.ts +1 -1
  139. package/dist/leu-chip-removable.js +3 -3
  140. package/dist/leu-chip-selectable.d.ts +1 -1
  141. package/dist/leu-chip-selectable.js +2 -2
  142. package/dist/leu-dialog.js +3 -3
  143. package/dist/leu-dropdown.js +8 -8
  144. package/dist/leu-file-input.js +6 -6
  145. package/dist/leu-icon.d.ts +1 -1
  146. package/dist/leu-icon.js +2 -2
  147. package/dist/leu-input.d.ts +1 -1
  148. package/dist/leu-input.js +3 -3
  149. package/dist/leu-menu-item.d.ts +1 -1
  150. package/dist/leu-menu-item.js +3 -3
  151. package/dist/leu-menu.d.ts +1 -1
  152. package/dist/leu-menu.js +4 -4
  153. package/dist/leu-message.js +3 -3
  154. package/dist/leu-pagination.d.ts +1 -1
  155. package/dist/leu-pagination.js +6 -6
  156. package/dist/leu-placeholder.js +2 -2
  157. package/dist/leu-popup.d.ts +1 -1
  158. package/dist/leu-popup.js +2 -2
  159. package/dist/leu-progress-bar.js +2 -2
  160. package/dist/leu-radio-group.js +3 -3
  161. package/dist/leu-radio.js +2 -2
  162. package/dist/leu-range.js +2 -2
  163. package/dist/leu-scroll-top.js +5 -5
  164. package/dist/leu-select.js +9 -9
  165. package/dist/leu-spinner.d.ts +1 -1
  166. package/dist/leu-spinner.js +2 -2
  167. package/dist/leu-tab-group.d.ts +10 -0
  168. package/dist/leu-tab-group.js +8 -0
  169. package/dist/leu-tab-panel.d.ts +10 -0
  170. package/dist/leu-tab-panel.js +6 -0
  171. package/dist/leu-tab.d.ts +10 -0
  172. package/dist/leu-tab.js +6 -0
  173. package/dist/leu-table.js +7 -7
  174. package/dist/leu-tag.js +2 -2
  175. package/dist/leu-visually-hidden.d.ts +1 -1
  176. package/dist/leu-visually-hidden.js +2 -2
  177. package/dist/vscode.html-custom-data.json +76 -8
  178. package/dist/vue/index.d.ts +73 -5
  179. package/dist/web-types.json +142 -17
  180. package/package.json +1 -2
  181. package/src/components/button/Button.ts +45 -30
  182. package/src/components/button/button.css +55 -54
  183. package/src/components/button/stories/button.stories.ts +17 -20
  184. package/src/components/button/test/button.test.ts +46 -0
  185. package/src/components/select/Select.ts +0 -1
  186. package/src/components/tab/Tab.ts +72 -0
  187. package/src/components/tab/TabGroup.ts +267 -0
  188. package/src/components/tab/TabPanel.ts +59 -0
  189. package/src/components/tab/leu-tab-group.ts +11 -0
  190. package/src/components/tab/leu-tab-panel.ts +11 -0
  191. package/src/components/tab/leu-tab.ts +11 -0
  192. package/src/components/tab/stories/tab.stories.ts +97 -0
  193. package/src/components/tab/tab-group.css +63 -0
  194. package/src/components/tab/tab-panel.css +10 -0
  195. package/src/components/tab/tab.css +54 -0
  196. package/src/components/tab/test/tab-group.test.ts +426 -0
  197. package/src/components/tab/test/tab-panel.test.ts +102 -0
  198. package/src/components/tab/test/tab.test.ts +139 -0
  199. package/tsconfig.json +1 -0
  200. /package/dist/{FormAssociatedMixin-Cc74LjbC.d.ts → FormAssociatedMixin-Cw7LsSUE.d.ts} +0 -0
  201. /package/dist/{LeuElement-pJFU18Xm.d.ts → LeuElement-DK1jntuu.d.ts} +0 -0
  202. /package/dist/{hasSlotController-DWPyZ52b.d.ts → hasSlotController-BjKyhJm-.d.ts} +0 -0
package/dist/Popup.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as VirtualElement, t as LeuPopup } from "./Popup-Btgm2a3D.js";
1
+ import { n as VirtualElement, t as LeuPopup } from "./Popup-B5iDSLIO.js";
2
2
  export { LeuPopup, VirtualElement };
package/dist/Popup.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import { t as LeuPopup } from "./Popup-8jhVy8gB.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import { t as LeuPopup } from "./Popup-nJrJHGSy.js";
3
3
  export { LeuPopup };
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-k4RjIeoG.js";
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
2
  import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
3
  import { css, html, nothing } from "lit";
4
4
  import { property } from "lit/decorators.js";
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
2
  import * as lit_html0 from "lit-html";
3
3
 
4
4
  //#region src/components/progress-bar/ProgressBar.d.ts
@@ -1,3 +1,3 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import { t as LeuProgressBar } from "./ProgressBar-CG0_lHfS.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import { t as LeuProgressBar } from "./ProgressBar-Dmq9veqU.js";
3
3
  export { LeuProgressBar };
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-k4RjIeoG.js";
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
2
  import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
3
  import { css, html } from "lit";
4
4
  import { property } from "lit/decorators.js";
package/dist/Radio.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
2
  import * as lit_html0 from "lit-html";
3
3
 
4
4
  //#region src/components/radio/Radio.d.ts
package/dist/Radio.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import { t as LeuRadio } from "./Radio-DG3xqP3s.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import { t as LeuRadio } from "./Radio-W5ck_IJI.js";
3
3
  export { LeuRadio };
@@ -1,6 +1,6 @@
1
- import { t as LeuElement } from "./LeuElement-k4RjIeoG.js";
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
2
  import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
- import { t as LeuRadio } from "./Radio-DG3xqP3s.js";
3
+ import { t as LeuRadio } from "./Radio-W5ck_IJI.js";
4
4
  import { css, html } from "lit";
5
5
  import { property } from "lit/decorators.js";
6
6
  import { classMap } from "lit/directives/class-map.js";
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
2
  import * as lit_html0 from "lit-html";
3
3
 
4
4
  //#region src/components/radio/RadioGroup.d.ts
@@ -1,4 +1,4 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import "./Radio-DG3xqP3s.js";
3
- import { t as LeuRadioGroup } from "./RadioGroup-BKCp9ICX.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import "./Radio-W5ck_IJI.js";
3
+ import { t as LeuRadioGroup } from "./RadioGroup-De5x2YCO.js";
4
4
  export { LeuRadioGroup };
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-k4RjIeoG.js";
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
2
  import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
3
  import { n as isNumber, t as clamp } from "./utils-hfk5Nwy8.js";
4
4
  import { css, html, nothing } from "lit";
package/dist/Range.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
2
  import { PropertyValues, nothing } from "lit";
3
3
  import * as lit_html0 from "lit-html";
4
4
 
package/dist/Range.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import { t as LeuRange } from "./Range-7LrESv4K.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import { t as LeuRange } from "./Range-NCdfDkeD.js";
3
3
  export { LeuRange };
@@ -1,7 +1,7 @@
1
- import { t as LeuElement } from "./LeuElement-k4RjIeoG.js";
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
2
  import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
- import { t as LeuIcon } from "./Icon-CbZXpyHU.js";
4
- import { t as LeuButton } from "./Button-BSyDL_cV.js";
3
+ import { t as LeuIcon } from "./Icon-D83qesg5.js";
4
+ import { t as LeuButton } from "./Button-DyNVOHCd.js";
5
5
  import { r as throttle } from "./utils-hfk5Nwy8.js";
6
6
  import { css, html } from "lit";
7
7
  import { state } from "lit/decorators.js";
@@ -1,6 +1,6 @@
1
- import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
2
- import { t as LeuIcon } from "./Icon-Op80LrrO.js";
3
- import { t as LeuButton } from "./Button-BgNUxmo_.js";
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
+ import { t as LeuIcon } from "./Icon-CUfh3eb3.js";
3
+ import { t as LeuButton } from "./Button-DcuvEVkC.js";
4
4
  import * as lit_html0 from "lit-html";
5
5
 
6
6
  //#region src/components/scroll-top/ScrollTop.d.ts
package/dist/ScrollTop.js CHANGED
@@ -1,7 +1,7 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import "./Icon-CbZXpyHU.js";
3
- import "./Spinner-VhKfzI3Q.js";
4
- import "./Button-BSyDL_cV.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import "./Icon-D83qesg5.js";
3
+ import "./Spinner-BBiVZxFH.js";
4
+ import "./Button-DyNVOHCd.js";
5
5
  import "./FormAssociatedMixin-DLPvFtbT.js";
6
- import { t as LeuScrollTop } from "./ScrollTop-CJJsfniA.js";
6
+ import { t as LeuScrollTop } from "./ScrollTop-DwcNIKmN.js";
7
7
  export { LeuScrollTop };
@@ -1,13 +1,13 @@
1
- import { t as LeuElement } from "./LeuElement-k4RjIeoG.js";
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
2
  import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
- import { t as LeuIcon } from "./Icon-CbZXpyHU.js";
3
+ import { t as LeuIcon } from "./Icon-D83qesg5.js";
4
4
  import { t as HasSlotController } from "./hasSlotController-DSBCVzPD.js";
5
- import { t as LeuButton } from "./Button-BSyDL_cV.js";
5
+ import { t as LeuButton } from "./Button-DyNVOHCd.js";
6
6
  import { t as FormAssociatedMixin } from "./FormAssociatedMixin-DLPvFtbT.js";
7
- import { t as LeuMenuItem } from "./MenuItem-Cs3KFhJm.js";
8
- import { t as LeuMenu } from "./Menu-Cu8eIF1T.js";
9
- import { t as LeuPopup } from "./Popup-8jhVy8gB.js";
10
- import { t as LeuInput } from "./Input-DBXX7ev8.js";
7
+ import { t as LeuMenuItem } from "./MenuItem-DCttylRO.js";
8
+ import { t as LeuMenu } from "./Menu-DRU1LiMM.js";
9
+ import { t as LeuPopup } from "./Popup-nJrJHGSy.js";
10
+ import { t as LeuInput } from "./Input-D7zS50oz.js";
11
11
  import { css, html, nothing } from "lit";
12
12
  import { property, state } from "lit/decorators.js";
13
13
  import { classMap } from "lit/directives/class-map.js";
@@ -509,7 +509,6 @@ var LeuSelect = class extends FormAssociatedMixin(LeuElement) {
509
509
  type="button"
510
510
  class="apply-button"
511
511
  @click=${this._closeDropdown}
512
- fluid
513
512
  >Anwenden</leu-button
514
513
  >
515
514
  </div>
package/dist/Select.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
2
- import { t as FormAssociatedMixinType } from "./FormAssociatedMixin-Cc74LjbC.js";
3
- import { t as LeuIcon } from "./Icon-Op80LrrO.js";
4
- import { t as LeuButton } from "./Button-BgNUxmo_.js";
5
- import { t as HasSlotController } from "./hasSlotController-DWPyZ52b.js";
6
- import { t as LeuMenuItem } from "./MenuItem-QcgnRk_7.js";
7
- import { t as LeuMenu } from "./Menu-CQdx1ef3.js";
8
- import { t as LeuPopup } from "./Popup-Btgm2a3D.js";
9
- import { t as LeuInput } from "./Input-CeaAOB4p.js";
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
+ import { t as FormAssociatedMixinType } from "./FormAssociatedMixin-Cw7LsSUE.js";
3
+ import { t as LeuIcon } from "./Icon-CUfh3eb3.js";
4
+ import { t as LeuButton } from "./Button-DcuvEVkC.js";
5
+ import { t as HasSlotController } from "./hasSlotController-BjKyhJm-.js";
6
+ import { t as LeuMenuItem } from "./MenuItem-LY4TRIho.js";
7
+ import { t as LeuMenu } from "./Menu-Z2b7dsB5.js";
8
+ import { t as LeuPopup } from "./Popup-B5iDSLIO.js";
9
+ import { t as LeuInput } from "./Input-fEiQvGDF.js";
10
10
  import { PropertyValues, nothing } from "lit";
11
11
  import * as lit_html0 from "lit-html";
12
12
  import * as lit_html_directives_ref_js0 from "lit-html/directives/ref.js";
package/dist/Select.js CHANGED
@@ -1,11 +1,11 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import "./Icon-CbZXpyHU.js";
3
- import "./Spinner-VhKfzI3Q.js";
4
- import "./Button-BSyDL_cV.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import "./Icon-D83qesg5.js";
3
+ import "./Spinner-BBiVZxFH.js";
4
+ import "./Button-DyNVOHCd.js";
5
5
  import "./FormAssociatedMixin-DLPvFtbT.js";
6
- import "./MenuItem-Cs3KFhJm.js";
7
- import "./Menu-Cu8eIF1T.js";
8
- import "./Popup-8jhVy8gB.js";
9
- import "./Input-DBXX7ev8.js";
10
- import { t as LeuSelect } from "./Select-CxEDXIBn.js";
6
+ import "./MenuItem-DCttylRO.js";
7
+ import "./Menu-DRU1LiMM.js";
8
+ import "./Popup-nJrJHGSy.js";
9
+ import "./Input-D7zS50oz.js";
10
+ import { t as LeuSelect } from "./Select-Bpicra9q.js";
11
11
  export { LeuSelect };
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-k4RjIeoG.js";
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
2
  import { css, html } from "lit";
3
3
  //#region src/components/spinner/spinner.css?inline
4
4
  var spinner_default = css`@keyframes leu-spinner-rotate {
@@ -1,4 +1,4 @@
1
- import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
2
  import * as lit_html0 from "lit-html";
3
3
 
4
4
  //#region src/components/spinner/Spinner.d.ts
package/dist/Spinner.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as LeuSpinner } from "./Spinner-CrM1enM0.js";
1
+ import { t as LeuSpinner } from "./Spinner-DHYaX6-Y.js";
2
2
  export { LeuSpinner };
package/dist/Spinner.js CHANGED
@@ -1,3 +1,3 @@
1
- import "./LeuElement-k4RjIeoG.js";
2
- import { t as LeuSpinner } from "./Spinner-VhKfzI3Q.js";
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import { t as LeuSpinner } from "./Spinner-BBiVZxFH.js";
3
3
  export { LeuSpinner };
@@ -0,0 +1,30 @@
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
+ import { PropertyValues } from "lit";
3
+ import * as lit_html0 from "lit-html";
4
+
5
+ //#region src/components/tab/Tab.d.ts
6
+ /**
7
+ * Tab Button.
8
+ *
9
+ * @prop {string} name - Name to link Button and Panel together
10
+ * @prop {boolean} active - Is active
11
+ *
12
+ * @tagname leu-tab
13
+ */
14
+ declare class LeuTab extends LeuElement {
15
+ static styles: any[];
16
+ protected readonly componentId: string;
17
+ /**
18
+ * Name of the tab. Apply the same name to the corresponding panel to link them together.
19
+ * Has to be unique within the tab component.
20
+ */
21
+ name: string;
22
+ active: boolean;
23
+ connectedCallback(): void;
24
+ disconnectedCallback(): void;
25
+ handleClick(): void;
26
+ updated(changedProperties: PropertyValues<this>): void;
27
+ render(): lit_html0.TemplateResult<1>;
28
+ }
29
+ //#endregion
30
+ export { LeuTab as t };
@@ -0,0 +1,117 @@
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
+ import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
+ import { css, html } from "lit";
4
+ import { property } from "lit/decorators.js";
5
+ //#region src/components/tab/tab.css?inline
6
+ var tab_default = css`:host {
7
+ --tab-button-font-regular: var(--leu-font-family-regular);
8
+
9
+ --tab-button-active-background: var(--leu-color-black-100);
10
+ --tab-button-active-color: var(--leu-color-black-0);
11
+
12
+ --tab-button-inactive-background: var(--leu-color-black-transp-10);
13
+ --tab-button-inactive-color: var(--leu-color-black-transp-60);
14
+
15
+ --tab-button-hover-background: var(--leu-color-black-transp-20);
16
+
17
+ display: flex;
18
+ justify-content: center;
19
+ align-items: center;
20
+ font-family: var(--tab-button-font-regular);
21
+ background: var(--tab-button-inactive-background);
22
+ color: var(--tab-button-inactive-color);
23
+ border: 0;
24
+ border-radius: 0.25rem;
25
+ padding: 0.5rem 0.75rem;
26
+ cursor: pointer;
27
+
28
+ white-space: nowrap;
29
+ }
30
+ @media (min-width: 1024px) {
31
+ :host {
32
+ padding-left: 1rem;
33
+ padding-right: 1rem;
34
+ }
35
+ }
36
+ :host(:hover) {
37
+ background: var(--tab-button-hover-background);
38
+ }
39
+ :host(:focus-visible) {
40
+ outline: 2px solid var(--leu-color-func-cyan);
41
+ outline-offset: 2px;
42
+ }
43
+ :host([active]) {
44
+ background: var(--tab-button-active-background);
45
+ color: var(--tab-button-active-color);
46
+ }
47
+ .label {
48
+ font-size: 1rem;
49
+ line-height: 1.5rem;
50
+ }
51
+ @media (min-width: 1024px) {
52
+ .label {
53
+ font-size: 1.125rem;
54
+ line-height: 1.75rem;
55
+ }
56
+ }
57
+ `;
58
+ //#endregion
59
+ //#region src/components/tab/Tab.ts
60
+ let nextId = 1;
61
+ /**
62
+ * Tab Button.
63
+ *
64
+ * @prop {string} name - Name to link Button and Panel together
65
+ * @prop {boolean} active - Is active
66
+ *
67
+ * @tagname leu-tab
68
+ */
69
+ var LeuTab = class extends LeuElement {
70
+ constructor(..._args) {
71
+ super(..._args);
72
+ this.componentId = `leu-tab-${nextId++}`;
73
+ this.name = "";
74
+ this.active = false;
75
+ }
76
+ static {
77
+ this.styles = [LeuElement.styles, tab_default];
78
+ }
79
+ connectedCallback() {
80
+ super.connectedCallback();
81
+ this.setAttribute("role", "tab");
82
+ this.addEventListener("click", this.handleClick);
83
+ this.id = this.id.length > 0 ? this.id : this.componentId;
84
+ }
85
+ disconnectedCallback() {
86
+ super.disconnectedCallback();
87
+ this.removeEventListener("click", this.handleClick);
88
+ }
89
+ handleClick() {
90
+ if (this.active) return;
91
+ this.active = true;
92
+ this.dispatchEvent(new CustomEvent("leu:tab-select", {
93
+ detail: { name: this.name },
94
+ bubbles: true,
95
+ composed: true
96
+ }));
97
+ }
98
+ updated(changedProperties) {
99
+ if (changedProperties.has("active")) {
100
+ this.ariaSelected = this.active ? "true" : "false";
101
+ this.tabIndex = this.active ? 0 : -1;
102
+ }
103
+ }
104
+ render() {
105
+ return html`<span class="label"><slot></slot></span>`;
106
+ }
107
+ };
108
+ __decorate([property({
109
+ type: String,
110
+ reflect: true
111
+ })], LeuTab.prototype, "name", void 0);
112
+ __decorate([property({
113
+ type: Boolean,
114
+ reflect: true
115
+ })], LeuTab.prototype, "active", void 0);
116
+ //#endregion
117
+ export { LeuTab as t };
package/dist/Tab.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { t as LeuTab } from "./Tab-CN97q0nj.js";
2
+ export { LeuTab };
package/dist/Tab.js ADDED
@@ -0,0 +1,3 @@
1
+ import "./LeuElement-DQI8cqZV.js";
2
+ import { t as LeuTab } from "./Tab-Ce9nrDok.js";
3
+ export { LeuTab };
@@ -0,0 +1,248 @@
1
+ import { t as LeuElement } from "./LeuElement-DQI8cqZV.js";
2
+ import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
+ import { t as LeuTab } from "./Tab-Ce9nrDok.js";
4
+ import { t as LeuTabPanel } from "./TabPanel-BW1ydVBT.js";
5
+ import { css, html } from "lit";
6
+ import { property, state } from "lit/decorators.js";
7
+ import { classMap } from "lit/directives/class-map.js";
8
+ import { createRef, ref } from "lit/directives/ref.js";
9
+ //#region src/components/tab/tab-group.css?inline
10
+ var tab_group_default = css`:host {
11
+ --tab-font-regular: var(--leu-font-family-regular);
12
+ --tab-font-black: var(--leu-font-family-black);
13
+
14
+ font-family: var(--tab-font-regular);
15
+ }
16
+ .container {
17
+ position: relative;
18
+ width: 100%;
19
+ }
20
+ .container::before,
21
+ .container::after {
22
+ content: "";
23
+ position: absolute;
24
+ top: 0;
25
+ height: 100%;
26
+ width: 0.375rem;
27
+ pointer-events: none;
28
+ visibility: hidden;
29
+ opacity: 0;
30
+ transition: 0.2s ease;
31
+ transition-property: visibility, opacity;
32
+ }
33
+ .container::before {
34
+ left: 0;
35
+ background: linear-gradient(to right, rgba(0, 0, 0, 0.2), transparent);
36
+ }
37
+ .container::after {
38
+ right: 0;
39
+ background: linear-gradient(to left, rgba(0, 0, 0, 0.2), transparent);
40
+ }
41
+ .container--scrollable-left::before,
42
+ .container--scrollable-right::after {
43
+ visibility: visible;
44
+ opacity: 1;
45
+ }
46
+ .tab-menu {
47
+ display: flex;
48
+ gap: 0.5rem;
49
+ padding: 0.5rem 0;
50
+ margin-bottom: 1.5rem;
51
+ border-bottom: 1px solid var(--leu-color-black-transp-10);
52
+
53
+ overflow: auto;
54
+ scrollbar-width: thin;
55
+ }
56
+ @media (min-width: 1024px) {
57
+ .tab-menu {
58
+ margin-bottom: 2rem;
59
+ }
60
+ }
61
+ @media (min-width: 1280px) {
62
+ .tab-menu {
63
+ padding: 1rem 0;
64
+ margin-bottom: 2.5rem;
65
+ }
66
+ }
67
+ `;
68
+ //#endregion
69
+ //#region src/components/tab/TabGroup.ts
70
+ /**
71
+ * Tab Group
72
+ *
73
+ * @slot tabs - Slot for the leu-tab elements
74
+ * @slot panels - Slot for the leu-tab-panel elements
75
+ * @todo: add disabled state to tabs and panels
76
+ * @todo: add backdrop / shadow
77
+ * @todo: add styling option for full-bleed layout (tabslist is full-bleed, panels use the full width of the container)
78
+ *
79
+ * @tagname leu-tab-group
80
+ */
81
+ var LeuTabGroup = class extends LeuElement {
82
+ constructor(..._args) {
83
+ super(..._args);
84
+ this.label = "";
85
+ this.active = "";
86
+ this.isScrollable = {
87
+ left: false,
88
+ right: false
89
+ };
90
+ this.tabs = [];
91
+ this.panels = [];
92
+ this.initialShowEventDispatched = false;
93
+ this.tabMenuRef = createRef();
94
+ this.resizeObserver = new ResizeObserver(() => {
95
+ this.checkScrollable();
96
+ });
97
+ this.mutationObserver = new MutationObserver((records) => {
98
+ for (const record of records) {
99
+ if (!(record.target instanceof HTMLElement)) continue;
100
+ if (record.type === "attributes" && record.attributeName === "id" && record.target.matches("leu-tab, leu-tab-panel")) {
101
+ this.linkTabsAndPanels();
102
+ continue;
103
+ }
104
+ }
105
+ });
106
+ }
107
+ static {
108
+ this.styles = [LeuElement.styles, tab_group_default];
109
+ }
110
+ connectedCallback() {
111
+ super.connectedCallback();
112
+ }
113
+ disconnectedCallback() {
114
+ super.disconnectedCallback();
115
+ this.resizeObserver.disconnect();
116
+ this.mutationObserver.disconnect();
117
+ }
118
+ firstUpdated() {
119
+ if (this.tabMenuRef.value) this.resizeObserver.observe(this.tabMenuRef.value);
120
+ this.mutationObserver.observe(this, {
121
+ subtree: true,
122
+ attributes: true,
123
+ attributeFilter: ["id"]
124
+ });
125
+ }
126
+ updated(changedProperties) {
127
+ if (changedProperties.has("active") || changedProperties.has("tabs") || changedProperties.has("panels")) {
128
+ this.updatePanels();
129
+ this.updateTabs();
130
+ }
131
+ }
132
+ async handleTabsSlotChange() {
133
+ this.tabs = (this.shadowRoot?.querySelector("slot[name=\"tabs\"]"))?.assignedElements({ flatten: true }).filter((el) => el instanceof LeuTab) ?? [];
134
+ if (this.tabs.length > 0 && !this.tabs.some((tab) => tab.name === this.active)) this.active = this.tabs[0].name;
135
+ this.linkTabsAndPanels();
136
+ await this.updateComplete;
137
+ this.checkScrollable();
138
+ }
139
+ handlePanelsSlotChange() {
140
+ this.panels = (this.shadowRoot?.querySelector("slot[name=\"panels\"]"))?.assignedElements({ flatten: true }).filter((el) => el instanceof LeuTabPanel) ?? [];
141
+ this.linkTabsAndPanels();
142
+ }
143
+ /**
144
+ * Link tabs and panels by setting the appropriate aria attributes.
145
+ * Generates global ids for tabs and panels if they don't have one.
146
+ */
147
+ linkTabsAndPanels() {
148
+ for (const tab of this.tabs) {
149
+ const panel = this.panels.find((o) => o.name === tab.name);
150
+ if (!panel) continue;
151
+ tab.setAttribute("aria-controls", panel.id);
152
+ panel.setAttribute("aria-labelledby", tab.id);
153
+ }
154
+ }
155
+ get activeTab() {
156
+ return this.tabs.find((o) => o.active);
157
+ }
158
+ get activePanel() {
159
+ return this.panels.find((o) => o.name === this.activeTab?.name);
160
+ }
161
+ updatePanels() {
162
+ for (const panel of this.panels) panel.active = panel.name === this.active;
163
+ }
164
+ updateTabs() {
165
+ for (const tab of this.tabs) tab.active = tab.name === this.active;
166
+ }
167
+ async keydownHandler(event) {
168
+ const activeTab = this.activeTab;
169
+ let nextTab = null;
170
+ if (![
171
+ "ArrowRight",
172
+ "ArrowLeft",
173
+ "Home",
174
+ "End"
175
+ ].includes(event.key) || !activeTab) return;
176
+ switch (event.key) {
177
+ case "ArrowRight":
178
+ case "ArrowLeft": {
179
+ const direction = event.key === "ArrowRight" ? 1 : -1;
180
+ const currentIndex = this.tabs.indexOf(activeTab);
181
+ const numOfTabs = this.tabs.length;
182
+ const nextIndex = (currentIndex + direction + numOfTabs) % numOfTabs;
183
+ nextTab = this.tabs[nextIndex];
184
+ break;
185
+ }
186
+ case "Home":
187
+ nextTab = this.tabs[0];
188
+ break;
189
+ case "End":
190
+ nextTab = this.tabs[this.tabs.length - 1];
191
+ break;
192
+ default: return;
193
+ }
194
+ this.active = nextTab.name;
195
+ await this.updateComplete;
196
+ nextTab.focus();
197
+ nextTab.scrollIntoView({
198
+ block: "nearest",
199
+ inline: "nearest"
200
+ });
201
+ }
202
+ checkScrollable() {
203
+ const tabMenu = this.tabMenuRef.value;
204
+ if (!tabMenu) return;
205
+ this.isScrollable = {
206
+ left: tabMenu.scrollLeft > 0,
207
+ right: tabMenu.scrollLeft < tabMenu.scrollWidth - tabMenu.clientWidth
208
+ };
209
+ }
210
+ handleScrollEvent() {
211
+ this.checkScrollable();
212
+ }
213
+ handleTabSelect(event) {
214
+ this.active = event.detail.name;
215
+ }
216
+ render() {
217
+ return html`
218
+ <div class=${classMap({
219
+ container: true,
220
+ "container--scrollable-left": this.isScrollable.left,
221
+ "container--scrollable-right": this.isScrollable.right
222
+ })}>
223
+ <div
224
+ class="tab-menu"
225
+ role="tablist"
226
+ @keydown=${this.keydownHandler}
227
+ @leu:tab-select=${this.handleTabSelect}
228
+ @scroll="${this.handleScrollEvent}"
229
+ aria-label=${this.label}
230
+ ${ref(this.tabMenuRef)}
231
+ >
232
+ <slot name="tabs" @slotchange=${this.handleTabsSlotChange}></slot>
233
+ </div>
234
+ </div>
235
+ <slot name="panels" @slotchange=${this.handlePanelsSlotChange}></slot>
236
+ `;
237
+ }
238
+ };
239
+ __decorate([property({ type: String })], LeuTabGroup.prototype, "label", void 0);
240
+ __decorate([property({
241
+ type: String,
242
+ reflect: true
243
+ })], LeuTabGroup.prototype, "active", void 0);
244
+ __decorate([state()], LeuTabGroup.prototype, "isScrollable", void 0);
245
+ __decorate([state()], LeuTabGroup.prototype, "tabs", void 0);
246
+ __decorate([state()], LeuTabGroup.prototype, "panels", void 0);
247
+ //#endregion
248
+ export { LeuTabGroup as t };