@statistikzh/leu 0.9.0 → 0.10.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/CHANGELOG.md +15 -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 +45 -1
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +473 -6
- 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.js +1 -1
- package/dist/ChipGroup.d.ts +1 -1
- package/dist/ChipGroup.js +2 -2
- package/dist/ChipLink.js +1 -1
- package/dist/ChipRemovable.js +1 -1
- package/dist/ChipSelectable.js +1 -1
- package/dist/Dialog.d.ts +17 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +255 -0
- 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.js +1 -1
- package/dist/Input.d.ts +1 -1
- package/dist/Input.d.ts.map +1 -1
- package/dist/Input.js +3 -1
- package/dist/{LeuElement-7ab5ef5e.d.ts → LeuElement-6fbc0dee.d.ts} +1 -1
- package/dist/LeuElement-6fbc0dee.d.ts.map +1 -0
- package/dist/{LeuElement-7ab5ef5e.js → LeuElement-6fbc0dee.js} +1 -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.d.ts.map +1 -1
- package/dist/Pagination.js +3 -2
- package/dist/Popup.d.ts +1 -1
- package/dist/Popup.js +1 -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/ScrollTop.d.ts +1 -1
- package/dist/ScrollTop.d.ts.map +1 -1
- package/dist/ScrollTop.js +3 -2
- package/dist/Select.d.ts +1 -1
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +3 -2
- package/dist/Spinner.d.ts +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Table.d.ts +1 -1
- package/dist/Table.d.ts.map +1 -1
- package/dist/Table.js +3 -2
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.js +1 -1
- package/dist/hasSlotController-04d0dfa2.d.ts +38 -0
- package/dist/hasSlotController-04d0dfa2.d.ts.map +1 -0
- package/dist/hasSlotController-04d0dfa2.js +75 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -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.d.ts +1 -1
- package/dist/leu-button.d.ts.map +1 -1
- package/dist/leu-button.js +3 -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.d.ts +3 -0
- package/dist/leu-dialog.d.ts.map +1 -0
- package/dist/leu-dialog.js +11 -0
- package/dist/leu-dropdown.js +3 -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 +3 -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-scroll-top.js +3 -2
- package/dist/leu-select.js +3 -2
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.js +3 -2
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/theme.css +318 -192
- package/dist/vscode.html-custom-data.json +15 -0
- package/dist/vue/index.d.ts +19 -0
- package/dist/web-types.json +29 -1
- package/package.json +1 -1
- package/rollup.config.js +4 -1
- package/scripts/postcss-leu-font-styles.cjs +29 -35
- package/src/components/chip/chip-group.css +1 -1
- package/src/components/dialog/Dialog.js +100 -0
- package/src/components/dialog/dialog.css +162 -0
- package/src/components/dialog/leu-dialog.js +5 -0
- package/src/components/dialog/stories/dialog.stories.js +144 -0
- package/src/components/dialog/test/dialog.test.js +85 -0
- package/src/components/input/input.css +2 -0
- package/src/styles/custom-properties.css +27 -0
- package/src/styles/font-definitions.json +27 -19
- package/src/styles/style.stories.js +61 -0
- package/dist/Button-5a8009c5.d.ts +0 -83
- package/dist/Button-5a8009c5.d.ts.map +0 -1
- package/dist/Button-5a8009c5.js +0 -544
- package/dist/LeuElement-7ab5ef5e.d.ts.map +0 -1
|
@@ -250,6 +250,21 @@
|
|
|
250
250
|
}
|
|
251
251
|
]
|
|
252
252
|
},
|
|
253
|
+
{
|
|
254
|
+
"name": "leu-dialog",
|
|
255
|
+
"description": "\n---\n",
|
|
256
|
+
"attributes": [
|
|
257
|
+
{ "name": "label", "values": [] },
|
|
258
|
+
{ "name": "sublabel", "values": [] },
|
|
259
|
+
{ "name": "open", "values": [] }
|
|
260
|
+
],
|
|
261
|
+
"references": [
|
|
262
|
+
{
|
|
263
|
+
"name": "Documentation",
|
|
264
|
+
"url": "https://statistikzh.github.io/leu/?path=/story/dialog"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
},
|
|
253
268
|
{
|
|
254
269
|
"name": "leu-dropdown",
|
|
255
270
|
"description": "\n---\n",
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { LeuChipGroup } from "../ChipGroup.js";
|
|
|
10
10
|
import type { LeuChipLink } from "../ChipLink.js";
|
|
11
11
|
import type { LeuChipRemovable } from "../ChipRemovable.js";
|
|
12
12
|
import type { LeuChipSelectable, CustomEvent } from "../ChipSelectable.js";
|
|
13
|
+
import type { LeuDialog } from "../Dialog.js";
|
|
13
14
|
import type { LeuDropdown } from "../Dropdown.js";
|
|
14
15
|
import type { LeuIcon } from "../Icon.js";
|
|
15
16
|
import type { LeuInput, CustomEvent } from "../Input.js";
|
|
@@ -172,6 +173,17 @@ type LeuChipSelectableProps = {
|
|
|
172
173
|
onInput?: (e: CustomEvent<CustomEvent>) => void;
|
|
173
174
|
};
|
|
174
175
|
|
|
176
|
+
type LeuDialogProps = {
|
|
177
|
+
/** */
|
|
178
|
+
label?: LeuDialog["label"];
|
|
179
|
+
/** */
|
|
180
|
+
sublabel?: LeuDialog["sublabel"];
|
|
181
|
+
/** */
|
|
182
|
+
open?: LeuDialog["open"];
|
|
183
|
+
/** */
|
|
184
|
+
_dialogRef?: LeuDialog["_dialogRef"];
|
|
185
|
+
};
|
|
186
|
+
|
|
175
187
|
type LeuDropdownProps = {
|
|
176
188
|
/** */
|
|
177
189
|
label?: LeuDropdown["label"];
|
|
@@ -561,6 +573,13 @@ export type CustomElements = {
|
|
|
561
573
|
*/
|
|
562
574
|
"leu-chip-selectable": DefineComponent<LeuChipSelectableProps>;
|
|
563
575
|
|
|
576
|
+
/**
|
|
577
|
+
*
|
|
578
|
+
* ---
|
|
579
|
+
*
|
|
580
|
+
*/
|
|
581
|
+
"leu-dialog": DefineComponent<LeuDialogProps>;
|
|
582
|
+
|
|
564
583
|
/**
|
|
565
584
|
*
|
|
566
585
|
* ---
|
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.
|
|
4
|
+
"version": "0.10.0",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -488,6 +488,34 @@
|
|
|
488
488
|
"events": [{ "name": "input" }]
|
|
489
489
|
}
|
|
490
490
|
},
|
|
491
|
+
{
|
|
492
|
+
"name": "leu-dialog",
|
|
493
|
+
"description": "\n---\n",
|
|
494
|
+
"doc-url": "",
|
|
495
|
+
"attributes": [
|
|
496
|
+
{
|
|
497
|
+
"name": "label",
|
|
498
|
+
"value": { "type": "string", "default": "\"\"" }
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "sublabel",
|
|
502
|
+
"value": { "type": "string", "default": "\"\"" }
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"name": "open",
|
|
506
|
+
"value": { "type": "boolean", "default": "false" }
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
"events": [],
|
|
510
|
+
"js": {
|
|
511
|
+
"properties": [
|
|
512
|
+
{ "name": "label", "value": { "type": "string" } },
|
|
513
|
+
{ "name": "sublabel", "value": { "type": "string" } },
|
|
514
|
+
{ "name": "open", "value": { "type": "boolean" } }
|
|
515
|
+
],
|
|
516
|
+
"events": []
|
|
517
|
+
}
|
|
518
|
+
},
|
|
491
519
|
{
|
|
492
520
|
"name": "leu-dropdown",
|
|
493
521
|
"description": "\n---\n",
|
package/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -11,7 +11,10 @@ export const plugins = [
|
|
|
11
11
|
plugin: replace,
|
|
12
12
|
args: [
|
|
13
13
|
{
|
|
14
|
-
|
|
14
|
+
preventAssignment: true,
|
|
15
|
+
values: {
|
|
16
|
+
__LEU_VERSION__: JSON.stringify(process.env.npm_package_version),
|
|
17
|
+
},
|
|
15
18
|
},
|
|
16
19
|
],
|
|
17
20
|
},
|
|
@@ -14,13 +14,13 @@ async function parseFile(file) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function generateCustomPropertyDeclarations({
|
|
17
|
-
|
|
17
|
+
name,
|
|
18
18
|
fontSize,
|
|
19
19
|
fontWeight,
|
|
20
20
|
lineHeight,
|
|
21
21
|
spacing,
|
|
22
22
|
}) {
|
|
23
|
-
const customPropertyPrefix = `--leu-t-${
|
|
23
|
+
const customPropertyPrefix = `--leu-t-${name}-${fontWeight}`
|
|
24
24
|
|
|
25
25
|
const varFontSize = `${customPropertyPrefix}-font-size`
|
|
26
26
|
const varLineHeight = `${customPropertyPrefix}-line-height`
|
|
@@ -77,14 +77,11 @@ async function createLeuFontStyleNodes(file, postcss, nodeSource) {
|
|
|
77
77
|
: [style.fontWeight]
|
|
78
78
|
const spacing = getPixelValue(style.spacing) / 16
|
|
79
79
|
|
|
80
|
-
const identifier = (fontSize / 4) * 10
|
|
81
|
-
|
|
82
80
|
return fontWeights.map((fontWeight) => ({
|
|
83
81
|
name: style.name,
|
|
84
82
|
fontWeight,
|
|
85
|
-
identifier,
|
|
86
83
|
declarations: generateCustomPropertyDeclarations({
|
|
87
|
-
|
|
84
|
+
name: style.name,
|
|
88
85
|
fontSize,
|
|
89
86
|
fontWeight,
|
|
90
87
|
lineHeight: style.lineHeight,
|
|
@@ -100,36 +97,33 @@ async function createLeuFontStyleNodes(file, postcss, nodeSource) {
|
|
|
100
97
|
)
|
|
101
98
|
)
|
|
102
99
|
|
|
103
|
-
const curveNodes = curves.flatMap((curve) =>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
nodes,
|
|
129
|
-
source: nodeSource,
|
|
130
|
-
})
|
|
100
|
+
const curveNodes = curves.flatMap((curve) =>
|
|
101
|
+
curve.weights.flatMap((fontWeight) => {
|
|
102
|
+
const curvePrefix = `--leu-t-curve-${curve.name}-${fontWeight}`
|
|
103
|
+
|
|
104
|
+
return curve.steps.flatMap((step) => {
|
|
105
|
+
const [viewport, styleName] = step
|
|
106
|
+
|
|
107
|
+
const stepStyle = fontStyleDeclarations.find(
|
|
108
|
+
(s) => s.name === styleName && s.fontWeight === fontWeight
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
const nodes = curveStepDeclarations(curvePrefix, stepStyle).map(
|
|
112
|
+
({ prop, value }) =>
|
|
113
|
+
new postcss.Declaration({ prop, value, source: nodeSource })
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
return viewport === null
|
|
117
|
+
? nodes
|
|
118
|
+
: new postcss.AtRule({
|
|
119
|
+
name: "media",
|
|
120
|
+
params: `(${viewport})`,
|
|
121
|
+
nodes,
|
|
122
|
+
source: nodeSource,
|
|
123
|
+
})
|
|
124
|
+
})
|
|
131
125
|
})
|
|
132
|
-
|
|
126
|
+
)
|
|
133
127
|
|
|
134
128
|
return [...fontStyleNodes, ...curveNodes]
|
|
135
129
|
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { html, nothing } from "lit"
|
|
2
|
+
import { createRef, ref } from "lit/directives/ref.js"
|
|
3
|
+
import { classMap } from "lit/directives/class-map.js"
|
|
4
|
+
|
|
5
|
+
import { LeuElement } from "../../lib/LeuElement.js"
|
|
6
|
+
import { HasSlotController } from "../../lib/hasSlotController.js"
|
|
7
|
+
import { LeuIcon } from "../icon/Icon.js"
|
|
8
|
+
|
|
9
|
+
// design: https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?node-id=21161-186812&node-type=FRAME
|
|
10
|
+
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
import styles from "./dialog.css"
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @tagname leu-dialog
|
|
16
|
+
*/
|
|
17
|
+
export class LeuDialog extends LeuElement {
|
|
18
|
+
static dependencies = {
|
|
19
|
+
"leu-icon": LeuIcon,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static styles = styles
|
|
23
|
+
|
|
24
|
+
static shadowRootOptions = {
|
|
25
|
+
...LeuElement.shadowRootOptions,
|
|
26
|
+
delegatesFocus: true,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
hasSlotController = new HasSlotController(this, ["toolbar"])
|
|
33
|
+
|
|
34
|
+
static properties = {
|
|
35
|
+
label: { type: String },
|
|
36
|
+
sublabel: { type: String },
|
|
37
|
+
open: { type: Boolean, open: true },
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
constructor() {
|
|
41
|
+
super()
|
|
42
|
+
|
|
43
|
+
/** @type {import("lit/directives/ref").Ref<HTMLDialogElement>} */
|
|
44
|
+
this._dialogRef = createRef()
|
|
45
|
+
|
|
46
|
+
/** @type {string} */
|
|
47
|
+
this.label = ""
|
|
48
|
+
/** @type {string} */
|
|
49
|
+
this.sublabel = ""
|
|
50
|
+
/** @type {boolean} */
|
|
51
|
+
this.open = false
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
show() {
|
|
55
|
+
this._dialogRef.value.showModal()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
close() {
|
|
59
|
+
this._dialogRef.value.close()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
render() {
|
|
63
|
+
const hasActionbar = this.hasSlotController.test("actionbar")
|
|
64
|
+
|
|
65
|
+
const closeButtonLabelClasses = {
|
|
66
|
+
"close-button__label": true,
|
|
67
|
+
"close-button__label--hidden": hasActionbar,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return html`
|
|
71
|
+
<dialog class="dialog" ref=${ref(this._dialogRef)} ?open=${this.open}>
|
|
72
|
+
<div class="content">
|
|
73
|
+
<div class="header">
|
|
74
|
+
<div class="title-wrapper">
|
|
75
|
+
<h1 class="title">${this.label}</h1>
|
|
76
|
+
${this.sublabel
|
|
77
|
+
? html`<p class="subtitle">${this.sublabel}</p>`
|
|
78
|
+
: nothing}
|
|
79
|
+
</div>
|
|
80
|
+
<button
|
|
81
|
+
class="close-button"
|
|
82
|
+
@click=${this.close}
|
|
83
|
+
aria-label="Schliessen"
|
|
84
|
+
>
|
|
85
|
+
<span
|
|
86
|
+
class=${classMap(closeButtonLabelClasses)}
|
|
87
|
+
aria-hidden="true"
|
|
88
|
+
>Schliessen</span
|
|
89
|
+
><leu-icon name="close"> </leu-icon>
|
|
90
|
+
</button>
|
|
91
|
+
</div>
|
|
92
|
+
<slot></slot>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="actionbar">
|
|
95
|
+
<slot name="actionbar"></slot>
|
|
96
|
+
</div>
|
|
97
|
+
</dialog>
|
|
98
|
+
`
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
@import url("../../styles/custom-media.css");
|
|
2
|
+
|
|
3
|
+
/* figma https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?node-id=21161-186812&t=8VgDy9avMRG5aL7s-0 */
|
|
4
|
+
|
|
5
|
+
:host,
|
|
6
|
+
:host * {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
--dialog-font-regular: var(--leu-font-family-regular);
|
|
12
|
+
--dialog-font-black: var(--leu-font-family-black);
|
|
13
|
+
|
|
14
|
+
font-family: var(--dialog-font-regular);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dialog {
|
|
18
|
+
background: #fff;
|
|
19
|
+
border: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
background-color: var(--leu-color-black-0);
|
|
24
|
+
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
|
|
27
|
+
margin: 0 auto;
|
|
28
|
+
height: 100vh;
|
|
29
|
+
width: 100vw;
|
|
30
|
+
max-height: 100vh;
|
|
31
|
+
max-width: 100vw;
|
|
32
|
+
|
|
33
|
+
@media (--viewport-regular) {
|
|
34
|
+
margin: 80px auto;
|
|
35
|
+
height: fit-content;
|
|
36
|
+
width: fit-content;
|
|
37
|
+
max-width: min(100% - 4.5rem, 60.5rem);
|
|
38
|
+
max-height: calc(100vh - 5rem);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dialog[open] {
|
|
43
|
+
display: flex;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.dialog::backdrop {
|
|
47
|
+
background-color: var(--leu-color-black-transp-40);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.content {
|
|
51
|
+
--padding: 2rem;
|
|
52
|
+
padding: var(--padding);
|
|
53
|
+
padding-bottom: 0;
|
|
54
|
+
margin-bottom: 1.5rem;
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
|
|
57
|
+
@media (--viewport-regular) {
|
|
58
|
+
--padding: 2.5rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (--viewport-medium) {
|
|
62
|
+
margin-bottom: 2rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media (--viewport-large) {
|
|
66
|
+
--padding: 3.5rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (--viewport-xlarge) {
|
|
70
|
+
margin-bottom: 2.5rem;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.title-wrapper {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-flow: column wrap;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.header {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: flex-start;
|
|
82
|
+
justify-content: space-between;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.title {
|
|
86
|
+
font: var(--leu-t-curve-big-black-font);
|
|
87
|
+
margin: 0 0 0.75rem;
|
|
88
|
+
order: 2;
|
|
89
|
+
|
|
90
|
+
@media (--viewport-regular) {
|
|
91
|
+
margin-bottom: 1rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@media (--viewport-medium) {
|
|
95
|
+
margin-bottom: 1.25rem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (--viewport-xlarge) {
|
|
99
|
+
margin-bottom: 1.5rem;
|
|
100
|
+
font: var(--leu-t-bigger-big-black-font);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.subtitle {
|
|
105
|
+
color: var(--leu-color-black-transp-60);
|
|
106
|
+
font-size: var(--leu-t-tiny-regular-font-size);
|
|
107
|
+
line-height: var(--leu-t-tiny-regular-line-height);
|
|
108
|
+
|
|
109
|
+
order: 1;
|
|
110
|
+
|
|
111
|
+
margin: 0 0 4px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.close-button {
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
display: flex;
|
|
117
|
+
gap: 0.5rem;
|
|
118
|
+
|
|
119
|
+
padding: 0.25rem 0;
|
|
120
|
+
margin-left: 0.75rem;
|
|
121
|
+
border: 0;
|
|
122
|
+
border-radius: 0.125rem;
|
|
123
|
+
|
|
124
|
+
color: var(--leu-color-black-transp-60);
|
|
125
|
+
background: transparent;
|
|
126
|
+
|
|
127
|
+
@media (--viewport-regular) {
|
|
128
|
+
margin-left: 1rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (--viewport-medium) {
|
|
132
|
+
margin-left: 1.25rem;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (--viewport-xlarge) {
|
|
136
|
+
margin-left: 1.5rem;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.close-button:focus-visible {
|
|
141
|
+
outline: 2px solid var(--leu-color-func-cyan);
|
|
142
|
+
outline-offset: 2px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.close-button__label {
|
|
146
|
+
display: none;
|
|
147
|
+
font: var(--leu-t-regular-regular-font);
|
|
148
|
+
|
|
149
|
+
@media (--viewport-medium) {
|
|
150
|
+
display: inline;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.close-button__label--hidden {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.actionbar {
|
|
159
|
+
display: flex;
|
|
160
|
+
justify-content: flex-end;
|
|
161
|
+
min-height: 3rem;
|
|
162
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { html } from "lit"
|
|
2
|
+
import "../leu-dialog.js"
|
|
3
|
+
import "../../input/leu-input.js"
|
|
4
|
+
import "../../button/leu-button.js"
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Dialog",
|
|
8
|
+
component: "leu-dialog",
|
|
9
|
+
parameters: {
|
|
10
|
+
design: {
|
|
11
|
+
type: "figma",
|
|
12
|
+
url: "https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?node-id=16052-88818&node-type=canvas&t=swv3JY6UIoCBUpXa-11",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function openDialog() {
|
|
18
|
+
document.querySelector("leu-dialog").show()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function closeDialog() {
|
|
22
|
+
document.querySelector("leu-dialog").close()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function OpenDialogButton() {
|
|
26
|
+
return html` <leu-button @click=${() => openDialog()}>
|
|
27
|
+
Open dialog
|
|
28
|
+
</leu-button>`
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function Template({ label, sublabel }) {
|
|
32
|
+
return html`
|
|
33
|
+
${OpenDialogButton()}
|
|
34
|
+
|
|
35
|
+
<leu-dialog label="${label}" sublabel="${sublabel}">
|
|
36
|
+
<leu-input label="Eingabe"></leu-input>
|
|
37
|
+
<br />
|
|
38
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
|
|
39
|
+
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
|
|
40
|
+
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
|
|
41
|
+
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
|
|
42
|
+
amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
|
|
43
|
+
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
|
|
44
|
+
diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
|
45
|
+
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
|
|
46
|
+
sit amet.
|
|
47
|
+
</leu-dialog>
|
|
48
|
+
`
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const Regular = Template.bind({})
|
|
52
|
+
Regular.args = {
|
|
53
|
+
label: "Property: label",
|
|
54
|
+
rubric: "Property: sublabel",
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function ActionButtonsTemplate({ label, sublabel }) {
|
|
58
|
+
return html`
|
|
59
|
+
${OpenDialogButton()}
|
|
60
|
+
|
|
61
|
+
<leu-dialog label="${label}" sublabel="${sublabel}">
|
|
62
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
|
|
63
|
+
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
|
|
64
|
+
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
|
|
65
|
+
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
|
|
66
|
+
amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
|
|
67
|
+
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed
|
|
68
|
+
diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
|
|
69
|
+
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
|
|
70
|
+
sit amet.
|
|
71
|
+
<slot slot="actionbar">
|
|
72
|
+
<leu-button
|
|
73
|
+
variant="secondary"
|
|
74
|
+
@click=${() => {
|
|
75
|
+
// eslint-disable-next-line no-alert
|
|
76
|
+
alert("Fenster wird geschlossen")
|
|
77
|
+
closeDialog()
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
Abbrechen
|
|
81
|
+
</leu-button>
|
|
82
|
+
<leu-button
|
|
83
|
+
@click=${() => {
|
|
84
|
+
// eslint-disable-next-line no-alert
|
|
85
|
+
alert("Fenster wird offen gelassen")
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
Anwenden
|
|
89
|
+
</leu-button>
|
|
90
|
+
</slot>
|
|
91
|
+
</leu-dialog>
|
|
92
|
+
`
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export const ActionButtons = ActionButtonsTemplate.bind({})
|
|
96
|
+
ActionButtons.args = {
|
|
97
|
+
label: "Property: label",
|
|
98
|
+
sublabel: "Property: sublabel",
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function SmallContentTemplate({ label, sublabel }) {
|
|
102
|
+
return html`
|
|
103
|
+
${OpenDialogButton()}
|
|
104
|
+
|
|
105
|
+
<leu-dialog label="${label}" sublabel="${sublabel}">
|
|
106
|
+
<p>Ein kurzer Text</p>
|
|
107
|
+
</leu-dialog>
|
|
108
|
+
`
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const SmallContent = SmallContentTemplate.bind({})
|
|
112
|
+
SmallContent.args = {
|
|
113
|
+
label: "Dialog Titel",
|
|
114
|
+
sublabel: "Property: sublabel",
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function ScrollablePageTemplate({ label, sublabel }) {
|
|
118
|
+
return html`
|
|
119
|
+
<div style="height: 200vh">
|
|
120
|
+
${OpenDialogButton()}
|
|
121
|
+
|
|
122
|
+
<leu-dialog label="${label}" sublabel="${sublabel}">
|
|
123
|
+
<leu-input label="Eingabe"></leu-input>
|
|
124
|
+
<br />
|
|
125
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
|
|
126
|
+
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
|
|
127
|
+
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
|
|
128
|
+
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
|
|
129
|
+
amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
|
|
130
|
+
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
|
|
131
|
+
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
|
|
132
|
+
rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
|
|
133
|
+
ipsum dolor sit amet.
|
|
134
|
+
</leu-dialog>
|
|
135
|
+
</div>
|
|
136
|
+
<div style="height: 200vh">${OpenDialogButton()}</div>
|
|
137
|
+
`
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const ScrollablePage = ScrollablePageTemplate.bind({})
|
|
141
|
+
ScrollablePage.args = {
|
|
142
|
+
label: "Dialog Titel",
|
|
143
|
+
sublabel: "Property: sublabel",
|
|
144
|
+
}
|