@statistikzh/leu 0.14.3 → 0.14.4
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/.eslintrc.json +23 -4
- package/.github/workflows/release-please.yml +0 -1
- package/.prettierignore +1 -1
- package/.release-please-manifest.json +3 -0
- package/.storybook/{main.js → main.ts} +18 -2
- package/.storybook/{theme.js → theme.ts} +1 -0
- package/CHANGELOG.md +7 -0
- package/custom-elements-manifest.config.js +2 -2
- package/dist/Accordion.d.ts +32 -11
- package/dist/Accordion.js +96 -68
- package/dist/Button.d.ts +84 -33
- package/dist/Button.js +116 -136
- package/dist/ButtonGroup.d.ts +15 -10
- package/dist/ButtonGroup.js +65 -72
- package/dist/Checkbox.d.ts +41 -8
- package/dist/Checkbox.js +33 -45
- package/dist/CheckboxGroup.d.ts +21 -8
- package/dist/CheckboxGroup.js +31 -35
- package/dist/Chip.d.ts +23 -4
- package/dist/Chip.js +13 -17
- package/dist/ChipGroup.d.ts +43 -17
- package/dist/ChipGroup.js +87 -113
- package/dist/ChipLink.d.ts +28 -10
- package/dist/ChipLink.js +17 -24
- package/dist/ChipRemovable.d.ts +25 -6
- package/dist/ChipRemovable.js +32 -36
- package/dist/ChipSelectable.d.ts +41 -23
- package/dist/ChipSelectable.js +55 -69
- package/dist/Dialog.d.ts +39 -11
- package/dist/Dialog.js +48 -55
- package/dist/Dropdown.d.ts +44 -9
- package/dist/Dropdown.js +89 -96
- package/dist/Icon.d.ts +16 -9
- package/dist/Icon.js +117 -122
- package/dist/Input.d.ts +122 -34
- package/dist/Input.js +262 -342
- package/dist/LeuElement-x8UlIDDl.js +42 -0
- package/dist/LeuElement.d-BevHqLUu.d.ts +10 -0
- package/dist/Menu.d.ts +29 -10
- package/dist/Menu.js +111 -110
- package/dist/MenuItem.d.ts +69 -19
- package/dist/MenuItem.js +93 -109
- package/dist/Pagination.d.ts +46 -16
- package/dist/Pagination.js +101 -116
- package/dist/Popup.d.ts +55 -21
- package/dist/Popup.js +149 -178
- package/dist/Radio.d.ts +37 -8
- package/dist/Radio.js +30 -42
- package/dist/RadioGroup.d.ts +25 -7
- package/dist/RadioGroup.js +123 -128
- package/dist/Range.d.ts +62 -23
- package/dist/Range.js +154 -180
- package/dist/ScrollTop.d.ts +25 -14
- package/dist/ScrollTop.js +71 -75
- package/dist/Select.d.ts +48 -38
- package/dist/Select.js +309 -336
- package/dist/Spinner.d.ts +9 -4
- package/dist/Spinner.js +5 -5
- package/dist/Table.d.ts +61 -31
- package/dist/Table.js +160 -179
- package/dist/VisuallyHidden.d.ts +9 -4
- package/dist/VisuallyHidden.js +5 -5
- package/dist/components/accordion/Accordion.d.ts +49 -0
- package/dist/components/accordion/Accordion.d.ts.map +1 -0
- package/dist/components/accordion/leu-accordion.d.ts +8 -0
- package/dist/components/accordion/leu-accordion.d.ts.map +1 -0
- package/dist/components/accordion/stories/accordion.stories.d.ts +26 -0
- package/dist/components/accordion/stories/accordion.stories.d.ts.map +1 -0
- package/dist/components/accordion/test/accordion.test.d.ts +2 -0
- package/dist/components/accordion/test/accordion.test.d.ts.map +1 -0
- package/dist/components/button/Button.d.ts +93 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/leu-button.d.ts +8 -0
- package/dist/components/button/leu-button.d.ts.map +1 -0
- package/dist/components/button/stories/button.stories.d.ts +19 -0
- package/dist/components/button/stories/button.stories.d.ts.map +1 -0
- package/dist/components/button/test/button.test.d.ts +3 -0
- package/dist/components/button/test/button.test.d.ts.map +1 -0
- package/dist/components/button-group/ButtonGroup.d.ts +25 -0
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -0
- package/dist/components/button-group/leu-button-group.d.ts +8 -0
- package/dist/components/button-group/leu-button-group.d.ts.map +1 -0
- package/dist/components/button-group/stories/button-group.stories.d.ts +15 -0
- package/dist/components/button-group/stories/button-group.stories.d.ts.map +1 -0
- package/dist/components/button-group/test/button-group.test.d.ts +3 -0
- package/dist/components/button-group/test/button-group.test.d.ts.map +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +43 -0
- package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/CheckboxGroup.d.ts +23 -0
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -0
- package/dist/components/checkbox/leu-checkbox-group.d.ts +8 -0
- package/dist/components/checkbox/leu-checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox/leu-checkbox.d.ts +8 -0
- package/dist/components/checkbox/leu-checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts +29 -0
- package/dist/components/checkbox/stories/checkbox-group.stories.d.ts.map +1 -0
- package/dist/components/checkbox/stories/checkbox.stories.d.ts +22 -0
- package/dist/components/checkbox/stories/checkbox.stories.d.ts.map +1 -0
- package/dist/components/checkbox/test/checkbox-group.test.d.ts +3 -0
- package/dist/components/checkbox/test/checkbox-group.test.d.ts.map +1 -0
- package/dist/components/checkbox/test/checkbox.test.d.ts +2 -0
- package/dist/components/checkbox/test/checkbox.test.d.ts.map +1 -0
- package/dist/components/chip/Chip.d.ts +21 -0
- package/dist/components/chip/Chip.d.ts.map +1 -0
- package/dist/components/chip/ChipGroup.d.ts +58 -0
- package/dist/components/chip/ChipGroup.d.ts.map +1 -0
- package/dist/components/chip/ChipLink.d.ts +29 -0
- package/dist/components/chip/ChipLink.d.ts.map +1 -0
- package/dist/components/chip/ChipRemovable.d.ts +32 -0
- package/dist/components/chip/ChipRemovable.d.ts.map +1 -0
- package/dist/components/chip/ChipSelectable.d.ts +51 -0
- package/dist/components/chip/ChipSelectable.d.ts.map +1 -0
- package/dist/components/chip/exports.d.ts +5 -0
- package/dist/components/chip/exports.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-group.d.ts +8 -0
- package/dist/components/chip/leu-chip-group.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-link.d.ts +8 -0
- package/dist/components/chip/leu-chip-link.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-removable.d.ts +8 -0
- package/dist/components/chip/leu-chip-removable.d.ts.map +1 -0
- package/dist/components/chip/leu-chip-selectable.d.ts +8 -0
- package/dist/components/chip/leu-chip-selectable.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-group.stories.d.ts +40 -0
- package/dist/components/chip/stories/chip-group.stories.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-link.stories.d.ts +27 -0
- package/dist/components/chip/stories/chip-link.stories.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-removable.stories.d.ts +21 -0
- package/dist/components/chip/stories/chip-removable.stories.d.ts.map +1 -0
- package/dist/components/chip/stories/chip-selectable.stories.d.ts +35 -0
- package/dist/components/chip/stories/chip-selectable.stories.d.ts.map +1 -0
- package/dist/components/chip/test/chip-group.test.d.ts +4 -0
- package/dist/components/chip/test/chip-group.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip-link.test.d.ts +2 -0
- package/dist/components/chip/test/chip-link.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip-removable.test.d.ts +2 -0
- package/dist/components/chip/test/chip-removable.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip-selectable.test.d.ts +2 -0
- package/dist/components/chip/test/chip-selectable.test.d.ts.map +1 -0
- package/dist/components/chip/test/chip.test.d.ts +2 -0
- package/dist/components/chip/test/chip.test.d.ts.map +1 -0
- package/dist/components/dialog/Dialog.d.ts +41 -0
- package/dist/components/dialog/Dialog.d.ts.map +1 -0
- package/dist/components/dialog/leu-dialog.d.ts +8 -0
- package/dist/components/dialog/leu-dialog.d.ts.map +1 -0
- package/dist/components/dialog/stories/dialog.stories.d.ts +19 -0
- package/dist/components/dialog/stories/dialog.stories.d.ts.map +1 -0
- package/dist/components/dialog/test/dialog.test.d.ts +2 -0
- package/dist/components/dialog/test/dialog.test.d.ts.map +1 -0
- package/dist/components/dropdown/Dropdown.d.ts +49 -0
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/dropdown/leu-dropdown.d.ts +8 -0
- package/dist/components/dropdown/leu-dropdown.d.ts.map +1 -0
- package/dist/components/dropdown/stories/dropdown.stories.d.ts +25 -0
- package/dist/components/dropdown/stories/dropdown.stories.d.ts.map +1 -0
- package/dist/components/dropdown/test/dropdown.test.d.ts +2 -0
- package/dist/components/dropdown/test/dropdown.test.d.ts.map +1 -0
- package/dist/components/icon/Icon.d.ts +23 -0
- package/dist/components/icon/Icon.d.ts.map +1 -0
- package/dist/components/icon/leu-icon.d.ts +8 -0
- package/dist/components/icon/leu-icon.d.ts.map +1 -0
- package/dist/components/icon/paths.d.ts +101 -0
- package/dist/components/icon/paths.d.ts.map +1 -0
- package/dist/components/icon/stories/icon.stories.d.ts +22 -0
- package/dist/components/icon/stories/icon.stories.d.ts.map +1 -0
- package/dist/components/icon/test/icon.test.d.ts +2 -0
- package/dist/components/icon/test/icon.test.d.ts.map +1 -0
- package/dist/components/input/Input.d.ts +239 -0
- package/dist/components/input/Input.d.ts.map +1 -0
- package/dist/components/input/leu-input.d.ts +8 -0
- package/dist/components/input/leu-input.d.ts.map +1 -0
- package/dist/components/input/stories/input.stories.d.ts +35 -0
- package/dist/components/input/stories/input.stories.d.ts.map +1 -0
- package/dist/components/input/test/input.test.d.ts +2 -0
- package/dist/components/input/test/input.test.d.ts.map +1 -0
- package/dist/components/menu/Menu.d.ts +44 -0
- package/dist/components/menu/Menu.d.ts.map +1 -0
- package/dist/components/menu/MenuItem.d.ts +88 -0
- package/dist/components/menu/MenuItem.d.ts.map +1 -0
- package/dist/components/menu/leu-menu-item.d.ts +8 -0
- package/dist/components/menu/leu-menu-item.d.ts.map +1 -0
- package/dist/components/menu/leu-menu.d.ts +8 -0
- package/dist/components/menu/leu-menu.d.ts.map +1 -0
- package/dist/components/menu/stories/menu-item.stories.d.ts +24 -0
- package/dist/components/menu/stories/menu-item.stories.d.ts.map +1 -0
- package/dist/components/menu/stories/menu.stories.d.ts +26 -0
- package/dist/components/menu/stories/menu.stories.d.ts.map +1 -0
- package/dist/components/menu/test/menu-item.test.d.ts +3 -0
- package/dist/components/menu/test/menu-item.test.d.ts.map +1 -0
- package/dist/components/menu/test/menu.test.d.ts +4 -0
- package/dist/components/menu/test/menu.test.d.ts.map +1 -0
- package/dist/components/pagination/Pagination.d.ts +59 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -0
- package/dist/components/pagination/leu-pagination.d.ts +8 -0
- package/dist/components/pagination/leu-pagination.d.ts.map +1 -0
- package/dist/components/pagination/stories/pagination.stories.d.ts +17 -0
- package/dist/components/pagination/stories/pagination.stories.d.ts.map +1 -0
- package/dist/components/pagination/test/pagination.test.d.ts +2 -0
- package/dist/components/pagination/test/pagination.test.d.ts.map +1 -0
- package/dist/components/popup/Popup.d.ts +66 -0
- package/dist/components/popup/Popup.d.ts.map +1 -0
- package/dist/components/popup/leu-popup.d.ts +8 -0
- package/dist/components/popup/leu-popup.d.ts.map +1 -0
- package/dist/components/popup/stories/popup.stories.d.ts +17 -0
- package/dist/components/popup/stories/popup.stories.d.ts.map +1 -0
- package/dist/components/popup/test/popup.test.d.ts +2 -0
- package/dist/components/popup/test/popup.test.d.ts.map +1 -0
- package/dist/components/radio/Radio.d.ts +39 -0
- package/dist/components/radio/Radio.d.ts.map +1 -0
- package/dist/components/radio/RadioGroup.d.ts +34 -0
- package/dist/components/radio/RadioGroup.d.ts.map +1 -0
- package/dist/components/radio/leu-radio-group.d.ts +8 -0
- package/dist/components/radio/leu-radio-group.d.ts.map +1 -0
- package/dist/components/radio/leu-radio.d.ts +8 -0
- package/dist/components/radio/leu-radio.d.ts.map +1 -0
- package/dist/components/radio/stories/radio-group.stories.d.ts +29 -0
- package/dist/components/radio/stories/radio-group.stories.d.ts.map +1 -0
- package/dist/components/radio/stories/radio.stories.d.ts +22 -0
- package/dist/components/radio/stories/radio.stories.d.ts.map +1 -0
- package/dist/components/radio/test/radio-group.test.d.ts +3 -0
- package/dist/components/radio/test/radio-group.test.d.ts.map +1 -0
- package/dist/components/radio/test/radio.test.d.ts +2 -0
- package/dist/components/radio/test/radio.test.d.ts.map +1 -0
- package/dist/components/range/Range.d.ts +95 -0
- package/dist/components/range/Range.d.ts.map +1 -0
- package/dist/components/range/leu-range.d.ts +8 -0
- package/dist/components/range/leu-range.d.ts.map +1 -0
- package/dist/components/range/stories/range-slider.stories.d.ts +26 -0
- package/dist/components/range/stories/range-slider.stories.d.ts.map +1 -0
- package/dist/components/range/test/range.test.d.ts +2 -0
- package/dist/components/range/test/range.test.d.ts.map +1 -0
- package/dist/components/scroll-top/ScrollTop.d.ts +25 -0
- package/dist/components/scroll-top/ScrollTop.d.ts.map +1 -0
- package/dist/components/scroll-top/leu-scroll-top.d.ts +8 -0
- package/dist/components/scroll-top/leu-scroll-top.d.ts.map +1 -0
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts +8 -0
- package/dist/components/scroll-top/stories/scroll-top.stories.d.ts.map +1 -0
- package/dist/components/scroll-top/test/scroll-top.test.d.ts +2 -0
- package/dist/components/scroll-top/test/scroll-top.test.d.ts.map +1 -0
- package/dist/components/select/Select.d.ts +145 -0
- package/dist/components/select/Select.d.ts.map +1 -0
- package/dist/components/select/leu-select.d.ts +8 -0
- package/dist/components/select/leu-select.d.ts.map +1 -0
- package/dist/components/select/stories/select.stories.d.ts +23 -0
- package/dist/components/select/stories/select.stories.d.ts.map +1 -0
- package/dist/components/select/test/fixtures.d.ts +2 -0
- package/dist/components/select/test/fixtures.d.ts.map +1 -0
- package/dist/components/select/test/select.test.d.ts +3 -0
- package/dist/components/select/test/select.test.d.ts.map +1 -0
- package/dist/components/spinner/Spinner.d.ts +10 -0
- package/dist/components/spinner/Spinner.d.ts.map +1 -0
- package/dist/components/spinner/leu-spinner.d.ts +8 -0
- package/dist/components/spinner/leu-spinner.d.ts.map +1 -0
- package/dist/components/spinner/stories/spinner.stories.d.ts +16 -0
- package/dist/components/spinner/stories/spinner.stories.d.ts.map +1 -0
- package/dist/components/spinner/test/spinner.test.d.ts +2 -0
- package/dist/components/spinner/test/spinner.test.d.ts.map +1 -0
- package/dist/components/table/Table.d.ts +65 -0
- package/dist/components/table/Table.d.ts.map +1 -0
- package/dist/components/table/leu-table.d.ts +8 -0
- package/dist/components/table/leu-table.d.ts.map +1 -0
- package/dist/components/table/stories/table.stories.d.ts +15 -0
- package/dist/components/table/stories/table.stories.d.ts.map +1 -0
- package/dist/components/table/test/table.test.d.ts +2 -0
- package/dist/components/table/test/table.test.d.ts.map +1 -0
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +9 -0
- package/dist/components/visually-hidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts +8 -0
- package/dist/components/visually-hidden/leu-visually-hidden.d.ts.map +1 -0
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts +13 -0
- package/dist/components/visually-hidden/stories/visually-hidden.stories.d.ts.map +1 -0
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts +2 -0
- package/dist/components/visually-hidden/test/visually-hidden.test.d.ts.map +1 -0
- package/dist/hasSlotController-Bm2tipvG.js +53 -0
- package/dist/hasSlotController.d-emXwVXWF.d.ts +23 -0
- package/dist/index.d.ts +17 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/leu-accordion.d.ts +12 -2
- package/dist/leu-accordion.js +2 -1
- package/dist/leu-button-group.d.ts +12 -2
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.d.ts +14 -2
- package/dist/leu-button.js +2 -2
- package/dist/leu-checkbox-group.d.ts +12 -2
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.d.ts +13 -2
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.d.ts +12 -2
- package/dist/leu-chip-group.js +2 -2
- package/dist/leu-chip-link.d.ts +13 -2
- package/dist/leu-chip-link.js +1 -1
- package/dist/leu-chip-removable.d.ts +14 -2
- package/dist/leu-chip-removable.js +1 -1
- package/dist/leu-chip-selectable.d.ts +13 -2
- package/dist/leu-chip-selectable.js +1 -1
- package/dist/leu-dialog.d.ts +14 -2
- package/dist/leu-dialog.js +2 -2
- package/dist/leu-dropdown.d.ts +18 -2
- package/dist/leu-dropdown.js +2 -2
- package/dist/leu-icon.d.ts +12 -2
- package/dist/leu-icon.js +1 -1
- package/dist/leu-input.d.ts +13 -2
- package/dist/leu-input.js +1 -1
- package/dist/leu-menu-item.d.ts +13 -2
- package/dist/leu-menu-item.js +1 -1
- package/dist/leu-menu.d.ts +14 -2
- package/dist/leu-menu.js +1 -1
- package/dist/leu-pagination.d.ts +16 -2
- package/dist/leu-pagination.js +2 -2
- package/dist/leu-popup.d.ts +12 -2
- package/dist/leu-popup.js +1 -1
- package/dist/leu-radio-group.d.ts +12 -2
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.d.ts +12 -2
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.d.ts +12 -2
- package/dist/leu-range.js +1 -1
- package/dist/leu-scroll-top.d.ts +15 -2
- package/dist/leu-scroll-top.js +2 -2
- package/dist/leu-select.d.ts +19 -2
- package/dist/leu-select.js +2 -2
- package/dist/leu-spinner.d.ts +12 -2
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.d.ts +17 -2
- package/dist/leu-table.js +2 -2
- package/dist/leu-visually-hidden.d.ts +12 -2
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/lib/LeuElement.d.ts +8 -0
- package/dist/lib/LeuElement.d.ts.map +1 -0
- package/dist/lib/a11y.d.ts +11 -0
- package/dist/lib/a11y.d.ts.map +1 -0
- package/dist/lib/hasSlotController.d.ts +20 -0
- package/dist/lib/hasSlotController.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +16 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/styles/style.stories.d.ts +6 -0
- package/dist/styles/style.stories.d.ts.map +1 -0
- package/dist/vscode.html-custom-data.json +1 -1
- package/dist/vue/index.d.ts +1 -3
- package/dist/web-types.json +4 -5
- package/package.json +18 -11
- package/release-please-config.json +10 -0
- package/rollup.config.js +55 -25
- package/scripts/generate-component/generate.js +1 -1
- package/scripts/generate-component/templates/{[Name].js → [Name].ts} +3 -3
- package/src/components/accordion/{Accordion.js → Accordion.ts} +26 -21
- package/src/components/accordion/{leu-accordion.js → leu-accordion.ts} +6 -0
- package/src/components/accordion/stories/{accordion.stories.js → accordion.stories.ts} +10 -8
- package/src/components/button/{Button.js → Button.ts} +0 -1
- package/src/components/button/{leu-button.js → leu-button.ts} +6 -0
- package/src/components/button-group/{ButtonGroup.js → ButtonGroup.ts} +4 -8
- package/src/components/button-group/{leu-button-group.js → leu-button-group.ts} +6 -0
- package/src/components/checkbox/{Checkbox.js → Checkbox.ts} +0 -1
- package/src/components/checkbox/{CheckboxGroup.js → CheckboxGroup.ts} +0 -1
- package/src/components/checkbox/{leu-checkbox-group.js → leu-checkbox-group.ts} +6 -0
- package/src/components/checkbox/{leu-checkbox.js → leu-checkbox.ts} +6 -0
- package/src/components/chip/{Chip.js → Chip.ts} +0 -1
- package/src/components/chip/{ChipGroup.js → ChipGroup.ts} +0 -1
- package/src/components/chip/{leu-chip-group.js → leu-chip-group.ts} +6 -0
- package/src/components/chip/{leu-chip-link.js → leu-chip-link.ts} +6 -0
- package/src/components/chip/{leu-chip-removable.js → leu-chip-removable.ts} +6 -0
- package/src/components/chip/{leu-chip-selectable.js → leu-chip-selectable.ts} +6 -0
- package/src/components/dialog/{Dialog.js → Dialog.ts} +0 -1
- package/src/components/dialog/{leu-dialog.js → leu-dialog.ts} +6 -0
- package/src/components/dropdown/{Dropdown.js → Dropdown.ts} +0 -1
- package/src/components/dropdown/{leu-dropdown.js → leu-dropdown.ts} +6 -0
- package/src/components/icon/{Icon.js → Icon.ts} +0 -1
- package/src/components/icon/{leu-icon.js → leu-icon.ts} +6 -0
- package/src/components/input/{Input.js → Input.ts} +0 -1
- package/src/components/input/{leu-input.js → leu-input.ts} +6 -0
- package/src/components/menu/{Menu.js → Menu.ts} +0 -1
- package/src/components/menu/{MenuItem.js → MenuItem.ts} +0 -1
- package/src/components/menu/{leu-menu-item.js → leu-menu-item.ts} +6 -0
- package/src/components/menu/{leu-menu.js → leu-menu.ts} +6 -0
- package/src/components/pagination/{Pagination.js → Pagination.ts} +0 -1
- package/src/components/pagination/{leu-pagination.js → leu-pagination.ts} +6 -0
- package/src/components/popup/{Popup.js → Popup.ts} +0 -1
- package/src/components/popup/{leu-popup.js → leu-popup.ts} +6 -0
- package/src/components/radio/{Radio.js → Radio.ts} +0 -1
- package/src/components/radio/{RadioGroup.js → RadioGroup.ts} +0 -1
- package/src/components/radio/{leu-radio-group.js → leu-radio-group.ts} +6 -0
- package/src/components/radio/{leu-radio.js → leu-radio.ts} +6 -0
- package/src/components/range/{leu-range.js → leu-range.ts} +6 -0
- package/src/components/scroll-top/{ScrollTop.js → ScrollTop.ts} +0 -1
- package/src/components/scroll-top/{leu-scroll-top.js → leu-scroll-top.ts} +6 -0
- package/src/components/select/{Select.js → Select.ts} +0 -1
- package/src/components/select/{leu-select.js → leu-select.ts} +6 -0
- package/src/components/select/test/{fixtures.js → fixtures.ts} +1 -1
- package/src/components/spinner/{leu-spinner.js → leu-spinner.ts} +6 -0
- package/src/components/table/{Table.js → Table.ts} +0 -1
- package/src/components/table/{leu-table.js → leu-table.ts} +6 -0
- package/src/components/visually-hidden/{VisuallyHidden.js → VisuallyHidden.ts} +0 -1
- package/src/components/visually-hidden/{leu-visually-hidden.js → leu-visually-hidden.ts} +6 -0
- package/src/docs/theme.mdx +14 -10
- package/src/global.d.ts +11 -0
- package/src/index.ts +17 -0
- package/src/lib/{LeuElement.js → LeuElement.ts} +15 -6
- package/src/lib/{a11y.js → a11y.ts} +2 -2
- package/src/lib/{hasSlotController.js → hasSlotController.ts} +12 -25
- package/stylelint.config.mjs +1 -1
- package/tsconfig.build.json +6 -4
- package/tsconfig.json +7 -10
- package/web-dev-server.config.mjs +11 -1
- package/web-test-runner.config.mjs +11 -2
- package/babel.config.json +0 -3
- package/dist/Accordion.d.ts.map +0 -1
- package/dist/Button.d.ts.map +0 -1
- package/dist/ButtonGroup.d.ts.map +0 -1
- package/dist/Checkbox.d.ts.map +0 -1
- package/dist/CheckboxGroup.d.ts.map +0 -1
- package/dist/Chip.d.ts.map +0 -1
- package/dist/ChipGroup.d.ts.map +0 -1
- package/dist/ChipLink.d.ts.map +0 -1
- package/dist/ChipRemovable.d.ts.map +0 -1
- package/dist/ChipSelectable.d.ts.map +0 -1
- package/dist/Dialog.d.ts.map +0 -1
- package/dist/Dropdown.d.ts.map +0 -1
- package/dist/Icon.d.ts.map +0 -1
- package/dist/Input.d.ts.map +0 -1
- package/dist/LeuElement-Dd6zm9XF.d.ts +0 -7
- package/dist/LeuElement-Dd6zm9XF.d.ts.map +0 -1
- package/dist/LeuElement-Dd6zm9XF.js +0 -70
- package/dist/Menu.d.ts.map +0 -1
- package/dist/MenuItem.d.ts.map +0 -1
- package/dist/Pagination.d.ts.map +0 -1
- package/dist/Popup.d.ts.map +0 -1
- package/dist/Radio.d.ts.map +0 -1
- package/dist/RadioGroup.d.ts.map +0 -1
- package/dist/Range.d.ts.map +0 -1
- package/dist/ScrollTop.d.ts.map +0 -1
- package/dist/Select.d.ts.map +0 -1
- package/dist/Spinner.d.ts.map +0 -1
- package/dist/Table.d.ts.map +0 -1
- package/dist/VisuallyHidden.d.ts.map +0 -1
- package/dist/hasSlotController-dQsSUUpb.d.ts +0 -38
- package/dist/hasSlotController-dQsSUUpb.d.ts.map +0 -1
- package/dist/hasSlotController-dQsSUUpb.js +0 -75
- package/dist/leu-accordion.d.ts.map +0 -1
- package/dist/leu-button-group.d.ts.map +0 -1
- package/dist/leu-button.d.ts.map +0 -1
- package/dist/leu-checkbox-group.d.ts.map +0 -1
- package/dist/leu-checkbox.d.ts.map +0 -1
- package/dist/leu-chip-group.d.ts.map +0 -1
- package/dist/leu-chip-link.d.ts.map +0 -1
- package/dist/leu-chip-removable.d.ts.map +0 -1
- package/dist/leu-chip-selectable.d.ts.map +0 -1
- package/dist/leu-dialog.d.ts.map +0 -1
- package/dist/leu-dropdown.d.ts.map +0 -1
- package/dist/leu-icon.d.ts.map +0 -1
- package/dist/leu-input.d.ts.map +0 -1
- package/dist/leu-menu-item.d.ts.map +0 -1
- package/dist/leu-menu.d.ts.map +0 -1
- package/dist/leu-pagination.d.ts.map +0 -1
- package/dist/leu-popup.d.ts.map +0 -1
- package/dist/leu-radio-group.d.ts.map +0 -1
- package/dist/leu-radio.d.ts.map +0 -1
- package/dist/leu-range.d.ts.map +0 -1
- package/dist/leu-scroll-top.d.ts.map +0 -1
- package/dist/leu-select.d.ts.map +0 -1
- package/dist/leu-spinner.d.ts.map +0 -1
- package/dist/leu-table.d.ts.map +0 -1
- package/dist/leu-visually-hidden.d.ts.map +0 -1
- package/index.js +0 -17
- /package/.storybook/{manager.js → manager.ts} +0 -0
- /package/.storybook/{preview.js → preview.ts} +0 -0
- /package/scripts/generate-component/templates/{[namespace]-[name].js → [namespace]-[name].ts} +0 -0
- /package/scripts/generate-component/templates/stories/{[name].stories.js → [name].stories.ts} +0 -0
- /package/scripts/generate-component/templates/test/{[name].test.js → [name].test.ts} +0 -0
- /package/src/components/accordion/test/{accordion.test.js → accordion.test.ts} +0 -0
- /package/src/components/button/stories/{button.stories.js → button.stories.ts} +0 -0
- /package/src/components/button/test/{button.test.js → button.test.ts} +0 -0
- /package/src/components/button-group/stories/{button-group.stories.js → button-group.stories.ts} +0 -0
- /package/src/components/button-group/test/{button-group.test.js → button-group.test.ts} +0 -0
- /package/src/components/checkbox/stories/{checkbox-group.stories.js → checkbox-group.stories.ts} +0 -0
- /package/src/components/checkbox/stories/{checkbox.stories.js → checkbox.stories.ts} +0 -0
- /package/src/components/checkbox/test/{checkbox-group.test.js → checkbox-group.test.ts} +0 -0
- /package/src/components/checkbox/test/{checkbox.test.js → checkbox.test.ts} +0 -0
- /package/src/components/chip/{ChipLink.js → ChipLink.ts} +0 -0
- /package/src/components/chip/{ChipRemovable.js → ChipRemovable.ts} +0 -0
- /package/src/components/chip/{ChipSelectable.js → ChipSelectable.ts} +0 -0
- /package/src/components/chip/{exports.js → exports.ts} +0 -0
- /package/src/components/chip/stories/{chip-group.stories.js → chip-group.stories.ts} +0 -0
- /package/src/components/chip/stories/{chip-link.stories.js → chip-link.stories.ts} +0 -0
- /package/src/components/chip/stories/{chip-removable.stories.js → chip-removable.stories.ts} +0 -0
- /package/src/components/chip/stories/{chip-selectable.stories.js → chip-selectable.stories.ts} +0 -0
- /package/src/components/chip/test/{chip-group.test.js → chip-group.test.ts} +0 -0
- /package/src/components/chip/test/{chip-link.test.js → chip-link.test.ts} +0 -0
- /package/src/components/chip/test/{chip-removable.test.js → chip-removable.test.ts} +0 -0
- /package/src/components/chip/test/{chip-selectable.test.js → chip-selectable.test.ts} +0 -0
- /package/src/components/chip/test/{chip.test.js → chip.test.ts} +0 -0
- /package/src/components/dialog/stories/{dialog.stories.js → dialog.stories.ts} +0 -0
- /package/src/components/dialog/test/{dialog.test.js → dialog.test.ts} +0 -0
- /package/src/components/dropdown/stories/{dropdown.stories.js → dropdown.stories.ts} +0 -0
- /package/src/components/dropdown/test/{dropdown.test.js → dropdown.test.ts} +0 -0
- /package/src/components/icon/{paths.js → paths.ts} +0 -0
- /package/src/components/icon/stories/{icon.stories.js → icon.stories.ts} +0 -0
- /package/src/components/icon/test/{icon.test.js → icon.test.ts} +0 -0
- /package/src/components/input/stories/{input.stories.js → input.stories.ts} +0 -0
- /package/src/components/input/test/{input.test.js → input.test.ts} +0 -0
- /package/src/components/menu/stories/{menu-item.stories.js → menu-item.stories.ts} +0 -0
- /package/src/components/menu/stories/{menu.stories.js → menu.stories.ts} +0 -0
- /package/src/components/menu/test/{menu-item.test.js → menu-item.test.ts} +0 -0
- /package/src/components/menu/test/{menu.test.js → menu.test.ts} +0 -0
- /package/src/components/pagination/stories/{pagination.stories.js → pagination.stories.ts} +0 -0
- /package/src/components/pagination/test/{pagination.test.js → pagination.test.ts} +0 -0
- /package/src/components/popup/stories/{popup.stories.js → popup.stories.ts} +0 -0
- /package/src/components/popup/test/{popup.test.js → popup.test.ts} +0 -0
- /package/src/components/radio/stories/{radio-group.stories.js → radio-group.stories.ts} +0 -0
- /package/src/components/radio/stories/{radio.stories.js → radio.stories.ts} +0 -0
- /package/src/components/radio/test/{radio-group.test.js → radio-group.test.ts} +0 -0
- /package/src/components/radio/test/{radio.test.js → radio.test.ts} +0 -0
- /package/src/components/range/{Range.js → Range.ts} +0 -0
- /package/src/components/range/stories/{range-slider.stories.js → range-slider.stories.ts} +0 -0
- /package/src/components/range/test/{range-test.js → range.test.ts} +0 -0
- /package/src/components/scroll-top/stories/{scroll-top.stories.js → scroll-top.stories.ts} +0 -0
- /package/src/components/scroll-top/test/{scroll-top.test.js → scroll-top.test.ts} +0 -0
- /package/src/components/select/stories/{select.stories.js → select.stories.ts} +0 -0
- /package/src/components/select/test/{select.test.js → select.test.ts} +0 -0
- /package/src/components/spinner/{Spinner.js → Spinner.ts} +0 -0
- /package/src/components/spinner/stories/{spinner.stories.js → spinner.stories.ts} +0 -0
- /package/src/components/spinner/test/{spinner.test.js → spinner.test.ts} +0 -0
- /package/src/components/table/stories/{table.stories.js → table.stories.ts} +0 -0
- /package/src/components/table/test/{table.test.js → table.test.ts} +0 -0
- /package/src/components/visually-hidden/stories/{visually-hidden.stories.js → visually-hidden.stories.ts} +0 -0
- /package/src/components/visually-hidden/test/{visually-hidden.test.js → visually-hidden.test.ts} +0 -0
- /package/src/lib/{utils.js → utils.ts} +0 -0
- /package/src/styles/{style.stories.js → style.stories.ts} +0 -0
package/dist/CheckboxGroup.d.ts
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
|
+
|
|
1
5
|
/**
|
|
2
6
|
* @tagname leu-checkbox-group
|
|
3
7
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
declare class LeuCheckboxGroup extends LeuElement {
|
|
9
|
+
static styles: lit.CSSResultGroup[];
|
|
10
|
+
static properties: {
|
|
11
|
+
orientation: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
reflect: boolean;
|
|
14
|
+
};
|
|
15
|
+
label: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
reflect: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
constructor();
|
|
21
|
+
get value(): any;
|
|
9
22
|
handleSlotChange(): void;
|
|
10
23
|
handleItems(): void;
|
|
11
|
-
render():
|
|
24
|
+
render(): lit_html.TemplateResult<1>;
|
|
12
25
|
}
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
|
|
27
|
+
export { LeuCheckboxGroup };
|
package/dist/CheckboxGroup.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
1
|
import { css, html } from 'lit';
|
|
3
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
|
|
4
4
|
|
|
5
5
|
var css_248z = css`:host {
|
|
6
6
|
--group-font-regular: var(--leu-font-family-regular);
|
|
@@ -37,44 +37,40 @@ var css_248z = css`:host {
|
|
|
37
37
|
* @tagname leu-checkbox-group
|
|
38
38
|
*/
|
|
39
39
|
class LeuCheckboxGroup extends LeuElement {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
/** @type {"horizontal" | "vertical"} */
|
|
43
|
+
this.orientation = "horizontal";
|
|
44
|
+
this.items = [];
|
|
45
|
+
}
|
|
46
|
+
get value() {
|
|
47
|
+
return this.items.filter((i) => i.checked).map((i) => i.value);
|
|
48
|
+
}
|
|
49
|
+
handleSlotChange() {
|
|
50
|
+
this.handleItems();
|
|
51
|
+
}
|
|
52
|
+
handleItems() {
|
|
53
|
+
this.items = Array.from(this.querySelectorAll(":scope > *:not([slot])"));
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
const fieldsetClasses = {
|
|
57
|
+
fieldset: "true",
|
|
58
|
+
"fieldset--vertical": this.orientation === "vertical",
|
|
59
|
+
};
|
|
60
|
+
return html `
|
|
61
61
|
<fieldset class=${classMap(fieldsetClasses)}>
|
|
62
|
-
${this.label
|
|
62
|
+
${this.label
|
|
63
|
+
? html `<legend class="legend">${this.label}</legend>`
|
|
64
|
+
: html ``}
|
|
63
65
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
64
66
|
</fieldset>
|
|
65
67
|
`;
|
|
66
|
-
|
|
68
|
+
}
|
|
67
69
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
type: String,
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
label: {
|
|
75
|
-
type: String,
|
|
76
|
-
reflect: true
|
|
77
|
-
}
|
|
78
|
-
});
|
|
70
|
+
LeuCheckboxGroup.styles = [LeuElement.styles, css_248z];
|
|
71
|
+
LeuCheckboxGroup.properties = {
|
|
72
|
+
orientation: { type: String, reflect: true },
|
|
73
|
+
label: { type: String, reflect: true },
|
|
74
|
+
};
|
|
79
75
|
|
|
80
76
|
export { LeuCheckboxGroup };
|
package/dist/Chip.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as lit from 'lit';
|
|
2
|
+
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
3
|
+
|
|
4
|
+
declare class LeuChipBase extends LeuElement {
|
|
5
|
+
static styles: lit.CSSResultGroup[];
|
|
6
|
+
/** @internal */
|
|
7
|
+
static shadowRootOptions: {
|
|
8
|
+
delegatesFocus: boolean;
|
|
9
|
+
mode: ShadowRootMode;
|
|
10
|
+
serializable?: boolean;
|
|
11
|
+
slotAssignment?: SlotAssignmentMode;
|
|
12
|
+
customElements?: CustomElementRegistry;
|
|
13
|
+
registry?: CustomElementRegistry;
|
|
14
|
+
};
|
|
15
|
+
static properties: {
|
|
16
|
+
inverted: {
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
reflect: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
constructor();
|
|
3
22
|
}
|
|
4
|
-
|
|
5
|
-
|
|
23
|
+
|
|
24
|
+
export { LeuChipBase };
|
package/dist/Chip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
|
|
2
2
|
import { css } from 'lit';
|
|
3
3
|
|
|
4
4
|
var css_248z = css`:host *::before,
|
|
@@ -146,24 +146,20 @@ var css_248z = css`:host *::before,
|
|
|
146
146
|
`;
|
|
147
147
|
|
|
148
148
|
/* Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=21161-184433&mode=design&t=Kjo5VDiqivihn8dh-11 */
|
|
149
|
-
|
|
150
149
|
class LeuChipBase extends LeuElement {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
constructor() {
|
|
151
|
+
super();
|
|
152
|
+
this.inverted = false;
|
|
153
|
+
}
|
|
155
154
|
}
|
|
156
|
-
|
|
155
|
+
LeuChipBase.styles = [LeuElement.styles, css_248z];
|
|
157
156
|
/** @internal */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
reflect: true
|
|
166
|
-
}
|
|
167
|
-
});
|
|
157
|
+
LeuChipBase.shadowRootOptions = {
|
|
158
|
+
...LeuElement.shadowRootOptions,
|
|
159
|
+
delegatesFocus: true,
|
|
160
|
+
};
|
|
161
|
+
LeuChipBase.properties = {
|
|
162
|
+
inverted: { type: Boolean, reflect: true },
|
|
163
|
+
};
|
|
168
164
|
|
|
169
165
|
export { LeuChipBase };
|
package/dist/ChipGroup.d.ts
CHANGED
|
@@ -1,22 +1,49 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
|
|
4
|
+
|
|
5
|
+
declare const SELECTION_MODES: Readonly<{
|
|
6
|
+
single: "single";
|
|
7
|
+
multiple: "multiple";
|
|
8
|
+
none: "none";
|
|
9
|
+
}>;
|
|
1
10
|
/**
|
|
2
11
|
* @slot - Place leu-chip-* elements inside this slot
|
|
3
12
|
* @cssproperty --leu-chip-group-gap - The gap between the chips
|
|
4
13
|
* @tagname leu-chip-group
|
|
5
14
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
declare class LeuChipGroup extends LeuElement {
|
|
16
|
+
static styles: lit.CSSResultGroup[];
|
|
17
|
+
static properties: {
|
|
18
|
+
inverted: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
reflect: boolean;
|
|
21
|
+
};
|
|
22
|
+
selectionMode: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
attribute: string;
|
|
25
|
+
reflect: boolean;
|
|
26
|
+
};
|
|
27
|
+
headingLevel: {
|
|
28
|
+
type: NumberConstructor;
|
|
29
|
+
attribute: string;
|
|
30
|
+
reflect: boolean;
|
|
31
|
+
};
|
|
32
|
+
label: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
reflect: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
constructor();
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
disconnectedCallback(): void;
|
|
40
|
+
get value(): any;
|
|
13
41
|
/**
|
|
14
42
|
* Checks the items with the given values.
|
|
15
43
|
* If the selectionMode is single, only the first item with the given value is checked.
|
|
16
44
|
* @param {string[]} valueList
|
|
17
45
|
*/
|
|
18
|
-
set value(valueList:
|
|
19
|
-
get value(): string[];
|
|
46
|
+
set value(valueList: any);
|
|
20
47
|
/**
|
|
21
48
|
* Determines the heading tag of the accordion toggle.
|
|
22
49
|
* The headingLevel shouldn't be used directly to render the heading tag
|
|
@@ -25,12 +52,11 @@ export class LeuChipGroup extends LeuElement {
|
|
|
25
52
|
* @internal
|
|
26
53
|
*/
|
|
27
54
|
_getHeadingTag(): string;
|
|
28
|
-
|
|
55
|
+
/** @internal */
|
|
56
|
+
handleInput: (e: any) => void;
|
|
57
|
+
/** @internal */
|
|
58
|
+
handleSlotChange: (e: any) => void;
|
|
59
|
+
render(): lit_html.TemplateResult;
|
|
29
60
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
multiple: "multiple";
|
|
33
|
-
none: "none";
|
|
34
|
-
}>;
|
|
35
|
-
import { L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
36
|
-
//# sourceMappingURL=ChipGroup.d.ts.map
|
|
61
|
+
|
|
62
|
+
export { LeuChipGroup, SELECTION_MODES };
|
package/dist/ChipGroup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as _defineProperty, L as LeuElement } from './LeuElement-Dd6zm9XF.js';
|
|
2
1
|
import { unsafeStatic, html } from 'lit/static-html.js';
|
|
2
|
+
import { L as LeuElement } from './LeuElement-x8UlIDDl.js';
|
|
3
3
|
import { css } from 'lit';
|
|
4
4
|
|
|
5
5
|
var css_248z = css`.label {
|
|
@@ -21,137 +21,111 @@ var css_248z = css`.label {
|
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
/* Figma https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=131766-248643&mode=design&t=Kjo5VDiqivihn8dh-11 */
|
|
24
|
-
|
|
25
24
|
const SELECTION_MODES = Object.freeze({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
single: "single",
|
|
26
|
+
multiple: "multiple",
|
|
27
|
+
none: "none",
|
|
29
28
|
});
|
|
30
|
-
|
|
31
29
|
/**
|
|
32
30
|
* @slot - Place leu-chip-* elements inside this slot
|
|
33
31
|
* @cssproperty --leu-chip-group-gap - The gap between the chips
|
|
34
32
|
* @tagname leu-chip-group
|
|
35
33
|
*/
|
|
36
34
|
class LeuChipGroup extends LeuElement {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
/** @internal */
|
|
38
|
+
this.handleInput = (e) => {
|
|
39
|
+
if (this.selectionMode === SELECTION_MODES.single) {
|
|
40
|
+
this.items.forEach((item) => {
|
|
41
|
+
item.checked = item === e.target; // eslint-disable-line no-param-reassign
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/** @internal */
|
|
46
|
+
this.handleSlotChange = (e) => {
|
|
47
|
+
const slot = e.target;
|
|
48
|
+
const items = slot.assignedElements({ flatten: true });
|
|
49
|
+
this.items = items;
|
|
50
|
+
};
|
|
51
|
+
this.inverted = false;
|
|
52
|
+
this.headingLevel = 2;
|
|
53
|
+
this.label = "";
|
|
54
|
+
/** @internal */
|
|
55
|
+
this.items = [];
|
|
56
|
+
/** @type {"single" | "multiple" | "none"} */
|
|
57
|
+
this.selectionMode = SELECTION_MODES.none;
|
|
58
|
+
}
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
super.connectedCallback();
|
|
61
|
+
/**
|
|
62
|
+
* It is technically possible to add an event listener to the host element
|
|
63
|
+
* before it is connected to the dom. In that case the outside event listener would
|
|
64
|
+
* be called before the following event listener. But at this point multiple
|
|
65
|
+
* radio chips could be selected at the same time because `handleInput` hasn't been
|
|
66
|
+
* called yet. That's why we use the capture phase.
|
|
67
|
+
*/
|
|
68
|
+
this.addEventListener("input", this.handleInput, { capture: true });
|
|
69
|
+
}
|
|
70
|
+
disconnectedCallback() {
|
|
71
|
+
super.disconnectedCallback();
|
|
72
|
+
this.removeEventListener("input", this.handleInput, { capture: true });
|
|
73
|
+
}
|
|
74
|
+
get value() {
|
|
75
|
+
return this.items.filter((i) => i.checked).map((i) => i.getValue());
|
|
76
|
+
}
|
|
68
77
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* radio chips could be selected at the same time because `handleInput` hasn't been
|
|
73
|
-
* called yet. That's why we use the capture phase.
|
|
78
|
+
* Checks the items with the given values.
|
|
79
|
+
* If the selectionMode is single, only the first item with the given value is checked.
|
|
80
|
+
* @param {string[]} valueList
|
|
74
81
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
get value() {
|
|
86
|
-
return this.items.filter(i => i.checked).map(i => i.getValue());
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Checks the items with the given values.
|
|
91
|
-
* If the selectionMode is single, only the first item with the given value is checked.
|
|
92
|
-
* @param {string[]} valueList
|
|
93
|
-
*/
|
|
94
|
-
set value(valueList) {
|
|
95
|
-
let hasChanged = false;
|
|
96
|
-
for (const item of this.items) {
|
|
97
|
-
item.checked = hasChanged ? false : valueList.includes(item.value);
|
|
98
|
-
if (this.selectionMode === SELECTION_MODES.single && item.checked) {
|
|
99
|
-
hasChanged = true;
|
|
100
|
-
}
|
|
82
|
+
set value(valueList) {
|
|
83
|
+
let hasChanged = false;
|
|
84
|
+
for (const item of this.items) {
|
|
85
|
+
item.checked = hasChanged ? false : valueList.includes(item.value);
|
|
86
|
+
if (this.selectionMode === SELECTION_MODES.single && item.checked) {
|
|
87
|
+
hasChanged = true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
101
90
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Determines the heading tag of the accordion toggle.
|
|
93
|
+
* The headingLevel shouldn't be used directly to render the heading tag
|
|
94
|
+
* in order to avoid XSS issues.
|
|
95
|
+
* @returns {String} The heading tag of the accordion toggle.
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
_getHeadingTag() {
|
|
99
|
+
let level = 2;
|
|
100
|
+
if (this.headingLevel > 0 && this.headingLevel < 7) {
|
|
101
|
+
level = this.headingLevel;
|
|
102
|
+
}
|
|
103
|
+
return `h${level}`;
|
|
115
104
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return html`
|
|
124
|
-
${this.label ? html`<${unsafeStatic(hTag)} class="label">
|
|
105
|
+
render() {
|
|
106
|
+
const hTag = this._getHeadingTag();
|
|
107
|
+
/* The eslint rules don't recognize html import from lit/static-html.js */
|
|
108
|
+
/* eslint-disable lit/binding-positions, lit/no-invalid-html */
|
|
109
|
+
return html `
|
|
110
|
+
${this.label
|
|
111
|
+
? html `<${unsafeStatic(hTag)} class="label">
|
|
125
112
|
<span class="label">${this.label}</span>
|
|
126
|
-
</${unsafeStatic(hTag)}>`
|
|
113
|
+
</${unsafeStatic(hTag)}>`
|
|
114
|
+
: ""}
|
|
127
115
|
<slot
|
|
128
116
|
class="group"
|
|
129
117
|
part="group"
|
|
130
118
|
@slotchange=${this.handleSlotChange}
|
|
131
119
|
></slot>
|
|
132
120
|
`;
|
|
133
|
-
|
|
121
|
+
}
|
|
134
122
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
type:
|
|
139
|
-
reflect: true
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
type: String,
|
|
143
|
-
attribute: "selection-mode",
|
|
144
|
-
reflect: true
|
|
145
|
-
},
|
|
146
|
-
headingLevel: {
|
|
147
|
-
type: Number,
|
|
148
|
-
attribute: "heading-level",
|
|
149
|
-
reflect: true
|
|
150
|
-
},
|
|
151
|
-
label: {
|
|
152
|
-
type: String,
|
|
153
|
-
reflect: true
|
|
154
|
-
}
|
|
155
|
-
});
|
|
123
|
+
LeuChipGroup.styles = [LeuElement.styles, css_248z];
|
|
124
|
+
LeuChipGroup.properties = {
|
|
125
|
+
inverted: { type: Boolean, reflect: true },
|
|
126
|
+
selectionMode: { type: String, attribute: "selection-mode", reflect: true },
|
|
127
|
+
headingLevel: { type: Number, attribute: "heading-level", reflect: true },
|
|
128
|
+
label: { type: String, reflect: true },
|
|
129
|
+
};
|
|
156
130
|
|
|
157
131
|
export { LeuChipGroup, SELECTION_MODES };
|
package/dist/ChipLink.d.ts
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { LeuChipBase } from './Chip.js';
|
|
3
|
+
import 'lit';
|
|
4
|
+
import './LeuElement.d-BevHqLUu.js';
|
|
5
|
+
|
|
6
|
+
declare const SIZES: {
|
|
7
|
+
regular: string;
|
|
8
|
+
large: string;
|
|
9
|
+
};
|
|
1
10
|
/**
|
|
2
11
|
* @tagname leu-chip-link
|
|
3
12
|
* @slot - The content of the chip
|
|
4
13
|
* @prop {keyof typeof SIZES} size - The size of the chip
|
|
5
14
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
declare class LeuChipLink extends LeuChipBase {
|
|
16
|
+
static properties: {
|
|
17
|
+
size: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
reflect: boolean;
|
|
20
|
+
};
|
|
21
|
+
href: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
reflect: boolean;
|
|
24
|
+
};
|
|
25
|
+
inverted: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
reflect: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
constructor();
|
|
31
|
+
render(): lit_html.TemplateResult<1>;
|
|
14
32
|
}
|
|
15
|
-
|
|
16
|
-
|
|
33
|
+
|
|
34
|
+
export { LeuChipLink, SIZES };
|
package/dist/ChipLink.js
CHANGED
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
import { _ as _defineProperty } from './LeuElement-Dd6zm9XF.js';
|
|
2
1
|
import { html } from 'lit';
|
|
3
2
|
import { LeuChipBase } from './Chip.js';
|
|
3
|
+
import './LeuElement-x8UlIDDl.js';
|
|
4
4
|
|
|
5
5
|
const SIZES = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
regular: "regular",
|
|
7
|
+
large: "large",
|
|
8
8
|
};
|
|
9
|
-
|
|
10
9
|
/**
|
|
11
10
|
* @tagname leu-chip-link
|
|
12
11
|
* @slot - The content of the chip
|
|
13
12
|
* @prop {keyof typeof SIZES} size - The size of the chip
|
|
14
13
|
*/
|
|
15
14
|
class LeuChipLink extends LeuChipBase {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.inverted = false;
|
|
18
|
+
this.size = SIZES.regular;
|
|
19
|
+
this.href = "";
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return html `<a href=${this.href} class="button">
|
|
24
23
|
<span class="label"><slot></slot></span>
|
|
25
24
|
</a>`;
|
|
26
|
-
|
|
25
|
+
}
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
type: String,
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
href: {
|
|
35
|
-
type: String,
|
|
36
|
-
reflect: true
|
|
37
|
-
}
|
|
38
|
-
});
|
|
27
|
+
LeuChipLink.properties = {
|
|
28
|
+
...LeuChipBase.properties,
|
|
29
|
+
size: { type: String, reflect: true },
|
|
30
|
+
href: { type: String, reflect: true },
|
|
31
|
+
};
|
|
39
32
|
|
|
40
33
|
export { LeuChipLink, SIZES };
|
package/dist/ChipRemovable.d.ts
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { LeuChipBase } from './Chip.js';
|
|
3
|
+
import { LeuIcon } from './Icon.js';
|
|
4
|
+
import 'lit';
|
|
5
|
+
import './LeuElement.d-BevHqLUu.js';
|
|
6
|
+
|
|
1
7
|
/**
|
|
2
8
|
* @slot - The content of the chip
|
|
3
9
|
* @tagname leu-chip-removable
|
|
4
10
|
* @fires remove - Dispatched when the user clicks on the chip
|
|
5
11
|
* @prop {string} value - The value of the chip.
|
|
6
12
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
declare class LeuChipRemovable extends LeuChipBase {
|
|
14
|
+
static dependencies: {
|
|
15
|
+
"leu-icon": typeof LeuIcon;
|
|
16
|
+
};
|
|
17
|
+
static properties: {
|
|
18
|
+
value: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
reflect: boolean;
|
|
21
|
+
};
|
|
22
|
+
inverted: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
reflect: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
constructor();
|
|
9
28
|
/**
|
|
10
29
|
* Returns the value of the chip. If `value` is not set, it will return the text content
|
|
11
30
|
* @returns {string}
|
|
12
31
|
*/
|
|
13
|
-
getValue():
|
|
32
|
+
getValue(): any;
|
|
14
33
|
handleClick(): void;
|
|
15
|
-
render():
|
|
34
|
+
render(): lit_html.TemplateResult<1>;
|
|
16
35
|
}
|
|
17
|
-
|
|
18
|
-
|
|
36
|
+
|
|
37
|
+
export { LeuChipRemovable };
|