@statistikzh/leu 0.15.0 → 0.15.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/Accordion.js +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/ChartWrapper.js +40 -29
- package/dist/Checkbox.js +1 -1
- package/dist/CheckboxGroup.js +1 -1
- package/dist/Chip.js +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.js +1 -1
- package/dist/Dropdown.js +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.js +1 -1
- package/dist/{LeuElement-BhAmogDy.js → LeuElement-B84x5CPL.js} +1 -1
- package/dist/Menu.js +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Placeholder.js +1 -1
- package/dist/Popup.js +1 -1
- package/dist/Radio.js +1 -1
- package/dist/RadioGroup.js +1 -1
- package/dist/Range.js +1 -1
- package/dist/ScrollTop.js +1 -1
- package/dist/Select.js +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/components/{visualization → chart-wrapper}/ChartWrapper.d.ts.map +1 -1
- package/dist/components/{visualization → chart-wrapper}/leu-chart-wrapper.d.ts.map +1 -1
- package/dist/components/{visualization → chart-wrapper}/stories/chart-wrapper.stories.d.ts +19 -0
- package/dist/components/{visualization → chart-wrapper}/stories/chart-wrapper.stories.d.ts.map +1 -1
- package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/leu-accordion.js +1 -1
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.js +1 -1
- package/dist/leu-chart-wrapper.js +1 -1
- 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 +1 -1
- package/dist/leu-dropdown.js +1 -1
- 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 +1 -1
- package/dist/leu-placeholder.js +1 -1
- 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 +1 -1
- package/dist/leu-select.js +1 -1
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.js +1 -1
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/theme.css +18 -18
- package/dist/vscode.html-custom-data.json +21 -21
- package/dist/vue/index.d.ts +36 -36
- package/dist/web-types.json +60 -60
- package/package.json +1 -1
- package/release-please-config.json +1 -0
- package/scripts/postcss-leu-font-styles.cjs +10 -10
- package/src/components/{visualization → chart-wrapper}/ChartWrapper.ts +13 -10
- package/src/components/{visualization → chart-wrapper}/chart-wrapper.css +20 -11
- package/src/components/{visualization → chart-wrapper}/stories/chart-wrapper.stories.ts +7 -1
- package/src/components/{visualization → chart-wrapper}/test/chart-wrapper.test.ts +13 -10
- package/src/docs/contributing.mdx +1 -1
- package/src/index.ts +1 -0
- package/src/styles/theme.css +89 -1
- package/dist/components/visualization/test/chart-wrapper.test.d.ts.map +0 -1
- package/src/styles/custom-properties.css +0 -89
- /package/dist/components/{visualization → chart-wrapper}/ChartWrapper.d.ts +0 -0
- /package/dist/components/{visualization → chart-wrapper}/leu-chart-wrapper.d.ts +0 -0
- /package/dist/components/{visualization → chart-wrapper}/test/chart-wrapper.test.d.ts +0 -0
- /package/src/components/{visualization → chart-wrapper}/leu-chart-wrapper.ts +0 -0
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@statistikzh/leu",
|
|
4
|
-
"version": "0.15.
|
|
4
|
+
"version": "0.15.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -65,6 +65,33 @@
|
|
|
65
65
|
"events": []
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
+
{
|
|
69
|
+
"name": "leu-button-group",
|
|
70
|
+
"description": "A radio input-like button group component.\nIt allows only one button to be active at a time.\n---\n\n\n### **Events:**\n - **input** - When the value of the group changes by clicking a button\n\n### **Slots:**\n - _default_ - Slot for the buttons",
|
|
71
|
+
"doc-url": "",
|
|
72
|
+
"attributes": [],
|
|
73
|
+
"slots": [{ "name": "", "description": "Slot for the buttons" }],
|
|
74
|
+
"events": [
|
|
75
|
+
{
|
|
76
|
+
"name": "input",
|
|
77
|
+
"description": "When the value of the group changes by clicking a button"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"js": {
|
|
81
|
+
"properties": [
|
|
82
|
+
{
|
|
83
|
+
"name": "value",
|
|
84
|
+
"description": "The value of the currently selected (active) button"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"events": [
|
|
88
|
+
{
|
|
89
|
+
"name": "input",
|
|
90
|
+
"description": "When the value of the group changes by clicking a button"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
68
95
|
{
|
|
69
96
|
"name": "leu-button",
|
|
70
97
|
"description": "\n---\n\n\n### **Slots:**\n - **before** - The icon to display before the label\n- **after** - The icon to display after the label\n- _default_ - The label of the button or the icon if no label is set",
|
|
@@ -212,30 +239,46 @@
|
|
|
212
239
|
}
|
|
213
240
|
},
|
|
214
241
|
{
|
|
215
|
-
"name": "leu-
|
|
216
|
-
"description": "A
|
|
242
|
+
"name": "leu-chart-wrapper",
|
|
243
|
+
"description": "A wrapper element for charts.\n---\n\n\n### **Slots:**\n - **title** - The title of the chart. Use a heading tag (h2-4) depending on your context.\n- **description** - A description of the chart. Content is wrapped in a `<p>` tag by the component.\n- **chart** - The actual chart\n- **caption** - A caption for the chart, e.g. a source or explanation of the data.\n- **download** - A download button or dropdown to export the chart in different formats.",
|
|
217
244
|
"doc-url": "",
|
|
218
|
-
"attributes": [
|
|
219
|
-
"slots": [{ "name": "", "description": "Slot for the buttons" }],
|
|
220
|
-
"events": [
|
|
245
|
+
"attributes": [
|
|
221
246
|
{
|
|
222
|
-
"name": "
|
|
223
|
-
"description": "
|
|
247
|
+
"name": "pending",
|
|
248
|
+
"description": "Whether the chart is currently loading or not.\nWhen set to `true`, a spinner will be shown in the chart container.",
|
|
249
|
+
"value": { "type": "boolean", "default": "false" }
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"slots": [
|
|
253
|
+
{
|
|
254
|
+
"name": "title",
|
|
255
|
+
"description": "The title of the chart. Use a heading tag (h2-4) depending on your context."
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "description",
|
|
259
|
+
"description": "A description of the chart. Content is wrapped in a `<p>` tag by the component."
|
|
260
|
+
},
|
|
261
|
+
{ "name": "chart", "description": "The actual chart" },
|
|
262
|
+
{
|
|
263
|
+
"name": "caption",
|
|
264
|
+
"description": "A caption for the chart, e.g. a source or explanation of the data."
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "download",
|
|
268
|
+
"description": "A download button or dropdown to export the chart in different formats."
|
|
224
269
|
}
|
|
225
270
|
],
|
|
271
|
+
"events": [],
|
|
226
272
|
"js": {
|
|
227
273
|
"properties": [
|
|
228
274
|
{
|
|
229
|
-
"name": "
|
|
230
|
-
"description": "
|
|
231
|
-
|
|
275
|
+
"name": "pending",
|
|
276
|
+
"description": "Whether the chart is currently loading or not.\nWhen set to `true`, a spinner will be shown in the chart container.",
|
|
277
|
+
"type": "boolean"
|
|
278
|
+
},
|
|
279
|
+
{ "name": "hasSlotController" }
|
|
232
280
|
],
|
|
233
|
-
"events": [
|
|
234
|
-
{
|
|
235
|
-
"name": "input",
|
|
236
|
-
"description": "When the value of the group changes by clicking a button"
|
|
237
|
-
}
|
|
238
|
-
]
|
|
281
|
+
"events": []
|
|
239
282
|
}
|
|
240
283
|
},
|
|
241
284
|
{
|
|
@@ -1390,49 +1433,6 @@
|
|
|
1390
1433
|
"events": []
|
|
1391
1434
|
}
|
|
1392
1435
|
},
|
|
1393
|
-
{
|
|
1394
|
-
"name": "leu-chart-wrapper",
|
|
1395
|
-
"description": "A wrapper element for charts.\n---\n\n\n### **Slots:**\n - **title** - The title of the chart. Use a heading tag (h2-4) depending on your context.\n- **description** - A description of the chart. Content is wrapped in a `<p>` tag by the component.\n- **chart** - The actual chart\n- **caption** - A caption for the chart, e.g. a source or explanation of the data.\n- **download** - A download button or dropdown to export the chart in different formats.",
|
|
1396
|
-
"doc-url": "",
|
|
1397
|
-
"attributes": [
|
|
1398
|
-
{
|
|
1399
|
-
"name": "pending",
|
|
1400
|
-
"description": "Whether the chart is currently loading or not.\nWhen set to `true`, a spinner will be shown in the chart container.",
|
|
1401
|
-
"value": { "type": "boolean", "default": "false" }
|
|
1402
|
-
}
|
|
1403
|
-
],
|
|
1404
|
-
"slots": [
|
|
1405
|
-
{
|
|
1406
|
-
"name": "title",
|
|
1407
|
-
"description": "The title of the chart. Use a heading tag (h2-4) depending on your context."
|
|
1408
|
-
},
|
|
1409
|
-
{
|
|
1410
|
-
"name": "description",
|
|
1411
|
-
"description": "A description of the chart. Content is wrapped in a `<p>` tag by the component."
|
|
1412
|
-
},
|
|
1413
|
-
{ "name": "chart", "description": "The actual chart" },
|
|
1414
|
-
{
|
|
1415
|
-
"name": "caption",
|
|
1416
|
-
"description": "A caption for the chart, e.g. a source or explanation of the data."
|
|
1417
|
-
},
|
|
1418
|
-
{
|
|
1419
|
-
"name": "download",
|
|
1420
|
-
"description": "A download button or dropdown to export the chart in different formats."
|
|
1421
|
-
}
|
|
1422
|
-
],
|
|
1423
|
-
"events": [],
|
|
1424
|
-
"js": {
|
|
1425
|
-
"properties": [
|
|
1426
|
-
{
|
|
1427
|
-
"name": "pending",
|
|
1428
|
-
"description": "Whether the chart is currently loading or not.\nWhen set to `true`, a spinner will be shown in the chart container.",
|
|
1429
|
-
"type": "boolean"
|
|
1430
|
-
},
|
|
1431
|
-
{ "name": "hasSlotController" }
|
|
1432
|
-
],
|
|
1433
|
-
"events": []
|
|
1434
|
-
}
|
|
1435
|
-
},
|
|
1436
1436
|
{
|
|
1437
1437
|
"name": "leu-visually-hidden",
|
|
1438
1438
|
"description": "\n---\n",
|
package/package.json
CHANGED
|
@@ -35,20 +35,20 @@ function generateCustomPropertyDeclarations({
|
|
|
35
35
|
{
|
|
36
36
|
type: "font",
|
|
37
37
|
name: varFont,
|
|
38
|
-
value: `var(${varFontSize}) / var(${varLineHeight}) var(${varFontFamily})`,
|
|
38
|
+
value: `normal var(${varFontSize}) / var(${varLineHeight}) var(${varFontFamily})`,
|
|
39
39
|
},
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function curveStepDeclarations(curvePrefix, stepStyle) {
|
|
44
44
|
const fontSizeVar = stepStyle.declarations.find(
|
|
45
|
-
(s) => s.type === "fontSize"
|
|
45
|
+
(s) => s.type === "fontSize",
|
|
46
46
|
).name
|
|
47
47
|
const lineHeightVar = stepStyle.declarations.find(
|
|
48
|
-
(s) => s.type === "lineHeight"
|
|
48
|
+
(s) => s.type === "lineHeight",
|
|
49
49
|
).name
|
|
50
50
|
const spacingVar = stepStyle.declarations.find(
|
|
51
|
-
(s) => s.type === "spacing"
|
|
51
|
+
(s) => s.type === "spacing",
|
|
52
52
|
).name
|
|
53
53
|
const fontVar = stepStyle.declarations.find((s) => s.type === "font").name
|
|
54
54
|
|
|
@@ -93,8 +93,8 @@ async function createLeuFontStyleNodes(file, postcss, nodeSource) {
|
|
|
93
93
|
const fontStyleNodes = fontStyleDeclarations.flatMap((style) =>
|
|
94
94
|
style.declarations.map(
|
|
95
95
|
({ name, value }) =>
|
|
96
|
-
new postcss.Declaration({ prop: name, value, source: nodeSource })
|
|
97
|
-
)
|
|
96
|
+
new postcss.Declaration({ prop: name, value, source: nodeSource }),
|
|
97
|
+
),
|
|
98
98
|
)
|
|
99
99
|
|
|
100
100
|
const curveNodes = curves.flatMap((curve) =>
|
|
@@ -105,12 +105,12 @@ async function createLeuFontStyleNodes(file, postcss, nodeSource) {
|
|
|
105
105
|
const [viewport, styleName] = step
|
|
106
106
|
|
|
107
107
|
const stepStyle = fontStyleDeclarations.find(
|
|
108
|
-
(s) => s.name === styleName && s.fontWeight === fontWeight
|
|
108
|
+
(s) => s.name === styleName && s.fontWeight === fontWeight,
|
|
109
109
|
)
|
|
110
110
|
|
|
111
111
|
const nodes = curveStepDeclarations(curvePrefix, stepStyle).map(
|
|
112
112
|
({ prop, value }) =>
|
|
113
|
-
new postcss.Declaration({ prop, value, source: nodeSource })
|
|
113
|
+
new postcss.Declaration({ prop, value, source: nodeSource }),
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
return viewport === null
|
|
@@ -122,7 +122,7 @@ async function createLeuFontStyleNodes(file, postcss, nodeSource) {
|
|
|
122
122
|
source: nodeSource,
|
|
123
123
|
})
|
|
124
124
|
})
|
|
125
|
-
})
|
|
125
|
+
}),
|
|
126
126
|
)
|
|
127
127
|
|
|
128
128
|
return [...fontStyleNodes, ...curveNodes]
|
|
@@ -143,7 +143,7 @@ module.exports = () => ({
|
|
|
143
143
|
const nodes = await createLeuFontStyleNodes(
|
|
144
144
|
path.resolve(rootDir, jsonFile),
|
|
145
145
|
postcss,
|
|
146
|
-
atRule.source
|
|
146
|
+
atRule.source,
|
|
147
147
|
)
|
|
148
148
|
|
|
149
149
|
atRule.replaceWith(nodes)
|
|
@@ -47,27 +47,30 @@ export class LeuChartWrapper extends LeuElement {
|
|
|
47
47
|
const hasDownload = this.hasSlotController.test("download")
|
|
48
48
|
|
|
49
49
|
return html`
|
|
50
|
-
<figure>
|
|
51
|
-
<slot name="title" class="
|
|
50
|
+
<figure class="chart-wrapper">
|
|
51
|
+
<slot name="title" class="chart-wrapper__title"></slot>
|
|
52
52
|
${hasDescription
|
|
53
|
-
? html`<slot
|
|
53
|
+
? html`<slot
|
|
54
|
+
name="description"
|
|
55
|
+
class="chart-wrapper__description"
|
|
56
|
+
></slot>`
|
|
54
57
|
: nothing}
|
|
55
|
-
<div class="chart-
|
|
56
|
-
<slot name="chart" class="chart"></slot>
|
|
58
|
+
<div class="chart-wrapper__container">
|
|
59
|
+
<slot name="chart" class="chart-wrapper__chart"></slot>
|
|
57
60
|
${this.pending
|
|
58
|
-
? html`<div class="
|
|
59
|
-
<leu-spinner class="
|
|
61
|
+
? html`<div class="chart-wrapper__spinner-container">
|
|
62
|
+
<leu-spinner class="chart-wrapper__spinner"></leu-spinner>
|
|
60
63
|
</div>`
|
|
61
64
|
: nothing}
|
|
62
65
|
</div>
|
|
63
66
|
${hasCaption
|
|
64
67
|
? html`<figcaption>
|
|
65
|
-
<slot name="caption" class="
|
|
68
|
+
<slot name="caption" class="chart-wrapper__caption"></slot>
|
|
66
69
|
</figcaption>`
|
|
67
70
|
: nothing}
|
|
68
|
-
<hr class="
|
|
71
|
+
<hr class="chart-wrapper__ruler" />
|
|
69
72
|
${hasDownload
|
|
70
|
-
? html`<slot name="download" class="
|
|
73
|
+
? html`<slot name="download" class="chart-wrapper__download"></slot>`
|
|
71
74
|
: nothing}
|
|
72
75
|
</figure>
|
|
73
76
|
`
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
@import url("../../styles/custom-media.css");
|
|
2
2
|
|
|
3
|
-
.
|
|
3
|
+
.chart-wrapper {
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.chart-wrapper__title::slotted(h2) {
|
|
10
|
+
color: var(--leu-color-black-100);
|
|
4
11
|
font: var(--leu-t-curve-large-black-font);
|
|
5
12
|
margin: 0 0 0.75rem;
|
|
6
13
|
|
|
@@ -13,18 +20,20 @@
|
|
|
13
20
|
}
|
|
14
21
|
}
|
|
15
22
|
|
|
16
|
-
.
|
|
23
|
+
.chart-wrapper__title::slotted(h3) {
|
|
24
|
+
color: var(--leu-color-black-100);
|
|
17
25
|
font: var(--leu-t-curve-medium-black-font);
|
|
18
26
|
margin: 0 0 0.5rem;
|
|
19
27
|
}
|
|
20
28
|
|
|
21
|
-
.
|
|
29
|
+
.chart-wrapper__title::slotted(h4) {
|
|
30
|
+
color: var(--leu-color-black-100);
|
|
22
31
|
font: var(--leu-t-curve-regular-black-font);
|
|
23
32
|
margin: 0 0 0.5rem;
|
|
24
33
|
}
|
|
25
34
|
|
|
26
|
-
.
|
|
27
|
-
.chart {
|
|
35
|
+
.chart-wrapper__description,
|
|
36
|
+
.chart-wrapper__chart {
|
|
28
37
|
display: block;
|
|
29
38
|
margin-bottom: 0.75rem;
|
|
30
39
|
|
|
@@ -37,17 +46,17 @@
|
|
|
37
46
|
}
|
|
38
47
|
}
|
|
39
48
|
|
|
40
|
-
.
|
|
49
|
+
.chart-wrapper__description {
|
|
41
50
|
font: var(--leu-t-curve-small-regular-font);
|
|
42
51
|
color: var(--leu-color-black-60);
|
|
43
52
|
}
|
|
44
53
|
|
|
45
|
-
.
|
|
54
|
+
.chart-wrapper__caption {
|
|
46
55
|
font: var(--leu-t-curve-tiny-regular-font);
|
|
47
56
|
color: var(--leu-color-black-60);
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
.
|
|
59
|
+
.chart-wrapper__ruler {
|
|
51
60
|
display: block;
|
|
52
61
|
border: none;
|
|
53
62
|
border-top: 1px solid var(--leu-color-black-transp-20);
|
|
@@ -58,16 +67,16 @@
|
|
|
58
67
|
}
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
.
|
|
70
|
+
.chart-wrapper__download {
|
|
62
71
|
display: block;
|
|
63
72
|
margin-left: -0.5rem;
|
|
64
73
|
}
|
|
65
74
|
|
|
66
|
-
.chart-
|
|
75
|
+
.chart-wrapper__container {
|
|
67
76
|
position: relative;
|
|
68
77
|
}
|
|
69
78
|
|
|
70
|
-
.
|
|
79
|
+
.chart-wrapper__spinner-container {
|
|
71
80
|
position: absolute;
|
|
72
81
|
top: 0;
|
|
73
82
|
left: 0;
|
|
@@ -50,25 +50,28 @@ describe("LeuChartWrapper", () => {
|
|
|
50
50
|
it("conditionally renders slots", async () => {
|
|
51
51
|
let el = await defaultFixture()
|
|
52
52
|
|
|
53
|
-
expect(el.shadowRoot.querySelector(".
|
|
54
|
-
expect(el.shadowRoot.querySelector(".
|
|
55
|
-
expect(el.shadowRoot.querySelector(".
|
|
53
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__description")).to.exist
|
|
54
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__caption")).to.exist
|
|
55
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__download")).to.exist
|
|
56
56
|
|
|
57
57
|
el = await fixture(html`<leu-chart-wrapper></leu-chart-wrapper>`)
|
|
58
58
|
|
|
59
|
-
expect(el.shadowRoot.querySelector(".
|
|
60
|
-
|
|
61
|
-
expect(el.shadowRoot.querySelector(".
|
|
59
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__description")).not.to
|
|
60
|
+
.exist
|
|
61
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__caption")).not.to.exist
|
|
62
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__download")).not.to.exist
|
|
62
63
|
|
|
63
64
|
// Check that the title and chart slots are always present
|
|
64
|
-
expect(el.shadowRoot.querySelector(".
|
|
65
|
-
expect(el.shadowRoot.querySelector(".chart")).to.exist
|
|
65
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__title")).to.exist
|
|
66
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__chart")).to.exist
|
|
66
67
|
})
|
|
67
68
|
|
|
68
69
|
it("shows a spinner when pending is set", async () => {
|
|
69
70
|
const el = await defaultFixture({ pending: true })
|
|
70
71
|
|
|
71
|
-
expect(el.shadowRoot.querySelector(".
|
|
72
|
-
|
|
72
|
+
expect(el.shadowRoot.querySelector(".chart-wrapper__spinner-container")).to
|
|
73
|
+
.exist
|
|
74
|
+
expect(el.shadowRoot.querySelector("leu-spinner.chart-wrapper__spinner")).to
|
|
75
|
+
.exist
|
|
73
76
|
})
|
|
74
77
|
})
|
|
@@ -92,7 +92,7 @@ window.customElements.define("leu-input", LeuInput)
|
|
|
92
92
|
### Scoped styles
|
|
93
93
|
|
|
94
94
|
All CSS declarations have to live inside a custom element. This way we ensure that the styles won't interfere with the environment they're loaded into.
|
|
95
|
-
Styles that are shared between components should be defined as global custom properties inside the `styles/
|
|
95
|
+
Styles that are shared between components should be defined as global custom properties inside the `styles/theme.css`.
|
|
96
96
|
When a global custom property is used inside a component it could be a good practice to assign them to a local custom property with a semantic naming.
|
|
97
97
|
This only make a sense when the component has a certain complexity and the global custom property are used multiple times.
|
|
98
98
|
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./components/accordion/Accordion.js"
|
|
2
2
|
export * from "./components/button/Button.js"
|
|
3
3
|
export * from "./components/button-group/ButtonGroup.js"
|
|
4
|
+
export * from "./components/chart-wrapper/ChartWrapper.js"
|
|
4
5
|
export * from "./components/checkbox/Checkbox.js"
|
|
5
6
|
export * from "./components/checkbox/CheckboxGroup.js"
|
|
6
7
|
export * from "./components/chip/exports.js"
|
package/src/styles/theme.css
CHANGED
|
@@ -1 +1,89 @@
|
|
|
1
|
-
@import url("./custom-
|
|
1
|
+
@import url("./custom-media.css");
|
|
2
|
+
|
|
3
|
+
:root,
|
|
4
|
+
:host {
|
|
5
|
+
--leu-color-black-100: #000;
|
|
6
|
+
--leu-color-black-80: #333;
|
|
7
|
+
--leu-color-black-60: #666;
|
|
8
|
+
--leu-color-black-40: #949494;
|
|
9
|
+
--leu-color-black-20: #ccc;
|
|
10
|
+
--leu-color-black-10: #f0f0f0;
|
|
11
|
+
--leu-color-black-5: #f7f7f7;
|
|
12
|
+
--leu-color-black-0: #fffffe;
|
|
13
|
+
|
|
14
|
+
--leu-color-black-transp-80: rgb(0 0 0 / 80%);
|
|
15
|
+
--leu-color-black-transp-60: rgb(0 0 0 / 60%);
|
|
16
|
+
--leu-color-black-transp-40: rgb(0 0 0 / 40%);
|
|
17
|
+
--leu-color-black-transp-20: rgb(0 0 0 / 20%);
|
|
18
|
+
--leu-color-black-transp-10: rgb(0 0 0 / 10%);
|
|
19
|
+
--leu-color-black-transp-5: rgb(0 0 0 / 5%);
|
|
20
|
+
|
|
21
|
+
--leu-color-white-transp-90: rgb(255 255 255 / 90%);
|
|
22
|
+
--leu-color-white-transp-70: rgb(255 255 255 / 70%);
|
|
23
|
+
--leu-color-white-transp-40: rgb(255 255 255 / 40%);
|
|
24
|
+
--leu-color-white-transp-10: rgb(255 255 255 / 10%);
|
|
25
|
+
|
|
26
|
+
--leu-color-accent-blue: #0076bd;
|
|
27
|
+
--leu-color-accent-darkblue: #00407c;
|
|
28
|
+
--leu-color-accent-turquoise: #00797b;
|
|
29
|
+
--leu-color-accent-green: #1a7f1f;
|
|
30
|
+
--leu-color-accent-bordeaux: #b01657;
|
|
31
|
+
--leu-color-accent-magenta: #d40053;
|
|
32
|
+
--leu-color-accent-violet: #7f3da7;
|
|
33
|
+
--leu-color-accent-gray: var(--leu-color-black-60);
|
|
34
|
+
|
|
35
|
+
--leu-color-accent-blue-soft: #edf5fa;
|
|
36
|
+
--leu-color-accent-darkblue-soft: #e0e8ee;
|
|
37
|
+
--leu-color-accent-turquoise-soft: #e8f3f2;
|
|
38
|
+
--leu-color-accent-green-soft: #ebf6eb;
|
|
39
|
+
--leu-color-accent-bordeaux-soft: #f6e3ea;
|
|
40
|
+
--leu-color-accent-magenta-soft: #fcedf3;
|
|
41
|
+
--leu-color-accent-violet-soft: #ece2f1;
|
|
42
|
+
--leu-color-accent-gray-soft: var(--leu-color-black-10);
|
|
43
|
+
|
|
44
|
+
--leu-color-func-cyan: #009ee0;
|
|
45
|
+
--leu-color-func-red: #d93c1a;
|
|
46
|
+
--leu-color-func-green: #1a7f1f;
|
|
47
|
+
|
|
48
|
+
/* stylelint-disable value-keyword-case */
|
|
49
|
+
--leu-font-family-regular:
|
|
50
|
+
"InterRegular", "HelveticaNowRegular", "Helvetica", sans-serif;
|
|
51
|
+
--leu-font-family-black:
|
|
52
|
+
"InterBlack", "HelveticaNowBlack", "Arial Black", "Helvetica", sans-serif;
|
|
53
|
+
/* stylelint-enable value-keyword-case */
|
|
54
|
+
|
|
55
|
+
--leu-box-shadow-short: 0px 0px 2px var(--leu-color-black-transp-40);
|
|
56
|
+
--leu-box-shadow-regular: 0px 0px 16px var(--leu-color-black-transp-20);
|
|
57
|
+
--leu-box-shadow-long: 0px 0px 80px var(--leu-color-black-transp-20);
|
|
58
|
+
|
|
59
|
+
--leu-z-index-popup: 100;
|
|
60
|
+
|
|
61
|
+
@leu-font-styles './font-definitions.json';
|
|
62
|
+
--leu-t-font-feature-settings: "ss07", "ss08", "cv03", "cv04", "cv10";
|
|
63
|
+
|
|
64
|
+
/*
|
|
65
|
+
* Grid system
|
|
66
|
+
*
|
|
67
|
+
* The design system uses a 6 columns system on smaller screens.
|
|
68
|
+
* For simplicity we use a 12 column grid for all breakpoints (zh web implementation does the same).
|
|
69
|
+
*
|
|
70
|
+
* The goal is to keep the css footprint small
|
|
71
|
+
* by not generating all classes for every cell width for every breakpoint.
|
|
72
|
+
* Most components don't need a grid and those who do probably have a very simple configuration.
|
|
73
|
+
* If we have enough use cases for a more complex grid system we can add it later.
|
|
74
|
+
*/
|
|
75
|
+
--leu-grid-gap: 1rem;
|
|
76
|
+
--leu-grid-template-columns: repeat(12, minmax(0, 4.25rem));
|
|
77
|
+
--leu-grid-max-width: 73rem;
|
|
78
|
+
|
|
79
|
+
--leu-grid-columns-full: 1 / -1;
|
|
80
|
+
--leu-grid-columns-offset: 1 / -1;
|
|
81
|
+
|
|
82
|
+
@media (--viewport-regular) {
|
|
83
|
+
--leu-grid-columns-offset: 3 / -1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (--viewport-medium) {
|
|
87
|
+
--leu-grid-gap: 2rem;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chart-wrapper.test.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/test/chart-wrapper.test.ts"],"names":[],"mappings":"AAGA,OAAO,yBAAyB,CAAA"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
@import url("./custom-media.css");
|
|
2
|
-
|
|
3
|
-
:root,
|
|
4
|
-
:host {
|
|
5
|
-
--leu-color-black-100: #000;
|
|
6
|
-
--leu-color-black-80: #333;
|
|
7
|
-
--leu-color-black-60: #666;
|
|
8
|
-
--leu-color-black-40: #949494;
|
|
9
|
-
--leu-color-black-20: #ccc;
|
|
10
|
-
--leu-color-black-10: #f0f0f0;
|
|
11
|
-
--leu-color-black-5: #f7f7f7;
|
|
12
|
-
--leu-color-black-0: #fffffe;
|
|
13
|
-
|
|
14
|
-
--leu-color-black-transp-80: rgb(0 0 0 / 80%);
|
|
15
|
-
--leu-color-black-transp-60: rgb(0 0 0 / 60%);
|
|
16
|
-
--leu-color-black-transp-40: rgb(0 0 0 / 40%);
|
|
17
|
-
--leu-color-black-transp-20: rgb(0 0 0 / 20%);
|
|
18
|
-
--leu-color-black-transp-10: rgb(0 0 0 / 10%);
|
|
19
|
-
--leu-color-black-transp-5: rgb(0 0 0 / 5%);
|
|
20
|
-
|
|
21
|
-
--leu-color-white-transp-90: rgb(255 255 255 / 90%);
|
|
22
|
-
--leu-color-white-transp-70: rgb(255 255 255 / 70%);
|
|
23
|
-
--leu-color-white-transp-40: rgb(255 255 255 / 40%);
|
|
24
|
-
--leu-color-white-transp-10: rgb(255 255 255 / 10%);
|
|
25
|
-
|
|
26
|
-
--leu-color-accent-blue: #0076bd;
|
|
27
|
-
--leu-color-accent-darkblue: #00407c;
|
|
28
|
-
--leu-color-accent-turquoise: #00797b;
|
|
29
|
-
--leu-color-accent-green: #1a7f1f;
|
|
30
|
-
--leu-color-accent-bordeaux: #b01657;
|
|
31
|
-
--leu-color-accent-magenta: #d40053;
|
|
32
|
-
--leu-color-accent-violet: #7f3da7;
|
|
33
|
-
--leu-color-accent-gray: var(--leu-color-black-60);
|
|
34
|
-
|
|
35
|
-
--leu-color-accent-blue-soft: #edf5fa;
|
|
36
|
-
--leu-color-accent-darkblue-soft: #e0e8ee;
|
|
37
|
-
--leu-color-accent-turquoise-soft: #e8f3f2;
|
|
38
|
-
--leu-color-accent-green-soft: #ebf6eb;
|
|
39
|
-
--leu-color-accent-bordeaux-soft: #f6e3ea;
|
|
40
|
-
--leu-color-accent-magenta-soft: #fcedf3;
|
|
41
|
-
--leu-color-accent-violet-soft: #ece2f1;
|
|
42
|
-
--leu-color-accent-gray-soft: var(--leu-color-black-10);
|
|
43
|
-
|
|
44
|
-
--leu-color-func-cyan: #009ee0;
|
|
45
|
-
--leu-color-func-red: #d93c1a;
|
|
46
|
-
--leu-color-func-green: #1a7f1f;
|
|
47
|
-
|
|
48
|
-
/* stylelint-disable value-keyword-case */
|
|
49
|
-
--leu-font-family-regular:
|
|
50
|
-
"InterRegular", "HelveticaNowRegular", "Helvetica", sans-serif;
|
|
51
|
-
--leu-font-family-black:
|
|
52
|
-
"InterBlack", "HelveticaNowBlack", "Arial Black", "Helvetica", sans-serif;
|
|
53
|
-
/* stylelint-enable value-keyword-case */
|
|
54
|
-
|
|
55
|
-
--leu-box-shadow-short: 0px 0px 2px var(--leu-color-black-transp-40);
|
|
56
|
-
--leu-box-shadow-regular: 0px 0px 16px var(--leu-color-black-transp-20);
|
|
57
|
-
--leu-box-shadow-long: 0px 0px 80px var(--leu-color-black-transp-20);
|
|
58
|
-
|
|
59
|
-
--leu-z-index-popup: 100;
|
|
60
|
-
|
|
61
|
-
@leu-font-styles './font-definitions.json';
|
|
62
|
-
--leu-t-font-feature-settings: "ss07", "ss08", "cv03", "cv04", "cv10";
|
|
63
|
-
|
|
64
|
-
/*
|
|
65
|
-
* Grid system
|
|
66
|
-
*
|
|
67
|
-
* The design system uses a 6 columns system on smaller screens.
|
|
68
|
-
* For simplicity we use a 12 column grid for all breakpoints (zh web implementation does the same).
|
|
69
|
-
*
|
|
70
|
-
* The goal is to keep the css footprint small
|
|
71
|
-
* by not generating all classes for every cell width for every breakpoint.
|
|
72
|
-
* Most components don't need a grid and those who do probably have a very simple configuration.
|
|
73
|
-
* If we have enough use cases for a more complex grid system we can add it later.
|
|
74
|
-
*/
|
|
75
|
-
--leu-grid-gap: 1rem;
|
|
76
|
-
--leu-grid-template-columns: repeat(12, minmax(0, 4.25rem));
|
|
77
|
-
--leu-grid-max-width: 73rem;
|
|
78
|
-
|
|
79
|
-
--leu-grid-columns-full: 1 / -1;
|
|
80
|
-
--leu-grid-columns-offset: 1 / -1;
|
|
81
|
-
|
|
82
|
-
@media (--viewport-regular) {
|
|
83
|
-
--leu-grid-columns-offset: 3 / -1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@media (--viewport-medium) {
|
|
87
|
-
--leu-grid-gap: 2rem;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|