@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.
Files changed (116) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/Accordion.d.ts +1 -1
  3. package/dist/Accordion.js +1 -1
  4. package/dist/Breadcrumb.d.ts +1 -1
  5. package/dist/Breadcrumb.js +1 -1
  6. package/dist/Button.d.ts +45 -1
  7. package/dist/Button.d.ts.map +1 -1
  8. package/dist/Button.js +473 -6
  9. package/dist/ButtonGroup.d.ts +1 -1
  10. package/dist/ButtonGroup.js +1 -1
  11. package/dist/Checkbox.d.ts +1 -1
  12. package/dist/Checkbox.js +1 -1
  13. package/dist/CheckboxGroup.d.ts +1 -1
  14. package/dist/CheckboxGroup.js +1 -1
  15. package/dist/Chip.d.ts +1 -1
  16. package/dist/Chip.js +1 -1
  17. package/dist/ChipGroup.d.ts +1 -1
  18. package/dist/ChipGroup.js +2 -2
  19. package/dist/ChipLink.js +1 -1
  20. package/dist/ChipRemovable.js +1 -1
  21. package/dist/ChipSelectable.js +1 -1
  22. package/dist/Dialog.d.ts +17 -0
  23. package/dist/Dialog.d.ts.map +1 -0
  24. package/dist/Dialog.js +255 -0
  25. package/dist/Dropdown.d.ts +1 -1
  26. package/dist/Dropdown.d.ts.map +1 -1
  27. package/dist/Dropdown.js +3 -2
  28. package/dist/Icon.d.ts +1 -1
  29. package/dist/Icon.js +1 -1
  30. package/dist/Input.d.ts +1 -1
  31. package/dist/Input.d.ts.map +1 -1
  32. package/dist/Input.js +3 -1
  33. package/dist/{LeuElement-7ab5ef5e.d.ts → LeuElement-6fbc0dee.d.ts} +1 -1
  34. package/dist/LeuElement-6fbc0dee.d.ts.map +1 -0
  35. package/dist/{LeuElement-7ab5ef5e.js → LeuElement-6fbc0dee.js} +1 -1
  36. package/dist/Menu.d.ts +1 -1
  37. package/dist/Menu.js +1 -1
  38. package/dist/MenuItem.d.ts +1 -1
  39. package/dist/MenuItem.js +1 -1
  40. package/dist/Pagination.d.ts +1 -1
  41. package/dist/Pagination.d.ts.map +1 -1
  42. package/dist/Pagination.js +3 -2
  43. package/dist/Popup.d.ts +1 -1
  44. package/dist/Popup.js +1 -1
  45. package/dist/Radio.d.ts +1 -1
  46. package/dist/Radio.js +1 -1
  47. package/dist/RadioGroup.d.ts +1 -1
  48. package/dist/RadioGroup.js +1 -1
  49. package/dist/ScrollTop.d.ts +1 -1
  50. package/dist/ScrollTop.d.ts.map +1 -1
  51. package/dist/ScrollTop.js +3 -2
  52. package/dist/Select.d.ts +1 -1
  53. package/dist/Select.d.ts.map +1 -1
  54. package/dist/Select.js +3 -2
  55. package/dist/Spinner.d.ts +1 -1
  56. package/dist/Spinner.js +1 -1
  57. package/dist/Table.d.ts +1 -1
  58. package/dist/Table.d.ts.map +1 -1
  59. package/dist/Table.js +3 -2
  60. package/dist/VisuallyHidden.d.ts +1 -1
  61. package/dist/VisuallyHidden.js +1 -1
  62. package/dist/hasSlotController-04d0dfa2.d.ts +38 -0
  63. package/dist/hasSlotController-04d0dfa2.d.ts.map +1 -0
  64. package/dist/hasSlotController-04d0dfa2.js +75 -0
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +3 -2
  67. package/dist/leu-accordion.js +1 -1
  68. package/dist/leu-breadcrumb.js +1 -1
  69. package/dist/leu-button-group.js +1 -1
  70. package/dist/leu-button.d.ts +1 -1
  71. package/dist/leu-button.d.ts.map +1 -1
  72. package/dist/leu-button.js +3 -2
  73. package/dist/leu-checkbox-group.js +1 -1
  74. package/dist/leu-checkbox.js +1 -1
  75. package/dist/leu-chip-group.js +1 -1
  76. package/dist/leu-chip-link.js +1 -1
  77. package/dist/leu-chip-removable.js +1 -1
  78. package/dist/leu-chip-selectable.js +1 -1
  79. package/dist/leu-dialog.d.ts +3 -0
  80. package/dist/leu-dialog.d.ts.map +1 -0
  81. package/dist/leu-dialog.js +11 -0
  82. package/dist/leu-dropdown.js +3 -2
  83. package/dist/leu-icon.js +1 -1
  84. package/dist/leu-input.js +1 -1
  85. package/dist/leu-menu-item.js +1 -1
  86. package/dist/leu-menu.js +1 -1
  87. package/dist/leu-pagination.js +3 -2
  88. package/dist/leu-popup.js +1 -1
  89. package/dist/leu-radio-group.js +1 -1
  90. package/dist/leu-radio.js +1 -1
  91. package/dist/leu-scroll-top.js +3 -2
  92. package/dist/leu-select.js +3 -2
  93. package/dist/leu-spinner.js +1 -1
  94. package/dist/leu-table.js +3 -2
  95. package/dist/leu-visually-hidden.js +1 -1
  96. package/dist/theme.css +318 -192
  97. package/dist/vscode.html-custom-data.json +15 -0
  98. package/dist/vue/index.d.ts +19 -0
  99. package/dist/web-types.json +29 -1
  100. package/package.json +1 -1
  101. package/rollup.config.js +4 -1
  102. package/scripts/postcss-leu-font-styles.cjs +29 -35
  103. package/src/components/chip/chip-group.css +1 -1
  104. package/src/components/dialog/Dialog.js +100 -0
  105. package/src/components/dialog/dialog.css +162 -0
  106. package/src/components/dialog/leu-dialog.js +5 -0
  107. package/src/components/dialog/stories/dialog.stories.js +144 -0
  108. package/src/components/dialog/test/dialog.test.js +85 -0
  109. package/src/components/input/input.css +2 -0
  110. package/src/styles/custom-properties.css +27 -0
  111. package/src/styles/font-definitions.json +27 -19
  112. package/src/styles/style.stories.js +61 -0
  113. package/dist/Button-5a8009c5.d.ts +0 -83
  114. package/dist/Button-5a8009c5.d.ts.map +0 -1
  115. package/dist/Button-5a8009c5.js +0 -544
  116. 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",
@@ -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
  * ---
@@ -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.9.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
@@ -3,7 +3,7 @@
3
3
  "description": "UI component library of the canton of zurich",
4
4
  "license": "MIT",
5
5
  "author": "statistikzh",
6
- "version": "0.9.0",
6
+ "version": "0.10.0",
7
7
  "type": "module",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
package/rollup.config.js CHANGED
@@ -11,7 +11,10 @@ export const plugins = [
11
11
  plugin: replace,
12
12
  args: [
13
13
  {
14
- __LEU_VERSION__: JSON.stringify(process.env.npm_package_version),
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
- identifier,
17
+ name,
18
18
  fontSize,
19
19
  fontWeight,
20
20
  lineHeight,
21
21
  spacing,
22
22
  }) {
23
- const customPropertyPrefix = `--leu-t-${identifier}-${fontWeight}`
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
- identifier,
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
- const [_, lastStepName] = curve.steps.at(-1)
105
- const { identifier } = fontStyleDeclarations.find(
106
- (style) => style.name === lastStepName && style.fontWeight === "black"
107
- )
108
-
109
- const curvePrefix = `--leu-t-curve-${identifier}-black`
110
-
111
- return curve.steps.flatMap((step) => {
112
- const [viewport, styleName] = step
113
-
114
- const stepStyle = fontStyleDeclarations.find(
115
- (s) => s.name === styleName && s.fontWeight === "black"
116
- )
117
-
118
- const nodes = curveStepDeclarations(curvePrefix, stepStyle).map(
119
- ({ prop, value }) =>
120
- new postcss.Declaration({ prop, value, source: nodeSource })
121
- )
122
-
123
- return viewport === null
124
- ? nodes
125
- : new postcss.AtRule({
126
- name: "media",
127
- params: `(${viewport})`,
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
  }
@@ -1,6 +1,6 @@
1
1
  .label {
2
2
  margin: 0 0 0.5rem;
3
- font: var(--leu-t-curve-35-black-font);
3
+ font: var(--leu-t-curve-tiny-black-font);
4
4
  color: var(--leu-color-black-100);
5
5
  }
6
6
 
@@ -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,5 @@
1
+ import { LeuDialog } from "./Dialog.js"
2
+
3
+ export { LeuDialog }
4
+
5
+ LeuDialog.define("leu-dialog")
@@ -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
+ }