@statistikzh/leu 0.15.0 → 0.16.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 (105) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/dist/Accordion.js +1 -1
  4. package/dist/Button.js +1 -1
  5. package/dist/ButtonGroup.js +1 -1
  6. package/dist/ChartWrapper.js +40 -29
  7. package/dist/Checkbox.js +1 -1
  8. package/dist/CheckboxGroup.js +1 -1
  9. package/dist/Chip.js +1 -1
  10. package/dist/ChipGroup.js +1 -1
  11. package/dist/ChipLink.js +1 -1
  12. package/dist/ChipRemovable.js +1 -1
  13. package/dist/ChipSelectable.js +1 -1
  14. package/dist/Dialog.js +1 -1
  15. package/dist/Dropdown.js +1 -1
  16. package/dist/Icon.js +1 -1
  17. package/dist/Input.js +1 -1
  18. package/dist/{LeuElement-BhAmogDy.js → LeuElement-C0BZ_nPB.js} +1 -1
  19. package/dist/Menu.js +1 -1
  20. package/dist/MenuItem.js +1 -1
  21. package/dist/Message.d.ts +63 -0
  22. package/dist/Message.js +268 -0
  23. package/dist/Pagination.js +1 -1
  24. package/dist/Placeholder.js +1 -1
  25. package/dist/Popup.js +1 -1
  26. package/dist/Radio.js +1 -1
  27. package/dist/RadioGroup.js +1 -1
  28. package/dist/Range.js +1 -1
  29. package/dist/ScrollTop.js +1 -1
  30. package/dist/Select.js +1 -1
  31. package/dist/Spinner.js +1 -1
  32. package/dist/Table.js +1 -1
  33. package/dist/VisuallyHidden.js +1 -1
  34. package/dist/components/{visualization → chart-wrapper}/ChartWrapper.d.ts.map +1 -1
  35. package/dist/components/{visualization → chart-wrapper}/leu-chart-wrapper.d.ts.map +1 -1
  36. package/dist/components/{visualization → chart-wrapper}/stories/chart-wrapper.stories.d.ts +19 -0
  37. package/dist/components/{visualization → chart-wrapper}/stories/chart-wrapper.stories.d.ts.map +1 -1
  38. package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts.map +1 -0
  39. package/dist/components/message/Message.d.ts +59 -0
  40. package/dist/components/message/Message.d.ts.map +1 -0
  41. package/dist/components/message/leu-message.d.ts +3 -0
  42. package/dist/components/message/leu-message.d.ts.map +1 -0
  43. package/dist/components/message/stories/message.stories.d.ts +179 -0
  44. package/dist/components/message/stories/message.stories.d.ts.map +1 -0
  45. package/dist/components/message/test/message.test.d.ts +2 -0
  46. package/dist/components/message/test/message.test.d.ts.map +1 -0
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +3 -1
  50. package/dist/leu-accordion.js +1 -1
  51. package/dist/leu-button-group.js +1 -1
  52. package/dist/leu-button.js +1 -1
  53. package/dist/leu-chart-wrapper.js +1 -1
  54. package/dist/leu-checkbox-group.js +1 -1
  55. package/dist/leu-checkbox.js +1 -1
  56. package/dist/leu-chip-group.js +1 -1
  57. package/dist/leu-chip-link.js +1 -1
  58. package/dist/leu-chip-removable.js +1 -1
  59. package/dist/leu-chip-selectable.js +1 -1
  60. package/dist/leu-dialog.js +1 -1
  61. package/dist/leu-dropdown.js +1 -1
  62. package/dist/leu-icon.js +1 -1
  63. package/dist/leu-input.js +1 -1
  64. package/dist/leu-menu-item.js +1 -1
  65. package/dist/leu-menu.js +1 -1
  66. package/dist/leu-message.d.ts +5 -0
  67. package/dist/leu-message.js +12 -0
  68. package/dist/leu-pagination.js +1 -1
  69. package/dist/leu-placeholder.js +1 -1
  70. package/dist/leu-popup.js +1 -1
  71. package/dist/leu-radio-group.js +1 -1
  72. package/dist/leu-radio.js +1 -1
  73. package/dist/leu-range.js +1 -1
  74. package/dist/leu-scroll-top.js +1 -1
  75. package/dist/leu-select.js +1 -1
  76. package/dist/leu-spinner.js +1 -1
  77. package/dist/leu-table.js +1 -1
  78. package/dist/leu-visually-hidden.js +1 -1
  79. package/dist/theme.css +18 -18
  80. package/dist/vscode.html-custom-data.json +54 -17
  81. package/dist/vue/index.d.ts +55 -23
  82. package/dist/web-types.json +125 -44
  83. package/package.json +1 -1
  84. package/release-please-config.json +1 -0
  85. package/scripts/postcss-leu-font-styles.cjs +10 -10
  86. package/src/components/{visualization → chart-wrapper}/ChartWrapper.ts +13 -10
  87. package/src/components/{visualization → chart-wrapper}/chart-wrapper.css +20 -11
  88. package/src/components/{visualization → chart-wrapper}/stories/chart-wrapper.stories.ts +7 -1
  89. package/src/components/{visualization → chart-wrapper}/test/chart-wrapper.test.ts +13 -10
  90. package/src/components/message/Message.ts +118 -0
  91. package/src/components/message/leu-message.ts +5 -0
  92. package/src/components/message/message.css +163 -0
  93. package/src/components/message/stories/message.mdx +76 -0
  94. package/src/components/message/stories/message.stories.ts +149 -0
  95. package/src/components/message/test/message.test.ts +96 -0
  96. package/src/docs/contributing.mdx +1 -1
  97. package/src/index.ts +1 -0
  98. package/src/styles/custom-media.css +1 -0
  99. package/src/styles/theme.css +89 -1
  100. package/dist/components/visualization/test/chart-wrapper.test.d.ts.map +0 -1
  101. package/src/styles/custom-properties.css +0 -89
  102. /package/dist/components/{visualization → chart-wrapper}/ChartWrapper.d.ts +0 -0
  103. /package/dist/components/{visualization → chart-wrapper}/leu-chart-wrapper.d.ts +0 -0
  104. /package/dist/components/{visualization → chart-wrapper}/test/chart-wrapper.test.d.ts +0 -0
  105. /package/src/components/{visualization → chart-wrapper}/leu-chart-wrapper.ts +0 -0
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.15.0"
2
+ ".": "0.16.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.16.0](https://github.com/statistikZH/leu/compare/leu-v0.15.1...leu-v0.16.0) (2025-07-31)
4
+
5
+
6
+ ### Features
7
+
8
+ * **message:** implement message component ([#298](https://github.com/statistikZH/leu/issues/298)) ([18372de](https://github.com/statistikZH/leu/commit/18372de960057ea00f79af17cf575ace9fd955c6))
9
+
10
+ ## [0.15.1](https://github.com/statistikZH/leu/compare/leu-v0.15.0...leu-v0.15.1) (2025-07-03)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **chart-wrapper:** fix directory name and add export ([9ec09fb](https://github.com/statistikZH/leu/commit/9ec09fbd715ee71977f52632627ca10a77115f53))
16
+ * **chart-wrapper:** reset user agent default styling ([f1cd090](https://github.com/statistikZH/leu/commit/f1cd0900a096a7ac5cc60faffc6c56ebf9363909))
17
+ * **theme:** explicitly define a font weight to avoid font synthesis ([2605cc9](https://github.com/statistikZH/leu/commit/2605cc9105c1b0e9439f272d09b5ec7d5f81ba33))
18
+
3
19
  ## [0.15.0](https://github.com/statistikZH/leu/compare/leu-v0.14.4...leu-v0.15.0) (2025-07-03)
4
20
 
5
21
 
package/dist/Accordion.js CHANGED
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
2
  import { css, nothing } from 'lit';
3
3
  import { unsafeStatic, html } from 'lit/static-html.js';
4
4
  import { property } from 'lit/decorators.js';
5
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
5
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
6
6
 
7
7
  var css_248z = css`:host {
8
8
  --accordion-font-regular: var(--leu-font-family-regular);
package/dist/Button.js CHANGED
@@ -4,7 +4,7 @@ import { classMap } from 'lit/directives/class-map.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
5
5
  import { property } from 'lit/decorators.js';
6
6
  import { LeuIcon } from './Icon.js';
7
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
7
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
8
8
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
9
9
 
10
10
  /**
@@ -1,5 +1,5 @@
1
1
  import { css, html } from 'lit';
2
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
2
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
3
3
  import { LeuButton } from './Button.js';
4
4
  import './_tslib-CNEFicEt.js';
5
5
  import 'lit/directives/class-map.js';
@@ -1,77 +1,85 @@
1
1
  import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
2
  import { css, nothing, html } from 'lit';
3
3
  import { property } from 'lit/decorators.js';
4
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
4
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
5
5
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
6
6
  import { LeuSpinner } from './Spinner.js';
7
7
 
8
- var css_248z = css`.title::slotted(h2) {
8
+ var css_248z = css`.chart-wrapper {
9
+ display: block;
10
+ width: 100%;
11
+ margin: 0;
12
+ }
13
+ .chart-wrapper__title::slotted(h2) {
14
+ color: var(--leu-color-black-100);
9
15
  font: var(--leu-t-curve-large-black-font);
10
16
  margin: 0 0 0.75rem;
11
17
  }
12
18
  @media (min-width: 840px) {
13
- .title::slotted(h2) {
19
+ .chart-wrapper__title::slotted(h2) {
14
20
  margin: 0 0 1.25rem;
15
21
  }
16
22
  }
17
23
  @media (min-width: 1280px) {
18
- .title::slotted(h2) {
24
+ .chart-wrapper__title::slotted(h2) {
19
25
  margin: 0 0 1.5rem;
20
26
  }
21
27
  }
22
- .title::slotted(h3) {
28
+ .chart-wrapper__title::slotted(h3) {
29
+ color: var(--leu-color-black-100);
23
30
  font: var(--leu-t-curve-medium-black-font);
24
31
  margin: 0 0 0.5rem;
25
32
  }
26
- .title::slotted(h4) {
33
+ .chart-wrapper__title::slotted(h4) {
34
+ color: var(--leu-color-black-100);
27
35
  font: var(--leu-t-curve-regular-black-font);
28
36
  margin: 0 0 0.5rem;
29
37
  }
30
- .description,
31
- .chart {
38
+ .chart-wrapper__description,
39
+ .chart-wrapper__chart {
32
40
  display: block;
33
41
  margin-bottom: 0.75rem;
34
42
  }
35
43
  @media (min-width: 840px) {
36
- .description,
37
- .chart {
44
+ .chart-wrapper__description,
45
+ .chart-wrapper__chart {
38
46
  margin-bottom: 1.25rem;
39
47
  }
40
48
  }
41
49
  @media (min-width: 1280px) {
42
- .description,
43
- .chart {
50
+ .chart-wrapper__description,
51
+ .chart-wrapper__chart {
44
52
  margin-bottom: 1.5rem;
45
53
  }
46
54
  }
47
- .description {
55
+ .chart-wrapper__description {
48
56
  font: var(--leu-t-curve-small-regular-font);
49
57
  color: var(--leu-color-black-60);
50
58
  }
51
- .caption {
59
+ .chart-wrapper__caption {
52
60
  font: var(--leu-t-curve-tiny-regular-font);
53
61
  color: var(--leu-color-black-60);
54
62
  }
55
- .ruler {
63
+ .chart-wrapper__ruler {
56
64
  display: block;
57
65
  border: none;
58
66
  border-top: 1px solid var(--leu-color-black-transp-20);
59
67
  margin: 0.75rem 0;
60
68
  }
61
69
  @media (min-width: 1280px) {
62
- .ruler {
70
+ .chart-wrapper__ruler {
63
71
  margin-top: 1rem;
64
72
  margin-bottom: 1rem;
65
73
  }
66
74
  }
67
- .download {
75
+ .chart-wrapper__download {
68
76
  display: block;
69
77
  margin-left: -0.5rem;
70
78
  }
71
- .chart-container {
79
+ .chart-wrapper__container {
72
80
  position: relative;
73
81
  }
74
- .spinner-container {
82
+ .chart-wrapper__spinner-container {
75
83
  position: absolute;
76
84
  top: 0;
77
85
  left: 0;
@@ -112,27 +120,30 @@ class LeuChartWrapper extends LeuElement {
112
120
  const hasCaption = this.hasSlotController.test("caption");
113
121
  const hasDownload = this.hasSlotController.test("download");
114
122
  return html `
115
- <figure>
116
- <slot name="title" class="title"></slot>
123
+ <figure class="chart-wrapper">
124
+ <slot name="title" class="chart-wrapper__title"></slot>
117
125
  ${hasDescription
118
- ? html `<slot name="description" class="description"></slot>`
126
+ ? html `<slot
127
+ name="description"
128
+ class="chart-wrapper__description"
129
+ ></slot>`
119
130
  : nothing}
120
- <div class="chart-container">
121
- <slot name="chart" class="chart"></slot>
131
+ <div class="chart-wrapper__container">
132
+ <slot name="chart" class="chart-wrapper__chart"></slot>
122
133
  ${this.pending
123
- ? html `<div class="spinner-container">
124
- <leu-spinner class="spinner"></leu-spinner>
134
+ ? html `<div class="chart-wrapper__spinner-container">
135
+ <leu-spinner class="chart-wrapper__spinner"></leu-spinner>
125
136
  </div>`
126
137
  : nothing}
127
138
  </div>
128
139
  ${hasCaption
129
140
  ? html `<figcaption>
130
- <slot name="caption" class="caption"></slot>
141
+ <slot name="caption" class="chart-wrapper__caption"></slot>
131
142
  </figcaption>`
132
143
  : nothing}
133
- <hr class="ruler" />
144
+ <hr class="chart-wrapper__ruler" />
134
145
  ${hasDownload
135
- ? html `<slot name="download" class="download"></slot>`
146
+ ? html `<slot name="download" class="chart-wrapper__download"></slot>`
136
147
  : nothing}
137
148
  </figure>
138
149
  `;
package/dist/Checkbox.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
2
  import { css, html } from 'lit';
3
3
  import { property } from 'lit/decorators.js';
4
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
4
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
5
5
  import { LeuIcon } from './Icon.js';
6
6
 
7
7
  var css_248z = css`:host {
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
2
  import { css, html } from 'lit';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
  import { property } from 'lit/decorators.js';
5
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
5
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
6
6
  import { LeuCheckbox } from './Checkbox.js';
7
7
  import './Icon.js';
8
8
 
package/dist/Chip.js CHANGED
@@ -1,4 +1,4 @@
1
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
1
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
2
2
  import { css } from 'lit';
3
3
 
4
4
  var css_248z = css`:host *::before,
package/dist/ChipGroup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unsafeStatic, html } from 'lit/static-html.js';
2
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
2
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
3
3
  import { css } from 'lit';
4
4
 
5
5
  var css_248z = css`.label {
package/dist/ChipLink.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { html } from 'lit';
2
2
  import { LeuChipBase } from './Chip.js';
3
- import './LeuElement-BhAmogDy.js';
3
+ import './LeuElement-C0BZ_nPB.js';
4
4
 
5
5
  const SIZES = {
6
6
  regular: "regular",
@@ -1,7 +1,7 @@
1
1
  import { html } from 'lit';
2
2
  import { LeuChipBase } from './Chip.js';
3
3
  import { LeuIcon } from './Icon.js';
4
- import './LeuElement-BhAmogDy.js';
4
+ import './LeuElement-C0BZ_nPB.js';
5
5
 
6
6
  /**
7
7
  * @slot - The content of the chip
@@ -1,6 +1,6 @@
1
1
  import { html } from 'lit';
2
2
  import { LeuChipBase } from './Chip.js';
3
- import './LeuElement-BhAmogDy.js';
3
+ import './LeuElement-C0BZ_nPB.js';
4
4
 
5
5
  const SIZES = {
6
6
  small: "small",
package/dist/Dialog.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { css, nothing, html } from 'lit';
2
2
  import { createRef, ref } from 'lit/directives/ref.js';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
4
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
5
5
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
6
6
  import { LeuIcon } from './Icon.js';
7
7
 
package/dist/Dropdown.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { css, nothing, html } from 'lit';
2
2
  import { createRef, ref } from 'lit/directives/ref.js';
3
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
3
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
4
4
  import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
5
5
  import { LeuButton } from './Button.js';
6
6
  import { LeuMenu } from './Menu.js';
package/dist/Icon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { css, html, svg } from 'lit';
2
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
2
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
3
3
 
4
4
  var css_248z = css`:host {
5
5
  display: contents;
package/dist/Input.js CHANGED
@@ -3,7 +3,7 @@ import { classMap } from 'lit/directives/class-map.js';
3
3
  import { ifDefined } from 'lit/directives/if-defined.js';
4
4
  import { live } from 'lit/directives/live.js';
5
5
  import { createRef, ref } from 'lit/directives/ref.js';
6
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
6
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
7
7
  import { LeuIcon } from './Icon.js';
8
8
 
9
9
  var css_248z = css`:host {
@@ -35,7 +35,7 @@ class LeuElement extends LitElement {
35
35
  }
36
36
  }
37
37
  }
38
- LeuElement.version = "0.15.0";
38
+ LeuElement.version = "0.16.0";
39
39
  LeuElement.dependencies = {};
40
40
  LeuElement.styles = css_248z;
41
41
 
package/dist/Menu.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { css, html } from 'lit';
2
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
2
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
3
3
  import { LeuMenuItem } from './MenuItem.js';
4
4
  import 'lit/directives/if-defined.js';
5
5
  import './Icon.js';
package/dist/MenuItem.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { css, html, nothing } from 'lit';
2
2
  import { ifDefined } from 'lit/directives/if-defined.js';
3
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
3
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
4
4
  import { LeuIcon } from './Icon.js';
5
5
 
6
6
  var css_248z = css`:host {
@@ -0,0 +1,63 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { L as LeuElement } from './LeuElement.d-BevHqLUu.js';
4
+ import { LeuIcon } from './Icon.js';
5
+
6
+ /**
7
+ * @tagname leu-message
8
+ * @cssprop --leu-message-accent-color - Sets the color of the message. According to the design system, it is only allowd for `info`
9
+ * @slot [default] - The content of the message. The title of the message should marked up with a `<strong>` tag.
10
+ * @slot cta - A call to action button that is only allowed for `size=large`
11
+ * @fires leu:remove - Fired when the close button is clicked.
12
+ */
13
+ declare class LeuMessage extends LeuElement {
14
+ static styles: lit.CSSResultGroup[];
15
+ /**
16
+ * @internal
17
+ */
18
+ static shadowRootOptions: {
19
+ delegatesFocus: boolean;
20
+ mode: ShadowRootMode;
21
+ serializable?: boolean;
22
+ slotAssignment?: SlotAssignmentMode;
23
+ customElements?: CustomElementRegistry;
24
+ registry?: CustomElementRegistry;
25
+ };
26
+ /**
27
+ * @internal
28
+ */
29
+ static dependencies: {
30
+ "leu-icon": typeof LeuIcon;
31
+ };
32
+ /**
33
+ * @internal
34
+ */
35
+ static iconToTypeMap: {
36
+ info: string;
37
+ error: string;
38
+ success: string;
39
+ warning: string;
40
+ };
41
+ /**
42
+ * The type of the message. `error` and `success` will be displayed as filled boxes.
43
+ */
44
+ type: "error" | "success" | "info" | "warning";
45
+ /**
46
+ * The size of the message. A call to action button is only allowed for `large` messages.
47
+ */
48
+ size: "regular" | "large";
49
+ /**
50
+ * Wheter the message is removable or not. The component will not remove itself when the close button is clicked.
51
+ */
52
+ removable: boolean;
53
+ /**
54
+ * Wheter the message is used as a popup or not. This will add a drop shadow but will not position the message absolutely.
55
+ */
56
+ popup: boolean;
57
+ private hasSlotController;
58
+ protected renderIcon(): lit_html.TemplateResult<1>;
59
+ protected handleRemove(): void;
60
+ render(): lit_html.TemplateResult<1>;
61
+ }
62
+
63
+ export { LeuMessage };
@@ -0,0 +1,268 @@
1
+ import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
+ import { css, html, nothing } from 'lit';
3
+ import { property } from 'lit/decorators.js';
4
+ import { classMap } from 'lit/directives/class-map.js';
5
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
6
+ import { LeuIcon } from './Icon.js';
7
+ import { H as HasSlotController } from './hasSlotController-Bm2tipvG.js';
8
+
9
+ var css_248z = css`:host {
10
+ font-family: var(--leu-font-family-regular);
11
+ }
12
+ .message {
13
+ position: relative;
14
+ display: flex;
15
+ flex-flow: row nowrap;
16
+ align-items: center;
17
+
18
+ padding: var(--_padding);
19
+ border-radius: 0.25rem;
20
+ overflow: hidden;
21
+
22
+ background-color: var(--leu-color-black-0);
23
+ color: var(--_accent-color);
24
+ }
25
+ .message::before {
26
+ content: "";
27
+ position: absolute;
28
+ top: 0;
29
+ left: 0;
30
+ width: 0.25rem;
31
+ height: 100%;
32
+ background-color: var(--_accent-color);
33
+ }
34
+ .message--error {
35
+ --_accent-color: var(--leu-message-accent-color, var(--leu-color-func-red));
36
+ }
37
+ .message--warning {
38
+ --_accent-color: var(--leu-message-accent-color, var(--leu-color-func-red));
39
+ }
40
+ .message--success {
41
+ --_accent-color: var(--leu-message-accent-color, var(--leu-color-func-green));
42
+ }
43
+ .message--info {
44
+ --_accent-color: var(
45
+ --leu-message-accent-color,
46
+ var(--leu-color-accent-violet)
47
+ );
48
+ }
49
+ .message--filled {
50
+ background-color: var(--_accent-color);
51
+ color: var(--leu-color-black-0);
52
+ }
53
+ .message--filled::before {
54
+ content: none;
55
+ }
56
+ .message--regular {
57
+ --_padding: 0.75rem;
58
+ --_icon-size: 24px;
59
+ }
60
+ @media (min-width: 1024px) {
61
+ .message--regular {
62
+ --_padding: 1rem;
63
+ }
64
+ }
65
+ .message--large {
66
+ --_padding: 1rem;
67
+ --_icon-size: 32px;
68
+ }
69
+ @media (max-width: 599px) {
70
+ .message--large {
71
+ flex-flow: column;
72
+ align-items: start;
73
+ gap: 0.75rem;
74
+ }
75
+ }
76
+ @media (min-width: 600px) {
77
+ .message--large {
78
+ --_padding: 1.25rem;
79
+ }
80
+ }
81
+ @media (min-width: 1024px) {
82
+ .message--large {
83
+ --_padding: 1.5rem;
84
+ }
85
+ }
86
+ .message--popup {
87
+ box-shadow: var(--leu-box-shadow-regular);
88
+ }
89
+ .message__icon {
90
+ --leu-icon-size: var(--_icon-size);
91
+
92
+ display: block;
93
+ flex: 0 0 min-content;
94
+ }
95
+ .message__content {
96
+ flex: 1 1 auto;
97
+ font: var(--leu-t-curve-small-regular-font);
98
+ margin: 0 0.5rem;
99
+ }
100
+ @media (min-width: 600px) {
101
+ .message__content {
102
+ margin-left: 0.75rem;
103
+ margin-right: 0.75rem;
104
+ }
105
+ }
106
+ @media (min-width: 1024px) {
107
+ .message__content {
108
+ margin-left: 1rem;
109
+ margin-right: 1rem;
110
+ }
111
+ }
112
+ @media (max-width: 599px) {
113
+ .message--large .message__content {
114
+ margin-left: 0;
115
+ margin-right: 0;
116
+ }
117
+ }
118
+ .message__content ::slotted(strong) {
119
+ font-family: var(--leu-font-family-black);
120
+ font-weight: normal;
121
+ }
122
+ .message__cta {
123
+ display: block;
124
+ flex: 0 0 min-content;
125
+ margin-right: 0.5rem;
126
+ }
127
+ .message__remove {
128
+ flex: 0 0 min-content;
129
+ border: none;
130
+ background: none;
131
+ padding: 0;
132
+ color: var(--leu-color-black-60);
133
+ cursor: pointer;
134
+ }
135
+ .message__remove:where(:hover, :focus-visible) {
136
+ color: var(--leu-color-black-40);
137
+ }
138
+ .message--filled .message__remove {
139
+ color: var(--leu-color-black-0);
140
+ }
141
+ .message--filled .message__remove:where(:hover, :focus-visible) {
142
+ color: var(--leu-color-white-transp-70);
143
+ }
144
+ .message--large .message__remove {
145
+ position: absolute;
146
+ top: var(--_padding);
147
+ right: var(--_padding);
148
+ }
149
+ @media (min-width: 600px) {
150
+ .message--large .message__remove {
151
+ position: static;
152
+ top: auto;
153
+ right: auto;
154
+ bottom: auto;
155
+ left: auto;
156
+ }
157
+ }
158
+ .message__remove-icon {
159
+ --leu-icon-size: 1.5rem;
160
+ }
161
+ `;
162
+
163
+ /**
164
+ * @tagname leu-message
165
+ * @cssprop --leu-message-accent-color - Sets the color of the message. According to the design system, it is only allowd for `info`
166
+ * @slot [default] - The content of the message. The title of the message should marked up with a `<strong>` tag.
167
+ * @slot cta - A call to action button that is only allowed for `size=large`
168
+ * @fires leu:remove - Fired when the close button is clicked.
169
+ */
170
+ class LeuMessage extends LeuElement {
171
+ constructor() {
172
+ super(...arguments);
173
+ /**
174
+ * The type of the message. `error` and `success` will be displayed as filled boxes.
175
+ */
176
+ this.type = "success";
177
+ /**
178
+ * The size of the message. A call to action button is only allowed for `large` messages.
179
+ */
180
+ this.size = "regular";
181
+ /**
182
+ * Wheter the message is removable or not. The component will not remove itself when the close button is clicked.
183
+ */
184
+ this.removable = false;
185
+ /**
186
+ * Wheter the message is used as a popup or not. This will add a drop shadow but will not position the message absolutely.
187
+ */
188
+ this.popup = false;
189
+ this.hasSlotController = new HasSlotController(this, ["cta"]);
190
+ }
191
+ renderIcon() {
192
+ const name = LeuMessage.iconToTypeMap[this.type];
193
+ return html `<leu-icon class="message__icon" name=${name}></leu-icon>`;
194
+ }
195
+ handleRemove() {
196
+ this.dispatchEvent(new CustomEvent("leu:remove", {
197
+ bubbles: true,
198
+ composed: true,
199
+ }));
200
+ }
201
+ render() {
202
+ const hasCta = this.hasSlotController.test("cta");
203
+ const classes = classMap({
204
+ message: true,
205
+ "message--filled": this.type === "error" || this.type === "success",
206
+ "message--popup": this.popup,
207
+ [`message--${this.size}`]: true,
208
+ [`message--${this.type}`]: true,
209
+ });
210
+ return html `
211
+ <div class="${classes}">
212
+ ${this.renderIcon()}
213
+ <p class="message__content">
214
+ <slot></slot>
215
+ </p>
216
+ ${hasCta
217
+ ? html `<slot class="message__cta" name="cta"></slot>`
218
+ : nothing}
219
+ ${this.removable
220
+ ? html `<button
221
+ class="message__remove"
222
+ aria-label="Meldung schliessen"
223
+ @click=${this.handleRemove}
224
+ >
225
+ <leu-icon class="message__remove-icon" name="close"></leu-icon>
226
+ </button>`
227
+ : nothing}
228
+ </div>
229
+ `;
230
+ }
231
+ }
232
+ LeuMessage.styles = [LeuElement.styles, css_248z];
233
+ /**
234
+ * @internal
235
+ */
236
+ LeuMessage.shadowRootOptions = {
237
+ ...LeuElement.shadowRootOptions,
238
+ delegatesFocus: true,
239
+ };
240
+ /**
241
+ * @internal
242
+ */
243
+ LeuMessage.dependencies = {
244
+ "leu-icon": LeuIcon,
245
+ };
246
+ /**
247
+ * @internal
248
+ */
249
+ LeuMessage.iconToTypeMap = {
250
+ info: "getInformation",
251
+ error: "caution",
252
+ success: "confirm",
253
+ warning: "caution",
254
+ };
255
+ __decorate([
256
+ property({ type: String, reflect: true })
257
+ ], LeuMessage.prototype, "type", void 0);
258
+ __decorate([
259
+ property({ type: String, reflect: true })
260
+ ], LeuMessage.prototype, "size", void 0);
261
+ __decorate([
262
+ property({ type: Boolean, reflect: true })
263
+ ], LeuMessage.prototype, "removable", void 0);
264
+ __decorate([
265
+ property({ type: Boolean, reflect: true })
266
+ ], LeuMessage.prototype, "popup", void 0);
267
+
268
+ export { LeuMessage };
@@ -2,7 +2,7 @@ import { _ as __decorate } from './_tslib-CNEFicEt.js';
2
2
  import { css, html } from 'lit';
3
3
  import { live } from 'lit/directives/live.js';
4
4
  import { property, state } from 'lit/decorators.js';
5
- import { L as LeuElement } from './LeuElement-BhAmogDy.js';
5
+ import { L as LeuElement } from './LeuElement-C0BZ_nPB.js';
6
6
  import { LeuButton } from './Button.js';
7
7
  import { LeuVisuallyHidden } from './VisuallyHidden.js';
8
8
  import { LeuIcon } from './Icon.js';