@statistikzh/leu 0.2.0 → 0.4.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/.github/workflows/deploy-github-pages.yaml +33 -0
- package/.storybook/main.js +27 -1
- package/.storybook/manager-head.html +1 -0
- package/.storybook/manager.js +9 -0
- package/.storybook/preview-head.html +1 -1
- package/.storybook/preview.js +59 -5
- package/.storybook/static/logo.svg +19 -0
- package/.storybook/theme.js +7 -0
- package/CHANGELOG.md +43 -0
- package/README.md +1 -1
- package/dist/Button.js +39 -30
- package/dist/ButtonGroup.js +5 -7
- package/dist/Checkbox.js +107 -88
- package/dist/CheckboxGroup.js +43 -38
- package/dist/{Chip-389013ff.js → Chip-dac7337d.js} +7 -2
- package/dist/ChipGroup.js +4 -6
- package/dist/ChipLink.js +6 -8
- package/dist/ChipRemovable.js +4 -7
- package/dist/ChipSelectable.js +10 -10
- package/dist/Dropdown.js +57 -27
- package/dist/Input.js +59 -43
- package/dist/Menu.js +2 -5
- package/dist/MenuItem.js +34 -17
- package/dist/Pagination.js +57 -55
- package/dist/Radio.js +13 -10
- package/dist/RadioGroup.js +43 -40
- package/dist/Select.js +57 -44
- package/dist/Table.js +147 -125
- package/dist/{defineElement-ba770aed.js → _rollupPluginBabelHelpers-20f659f4.js} +1 -15
- package/dist/defineElement-47d4f665.js +15 -0
- package/dist/index.js +29 -19
- package/dist/leu-button-group.js +7 -3
- package/dist/leu-button.js +6 -3
- package/dist/leu-checkbox-group.js +6 -3
- package/dist/leu-checkbox.js +6 -3
- package/dist/leu-chip-group.js +6 -3
- package/dist/leu-chip-link.js +7 -4
- package/dist/leu-chip-removable.js +7 -4
- package/dist/leu-chip-selectable.js +7 -4
- package/dist/leu-dropdown.js +13 -3
- package/dist/leu-input.js +7 -3
- package/dist/leu-menu-item.js +8 -3
- package/dist/leu-menu.js +6 -3
- package/dist/leu-pagination.js +8 -3
- package/dist/leu-popup-4bf6f1f4.js +216 -0
- package/dist/leu-radio-group.js +6 -3
- package/dist/leu-radio.js +6 -3
- package/dist/leu-select.js +14 -3
- package/dist/leu-table.js +9 -3
- package/package.json +29 -12
- package/scripts/generate-component/templates/[Name].js +0 -5
- package/scripts/generate-component/templates/[name].css +1 -1
- package/scripts/generate-component/templates/[namespace]-[name].js +5 -2
- package/src/components/accordion/Accordion.js +3 -9
- package/src/components/accordion/leu-accordion.js +5 -2
- package/src/components/accordion/stories/accordion.stories.js +7 -4
- package/src/components/accordion/test/accordion.test.js +92 -2
- package/src/components/breadcrumb/Breadcrumb.js +310 -0
- package/src/components/breadcrumb/breadcrumb.css +114 -0
- package/src/components/breadcrumb/leu-breadcrumb.js +6 -0
- package/src/components/breadcrumb/stories/breadcrumb.stories.js +73 -0
- package/src/components/breadcrumb/test/breadcrumb.test.js +141 -0
- package/src/components/button/Button.js +22 -27
- package/src/components/button/button.css +3 -3
- package/src/components/button/leu-button.js +5 -2
- package/src/components/button/stories/button.stories.js +58 -37
- package/src/components/button/test/button.test.js +112 -2
- package/src/components/button-group/ButtonGroup.js +1 -7
- package/src/components/button-group/leu-button-group.js +5 -2
- package/src/components/button-group/stories/button-group.stories.js +6 -0
- package/src/components/button-group/test/button-group.test.js +79 -3
- package/src/components/checkbox/Checkbox.js +9 -89
- package/src/components/checkbox/CheckboxGroup.js +9 -39
- package/src/components/checkbox/checkbox-group.css +29 -0
- package/src/components/checkbox/checkbox.css +76 -0
- package/src/components/checkbox/leu-checkbox-group.js +5 -2
- package/src/components/checkbox/leu-checkbox.js +5 -2
- package/src/components/checkbox/stories/checkbox-group.stories.js +44 -21
- package/src/components/checkbox/stories/checkbox.stories.js +7 -1
- package/src/components/checkbox/test/checkbox-group.test.js +124 -0
- package/src/components/checkbox/test/checkbox.test.js +72 -59
- package/src/components/chip/Chip.js +2 -1
- package/src/components/chip/ChipGroup.js +1 -6
- package/src/components/chip/ChipLink.js +2 -8
- package/src/components/chip/ChipRemovable.js +1 -6
- package/src/components/chip/ChipSelectable.js +4 -9
- package/src/components/chip/exports.js +4 -10
- package/src/components/chip/leu-chip-group.js +5 -2
- package/src/components/chip/leu-chip-link.js +5 -2
- package/src/components/chip/leu-chip-removable.js +5 -2
- package/src/components/chip/leu-chip-selectable.js +5 -2
- package/src/components/chip/stories/chip-group.stories.js +18 -6
- package/src/components/chip/stories/chip-link.stories.js +16 -4
- package/src/components/chip/stories/chip-removable.stories.js +15 -4
- package/src/components/chip/stories/chip-selectable.stories.js +13 -3
- package/src/components/chip/test/chip-group.test.js +124 -0
- package/src/components/chip/test/chip-link.test.js +58 -0
- package/src/components/chip/test/chip-removable.test.js +79 -0
- package/src/components/chip/test/chip-selectable.test.js +95 -0
- package/src/components/chip/test/chip.test.js +1 -1
- package/src/components/dropdown/Dropdown.js +53 -25
- package/src/components/dropdown/dropdown.css +1 -2
- package/src/components/dropdown/leu-dropdown.js +5 -2
- package/src/components/dropdown/stories/dropdown.stories.js +11 -5
- package/src/components/dropdown/test/dropdown.test.js +6 -6
- package/src/components/icon/icon.js +1 -1
- package/src/components/icon/test/icon.test.js +66 -0
- package/src/components/input/Input.js +33 -39
- package/src/components/input/input.css +9 -6
- package/src/components/input/leu-input.js +5 -2
- package/src/components/input/stories/input.stories.js +8 -2
- package/src/components/input/test/input.test.js +431 -4
- package/src/components/menu/Menu.js +0 -5
- package/src/components/menu/MenuItem.js +22 -15
- package/src/components/menu/leu-menu-item.js +5 -2
- package/src/components/menu/leu-menu.js +5 -2
- package/src/components/menu/menu-item.css +5 -2
- package/src/components/menu/stories/menu-item.stories.js +13 -4
- package/src/components/menu/stories/menu.stories.js +11 -5
- package/src/components/menu/test/menu-item.test.js +180 -0
- package/src/components/menu/test/menu.test.js +10 -2
- package/src/components/pagination/Pagination.js +53 -65
- package/src/components/pagination/leu-pagination.js +5 -2
- package/src/components/pagination/stories/pagination.stories.js +17 -9
- package/src/components/pagination/test/pagination.test.js +191 -5
- package/src/components/popup/Popup.js +200 -0
- package/src/components/popup/leu-popup.js +6 -0
- package/src/components/popup/popup.css +27 -0
- package/src/components/popup/stories/popup.stories.js +58 -0
- package/src/components/popup/test/popup.test.js +29 -0
- package/src/components/radio/Radio.js +5 -10
- package/src/components/radio/RadioGroup.js +7 -39
- package/src/components/radio/leu-radio-group.js +5 -2
- package/src/components/radio/leu-radio.js +5 -2
- package/src/components/radio/radio-group.css +29 -0
- package/src/components/radio/stories/radio-group.stories.js +38 -19
- package/src/components/radio/stories/radio.stories.js +7 -1
- package/src/components/radio/test/radio-group.test.js +86 -0
- package/src/components/radio/test/radio.test.js +108 -17
- package/src/components/select/Select.js +35 -32
- package/src/components/select/leu-select.js +5 -2
- package/src/components/select/select.css +13 -13
- package/src/components/select/stories/select.stories.js +15 -168
- package/src/components/select/test/fixtures.js +162 -0
- package/src/components/select/test/select.test.js +236 -12
- package/src/components/table/Table.js +48 -123
- package/src/components/table/leu-table.js +5 -2
- package/src/components/table/stories/table.stories.js +20 -10
- package/src/components/table/table.css +99 -0
- package/src/components/table/test/table.test.js +1 -1
- package/src/lib/utils.js +17 -0
- package/{web-dev-server-storybook.config.mjs → web-dev-server.config.mjs} +1 -2
- package/web-test-runner.config.mjs +15 -2
package/dist/index.js
CHANGED
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton
|
|
2
|
-
export { LeuButtonGroup
|
|
3
|
-
export { LeuCheckbox
|
|
4
|
-
export { LeuCheckboxGroup
|
|
5
|
-
export { LeuChipGroup
|
|
6
|
-
export { LeuChipLink
|
|
7
|
-
export { LeuChipRemovable
|
|
8
|
-
export { LeuChipSelectable
|
|
9
|
-
export { LeuDropdown
|
|
10
|
-
export { LeuInput, SIZE_TYPES
|
|
11
|
-
export { LeuMenu
|
|
12
|
-
export { LeuMenuItem
|
|
13
|
-
export { LeuPagination
|
|
14
|
-
export { LeuRadio
|
|
15
|
-
export { LeuRadioGroup
|
|
16
|
-
export { LeuSelect
|
|
17
|
-
export { LeuTable
|
|
18
|
-
import './
|
|
1
|
+
export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton } from './Button.js';
|
|
2
|
+
export { LeuButtonGroup } from './ButtonGroup.js';
|
|
3
|
+
export { LeuCheckbox } from './Checkbox.js';
|
|
4
|
+
export { LeuCheckboxGroup } from './CheckboxGroup.js';
|
|
5
|
+
export { LeuChipGroup } from './ChipGroup.js';
|
|
6
|
+
export { LeuChipLink } from './ChipLink.js';
|
|
7
|
+
export { LeuChipRemovable } from './ChipRemovable.js';
|
|
8
|
+
export { LeuChipSelectable } from './ChipSelectable.js';
|
|
9
|
+
export { LeuDropdown } from './Dropdown.js';
|
|
10
|
+
export { LeuInput, SIZE_TYPES } from './Input.js';
|
|
11
|
+
export { LeuMenu } from './Menu.js';
|
|
12
|
+
export { LeuMenuItem } from './MenuItem.js';
|
|
13
|
+
export { LeuPagination } from './Pagination.js';
|
|
14
|
+
export { LeuRadio } from './Radio.js';
|
|
15
|
+
export { LeuRadioGroup } from './RadioGroup.js';
|
|
16
|
+
export { LeuSelect } from './Select.js';
|
|
17
|
+
export { LeuTable } from './Table.js';
|
|
18
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
19
19
|
import 'lit';
|
|
20
20
|
import 'lit/directives/class-map.js';
|
|
21
21
|
import './icon-03e86700.js';
|
|
22
|
-
import './
|
|
22
|
+
import './leu-button.js';
|
|
23
|
+
import './defineElement-47d4f665.js';
|
|
24
|
+
import './Chip-dac7337d.js';
|
|
25
|
+
import './leu-menu.js';
|
|
26
|
+
import './leu-menu-item.js';
|
|
27
|
+
import './leu-popup-4bf6f1f4.js';
|
|
28
|
+
import '@floating-ui/dom';
|
|
23
29
|
import 'lit/directives/if-defined.js';
|
|
30
|
+
import 'lit/directives/live.js';
|
|
24
31
|
import 'lit/directives/ref.js';
|
|
32
|
+
import 'lit/static-html.js';
|
|
25
33
|
import 'lit/directives/map.js';
|
|
34
|
+
import './leu-input.js';
|
|
26
35
|
import 'lit/directives/style-map.js';
|
|
36
|
+
import './leu-pagination.js';
|
package/dist/leu-button-group.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuButtonGroup } from './ButtonGroup.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
5
|
+
import './leu-button.js';
|
|
4
6
|
import './Button.js';
|
|
5
7
|
import 'lit/directives/class-map.js';
|
|
6
8
|
import './icon-03e86700.js';
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
defineElement("button-group", LeuButtonGroup);
|
|
11
|
+
|
|
12
|
+
export { LeuButtonGroup };
|
package/dist/leu-button.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuButton } from './Button.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
import 'lit/directives/class-map.js';
|
|
5
6
|
import './icon-03e86700.js';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
defineElement("button", LeuButton);
|
|
9
|
+
|
|
10
|
+
export { LeuButton };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuCheckboxGroup } from './CheckboxGroup.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
import 'lit/directives/class-map.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
defineElement("checkbox-group", LeuCheckboxGroup);
|
|
8
|
+
|
|
9
|
+
export { LeuCheckboxGroup };
|
package/dist/leu-checkbox.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuCheckbox } from './Checkbox.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
import './icon-03e86700.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
defineElement("checkbox", LeuCheckbox);
|
|
8
|
+
|
|
9
|
+
export { LeuCheckbox };
|
package/dist/leu-chip-group.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuChipGroup } from './ChipGroup.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
defineElement("chip-group", LeuChipGroup);
|
|
7
|
+
|
|
8
|
+
export { LeuChipGroup };
|
package/dist/leu-chip-link.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuChipLink } from './ChipLink.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
|
-
import './Chip-
|
|
5
|
+
import './Chip-dac7337d.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
defineElement("chip-link", LeuChipLink);
|
|
8
|
+
|
|
9
|
+
export { LeuChipLink };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuChipRemovable } from './ChipRemovable.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
|
-
import './Chip-
|
|
5
|
+
import './Chip-dac7337d.js';
|
|
5
6
|
import './icon-03e86700.js';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
defineElement("chip-removable", LeuChipRemovable);
|
|
9
|
+
|
|
10
|
+
export { LeuChipRemovable };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuChipSelectable } from './ChipSelectable.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
|
-
import './Chip-
|
|
5
|
+
import './Chip-dac7337d.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
defineElement("chip-selectable", LeuChipSelectable);
|
|
8
|
+
|
|
9
|
+
export { LeuChipSelectable };
|
package/dist/leu-dropdown.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuDropdown } from './Dropdown.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
5
|
+
import './leu-button.js';
|
|
4
6
|
import './Button.js';
|
|
5
7
|
import 'lit/directives/class-map.js';
|
|
6
8
|
import './icon-03e86700.js';
|
|
9
|
+
import './leu-menu.js';
|
|
7
10
|
import './Menu.js';
|
|
11
|
+
import './leu-menu-item.js';
|
|
8
12
|
import './MenuItem.js';
|
|
13
|
+
import 'lit/static-html.js';
|
|
14
|
+
import 'lit/directives/if-defined.js';
|
|
15
|
+
import './leu-popup-4bf6f1f4.js';
|
|
16
|
+
import '@floating-ui/dom';
|
|
9
17
|
|
|
10
|
-
|
|
18
|
+
defineElement("dropdown", LeuDropdown);
|
|
19
|
+
|
|
20
|
+
export { LeuDropdown };
|
package/dist/leu-input.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuInput } from './Input.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
import 'lit/directives/class-map.js';
|
|
5
6
|
import 'lit/directives/if-defined.js';
|
|
7
|
+
import 'lit/directives/live.js';
|
|
6
8
|
import 'lit/directives/ref.js';
|
|
7
9
|
import './icon-03e86700.js';
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
defineElement("input", LeuInput);
|
|
12
|
+
|
|
13
|
+
export { LeuInput };
|
package/dist/leu-menu-item.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuMenuItem } from './MenuItem.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
5
|
+
import 'lit/static-html.js';
|
|
6
|
+
import 'lit/directives/if-defined.js';
|
|
4
7
|
import './icon-03e86700.js';
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
defineElement("menu-item", LeuMenuItem);
|
|
10
|
+
|
|
11
|
+
export { LeuMenuItem };
|
package/dist/leu-menu.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuMenu } from './Menu.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
defineElement("menu", LeuMenu);
|
|
7
|
+
|
|
8
|
+
export { LeuMenu };
|
package/dist/leu-pagination.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuPagination } from './Pagination.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
5
|
+
import 'lit/directives/live.js';
|
|
6
|
+
import './leu-button.js';
|
|
4
7
|
import './Button.js';
|
|
5
8
|
import 'lit/directives/class-map.js';
|
|
6
9
|
import './icon-03e86700.js';
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
defineElement("pagination", LeuPagination);
|
|
12
|
+
|
|
13
|
+
export { LeuPagination };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
|
+
import { css, LitElement, html } from 'lit';
|
|
4
|
+
import { autoUpdate, size, flip, shift, computePosition } from '@floating-ui/dom';
|
|
5
|
+
|
|
6
|
+
var css_248z = css`:host,
|
|
7
|
+
:host * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host {
|
|
12
|
+
--popup-font-regular: var(--leu-font-regular);
|
|
13
|
+
--popup-font-black: var(--leu-font-black);
|
|
14
|
+
|
|
15
|
+
font-family: var(--leu-font-regular);
|
|
16
|
+
|
|
17
|
+
font-family: var(--popup-font-regular);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.popup {
|
|
21
|
+
display: none;
|
|
22
|
+
|
|
23
|
+
max-width: none;
|
|
24
|
+
|
|
25
|
+
max-width: var(--auto-size-available-width, none);
|
|
26
|
+
max-height: none;
|
|
27
|
+
max-height: var(--auto-size-available-height, none);
|
|
28
|
+
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
left: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* TODO: Should visibility be a matter of the popup component? */
|
|
35
|
+
|
|
36
|
+
:host([active]) .popup {
|
|
37
|
+
display: block;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @tagname leu-popup
|
|
43
|
+
*/
|
|
44
|
+
class LeuPopup extends LitElement {
|
|
45
|
+
constructor() {
|
|
46
|
+
super();
|
|
47
|
+
this.anchorEl = null;
|
|
48
|
+
this.cleanup = undefined;
|
|
49
|
+
this.flip = false;
|
|
50
|
+
this.shift = false;
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
super.disconnectedCallback();
|
|
54
|
+
this.stop();
|
|
55
|
+
}
|
|
56
|
+
updated(changedProperties) {
|
|
57
|
+
if (changedProperties.has("active")) {
|
|
58
|
+
if (this.active) {
|
|
59
|
+
this.start();
|
|
60
|
+
} else {
|
|
61
|
+
this.stop();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (changedProperties.has("anchor")) {
|
|
65
|
+
this.handleAnchorChange();
|
|
66
|
+
}
|
|
67
|
+
if (this.active) {
|
|
68
|
+
this.reposition();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
get popupEl() {
|
|
72
|
+
return this.renderRoot?.querySelector(".popup") ?? null;
|
|
73
|
+
}
|
|
74
|
+
start() {
|
|
75
|
+
if (!this.anchorEl || !this.active) return;
|
|
76
|
+
this.cleanup = autoUpdate(this.anchorEl, this.popupEl, () => {
|
|
77
|
+
this.reposition();
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
stop() {
|
|
81
|
+
this.cleanup?.();
|
|
82
|
+
this.style.removeProperty("--auto-size-available-width");
|
|
83
|
+
this.style.removeProperty("--auto-size-available-height");
|
|
84
|
+
}
|
|
85
|
+
reposition() {
|
|
86
|
+
if (!this.anchorEl || !this.popupEl || !this.active) return;
|
|
87
|
+
const middleware = [];
|
|
88
|
+
if (this.matchSize) {
|
|
89
|
+
middleware.push(size({
|
|
90
|
+
apply: ({
|
|
91
|
+
rects
|
|
92
|
+
}) => {
|
|
93
|
+
const matchWidth = this.matchSize === "width" || this.matchSize === "both";
|
|
94
|
+
const matchHeight = this.matchSize === "height" || this.matchSize === "both";
|
|
95
|
+
this.popupEl.style.width = matchWidth ? `${rects.reference.width}px` : "";
|
|
96
|
+
this.popupEl.style.height = matchHeight ? `${rects.reference.height}px` : "";
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
} else {
|
|
100
|
+
// Cleanup styles if we're not matching width/height
|
|
101
|
+
this.popupEl.style.width = "";
|
|
102
|
+
this.popupEl.style.height = "";
|
|
103
|
+
}
|
|
104
|
+
if (this.flip) {
|
|
105
|
+
middleware.push(flip());
|
|
106
|
+
}
|
|
107
|
+
if (this.shift) {
|
|
108
|
+
middleware.push(shift({
|
|
109
|
+
padding: this.shiftPadding
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
if (this.autoSize) {
|
|
113
|
+
middleware.push(size({
|
|
114
|
+
padding: this.autoSizePadding,
|
|
115
|
+
apply: ({
|
|
116
|
+
availableWidth,
|
|
117
|
+
availableHeight
|
|
118
|
+
}) => {
|
|
119
|
+
const setMaxWidth = this.autoSize === "width" || this.autoSize === "both";
|
|
120
|
+
const setMaxHeight = this.autoSize === "height" || this.autoSize === "both";
|
|
121
|
+
if (setMaxHeight) {
|
|
122
|
+
this.style.setProperty("--auto-size-available-height", `${availableHeight}px`);
|
|
123
|
+
} else {
|
|
124
|
+
this.style.removeProperty("--auto-size-available-height");
|
|
125
|
+
}
|
|
126
|
+
if (setMaxWidth) {
|
|
127
|
+
this.style.setProperty("--auto-size-available-width", `${availableWidth}px`);
|
|
128
|
+
} else {
|
|
129
|
+
this.style.removeProperty("--auto-size-available-width");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}));
|
|
133
|
+
} else {
|
|
134
|
+
// Cleanup styles if we're not auto-sizing
|
|
135
|
+
this.style.removeProperty("--auto-size-available-width");
|
|
136
|
+
this.style.removeProperty("--auto-size-available-height");
|
|
137
|
+
}
|
|
138
|
+
computePosition(this.anchorEl, this.popupEl, {
|
|
139
|
+
placement: this.placement,
|
|
140
|
+
middleware
|
|
141
|
+
}).then(({
|
|
142
|
+
x,
|
|
143
|
+
y
|
|
144
|
+
}) => {
|
|
145
|
+
Object.assign(this.popupEl.style, {
|
|
146
|
+
left: `${x}px`,
|
|
147
|
+
top: `${y}px`
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
handleAnchorChange() {
|
|
152
|
+
if (this.anchor && typeof this.anchor === "string") {
|
|
153
|
+
const root = this.getRootNode();
|
|
154
|
+
this.anchorEl = root.getElementById(this.anchor);
|
|
155
|
+
} else if (this.anchor instanceof HTMLElement) {
|
|
156
|
+
this.anchorEl = this.anchor;
|
|
157
|
+
} else {
|
|
158
|
+
this.anchorEl = this.querySelector("[slot=anchor]");
|
|
159
|
+
}
|
|
160
|
+
if (this.anchorEl instanceof HTMLSlotElement) {
|
|
161
|
+
[this.anchorEl] = this.anchorEl.assignedElements({
|
|
162
|
+
flatten: true
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
if (this.anchorEl) {
|
|
166
|
+
this.start();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
render() {
|
|
170
|
+
return html`
|
|
171
|
+
<slot name="anchor" @slotchange=${this.handleAnchorChange}></slot>
|
|
172
|
+
<div class="popup">
|
|
173
|
+
<slot> </slot>
|
|
174
|
+
</div>
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
_defineProperty(LeuPopup, "styles", css_248z);
|
|
179
|
+
_defineProperty(LeuPopup, "shadowRootOptions", {
|
|
180
|
+
...LitElement.shadowRootOptions,
|
|
181
|
+
delegatesFocus: true
|
|
182
|
+
});
|
|
183
|
+
_defineProperty(LeuPopup, "properties", {
|
|
184
|
+
anchor: {},
|
|
185
|
+
active: {
|
|
186
|
+
type: Boolean
|
|
187
|
+
},
|
|
188
|
+
/**
|
|
189
|
+
* @type {"top"|"top-start"|"top-end"|"bottom"|"bottom-start"|"bottom-end"|"left"|"left-start"|"left-end"|"right"|"right-start"|"right-end"}
|
|
190
|
+
*/
|
|
191
|
+
placement: {
|
|
192
|
+
type: String
|
|
193
|
+
},
|
|
194
|
+
flip: {
|
|
195
|
+
type: Boolean
|
|
196
|
+
},
|
|
197
|
+
shift: {
|
|
198
|
+
type: Boolean
|
|
199
|
+
},
|
|
200
|
+
shiftPadding: {
|
|
201
|
+
type: Number
|
|
202
|
+
},
|
|
203
|
+
/** @type {"width" | "height" | "both"} */
|
|
204
|
+
matchSize: {
|
|
205
|
+
type: String
|
|
206
|
+
},
|
|
207
|
+
/** @type {"width" | "height" | "both"} */
|
|
208
|
+
autoSize: {
|
|
209
|
+
type: String
|
|
210
|
+
},
|
|
211
|
+
autoSizePadding: {
|
|
212
|
+
type: Number
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
defineElement("popup", LeuPopup);
|
package/dist/leu-radio-group.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuRadioGroup } from './RadioGroup.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
import 'lit/directives/class-map.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
defineElement("radio-group", LeuRadioGroup);
|
|
8
|
+
|
|
9
|
+
export { LeuRadioGroup };
|
package/dist/leu-radio.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuRadio } from './Radio.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
defineElement("radio", LeuRadio);
|
|
7
|
+
|
|
8
|
+
export { LeuRadio };
|
package/dist/leu-select.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuSelect } from './Select.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
import 'lit/directives/class-map.js';
|
|
5
6
|
import 'lit/directives/map.js';
|
|
6
7
|
import 'lit/directives/if-defined.js';
|
|
7
8
|
import 'lit/directives/ref.js';
|
|
8
9
|
import './icon-03e86700.js';
|
|
10
|
+
import './leu-button.js';
|
|
9
11
|
import './Button.js';
|
|
12
|
+
import './leu-menu.js';
|
|
10
13
|
import './Menu.js';
|
|
14
|
+
import './leu-menu-item.js';
|
|
11
15
|
import './MenuItem.js';
|
|
16
|
+
import 'lit/static-html.js';
|
|
17
|
+
import './leu-input.js';
|
|
12
18
|
import './Input.js';
|
|
19
|
+
import 'lit/directives/live.js';
|
|
20
|
+
import './leu-popup-4bf6f1f4.js';
|
|
21
|
+
import '@floating-ui/dom';
|
|
13
22
|
|
|
14
|
-
|
|
23
|
+
defineElement("select", LeuSelect);
|
|
24
|
+
|
|
25
|
+
export { LeuSelect };
|
package/dist/leu-table.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { d as defineElement } from './defineElement-47d4f665.js';
|
|
2
|
+
import { LeuTable } from './Table.js';
|
|
3
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
3
4
|
import 'lit';
|
|
4
5
|
import 'lit/directives/class-map.js';
|
|
5
6
|
import 'lit/directives/style-map.js';
|
|
6
7
|
import 'lit/directives/ref.js';
|
|
7
8
|
import './icon-03e86700.js';
|
|
9
|
+
import './leu-pagination.js';
|
|
8
10
|
import './Pagination.js';
|
|
11
|
+
import 'lit/directives/live.js';
|
|
12
|
+
import './leu-button.js';
|
|
9
13
|
import './Button.js';
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
defineElement("table", LeuTable);
|
|
16
|
+
|
|
17
|
+
export { LeuTable };
|
package/package.json
CHANGED
|
@@ -3,15 +3,21 @@
|
|
|
3
3
|
"description": "UI component library of the canton of zurich",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "statistikzh",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.4.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/statistikzh/leu.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/statistikzh/leu/",
|
|
10
15
|
"scripts": {
|
|
11
16
|
"analyze": "cem analyze --litelement --globs \"src/**/*.js\"",
|
|
12
17
|
"build": "rimraf dist && npm run build:js && npm run build:css",
|
|
13
18
|
"build:js": "rollup -c rollup.config.js",
|
|
14
|
-
"build:css": "postcss src/styles/theme.css -o dist/theme.css",
|
|
19
|
+
"build:css": "postcss src/styles/theme.css -o dist/theme.css && cp dist/theme.css .storybook/static/",
|
|
20
|
+
"watch:css": "nodemon --watch 'src/styles/*' -e css --exec npm run build:css",
|
|
15
21
|
"lint": "npm run lint:eslint && npm run lint:prettier",
|
|
16
22
|
"lint:eslint": "eslint --ext .js,.mjs,.html . --ignore-path .gitignore ",
|
|
17
23
|
"lint:prettier": "prettier \"**/*.{js,mjs,md,html,json}\" --check --ignore-path .gitignore",
|
|
@@ -22,10 +28,12 @@
|
|
|
22
28
|
"test": "web-test-runner --coverage",
|
|
23
29
|
"test:watch": "web-test-runner --watch",
|
|
24
30
|
"prepare": "husky install",
|
|
25
|
-
"storybook": "npm run
|
|
26
|
-
"
|
|
31
|
+
"storybook": "npm run storybook:start",
|
|
32
|
+
"storybook:start": "npm run analyze && npm run watch:css & storybook dev -p 8080 --no-open",
|
|
33
|
+
"storybook:build": "npm run analyze && npm run build:css && storybook build --output-dir docs"
|
|
27
34
|
},
|
|
28
35
|
"dependencies": {
|
|
36
|
+
"@floating-ui/dom": "^1.6.3",
|
|
29
37
|
"lit": "^3.0.2"
|
|
30
38
|
},
|
|
31
39
|
"devDependencies": {
|
|
@@ -34,25 +42,32 @@
|
|
|
34
42
|
"@commitlint/config-conventional": "^17.7.0",
|
|
35
43
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
36
44
|
"@open-wc/eslint-config": "^9.2.1",
|
|
37
|
-
"@open-wc/testing": "^
|
|
45
|
+
"@open-wc/testing": "^4.0.0",
|
|
38
46
|
"@rollup/plugin-babel": "^6.0.4",
|
|
47
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
39
48
|
"@rollup/plugin-json": "^6.0.0",
|
|
49
|
+
"@storybook/addon-designs": "^7.0.9",
|
|
50
|
+
"@storybook/addon-essentials": "^7.6.10",
|
|
51
|
+
"@storybook/addon-links": "^7.6.10",
|
|
52
|
+
"@storybook/blocks": "^7.6.10",
|
|
53
|
+
"@storybook/web-components": "^7.6.10",
|
|
40
54
|
"@web/dev-server": "^0.1.34",
|
|
41
55
|
"@web/dev-server-rollup": "^0.5.2",
|
|
42
|
-
"@web/
|
|
43
|
-
"@web/storybook-builder": "^0.1.0",
|
|
56
|
+
"@web/storybook-builder": "^0.1.2",
|
|
44
57
|
"@web/storybook-framework-web-components": "^0.1.1",
|
|
45
|
-
"@web/test-runner": "^0.
|
|
46
|
-
"@web/test-runner-commands": "^0.
|
|
47
|
-
"@web/test-runner-playwright": "^0.
|
|
58
|
+
"@web/test-runner": "^0.18.0",
|
|
59
|
+
"@web/test-runner-commands": "^0.9.0",
|
|
60
|
+
"@web/test-runner-playwright": "^0.11.0",
|
|
61
|
+
"@whitespace/storybook-addon-html": "^5.1.6",
|
|
48
62
|
"arg": "^5.0.2",
|
|
49
63
|
"es-dev-server": "^2.1.0",
|
|
50
|
-
"esbuild": "^0.
|
|
64
|
+
"esbuild": "^0.20.0",
|
|
51
65
|
"eslint": "^8.31.0",
|
|
52
66
|
"eslint-config-prettier": "^8.3.0",
|
|
53
67
|
"eslint-plugin-storybook": "^0.6.14",
|
|
54
68
|
"husky": "^8.0.0",
|
|
55
69
|
"lint-staged": "^10.5.4",
|
|
70
|
+
"nodemon": "^3.0.2",
|
|
56
71
|
"postcss": "^8.4.31",
|
|
57
72
|
"postcss-cli": "^10.1.0",
|
|
58
73
|
"postcss-import": "^15.1.0",
|
|
@@ -61,12 +76,14 @@
|
|
|
61
76
|
"prettier": "^2.4.1",
|
|
62
77
|
"react": "^18.2.0",
|
|
63
78
|
"react-dom": "^18.2.0",
|
|
79
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
64
80
|
"rimraf": "^5.0.5",
|
|
65
81
|
"rollup": "^3.29.4",
|
|
66
82
|
"rollup-plugin-esbuild": "^6.0.2",
|
|
67
83
|
"rollup-plugin-postcss": "^4.0.2",
|
|
68
84
|
"rollup-plugin-postcss-lit": "^2.1.0",
|
|
69
|
-
"
|
|
85
|
+
"sinon": "^17.0.1",
|
|
86
|
+
"storybook": "^7.6.10",
|
|
70
87
|
"stylelint": "^15.10.3",
|
|
71
88
|
"stylelint-config-standard": "^34.0.0"
|
|
72
89
|
},
|