@statistikzh/leu 0.12.2 → 0.13.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-head.html +1 -4
- package/.storybook/static/fonts/Inter-Black.woff2 +0 -0
- package/.storybook/static/fonts/Inter-Regular.woff2 +0 -0
- package/.storybook/static/fonts.css +11 -0
- package/CHANGELOG.md +18 -0
- package/dist/Accordion.d.ts +1 -1
- package/dist/Accordion.js +1 -1
- package/dist/Breadcrumb.d.ts +1 -1
- package/dist/Breadcrumb.js +1 -1
- package/dist/Button.d.ts +1 -1
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +64 -34
- package/dist/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/CheckboxGroup.d.ts +1 -1
- package/dist/CheckboxGroup.js +1 -1
- package/dist/Chip.d.ts +1 -1
- package/dist/Chip.d.ts.map +1 -1
- package/dist/Chip.js +5 -4
- package/dist/ChipGroup.d.ts +1 -1
- package/dist/ChipGroup.js +1 -1
- package/dist/ChipLink.js +1 -1
- package/dist/ChipRemovable.js +1 -1
- package/dist/ChipSelectable.js +1 -1
- package/dist/Dialog.d.ts +1 -1
- package/dist/Dialog.js +2 -2
- package/dist/Dropdown.d.ts +1 -1
- package/dist/Dropdown.d.ts.map +1 -1
- package/dist/Dropdown.js +3 -2
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Icon.js +6 -2
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +1 -1
- package/dist/{LeuElement-519af050.d.ts → LeuElement-b670d77c.d.ts} +1 -1
- package/dist/LeuElement-b670d77c.d.ts.map +1 -0
- package/dist/{LeuElement-519af050.js → LeuElement-b670d77c.js} +11 -1
- package/dist/Menu.d.ts +1 -1
- package/dist/Menu.js +1 -1
- package/dist/MenuItem.d.ts +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/Pagination.d.ts +1 -1
- package/dist/Pagination.js +2 -2
- package/dist/Popup.d.ts +1 -1
- package/dist/Popup.d.ts.map +1 -1
- package/dist/Popup.js +2 -1
- package/dist/Radio.d.ts +1 -1
- package/dist/Radio.js +1 -1
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/Range.d.ts +1 -1
- package/dist/Range.js +1 -1
- package/dist/ScrollTop.d.ts +1 -1
- package/dist/ScrollTop.js +2 -2
- package/dist/Select.d.ts +1 -1
- package/dist/Select.js +3 -3
- package/dist/Spinner.d.ts +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.d.ts +1 -3
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +49 -20
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/{hasSlotController-bf769658.d.ts → hasSlotController-c09741c5.d.ts} +1 -1
- package/dist/{hasSlotController-bf769658.d.ts.map → hasSlotController-c09741c5.d.ts.map} +1 -1
- package/dist/{hasSlotController-bf769658.js → hasSlotController-c09741c5.js} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/leu-accordion.js +1 -1
- package/dist/leu-breadcrumb.js +1 -1
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.js +2 -2
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.js +1 -1
- package/dist/leu-chip-link.js +1 -1
- package/dist/leu-chip-removable.js +1 -1
- package/dist/leu-chip-selectable.js +1 -1
- package/dist/leu-dialog.js +2 -2
- package/dist/leu-dropdown.js +2 -2
- package/dist/leu-icon.js +1 -1
- package/dist/leu-input.js +1 -1
- package/dist/leu-menu-item.js +1 -1
- package/dist/leu-menu.js +1 -1
- package/dist/leu-pagination.js +2 -2
- package/dist/leu-popup.js +1 -1
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.js +1 -1
- package/dist/leu-scroll-top.js +2 -2
- package/dist/leu-select.js +2 -2
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.js +2 -2
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/web-types.json +1 -1
- package/index.js +1 -0
- package/package.json +1 -1
- package/src/components/button/Button.js +8 -3
- package/src/components/button/button.css +56 -22
- package/src/components/button/stories/button.stories.js +1 -0
- package/src/components/button/test/button.test.js +3 -3
- package/src/components/chip/chip.css +4 -3
- package/src/components/chip/stories/chip-selectable.stories.js +1 -1
- package/src/components/dropdown/dropdown.css +1 -0
- package/src/components/icon/icon.css +4 -0
- package/src/components/popup/popup.css +1 -0
- package/src/components/select/select.css +1 -1
- package/src/components/select/test/select.test.js +1 -0
- package/src/components/table/Table.js +33 -15
- package/src/components/table/table.css +16 -6
- package/src/styles/common-styles.css +9 -0
- package/web-test-runner.config.mjs +1 -0
- package/dist/LeuElement-519af050.d.ts.map +0 -1
|
@@ -128,6 +128,7 @@ button.ghost {
|
|
|
128
128
|
padding: 0 0.5rem;
|
|
129
129
|
color: var(--leu-color-black-60);
|
|
130
130
|
font-family: var(--leu-font-family-regular);
|
|
131
|
+
height: 2rem;
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
button.ghost:hover {
|
|
@@ -206,49 +207,82 @@ button.ghost.inverted:disabled {
|
|
|
206
207
|
display: block;
|
|
207
208
|
}
|
|
208
209
|
|
|
209
|
-
.
|
|
210
|
-
|
|
210
|
+
.icon-wrapper {
|
|
211
|
+
display: none;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.icon-before .icon-wrapper--before,
|
|
215
|
+
.icon-after .icon-wrapper--after {
|
|
211
216
|
display: block;
|
|
212
|
-
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.ghost .icon-wrapper {
|
|
220
|
+
position: relative;
|
|
221
|
+
width: 2rem;
|
|
222
|
+
padding: 0 0.5rem;
|
|
223
|
+
--_bg: var(--leu-color-black-transp-10);
|
|
224
|
+
--_color: currentcolor;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.ghost .icon-wrapper__slot {
|
|
228
|
+
display: block;
|
|
229
|
+
position: relative;
|
|
230
|
+
z-index: 1;
|
|
231
|
+
color: var(--_color);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.ghost .icon-wrapper::before {
|
|
235
|
+
content: "";
|
|
236
|
+
position: absolute;
|
|
237
|
+
z-index: 0;
|
|
238
|
+
left: 0;
|
|
239
|
+
top: -0.5rem;
|
|
240
|
+
|
|
241
|
+
width: 2rem;
|
|
242
|
+
aspect-ratio: 1;
|
|
213
243
|
border-radius: 50%;
|
|
214
|
-
background: var(--
|
|
244
|
+
background: var(--_bg);
|
|
215
245
|
}
|
|
216
246
|
|
|
217
|
-
.ghost.active
|
|
218
|
-
|
|
219
|
-
|
|
247
|
+
.ghost.active .icon-wrapper {
|
|
248
|
+
--_bg: var(--leu-color-black-100);
|
|
249
|
+
--_color: var(--leu-color-black-0);
|
|
220
250
|
}
|
|
221
251
|
|
|
222
|
-
.ghost:disabled
|
|
223
|
-
|
|
252
|
+
.ghost:disabled .icon-wrapper {
|
|
253
|
+
--_bg: var(--leu-color-black-transp-5);
|
|
224
254
|
}
|
|
225
255
|
|
|
226
256
|
/* inverted */
|
|
227
257
|
|
|
228
|
-
.ghost.inverted
|
|
229
|
-
|
|
258
|
+
.ghost.inverted .icon-wrapper {
|
|
259
|
+
--_bg: var(--leu-color-black-transp-20);
|
|
230
260
|
}
|
|
231
261
|
|
|
232
|
-
.ghost.inverted:hover
|
|
233
|
-
|
|
234
|
-
|
|
262
|
+
.ghost.inverted:hover .icon-wrapper {
|
|
263
|
+
--_bg: var(--leu-color-black-transp-40);
|
|
264
|
+
--_color: var(--leu-color-black-0);
|
|
235
265
|
}
|
|
236
266
|
|
|
237
|
-
.ghost.inverted:disabled
|
|
238
|
-
|
|
239
|
-
|
|
267
|
+
.ghost.inverted:disabled .icon-wrapper {
|
|
268
|
+
--_bg: var(--leu-color-black-transp-20);
|
|
269
|
+
--_color: var(--leu-color-white-transp-70);
|
|
240
270
|
}
|
|
241
271
|
|
|
242
|
-
.ghost.active.inverted
|
|
243
|
-
|
|
244
|
-
|
|
272
|
+
.ghost.active.inverted .icon-wrapper {
|
|
273
|
+
--_bg: var(--leu-color-black-0);
|
|
274
|
+
--_color: var(--leu-color-black-100);
|
|
245
275
|
}
|
|
246
276
|
|
|
247
277
|
/* Expanded icon */
|
|
248
|
-
.icon-
|
|
278
|
+
.icon-expanded leu-icon {
|
|
279
|
+
display: block;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.icon-expanded {
|
|
249
283
|
transition: transform 0.1s ease;
|
|
250
284
|
}
|
|
251
285
|
|
|
252
|
-
:host([expanded="
|
|
286
|
+
:host([expanded="true"]) .icon-expanded {
|
|
253
287
|
transform: rotate(180deg);
|
|
254
288
|
}
|
|
@@ -58,7 +58,7 @@ describe("LeuButton", () => {
|
|
|
58
58
|
const button = el.shadowRoot.querySelector("button")
|
|
59
59
|
|
|
60
60
|
expect(button).dom.to.equal(
|
|
61
|
-
"<button><slot name='before'></slot><span><slot></slot></span><slot name='after'></slot></button>",
|
|
61
|
+
"<button><div><slot name='before'></slot></div><span><slot></slot></span><div><slot name='after'></slot></div></button>",
|
|
62
62
|
{ ignoreAttributes: ["class", "type"] }
|
|
63
63
|
)
|
|
64
64
|
})
|
|
@@ -73,7 +73,7 @@ describe("LeuButton", () => {
|
|
|
73
73
|
const button = el.shadowRoot.querySelector("button")
|
|
74
74
|
|
|
75
75
|
expect(button).dom.to.equal(
|
|
76
|
-
"<button aria-expanded='true'><slot name='before'></slot><span><slot></slot></span><slot name='after'></slot><div class='icon-
|
|
76
|
+
"<button aria-expanded='true'><div><slot name='before'></slot></div><span><slot></slot></span><div><slot name='after'></slot></div><div class='icon-expanded'><leu-icon name='angleDropDown' size='24'></leu-icon></div></button>",
|
|
77
77
|
{ ignoreAttributes: ["class", "type"] }
|
|
78
78
|
)
|
|
79
79
|
|
|
@@ -82,7 +82,7 @@ describe("LeuButton", () => {
|
|
|
82
82
|
await elementUpdated(el)
|
|
83
83
|
|
|
84
84
|
expect(button).dom.to.equal(
|
|
85
|
-
"<button class='primary regular' aria-expanded='true'><slot name='before'></slot><span><slot></slot></span><slot name='after'></slot></button>",
|
|
85
|
+
"<button class='primary regular' aria-expanded='true'><div><slot name='before'></slot></div><span><slot></slot></span><div><slot name='after'></slot></div></button>",
|
|
86
86
|
{ ignoreAttributes: ["class", "type"] }
|
|
87
87
|
)
|
|
88
88
|
})
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
border: none;
|
|
56
56
|
border-radius: 1rem;
|
|
57
57
|
background-color: var(--chip-background-color);
|
|
58
|
-
padding:
|
|
58
|
+
padding: 8px 1rem;
|
|
59
59
|
|
|
60
60
|
color: var(--chip-color);
|
|
61
61
|
font-family: inherit;
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
|
|
67
67
|
display: inline-flex;
|
|
68
68
|
gap: 0.5rem;
|
|
69
|
+
align-items: center;
|
|
69
70
|
|
|
70
71
|
/* Allow shrinking to achieve text truncation (ellipsis) */
|
|
71
72
|
min-width: 0;
|
|
@@ -108,10 +109,10 @@
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
:host([size="small"]:not([variant="radio"])) .button {
|
|
111
|
-
padding: 0.
|
|
112
|
+
padding: 0.3125rem 0.75rem;
|
|
112
113
|
|
|
113
114
|
font-size: 0.75rem;
|
|
114
|
-
line-height: 1;
|
|
115
|
+
line-height: 1.25rem;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
:host([variant="radio"]) .button::before {
|
|
@@ -50,7 +50,7 @@ export const Default = Template.bind({})
|
|
|
50
50
|
Default.args = {}
|
|
51
51
|
|
|
52
52
|
export const Small = Template.bind({})
|
|
53
|
-
Small.args = { size: SIZES.small }
|
|
53
|
+
Small.args = { size: SIZES.small, label: "Publikationen Region" }
|
|
54
54
|
|
|
55
55
|
export const Radio = Template.bind({})
|
|
56
56
|
Radio.args = { variant: VARIANTS.radio }
|
|
@@ -419,6 +419,7 @@ describe("LeuSelect", () => {
|
|
|
419
419
|
await elementUpdated(el)
|
|
420
420
|
|
|
421
421
|
expect(menuItems.every((item) => !item.multipleSelection)).to.be.true
|
|
422
|
+
})
|
|
422
423
|
|
|
423
424
|
it("closes the popup when the document is clicked outside the component", async () => {
|
|
424
425
|
const el = await defaultFixture({
|
|
@@ -115,7 +115,7 @@ export class LeuTable extends LeuElement {
|
|
|
115
115
|
this.sortOrderAsc = !this.sortOrderAsc
|
|
116
116
|
} else {
|
|
117
117
|
this.sortIndex = index
|
|
118
|
-
this.
|
|
118
|
+
this.sortOrderAsc = false
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -125,10 +125,6 @@ export class LeuTable extends LeuElement {
|
|
|
125
125
|
></leu-icon>`
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
sortArrow(col) {
|
|
129
|
-
return html` ${this.isSorted(col) ? this.sortArrowIcon() : nothing} `
|
|
130
|
-
}
|
|
131
|
-
|
|
132
128
|
get _columns() {
|
|
133
129
|
return this.columns
|
|
134
130
|
}
|
|
@@ -172,6 +168,26 @@ export class LeuTable extends LeuElement {
|
|
|
172
168
|
sticky: this.firstColumnSticky,
|
|
173
169
|
}
|
|
174
170
|
|
|
171
|
+
function headerStyle(col) {
|
|
172
|
+
if (col.headerStyle) {
|
|
173
|
+
return styleMap({
|
|
174
|
+
...col.headerStyle(),
|
|
175
|
+
textAlign: col.align === "right" ? "right" : undefined,
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
return col.align === "right" ? styleMap({ textAlign: "right" }) : nothing
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function bodyStyle(col, row) {
|
|
182
|
+
if (col.style) {
|
|
183
|
+
return styleMap({
|
|
184
|
+
...col.style(row),
|
|
185
|
+
textAlign: col.align === "right" ? "right" : undefined,
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
return col.align === "right" ? styleMap({ textAlign: "right" }) : nothing
|
|
189
|
+
}
|
|
190
|
+
|
|
175
191
|
return html`
|
|
176
192
|
<div
|
|
177
193
|
class=${classMap(scrollClasses)}
|
|
@@ -183,15 +199,19 @@ export class LeuTable extends LeuElement {
|
|
|
183
199
|
<tr>
|
|
184
200
|
${this._columns.map(
|
|
185
201
|
(col) =>
|
|
186
|
-
html`<th
|
|
187
|
-
style=${col.headerStyle
|
|
188
|
-
? styleMap(col.headerStyle())
|
|
189
|
-
: nothing}
|
|
190
|
-
>
|
|
202
|
+
html`<th style=${headerStyle(col)}>
|
|
191
203
|
${col.sort
|
|
192
|
-
? html`<button
|
|
204
|
+
? html`<button
|
|
205
|
+
@click=${(_) => this.sortClick(col)}
|
|
206
|
+
class=${this.isSorted(col) ? "active" : nothing}
|
|
207
|
+
>
|
|
208
|
+
${col.align === "right"
|
|
209
|
+
? this.sortArrowIcon()
|
|
210
|
+
: nothing}
|
|
193
211
|
<span>${col.name}</span>
|
|
194
|
-
${
|
|
212
|
+
${col.align !== "right"
|
|
213
|
+
? this.sortArrowIcon()
|
|
214
|
+
: nothing}
|
|
195
215
|
</button>`
|
|
196
216
|
: col.name}
|
|
197
217
|
</th>`
|
|
@@ -204,9 +224,7 @@ export class LeuTable extends LeuElement {
|
|
|
204
224
|
html`<tr>
|
|
205
225
|
${this._columns.map(
|
|
206
226
|
(col) =>
|
|
207
|
-
html`<td
|
|
208
|
-
style=${col.style ? styleMap(col.style(row)) : nothing}
|
|
209
|
-
>
|
|
227
|
+
html`<td style=${bodyStyle(col, row)}>
|
|
210
228
|
${col.value(row)}
|
|
211
229
|
</td>`
|
|
212
230
|
)}
|
|
@@ -66,20 +66,30 @@ button {
|
|
|
66
66
|
line-height: 1.5;
|
|
67
67
|
padding: 0;
|
|
68
68
|
border: 0;
|
|
69
|
-
width: 100%;
|
|
70
|
-
display: flex;
|
|
71
|
-
align-items: flex-center;
|
|
72
69
|
font-size: inherit;
|
|
73
70
|
font-family: inherit;
|
|
74
71
|
color: inherit;
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
button span {
|
|
75
|
+
vertical-align: bottom;
|
|
76
|
+
}
|
|
79
77
|
|
|
78
|
+
button leu-icon {
|
|
79
|
+
--leu-icon-size: 1.25rem;
|
|
80
80
|
display: inline-block;
|
|
81
|
-
color: var(--leu-color-accent-blue);
|
|
82
81
|
padding: 0;
|
|
82
|
+
opacity: 0;
|
|
83
|
+
vertical-align: bottom;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
button:hover leu-icon {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
button.active leu-icon {
|
|
91
|
+
color: var(--leu-color-accent-blue);
|
|
92
|
+
opacity: 1;
|
|
83
93
|
}
|
|
84
94
|
|
|
85
95
|
table.sticky td:first-child,
|
|
@@ -3,3 +3,12 @@
|
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
font-feature-settings: var(--leu-t-font-feature-settings);
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* If a custom element sets the display property to any value
|
|
9
|
+
* it will not be hidden by the [hidden] attribute.
|
|
10
|
+
* That's why we need to specify this rule.
|
|
11
|
+
*/
|
|
12
|
+
:host([hidden]) {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LeuElement-519af050.d.ts","sourceRoot":"","sources":["LeuElement-519af050.js"],"names":[],"mappings":"AAsCA;IACE,8EAcC;CACF;AApDD,sEAaC;2BAf+B,KAAK"}
|