@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.
- package/.github/workflows/publish.yml +1 -3
- package/.release-please-manifest.json +1 -1
- package/.storybook/main.ts +1 -1
- package/.storybook/preview.ts +6 -4
- package/.storybook/static/global.css +5 -0
- package/AGENTS.md +162 -0
- package/CHANGELOG.md +30 -0
- package/dist/{Accordion-DLsqXcK8.js → Accordion-CwkI7sfx.js} +1 -1
- package/dist/Accordion.d.ts +1 -1
- package/dist/Accordion.js +2 -2
- package/dist/{Button-BSyDL_cV.js → Button-D1aYnunQ.js} +90 -82
- package/dist/{Button-BgNUxmo_.d.ts → Button-DcuvEVkC.d.ts} +14 -12
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +4 -4
- package/dist/{ButtonGroup-BmSvl-Oc.js → ButtonGroup-CqThYjzX.js} +2 -2
- package/dist/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup.js +5 -5
- package/dist/{ChartWrapper-CvDvQsd5.js → ChartWrapper-BjVT4x-H.js} +2 -2
- package/dist/ChartWrapper.d.ts +3 -3
- package/dist/ChartWrapper.js +3 -3
- package/dist/{Checkbox-Cl_X6gBJ.js → Checkbox-HxYqp2w4.js} +2 -2
- package/dist/Checkbox.d.ts +3 -3
- package/dist/Checkbox.js +3 -3
- package/dist/{CheckboxGroup-BKhOmZYX.js → CheckboxGroup-DYws2rwt.js} +2 -2
- package/dist/CheckboxGroup.d.ts +1 -1
- package/dist/CheckboxGroup.js +4 -4
- package/dist/{Chip-DLKM9P7v.d.ts → Chip-DVGjEPJE.d.ts} +1 -1
- package/dist/{Chip-McVP3N_x.js → Chip-gKxD6IaZ.js} +1 -1
- package/dist/Chip.d.ts +1 -1
- package/dist/Chip.js +2 -2
- package/dist/{ChipGroup-Ta8Ht4jc.d.ts → ChipGroup-BK5BYM0X.d.ts} +2 -2
- package/dist/{ChipGroup-DUGavZeU.js → ChipGroup-ZvBzX_wd.js} +1 -1
- package/dist/ChipGroup.d.ts +1 -1
- package/dist/ChipGroup.js +3 -3
- package/dist/{ChipLink-BAxyQO2M.d.ts → ChipLink-BdG2o-nk.d.ts} +1 -1
- package/dist/ChipLink.d.ts +1 -1
- package/dist/ChipLink.js +2 -2
- package/dist/{ChipRemovable-DBjwt0CH.d.ts → ChipRemovable-CCwSQTAL.d.ts} +2 -2
- package/dist/ChipRemovable.d.ts +1 -1
- package/dist/ChipRemovable.js +3 -3
- package/dist/{ChipSelectable-CMJNcE4U.d.ts → ChipSelectable-BQ3VLVi5.d.ts} +1 -1
- package/dist/ChipSelectable.d.ts +1 -1
- package/dist/ChipSelectable.js +2 -2
- package/dist/{Dialog-BlDd4T2u.js → Dialog-BYpzTprV.js} +2 -2
- package/dist/Dialog.d.ts +3 -3
- package/dist/Dialog.js +3 -3
- package/dist/{Dropdown-BLxSIe6p.js → Dropdown-C4CgE4E-.js} +5 -5
- package/dist/Dropdown.d.ts +6 -6
- package/dist/Dropdown.js +8 -8
- package/dist/{FileInput-DntYrpZ-.js → FileInput-nsnSQCaU.js} +8 -6
- package/dist/FileInput.d.ts +6 -6
- package/dist/FileInput.js +6 -6
- package/dist/{Icon-Op80LrrO.d.ts → Icon-CUfh3eb3.d.ts} +1 -1
- package/dist/{Icon-CbZXpyHU.js → Icon-D8HTPEFH.js} +1 -1
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +2 -2
- package/dist/{Input-DBXX7ev8.js → Input-OrILqlax.js} +2 -2
- package/dist/{Input-CeaAOB4p.d.ts → Input-fEiQvGDF.d.ts} +3 -3
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +3 -3
- package/dist/{LeuElement-k4RjIeoG.js → LeuElement-C_lcHzQI.js} +1 -1
- package/dist/{Menu-Cu8eIF1T.js → Menu-CFLCnI34.js} +2 -2
- package/dist/{Menu-CQdx1ef3.d.ts → Menu-Z2b7dsB5.d.ts} +2 -2
- package/dist/Menu.d.ts +1 -1
- package/dist/Menu.js +4 -4
- package/dist/{MenuItem-Cs3KFhJm.js → MenuItem-ICjLCGim.js} +2 -2
- package/dist/{MenuItem-QcgnRk_7.d.ts → MenuItem-LY4TRIho.d.ts} +2 -2
- package/dist/MenuItem.d.ts +1 -1
- package/dist/MenuItem.js +3 -3
- package/dist/{Message-C6Zlk_2p.js → Message-Dw5D_0i1.js} +2 -2
- package/dist/Message.d.ts +2 -2
- package/dist/Message.js +3 -3
- package/dist/{Pagination-CqkHh-Vd.d.ts → Pagination-9eZ8WMvR.d.ts} +4 -4
- package/dist/{Pagination-CB2eVlXk.js → Pagination-D1tP5FrM.js} +4 -4
- package/dist/Pagination.d.ts +1 -1
- package/dist/Pagination.js +6 -6
- package/dist/{Placeholder-DHMexMhK.js → Placeholder-CnGzCZ5-.js} +1 -1
- package/dist/Placeholder.d.ts +1 -1
- package/dist/Placeholder.js +2 -2
- package/dist/{Popup-Btgm2a3D.d.ts → Popup-B5iDSLIO.d.ts} +1 -1
- package/dist/{Popup-8jhVy8gB.js → Popup-BiN_tZDN.js} +1 -1
- package/dist/Popup.d.ts +1 -1
- package/dist/Popup.js +2 -2
- package/dist/{ProgressBar-CG0_lHfS.js → ProgressBar-BfJo_KyU.js} +1 -1
- package/dist/ProgressBar.d.ts +1 -1
- package/dist/ProgressBar.js +2 -2
- package/dist/{Radio-DG3xqP3s.js → Radio-CV7vuQUj.js} +1 -1
- package/dist/Radio.d.ts +1 -1
- package/dist/Radio.js +2 -2
- package/dist/{RadioGroup-BKCp9ICX.js → RadioGroup-C3XWSScc.js} +2 -2
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +3 -3
- package/dist/{Range-7LrESv4K.js → Range-C8RVrIM9.js} +1 -1
- package/dist/Range.d.ts +1 -1
- package/dist/Range.js +2 -2
- package/dist/{ScrollTop-CJJsfniA.js → ScrollTop-B_TJ_k4m.js} +3 -3
- package/dist/ScrollTop.d.ts +3 -3
- package/dist/ScrollTop.js +5 -5
- package/dist/{Select-CxEDXIBn.js → Select-CbPTrL3G.js} +7 -8
- package/dist/Select.d.ts +9 -9
- package/dist/Select.js +9 -9
- package/dist/{Spinner-VhKfzI3Q.js → Spinner-ChKJQJTN.js} +1 -1
- package/dist/{Spinner-CrM1enM0.d.ts → Spinner-DHYaX6-Y.d.ts} +1 -1
- package/dist/Spinner.d.ts +1 -1
- package/dist/Spinner.js +2 -2
- package/dist/Tab-BJbzY1xd.js +117 -0
- package/dist/Tab-CN97q0nj.d.ts +30 -0
- package/dist/Tab.d.ts +2 -0
- package/dist/Tab.js +3 -0
- package/dist/TabGroup-BIaCHrKR.js +248 -0
- package/dist/TabGroup.d.ts +64 -0
- package/dist/TabGroup.js +5 -0
- package/dist/TabPanel-CTyw410b.js +65 -0
- package/dist/TabPanel-DQgWP7LO.d.ts +26 -0
- package/dist/TabPanel.d.ts +2 -0
- package/dist/TabPanel.js +3 -0
- package/dist/{Table-rg_JCtsA.js → Table-D3QmePJd.js} +3 -3
- package/dist/Table.d.ts +3 -3
- package/dist/Table.js +7 -7
- package/dist/{Tag-BROUaDAZ.js → Tag-nUnWtHYy.js} +1 -1
- package/dist/Tag.d.ts +1 -1
- package/dist/Tag.js +2 -2
- package/dist/{VisuallyHidden-OeQvhxYn.d.ts → VisuallyHidden-CB7aRJzF.d.ts} +1 -1
- package/dist/{VisuallyHidden-Co_txzxB.js → VisuallyHidden-DF2q9pTa.js} +1 -1
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.js +2 -2
- package/dist/index.d.ts +14 -14
- package/dist/index.js +30 -30
- package/dist/leu-accordion.js +2 -2
- package/dist/leu-button-group.js +5 -5
- package/dist/leu-button.d.ts +1 -1
- package/dist/leu-button.js +4 -4
- package/dist/leu-chart-wrapper.js +3 -3
- package/dist/leu-checkbox-group.js +4 -4
- package/dist/leu-checkbox.js +3 -3
- package/dist/leu-chip-group.d.ts +1 -1
- package/dist/leu-chip-group.js +3 -3
- package/dist/leu-chip-link.d.ts +1 -1
- package/dist/leu-chip-link.js +2 -2
- package/dist/leu-chip-removable.d.ts +1 -1
- package/dist/leu-chip-removable.js +3 -3
- package/dist/leu-chip-selectable.d.ts +1 -1
- package/dist/leu-chip-selectable.js +2 -2
- package/dist/leu-dialog.js +3 -3
- package/dist/leu-dropdown.js +8 -8
- package/dist/leu-file-input.js +6 -6
- package/dist/leu-icon.d.ts +1 -1
- package/dist/leu-icon.js +2 -2
- package/dist/leu-input.d.ts +1 -1
- package/dist/leu-input.js +3 -3
- package/dist/leu-menu-item.d.ts +1 -1
- package/dist/leu-menu-item.js +3 -3
- package/dist/leu-menu.d.ts +1 -1
- package/dist/leu-menu.js +4 -4
- package/dist/leu-message.js +3 -3
- package/dist/leu-pagination.d.ts +1 -1
- package/dist/leu-pagination.js +6 -6
- package/dist/leu-placeholder.js +2 -2
- package/dist/leu-popup.d.ts +1 -1
- package/dist/leu-popup.js +2 -2
- package/dist/leu-progress-bar.js +2 -2
- package/dist/leu-radio-group.js +3 -3
- package/dist/leu-radio.js +2 -2
- package/dist/leu-range.js +2 -2
- package/dist/leu-scroll-top.js +5 -5
- package/dist/leu-select.js +9 -9
- package/dist/leu-spinner.d.ts +1 -1
- package/dist/leu-spinner.js +2 -2
- package/dist/leu-tab-group.d.ts +10 -0
- package/dist/leu-tab-group.js +8 -0
- package/dist/leu-tab-panel.d.ts +10 -0
- package/dist/leu-tab-panel.js +6 -0
- package/dist/leu-tab.d.ts +10 -0
- package/dist/leu-tab.js +6 -0
- package/dist/leu-table.js +7 -7
- package/dist/leu-tag.js +2 -2
- package/dist/leu-visually-hidden.d.ts +1 -1
- package/dist/leu-visually-hidden.js +2 -2
- package/dist/vscode.html-custom-data.json +87 -19
- package/dist/vue/index.d.ts +93 -25
- package/dist/web-types.json +169 -44
- package/package.json +6 -5
- package/src/components/button/Button.ts +45 -30
- package/src/components/button/button.css +55 -54
- package/src/components/button/stories/button.stories.ts +17 -20
- package/src/components/button/test/button.test.ts +46 -0
- package/src/components/file-input/FileInput.ts +4 -2
- package/src/components/file-input/test/file-input.test.ts +24 -0
- package/src/components/select/Select.ts +0 -1
- package/src/components/tab/Tab.ts +72 -0
- package/src/components/tab/TabGroup.ts +267 -0
- package/src/components/tab/TabPanel.ts +59 -0
- package/src/components/tab/leu-tab-group.ts +11 -0
- package/src/components/tab/leu-tab-panel.ts +11 -0
- package/src/components/tab/leu-tab.ts +11 -0
- package/src/components/tab/stories/tab.stories.ts +97 -0
- package/src/components/tab/tab-group.css +63 -0
- package/src/components/tab/tab-panel.css +10 -0
- package/src/components/tab/tab.css +54 -0
- package/src/components/tab/test/tab-group.test.ts +426 -0
- package/src/components/tab/test/tab-panel.test.ts +102 -0
- package/src/components/tab/test/tab.test.ts +139 -0
- package/tsconfig.json +1 -0
- /package/dist/{FormAssociatedMixin-Cc74LjbC.d.ts → FormAssociatedMixin-Cw7LsSUE.d.ts} +0 -0
- /package/dist/{LeuElement-pJFU18Xm.d.ts → LeuElement-DK1jntuu.d.ts} +0 -0
- /package/dist/{hasSlotController-DWPyZ52b.d.ts → hasSlotController-BjKyhJm-.d.ts} +0 -0
package/dist/RadioGroup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./LeuElement-
|
|
2
|
-
import "./Radio-
|
|
3
|
-
import { t as LeuRadioGroup } from "./RadioGroup-
|
|
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-
|
|
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
package/dist/Range.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./LeuElement-
|
|
2
|
-
import { t as LeuRange } from "./Range-
|
|
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-
|
|
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-
|
|
4
|
-
import { t as LeuButton } from "./Button-
|
|
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";
|
package/dist/ScrollTop.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as LeuElement } from "./LeuElement-
|
|
2
|
-
import { t as LeuIcon } from "./Icon-
|
|
3
|
-
import { t as LeuButton } from "./Button-
|
|
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-
|
|
2
|
-
import "./Icon-
|
|
3
|
-
import "./Spinner-
|
|
4
|
-
import "./Button-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
8
|
-
import { t as LeuMenu } from "./Menu-
|
|
9
|
-
import { t as LeuPopup } from "./Popup-
|
|
10
|
-
import { t as LeuInput } from "./Input-
|
|
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-
|
|
2
|
-
import { t as FormAssociatedMixinType } from "./FormAssociatedMixin-
|
|
3
|
-
import { t as LeuIcon } from "./Icon-
|
|
4
|
-
import { t as LeuButton } from "./Button-
|
|
5
|
-
import { t as HasSlotController } from "./hasSlotController-
|
|
6
|
-
import { t as LeuMenuItem } from "./MenuItem-
|
|
7
|
-
import { t as LeuMenu } from "./Menu-
|
|
8
|
-
import { t as LeuPopup } from "./Popup-
|
|
9
|
-
import { t as LeuInput } from "./Input-
|
|
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-
|
|
2
|
-
import "./Icon-
|
|
3
|
-
import "./Spinner-
|
|
4
|
-
import "./Button-
|
|
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-
|
|
7
|
-
import "./Menu-
|
|
8
|
-
import "./Popup-
|
|
9
|
-
import "./Input-
|
|
10
|
-
import { t as LeuSelect } from "./Select-
|
|
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 };
|
package/dist/Spinner.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LeuSpinner } from "./Spinner-
|
|
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-
|
|
2
|
-
import { t as LeuSpinner } from "./Spinner-
|
|
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
package/dist/Tab.js
ADDED
|
@@ -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 };
|