@statistikzh/leu 0.9.0 → 0.11.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 (127) hide show
  1. package/CHANGELOG.md +22 -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-78b4a998.d.ts} +1 -1
  34. package/dist/LeuElement-78b4a998.d.ts.map +1 -0
  35. package/dist/{LeuElement-7ab5ef5e.js → LeuElement-78b4a998.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/Range.d.ts +60 -0
  50. package/dist/Range.d.ts.map +1 -0
  51. package/dist/Range.js +414 -0
  52. package/dist/ScrollTop.d.ts +1 -1
  53. package/dist/ScrollTop.d.ts.map +1 -1
  54. package/dist/ScrollTop.js +3 -2
  55. package/dist/Select.d.ts +1 -1
  56. package/dist/Select.d.ts.map +1 -1
  57. package/dist/Select.js +3 -2
  58. package/dist/Spinner.d.ts +1 -1
  59. package/dist/Spinner.js +1 -1
  60. package/dist/Table.d.ts +1 -1
  61. package/dist/Table.d.ts.map +1 -1
  62. package/dist/Table.js +3 -2
  63. package/dist/VisuallyHidden.d.ts +1 -1
  64. package/dist/VisuallyHidden.js +1 -1
  65. package/dist/hasSlotController-fd1950b4.d.ts +38 -0
  66. package/dist/hasSlotController-fd1950b4.d.ts.map +1 -0
  67. package/dist/hasSlotController-fd1950b4.js +75 -0
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +3 -2
  70. package/dist/leu-accordion.js +1 -1
  71. package/dist/leu-breadcrumb.js +1 -1
  72. package/dist/leu-button-group.js +1 -1
  73. package/dist/leu-button.d.ts +1 -1
  74. package/dist/leu-button.d.ts.map +1 -1
  75. package/dist/leu-button.js +3 -2
  76. package/dist/leu-checkbox-group.js +1 -1
  77. package/dist/leu-checkbox.js +1 -1
  78. package/dist/leu-chip-group.js +1 -1
  79. package/dist/leu-chip-link.js +1 -1
  80. package/dist/leu-chip-removable.js +1 -1
  81. package/dist/leu-chip-selectable.js +1 -1
  82. package/dist/leu-dialog.d.ts +3 -0
  83. package/dist/leu-dialog.d.ts.map +1 -0
  84. package/dist/leu-dialog.js +11 -0
  85. package/dist/leu-dropdown.js +3 -2
  86. package/dist/leu-icon.js +1 -1
  87. package/dist/leu-input.js +1 -1
  88. package/dist/leu-menu-item.js +1 -1
  89. package/dist/leu-menu.js +1 -1
  90. package/dist/leu-pagination.js +3 -2
  91. package/dist/leu-popup.js +1 -1
  92. package/dist/leu-radio-group.js +1 -1
  93. package/dist/leu-radio.js +1 -1
  94. package/dist/leu-range.d.ts +3 -0
  95. package/dist/leu-range.d.ts.map +1 -0
  96. package/dist/leu-range.js +7 -0
  97. package/dist/leu-scroll-top.js +3 -2
  98. package/dist/leu-select.js +3 -2
  99. package/dist/leu-spinner.js +1 -1
  100. package/dist/leu-table.js +3 -2
  101. package/dist/leu-visually-hidden.js +1 -1
  102. package/dist/theme.css +318 -192
  103. package/dist/vscode.html-custom-data.json +35 -0
  104. package/dist/vue/index.d.ts +60 -0
  105. package/dist/web-types.json +73 -1
  106. package/package.json +1 -1
  107. package/rollup.config.js +4 -1
  108. package/scripts/postcss-leu-font-styles.cjs +29 -35
  109. package/src/components/chip/chip-group.css +1 -1
  110. package/src/components/dialog/Dialog.js +100 -0
  111. package/src/components/dialog/dialog.css +162 -0
  112. package/src/components/dialog/leu-dialog.js +5 -0
  113. package/src/components/dialog/stories/dialog.stories.js +144 -0
  114. package/src/components/dialog/test/dialog.test.js +85 -0
  115. package/src/components/input/input.css +2 -0
  116. package/src/components/range/Range.js +237 -0
  117. package/src/components/range/leu-range.js +5 -0
  118. package/src/components/range/range.css +181 -0
  119. package/src/components/range/stories/range-slider.stories.js +142 -0
  120. package/src/components/range/test/range-test.js +24 -0
  121. package/src/styles/custom-properties.css +27 -0
  122. package/src/styles/font-definitions.json +27 -19
  123. package/src/styles/style.stories.js +61 -0
  124. package/dist/Button-5a8009c5.d.ts +0 -83
  125. package/dist/Button-5a8009c5.d.ts.map +0 -1
  126. package/dist/Button-5a8009c5.js +0 -544
  127. 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",
@@ -542,6 +557,26 @@
542
557
  }
543
558
  ]
544
559
  },
560
+ {
561
+ "name": "leu-range",
562
+ "description": "\n---\n\n\n### **Methods:**\n - **_handlePointerDown(e: _PointerEvent & {target: HTMLInputElement}_)** - Determine if the \"click\" (pointer event) is closer the\nthe value of the other input element. Swap the values if this is the case.",
563
+ "attributes": [
564
+ { "name": "value", "values": [{ "name": "array" }] },
565
+ { "name": "min", "values": [] },
566
+ { "name": "max", "values": [] },
567
+ { "name": "step", "values": [] },
568
+ { "name": "name", "values": [] },
569
+ { "name": "label", "values": [] },
570
+ { "name": "disabled", "values": [] },
571
+ { "name": "multiple", "values": [] }
572
+ ],
573
+ "references": [
574
+ {
575
+ "name": "Documentation",
576
+ "url": "https://statistikzh.github.io/leu/?path=/story/range"
577
+ }
578
+ ]
579
+ },
545
580
  {
546
581
  "name": "leu-scroll-top",
547
582
  "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";
@@ -19,6 +20,7 @@ import type { LeuPagination, CustomEvent } from "../Pagination.js";
19
20
  import type { LeuPopup } from "../Popup.js";
20
21
  import type { LeuRadio } from "../Radio.js";
21
22
  import type { LeuRadioGroup } from "../RadioGroup.js";
23
+ import type { LeuRange } from "../Range.js";
22
24
  import type { LeuScrollTop } from "../ScrollTop.js";
23
25
  import type { LeuSelect } from "../Select.js";
24
26
  import type { LeuSpinner } from "../Spinner.js";
@@ -172,6 +174,17 @@ type LeuChipSelectableProps = {
172
174
  onInput?: (e: CustomEvent<CustomEvent>) => void;
173
175
  };
174
176
 
177
+ type LeuDialogProps = {
178
+ /** */
179
+ label?: LeuDialog["label"];
180
+ /** */
181
+ sublabel?: LeuDialog["sublabel"];
182
+ /** */
183
+ open?: LeuDialog["open"];
184
+ /** */
185
+ _dialogRef?: LeuDialog["_dialogRef"];
186
+ };
187
+
175
188
  type LeuDropdownProps = {
176
189
  /** */
177
190
  label?: LeuDropdown["label"];
@@ -348,6 +361,35 @@ type LeuRadioGroupProps = {
348
361
  items?: LeuRadioGroup["items"];
349
362
  };
350
363
 
364
+ type LeuRangeProps = {
365
+ /** */
366
+ value?: LeuRange["defaultValue"];
367
+ /** */
368
+ min?: LeuRange["min"];
369
+ /** */
370
+ max?: LeuRange["max"];
371
+ /** */
372
+ step?: LeuRange["step"];
373
+ /** */
374
+ name?: LeuRange["name"];
375
+ /** */
376
+ label?: LeuRange["label"];
377
+ /** */
378
+ disabled?: LeuRange["disabled"];
379
+ /** */
380
+ multiple?: LeuRange["multiple"];
381
+ /** Sets the value of the underlying input element(s).
382
+ The value has to be an array if "multiple" range is used.
383
+ Otherwise it has to be a string. */
384
+ value?: LeuRange["value"];
385
+ /** */
386
+ valueAsArray?: LeuRange["valueAsArray"];
387
+ /** */
388
+ valueLow?: LeuRange["valueLow"];
389
+ /** */
390
+ valueHigh?: LeuRange["valueHigh"];
391
+ };
392
+
351
393
  type LeuScrollTopProps = {
352
394
  /** */
353
395
  _showButton?: LeuScrollTop["_showButton"];
@@ -561,6 +603,13 @@ export type CustomElements = {
561
603
  */
562
604
  "leu-chip-selectable": DefineComponent<LeuChipSelectableProps>;
563
605
 
606
+ /**
607
+ *
608
+ * ---
609
+ *
610
+ */
611
+ "leu-dialog": DefineComponent<LeuDialogProps>;
612
+
564
613
  /**
565
614
  *
566
615
  * ---
@@ -653,6 +702,17 @@ export type CustomElements = {
653
702
  */
654
703
  "leu-radio-group": DefineComponent<LeuRadioGroupProps>;
655
704
 
705
+ /**
706
+ *
707
+ * ---
708
+ *
709
+ *
710
+ * ### **Methods:**
711
+ * - **_handlePointerDown(e: _PointerEvent & {target: HTMLInputElement}_)** - Determine if the "click" (pointer event) is closer the
712
+ * the value of the other input element. Swap the values if this is the case.
713
+ */
714
+ "leu-range": DefineComponent<LeuRangeProps>;
715
+
656
716
  /**
657
717
  *
658
718
  * ---
@@ -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.11.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",
@@ -1035,6 +1063,50 @@
1035
1063
  "events": []
1036
1064
  }
1037
1065
  },
1066
+ {
1067
+ "name": "leu-range",
1068
+ "description": "\n---\n\n\n### **Methods:**\n - **_handlePointerDown(e: _PointerEvent & {target: HTMLInputElement}_)** - Determine if the \"click\" (pointer event) is closer the\nthe value of the other input element. Swap the values if this is the case.",
1069
+ "doc-url": "",
1070
+ "attributes": [
1071
+ {
1072
+ "name": "value",
1073
+ "value": { "type": "array", "default": "[50]" }
1074
+ },
1075
+ { "name": "min", "value": { "type": "number", "default": "0" } },
1076
+ { "name": "max", "value": { "type": "number", "default": "100" } },
1077
+ { "name": "step", "value": { "type": "number", "default": "1" } },
1078
+ {
1079
+ "name": "name",
1080
+ "value": { "type": "string", "default": "\"\"" }
1081
+ },
1082
+ {
1083
+ "name": "label",
1084
+ "value": { "type": "string", "default": "\"\"" }
1085
+ },
1086
+ {
1087
+ "name": "disabled",
1088
+ "value": { "type": "boolean", "default": "false" }
1089
+ },
1090
+ {
1091
+ "name": "multiple",
1092
+ "value": { "type": "boolean", "default": "false" }
1093
+ }
1094
+ ],
1095
+ "events": [],
1096
+ "js": {
1097
+ "properties": [
1098
+ { "name": "value", "value": { "type": "array" } },
1099
+ { "name": "min", "value": { "type": "number" } },
1100
+ { "name": "max", "value": { "type": "number" } },
1101
+ { "name": "step", "value": { "type": "number" } },
1102
+ { "name": "name", "value": { "type": "string" } },
1103
+ { "name": "label", "value": { "type": "string" } },
1104
+ { "name": "disabled", "value": { "type": "boolean" } },
1105
+ { "name": "multiple", "value": { "type": "boolean" } }
1106
+ ],
1107
+ "events": []
1108
+ }
1109
+ },
1038
1110
  {
1039
1111
  "name": "leu-scroll-top",
1040
1112
  "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.11.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")