@statistikzh/leu 0.27.0 → 0.28.1

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 (206) hide show
  1. package/.github/workflows/publish.yml +1 -3
  2. package/.release-please-manifest.json +1 -1
  3. package/.storybook/main.ts +1 -1
  4. package/.storybook/preview.ts +6 -4
  5. package/.storybook/static/global.css +5 -0
  6. package/AGENTS.md +162 -0
  7. package/CHANGELOG.md +30 -0
  8. package/dist/{Accordion-DLsqXcK8.js → Accordion-CwkI7sfx.js} +1 -1
  9. package/dist/Accordion.d.ts +1 -1
  10. package/dist/Accordion.js +2 -2
  11. package/dist/{Button-BSyDL_cV.js → Button-D1aYnunQ.js} +90 -82
  12. package/dist/{Button-BgNUxmo_.d.ts → Button-DcuvEVkC.d.ts} +14 -12
  13. package/dist/Button.d.ts +1 -1
  14. package/dist/Button.js +4 -4
  15. package/dist/{ButtonGroup-BmSvl-Oc.js → ButtonGroup-CqThYjzX.js} +2 -2
  16. package/dist/ButtonGroup.d.ts +1 -1
  17. package/dist/ButtonGroup.js +5 -5
  18. package/dist/{ChartWrapper-CvDvQsd5.js → ChartWrapper-BjVT4x-H.js} +2 -2
  19. package/dist/ChartWrapper.d.ts +3 -3
  20. package/dist/ChartWrapper.js +3 -3
  21. package/dist/{Checkbox-Cl_X6gBJ.js → Checkbox-HxYqp2w4.js} +2 -2
  22. package/dist/Checkbox.d.ts +3 -3
  23. package/dist/Checkbox.js +3 -3
  24. package/dist/{CheckboxGroup-BKhOmZYX.js → CheckboxGroup-DYws2rwt.js} +2 -2
  25. package/dist/CheckboxGroup.d.ts +1 -1
  26. package/dist/CheckboxGroup.js +4 -4
  27. package/dist/{Chip-DLKM9P7v.d.ts → Chip-DVGjEPJE.d.ts} +1 -1
  28. package/dist/{Chip-McVP3N_x.js → Chip-gKxD6IaZ.js} +1 -1
  29. package/dist/Chip.d.ts +1 -1
  30. package/dist/Chip.js +2 -2
  31. package/dist/{ChipGroup-Ta8Ht4jc.d.ts → ChipGroup-BK5BYM0X.d.ts} +2 -2
  32. package/dist/{ChipGroup-DUGavZeU.js → ChipGroup-ZvBzX_wd.js} +1 -1
  33. package/dist/ChipGroup.d.ts +1 -1
  34. package/dist/ChipGroup.js +3 -3
  35. package/dist/{ChipLink-BAxyQO2M.d.ts → ChipLink-BdG2o-nk.d.ts} +1 -1
  36. package/dist/ChipLink.d.ts +1 -1
  37. package/dist/ChipLink.js +2 -2
  38. package/dist/{ChipRemovable-DBjwt0CH.d.ts → ChipRemovable-CCwSQTAL.d.ts} +2 -2
  39. package/dist/ChipRemovable.d.ts +1 -1
  40. package/dist/ChipRemovable.js +3 -3
  41. package/dist/{ChipSelectable-CMJNcE4U.d.ts → ChipSelectable-BQ3VLVi5.d.ts} +1 -1
  42. package/dist/ChipSelectable.d.ts +1 -1
  43. package/dist/ChipSelectable.js +2 -2
  44. package/dist/{Dialog-BlDd4T2u.js → Dialog-BYpzTprV.js} +2 -2
  45. package/dist/Dialog.d.ts +3 -3
  46. package/dist/Dialog.js +3 -3
  47. package/dist/{Dropdown-BLxSIe6p.js → Dropdown-C4CgE4E-.js} +5 -5
  48. package/dist/Dropdown.d.ts +6 -6
  49. package/dist/Dropdown.js +8 -8
  50. package/dist/{FileInput-DntYrpZ-.js → FileInput-nsnSQCaU.js} +8 -6
  51. package/dist/FileInput.d.ts +6 -6
  52. package/dist/FileInput.js +6 -6
  53. package/dist/{Icon-Op80LrrO.d.ts → Icon-CUfh3eb3.d.ts} +1 -1
  54. package/dist/{Icon-CbZXpyHU.js → Icon-D8HTPEFH.js} +1 -1
  55. package/dist/Icon.d.ts +1 -1
  56. package/dist/Icon.js +2 -2
  57. package/dist/{Input-DBXX7ev8.js → Input-OrILqlax.js} +2 -2
  58. package/dist/{Input-CeaAOB4p.d.ts → Input-fEiQvGDF.d.ts} +3 -3
  59. package/dist/Input.d.ts +1 -1
  60. package/dist/Input.js +3 -3
  61. package/dist/{LeuElement-k4RjIeoG.js → LeuElement-C_lcHzQI.js} +1 -1
  62. package/dist/{Menu-Cu8eIF1T.js → Menu-CFLCnI34.js} +2 -2
  63. package/dist/{Menu-CQdx1ef3.d.ts → Menu-Z2b7dsB5.d.ts} +2 -2
  64. package/dist/Menu.d.ts +1 -1
  65. package/dist/Menu.js +4 -4
  66. package/dist/{MenuItem-Cs3KFhJm.js → MenuItem-ICjLCGim.js} +2 -2
  67. package/dist/{MenuItem-QcgnRk_7.d.ts → MenuItem-LY4TRIho.d.ts} +2 -2
  68. package/dist/MenuItem.d.ts +1 -1
  69. package/dist/MenuItem.js +3 -3
  70. package/dist/{Message-C6Zlk_2p.js → Message-Dw5D_0i1.js} +2 -2
  71. package/dist/Message.d.ts +2 -2
  72. package/dist/Message.js +3 -3
  73. package/dist/{Pagination-CqkHh-Vd.d.ts → Pagination-9eZ8WMvR.d.ts} +4 -4
  74. package/dist/{Pagination-CB2eVlXk.js → Pagination-D1tP5FrM.js} +4 -4
  75. package/dist/Pagination.d.ts +1 -1
  76. package/dist/Pagination.js +6 -6
  77. package/dist/{Placeholder-DHMexMhK.js → Placeholder-CnGzCZ5-.js} +1 -1
  78. package/dist/Placeholder.d.ts +1 -1
  79. package/dist/Placeholder.js +2 -2
  80. package/dist/{Popup-Btgm2a3D.d.ts → Popup-B5iDSLIO.d.ts} +1 -1
  81. package/dist/{Popup-8jhVy8gB.js → Popup-BiN_tZDN.js} +1 -1
  82. package/dist/Popup.d.ts +1 -1
  83. package/dist/Popup.js +2 -2
  84. package/dist/{ProgressBar-CG0_lHfS.js → ProgressBar-BfJo_KyU.js} +1 -1
  85. package/dist/ProgressBar.d.ts +1 -1
  86. package/dist/ProgressBar.js +2 -2
  87. package/dist/{Radio-DG3xqP3s.js → Radio-CV7vuQUj.js} +1 -1
  88. package/dist/Radio.d.ts +1 -1
  89. package/dist/Radio.js +2 -2
  90. package/dist/{RadioGroup-BKCp9ICX.js → RadioGroup-C3XWSScc.js} +2 -2
  91. package/dist/RadioGroup.d.ts +1 -1
  92. package/dist/RadioGroup.js +3 -3
  93. package/dist/{Range-7LrESv4K.js → Range-C8RVrIM9.js} +1 -1
  94. package/dist/Range.d.ts +1 -1
  95. package/dist/Range.js +2 -2
  96. package/dist/{ScrollTop-CJJsfniA.js → ScrollTop-B_TJ_k4m.js} +3 -3
  97. package/dist/ScrollTop.d.ts +3 -3
  98. package/dist/ScrollTop.js +5 -5
  99. package/dist/{Select-CxEDXIBn.js → Select-CbPTrL3G.js} +7 -8
  100. package/dist/Select.d.ts +9 -9
  101. package/dist/Select.js +9 -9
  102. package/dist/{Spinner-VhKfzI3Q.js → Spinner-ChKJQJTN.js} +1 -1
  103. package/dist/{Spinner-CrM1enM0.d.ts → Spinner-DHYaX6-Y.d.ts} +1 -1
  104. package/dist/Spinner.d.ts +1 -1
  105. package/dist/Spinner.js +2 -2
  106. package/dist/Tab-BJbzY1xd.js +117 -0
  107. package/dist/Tab-CN97q0nj.d.ts +30 -0
  108. package/dist/Tab.d.ts +2 -0
  109. package/dist/Tab.js +3 -0
  110. package/dist/TabGroup-BIaCHrKR.js +248 -0
  111. package/dist/TabGroup.d.ts +64 -0
  112. package/dist/TabGroup.js +5 -0
  113. package/dist/TabPanel-CTyw410b.js +65 -0
  114. package/dist/TabPanel-DQgWP7LO.d.ts +26 -0
  115. package/dist/TabPanel.d.ts +2 -0
  116. package/dist/TabPanel.js +3 -0
  117. package/dist/{Table-rg_JCtsA.js → Table-D3QmePJd.js} +3 -3
  118. package/dist/Table.d.ts +3 -3
  119. package/dist/Table.js +7 -7
  120. package/dist/{Tag-BROUaDAZ.js → Tag-nUnWtHYy.js} +1 -1
  121. package/dist/Tag.d.ts +1 -1
  122. package/dist/Tag.js +2 -2
  123. package/dist/{VisuallyHidden-OeQvhxYn.d.ts → VisuallyHidden-CB7aRJzF.d.ts} +1 -1
  124. package/dist/{VisuallyHidden-Co_txzxB.js → VisuallyHidden-DF2q9pTa.js} +1 -1
  125. package/dist/VisuallyHidden.d.ts +1 -1
  126. package/dist/VisuallyHidden.js +2 -2
  127. package/dist/index.d.ts +14 -14
  128. package/dist/index.js +30 -30
  129. package/dist/leu-accordion.js +2 -2
  130. package/dist/leu-button-group.js +5 -5
  131. package/dist/leu-button.d.ts +1 -1
  132. package/dist/leu-button.js +4 -4
  133. package/dist/leu-chart-wrapper.js +3 -3
  134. package/dist/leu-checkbox-group.js +4 -4
  135. package/dist/leu-checkbox.js +3 -3
  136. package/dist/leu-chip-group.d.ts +1 -1
  137. package/dist/leu-chip-group.js +3 -3
  138. package/dist/leu-chip-link.d.ts +1 -1
  139. package/dist/leu-chip-link.js +2 -2
  140. package/dist/leu-chip-removable.d.ts +1 -1
  141. package/dist/leu-chip-removable.js +3 -3
  142. package/dist/leu-chip-selectable.d.ts +1 -1
  143. package/dist/leu-chip-selectable.js +2 -2
  144. package/dist/leu-dialog.js +3 -3
  145. package/dist/leu-dropdown.js +8 -8
  146. package/dist/leu-file-input.js +6 -6
  147. package/dist/leu-icon.d.ts +1 -1
  148. package/dist/leu-icon.js +2 -2
  149. package/dist/leu-input.d.ts +1 -1
  150. package/dist/leu-input.js +3 -3
  151. package/dist/leu-menu-item.d.ts +1 -1
  152. package/dist/leu-menu-item.js +3 -3
  153. package/dist/leu-menu.d.ts +1 -1
  154. package/dist/leu-menu.js +4 -4
  155. package/dist/leu-message.js +3 -3
  156. package/dist/leu-pagination.d.ts +1 -1
  157. package/dist/leu-pagination.js +6 -6
  158. package/dist/leu-placeholder.js +2 -2
  159. package/dist/leu-popup.d.ts +1 -1
  160. package/dist/leu-popup.js +2 -2
  161. package/dist/leu-progress-bar.js +2 -2
  162. package/dist/leu-radio-group.js +3 -3
  163. package/dist/leu-radio.js +2 -2
  164. package/dist/leu-range.js +2 -2
  165. package/dist/leu-scroll-top.js +5 -5
  166. package/dist/leu-select.js +9 -9
  167. package/dist/leu-spinner.d.ts +1 -1
  168. package/dist/leu-spinner.js +2 -2
  169. package/dist/leu-tab-group.d.ts +10 -0
  170. package/dist/leu-tab-group.js +8 -0
  171. package/dist/leu-tab-panel.d.ts +10 -0
  172. package/dist/leu-tab-panel.js +6 -0
  173. package/dist/leu-tab.d.ts +10 -0
  174. package/dist/leu-tab.js +6 -0
  175. package/dist/leu-table.js +7 -7
  176. package/dist/leu-tag.js +2 -2
  177. package/dist/leu-visually-hidden.d.ts +1 -1
  178. package/dist/leu-visually-hidden.js +2 -2
  179. package/dist/vscode.html-custom-data.json +87 -19
  180. package/dist/vue/index.d.ts +93 -25
  181. package/dist/web-types.json +169 -44
  182. package/package.json +6 -5
  183. package/src/components/button/Button.ts +45 -30
  184. package/src/components/button/button.css +55 -54
  185. package/src/components/button/stories/button.stories.ts +17 -20
  186. package/src/components/button/test/button.test.ts +46 -0
  187. package/src/components/file-input/FileInput.ts +4 -2
  188. package/src/components/file-input/test/file-input.test.ts +24 -0
  189. package/src/components/select/Select.ts +0 -1
  190. package/src/components/tab/Tab.ts +72 -0
  191. package/src/components/tab/TabGroup.ts +267 -0
  192. package/src/components/tab/TabPanel.ts +59 -0
  193. package/src/components/tab/leu-tab-group.ts +11 -0
  194. package/src/components/tab/leu-tab-panel.ts +11 -0
  195. package/src/components/tab/leu-tab.ts +11 -0
  196. package/src/components/tab/stories/tab.stories.ts +97 -0
  197. package/src/components/tab/tab-group.css +63 -0
  198. package/src/components/tab/tab-panel.css +10 -0
  199. package/src/components/tab/tab.css +54 -0
  200. package/src/components/tab/test/tab-group.test.ts +426 -0
  201. package/src/components/tab/test/tab-panel.test.ts +102 -0
  202. package/src/components/tab/test/tab.test.ts +139 -0
  203. package/tsconfig.json +1 -0
  204. /package/dist/{FormAssociatedMixin-Cc74LjbC.d.ts → FormAssociatedMixin-Cw7LsSUE.d.ts} +0 -0
  205. /package/dist/{LeuElement-pJFU18Xm.d.ts → LeuElement-DK1jntuu.d.ts} +0 -0
  206. /package/dist/{hasSlotController-DWPyZ52b.d.ts → hasSlotController-BjKyhJm-.d.ts} +0 -0
@@ -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-C_lcHzQI.js";
2
+ import "./Radio-CV7vuQUj.js";
3
+ import { t as LeuRadioGroup } from "./RadioGroup-C3XWSScc.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-C_lcHzQI.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-C_lcHzQI.js";
2
+ import { t as LeuRange } from "./Range-C8RVrIM9.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-C_lcHzQI.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-D8HTPEFH.js";
4
+ import { t as LeuButton } from "./Button-D1aYnunQ.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-C_lcHzQI.js";
2
+ import "./Icon-D8HTPEFH.js";
3
+ import "./Spinner-ChKJQJTN.js";
4
+ import "./Button-D1aYnunQ.js";
5
5
  import "./FormAssociatedMixin-DLPvFtbT.js";
6
- import { t as LeuScrollTop } from "./ScrollTop-CJJsfniA.js";
6
+ import { t as LeuScrollTop } from "./ScrollTop-B_TJ_k4m.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-C_lcHzQI.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-D8HTPEFH.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-D1aYnunQ.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-ICjLCGim.js";
8
+ import { t as LeuMenu } from "./Menu-CFLCnI34.js";
9
+ import { t as LeuPopup } from "./Popup-BiN_tZDN.js";
10
+ import { t as LeuInput } from "./Input-OrILqlax.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-C_lcHzQI.js";
2
+ import "./Icon-D8HTPEFH.js";
3
+ import "./Spinner-ChKJQJTN.js";
4
+ import "./Button-D1aYnunQ.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-ICjLCGim.js";
7
+ import "./Menu-CFLCnI34.js";
8
+ import "./Popup-BiN_tZDN.js";
9
+ import "./Input-OrILqlax.js";
10
+ import { t as LeuSelect } from "./Select-CbPTrL3G.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-C_lcHzQI.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-C_lcHzQI.js";
2
+ import { t as LeuSpinner } from "./Spinner-ChKJQJTN.js";
3
3
  export { LeuSpinner };
@@ -0,0 +1,117 @@
1
+ import { t as LeuElement } from "./LeuElement-C_lcHzQI.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 };
@@ -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 };
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-C_lcHzQI.js";
2
+ import { t as LeuTab } from "./Tab-BJbzY1xd.js";
3
+ export { LeuTab };
@@ -0,0 +1,248 @@
1
+ import { t as LeuElement } from "./LeuElement-C_lcHzQI.js";
2
+ import { t as __decorate } from "./decorate-DwpAc4D0.js";
3
+ import { t as LeuTab } from "./Tab-BJbzY1xd.js";
4
+ import { t as LeuTabPanel } from "./TabPanel-CTyw410b.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 };
@@ -0,0 +1,64 @@
1
+ import { t as LeuElement } from "./LeuElement-DK1jntuu.js";
2
+ import { t as LeuTab } from "./Tab-CN97q0nj.js";
3
+ import { t as LeuTabPanel } from "./TabPanel-DQgWP7LO.js";
4
+ import { PropertyValues } from "lit";
5
+ import * as lit_html0 from "lit-html";
6
+ import * as lit_html_directives_ref_js0 from "lit-html/directives/ref.js";
7
+
8
+ //#region src/components/tab/TabGroup.d.ts
9
+ type ScrollableState = {
10
+ left: boolean;
11
+ right: boolean;
12
+ };
13
+ /**
14
+ * Tab Group
15
+ *
16
+ * @slot tabs - Slot for the leu-tab elements
17
+ * @slot panels - Slot for the leu-tab-panel elements
18
+ * @todo: add disabled state to tabs and panels
19
+ * @todo: add backdrop / shadow
20
+ * @todo: add styling option for full-bleed layout (tabslist is full-bleed, panels use the full width of the container)
21
+ *
22
+ * @tagname leu-tab-group
23
+ */
24
+ declare class LeuTabGroup extends LeuElement {
25
+ static styles: any[];
26
+ /**
27
+ * Label for the tab list, used for accessibility.
28
+ * Content will not be visible on the page, but should be provided for screen readers.
29
+ */
30
+ label: string;
31
+ /**
32
+ * Name of the active/selected tab and panel. Has to match the name property of a leu-tab and leu-tab-panel.
33
+ */
34
+ active: string;
35
+ protected isScrollable: ScrollableState;
36
+ protected tabs: LeuTab[];
37
+ protected panels: LeuTabPanel[];
38
+ protected initialShowEventDispatched: boolean;
39
+ protected tabMenuRef: lit_html_directives_ref_js0.Ref<HTMLDivElement>;
40
+ protected resizeObserver: ResizeObserver;
41
+ protected mutationObserver: MutationObserver;
42
+ connectedCallback(): void;
43
+ disconnectedCallback(): void;
44
+ firstUpdated(): void;
45
+ updated(changedProperties: PropertyValues): void;
46
+ protected handleTabsSlotChange(): Promise<void>;
47
+ protected handlePanelsSlotChange(): void;
48
+ /**
49
+ * Link tabs and panels by setting the appropriate aria attributes.
50
+ * Generates global ids for tabs and panels if they don't have one.
51
+ */
52
+ protected linkTabsAndPanels(): void;
53
+ protected get activeTab(): LeuTab;
54
+ protected get activePanel(): LeuTabPanel;
55
+ protected updatePanels(): void;
56
+ protected updateTabs(): void;
57
+ protected keydownHandler(event: KeyboardEvent): Promise<void>;
58
+ protected checkScrollable(): void;
59
+ protected handleScrollEvent(): void;
60
+ protected handleTabSelect(event: CustomEvent): void;
61
+ render(): lit_html0.TemplateResult<1>;
62
+ }
63
+ //#endregion
64
+ export { LeuTabGroup };
@@ -0,0 +1,5 @@
1
+ import "./LeuElement-C_lcHzQI.js";
2
+ import "./Tab-BJbzY1xd.js";
3
+ import "./TabPanel-CTyw410b.js";
4
+ import { t as LeuTabGroup } from "./TabGroup-BIaCHrKR.js";
5
+ export { LeuTabGroup };