@statistikzh/leu 0.24.2 → 0.26.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.
- package/.release-please-manifest.json +1 -1
- package/.storybook/main.ts +18 -53
- package/.storybook/manager.ts +1 -4
- package/.storybook/preview.ts +23 -16
- package/.storybook/theme.ts +1 -1
- package/CHANGELOG.md +21 -0
- package/CONTRIBUTING.md +19 -8
- package/dist/Accordion-B04QkmHz.js +241 -0
- package/dist/Accordion.d.ts +44 -44
- package/dist/Accordion.js +2 -249
- package/dist/Button-BgNUxmo_.d.ts +99 -0
- package/dist/Button-BkhqVjug.js +564 -0
- package/dist/Button.d.ts +2 -85
- package/dist/Button.js +5 -504
- package/dist/ButtonGroup-B8U9fDvM.js +88 -0
- package/dist/ButtonGroup.d.ts +19 -19
- package/dist/ButtonGroup.js +6 -101
- package/dist/ChartWrapper-CSMFwz9e.js +158 -0
- package/dist/ChartWrapper.d.ts +26 -26
- package/dist/ChartWrapper.js +3 -163
- package/dist/Checkbox-Dd1QLpfn.js +198 -0
- package/dist/Checkbox.d.ts +35 -27
- package/dist/Checkbox.js +4 -157
- package/dist/CheckboxGroup-Bz2eWEFL.js +81 -0
- package/dist/CheckboxGroup.d.ts +18 -18
- package/dist/CheckboxGroup.js +5 -82
- package/dist/Chip-DLKM9P7v.d.ts +18 -0
- package/dist/Chip-XAQIIsXq.js +171 -0
- package/dist/Chip.d.ts +2 -18
- package/dist/Chip.js +2 -166
- package/dist/ChipGroup-DLqfK2kn.js +125 -0
- package/dist/ChipGroup-Ta8Ht4jc.d.ts +42 -0
- package/dist/ChipGroup.d.ts +2 -43
- package/dist/ChipGroup.js +3 -132
- package/dist/ChipLink-BAxyQO2M.d.ts +17 -0
- package/dist/ChipLink.d.ts +2 -18
- package/dist/ChipLink.js +28 -28
- package/dist/ChipRemovable-DBjwt0CH.d.ts +25 -0
- package/dist/ChipRemovable.d.ts +2 -26
- package/dist/ChipRemovable.js +42 -43
- package/dist/ChipSelectable-CMJNcE4U.d.ts +32 -0
- package/dist/ChipSelectable.d.ts +2 -33
- package/dist/ChipSelectable.js +63 -72
- package/dist/Dialog-DHuXR_oo.js +241 -0
- package/dist/Dialog.d.ts +28 -28
- package/dist/Dialog.js +3 -240
- package/dist/Dropdown-DtFTePbc.js +155 -0
- package/dist/Dropdown.d.ts +39 -41
- package/dist/Dropdown.js +9 -157
- package/dist/FileInput-b8sbLDPI.js +344 -0
- package/dist/FileInput.d.ts +56 -57
- package/dist/FileInput.js +7 -383
- package/dist/FormAssociatedMixin-Cc74LjbC.d.ts +22 -0
- package/dist/FormAssociatedMixin-DLPvFtbT.js +58 -0
- package/dist/Icon-C_yYuynf.js +186 -0
- package/dist/Icon-Op80LrrO.d.ts +151 -0
- package/dist/Icon.d.ts +2 -4
- package/dist/Icon.js +2 -188
- package/dist/Input-D2THgo7c.d.ts +169 -0
- package/dist/Input-DEOVocTa.js +610 -0
- package/dist/Input.d.ts +2 -166
- package/dist/Input.js +4 -626
- package/dist/LeuElement-BeFrgKes.js +46 -0
- package/dist/LeuElement-pJFU18Xm.d.ts +11 -0
- package/dist/Menu-BeqqtCw6.js +136 -0
- package/dist/Menu-CQdx1ef3.d.ts +43 -0
- package/dist/Menu.d.ts +2 -44
- package/dist/Menu.js +4 -157
- package/dist/MenuItem-DVg8-1Bq.js +219 -0
- package/dist/MenuItem-QcgnRk_7.d.ts +63 -0
- package/dist/MenuItem.d.ts +2 -64
- package/dist/MenuItem.js +3 -227
- package/dist/Message-BhknWvAF.js +252 -0
- package/dist/Message.d.ts +53 -53
- package/dist/Message.js +3 -267
- package/dist/Pagination-CqkHh-Vd.d.ts +76 -0
- package/dist/Pagination-DJI5MIi_.js +226 -0
- package/dist/Pagination.d.ts +2 -76
- package/dist/Pagination.js +7 -240
- package/dist/Placeholder-BJybFwSg.js +95 -0
- package/dist/Placeholder.d.ts +15 -15
- package/dist/Placeholder.js +2 -89
- package/dist/Popup-Btgm2a3D.d.ts +61 -0
- package/dist/Popup-DNlm_9AA.js +195 -0
- package/dist/Popup.d.ts +2 -62
- package/dist/Popup.js +2 -233
- package/dist/ProgressBar-B0wYj1KF.js +167 -0
- package/dist/ProgressBar.d.ts +21 -21
- package/dist/ProgressBar.js +2 -165
- package/dist/Radio-DMCL8c4D.js +160 -0
- package/dist/Radio.d.ts +22 -22
- package/dist/Radio.js +2 -151
- package/dist/RadioGroup-CM6IyBlq.js +171 -0
- package/dist/RadioGroup.d.ts +35 -35
- package/dist/RadioGroup.js +3 -182
- package/dist/Range-B72rtfln.js +496 -0
- package/dist/Range.d.ts +112 -112
- package/dist/Range.js +2 -586
- package/dist/ScrollTop-BFAqBVDR.js +130 -0
- package/dist/ScrollTop.d.ts +21 -21
- package/dist/ScrollTop.js +6 -134
- package/dist/Select-vxl3BvD4.js +618 -0
- package/dist/Select.d.ts +130 -132
- package/dist/Select.js +10 -675
- package/dist/Spinner-CrM1enM0.d.ts +14 -0
- package/dist/Spinner-DDTqijTO.js +56 -0
- package/dist/Spinner.d.ts +2 -14
- package/dist/Spinner.js +2 -52
- package/dist/Table-BgCxfBcm.js +392 -0
- package/dist/Table.d.ts +61 -63
- package/dist/Table.js +8 -427
- package/dist/Tag-DK2KkPIQ.js +76 -0
- package/dist/Tag.d.ts +8 -8
- package/dist/Tag.js +2 -74
- package/dist/VisuallyHidden-OeQvhxYn.d.ts +13 -0
- package/dist/VisuallyHidden-pll3amXE.js +29 -0
- package/dist/VisuallyHidden.d.ts +2 -13
- package/dist/VisuallyHidden.js +2 -25
- package/dist/decorate-DwpAc4D0.js +9 -0
- package/dist/hasSlotController-DSBCVzPD.js +38 -0
- package/dist/hasSlotController-DWPyZ52b.d.ts +19 -0
- package/dist/index.d.ts +33 -30
- package/dist/index.js +35 -45
- package/dist/leu-accordion.d.ts +7 -10
- package/dist/leu-accordion.js +4 -8
- package/dist/leu-button-group.d.ts +7 -10
- package/dist/leu-button-group.js +8 -12
- package/dist/leu-button.d.ts +7 -11
- package/dist/leu-button.js +7 -11
- package/dist/leu-chart-wrapper.d.ts +7 -12
- package/dist/leu-chart-wrapper.js +5 -9
- package/dist/leu-checkbox-group.d.ts +7 -10
- package/dist/leu-checkbox-group.js +7 -10
- package/dist/leu-checkbox.d.ts +7 -11
- package/dist/leu-checkbox.js +6 -8
- package/dist/leu-chip-group.d.ts +7 -12
- package/dist/leu-chip-group.js +5 -10
- package/dist/leu-chip-link.d.ts +7 -11
- package/dist/leu-chip-link.js +5 -8
- package/dist/leu-chip-removable.d.ts +7 -12
- package/dist/leu-chip-removable.js +6 -9
- package/dist/leu-chip-selectable.d.ts +7 -11
- package/dist/leu-chip-selectable.js +5 -8
- package/dist/leu-dialog.d.ts +7 -13
- package/dist/leu-dialog.js +5 -11
- package/dist/leu-dropdown.d.ts +7 -18
- package/dist/leu-dropdown.js +11 -17
- package/dist/leu-file-input.d.ts +7 -13
- package/dist/leu-file-input.js +9 -13
- package/dist/leu-icon.d.ts +7 -10
- package/dist/leu-icon.js +4 -7
- package/dist/leu-input.d.ts +7 -12
- package/dist/leu-input.js +6 -12
- package/dist/leu-menu-item.d.ts +7 -11
- package/dist/leu-menu-item.js +5 -9
- package/dist/leu-menu.d.ts +7 -12
- package/dist/leu-menu.js +6 -10
- package/dist/leu-message.d.ts +7 -11
- package/dist/leu-message.js +5 -10
- package/dist/leu-pagination.d.ts +7 -13
- package/dist/leu-pagination.js +9 -14
- package/dist/leu-placeholder.d.ts +7 -10
- package/dist/leu-placeholder.js +4 -5
- package/dist/leu-popup.d.ts +7 -11
- package/dist/leu-popup.js +4 -8
- package/dist/leu-progress-bar.d.ts +7 -10
- package/dist/leu-progress-bar.js +4 -8
- package/dist/leu-radio-group.d.ts +7 -10
- package/dist/leu-radio-group.js +5 -9
- package/dist/leu-radio.d.ts +7 -10
- package/dist/leu-radio.js +4 -7
- package/dist/leu-range.d.ts +7 -10
- package/dist/leu-range.js +4 -9
- package/dist/leu-scroll-top.d.ts +7 -12
- package/dist/leu-scroll-top.js +8 -13
- package/dist/leu-select.d.ts +7 -19
- package/dist/leu-select.js +12 -19
- package/dist/leu-spinner.d.ts +7 -10
- package/dist/leu-spinner.js +4 -5
- package/dist/leu-table.d.ts +7 -14
- package/dist/leu-table.js +10 -17
- package/dist/leu-tag.d.ts +7 -10
- package/dist/leu-tag.js +4 -7
- package/dist/leu-visually-hidden.d.ts +7 -10
- package/dist/leu-visually-hidden.js +4 -5
- package/dist/utils-hfk5Nwy8.js +28 -0
- package/dist/vscode.html-custom-data.json +7 -8
- package/dist/vue/index.d.ts +5 -9
- package/dist/web-types.json +18 -24
- package/eslint.config.mjs +79 -0
- package/package.json +44 -60
- package/scripts/generate-component/templates/stories/[name].stories.ts +1 -1
- package/src/components/accordion/Accordion.ts +1 -1
- package/src/components/button/Button.ts +76 -5
- package/src/components/button/button.css +37 -9
- package/src/components/button/stories/button.stories.ts +23 -0
- package/src/components/button/test/button.test.ts +214 -9
- package/src/components/button-group/ButtonGroup.ts +1 -6
- package/src/components/button-group/stories/button-group.stories.ts +1 -1
- package/src/components/chart-wrapper/ChartWrapper.ts +1 -1
- package/src/components/chart-wrapper/stories/chart-wrapper.stories.ts +1 -1
- package/src/components/checkbox/Checkbox.ts +76 -12
- package/src/components/checkbox/CheckboxGroup.ts +1 -1
- package/src/components/checkbox/checkbox.css +4 -0
- package/src/components/checkbox/stories/checkbox.stories.ts +26 -3
- package/src/components/checkbox/test/checkbox.test.ts +147 -3
- package/src/components/chip/Chip.ts +1 -1
- package/src/components/chip/ChipGroup.ts +2 -2
- package/src/components/chip/stories/chip-removable.stories.ts +1 -1
- package/src/components/chip/test/chip-removable.test.ts +2 -2
- package/src/components/dialog/Dialog.ts +1 -1
- package/src/components/dialog/stories/dialog.stories.ts +0 -2
- package/src/components/dropdown/Dropdown.ts +1 -1
- package/src/components/dropdown/stories/dropdown.stories.ts +1 -1
- package/src/components/file-input/FileInput.ts +18 -20
- package/src/components/file-input/stories/file-input.stories.ts +2 -2
- package/src/components/file-input/test/file-input.test.ts +14 -1
- package/src/components/icon/Icon.ts +1 -1
- package/src/components/input/Input.ts +18 -7
- package/src/components/input/stories/input.stories.ts +24 -21
- package/src/components/menu/Menu.ts +4 -4
- package/src/components/menu/MenuItem.ts +1 -1
- package/src/components/menu/stories/menu-item.stories.ts +0 -2
- package/src/components/message/Message.ts +1 -1
- package/src/components/message/stories/message.stories.ts +2 -2
- package/src/components/pagination/Pagination.ts +1 -1
- package/src/components/pagination/stories/pagination.stories.ts +3 -3
- package/src/components/pagination/test/pagination.test.ts +1 -1
- package/src/components/placeholder/Placeholder.ts +1 -1
- package/src/components/placeholder/stories/placeholder.stories.ts +1 -1
- package/src/components/popup/Popup.ts +1 -1
- package/src/components/progress-bar/ProgressBar.ts +1 -1
- package/src/components/progress-bar/stories/progress-bar.stories.ts +1 -1
- package/src/components/radio/Radio.ts +1 -1
- package/src/components/radio/RadioGroup.ts +5 -5
- package/src/components/range/Range.ts +1 -1
- package/src/components/range/stories/range.stories.ts +2 -2
- package/src/components/scroll-top/ScrollTop.ts +1 -1
- package/src/components/select/Select.ts +2 -5
- package/src/components/spinner/Spinner.ts +1 -1
- package/src/components/table/Table.ts +1 -1
- package/src/components/tag/Tag.ts +1 -1
- package/src/components/tag/stories/tag.stories.ts +1 -1
- package/src/components/visually-hidden/VisuallyHidden.ts +1 -1
- package/src/docs/contributing.mdx +1 -1
- package/src/docs/installation.mdx +1 -1
- package/src/docs/theme.mdx +1 -1
- package/src/docs/usage.mdx +1 -1
- package/src/global.d.ts +1 -1
- package/src/lib/LeuElement.ts +1 -1
- package/src/lib/mixins/FormAssociatedMixin.ts +115 -0
- package/src/lib/styleMap.ts +1 -1
- package/tsdown.config.ts +35 -0
- package/web-test-runner.config.mjs +20 -2
- package/.eslintrc.json +0 -57
- package/dist/Icon.d-itcQ94ym.d.ts +0 -151
- package/dist/LeuElement-BfXSO7MN.js +0 -42
- package/dist/LeuElement.d-BevHqLUu.d.ts +0 -10
- package/dist/_tslib-CNEFicEt.js +0 -30
- package/dist/components/accordion/Accordion.d.ts +0 -49
- package/dist/components/accordion/Accordion.d.ts.map +0 -1
- package/dist/components/accordion/leu-accordion.d.ts +0 -8
- package/dist/components/accordion/leu-accordion.d.ts.map +0 -1
- package/dist/components/accordion/stories/accordion.stories.d.ts +0 -26
- package/dist/components/accordion/stories/accordion.stories.d.ts.map +0 -1
- package/dist/components/accordion/test/accordion.test.d.ts +0 -2
- package/dist/components/accordion/test/accordion.test.d.ts.map +0 -1
- package/dist/components/button/Button.d.ts +0 -81
- package/dist/components/button/Button.d.ts.map +0 -1
- package/dist/components/button/leu-button.d.ts +0 -8
- package/dist/components/button/leu-button.d.ts.map +0 -1
- package/dist/components/button/stories/button.stories.d.ts +0 -19
- package/dist/components/button/stories/button.stories.d.ts.map +0 -1
- package/dist/components/button/test/button.test.d.ts +0 -3
- package/dist/components/button/test/button.test.d.ts.map +0 -1
- package/dist/components/button-group/ButtonGroup.d.ts +0 -25
- package/dist/components/button-group/ButtonGroup.d.ts.map +0 -1
- package/dist/components/button-group/leu-button-group.d.ts +0 -8
- package/dist/components/button-group/leu-button-group.d.ts.map +0 -1
- package/dist/components/button-group/stories/button-group.stories.d.ts +0 -15
- package/dist/components/button-group/stories/button-group.stories.d.ts.map +0 -1
- package/dist/components/button-group/test/button-group.test.d.ts +0 -3
- package/dist/components/button-group/test/button-group.test.d.ts.map +0 -1
- package/dist/components/chart-wrapper/ChartWrapper.d.ts +0 -34
- package/dist/components/chart-wrapper/ChartWrapper.d.ts.map +0 -1
- package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts +0 -8
- package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts.map +0 -1
- package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts +0 -47
- package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts.map +0 -1
- package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts +0 -2
- package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts.map +0 -1
- package/dist/components/checkbox/Checkbox.d.ts +0 -28
- package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/CheckboxGroup.d.ts +0 -22
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +0 -1
- package/dist/components/checkbox/leu-checkbox-group.d.ts +0 -8
- package/dist/components/checkbox/leu-checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox/leu-checkbox.d.ts +0 -8
- package/dist/components/checkbox/leu-checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts +0 -29
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts.map +0 -1
- package/dist/components/checkbox/stories/checkbox.stories.d.ts +0 -22
- package/dist/components/checkbox/stories/checkbox.stories.d.ts.map +0 -1
- package/dist/components/checkbox/test/checkbox-group.test.d.ts +0 -3
- package/dist/components/checkbox/test/checkbox-group.test.d.ts.map +0 -1
- package/dist/components/checkbox/test/checkbox.test.d.ts +0 -2
- package/dist/components/checkbox/test/checkbox.test.d.ts.map +0 -1
- package/dist/components/chip/Chip.d.ts +0 -15
- package/dist/components/chip/Chip.d.ts.map +0 -1
- package/dist/components/chip/ChipGroup.d.ts +0 -38
- package/dist/components/chip/ChipGroup.d.ts.map +0 -1
- package/dist/components/chip/ChipLink.d.ts +0 -13
- package/dist/components/chip/ChipLink.d.ts.map +0 -1
- package/dist/components/chip/ChipRemovable.d.ts +0 -21
- package/dist/components/chip/ChipRemovable.d.ts.map +0 -1
- package/dist/components/chip/ChipSelectable.d.ts +0 -28
- package/dist/components/chip/ChipSelectable.d.ts.map +0 -1
- package/dist/components/chip/exports.d.ts +0 -5
- package/dist/components/chip/exports.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-group.d.ts +0 -8
- package/dist/components/chip/leu-chip-group.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-link.d.ts +0 -8
- package/dist/components/chip/leu-chip-link.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-removable.d.ts +0 -8
- package/dist/components/chip/leu-chip-removable.d.ts.map +0 -1
- package/dist/components/chip/leu-chip-selectable.d.ts +0 -8
- package/dist/components/chip/leu-chip-selectable.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-group.stories.d.ts +0 -40
- package/dist/components/chip/stories/chip-group.stories.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-link.stories.d.ts +0 -27
- package/dist/components/chip/stories/chip-link.stories.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-removable.stories.d.ts +0 -21
- package/dist/components/chip/stories/chip-removable.stories.d.ts.map +0 -1
- package/dist/components/chip/stories/chip-selectable.stories.d.ts +0 -35
- package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +0 -1
- package/dist/components/chip/test/chip-group.test.d.ts +0 -4
- package/dist/components/chip/test/chip-group.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip-link.test.d.ts +0 -2
- package/dist/components/chip/test/chip-link.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip-removable.test.d.ts +0 -2
- package/dist/components/chip/test/chip-removable.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip-selectable.test.d.ts +0 -2
- package/dist/components/chip/test/chip-selectable.test.d.ts.map +0 -1
- package/dist/components/chip/test/chip.test.d.ts +0 -2
- package/dist/components/chip/test/chip.test.d.ts.map +0 -1
- package/dist/components/dialog/Dialog.d.ts +0 -29
- package/dist/components/dialog/Dialog.d.ts.map +0 -1
- package/dist/components/dialog/leu-dialog.d.ts +0 -8
- package/dist/components/dialog/leu-dialog.d.ts.map +0 -1
- package/dist/components/dialog/stories/dialog.stories.d.ts +0 -19
- package/dist/components/dialog/stories/dialog.stories.d.ts.map +0 -1
- package/dist/components/dialog/test/dialog.test.d.ts +0 -2
- package/dist/components/dialog/test/dialog.test.d.ts.map +0 -1
- package/dist/components/dropdown/Dropdown.d.ts +0 -40
- package/dist/components/dropdown/Dropdown.d.ts.map +0 -1
- package/dist/components/dropdown/leu-dropdown.d.ts +0 -8
- package/dist/components/dropdown/leu-dropdown.d.ts.map +0 -1
- package/dist/components/dropdown/stories/dropdown.stories.d.ts +0 -25
- package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +0 -1
- package/dist/components/dropdown/test/dropdown.test.d.ts +0 -2
- package/dist/components/dropdown/test/dropdown.test.d.ts.map +0 -1
- package/dist/components/file-input/FileInput.d.ts +0 -62
- package/dist/components/file-input/FileInput.d.ts.map +0 -1
- package/dist/components/file-input/leu-file-input.d.ts +0 -8
- package/dist/components/file-input/leu-file-input.d.ts.map +0 -1
- package/dist/components/file-input/stories/file-input.stories.d.ts +0 -34
- package/dist/components/file-input/stories/file-input.stories.d.ts.map +0 -1
- package/dist/components/file-input/test/file-input.test.d.ts +0 -2
- package/dist/components/file-input/test/file-input.test.d.ts.map +0 -1
- package/dist/components/icon/Icon.d.ts +0 -20
- package/dist/components/icon/Icon.d.ts.map +0 -1
- package/dist/components/icon/leu-icon.d.ts +0 -8
- package/dist/components/icon/leu-icon.d.ts.map +0 -1
- package/dist/components/icon/paths.d.ts +0 -127
- package/dist/components/icon/paths.d.ts.map +0 -1
- package/dist/components/icon/stories/icon.stories.d.ts +0 -32
- package/dist/components/icon/stories/icon.stories.d.ts.map +0 -1
- package/dist/components/icon/test/icon.test.d.ts +0 -2
- package/dist/components/icon/test/icon.test.d.ts.map +0 -1
- package/dist/components/input/Input.d.ts +0 -163
- package/dist/components/input/Input.d.ts.map +0 -1
- package/dist/components/input/leu-input.d.ts +0 -8
- package/dist/components/input/leu-input.d.ts.map +0 -1
- package/dist/components/input/stories/input.stories.d.ts +0 -35
- package/dist/components/input/stories/input.stories.d.ts.map +0 -1
- package/dist/components/input/test/input.test.d.ts +0 -2
- package/dist/components/input/test/input.test.d.ts.map +0 -1
- package/dist/components/menu/Menu.d.ts +0 -39
- package/dist/components/menu/Menu.d.ts.map +0 -1
- package/dist/components/menu/MenuItem.d.ts +0 -61
- package/dist/components/menu/MenuItem.d.ts.map +0 -1
- package/dist/components/menu/leu-menu-item.d.ts +0 -8
- package/dist/components/menu/leu-menu-item.d.ts.map +0 -1
- package/dist/components/menu/leu-menu.d.ts +0 -8
- package/dist/components/menu/leu-menu.d.ts.map +0 -1
- package/dist/components/menu/stories/menu-item.stories.d.ts +0 -24
- package/dist/components/menu/stories/menu-item.stories.d.ts.map +0 -1
- package/dist/components/menu/stories/menu.stories.d.ts +0 -26
- package/dist/components/menu/stories/menu.stories.d.ts.map +0 -1
- package/dist/components/menu/test/menu-item.test.d.ts +0 -3
- package/dist/components/menu/test/menu-item.test.d.ts.map +0 -1
- package/dist/components/menu/test/menu.test.d.ts +0 -4
- package/dist/components/menu/test/menu.test.d.ts.map +0 -1
- package/dist/components/message/Message.d.ts +0 -59
- package/dist/components/message/Message.d.ts.map +0 -1
- package/dist/components/message/leu-message.d.ts +0 -8
- package/dist/components/message/leu-message.d.ts.map +0 -1
- package/dist/components/message/stories/message.stories.d.ts +0 -179
- package/dist/components/message/stories/message.stories.d.ts.map +0 -1
- package/dist/components/message/test/message.test.d.ts +0 -2
- package/dist/components/message/test/message.test.d.ts.map +0 -1
- package/dist/components/pagination/Pagination.d.ts +0 -72
- package/dist/components/pagination/Pagination.d.ts.map +0 -1
- package/dist/components/pagination/leu-pagination.d.ts +0 -8
- package/dist/components/pagination/leu-pagination.d.ts.map +0 -1
- package/dist/components/pagination/stories/pagination.stories.d.ts +0 -25
- package/dist/components/pagination/stories/pagination.stories.d.ts.map +0 -1
- package/dist/components/pagination/test/pagination.test.d.ts +0 -2
- package/dist/components/pagination/test/pagination.test.d.ts.map +0 -1
- package/dist/components/placeholder/Placeholder.d.ts +0 -23
- package/dist/components/placeholder/Placeholder.d.ts.map +0 -1
- package/dist/components/placeholder/leu-placeholder.d.ts +0 -8
- package/dist/components/placeholder/leu-placeholder.d.ts.map +0 -1
- package/dist/components/placeholder/stories/placeholder.stories.d.ts +0 -27
- package/dist/components/placeholder/stories/placeholder.stories.d.ts.map +0 -1
- package/dist/components/placeholder/test/placeholder.test.d.ts +0 -2
- package/dist/components/placeholder/test/placeholder.test.d.ts.map +0 -1
- package/dist/components/popup/Popup.d.ts +0 -57
- package/dist/components/popup/Popup.d.ts.map +0 -1
- package/dist/components/popup/leu-popup.d.ts +0 -8
- package/dist/components/popup/leu-popup.d.ts.map +0 -1
- package/dist/components/popup/stories/popup.stories.d.ts +0 -28
- package/dist/components/popup/stories/popup.stories.d.ts.map +0 -1
- package/dist/components/popup/test/popup.test.d.ts +0 -2
- package/dist/components/popup/test/popup.test.d.ts.map +0 -1
- package/dist/components/progress-bar/ProgressBar.d.ts +0 -25
- package/dist/components/progress-bar/ProgressBar.d.ts.map +0 -1
- package/dist/components/progress-bar/leu-progress-bar.d.ts +0 -8
- package/dist/components/progress-bar/leu-progress-bar.d.ts.map +0 -1
- package/dist/components/progress-bar/stories/progress-bar.stories.d.ts +0 -48
- package/dist/components/progress-bar/stories/progress-bar.stories.d.ts.map +0 -1
- package/dist/components/progress-bar/test/progress-bar.test.d.ts +0 -2
- package/dist/components/progress-bar/test/progress-bar.test.d.ts.map +0 -1
- package/dist/components/radio/Radio.d.ts +0 -24
- package/dist/components/radio/Radio.d.ts.map +0 -1
- package/dist/components/radio/RadioGroup.d.ts +0 -39
- package/dist/components/radio/RadioGroup.d.ts.map +0 -1
- package/dist/components/radio/leu-radio-group.d.ts +0 -8
- package/dist/components/radio/leu-radio-group.d.ts.map +0 -1
- package/dist/components/radio/leu-radio.d.ts +0 -8
- package/dist/components/radio/leu-radio.d.ts.map +0 -1
- package/dist/components/radio/stories/radio-group.stories.d.ts +0 -29
- package/dist/components/radio/stories/radio-group.stories.d.ts.map +0 -1
- package/dist/components/radio/stories/radio.stories.d.ts +0 -22
- package/dist/components/radio/stories/radio.stories.d.ts.map +0 -1
- package/dist/components/radio/test/radio-group.test.d.ts +0 -3
- package/dist/components/radio/test/radio-group.test.d.ts.map +0 -1
- package/dist/components/radio/test/radio.test.d.ts +0 -2
- package/dist/components/radio/test/radio.test.d.ts.map +0 -1
- package/dist/components/range/Range.d.ts +0 -116
- package/dist/components/range/Range.d.ts.map +0 -1
- package/dist/components/range/leu-range.d.ts +0 -8
- package/dist/components/range/leu-range.d.ts.map +0 -1
- package/dist/components/range/stories/range.stories.d.ts +0 -231
- package/dist/components/range/stories/range.stories.d.ts.map +0 -1
- package/dist/components/range/test/range.test.d.ts +0 -2
- package/dist/components/range/test/range.test.d.ts.map +0 -1
- package/dist/components/scroll-top/ScrollTop.d.ts +0 -23
- package/dist/components/scroll-top/ScrollTop.d.ts.map +0 -1
- package/dist/components/scroll-top/leu-scroll-top.d.ts +0 -8
- package/dist/components/scroll-top/leu-scroll-top.d.ts.map +0 -1
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts +0 -8
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts.map +0 -1
- package/dist/components/scroll-top/test/scroll-top.test.d.ts +0 -2
- package/dist/components/scroll-top/test/scroll-top.test.d.ts.map +0 -1
- package/dist/components/select/Select.d.ts +0 -145
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/leu-select.d.ts +0 -8
- package/dist/components/select/leu-select.d.ts.map +0 -1
- package/dist/components/select/stories/select.stories.d.ts +0 -23
- package/dist/components/select/stories/select.stories.d.ts.map +0 -1
- package/dist/components/select/test/fixtures.d.ts +0 -2
- package/dist/components/select/test/fixtures.d.ts.map +0 -1
- package/dist/components/select/test/select.test.d.ts +0 -3
- package/dist/components/select/test/select.test.d.ts.map +0 -1
- package/dist/components/spinner/Spinner.d.ts +0 -10
- package/dist/components/spinner/Spinner.d.ts.map +0 -1
- package/dist/components/spinner/leu-spinner.d.ts +0 -8
- package/dist/components/spinner/leu-spinner.d.ts.map +0 -1
- package/dist/components/spinner/stories/spinner.stories.d.ts +0 -16
- package/dist/components/spinner/stories/spinner.stories.d.ts.map +0 -1
- package/dist/components/spinner/test/spinner.test.d.ts +0 -2
- package/dist/components/spinner/test/spinner.test.d.ts.map +0 -1
- package/dist/components/table/Table.d.ts +0 -65
- package/dist/components/table/Table.d.ts.map +0 -1
- package/dist/components/table/leu-table.d.ts +0 -8
- package/dist/components/table/leu-table.d.ts.map +0 -1
- package/dist/components/table/stories/table.stories.d.ts +0 -15
- package/dist/components/table/stories/table.stories.d.ts.map +0 -1
- package/dist/components/table/test/table.test.d.ts +0 -2
- package/dist/components/table/test/table.test.d.ts.map +0 -1
- package/dist/components/tag/Tag.d.ts +0 -13
- package/dist/components/tag/Tag.d.ts.map +0 -1
- package/dist/components/tag/leu-tag.d.ts +0 -8
- package/dist/components/tag/leu-tag.d.ts.map +0 -1
- package/dist/components/tag/stories/tag.stories.d.ts +0 -136
- package/dist/components/tag/stories/tag.stories.d.ts.map +0 -1
- package/dist/components/tag/test/tag.test.d.ts +0 -2
- package/dist/components/tag/test/tag.test.d.ts.map +0 -1
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +0 -9
- package/dist/components/visually-hidden/VisuallyHidden.d.ts.map +0 -1
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts +0 -8
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts.map +0 -1
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts +0 -13
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts.map +0 -1
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts +0 -2
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts.map +0 -1
- package/dist/hasSlotController-Bm2tipvG.js +0 -53
- package/dist/hasSlotController.d-emXwVXWF.d.ts +0 -23
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/LeuElement.d.ts +0 -8
- package/dist/lib/LeuElement.d.ts.map +0 -1
- package/dist/lib/a11y.d.ts +0 -11
- package/dist/lib/a11y.d.ts.map +0 -1
- package/dist/lib/hasSlotController.d.ts +0 -20
- package/dist/lib/hasSlotController.d.ts.map +0 -1
- package/dist/lib/styleMap.d.ts +0 -61
- package/dist/lib/styleMap.d.ts.map +0 -1
- package/dist/lib/utils.d.ts +0 -23
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/styles/style.stories.d.ts +0 -6
- package/dist/styles/style.stories.d.ts.map +0 -1
- package/dist/utils-DBGsNSJW.js +0 -33
- package/rollup.config.js +0 -94
- package/web-dev-server.config.mjs +0 -30
package/dist/Button.js
CHANGED
|
@@ -1,505 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { LeuIcon } from './Icon.js';
|
|
7
|
-
import { L as LeuElement } from './LeuElement-BfXSO7MN.js';
|
|
8
|
-
import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* All roles that are associated with a aria-checked attribute
|
|
12
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
|
|
13
|
-
*/
|
|
14
|
-
const ARIA_CHECKED_ROLES = [
|
|
15
|
-
"checkbox",
|
|
16
|
-
"menuitemcheckbox",
|
|
17
|
-
"menuitemradio",
|
|
18
|
-
"option",
|
|
19
|
-
"radio",
|
|
20
|
-
"switch",
|
|
21
|
-
];
|
|
22
|
-
/**
|
|
23
|
-
* All roles that are associated with a aria-selected attribute
|
|
24
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
|
|
25
|
-
*/
|
|
26
|
-
const ARIA_SELECTED_ROLES = [
|
|
27
|
-
"gridcell",
|
|
28
|
-
"option",
|
|
29
|
-
"row",
|
|
30
|
-
"tab",
|
|
31
|
-
"columnheader",
|
|
32
|
-
"rowheader",
|
|
33
|
-
"treeitem",
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
var css_248z = css`:host {
|
|
37
|
-
display: inline-block;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
button {
|
|
41
|
-
font-family: var(--leu-font-family-black);
|
|
42
|
-
text-align: center;
|
|
43
|
-
-webkit-appearance: none;
|
|
44
|
-
-moz-appearance: none;
|
|
45
|
-
appearance: none;
|
|
46
|
-
transition: background 0.1s ease;
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
border: none;
|
|
49
|
-
border-radius: 2px;
|
|
50
|
-
|
|
51
|
-
max-width: 100%;
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
-moz-column-gap: 8px;
|
|
55
|
-
column-gap: 8px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.content {
|
|
59
|
-
flex: 1 1 0;
|
|
60
|
-
overflow: hidden;
|
|
61
|
-
text-overflow: ellipsis;
|
|
62
|
-
white-space: nowrap;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
button.round {
|
|
66
|
-
border-radius: 50%;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
button:disabled {
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
button:focus-visible {
|
|
74
|
-
outline: 2px solid var(--leu-color-func-cyan);
|
|
75
|
-
outline-offset: 2px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
button.inverted:focus-visible {
|
|
79
|
-
outline: 2px solid var(--leu-color-black-0);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
:host([fluid]) button {
|
|
83
|
-
width: 100%;
|
|
84
|
-
justify-content: center;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* size - regular */
|
|
88
|
-
|
|
89
|
-
button.regular {
|
|
90
|
-
padding: 12px 24px;
|
|
91
|
-
font-size: 16px;
|
|
92
|
-
line-height: 24px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
button.regular.icon-only {
|
|
96
|
-
padding: 12px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* size - small */
|
|
100
|
-
|
|
101
|
-
button.small {
|
|
102
|
-
padding: 6px 24px;
|
|
103
|
-
font-size: 14px;
|
|
104
|
-
line-height: 20px;
|
|
105
|
-
|
|
106
|
-
--leu-icon-size: 1rem;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
button.small.icon-only {
|
|
110
|
-
padding: 8px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* primary */
|
|
114
|
-
|
|
115
|
-
button.primary {
|
|
116
|
-
color: var(--leu-color-black-0);
|
|
117
|
-
background: var(--leu-color-black-100);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
button.primary:hover {
|
|
121
|
-
color: var(--leu-color-black-0);
|
|
122
|
-
background: var(--leu-color-black-transp-80);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
button.primary.active {
|
|
126
|
-
color: var(--leu-color-black-0);
|
|
127
|
-
background: var(--leu-color-black-100);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
button.primary.active:hover {
|
|
131
|
-
background: var(--leu-color-black-transp-80);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
button.primary:disabled {
|
|
135
|
-
color: var(--leu-color-black-0);
|
|
136
|
-
background: var(--leu-color-black-transp-20);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* secondary */
|
|
140
|
-
|
|
141
|
-
button.secondary {
|
|
142
|
-
color: var(--leu-color-black-transp-60);
|
|
143
|
-
background: var(--leu-color-black-transp-10);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
button.secondary:hover {
|
|
147
|
-
color: var(--leu-color-black-100);
|
|
148
|
-
background: var(--leu-color-black-transp-20);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
button.secondary.active {
|
|
152
|
-
color: var(--leu-color-black-0);
|
|
153
|
-
background: var(--leu-color-black-100);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
button.secondary.active:hover {
|
|
157
|
-
background: var(--leu-color-black-transp-80);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
button.secondary:disabled {
|
|
161
|
-
color: var(--leu-color-black-transp-20);
|
|
162
|
-
background: var(--leu-color-black-transp-5);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/* ghost */
|
|
166
|
-
|
|
167
|
-
button.ghost {
|
|
168
|
-
--leu-icon-size: 1rem;
|
|
169
|
-
|
|
170
|
-
background: transparent;
|
|
171
|
-
padding: 0 0.5rem;
|
|
172
|
-
color: var(--leu-color-black-60);
|
|
173
|
-
font-family: var(--leu-font-family-regular);
|
|
174
|
-
height: 2rem;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
button.ghost:hover {
|
|
178
|
-
color: var(--leu-color-black-100);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
button.ghost.active {
|
|
182
|
-
color: var(--leu-color-black-100);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
button.ghost:disabled {
|
|
186
|
-
color: var(--leu-color-black-20);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* primary + inverted */
|
|
190
|
-
|
|
191
|
-
button.primary.inverted {
|
|
192
|
-
color: var(--leu-color-black-100);
|
|
193
|
-
background: var(--leu-color-black-0);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
button.primary.inverted:hover {
|
|
197
|
-
color: var(--leu-color-black-100);
|
|
198
|
-
background: var(--leu-color-white-transp-70);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
button.primary.inverted.active {
|
|
202
|
-
color: var(--leu-color-black-0);
|
|
203
|
-
background: var(--leu-color-black-100);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
button.primary.inverted:disabled {
|
|
207
|
-
color: var(--leu-color-black-40);
|
|
208
|
-
background: var(--leu-color-white-transp-70);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/* secondary + inverted */
|
|
212
|
-
|
|
213
|
-
button.secondary.inverted {
|
|
214
|
-
color: var(--leu-color-black-0);
|
|
215
|
-
background: var(--leu-color-black-transp-20);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
button.secondary.inverted:hover {
|
|
219
|
-
color: var(--leu-color-black-0);
|
|
220
|
-
background: var(--leu-color-black-transp-40);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
button.secondary.inverted.active {
|
|
224
|
-
color: var(--leu-color-black-100);
|
|
225
|
-
background: var(--leu-color-black-0);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
button.secondary.inverted:disabled {
|
|
229
|
-
color: var(--leu-color-white-transp-70);
|
|
230
|
-
background: var(--leu-color-black-transp-10);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/* ghost + inverted */
|
|
234
|
-
|
|
235
|
-
button.ghost.inverted {
|
|
236
|
-
color: var(--leu-color-black-0);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
button.ghost.inverted:hover {
|
|
240
|
-
color: var(--leu-color-white-transp-70);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
button.ghost.inverted.active {
|
|
244
|
-
color: var(--leu-color-black-0);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
button.ghost.inverted:disabled {
|
|
248
|
-
color: var(--leu-color-black-20);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/* icon-wrapper */
|
|
252
|
-
|
|
253
|
-
.icon-wrapper leu-icon {
|
|
254
|
-
display: block;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.icon-wrapper {
|
|
258
|
-
display: none;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.icon-before .icon-wrapper--before,
|
|
262
|
-
.icon-after .icon-wrapper--after {
|
|
263
|
-
display: block;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
.ghost .icon-wrapper {
|
|
267
|
-
position: relative;
|
|
268
|
-
width: 2rem;
|
|
269
|
-
padding: 0 0.5rem;
|
|
270
|
-
--_bg: var(--leu-color-black-transp-10);
|
|
271
|
-
--_color: currentcolor;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.ghost .icon-wrapper__slot {
|
|
275
|
-
display: block;
|
|
276
|
-
position: relative;
|
|
277
|
-
z-index: 1;
|
|
278
|
-
color: var(--_color);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.ghost .icon-wrapper::before {
|
|
282
|
-
content: "";
|
|
283
|
-
position: absolute;
|
|
284
|
-
z-index: 0;
|
|
285
|
-
left: 0;
|
|
286
|
-
top: -0.5rem;
|
|
287
|
-
|
|
288
|
-
width: 2rem;
|
|
289
|
-
aspect-ratio: 1;
|
|
290
|
-
border-radius: 50%;
|
|
291
|
-
background: var(--_bg);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.ghost.active .icon-wrapper {
|
|
295
|
-
--_bg: var(--leu-color-black-100);
|
|
296
|
-
--_color: var(--leu-color-black-0);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.ghost:disabled .icon-wrapper {
|
|
300
|
-
--_bg: var(--leu-color-black-transp-5);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/* inverted */
|
|
304
|
-
|
|
305
|
-
.ghost.inverted .icon-wrapper {
|
|
306
|
-
--_bg: var(--leu-color-black-transp-20);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.ghost.inverted:hover .icon-wrapper {
|
|
310
|
-
--_bg: var(--leu-color-black-transp-40);
|
|
311
|
-
--_color: var(--leu-color-black-0);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
.ghost.inverted:disabled .icon-wrapper {
|
|
315
|
-
--_bg: var(--leu-color-black-transp-20);
|
|
316
|
-
--_color: var(--leu-color-white-transp-70);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
.ghost.active.inverted .icon-wrapper {
|
|
320
|
-
--_bg: var(--leu-color-black-0);
|
|
321
|
-
--_color: var(--leu-color-black-100);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/* Expanded icon */
|
|
325
|
-
|
|
326
|
-
.icon-expanded leu-icon {
|
|
327
|
-
display: block;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.icon-expanded {
|
|
331
|
-
transition: transform 0.1s ease;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
:host([expanded="true"]) .icon-expanded {
|
|
335
|
-
transform: rotate(180deg);
|
|
336
|
-
}
|
|
337
|
-
`;
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* @tagname leu-button
|
|
341
|
-
* @slot before - The icon to display before the label
|
|
342
|
-
* @slot after - The icon to display after the label
|
|
343
|
-
* @slot - The label of the button or the icon if no label is set
|
|
344
|
-
* @see https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=4-1444&mode=design&t=xu5Vii8jXKKCKDez-0
|
|
345
|
-
*/
|
|
346
|
-
class LeuButton extends LeuElement {
|
|
347
|
-
constructor() {
|
|
348
|
-
super(...arguments);
|
|
349
|
-
this.hasSlotController = new HasSlotController(this, [
|
|
350
|
-
"before",
|
|
351
|
-
"after",
|
|
352
|
-
"[default]",
|
|
353
|
-
]);
|
|
354
|
-
/**
|
|
355
|
-
* `aria-label` of the underlying button elements.
|
|
356
|
-
* Use it to provide a label when only an icon is visible.
|
|
357
|
-
*/
|
|
358
|
-
this.label = null;
|
|
359
|
-
/**
|
|
360
|
-
* The size of the button.
|
|
361
|
-
*/
|
|
362
|
-
this.size = "regular";
|
|
363
|
-
/**
|
|
364
|
-
* The visual variant of the button.
|
|
365
|
-
*/
|
|
366
|
-
this.variant = "primary";
|
|
367
|
-
/**
|
|
368
|
-
* The `type` of the underlying button element.
|
|
369
|
-
*/
|
|
370
|
-
this.type = "button";
|
|
371
|
-
/**
|
|
372
|
-
* Whether the button is disabled or not.
|
|
373
|
-
* @type {boolean}
|
|
374
|
-
*/
|
|
375
|
-
this.disabled = false;
|
|
376
|
-
/**
|
|
377
|
-
* Whether the button should be round.
|
|
378
|
-
* Can only be applied when the button contains an icon without a visible label.
|
|
379
|
-
* @type {boolean}
|
|
380
|
-
*/
|
|
381
|
-
this.round = false;
|
|
382
|
-
/**
|
|
383
|
-
* Whether the button is active or not.
|
|
384
|
-
* Depending on the `componentRole`, it applies `aria-checked` or `aria-selected` to the underlying button element.
|
|
385
|
-
*/
|
|
386
|
-
this.active = false;
|
|
387
|
-
/**
|
|
388
|
-
* Wheter the colors should be inverted. For use on dark backgrounds.
|
|
389
|
-
*/
|
|
390
|
-
this.inverted = false;
|
|
391
|
-
/**
|
|
392
|
-
* Alters the shape of the button to be full width of its parent container
|
|
393
|
-
*/
|
|
394
|
-
this.fluid = false;
|
|
395
|
-
}
|
|
396
|
-
renderExpandingIcon() {
|
|
397
|
-
if (typeof this.expanded !== "undefined" && this.variant === "ghost") {
|
|
398
|
-
return html `<div class="icon-expanded">
|
|
399
|
-
<leu-icon name="angleDropDown" size="24"></leu-icon>
|
|
400
|
-
</div>`;
|
|
401
|
-
}
|
|
402
|
-
return nothing;
|
|
403
|
-
}
|
|
404
|
-
getAriaAttributes() {
|
|
405
|
-
const attributes = {
|
|
406
|
-
role: this.componentRole,
|
|
407
|
-
label: this.label,
|
|
408
|
-
};
|
|
409
|
-
// TODO: checked and selected roles are not mutually exclusive
|
|
410
|
-
if (this.componentRole) {
|
|
411
|
-
if (ARIA_CHECKED_ROLES.includes(this.componentRole)) {
|
|
412
|
-
attributes.checked = this.active ? "true" : "false";
|
|
413
|
-
}
|
|
414
|
-
else if (ARIA_SELECTED_ROLES.includes(this.componentRole)) {
|
|
415
|
-
attributes.selected = this.active ? "true" : "false";
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
return attributes;
|
|
419
|
-
}
|
|
420
|
-
hasTextContent() {
|
|
421
|
-
return Array.from(this.childNodes).some((node) => node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "");
|
|
422
|
-
}
|
|
423
|
-
render() {
|
|
424
|
-
const hasTextContent = this.hasTextContent();
|
|
425
|
-
const hasIconDefault = Boolean(this.querySelector("leu-icon"));
|
|
426
|
-
const hasIconBefore = this.hasSlotController.test("before");
|
|
427
|
-
const hasIconAfter = this.hasSlotController.test("after");
|
|
428
|
-
const aria = this.getAriaAttributes();
|
|
429
|
-
const cssClasses = {
|
|
430
|
-
"icon-only": hasIconDefault && !hasTextContent,
|
|
431
|
-
"icon-before": hasIconBefore,
|
|
432
|
-
"icon-after": hasIconAfter,
|
|
433
|
-
round: this.round,
|
|
434
|
-
active: this.active,
|
|
435
|
-
inverted: this.inverted,
|
|
436
|
-
[this.variant]: true,
|
|
437
|
-
[this.size]: true,
|
|
438
|
-
};
|
|
439
|
-
return html `
|
|
440
|
-
<button
|
|
441
|
-
aria-label=${ifDefined(aria.label)}
|
|
442
|
-
aria-selected=${ifDefined(aria.selected)}
|
|
443
|
-
aria-checked=${ifDefined(aria.checked)}
|
|
444
|
-
aria-expanded=${ifDefined(this.expanded)}
|
|
445
|
-
role=${ifDefined(aria.role)}
|
|
446
|
-
class=${classMap(cssClasses)}
|
|
447
|
-
?disabled=${this.disabled}
|
|
448
|
-
type=${this.type}
|
|
449
|
-
>
|
|
450
|
-
<div class="icon-wrapper icon-wrapper--before">
|
|
451
|
-
<slot name="before" class="icon-wrapper__slot"></slot>
|
|
452
|
-
</div>
|
|
453
|
-
<span class="content"><slot></slot></span>
|
|
454
|
-
<div class="icon-wrapper icon-wrapper--after">
|
|
455
|
-
<slot name="after" class="icon-wrapper__slot"></slot>
|
|
456
|
-
</div>
|
|
457
|
-
|
|
458
|
-
${this.renderExpandingIcon()}
|
|
459
|
-
</button>
|
|
460
|
-
`;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
LeuButton.dependencies = {
|
|
464
|
-
"leu-icon": LeuIcon,
|
|
465
|
-
};
|
|
466
|
-
LeuButton.styles = [LeuElement.styles, css_248z];
|
|
467
|
-
LeuButton.shadowRootOptions = {
|
|
468
|
-
...LeuElement.shadowRootOptions,
|
|
469
|
-
delegatesFocus: true,
|
|
470
|
-
};
|
|
471
|
-
__decorate([
|
|
472
|
-
property({ type: String, reflect: true })
|
|
473
|
-
], LeuButton.prototype, "label", void 0);
|
|
474
|
-
__decorate([
|
|
475
|
-
property({ type: String, reflect: true })
|
|
476
|
-
], LeuButton.prototype, "size", void 0);
|
|
477
|
-
__decorate([
|
|
478
|
-
property({ type: String, reflect: true })
|
|
479
|
-
], LeuButton.prototype, "variant", void 0);
|
|
480
|
-
__decorate([
|
|
481
|
-
property({ type: String, reflect: true })
|
|
482
|
-
], LeuButton.prototype, "type", void 0);
|
|
483
|
-
__decorate([
|
|
484
|
-
property({ type: String, reflect: true })
|
|
485
|
-
], LeuButton.prototype, "componentRole", void 0);
|
|
486
|
-
__decorate([
|
|
487
|
-
property({ type: Boolean, reflect: true })
|
|
488
|
-
], LeuButton.prototype, "disabled", void 0);
|
|
489
|
-
__decorate([
|
|
490
|
-
property({ type: Boolean, reflect: true })
|
|
491
|
-
], LeuButton.prototype, "round", void 0);
|
|
492
|
-
__decorate([
|
|
493
|
-
property({ type: Boolean, reflect: true })
|
|
494
|
-
], LeuButton.prototype, "active", void 0);
|
|
495
|
-
__decorate([
|
|
496
|
-
property({ type: Boolean, reflect: true })
|
|
497
|
-
], LeuButton.prototype, "inverted", void 0);
|
|
498
|
-
__decorate([
|
|
499
|
-
property({ type: String, reflect: true })
|
|
500
|
-
], LeuButton.prototype, "expanded", void 0);
|
|
501
|
-
__decorate([
|
|
502
|
-
property({ type: Boolean, reflect: true })
|
|
503
|
-
], LeuButton.prototype, "fluid", void 0);
|
|
504
|
-
|
|
1
|
+
import "./LeuElement-BeFrgKes.js";
|
|
2
|
+
import "./Icon-C_yYuynf.js";
|
|
3
|
+
import "./Spinner-DDTqijTO.js";
|
|
4
|
+
import { t as LeuButton } from "./Button-BkhqVjug.js";
|
|
5
|
+
import "./FormAssociatedMixin-DLPvFtbT.js";
|
|
505
6
|
export { LeuButton };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { t as LeuElement } from "./LeuElement-BeFrgKes.js";
|
|
2
|
+
import { t as LeuButton } from "./Button-BkhqVjug.js";
|
|
3
|
+
import { css, html } from "lit";
|
|
4
|
+
//#region src/components/button-group/button-group.css?inline
|
|
5
|
+
var button_group_default = css`.group {
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 0.5rem;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/button-group/ButtonGroup.ts
|
|
13
|
+
/**
|
|
14
|
+
* A radio input-like button group component.
|
|
15
|
+
* It allows only one button to be active at a time.
|
|
16
|
+
* @tagname leu-button-group
|
|
17
|
+
* @slot - Slot for the buttons
|
|
18
|
+
* @fires input - When the value of the group changes by clicking a button
|
|
19
|
+
*/
|
|
20
|
+
var LeuButtonGroup = class LeuButtonGroup extends LeuElement {
|
|
21
|
+
constructor(..._args) {
|
|
22
|
+
super(..._args);
|
|
23
|
+
this._items = [];
|
|
24
|
+
this._handleButtonClick = (event) => {
|
|
25
|
+
const button = event.currentTarget;
|
|
26
|
+
if (!button.active) {
|
|
27
|
+
this.value = LeuButtonGroup.getButtonValue(button);
|
|
28
|
+
this.dispatchEvent(new CustomEvent("input", {
|
|
29
|
+
bubbles: true,
|
|
30
|
+
composed: true,
|
|
31
|
+
detail: { value: LeuButtonGroup.getButtonValue(button) }
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
static {
|
|
37
|
+
this.styles = [LeuElement.styles, button_group_default];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves the value or the text content of a given LeuButton element.
|
|
41
|
+
*/
|
|
42
|
+
static getButtonValue(button) {
|
|
43
|
+
return button.getAttribute("value") ?? button.textContent.trim();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The value of the currently selected (active) button
|
|
47
|
+
*/
|
|
48
|
+
get value() {
|
|
49
|
+
const activeButton = this._items.find((item) => item.active);
|
|
50
|
+
return activeButton ? LeuButtonGroup.getButtonValue(activeButton) : null;
|
|
51
|
+
}
|
|
52
|
+
set value(newValue) {
|
|
53
|
+
this._items.forEach((item) => {
|
|
54
|
+
item.active = LeuButtonGroup.getButtonValue(item) === newValue;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
_handleSlotChange() {
|
|
58
|
+
/**
|
|
59
|
+
* Remove all event listeners that were added before.
|
|
60
|
+
* Just because a slotchange event was fired, it doesn't mean that all of the
|
|
61
|
+
* children of the slot have changed.
|
|
62
|
+
*/
|
|
63
|
+
this._items.forEach((item) => {
|
|
64
|
+
item.removeEventListener("click", this._handleButtonClick);
|
|
65
|
+
});
|
|
66
|
+
this._items = this.shadowRoot.querySelector("slot").assignedElements({ flatten: true }).filter((el) => el instanceof LeuButton);
|
|
67
|
+
let foundActiveButtonBefore = false;
|
|
68
|
+
this._items.forEach((item) => {
|
|
69
|
+
item.addEventListener("click", this._handleButtonClick);
|
|
70
|
+
item.componentRole = "menuitemradio";
|
|
71
|
+
/**
|
|
72
|
+
* In case there are multiple active buttons
|
|
73
|
+
* only the first one will be kept active.
|
|
74
|
+
*/
|
|
75
|
+
if (item.active && foundActiveButtonBefore) item.active = false;
|
|
76
|
+
else if (item.active) foundActiveButtonBefore = true;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
return html`
|
|
81
|
+
<div role="menubar" class="group">
|
|
82
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { LeuButtonGroup as t };
|
package/dist/ButtonGroup.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
1
|
+
import { t as LeuElement } from "./LeuElement-pJFU18Xm.js";
|
|
2
|
+
import * as lit_html0 from "lit-html";
|
|
4
3
|
|
|
4
|
+
//#region src/components/button-group/ButtonGroup.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* A radio input-like button group component.
|
|
7
7
|
* It allows only one button to be active at a time.
|
|
@@ -10,20 +10,20 @@ import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
|
10
10
|
* @fires input - When the value of the group changes by clicking a button
|
|
11
11
|
*/
|
|
12
12
|
declare class LeuButtonGroup extends LeuElement {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
static styles: any[];
|
|
14
|
+
private _items;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the value or the text content of a given LeuButton element.
|
|
17
|
+
*/
|
|
18
|
+
private static getButtonValue;
|
|
19
|
+
/**
|
|
20
|
+
* The value of the currently selected (active) button
|
|
21
|
+
*/
|
|
22
|
+
get value(): string;
|
|
23
|
+
set value(newValue: string);
|
|
24
|
+
private _handleSlotChange;
|
|
25
|
+
private _handleButtonClick;
|
|
26
|
+
render(): lit_html0.TemplateResult<1>;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
export { LeuButtonGroup };
|
|
28
|
+
//#endregion
|
|
29
|
+
export { LeuButtonGroup };
|