@sbb-esta/lyne-elements-dev 5.0.0-next-dev.1776959321 → 5.0.0-next-dev.1777014673

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 (35) hide show
  1. package/alert/alert/alert.component.js +1 -1
  2. package/alert/alert-group/alert-group.component.js +1 -1
  3. package/{alert-group.component-CAjj3FtE.js → alert-group.component-BCYOVicl.js} +5 -7
  4. package/alert.component-BQsF0R1M.js +161 -0
  5. package/alert.js +2 -2
  6. package/alert.pure.js +2 -2
  7. package/core/styles/core.scss +11 -0
  8. package/core.css +19 -0
  9. package/custom-elements.json +2163 -2163
  10. package/development/alert/alert/alert.component.d.ts +1 -0
  11. package/development/alert/alert/alert.component.d.ts.map +1 -1
  12. package/development/alert/alert/alert.component.js +1 -1
  13. package/development/alert/alert-group/alert-group.component.d.ts.map +1 -1
  14. package/development/alert/alert-group/alert-group.component.js +1 -1
  15. package/development/alert-group.component-D4KxKTd2.js +186 -0
  16. package/development/alert.component-Pv-Ol6XU.js +213 -0
  17. package/development/alert.js +2 -2
  18. package/development/alert.pure.js +2 -2
  19. package/development/step.component-D1Gq0VRW.js +146 -0
  20. package/development/stepper/step/step.component.d.ts.map +1 -1
  21. package/development/stepper/step/step.component.js +1 -1
  22. package/development/stepper.js +1 -1
  23. package/development/stepper.pure.js +1 -1
  24. package/off-brand-theme.css +19 -0
  25. package/package.json +2 -2
  26. package/safety-theme.css +19 -0
  27. package/standard-theme.css +19 -0
  28. package/{step.component-sQbJslHx.js → step.component-DuLOqjZk.js} +3 -5
  29. package/stepper/step/step.component.js +1 -1
  30. package/stepper.js +1 -1
  31. package/stepper.pure.js +1 -1
  32. package/alert.component-C42LwoGa.js +0 -163
  33. package/development/alert-group.component-DeI6kuwn.js +0 -188
  34. package/development/alert.component-Cn36k_Hf.js +0 -214
  35. package/development/step.component-CVWxYkrv.js +0 -148
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../alert.component-C42LwoGa.js";
1
+ import { t as e } from "../../alert.component-BQsF0R1M.js";
2
2
  export { e as SbbAlertElement };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../alert-group.component-CAjj3FtE.js";
1
+ import { t as e } from "../../alert-group.component-BCYOVicl.js";
2
2
  export { e as SbbAlertGroupElement };
@@ -4,7 +4,7 @@ import { property as i, state as a } from "lit/decorators.js";
4
4
  import { SbbElement as o, boxSizingStyles as s, forceType as c, isEventPrevented as l } from "./core.js";
5
5
  import { html as u, unsafeStatic as d } from "lit/static-html.js";
6
6
  //#region src/elements/alert/alert-group/alert-group.scss?inline
7
- var f = ":host{--sbb-alert-group-gap: var(--sbb-spacing-fixed-3x);--sbb-alert-group-border-radius: var(--sbb-border-radius-4x);display:block}.sbb-alert-group{display:flex;flex-direction:column;gap:var(--sbb-alert-group-gap)}:host(:focus-visible:not(:is(:state(empty),[state--empty]))){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);border-radius:var(--sbb-alert-group-border-radius)}.sbb-alert-group__title{border:0;clip-path:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}", p = (() => {
7
+ var f = ":host{display:flex;flex-direction:column;gap:var(--sbb-alert-group-gap)}:host(:focus-visible:not(:is(:state(empty),[state--empty]))){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);border-radius:var(--sbb-alert-group-border-radius)}.sbb-alert-group__title{border:0;clip-path:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}", p = (() => {
8
8
  let p = o, m, h = [], g = [], _, v = [], y = [], b, x = [], S = [], C, w = [], T = [];
9
9
  return class extends p {
10
10
  static {
@@ -124,12 +124,10 @@ var f = ":host{--sbb-alert-group-gap: var(--sbb-spacing-fixed-3x);--sbb-alert-gr
124
124
  render() {
125
125
  let e = `h${this.accessibilityTitleLevel}`;
126
126
  return u`
127
- <div class="sbb-alert-group">
128
- ${this._hasAlerts ? u`<${d(e)} class="sbb-alert-group__title">
129
- <slot name="accessibility-title">${this.accessibilityTitle}</slot>
130
- </${d(e)}>` : n}
131
- <slot @slotchange=${(e) => this._slotChanged(e)}></slot>
132
- </div>
127
+ ${this._hasAlerts ? u`<${d(e)} class="sbb-alert-group__title">
128
+ <slot name="accessibility-title">${this.accessibilityTitle}</slot>
129
+ </${d(e)}>` : n}
130
+ <slot @slotchange=${(e) => this._slotChanged(e)}></slot>
133
131
  `;
134
132
  }
135
133
  };
@@ -0,0 +1,161 @@
1
+ import { __esDecorate as e, __runInitializers as t } from "tslib";
2
+ import { html as n, nothing as r, unsafeCSS as i } from "lit";
3
+ import { property as a } from "lit/decorators.js";
4
+ import { SbbDarkModeController as o, SbbLanguageController as s, SbbOpenCloseBaseElement as c, SbbReadonlyMixin as l, boxSizingStyles as u, i18nCloseAlert as d, isLean as f, isZeroAnimationDuration as p } from "./core.js";
5
+ import { SbbTransparentButtonElement as m } from "./button.pure.js";
6
+ import { SbbDividerElement as h } from "./divider.pure.js";
7
+ import { SbbIconNameMixin as g } from "./icon.pure.js";
8
+ //#region src/elements/alert/alert/alert.scss?inline
9
+ var _ = ":host{--sbb-alert-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-6x) );display:grid;grid-template-rows:0fr;opacity:0;border-radius:var(--sbb-alert-forced-color-border-radius);outline:var(--sbb-alert-outline)}:host(:is(:state(state-opening),[state--state-opening]):not([animation=open],[animation=all])){--sbb-disable-animation-duration: 0s}:host(:is(:state(state-closing),[state--state-closing]):not([animation=close],[animation=all])){--sbb-disable-animation-duration: 0s}:host([size=s]){--sbb-alert-gap: var(--sbb-spacing-fixed-1x) var(--sbb-spacing-responsive-xxs);--sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxxs)}:host([size=m]){--sbb-alert-gap: var(--sbb-spacing-fixed-2x) var(--sbb-spacing-responsive-xs);--sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxs)}:host([size=l]){--sbb-alert-icon-size: var(--sbb-alert-icon-size-l);--sbb-alert-title-margin-block: 0 var(--sbb-spacing-fixed-1x)}:host(:not(:is(:state(dark),[state--dark]))){--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark)}:host(:is(:is(:state(state-opened),[state--state-opened]),:is(:state(state-closing),[state--state-closing]))){grid-template-rows:1fr;opacity:1}:host(:is(:state(state-opening),[state--state-opening])){animation-name:open,open-opacity;animation-fill-mode:forwards;animation-duration:var(--sbb-alert-animation-duration);animation-timing-function:var(--sbb-alert-timing-function);animation-delay:0s,var(--sbb-alert-animation-duration)}:host(:is(:state(state-closing),[state--state-closing])){animation-name:close-opacity,close;animation-fill-mode:forwards;animation-duration:var(--sbb-alert-animation-duration);animation-timing-function:var(--sbb-alert-timing-function);animation-delay:0s,var(--sbb-disable-animation-duration, var(--sbb-animation-duration-2x))}.sbb-alert__transition-wrapper{overflow:hidden}.sbb-alert{display:grid;grid-template-columns:1fr auto;align-items:center;gap:var(--sbb-alert-gap);min-width:fit-content;padding:var(--sbb-alert-padding);overflow:hidden;color:var(--sbb-alert-color);background-color:var(--sbb-alert-background-color);border-radius:var(--sbb-alert-border-radius);font-size:var(--sbb-alert-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);line-height:var(--sbb-typo-line-height-text)}@media(min-width:37.5rem){.sbb-alert{grid-template-columns:auto 1fr auto;align-items:flex-start}}.sbb-alert__icon{display:flex;align-items:start;padding-block:var(--sbb-spacing-fixed-1x);min-width:var(--sbb-alert-icon-size);--sbb-icon-svg-width: var(--sbb-alert-icon-size);--sbb-icon-svg-height: var(--sbb-alert-icon-size)}.sbb-alert__content{color-scheme:only light;order:3;grid-column:1/3}@media(min-width:37.5rem){.sbb-alert__content{order:initial;grid-column-start:initial;grid-column-end:initial}}.sbb-alert__content-slot{display:inline;margin:0;padding:0}.sbb-alert__close-button-wrapper{color-scheme:only light;display:flex;justify-content:flex-end;align-items:center;height:100%}@media(min-width:37.5rem){.sbb-alert__close-button{margin-inline-start:var(--sbb-alert-close-icon-margin)}}.sbb-alert__close-button-divider{display:var(--sbb-alert-close-button-divider-display, none);height:calc(100% - var(--sbb-spacing-fixed-1x) * 2)}@keyframes open{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}@keyframes open-opacity{0%{opacity:0}to{opacity:1}}@keyframes close{0%{grid-template-rows:1fr}to{grid-template-rows:0fr}}@keyframes close-opacity{0%{opacity:1}to{opacity:0}}::slotted(sbb-title){margin-block:var(--sbb-alert-title-margin-block)}", v = (() => {
10
+ let v = g(l(c)), y, b = [], x = [], S, C = [], w = [];
11
+ return class extends v {
12
+ static {
13
+ let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(v[Symbol.metadata] ?? null) : void 0;
14
+ y = [a({ reflect: !0 })], S = [a({ reflect: !0 })], e(this, null, y, {
15
+ kind: "accessor",
16
+ name: "size",
17
+ static: !1,
18
+ private: !1,
19
+ access: {
20
+ has: (e) => "size" in e,
21
+ get: (e) => e.size,
22
+ set: (e, t) => {
23
+ e.size = t;
24
+ }
25
+ },
26
+ metadata: t
27
+ }, b, x), e(this, null, S, {
28
+ kind: "accessor",
29
+ name: "animation",
30
+ static: !1,
31
+ private: !1,
32
+ access: {
33
+ has: (e) => "animation" in e,
34
+ get: (e) => e.animation,
35
+ set: (e, t) => {
36
+ e.animation = t;
37
+ }
38
+ },
39
+ metadata: t
40
+ }, C, w), t && Object.defineProperty(this, Symbol.metadata, {
41
+ enumerable: !0,
42
+ configurable: !0,
43
+ writable: !0,
44
+ value: t
45
+ });
46
+ }
47
+ static {
48
+ this.elementName = "sbb-alert";
49
+ }
50
+ static {
51
+ this.elementDependencies = [m, h];
52
+ }
53
+ static {
54
+ this.styles = [u, i(_)];
55
+ }
56
+ static {
57
+ this.events = {
58
+ beforeopen: "beforeopen",
59
+ open: "open",
60
+ beforeclose: "beforeclose",
61
+ close: "close"
62
+ };
63
+ }
64
+ #e;
65
+ get size() {
66
+ return this.#e;
67
+ }
68
+ set size(e) {
69
+ this.#e = e;
70
+ }
71
+ #t;
72
+ get animation() {
73
+ return this.#t;
74
+ }
75
+ set animation(e) {
76
+ this.#t = e;
77
+ }
78
+ constructor() {
79
+ super(), this.#e = t(this, b, f() ? "s" : "m"), this.#t = (t(this, x), t(this, C, "all")), this._language = (t(this, w), new s(this)), this._darkModeController = new o(this, () => {
80
+ this._syncLinks(), this._configureTitle(), this.requestUpdate();
81
+ }), this.addEventListener("animationend", (e) => this._onAnimationEnd(e));
82
+ }
83
+ open() {
84
+ this.state = "opening", this.dispatchBeforeOpenEvent() && this._isZeroAnimationDuration() && this._handleOpening();
85
+ }
86
+ close() {
87
+ this.state === "opened" && this.dispatchBeforeCloseEvent() && (this.state = "closing", this._isZeroAnimationDuration() && this._handleClosing());
88
+ }
89
+ firstUpdated(e) {
90
+ super.firstUpdated(e), this.open();
91
+ }
92
+ willUpdate(e) {
93
+ super.willUpdate(e), e.has("size") && this._configureTitle();
94
+ }
95
+ _isZeroAnimationDuration() {
96
+ return p(this, "--sbb-alert-animation-duration");
97
+ }
98
+ _onAnimationEnd(e) {
99
+ this.state === "opening" && e.animationName === "open-opacity" ? this._handleOpening() : this.state === "closing" && e.animationName === "close" && this._handleClosing();
100
+ }
101
+ _handleOpening() {
102
+ this.state = "opened", this.dispatchOpenEvent();
103
+ }
104
+ _handleClosing() {
105
+ this.state = "closed", this.dispatchCloseEvent(), setTimeout(() => this.remove());
106
+ }
107
+ _handleSlotchange() {
108
+ this._syncLinks();
109
+ let e = Array.from(this.children).find((e) => e.localName === "sbb-title");
110
+ e && (e.slot = "title");
111
+ }
112
+ _syncLinks() {
113
+ Array.from(this.querySelectorAll?.("sbb-link") ?? []).forEach((e) => {
114
+ customElements.upgrade(e), e.negative = this._isLightMode();
115
+ });
116
+ }
117
+ _configureTitle() {
118
+ let e = this.querySelector?.("sbb-title");
119
+ e && (customElements.upgrade(e), e.negative = this._isLightMode(), e.visualLevel = this.size === "l" ? "3" : "5");
120
+ }
121
+ _isLightMode() {
122
+ return !this._darkModeController.matches();
123
+ }
124
+ renderIconName() {
125
+ return super.renderIconName() || "info";
126
+ }
127
+ render() {
128
+ return n`
129
+ <!-- wrapper needed to properly support fade in animation -->
130
+ <div class="sbb-alert__transition-wrapper">
131
+ <div class="sbb-alert">
132
+ <span class="sbb-alert__icon"> ${this.renderIconSlot()} </span>
133
+ <span class="sbb-alert__content">
134
+ <slot name="title" @slotchange=${this._configureTitle}></slot>
135
+ <p class="sbb-alert__content-slot">
136
+ <slot @slotchange=${this._handleSlotchange}></slot>
137
+ </p>
138
+ </span>
139
+ ${this.readOnly ? r : n`<span class="sbb-alert__close-button-wrapper">
140
+ <sbb-divider
141
+ orientation="vertical"
142
+ ?negative=${this._isLightMode()}
143
+ class="sbb-alert__close-button-divider"
144
+ ></sbb-divider>
145
+ <sbb-transparent-button
146
+ ?negative=${this._isLightMode()}
147
+ size=${this.size === "l" ? "m" : this.size}
148
+ icon-name="cross-small"
149
+ @click=${() => this.close()}
150
+ aria-label=${d[this._language.current]}
151
+ class="sbb-alert__close-button"
152
+ ></sbb-transparent-button>
153
+ </span>`}
154
+ </div>
155
+ </div>
156
+ `;
157
+ }
158
+ };
159
+ })();
160
+ //#endregion
161
+ export { v as t };
package/alert.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as e } from "./alert-group.component-CAjj3FtE.js";
2
- import { t } from "./alert.component-C42LwoGa.js";
1
+ import { t as e } from "./alert-group.component-BCYOVicl.js";
2
+ import { t } from "./alert.component-BQsF0R1M.js";
3
3
  import "./alert.pure.js";
4
4
  t.define(), e.define();
5
5
  //#endregion
package/alert.pure.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as e } from "./alert-group.component-CAjj3FtE.js";
2
- import { t } from "./alert.component-C42LwoGa.js";
1
+ import { t as e } from "./alert-group.component-BCYOVicl.js";
2
+ import { t } from "./alert.component-BQsF0R1M.js";
3
3
  export { t as SbbAlertElement, e as SbbAlertGroupElement };
@@ -39,6 +39,12 @@ $theme: 'standard' !default;
39
39
  @use '../../card/card/card.global' as card with (
40
40
  $theme: $theme
41
41
  );
42
+ @use '../../alert/alert/alert.global' as alert with (
43
+ $theme: $theme
44
+ );
45
+ @use '../../alert/alert-group/alert-group.global' as alert-group with (
46
+ $theme: $theme
47
+ );
42
48
  @use '../../chip-label/chip-label.global' as chip-label with (
43
49
  $theme: $theme
44
50
  );
@@ -291,6 +297,8 @@ $theme: 'standard' !default;
291
297
  // Grab CSS vars defined by `@sbb-esta/lyne-design-tokens` package
292
298
  @include sbb-css-tokens.base;
293
299
 
300
+ @include alert.base;
301
+ @include alert-group.base;
294
302
  @include breadcrumb.base;
295
303
  @include breadcrumb-group.base;
296
304
  @include button.base;
@@ -377,6 +385,7 @@ $theme: 'standard' !default;
377
385
  @include a11y.if-forced-colors {
378
386
  @include sbb-css-tokens.forced-colors;
379
387
 
388
+ @include alert.base-forced-colors;
380
389
  @include breadcrumb.base-forced-colors;
381
390
  @include card.base-forced-colors;
382
391
  @include card-badge.base-forced-colors;
@@ -446,6 +455,7 @@ $theme: 'standard' !default;
446
455
  @include mediaqueries.mq($from: small) {
447
456
  @include sbb-css-tokens.breakpoint-small;
448
457
 
458
+ @include alert.base-breakpoint-small;
449
459
  @include dialog.base-breakpoint-small;
450
460
  @include footer.base-breakpoint-small;
451
461
  @include notification.base-breakpoint-small;
@@ -454,6 +464,7 @@ $theme: 'standard' !default;
454
464
  @include mediaqueries.mq($from: large) {
455
465
  @include sbb-css-tokens.breakpoint-large;
456
466
 
467
+ @include alert.base-breakpoint-large;
457
468
  @include button.base-breakpoint-large;
458
469
  @include chip-group.base-breakpoint-large;
459
470
  @include dialog.base-breakpoint-large;
package/core.css CHANGED
@@ -1163,6 +1163,20 @@ slot[name=error]::slotted(*) {
1163
1163
  --sbb-size-element-s: var(--sbb-size-element-s-zero);
1164
1164
  --sbb-size-element-m: var(--sbb-size-element-m-zero);
1165
1165
  --sbb-size-element-l: var(--sbb-size-element-l-zero);
1166
+ --sbb-alert-background-color: var(--sbb-background-color-1-inverted);
1167
+ --sbb-alert-border-radius: var(--sbb-border-radius-4x);
1168
+ --sbb-alert-color: var(--sbb-color-aluminium);
1169
+ --sbb-alert-color: light-dark(var(--sbb-color-aluminium), var(--sbb-color-anthracite));
1170
+ --sbb-alert-padding: var(--sbb-spacing-responsive-xxs) var(--sbb-spacing-responsive-xs);
1171
+ --sbb-alert-timing-function: ease-in;
1172
+ --sbb-alert-icon-size: 1.25rem;
1173
+ --sbb-alert-icon-size-l: var(--sbb-size-icon-ui-small);
1174
+ --sbb-alert-title-margin-block: 0;
1175
+ --sbb-alert-font-size: var(--sbb-text-font-size-s);
1176
+ --sbb-alert-gap: var(--sbb-spacing-fixed-2x) var(--sbb-spacing-responsive-xs);
1177
+ --sbb-alert-close-icon-margin: var(--sbb-spacing-responsive-xxs);
1178
+ --sbb-alert-group-gap: var(--sbb-spacing-fixed-3x);
1179
+ --sbb-alert-group-border-radius: var(--sbb-border-radius-4x);
1166
1180
  --sbb-breadcrumb-color: var(--sbb-color-granite);
1167
1181
  --sbb-breadcrumb-color: light-dark(var(--sbb-color-granite), var(--sbb-color-aluminium));
1168
1182
  --sbb-breadcrumb-color-hover: var(--sbb-color-charcoal);
@@ -1868,6 +1882,8 @@ slot[name=error]::slotted(*) {
1868
1882
  --sbb-focus-outline-color-default: Highlight;
1869
1883
  --sbb-focus-outline-color-dark: Highlight;
1870
1884
  --sbb-focus-outline-width: var(--sbb-border-width-2x);
1885
+ --sbb-alert-outline: var(--sbb-border-width-1x) solid CanvasText;
1886
+ --sbb-alert-forced-color-border-radius: var(--sbb-alert-border-radius);
1871
1887
  --sbb-breadcrumb-color: ButtonText;
1872
1888
  --sbb-breadcrumb-color-active: Highlight;
1873
1889
  --sbb-card-border-color: CanvasText;
@@ -1957,6 +1973,7 @@ slot[name=error]::slotted(*) {
1957
1973
  --sbb-layout-base-offset-responsive: var(--sbb-layout-base-offset-responsive-small);
1958
1974
  --sbb-grid-base-columns: var(--sbb-layout-base-grid-columns-small);
1959
1975
  --sbb-grid-base-gutter-responsive: var(--sbb-layout-base-grid-gutter-responsive-small);
1976
+ --sbb-alert-close-button-divider-display: block;
1960
1977
  --sbb-dialog-padding-inline: var(--sbb-spacing-fixed-12x);
1961
1978
  --sbb-footer-clock-width: 7rem;
1962
1979
  --sbb-notification-icon-align-self: flex-start;
@@ -1998,6 +2015,8 @@ slot[name=error]::slotted(*) {
1998
2015
  --sbb-size-element-s: var(--sbb-size-element-s-large);
1999
2016
  --sbb-size-element-m: var(--sbb-size-element-m-large);
2000
2017
  --sbb-size-element-l: var(--sbb-size-element-l-large);
2018
+ --sbb-alert-icon-size: 1.75rem;
2019
+ --sbb-alert-icon-size-l: 2.125rem;
2001
2020
  --sbb-button-padding-inline-size-l: var(--sbb-spacing-fixed-10x);
2002
2021
  --sbb-button-padding-inline-size-m: var(--sbb-spacing-fixed-8x);
2003
2022
  --sbb-button-padding-inline-size-s: var(--sbb-spacing-fixed-5x);