@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
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { t as LeuElement } from "./LeuElement-BeFrgKes.js";
|
|
2
|
+
import { t as __decorate } from "./decorate-DwpAc4D0.js";
|
|
3
|
+
import { css, html } from "lit";
|
|
4
|
+
import { property } from "lit/decorators.js";
|
|
5
|
+
import { autoUpdate, computePosition, flip, offset, shift, size } from "@floating-ui/dom";
|
|
6
|
+
//#region src/components/popup/popup.css?inline
|
|
7
|
+
var popup_default = css`:host {
|
|
8
|
+
--popup-font-regular: var(--leu-font-family-regular);
|
|
9
|
+
--popup-font-black: var(--leu-font-family-black);
|
|
10
|
+
|
|
11
|
+
font-family: var(--popup-font-regular);
|
|
12
|
+
display: contents;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.popup {
|
|
16
|
+
display: none;
|
|
17
|
+
|
|
18
|
+
max-width: none;
|
|
19
|
+
|
|
20
|
+
max-width: var(--auto-size-available-width, none);
|
|
21
|
+
max-height: none;
|
|
22
|
+
max-height: var(--auto-size-available-height, none);
|
|
23
|
+
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
z-index: var(--leu-z-index-popup);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* TODO: Should visibility be a matter of the popup component? */
|
|
31
|
+
|
|
32
|
+
:host([active]) .popup {
|
|
33
|
+
display: block;
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/popup/Popup.ts
|
|
38
|
+
function isVirtualElement(el) {
|
|
39
|
+
return el !== null && typeof el === "object" && "getBoundingClientRect" in el && ("contextElement" in el ? el instanceof Element : true);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @tagname leu-popup
|
|
43
|
+
*/
|
|
44
|
+
var LeuPopup = class extends LeuElement {
|
|
45
|
+
constructor(..._args) {
|
|
46
|
+
super(..._args);
|
|
47
|
+
this.active = false;
|
|
48
|
+
this.flip = false;
|
|
49
|
+
this.shift = false;
|
|
50
|
+
this.shiftPadding = 0;
|
|
51
|
+
this.autoSizePadding = 0;
|
|
52
|
+
}
|
|
53
|
+
static {
|
|
54
|
+
this.styles = [LeuElement.styles, popup_default];
|
|
55
|
+
}
|
|
56
|
+
static {
|
|
57
|
+
this.shadowRootOptions = {
|
|
58
|
+
...LeuElement.shadowRootOptions,
|
|
59
|
+
delegatesFocus: true
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
disconnectedCallback() {
|
|
63
|
+
super.disconnectedCallback();
|
|
64
|
+
this.stop();
|
|
65
|
+
}
|
|
66
|
+
updated(changedProperties) {
|
|
67
|
+
if (changedProperties.has("active")) if (this.active) this.start();
|
|
68
|
+
else this.stop();
|
|
69
|
+
if (changedProperties.has("anchor")) this.handleAnchorChange();
|
|
70
|
+
if (this.active) this.reposition();
|
|
71
|
+
}
|
|
72
|
+
get popupEl() {
|
|
73
|
+
return this.renderRoot?.querySelector(".popup") ?? null;
|
|
74
|
+
}
|
|
75
|
+
start() {
|
|
76
|
+
if (!this.anchorEl || !this.active) return;
|
|
77
|
+
this.cleanup = autoUpdate(this.anchorEl, this.popupEl, () => {
|
|
78
|
+
this.reposition();
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
stop() {
|
|
82
|
+
this.cleanup?.();
|
|
83
|
+
this.style.removeProperty("--auto-size-available-width");
|
|
84
|
+
this.style.removeProperty("--auto-size-available-height");
|
|
85
|
+
}
|
|
86
|
+
reposition() {
|
|
87
|
+
if (!this.anchorEl || !this.popupEl || !this.active) return;
|
|
88
|
+
const middleware = [];
|
|
89
|
+
if (this.offsetAlignmentAxis || this.offsetMainAxis || this.offsetCrossAxis) middleware.push(offset({
|
|
90
|
+
mainAxis: this.offsetMainAxis,
|
|
91
|
+
crossAxis: this.offsetCrossAxis,
|
|
92
|
+
alignmentAxis: this.offsetAlignmentAxis
|
|
93
|
+
}));
|
|
94
|
+
if (this.matchSize) middleware.push(size({ apply: ({ rects }) => {
|
|
95
|
+
const matchWidth = this.matchSize === "width" || this.matchSize === "both";
|
|
96
|
+
const matchHeight = this.matchSize === "height" || this.matchSize === "both";
|
|
97
|
+
this.popupEl.style.width = matchWidth ? `${rects.reference.width}px` : "";
|
|
98
|
+
this.popupEl.style.height = matchHeight ? `${rects.reference.height}px` : "";
|
|
99
|
+
} }));
|
|
100
|
+
else {
|
|
101
|
+
this.popupEl.style.width = "";
|
|
102
|
+
this.popupEl.style.height = "";
|
|
103
|
+
}
|
|
104
|
+
if (this.flip) middleware.push(flip());
|
|
105
|
+
if (this.shift) middleware.push(shift({ padding: this.shiftPadding }));
|
|
106
|
+
if (this.autoSize) middleware.push(size({
|
|
107
|
+
padding: this.autoSizePadding,
|
|
108
|
+
apply: ({ availableWidth, availableHeight }) => {
|
|
109
|
+
const setMaxWidth = this.autoSize === "width" || this.autoSize === "both";
|
|
110
|
+
if (this.autoSize === "height" || this.autoSize === "both") this.style.setProperty("--auto-size-available-height", `${availableHeight}px`);
|
|
111
|
+
else this.style.removeProperty("--auto-size-available-height");
|
|
112
|
+
if (setMaxWidth) this.style.setProperty("--auto-size-available-width", `${availableWidth}px`);
|
|
113
|
+
else this.style.removeProperty("--auto-size-available-width");
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
else {
|
|
117
|
+
this.style.removeProperty("--auto-size-available-width");
|
|
118
|
+
this.style.removeProperty("--auto-size-available-height");
|
|
119
|
+
}
|
|
120
|
+
computePosition(this.anchorEl, this.popupEl, {
|
|
121
|
+
placement: this.placement,
|
|
122
|
+
middleware
|
|
123
|
+
}).then(({ x, y }) => {
|
|
124
|
+
Object.assign(this.popupEl.style, {
|
|
125
|
+
left: `${x}px`,
|
|
126
|
+
top: `${y}px`
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
handleAnchorChange() {
|
|
131
|
+
if (this.anchor && typeof this.anchor === "string") this.anchorEl = this.getRootNode().getElementById(this.anchor);
|
|
132
|
+
else if (this.anchor instanceof HTMLElement || isVirtualElement(this.anchor)) this.anchorEl = this.anchor;
|
|
133
|
+
else this.anchorEl = this.querySelector("[slot=anchor]");
|
|
134
|
+
if (this.anchorEl instanceof HTMLSlotElement) [this.anchorEl] = this.anchorEl.assignedElements({ flatten: true });
|
|
135
|
+
if (this.anchorEl) this.start();
|
|
136
|
+
}
|
|
137
|
+
render() {
|
|
138
|
+
return html`
|
|
139
|
+
<slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
|
|
140
|
+
<div class="popup">
|
|
141
|
+
<slot> </slot>
|
|
142
|
+
</div>
|
|
143
|
+
`;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
__decorate([property()], LeuPopup.prototype, "anchor", void 0);
|
|
147
|
+
__decorate([property({
|
|
148
|
+
type: Boolean,
|
|
149
|
+
reflect: true
|
|
150
|
+
})], LeuPopup.prototype, "active", void 0);
|
|
151
|
+
__decorate([property({
|
|
152
|
+
type: String,
|
|
153
|
+
reflect: true
|
|
154
|
+
})], LeuPopup.prototype, "placement", void 0);
|
|
155
|
+
__decorate([property({
|
|
156
|
+
type: Boolean,
|
|
157
|
+
reflect: true
|
|
158
|
+
})], LeuPopup.prototype, "flip", void 0);
|
|
159
|
+
__decorate([property({
|
|
160
|
+
type: Boolean,
|
|
161
|
+
reflect: true
|
|
162
|
+
})], LeuPopup.prototype, "shift", void 0);
|
|
163
|
+
__decorate([property({
|
|
164
|
+
type: Number,
|
|
165
|
+
reflect: true
|
|
166
|
+
})], LeuPopup.prototype, "shiftPadding", void 0);
|
|
167
|
+
__decorate([property({
|
|
168
|
+
type: String,
|
|
169
|
+
reflect: true
|
|
170
|
+
})], LeuPopup.prototype, "matchSize", void 0);
|
|
171
|
+
__decorate([property({
|
|
172
|
+
type: Number,
|
|
173
|
+
reflect: true,
|
|
174
|
+
attribute: "offset-main-axis"
|
|
175
|
+
})], LeuPopup.prototype, "offsetMainAxis", void 0);
|
|
176
|
+
__decorate([property({
|
|
177
|
+
type: Number,
|
|
178
|
+
reflect: true,
|
|
179
|
+
attribute: "offset-cross-axis"
|
|
180
|
+
})], LeuPopup.prototype, "offsetCrossAxis", void 0);
|
|
181
|
+
__decorate([property({
|
|
182
|
+
type: Number,
|
|
183
|
+
reflect: true,
|
|
184
|
+
attribute: "offset-alignment-axis"
|
|
185
|
+
})], LeuPopup.prototype, "offsetAlignmentAxis", void 0);
|
|
186
|
+
__decorate([property({
|
|
187
|
+
type: String,
|
|
188
|
+
reflect: true
|
|
189
|
+
})], LeuPopup.prototype, "autoSize", void 0);
|
|
190
|
+
__decorate([property({
|
|
191
|
+
type: Number,
|
|
192
|
+
reflect: true
|
|
193
|
+
})], LeuPopup.prototype, "autoSizePadding", void 0);
|
|
194
|
+
//#endregion
|
|
195
|
+
export { LeuPopup as t };
|
package/dist/Popup.d.ts
CHANGED
|
@@ -1,62 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { PropertyValues } from 'lit';
|
|
4
|
-
import { Placement } from '@floating-ui/dom';
|
|
5
|
-
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
6
|
-
|
|
7
|
-
interface VirtualElement {
|
|
8
|
-
getBoundingClientRect: () => DOMRect;
|
|
9
|
-
contextElement?: Element;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* @tagname leu-popup
|
|
13
|
-
*/
|
|
14
|
-
declare class LeuPopup extends LeuElement {
|
|
15
|
-
static styles: lit.CSSResultGroup[];
|
|
16
|
-
static shadowRootOptions: {
|
|
17
|
-
delegatesFocus: boolean;
|
|
18
|
-
mode: ShadowRootMode;
|
|
19
|
-
serializable?: boolean;
|
|
20
|
-
slotAssignment?: SlotAssignmentMode;
|
|
21
|
-
customElements?: CustomElementRegistry;
|
|
22
|
-
registry?: CustomElementRegistry;
|
|
23
|
-
};
|
|
24
|
-
anchor: Element | string | VirtualElement;
|
|
25
|
-
active: boolean;
|
|
26
|
-
placement?: Placement;
|
|
27
|
-
flip: boolean;
|
|
28
|
-
shift: boolean;
|
|
29
|
-
shiftPadding: number;
|
|
30
|
-
matchSize?: "width" | "height" | "both";
|
|
31
|
-
/**
|
|
32
|
-
* Offsets the popup along the main axis.
|
|
33
|
-
* @link https://floating-ui.com/docs/offset#mainaxis
|
|
34
|
-
*/
|
|
35
|
-
offsetMainAxis?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Offsets the popup along the cross axis.
|
|
38
|
-
* @link https://floating-ui.com/docs/offset#crossaxis
|
|
39
|
-
*/
|
|
40
|
-
offsetCrossAxis?: number;
|
|
41
|
-
/**
|
|
42
|
-
* Offsets the popup along the alignment axis.
|
|
43
|
-
* Overrides the `offsetCrossAxis` value.
|
|
44
|
-
* @link https://floating-ui.com/docs/offset#alignmentaxis
|
|
45
|
-
*/
|
|
46
|
-
offsetAlignmentAxis?: number;
|
|
47
|
-
autoSize?: "width" | "height" | "both";
|
|
48
|
-
autoSizePadding: number;
|
|
49
|
-
private anchorEl;
|
|
50
|
-
private cleanup;
|
|
51
|
-
disconnectedCallback(): void;
|
|
52
|
-
updated(changedProperties: PropertyValues<this>): void;
|
|
53
|
-
protected get popupEl(): HTMLDivElement;
|
|
54
|
-
protected start(): void;
|
|
55
|
-
protected stop(): void;
|
|
56
|
-
reposition(): void;
|
|
57
|
-
handleAnchorChange(): void;
|
|
58
|
-
render(): lit_html.TemplateResult<1>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { LeuPopup };
|
|
62
|
-
export type { VirtualElement };
|
|
1
|
+
import { n as VirtualElement, t as LeuPopup } from "./Popup-Btgm2a3D.js";
|
|
2
|
+
export { LeuPopup, VirtualElement };
|
package/dist/Popup.js
CHANGED
|
@@ -1,234 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { property } from 'lit/decorators.js';
|
|
4
|
-
import { autoUpdate, offset, size, flip, shift, computePosition } from '@floating-ui/dom';
|
|
5
|
-
import { L as LeuElement } from './LeuElement-BfXSO7MN.js';
|
|
6
|
-
|
|
7
|
-
var css_248z = css`:host {
|
|
8
|
-
--popup-font-regular: var(--leu-font-family-regular);
|
|
9
|
-
--popup-font-black: var(--leu-font-family-black);
|
|
10
|
-
|
|
11
|
-
font-family: var(--popup-font-regular);
|
|
12
|
-
display: contents;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.popup {
|
|
16
|
-
display: none;
|
|
17
|
-
|
|
18
|
-
max-width: none;
|
|
19
|
-
|
|
20
|
-
max-width: var(--auto-size-available-width, none);
|
|
21
|
-
max-height: none;
|
|
22
|
-
max-height: var(--auto-size-available-height, none);
|
|
23
|
-
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 0;
|
|
26
|
-
left: 0;
|
|
27
|
-
z-index: var(--leu-z-index-popup);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* TODO: Should visibility be a matter of the popup component? */
|
|
31
|
-
|
|
32
|
-
:host([active]) .popup {
|
|
33
|
-
display: block;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
function isVirtualElement(el) {
|
|
38
|
-
return (el !== null &&
|
|
39
|
-
typeof el === "object" &&
|
|
40
|
-
"getBoundingClientRect" in el &&
|
|
41
|
-
("contextElement" in el ? el instanceof Element : true));
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* @tagname leu-popup
|
|
45
|
-
*/
|
|
46
|
-
class LeuPopup extends LeuElement {
|
|
47
|
-
constructor() {
|
|
48
|
-
super(...arguments);
|
|
49
|
-
this.active = false;
|
|
50
|
-
this.flip = false;
|
|
51
|
-
this.shift = false;
|
|
52
|
-
this.shiftPadding = 0;
|
|
53
|
-
this.autoSizePadding = 0;
|
|
54
|
-
}
|
|
55
|
-
disconnectedCallback() {
|
|
56
|
-
super.disconnectedCallback();
|
|
57
|
-
this.stop();
|
|
58
|
-
}
|
|
59
|
-
updated(changedProperties) {
|
|
60
|
-
if (changedProperties.has("active")) {
|
|
61
|
-
if (this.active) {
|
|
62
|
-
this.start();
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
this.stop();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (changedProperties.has("anchor")) {
|
|
69
|
-
this.handleAnchorChange();
|
|
70
|
-
}
|
|
71
|
-
if (this.active) {
|
|
72
|
-
this.reposition();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
get popupEl() {
|
|
76
|
-
return this.renderRoot?.querySelector(".popup") ?? null;
|
|
77
|
-
}
|
|
78
|
-
start() {
|
|
79
|
-
if (!this.anchorEl || !this.active)
|
|
80
|
-
return;
|
|
81
|
-
this.cleanup = autoUpdate(this.anchorEl, this.popupEl, () => {
|
|
82
|
-
this.reposition();
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
stop() {
|
|
86
|
-
this.cleanup?.();
|
|
87
|
-
this.style.removeProperty("--auto-size-available-width");
|
|
88
|
-
this.style.removeProperty("--auto-size-available-height");
|
|
89
|
-
}
|
|
90
|
-
reposition() {
|
|
91
|
-
if (!this.anchorEl || !this.popupEl || !this.active)
|
|
92
|
-
return;
|
|
93
|
-
const middleware = [];
|
|
94
|
-
if (this.offsetAlignmentAxis ||
|
|
95
|
-
this.offsetMainAxis ||
|
|
96
|
-
this.offsetCrossAxis) {
|
|
97
|
-
middleware.push(offset({
|
|
98
|
-
mainAxis: this.offsetMainAxis,
|
|
99
|
-
crossAxis: this.offsetCrossAxis,
|
|
100
|
-
alignmentAxis: this.offsetAlignmentAxis,
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
if (this.matchSize) {
|
|
104
|
-
middleware.push(size({
|
|
105
|
-
apply: ({ rects }) => {
|
|
106
|
-
const matchWidth = this.matchSize === "width" || this.matchSize === "both";
|
|
107
|
-
const matchHeight = this.matchSize === "height" || this.matchSize === "both";
|
|
108
|
-
this.popupEl.style.width = matchWidth
|
|
109
|
-
? `${rects.reference.width}px`
|
|
110
|
-
: "";
|
|
111
|
-
this.popupEl.style.height = matchHeight
|
|
112
|
-
? `${rects.reference.height}px`
|
|
113
|
-
: "";
|
|
114
|
-
},
|
|
115
|
-
}));
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
// Cleanup styles if we're not matching width/height
|
|
119
|
-
this.popupEl.style.width = "";
|
|
120
|
-
this.popupEl.style.height = "";
|
|
121
|
-
}
|
|
122
|
-
if (this.flip) {
|
|
123
|
-
middleware.push(flip());
|
|
124
|
-
}
|
|
125
|
-
if (this.shift) {
|
|
126
|
-
middleware.push(shift({ padding: this.shiftPadding }));
|
|
127
|
-
}
|
|
128
|
-
if (this.autoSize) {
|
|
129
|
-
middleware.push(size({
|
|
130
|
-
padding: this.autoSizePadding,
|
|
131
|
-
apply: ({ availableWidth, availableHeight }) => {
|
|
132
|
-
const setMaxWidth = this.autoSize === "width" || this.autoSize === "both";
|
|
133
|
-
const setMaxHeight = this.autoSize === "height" || this.autoSize === "both";
|
|
134
|
-
if (setMaxHeight) {
|
|
135
|
-
this.style.setProperty("--auto-size-available-height", `${availableHeight}px`);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
this.style.removeProperty("--auto-size-available-height");
|
|
139
|
-
}
|
|
140
|
-
if (setMaxWidth) {
|
|
141
|
-
this.style.setProperty("--auto-size-available-width", `${availableWidth}px`);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
this.style.removeProperty("--auto-size-available-width");
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
}));
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
// Cleanup styles if we're not auto-sizing
|
|
151
|
-
this.style.removeProperty("--auto-size-available-width");
|
|
152
|
-
this.style.removeProperty("--auto-size-available-height");
|
|
153
|
-
}
|
|
154
|
-
computePosition(this.anchorEl, this.popupEl, {
|
|
155
|
-
placement: this.placement,
|
|
156
|
-
middleware,
|
|
157
|
-
}).then(({ x, y }) => {
|
|
158
|
-
Object.assign(this.popupEl.style, {
|
|
159
|
-
left: `${x}px`,
|
|
160
|
-
top: `${y}px`,
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
handleAnchorChange() {
|
|
165
|
-
if (this.anchor && typeof this.anchor === "string") {
|
|
166
|
-
const root = this.getRootNode();
|
|
167
|
-
this.anchorEl = root.getElementById(this.anchor);
|
|
168
|
-
}
|
|
169
|
-
else if (this.anchor instanceof HTMLElement ||
|
|
170
|
-
isVirtualElement(this.anchor)) {
|
|
171
|
-
this.anchorEl = this.anchor;
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
this.anchorEl = this.querySelector("[slot=anchor]");
|
|
175
|
-
}
|
|
176
|
-
if (this.anchorEl instanceof HTMLSlotElement) {
|
|
177
|
-
[this.anchorEl] = this.anchorEl.assignedElements({ flatten: true });
|
|
178
|
-
}
|
|
179
|
-
if (this.anchorEl) {
|
|
180
|
-
this.start();
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
render() {
|
|
184
|
-
return html `
|
|
185
|
-
<slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
|
|
186
|
-
<div class="popup">
|
|
187
|
-
<slot> </slot>
|
|
188
|
-
</div>
|
|
189
|
-
`;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
LeuPopup.styles = [LeuElement.styles, css_248z];
|
|
193
|
-
LeuPopup.shadowRootOptions = {
|
|
194
|
-
...LeuElement.shadowRootOptions,
|
|
195
|
-
delegatesFocus: true,
|
|
196
|
-
};
|
|
197
|
-
__decorate([
|
|
198
|
-
property()
|
|
199
|
-
], LeuPopup.prototype, "anchor", void 0);
|
|
200
|
-
__decorate([
|
|
201
|
-
property({ type: Boolean, reflect: true })
|
|
202
|
-
], LeuPopup.prototype, "active", void 0);
|
|
203
|
-
__decorate([
|
|
204
|
-
property({ type: String, reflect: true })
|
|
205
|
-
], LeuPopup.prototype, "placement", void 0);
|
|
206
|
-
__decorate([
|
|
207
|
-
property({ type: Boolean, reflect: true })
|
|
208
|
-
], LeuPopup.prototype, "flip", void 0);
|
|
209
|
-
__decorate([
|
|
210
|
-
property({ type: Boolean, reflect: true })
|
|
211
|
-
], LeuPopup.prototype, "shift", void 0);
|
|
212
|
-
__decorate([
|
|
213
|
-
property({ type: Number, reflect: true })
|
|
214
|
-
], LeuPopup.prototype, "shiftPadding", void 0);
|
|
215
|
-
__decorate([
|
|
216
|
-
property({ type: String, reflect: true })
|
|
217
|
-
], LeuPopup.prototype, "matchSize", void 0);
|
|
218
|
-
__decorate([
|
|
219
|
-
property({ type: Number, reflect: true, attribute: "offset-main-axis" })
|
|
220
|
-
], LeuPopup.prototype, "offsetMainAxis", void 0);
|
|
221
|
-
__decorate([
|
|
222
|
-
property({ type: Number, reflect: true, attribute: "offset-cross-axis" })
|
|
223
|
-
], LeuPopup.prototype, "offsetCrossAxis", void 0);
|
|
224
|
-
__decorate([
|
|
225
|
-
property({ type: Number, reflect: true, attribute: "offset-alignment-axis" })
|
|
226
|
-
], LeuPopup.prototype, "offsetAlignmentAxis", void 0);
|
|
227
|
-
__decorate([
|
|
228
|
-
property({ type: String, reflect: true })
|
|
229
|
-
], LeuPopup.prototype, "autoSize", void 0);
|
|
230
|
-
__decorate([
|
|
231
|
-
property({ type: Number, reflect: true })
|
|
232
|
-
], LeuPopup.prototype, "autoSizePadding", void 0);
|
|
233
|
-
|
|
1
|
+
import "./LeuElement-BeFrgKes.js";
|
|
2
|
+
import { t as LeuPopup } from "./Popup-DNlm_9AA.js";
|
|
234
3
|
export { LeuPopup };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { t as LeuElement } from "./LeuElement-BeFrgKes.js";
|
|
2
|
+
import { t as __decorate } from "./decorate-DwpAc4D0.js";
|
|
3
|
+
import { css, html, nothing } from "lit";
|
|
4
|
+
import { property } from "lit/decorators.js";
|
|
5
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
6
|
+
//#region src/components/progress-bar/progress-bar.css?inline
|
|
7
|
+
var progress_bar_default = css`/* :host {
|
|
8
|
+
--progress-bar-font-regular: var(--leu-font-family-regular);
|
|
9
|
+
--progress-bar-font-black: var(--leu-font-family-black);
|
|
10
|
+
|
|
11
|
+
font-family: var(--progress-bar-font-regular);
|
|
12
|
+
} */
|
|
13
|
+
|
|
14
|
+
.progress {
|
|
15
|
+
--_height: 0.5rem;
|
|
16
|
+
--_border-radius: 0.25rem;
|
|
17
|
+
--_progress-color: var(--leu-color-func-cyan);
|
|
18
|
+
--_indeterminate-animation: indeterminate 2s ease infinite;
|
|
19
|
+
--_indeterminate-width: 25%;
|
|
20
|
+
|
|
21
|
+
-webkit-appearance: none;
|
|
22
|
+
|
|
23
|
+
-moz-appearance: none;
|
|
24
|
+
|
|
25
|
+
appearance: none;
|
|
26
|
+
display: block;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 0.5rem;
|
|
29
|
+
height: var(--_height);
|
|
30
|
+
|
|
31
|
+
background-color: var(--leu-color-black-transp-10);
|
|
32
|
+
border: none;
|
|
33
|
+
border-radius: 0.25rem;
|
|
34
|
+
border-radius: var(--_border-radius);
|
|
35
|
+
margin-bottom: 0.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.progress::-webkit-progress-bar {
|
|
39
|
+
background: transparent;
|
|
40
|
+
border-radius: var(--_border-radius);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Progress bar */
|
|
44
|
+
|
|
45
|
+
.progress::-moz-progress-bar {
|
|
46
|
+
background-color: var(--_progress-color);
|
|
47
|
+
border-radius: var(--_border-radius);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.progress::-webkit-progress-value {
|
|
51
|
+
background-color: var(--_progress-color);
|
|
52
|
+
border-radius: var(--_border-radius);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Indeterminate state */
|
|
56
|
+
|
|
57
|
+
.progress:indeterminate::-moz-progress-bar {
|
|
58
|
+
width: var(--_indeterminate-width);
|
|
59
|
+
animation: var(--_indeterminate-animation);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Safari */
|
|
63
|
+
|
|
64
|
+
.progress:indeterminate::-webkit-progress-value {
|
|
65
|
+
display: block;
|
|
66
|
+
width: var(--_indeterminate-width);
|
|
67
|
+
animation: var(--_indeterminate-animation);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Chrome */
|
|
71
|
+
|
|
72
|
+
.progress:indeterminate::before {
|
|
73
|
+
content: "";
|
|
74
|
+
display: block;
|
|
75
|
+
width: var(--_indeterminate-width);
|
|
76
|
+
height: var(--_height);
|
|
77
|
+
background-color: var(--_progress-color);
|
|
78
|
+
border-radius: var(--_border-radius);
|
|
79
|
+
animation: var(--_indeterminate-animation);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@keyframes indeterminate {
|
|
83
|
+
0% {
|
|
84
|
+
margin-left: 0%;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
50% {
|
|
88
|
+
margin-left: 75%;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
100% {
|
|
92
|
+
margin-left: 0%;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Info section (text label and value) */
|
|
97
|
+
|
|
98
|
+
.info {
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: space-between;
|
|
101
|
+
align-items: center;
|
|
102
|
+
flex-wrap: wrap;
|
|
103
|
+
gap: 0.25rem;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.label,
|
|
107
|
+
.value {
|
|
108
|
+
font: var(--leu-t-tiny-regular-font);
|
|
109
|
+
color: var(--leu-color-black-60);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.value {
|
|
113
|
+
/* margin-left: auto; */
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/components/progress-bar/ProgressBar.ts
|
|
118
|
+
/**
|
|
119
|
+
* An indicator showing the completion progress of a task
|
|
120
|
+
*
|
|
121
|
+
* @tagname leu-progress-bar
|
|
122
|
+
*/
|
|
123
|
+
var LeuProgressBar = class extends LeuElement {
|
|
124
|
+
constructor(..._args) {
|
|
125
|
+
super(..._args);
|
|
126
|
+
this.value = 0;
|
|
127
|
+
this.label = "";
|
|
128
|
+
this.indeterminate = false;
|
|
129
|
+
}
|
|
130
|
+
static {
|
|
131
|
+
this.styles = [LeuElement.styles, progress_bar_default];
|
|
132
|
+
}
|
|
133
|
+
static {
|
|
134
|
+
this.shadowRootOptions = {
|
|
135
|
+
...LeuElement.shadowRootOptions,
|
|
136
|
+
delegatesFocus: true
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
return html`
|
|
141
|
+
<progress
|
|
142
|
+
class="progress"
|
|
143
|
+
max=${ifDefined(!this.indeterminate ? 100 : void 0)}
|
|
144
|
+
value=${ifDefined(!this.indeterminate ? this.value : void 0)}
|
|
145
|
+
id="progress"
|
|
146
|
+
></progress>
|
|
147
|
+
<div class="info">
|
|
148
|
+
${this.label ? html`<label class="label" for="progress">${this.label}</label>` : html`<div class="label label--placeholder"></div>`}
|
|
149
|
+
${this.indeterminate ? nothing : html`<span class="value">${Math.round(this.value)} %</span>`}
|
|
150
|
+
</div>
|
|
151
|
+
`;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
__decorate([property({
|
|
155
|
+
type: Number,
|
|
156
|
+
reflect: true
|
|
157
|
+
})], LeuProgressBar.prototype, "value", void 0);
|
|
158
|
+
__decorate([property({
|
|
159
|
+
type: String,
|
|
160
|
+
reflect: true
|
|
161
|
+
})], LeuProgressBar.prototype, "label", void 0);
|
|
162
|
+
__decorate([property({
|
|
163
|
+
type: Boolean,
|
|
164
|
+
reflect: true
|
|
165
|
+
})], LeuProgressBar.prototype, "indeterminate", void 0);
|
|
166
|
+
//#endregion
|
|
167
|
+
export { LeuProgressBar as t };
|