@statistikzh/leu 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +1 -2
- package/CHANGELOG.md +32 -0
- package/custom-elements-manifest.config.js +46 -0
- package/dist/Accordion.d.ts +31 -0
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/Accordion.js +257 -0
- package/dist/Breadcrumb.d.ts +69 -0
- package/dist/Breadcrumb.d.ts.map +1 -0
- package/dist/Breadcrumb.js +392 -0
- package/dist/Button-5326c982.d.ts +84 -0
- package/dist/Button-5326c982.d.ts.map +1 -0
- package/dist/Button-5326c982.js +555 -0
- package/dist/Button.d.ts +2 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.js +6 -420
- package/dist/ButtonGroup.d.ts +24 -0
- package/dist/ButtonGroup.d.ts.map +1 -0
- package/dist/ButtonGroup.js +70 -39
- package/dist/Checkbox.d.ts +13 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.js +2 -2
- package/dist/CheckboxGroup.d.ts +13 -0
- package/dist/CheckboxGroup.d.ts.map +1 -0
- package/dist/CheckboxGroup.js +3 -3
- package/dist/Chip.d.ts +5 -0
- package/dist/Chip.d.ts.map +1 -0
- package/dist/{Chip-dac7337d.js → Chip.js} +16 -5
- package/dist/ChipGroup.d.ts +28 -0
- package/dist/ChipGroup.d.ts.map +1 -0
- package/dist/ChipGroup.js +62 -5
- package/dist/ChipLink.d.ts +15 -0
- package/dist/ChipLink.d.ts.map +1 -0
- package/dist/ChipLink.js +1 -1
- package/dist/ChipRemovable.d.ts +13 -0
- package/dist/ChipRemovable.d.ts.map +1 -0
- package/dist/ChipRemovable.js +2 -2
- package/dist/ChipSelectable.d.ts +22 -0
- package/dist/ChipSelectable.d.ts.map +1 -0
- package/dist/ChipSelectable.js +5 -5
- package/dist/Dropdown.d.ts +15 -0
- package/dist/Dropdown.d.ts.map +1 -0
- package/dist/Dropdown.js +30 -7
- package/dist/Input.d.ts +154 -0
- package/dist/Input.d.ts.map +1 -0
- package/dist/Input.js +13 -7
- package/dist/Menu.d.ts +8 -0
- package/dist/Menu.d.ts.map +1 -0
- package/dist/MenuItem.d.ts +21 -0
- package/dist/MenuItem.d.ts.map +1 -0
- package/dist/MenuItem.js +3 -3
- package/dist/Pagination.d.ts +27 -0
- package/dist/Pagination.d.ts.map +1 -0
- package/dist/Pagination.js +93 -61
- package/dist/Popup.d.ts +18 -0
- package/dist/Popup.d.ts.map +1 -0
- package/dist/{leu-popup-4bf6f1f4.js → Popup.js} +4 -5
- package/dist/Radio.d.ts +12 -0
- package/dist/Radio.d.ts.map +1 -0
- package/dist/Radio.js +2 -2
- package/dist/RadioGroup.d.ts +20 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +3 -3
- package/dist/ScrollTop.d.ts +19 -0
- package/dist/ScrollTop.d.ts.map +1 -0
- package/dist/ScrollTop.js +122 -0
- package/dist/Select.d.ts +98 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +27 -82
- package/dist/Table.d.ts +48 -0
- package/dist/Table.d.ts.map +1 -0
- package/dist/Table.js +7 -4
- package/dist/VisuallyHidden.d.ts +8 -0
- package/dist/VisuallyHidden.d.ts.map +1 -0
- package/dist/VisuallyHidden.js +28 -0
- package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +3 -0
- package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +1 -0
- package/dist/defineElement-40372b4b.d.ts +9 -0
- package/dist/defineElement-40372b4b.d.ts.map +1 -0
- package/dist/{defineElement-47d4f665.js → defineElement-40372b4b.js} +1 -1
- package/dist/icon-03e86700.d.ts +11 -0
- package/dist/icon-03e86700.d.ts.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -8
- package/dist/leu-accordion.d.ts +3 -0
- package/dist/leu-accordion.d.ts.map +1 -0
- package/dist/leu-accordion.js +9 -0
- package/dist/leu-breadcrumb.d.ts +3 -0
- package/dist/leu-breadcrumb.d.ts.map +1 -0
- package/dist/leu-breadcrumb.js +23 -0
- package/dist/leu-button-group.d.ts +3 -0
- package/dist/leu-button-group.d.ts.map +1 -0
- package/dist/leu-button-group.js +1 -5
- package/dist/leu-button.d.ts +3 -0
- package/dist/leu-button.d.ts.map +1 -0
- package/dist/leu-button.js +3 -2
- package/dist/leu-checkbox-group.d.ts +3 -0
- package/dist/leu-checkbox-group.d.ts.map +1 -0
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.d.ts +3 -0
- package/dist/leu-checkbox.d.ts.map +1 -0
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.d.ts +3 -0
- package/dist/leu-chip-group.d.ts.map +1 -0
- package/dist/leu-chip-group.js +2 -1
- package/dist/leu-chip-link.d.ts +3 -0
- package/dist/leu-chip-link.d.ts.map +1 -0
- package/dist/leu-chip-link.js +2 -2
- package/dist/leu-chip-removable.d.ts +3 -0
- package/dist/leu-chip-removable.d.ts.map +1 -0
- package/dist/leu-chip-removable.js +2 -2
- package/dist/leu-chip-selectable.d.ts +3 -0
- package/dist/leu-chip-selectable.d.ts.map +1 -0
- package/dist/leu-chip-selectable.js +2 -2
- package/dist/leu-dropdown.d.ts +3 -0
- package/dist/leu-dropdown.d.ts.map +1 -0
- package/dist/leu-dropdown.js +5 -4
- package/dist/leu-input.d.ts +3 -0
- package/dist/leu-input.d.ts.map +1 -0
- package/dist/leu-input.js +1 -1
- package/dist/leu-menu-item.d.ts +3 -0
- package/dist/leu-menu-item.d.ts.map +1 -0
- package/dist/leu-menu-item.js +1 -1
- package/dist/leu-menu.d.ts +3 -0
- package/dist/leu-menu.d.ts.map +1 -0
- package/dist/leu-menu.js +1 -1
- package/dist/leu-pagination.d.ts +3 -0
- package/dist/leu-pagination.d.ts.map +1 -0
- package/dist/leu-pagination.js +5 -2
- package/dist/leu-popup.d.ts +3 -0
- package/dist/leu-popup.d.ts.map +1 -0
- package/dist/leu-popup.js +9 -0
- package/dist/leu-radio-group.d.ts +3 -0
- package/dist/leu-radio-group.d.ts.map +1 -0
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.d.ts +3 -0
- package/dist/leu-radio.d.ts.map +1 -0
- package/dist/leu-radio.js +1 -1
- package/dist/leu-scroll-top.d.ts +3 -0
- package/dist/leu-scroll-top.d.ts.map +1 -0
- package/dist/leu-scroll-top.js +14 -0
- package/dist/leu-select.d.ts +3 -0
- package/dist/leu-select.d.ts.map +1 -0
- package/dist/leu-select.js +4 -3
- package/dist/leu-table.d.ts +3 -0
- package/dist/leu-table.d.ts.map +1 -0
- package/dist/leu-table.js +5 -2
- package/dist/leu-visually-hidden.d.ts +3 -0
- package/dist/leu-visually-hidden.d.ts.map +1 -0
- package/dist/leu-visually-hidden.js +8 -0
- package/dist/theme.css +386 -2
- package/dist/utils-65469421.d.ts +16 -0
- package/dist/utils-65469421.d.ts.map +1 -0
- package/dist/utils-65469421.js +35 -0
- package/dist/vscode.html-custom-data.json +579 -0
- package/dist/vue/index.d.ts +678 -0
- package/dist/web-types.json +1076 -0
- package/index.js +3 -0
- package/package.json +30 -12
- package/postcss.config.cjs +2 -0
- package/rollup.config.js +21 -40
- package/scripts/generate-component/templates/[name].css +2 -2
- package/scripts/postcss-leu-font-styles.cjs +160 -0
- package/src/components/accordion/accordion.css +2 -2
- package/src/components/accordion/stories/accordion.stories.js +2 -1
- package/src/components/accordion/test/accordion.test.js +4 -2
- package/src/components/breadcrumb/Breadcrumb.js +2 -1
- package/src/components/breadcrumb/breadcrumb.css +2 -13
- package/src/components/button/Button.js +69 -8
- package/src/components/button/button.css +23 -2
- package/src/components/button/stories/button.stories.js +43 -90
- package/src/components/button/test/button.test.js +90 -19
- package/src/components/button-group/ButtonGroup.js +76 -34
- package/src/components/button-group/stories/button-group.stories.js +13 -6
- package/src/components/button-group/test/button-group.test.js +38 -31
- package/src/components/checkbox/checkbox-group.css +2 -2
- package/src/components/checkbox/checkbox.css +1 -1
- package/src/components/chip/ChipGroup.js +42 -2
- package/src/components/chip/ChipRemovable.js +1 -1
- package/src/components/chip/ChipSelectable.js +4 -4
- package/src/components/chip/chip-group.css +12 -2
- package/src/components/chip/chip.css +14 -3
- package/src/components/chip/stories/chip-group.stories.js +100 -46
- package/src/components/chip/test/chip-removable.test.js +3 -3
- package/src/components/dropdown/Dropdown.js +24 -3
- package/src/components/dropdown/dropdown.css +4 -0
- package/src/components/input/Input.js +7 -4
- package/src/components/input/input.css +2 -2
- package/src/components/input/stories/input.stories.js +13 -0
- package/src/components/input/test/input.test.js +1 -0
- package/src/components/menu/menu-item.css +3 -3
- package/src/components/pagination/Pagination.js +91 -60
- package/src/components/pagination/pagination.css +6 -1
- package/src/components/pagination/stories/pagination.stories.js +15 -2
- package/src/components/pagination/test/pagination.test.js +15 -15
- package/src/components/popup/popup.css +2 -2
- package/src/components/popup/stories/popup.stories.js +1 -1
- package/src/components/radio/radio-group.css +2 -2
- package/src/components/radio/radio.css +1 -1
- package/src/components/scroll-top/ScrollTop.js +87 -0
- package/src/components/scroll-top/leu-scroll-top.js +6 -0
- package/src/components/scroll-top/scroll-top.css +34 -0
- package/src/components/scroll-top/stories/scroll-top.stories.js +217 -0
- package/src/components/scroll-top/test/scroll-top.test.js +22 -0
- package/src/components/select/Select.js +24 -6
- package/src/components/select/select.css +2 -2
- package/src/components/table/table.css +2 -2
- package/src/components/visually-hidden/VisuallyHidden.js +13 -0
- package/src/components/visually-hidden/leu-visually-hidden.js +6 -0
- package/src/components/visually-hidden/stories/visually-hidden.stories.js +22 -0
- package/src/components/visually-hidden/test/visually-hidden.test.js +36 -0
- package/src/components/visually-hidden/visually-hidden.css +10 -0
- package/src/lib/defineElement.js +1 -1
- package/src/lib/hasSlotController.js +5 -3
- package/src/lib/utils.js +21 -3
- package/src/styles/custom-properties.css +6 -2
- package/src/styles/font-definitions.json +202 -0
- package/stylelint.config.mjs +2 -0
- package/tsconfig.build.json +21 -0
- package/tsconfig.json +16 -0
package/dist/Button.js
CHANGED
|
@@ -1,420 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
display: inline-block;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
button {
|
|
11
|
-
font-family: var(--leu-font-black);
|
|
12
|
-
text-align: center;
|
|
13
|
-
-webkit-appearance: none;
|
|
14
|
-
-moz-appearance: none;
|
|
15
|
-
appearance: none;
|
|
16
|
-
transition: background 0.1s ease;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
border: 1px solid transparent;
|
|
19
|
-
border-radius: 2px;
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
-moz-column-gap: 8px;
|
|
23
|
-
column-gap: 8px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
button.round {
|
|
27
|
-
border-radius: 50%;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
button:disabled {
|
|
31
|
-
cursor: not-allowed;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
button:focus-visible {
|
|
35
|
-
border: 1px solid var(--leu-color-black-0);
|
|
36
|
-
outline: 2px solid var(--leu-color-func-cyan);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
button.inverted:focus-visible {
|
|
40
|
-
border: 1px solid var(--leu-color-black-100);
|
|
41
|
-
outline: 2px solid var(--leu-color-black-0);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
:host([fluid]) button {
|
|
45
|
-
width: 100%;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* size - regular */
|
|
50
|
-
|
|
51
|
-
button.regular {
|
|
52
|
-
padding: 12px 24px;
|
|
53
|
-
font-size: 16px;
|
|
54
|
-
line-height: 24px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
button.regular.icon {
|
|
58
|
-
padding: 12px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/* size - small */
|
|
62
|
-
|
|
63
|
-
button.small {
|
|
64
|
-
padding: 6px 24px;
|
|
65
|
-
font-size: 14px;
|
|
66
|
-
line-height: 20px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
button.small.icon {
|
|
70
|
-
padding: 8px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* primary */
|
|
74
|
-
|
|
75
|
-
button.primary {
|
|
76
|
-
color: var(--leu-color-black-0);
|
|
77
|
-
background: var(--leu-color-black-100);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
button.primary:hover {
|
|
81
|
-
color: var(--leu-color-black-0);
|
|
82
|
-
background: var(--leu-color-black-transp-80);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
button.primary.active {
|
|
86
|
-
color: var(--leu-color-black-0);
|
|
87
|
-
background: var(--leu-color-black-100);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
button.primary:disabled {
|
|
91
|
-
color: var(--leu-color-black-0);
|
|
92
|
-
background: var(--leu-color-black-transp-20);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/* secondary */
|
|
96
|
-
|
|
97
|
-
button.secondary {
|
|
98
|
-
color: var(--leu-color-black-transp-60);
|
|
99
|
-
background: var(--leu-color-black-transp-10);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
button.secondary:hover {
|
|
103
|
-
color: var(--leu-color-black-100);
|
|
104
|
-
background: var(--leu-color-black-transp-20);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
button.secondary.active {
|
|
108
|
-
color: var(--leu-color-black-0);
|
|
109
|
-
background: var(--leu-color-black-100);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
button.secondary:disabled {
|
|
113
|
-
color: var(--leu-color-black-transp-20);
|
|
114
|
-
background: var(--leu-color-black-transp-5);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* ghost */
|
|
118
|
-
|
|
119
|
-
button.ghost {
|
|
120
|
-
background: transparent;
|
|
121
|
-
padding: 0 0.5rem;
|
|
122
|
-
color: var(--leu-color-black-60);
|
|
123
|
-
font-family: var(--leu-font-regular);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
button.ghost:hover {
|
|
127
|
-
color: var(--leu-color-black-100);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
button.ghost.active {
|
|
131
|
-
color: var(--leu-color-black-100);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
button.ghost:disabled {
|
|
135
|
-
color: var(--leu-color-black-20);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/* primary + inverted */
|
|
139
|
-
|
|
140
|
-
button.primary.inverted {
|
|
141
|
-
color: var(--leu-color-black-100);
|
|
142
|
-
background: var(--leu-color-black-0);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
button.primary.inverted:hover {
|
|
146
|
-
color: var(--leu-color-black-100);
|
|
147
|
-
background: var(--leu-color-white-transp-70);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
button.primary.inverted.active {
|
|
151
|
-
color: var(--leu-color-black-0);
|
|
152
|
-
background: var(--leu-color-black-100);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
button.primary.inverted:disabled {
|
|
156
|
-
color: var(--leu-color-black-40);
|
|
157
|
-
background: var(--leu-color-white-transp-70);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/* secondary + inverted */
|
|
161
|
-
|
|
162
|
-
button.secondary.inverted {
|
|
163
|
-
color: var(--leu-color-black-0);
|
|
164
|
-
background: var(--leu-color-black-transp-20);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
button.secondary.inverted:hover {
|
|
168
|
-
color: var(--leu-color-black-0);
|
|
169
|
-
background: var(--leu-color-black-transp-40);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
button.secondary.inverted.active {
|
|
173
|
-
color: var(--leu-color-black-100);
|
|
174
|
-
background: var(--leu-color-black-0);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
button.secondary.inverted:disabled {
|
|
178
|
-
color: var(--leu-color-white-transp-70);
|
|
179
|
-
background: var(--leu-color-black-transp-10);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/* ghost + inverted */
|
|
183
|
-
|
|
184
|
-
button.ghost.inverted {
|
|
185
|
-
color: var(--leu-color-black-0);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
button.ghost.inverted:hover {
|
|
189
|
-
color: var(--leu-color-white-transp-70);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
button.ghost.inverted.active {
|
|
193
|
-
color: var(--leu-color-black-0);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
button.ghost.inverted:disabled {
|
|
197
|
-
color: var(--leu-color-black-20);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/* icon-wrapper */
|
|
201
|
-
|
|
202
|
-
.icon-wrapper svg {
|
|
203
|
-
display: block;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.ghost .icon-wrapper--before, .ghost .icon-wrapper--after {
|
|
207
|
-
padding: 0.5rem;
|
|
208
|
-
border-radius: 50%;
|
|
209
|
-
background: var(--leu-color-black-transp-10);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.ghost.active .icon-wrapper--before, .ghost.active .icon-wrapper--after {
|
|
213
|
-
background: var(--leu-color-black-100);
|
|
214
|
-
color: var(--leu-color-black-0);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
.ghost:disabled .icon-wrapper--before {
|
|
218
|
-
background: var(--leu-color-black-transp-5);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.ghost:disabled .icon-wrapper--after {
|
|
222
|
-
background: var(--leu-color-black-transp-5);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/* inverted */
|
|
226
|
-
|
|
227
|
-
.ghost.inverted .icon-wrapper--before, .ghost.inverted .icon-wrapper--after {
|
|
228
|
-
background: var(--leu-color-black-transp-20);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.ghost.inverted:hover .icon-wrapper--before, .ghost.inverted:hover .icon-wrapper--after {
|
|
232
|
-
background: var(--leu-color-black-transp-40);
|
|
233
|
-
color: var(--leu-color-black-0);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.ghost.inverted:disabled .icon-wrapper--before {
|
|
237
|
-
background: var(--leu-color-black-transp-20);
|
|
238
|
-
color: var(--leu-color-white-transp-70);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.ghost.inverted:disabled .icon-wrapper--after {
|
|
242
|
-
background: var(--leu-color-black-transp-20);
|
|
243
|
-
color: var(--leu-color-white-transp-70);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.ghost.active.inverted .icon-wrapper--before, .ghost.active.inverted .icon-wrapper--after {
|
|
247
|
-
background: var(--leu-color-black-0);
|
|
248
|
-
color: var(--leu-color-black-100);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/* Expanded icon */
|
|
252
|
-
|
|
253
|
-
.icon-wrapper--expanded {
|
|
254
|
-
transition: transform 0.1s ease;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
:host([expanded="open"]) .icon-wrapper--expanded {
|
|
258
|
-
transform: rotate(180deg);
|
|
259
|
-
}
|
|
260
|
-
`;
|
|
261
|
-
|
|
262
|
-
/*
|
|
263
|
-
Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=4-1444&mode=design&t=xu5Vii8jXKKCKDez-0
|
|
264
|
-
Live Demo: zh.ch
|
|
265
|
-
*/
|
|
266
|
-
|
|
267
|
-
const BUTTON_VARIANTS = ["primary", "secondary", "ghost"];
|
|
268
|
-
Object.freeze(BUTTON_VARIANTS);
|
|
269
|
-
const BUTTON_SIZES = ["regular", "small"];
|
|
270
|
-
Object.freeze(BUTTON_SIZES);
|
|
271
|
-
const BUTTON_TYPES = ["button", "submit", "reset"];
|
|
272
|
-
Object.freeze(BUTTON_TYPES);
|
|
273
|
-
const BUTTON_EXPANDED_OPTIONS = ["open", "closed"];
|
|
274
|
-
Object.freeze(BUTTON_EXPANDED_OPTIONS);
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* @tagname leu-button
|
|
278
|
-
*/
|
|
279
|
-
class LeuButton extends LitElement {
|
|
280
|
-
constructor() {
|
|
281
|
-
super();
|
|
282
|
-
/** @type {string} */
|
|
283
|
-
this.label = null;
|
|
284
|
-
/** @type {string} */
|
|
285
|
-
this.icon = null;
|
|
286
|
-
/** @type {("before" | "after")} - Only taken into account if Label and no Icon is set */
|
|
287
|
-
this.iconPosition = "before";
|
|
288
|
-
/** @type {string} */
|
|
289
|
-
this.size = "regular";
|
|
290
|
-
/** @type {string} */
|
|
291
|
-
this.variant = "primary";
|
|
292
|
-
/** @type {string} */
|
|
293
|
-
this.type = "button";
|
|
294
|
-
|
|
295
|
-
/** @type {boolean} */
|
|
296
|
-
this.disabled = false;
|
|
297
|
-
/** @type {boolean} - Only taken into account if no Label and an Icon is set */
|
|
298
|
-
this.round = false;
|
|
299
|
-
/** @type {boolean} */
|
|
300
|
-
this.active = false;
|
|
301
|
-
/** @type {boolean} - will be used on dark Background */
|
|
302
|
-
this.inverted = false;
|
|
303
|
-
|
|
304
|
-
/** @type {boolean} - Alters the shape of the button to be full width of its parent container */
|
|
305
|
-
this.fluid = false;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Only taken into account if variant is "ghost"
|
|
309
|
-
* @type {("open" | "closed" | undefined)}
|
|
310
|
-
*/
|
|
311
|
-
this.expanded = undefined;
|
|
312
|
-
}
|
|
313
|
-
getIconSize() {
|
|
314
|
-
return this.size === "small" || this.variant === "ghost" ? 16 : 24;
|
|
315
|
-
}
|
|
316
|
-
renderIconBefore() {
|
|
317
|
-
if (this.icon && this.iconPosition === "before") {
|
|
318
|
-
return html`<div class="icon-wrapper icon-wrapper--before">
|
|
319
|
-
${Icon(this.icon, this.getIconSize())}
|
|
320
|
-
</div>`;
|
|
321
|
-
}
|
|
322
|
-
return nothing;
|
|
323
|
-
}
|
|
324
|
-
renderIconAfter() {
|
|
325
|
-
if (this.icon && this.label && this.iconPosition === "after") {
|
|
326
|
-
return html`<div class="icon-wrapper icon-wrapper--after">
|
|
327
|
-
${Icon(this.icon, this.getIconSize())}
|
|
328
|
-
</div>`;
|
|
329
|
-
}
|
|
330
|
-
return nothing;
|
|
331
|
-
}
|
|
332
|
-
renderExpandingIcon() {
|
|
333
|
-
if (typeof this.expanded !== "undefined" && this.variant === "ghost") {
|
|
334
|
-
return html`<div class="icon-wrapper icon-wrapper--expanded">
|
|
335
|
-
${Icon("angleDropDown", 24)}
|
|
336
|
-
</div>`;
|
|
337
|
-
}
|
|
338
|
-
return nothing;
|
|
339
|
-
}
|
|
340
|
-
render() {
|
|
341
|
-
const cssClasses = {
|
|
342
|
-
icon: !this.label && this.icon,
|
|
343
|
-
round: !this.label && this.icon && this.round,
|
|
344
|
-
active: this.active,
|
|
345
|
-
inverted: this.inverted,
|
|
346
|
-
[this.variant]: true,
|
|
347
|
-
[this.size]: true
|
|
348
|
-
};
|
|
349
|
-
return html`
|
|
350
|
-
<button
|
|
351
|
-
class=${classMap(cssClasses)}
|
|
352
|
-
?disabled=${this.disabled}
|
|
353
|
-
type=${this.type}
|
|
354
|
-
>
|
|
355
|
-
${this.renderIconBefore()} ${this.label} ${this.renderIconAfter()}
|
|
356
|
-
${this.renderExpandingIcon()}
|
|
357
|
-
</button>
|
|
358
|
-
`;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
_defineProperty(LeuButton, "styles", css_248z);
|
|
362
|
-
/**
|
|
363
|
-
* @internal
|
|
364
|
-
*/
|
|
365
|
-
_defineProperty(LeuButton, "shadowRootOptions", {
|
|
366
|
-
...LitElement.shadowRootOptions,
|
|
367
|
-
delegatesFocus: true
|
|
368
|
-
});
|
|
369
|
-
_defineProperty(LeuButton, "properties", {
|
|
370
|
-
label: {
|
|
371
|
-
type: String,
|
|
372
|
-
reflect: true
|
|
373
|
-
},
|
|
374
|
-
icon: {
|
|
375
|
-
type: String,
|
|
376
|
-
reflect: true
|
|
377
|
-
},
|
|
378
|
-
iconPosition: {
|
|
379
|
-
type: String,
|
|
380
|
-
reflect: true
|
|
381
|
-
},
|
|
382
|
-
size: {
|
|
383
|
-
type: String,
|
|
384
|
-
reflect: true
|
|
385
|
-
},
|
|
386
|
-
variant: {
|
|
387
|
-
type: String,
|
|
388
|
-
reflect: true
|
|
389
|
-
},
|
|
390
|
-
type: {
|
|
391
|
-
type: String,
|
|
392
|
-
reflect: true
|
|
393
|
-
},
|
|
394
|
-
disabled: {
|
|
395
|
-
type: Boolean,
|
|
396
|
-
reflect: true
|
|
397
|
-
},
|
|
398
|
-
round: {
|
|
399
|
-
type: Boolean,
|
|
400
|
-
reflect: true
|
|
401
|
-
},
|
|
402
|
-
active: {
|
|
403
|
-
type: Boolean,
|
|
404
|
-
reflect: true
|
|
405
|
-
},
|
|
406
|
-
inverted: {
|
|
407
|
-
type: Boolean,
|
|
408
|
-
reflect: true
|
|
409
|
-
},
|
|
410
|
-
expanded: {
|
|
411
|
-
type: String,
|
|
412
|
-
reflect: true
|
|
413
|
-
},
|
|
414
|
-
fluid: {
|
|
415
|
-
type: Boolean,
|
|
416
|
-
reflect: true
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
export { BUTTON_EXPANDED_OPTIONS, BUTTON_SIZES, BUTTON_TYPES, BUTTON_VARIANTS, LeuButton };
|
|
1
|
+
import './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
|
+
import 'lit';
|
|
3
|
+
import 'lit/directives/class-map.js';
|
|
4
|
+
import 'lit/directives/if-defined.js';
|
|
5
|
+
import './icon-03e86700.js';
|
|
6
|
+
export { c as BUTTON_EXPANDED_OPTIONS, a as BUTTON_SIZES, b as BUTTON_TYPES, B as BUTTON_VARIANTS, L as LeuButton } from './Button-5326c982.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tagname leu-button-group
|
|
3
|
+
* @slot - Slot for the buttons
|
|
4
|
+
* @prop {string} value - The value of the currenty selected (active) button
|
|
5
|
+
* @fires input - When the value of the group changes by clicking a button
|
|
6
|
+
*/
|
|
7
|
+
export class LeuButtonGroup extends LitElement {
|
|
8
|
+
/**
|
|
9
|
+
* @param {import("../button/Button").LeuButton} button
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
static getButtonValue(button: any): string;
|
|
13
|
+
_items: any[];
|
|
14
|
+
set value(newValue: string);
|
|
15
|
+
get value(): string;
|
|
16
|
+
_handleSlotChange(): void;
|
|
17
|
+
/**
|
|
18
|
+
* @param {import("../button/Button").LeuButton} button
|
|
19
|
+
*/
|
|
20
|
+
_handleButtonClick(button: any): void;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
import { LitElement } from 'lit';
|
|
24
|
+
//# sourceMappingURL=ButtonGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["ButtonGroup.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH;IAME;;;OAGG;IACH,oCAFa,MAAM,CAIlB;IATC,cAAgB;IAclB,4BAMC;IAVD,oBAGC;IAQD,0BA+BC;IAED;;OAEG;IACH,sCAWC;IACD,+CAMC;CACF;2BAnGqC,KAAK"}
|
package/dist/ButtonGroup.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { _ as _defineProperty } from './_rollupPluginBabelHelpers-20f659f4.js';
|
|
2
2
|
import { css, LitElement, html } from 'lit';
|
|
3
|
-
import './leu-button.js';
|
|
4
|
-
import './defineElement-47d4f665.js';
|
|
5
|
-
import './Button.js';
|
|
6
|
-
import 'lit/directives/class-map.js';
|
|
7
|
-
import './icon-03e86700.js';
|
|
8
3
|
|
|
9
4
|
var css_248z = css`:host,
|
|
10
5
|
:host * {
|
|
@@ -20,54 +15,90 @@ var css_248z = css`:host,
|
|
|
20
15
|
|
|
21
16
|
/**
|
|
22
17
|
* @tagname leu-button-group
|
|
18
|
+
* @slot - Slot for the buttons
|
|
19
|
+
* @prop {string} value - The value of the currenty selected (active) button
|
|
20
|
+
* @fires input - When the value of the group changes by clicking a button
|
|
23
21
|
*/
|
|
24
22
|
class LeuButtonGroup extends LitElement {
|
|
25
23
|
constructor() {
|
|
26
24
|
super();
|
|
27
|
-
|
|
28
|
-
this.items = [];
|
|
29
|
-
/** @type {string} */
|
|
30
|
-
this.value = null;
|
|
25
|
+
this._items = [];
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {import("../button/Button").LeuButton} button
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
static getButtonValue(button) {
|
|
33
|
+
return button.getAttribute("value") ?? button.innerText.trim();
|
|
34
|
+
}
|
|
35
|
+
get value() {
|
|
36
|
+
const activeButton = this._items.find(item => item.active);
|
|
37
|
+
return activeButton ? LeuButtonGroup.getButtonValue(activeButton) : null;
|
|
38
|
+
}
|
|
39
|
+
set value(newValue) {
|
|
40
|
+
this._items.forEach(item => {
|
|
41
|
+
/* eslint-disable no-param-reassign */
|
|
42
|
+
item.active = LeuButtonGroup.getButtonValue(item) === newValue;
|
|
43
|
+
/* eslint-enable no-param-reassign */
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
_handleSlotChange() {
|
|
47
|
+
/**
|
|
48
|
+
* Remove all event listeners that were added before.
|
|
49
|
+
* Just because a slotchange event was fired, it doesn't mean that all of the
|
|
50
|
+
* children of the slot have changed.
|
|
51
|
+
*/
|
|
52
|
+
this._items.forEach(item => {
|
|
53
|
+
item.removeEventListener("click", this._handleButtonClick);
|
|
54
|
+
});
|
|
55
|
+
const slot = this.shadowRoot.querySelector("slot");
|
|
56
|
+
this._items = slot.assignedElements({
|
|
57
|
+
flatten: true
|
|
58
|
+
});
|
|
59
|
+
let foundActiveButtonBefore = false;
|
|
60
|
+
this._items.forEach(item => {
|
|
61
|
+
/* eslint-disable no-param-reassign */
|
|
62
|
+
item.addEventListener("click", () => this._handleButtonClick(item));
|
|
63
|
+
item.componentRole = "menuitemradio";
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* In case there are multiple active buttons
|
|
67
|
+
* only the first one will be kept active.
|
|
68
|
+
*/
|
|
69
|
+
if (item.active && foundActiveButtonBefore) {
|
|
70
|
+
item.active = false;
|
|
71
|
+
} else if (item.active) {
|
|
72
|
+
foundActiveButtonBefore = true;
|
|
39
73
|
}
|
|
40
|
-
|
|
74
|
+
|
|
75
|
+
/* eslint-enable no-param-reassign */
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param {import("../button/Button").LeuButton} button
|
|
81
|
+
*/
|
|
82
|
+
_handleButtonClick(button) {
|
|
83
|
+
if (!button.active) {
|
|
84
|
+
this.value = LeuButtonGroup.getButtonValue(button);
|
|
85
|
+
this.dispatchEvent(new CustomEvent("input", {
|
|
86
|
+
bubbles: true,
|
|
87
|
+
composed: true,
|
|
88
|
+
detail: {
|
|
89
|
+
value: LeuButtonGroup.getButtonValue(button)
|
|
90
|
+
}
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
41
93
|
}
|
|
42
94
|
render() {
|
|
43
95
|
return html`
|
|
44
96
|
<div role="menubar" class="group">
|
|
45
|
-
|
|
46
|
-
<leu-button
|
|
47
|
-
label=${item}
|
|
48
|
-
variant=${this.value === item ? "primary" : "secondary"}
|
|
49
|
-
@click=${() => {
|
|
50
|
-
this._setValue(item);
|
|
51
|
-
}}
|
|
52
|
-
role="menuitemradio"
|
|
53
|
-
aria-checked=${this.value === item}
|
|
54
|
-
>
|
|
55
|
-
</leu-button>
|
|
56
|
-
`)}
|
|
97
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
57
98
|
</div>
|
|
58
99
|
`;
|
|
59
100
|
}
|
|
60
101
|
}
|
|
61
102
|
_defineProperty(LeuButtonGroup, "styles", css_248z);
|
|
62
|
-
_defineProperty(LeuButtonGroup, "properties", {
|
|
63
|
-
items: {
|
|
64
|
-
type: Array,
|
|
65
|
-
reflect: true
|
|
66
|
-
},
|
|
67
|
-
value: {
|
|
68
|
-
type: String,
|
|
69
|
-
reflect: true
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
103
|
|
|
73
104
|
export { LeuButtonGroup };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tagname leu-checkbox
|
|
3
|
+
*/
|
|
4
|
+
export class LeuCheckbox extends LitElement {
|
|
5
|
+
checked: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
checkIcon: import("lit-html").TemplateResult<1>;
|
|
8
|
+
handleChange(event: any): void;
|
|
9
|
+
handleInput(event: any): void;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
import { LitElement } from 'lit';
|
|
13
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["Checkbox.js"],"names":[],"mappings":"AAiGA;;GAEG;AACH;IAGI,iBAAoB;IACpB,kBAAqB;IACrB,gDAA8B;IAEhC,+BAIC;IACD,8BAEC;IACD,+CAgBC;CACF;2BAnIqC,KAAK"}
|
package/dist/Checkbox.js
CHANGED
|
@@ -12,7 +12,7 @@ var css_248z = css`:host {
|
|
|
12
12
|
|
|
13
13
|
--checkbox-tick-color: var(--leu-color-black-0);
|
|
14
14
|
|
|
15
|
-
--checkbox-font-regular: var(--leu-font-regular);
|
|
15
|
+
--checkbox-font-regular: var(--leu-font-family-regular);
|
|
16
16
|
|
|
17
17
|
position: relative;
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ var css_248z = css`:host {
|
|
|
20
20
|
align-items: flex-start;
|
|
21
21
|
gap: 0.5rem;
|
|
22
22
|
|
|
23
|
-
font-family: var(--leu-font-regular);
|
|
23
|
+
font-family: var(--leu-font-family-regular);
|
|
24
24
|
|
|
25
25
|
font-family: var(--checkbox-font-regular);
|
|
26
26
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tagname leu-checkbox-group
|
|
3
|
+
*/
|
|
4
|
+
export class LeuCheckboxGroup extends LitElement {
|
|
5
|
+
orientation: string;
|
|
6
|
+
items: any[];
|
|
7
|
+
get value(): any[];
|
|
8
|
+
handleSlotChange(): void;
|
|
9
|
+
handleItems(): void;
|
|
10
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
|
+
}
|
|
12
|
+
import { LitElement } from 'lit';
|
|
13
|
+
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["CheckboxGroup.js"],"names":[],"mappings":"AAqCA;;GAEG;AACH;IAGI,oBAA+B;IAC/B,aAAe;IAEjB,mBAEC;IACD,yBAEC;IACD,oBAEC;IACD,+CAWC;CACF;2BAlEqC,KAAK"}
|
package/dist/CheckboxGroup.js
CHANGED
|
@@ -3,10 +3,10 @@ import { css, LitElement, html } from 'lit';
|
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
|
|
5
5
|
var css_248z = css`:host {
|
|
6
|
-
--group-font-regular: var(--leu-font-regular);
|
|
7
|
-
--group-font-black: var(--leu-font-black);
|
|
6
|
+
--group-font-regular: var(--leu-font-family-regular);
|
|
7
|
+
--group-font-black: var(--leu-font-family-black);
|
|
8
8
|
|
|
9
|
-
font-family: var(--leu-font-regular);
|
|
9
|
+
font-family: var(--leu-font-family-regular);
|
|
10
10
|
|
|
11
11
|
font-family: var(--group-font-regular);
|
|
12
12
|
}
|
package/dist/Chip.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["Chip.js"],"names":[],"mappings":"AAyJA;IAGI,kBAAqB;CAExB;2BA7J+B,KAAK"}
|