@sbb-esta/lyne-elements-dev 5.15.0-dev.1796054560 → 5.15.0-dev.1796137118

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 (52) hide show
  1. package/carousel.pure.js +6 -6
  2. package/clock.pure.js +11 -11
  3. package/core.js +10 -10
  4. package/custom-elements.json +282 -99
  5. package/development/carousel/carousel-list/carousel-list.component.d.ts +1 -0
  6. package/development/carousel.pure.js +4 -3
  7. package/development/clock/clock.component.d.ts +1 -0
  8. package/development/clock.pure.js +14 -16
  9. package/development/core/controllers/host-styles-controller.d.ts +14 -0
  10. package/development/core/mixins/dynamic-styleheet-mixin.d.ts +1 -0
  11. package/development/core.d.ts +2 -1
  12. package/development/core.js +134 -95
  13. package/development/flip-card/flip-card/flip-card.component.d.ts +1 -0
  14. package/development/flip-card.pure.js +3 -2
  15. package/development/menu/menu/menu.component.d.ts +1 -0
  16. package/development/menu.pure.js +3 -4
  17. package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts +1 -0
  18. package/development/mini-calendar.pure.js +3 -2
  19. package/development/navigation/navigation-marker/navigation-marker.component.d.ts +1 -0
  20. package/development/navigation.pure.js +3 -2
  21. package/development/notification/notification.component.d.ts +1 -0
  22. package/development/notification.pure.js +3 -2
  23. package/development/popover/popover-base/popover-base.d.ts +1 -0
  24. package/development/popover.pure.js +3 -5
  25. package/development/sidebar/sidebar-container/sidebar-container.component.d.ts +2 -1
  26. package/development/sidebar.pure.js +7 -5
  27. package/development/slider/slider.component.d.ts +1 -0
  28. package/development/slider.pure.js +3 -2
  29. package/development/stepper/stepper/stepper.component.d.ts +1 -0
  30. package/development/stepper.pure.js +6 -5
  31. package/development/tabs/tab-group/tab-group.component.d.ts +1 -0
  32. package/development/tabs/tab-nav-bar/tab-nav-bar.component.d.ts +1 -0
  33. package/development/tabs.pure.js +8 -6
  34. package/development/toggle/toggle/toggle.component.d.ts +1 -0
  35. package/development/toggle.pure.js +4 -4
  36. package/development/tooltip/tooltip.component.d.ts +2 -1
  37. package/development/tooltip.pure.js +7 -4
  38. package/development/train.pure.js +4 -17
  39. package/flip-card.pure.js +8 -8
  40. package/menu.pure.js +8 -8
  41. package/mini-calendar.pure.js +5 -5
  42. package/navigation.pure.js +12 -12
  43. package/notification.pure.js +4 -4
  44. package/package.json +2 -2
  45. package/popover.pure.js +5 -5
  46. package/sidebar.pure.js +11 -11
  47. package/slider.pure.js +3 -3
  48. package/stepper.pure.js +7 -7
  49. package/tabs.pure.js +11 -11
  50. package/toggle.pure.js +4 -4
  51. package/tooltip.pure.js +2 -2
  52. package/train.pure.js +24 -29
@@ -2,7 +2,7 @@ import { __esDecorate, __runInitializers } from "tslib";
2
2
  import { html, isServer, unsafeCSS } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
  import { ref } from "lit/directives/ref.js";
5
- import { SbbElement } from "./core.js";
5
+ import { SbbElement, SbbHostStylesController } from "./core.js";
6
6
 
7
7
  // src/elements/clock/assets/sbb_clock_face.svg?raw
8
8
  var sbb_clock_face_default = "<svg focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 105 105\"><g class=\"face\"><circle fill=\"var(--sbb-clock-background-color)\" cx=\"52.5\" cy=\"52.5\" r=\"52.5\"/><path d=\"M50.75 4h3.5v12h-3.5zM50.75 89h3.5v12h-3.5zM75.233 9.623l3.03 1.75-6 10.392-3.03-1.75zM32.734 83.233l3.03 1.75-6 10.392-3.03-1.75zM93.628 26.732l1.75 3.031-10.392 6-1.75-3.03zM20.017 69.234l1.75 3.031-10.392 6-1.75-3.03zM101 50.75v3.5H89v-3.5zM16 50.75v3.5H4v-3.5zM95.379 75.232l-1.75 3.031-10.392-6 1.75-3.03zM21.766 32.734l-1.75 3.031-10.392-6 1.75-3.03zM78.267 93.63l-3.03 1.75-6-10.393 3.03-1.75zM35.766 20.015l-3.03 1.75-6-10.392 3.03-1.75z\"/><g><path d=\"M56.873 4.19l1.392.147-.366 3.48-1.392-.145zM47.101 97.177l1.393.146-.366 3.481-1.392-.146zM61.896 4.914l1.37.29-.728 3.424-1.37-.29zM42.458 96.366l1.37.29-.728 3.424-1.37-.291zM66.825 6.157l1.332.432-1.082 3.33-1.331-.434zM37.931 95.085l1.332.432-1.082 3.33-1.331-.433zM71.584 7.906l1.28.569-1.424 3.197-1.28-.57zM33.56 93.32l1.278.569-1.423 3.197-1.28-.57zM80.44 12.852l1.133.823-2.058 2.831-1.132-.823zM25.481 88.494l1.133.822-2.057 2.832-1.133-.823zM84.43 15.986l1.04.937-2.342 2.6-1.04-.936zM21.87 85.469l1.04.936-2.341 2.601-1.04-.937zM88.072 19.522l.937 1.04-2.6 2.343-.937-1.04zM18.593 82.088l.937 1.04-2.601 2.342-.937-1.04zM91.328 23.425l.823 1.133-2.832 2.057-.823-1.132zM15.684 78.385l.823 1.132-2.832 2.058-.822-1.133zM96.52 32.128l.57 1.279-3.198 1.423-.57-1.278zM11.109 70.161l.569 1.279-3.197 1.423-.57-1.279zM98.407 36.85l.433 1.332-3.33 1.081-.432-1.331zM9.483 65.74l.432 1.33-3.329 1.082-.432-1.331zM99.795 41.726l.291 1.37-3.423.727-.29-1.37zM8.34 61.17l.292 1.37-3.424.728-.29-1.37zM100.66 46.73l.146 1.393-3.48.366-.147-1.392zM7.674 56.506l.146 1.392-3.48.366-.147-1.392zM100.811 56.873l-.146 1.392-3.48-.365.145-1.393zM7.821 47.101l-.146 1.392-3.48-.365.145-1.393zM100.09 61.895l-.291 1.369-3.424-.728.291-1.369zM8.631 42.46l-.291 1.37-3.423-.728.29-1.37zM98.84 66.827l-.432 1.331-3.329-1.081.433-1.332zM9.918 37.93l-.433 1.331-3.329-1.082.433-1.331zM97.098 71.585l-.569 1.28-3.197-1.424.57-1.28zM11.677 33.558l-.57 1.28-3.197-1.424.57-1.279zM92.149 80.439l-.823 1.133-2.832-2.058.823-1.132zM16.506 25.482l-.823 1.133-2.831-2.057.823-1.133zM89.017 84.431l-.937 1.04-2.6-2.341.936-1.04zM19.528 21.869l-.936 1.04-2.601-2.342.936-1.04zM85.48 88.076l-1.041.936-2.342-2.6 1.04-.937zM22.91 18.59l-1.04.937-2.341-2.601 1.04-.937zM81.574 91.328l-1.133.823-2.057-2.831 1.132-.823zM26.617 15.684l-1.133.823-2.057-2.832 1.132-.823zM72.873 96.524l-1.279.57-1.423-3.198 1.278-.57zM34.838 11.105l-1.279.57-1.423-3.198 1.279-.57zM68.151 98.405l-1.331.432-1.082-3.329 1.332-.432zM39.259 9.485l-1.332.433-1.081-3.33 1.331-.432zM63.272 99.799l-1.369.29-.728-3.422 1.37-.291zM43.83 8.337l-1.369.291-.727-3.423 1.37-.291zM58.27 100.662l-1.393.146-.366-3.48 1.393-.147zM48.494 7.672l-1.392.147-.366-3.481 1.392-.147z\"/></g></g></svg>\n";
@@ -17,7 +17,7 @@ var sbb_clock_minutes_default = "<svg focusable=\"false\" xmlns=\"http://www.w3.
17
17
  var sbb_clock_seconds_default = "<svg focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 105 105\"><path d=\"M57.8,21.3c0-2.9-2.4-5.2-5.2-5.2s-5.3,2.3-5.3,5.2c0,2.7,2,4.8,4.5,5.2V69h1.5V26.5C55.8,26.2,57.8,24,57.8,21.3z\"/></svg>\n";
18
18
 
19
19
  // src/elements/clock/clock.scss?inline
20
- var clock_default = ":host {\n display: block;\n position: relative;\n aspect-ratio: 1/1;\n overflow: hidden;\n contain: content;\n}\n\n.sbb-clock__face,\n.sbb-clock__hand-hours,\n.sbb-clock__hand-minutes,\n.sbb-clock__hand-seconds {\n position: absolute;\n inset: 0;\n transform-origin: center center;\n transform: rotateZ(0deg);\n transform-style: preserve-3d;\n backface-visibility: hidden;\n}\n\n.sbb-clock__hand-hours,\n.sbb-clock__hand-minutes,\n.sbb-clock__face {\n fill: var(--sbb-clock-face-color);\n}\n\n.sbb-clock__hand-minutes {\n transition: transform var(--sbb-disable-animation-duration, 0.2s) cubic-bezier(0.4, 2.08, 0.55, 0.44);\n}\n@supports not (aspect-ratio: 1/1) {\n .sbb-clock__hand-minutes {\n transform-origin: 50% 49.625%;\n }\n}\n\n.sbb-clock__hand-hours {\n animation-name: rotate;\n animation-duration: 43200s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n}\n\n.sbb-clock__hand-hours--initial-hour {\n animation-name: hand-hours-animation-initial-hour;\n animation-duration: var(--sbb-clock-hours-animation-duration, 0s);\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n animation-iteration-count: 1;\n}\n\n.sbb-clock__hand-minutes--no-transition {\n transition: none;\n}\n\n.sbb-clock__hand-seconds {\n animation-name: hand-seconds-animation;\n animation-duration: 60s;\n animation-timing-function: linear;\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n animation-iteration-count: infinite;\n fill: var(--sbb-clock-seconds-hand-color);\n}\n\n.sbb-clock__hand-seconds--initial-minute {\n animation-name: hand-seconds-animation-initial-minute;\n animation-duration: var(--sbb-clock-seconds-animation-duration, 0s);\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n animation-iteration-count: 1;\n}\n\n:host(:not(:is(:state(initialized),[state--initialized]))) :is(.sbb-clock__hand-hours, .sbb-clock__hand-minutes, .sbb-clock__hand-seconds) {\n display: none;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotateZ(360deg);\n }\n}\n@keyframes hand-hours-animation-initial-hour {\n 0% {\n transform: rotateZ(var(--sbb-clock-hours-animation-start-angle, 0deg));\n }\n 100% {\n transform: rotateZ(360deg);\n }\n}\n@keyframes hand-seconds-animation {\n 0% {\n transform: rotateZ(0deg);\n }\n 97.5%, 100% {\n transform: rotateZ(360deg);\n }\n}\n@keyframes hand-seconds-animation-initial-minute {\n 0% {\n transform: rotateZ(var(--sbb-clock-seconds-animation-start-angle, 0deg));\n }\n 97.5%, 100% {\n transform: rotateZ(360deg);\n }\n}\n";
20
+ var clock_default = ":host {\n display: block;\n position: relative;\n aspect-ratio: 1/1;\n overflow: hidden;\n contain: content;\n}\n\n.sbb-clock__face,\n.sbb-clock__hand-hours,\n.sbb-clock__hand-minutes,\n.sbb-clock__hand-seconds {\n position: absolute;\n inset: 0;\n transform-origin: center center;\n transform: rotateZ(0deg);\n transform-style: preserve-3d;\n backface-visibility: hidden;\n}\n\n.sbb-clock__hand-hours,\n.sbb-clock__hand-minutes,\n.sbb-clock__face {\n fill: var(--sbb-clock-face-color);\n}\n\n.sbb-clock__hand-minutes {\n transform: var(--sbb-clock-minutes-transform, rotateZ(0deg));\n transition: transform var(--sbb-disable-animation-duration, 0.2s) cubic-bezier(0.4, 2.08, 0.55, 0.44);\n}\n@supports not (aspect-ratio: 1/1) {\n .sbb-clock__hand-minutes {\n transform-origin: 50% 49.625%;\n }\n}\n\n.sbb-clock__hand-hours {\n transform: var(--sbb-clock-hours-transform, rotateZ(0deg));\n animation-name: rotate;\n animation-duration: 43200s;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n}\n\n.sbb-clock__hand-hours--initial-hour {\n animation-name: hand-hours-animation-initial-hour;\n animation-duration: var(--sbb-clock-hours-animation-duration, 0s);\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n animation-iteration-count: 1;\n}\n\n.sbb-clock__hand-minutes--no-transition {\n transition: none;\n}\n\n.sbb-clock__hand-seconds {\n animation-name: var(--sbb-clock-seconds-animation-pause, hand-seconds-animation);\n animation-duration: 60s;\n animation-timing-function: linear;\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n animation-iteration-count: infinite;\n fill: var(--sbb-clock-seconds-hand-color);\n}\n\n.sbb-clock__hand-seconds--initial-minute {\n animation-name: hand-seconds-animation-initial-minute;\n animation-duration: var(--sbb-clock-seconds-animation-duration, 0s);\n animation-play-state: var(--sbb-clock-animation-play-state, \"paused\");\n animation-iteration-count: 1;\n}\n\n:host(:not(:is(:state(initialized),[state--initialized]))) :is(.sbb-clock__hand-hours, .sbb-clock__hand-minutes, .sbb-clock__hand-seconds) {\n display: none;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotateZ(360deg);\n }\n}\n@keyframes hand-hours-animation-initial-hour {\n 0% {\n transform: rotateZ(var(--sbb-clock-hours-animation-start-angle, 0deg));\n }\n 100% {\n transform: rotateZ(360deg);\n }\n}\n@keyframes hand-seconds-animation {\n 0% {\n transform: rotateZ(0deg);\n }\n 97.5%, 100% {\n transform: rotateZ(360deg);\n }\n}\n@keyframes hand-seconds-animation-initial-minute {\n 0% {\n transform: rotateZ(var(--sbb-clock-seconds-animation-start-angle, 0deg));\n }\n 97.5%, 100% {\n transform: rotateZ(360deg);\n }\n}\n";
21
21
 
22
22
  // src/elements/clock/clock.component.ts
23
23
  /** Number of hours on the clock face. */
@@ -60,6 +60,7 @@ let SbbClockElement = (() => {
60
60
  this.#now_accessor_storage = __runInitializers(this, _now_initializers, null);
61
61
  /** Whether the clock is ticking or not */
62
62
  this._state = (__runInitializers(this, _now_extraInitializers), "paused");
63
+ this._hostStyles = new SbbHostStylesController(this);
63
64
  /** Callback function for hours hand. */
64
65
  this._moveHoursHandFn = () => this._moveHoursHand();
65
66
  /** Callback function for minutes hand. */
@@ -144,7 +145,7 @@ let SbbClockElement = (() => {
144
145
  this._clockHandHours?.addEventListener("animationend", this._moveHoursHandFn, ADD_EVENT_LISTENER_OPTIONS);
145
146
  this._clockHandSeconds?.addEventListener("animationend", this._moveMinutesHandFn, ADD_EVENT_LISTENER_OPTIONS);
146
147
  this._setHandsStartingPosition();
147
- this.style?.setProperty("--sbb-clock-animation-play-state", "running");
148
+ this._hostStyles.set("--sbb-clock-animation-play-state", "running");
148
149
  this._state = "running";
149
150
  }
150
151
  /** Stops the clock by removing all the animations. */
@@ -155,7 +156,7 @@ let SbbClockElement = (() => {
155
156
  this._clockHandHours?.removeEventListener("animationend", this._moveHoursHandFn);
156
157
  this._clockHandSeconds?.removeEventListener("animationend", this._moveMinutesHandFn);
157
158
  this._clockHandMinutes?.classList.add("sbb-clock__hand-minutes--no-transition");
158
- this.style?.setProperty("--sbb-clock-animation-play-state", "paused");
159
+ this._hostStyles.set("--sbb-clock-animation-play-state", "paused");
159
160
  this._state = "paused";
160
161
  }
161
162
  /**
@@ -183,10 +184,7 @@ let SbbClockElement = (() => {
183
184
  hasRemainingMinutesOrSeconds = 1;
184
185
  }
185
186
  if (remainingHours > 0) hoursAnimationDuration += (remainingHours - hasRemainingMinutesOrSeconds) * SECONDS_IN_AN_HOUR;
186
- this.style?.setProperty("--sbb-clock-hours-animation-start-angle", `${Math.ceil(this._hours * HOURS_ANGLE + this._minutes / 2)}deg`);
187
- this.style?.setProperty("--sbb-clock-hours-animation-duration", `${hoursAnimationDuration}s`);
188
- this.style?.setProperty("--sbb-clock-seconds-animation-start-angle", `${Math.ceil(this._seconds * SBB_SECONDS_ANGLE)}deg`);
189
- this.style?.setProperty("--sbb-clock-seconds-animation-duration", `${remainingSeconds}s`);
187
+ this._hostStyles.set("--sbb-clock-hours-animation-start-angle", `${Math.ceil(this._hours * HOURS_ANGLE + this._minutes / 2)}deg`).set("--sbb-clock-hours-animation-duration", `${hoursAnimationDuration}s`).set("--sbb-clock-seconds-animation-start-angle", `${Math.ceil(this._seconds * SBB_SECONDS_ANGLE)}deg`).set("--sbb-clock-seconds-animation-duration", `${remainingSeconds}s`);
190
188
  this._setMinutesHand();
191
189
  this._clockHandSeconds?.classList.add("sbb-clock__hand-seconds--initial-minute");
192
190
  this._clockHandHours?.classList.add("sbb-clock__hand-hours--initial-hour");
@@ -206,14 +204,14 @@ let SbbClockElement = (() => {
206
204
  }
207
205
  /** Set the starting position for the minutes hand. */
208
206
  _setMinutesHand() {
209
- this._clockHandMinutes?.style.setProperty("transform", `rotateZ(${Math.ceil(this._minutes * MINUTES_ANGLE)}deg)`);
207
+ this._hostStyles.set("--sbb-clock-minutes-transform", `rotateZ(${Math.ceil(this._minutes * MINUTES_ANGLE)}deg)`);
210
208
  }
211
209
  /** Move the hours hand to the next value. */
212
210
  _moveHoursHand() {
213
211
  this._removeHoursAnimationStyles();
214
212
  let hoursAngle = Math.ceil(this._hours * HOURS_ANGLE + this._minutes / 2);
215
213
  if (hoursAngle >= FULL_ANGLE) hoursAngle -= FULL_ANGLE;
216
- this._clockHandHours?.style.setProperty("transform", `rotateZ(${hoursAngle}deg)`);
214
+ this._hostStyles.set("--sbb-clock-hours-transform", `rotateZ(${hoursAngle}deg)`);
217
215
  }
218
216
  /** Move the minutes hand to the next value. */
219
217
  _moveMinutesHand() {
@@ -233,9 +231,9 @@ let SbbClockElement = (() => {
233
231
  */
234
232
  _resetSecondsHandAnimation() {
235
233
  if (!this._clockHandSeconds) return;
236
- this._clockHandSeconds.style.animation = "";
234
+ this._hostStyles.set("--sbb-clock-seconds-animation-pause", "");
237
235
  this._clockHandSeconds.offsetHeight;
238
- this._clockHandSeconds.style.removeProperty("animation");
236
+ this._hostStyles.delete("--sbb-clock-seconds-animation-pause");
239
237
  }
240
238
  _removeEventListeners() {
241
239
  document?.removeEventListener("visibilitychange", this._handlePageVisibilityChange);
@@ -245,14 +243,14 @@ let SbbClockElement = (() => {
245
243
  }
246
244
  _removeHoursAnimationStyles() {
247
245
  this._clockHandHours?.classList.remove("sbb-clock__hand-hours--initial-hour");
248
- this.style.removeProperty("--sbb-clock-hours-animation-start-angle");
249
- this.style.removeProperty("--sbb-clock-hours-animation-duration");
246
+ this._hostStyles.delete("--sbb-clock-hours-animation-start-angle");
247
+ this._hostStyles.delete("--sbb-clock-hours-animation-duration");
250
248
  }
251
249
  _removeSecondsAnimationStyles() {
252
250
  this._clockHandSeconds?.classList.remove("sbb-clock__hand-seconds--initial-minute");
253
251
  this._clockHandMinutes?.classList.remove("sbb-clock__hand-minutes--no-transition");
254
- this.style.removeProperty("--sbb-clock-seconds-animation-start-angle");
255
- this.style.removeProperty("--sbb-clock-seconds-animation-duration");
252
+ this._hostStyles.delete("--sbb-clock-seconds-animation-start-angle");
253
+ this._hostStyles.delete("--sbb-clock-seconds-animation-duration");
256
254
  }
257
255
  render() {
258
256
  return html`
@@ -0,0 +1,14 @@
1
+ import { type ReactiveController, type ReactiveControllerHost } from 'lit';
2
+ /**
3
+ * This controller applies a constructed CSSStyleSheet and keeps the style map synchronized with it.
4
+ */
5
+ export declare class SbbHostStylesController extends Map<string, string> implements ReactiveController {
6
+ private _host;
7
+ private _styleSheet?;
8
+ constructor(_host: HTMLElement & ReactiveControllerHost);
9
+ hostConnected(): void;
10
+ set(key: string, value: string): this;
11
+ delete(key: string): boolean;
12
+ clear(): void;
13
+ private _updateHostStyles;
14
+ }
@@ -6,5 +6,6 @@ export declare class SbbDynamicStylesheetMixinType {
6
6
  /**
7
7
  * Mixin for encapsulating the dynamic stylesheet logic.
8
8
  * This is used in components that need to dynamically update their stylesheets.
9
+ * @deprecated will be removed with next major release, use `SbbHostStylesController` instead.
9
10
  */
10
11
  export declare const SbbDynamicStylesheetMixin: <T extends AbstractConstructor<LitElement>>(superClass: T) => AbstractConstructor<SbbDynamicStylesheetMixinType> & T;
@@ -14,13 +14,14 @@ export * from './core/base-elements/link-base-element.ts';
14
14
  export * from './core/base-elements/open-close-base-element.ts';
15
15
  export * from './core/base-elements/selection-group-base-element.ts';
16
16
  export * from './core/config/config.ts';
17
- export * from './core/controllers/property-watcher-controller.ts';
18
17
  export * from './core/controllers/escapable-overlay-controller.ts';
18
+ export * from './core/controllers/host-styles-controller.ts';
19
19
  export * from './core/controllers/id-reference-controller.ts';
20
20
  export * from './core/controllers/inert-controller.ts';
21
21
  export * from './core/controllers/language-controller.ts';
22
22
  export * from './core/controllers/media-matchers-controller.ts';
23
23
  export * from './core/controllers/overlay-position-controller.ts';
24
+ export * from './core/controllers/property-watcher-controller.ts';
24
25
  export * from './core/controllers/scroll-controller.ts';
25
26
  export * from './core/controllers/temporary-focus-controller.ts';
26
27
  export * from './core/datetime/date-adapter.ts';
@@ -3187,100 +3187,6 @@ let SbbSelectionGroupBaseElement = (() => {
3187
3187
  };
3188
3188
  })();
3189
3189
 
3190
- // src/elements/core/controllers/property-watcher-controller.ts
3191
- var PropertyWatcher = class {
3192
- get size() {
3193
- return this._handlers.size;
3194
- }
3195
- constructor(_host, _property) {
3196
- this._host = _host;
3197
- this._property = _property;
3198
- this._handlers = /* @__PURE__ */ new Set();
3199
- this._hostDefinedPromise = null;
3200
- if (!isServer) {
3201
- if (customElements.get(this._host.localName)) customElements.upgrade(this._host);
3202
- else this._hostDefinedPromise = customElements.whenDefined(this._host.localName).then(() => {
3203
- customElements.upgrade(this._host);
3204
- this._hostDefinedPromise = null;
3205
- });
3206
- }
3207
- this._value = this._host[this._property];
3208
- }
3209
- addHandler(handler) {
3210
- if (!this._handlers.size) {
3211
- if (this._host.addController) this._host.addController(this);
3212
- else if (this._hostDefinedPromise) this._hostDefinedPromise.then(() => this._host.addController(this));
3213
- }
3214
- this._handlers.add(handler);
3215
- if (!this._hostDefinedPromise) handler(this._host);
3216
- else this._hostDefinedPromise.then(() => handler(this._host));
3217
- }
3218
- removeHandler(handler) {
3219
- this._handlers.delete(handler);
3220
- if (!this._handlers.size) {
3221
- if (this._host.removeController) this._host.removeController(this);
3222
- else if (this._hostDefinedPromise) this._hostDefinedPromise.then(() => this._host.removeController(this));
3223
- }
3224
- }
3225
- hostUpdate() {
3226
- const currentValue = this._host[this._property];
3227
- if (this._value !== currentValue) {
3228
- this._value = currentValue;
3229
- for (const handler of this._handlers) handler(this._host);
3230
- }
3231
- }
3232
- };
3233
- const propertyWatchers = /* @__PURE__ */ new WeakMap();
3234
- var SbbPropertyWatcherController = class {
3235
- constructor(_host, _referenceResolver, _handlers) {
3236
- this._host = _host;
3237
- this._referenceResolver = _referenceResolver;
3238
- this._handlers = _handlers;
3239
- this._host.addController(this);
3240
- }
3241
- hostConnected() {
3242
- this.connect();
3243
- }
3244
- hostDisconnected() {
3245
- if (this._reference !== this._referenceResolver()) this.disconnect();
3246
- }
3247
- connect() {
3248
- const reference = this._referenceResolver();
3249
- if (this._reference === reference) return;
3250
- this.disconnect();
3251
- this._reference = reference;
3252
- if (!this._reference) return;
3253
- let watchers = propertyWatchers.get(this._reference);
3254
- if (!watchers) {
3255
- watchers = /* @__PURE__ */ new Map();
3256
- propertyWatchers.set(this._reference, watchers);
3257
- }
3258
- this._watchers = watchers;
3259
- for (const [property, handler] of Object.entries(this._handlers)) {
3260
- let watcher = this._watchers.get(property);
3261
- if (!watcher) {
3262
- watcher = new PropertyWatcher(this._reference, property);
3263
- this._watchers.set(property, watcher);
3264
- }
3265
- watcher.addHandler(handler);
3266
- }
3267
- }
3268
- disconnect() {
3269
- if (!this._reference) return;
3270
- for (const [property, handler] of Object.entries(this._handlers)) {
3271
- const watcher = this._watchers?.get(property);
3272
- if (watcher) {
3273
- watcher.removeHandler(handler);
3274
- if (!watcher.size) {
3275
- this._watchers.delete(property);
3276
- if (!this._watchers.size && this._reference) propertyWatchers.delete(this._reference);
3277
- }
3278
- }
3279
- }
3280
- this._reference = null;
3281
- }
3282
- };
3283
-
3284
3190
  // src/elements/core/controllers/escapable-overlay-controller.ts
3285
3191
  const overlayStack = new Array();
3286
3192
  if (!isServer) window.addEventListener("keydown", (event) => {
@@ -3313,6 +3219,44 @@ var SbbEscapableOverlayController = class {
3313
3219
  }
3314
3220
  };
3315
3221
 
3222
+ // src/elements/core/controllers/host-styles-controller.ts
3223
+ /**
3224
+ * This controller applies a constructed CSSStyleSheet and keeps the style map synchronized with it.
3225
+ */
3226
+ var SbbHostStylesController = class extends Map {
3227
+ constructor(_host) {
3228
+ super();
3229
+ this._host = _host;
3230
+ this._host.addController(this);
3231
+ }
3232
+ hostConnected() {
3233
+ if (!isServer && this._styleSheet && !this._host.shadowRoot?.adoptedStyleSheets.includes(this._styleSheet)) this._host.shadowRoot?.adoptedStyleSheets.push(this._styleSheet);
3234
+ }
3235
+ set(key, value) {
3236
+ super.set(key, value);
3237
+ this._updateHostStyles();
3238
+ return this;
3239
+ }
3240
+ delete(key) {
3241
+ const result = super.delete(key);
3242
+ this._updateHostStyles();
3243
+ return result;
3244
+ }
3245
+ clear() {
3246
+ super.clear();
3247
+ this._updateHostStyles();
3248
+ }
3249
+ _updateHostStyles() {
3250
+ if (isServer) return;
3251
+ else if (!this._styleSheet) {
3252
+ this._styleSheet = new CSSStyleSheet();
3253
+ this._host.shadowRoot?.adoptedStyleSheets.push(this._styleSheet);
3254
+ }
3255
+ const cssRule = this.size ? `:host { ${Array.from(this, ([property, value]) => `${property}: ${value};`).join("")} }` : "";
3256
+ this._styleSheet.replaceSync(cssRule);
3257
+ }
3258
+ };
3259
+
3316
3260
  // src/elements/core/controllers/id-reference-controller.ts
3317
3261
  const observers$1 = /* @__PURE__ */ new WeakMap();
3318
3262
  /**
@@ -3957,6 +3901,100 @@ var SbbOverlayPositionController = class {
3957
3901
  }
3958
3902
  };
3959
3903
 
3904
+ // src/elements/core/controllers/property-watcher-controller.ts
3905
+ var PropertyWatcher = class {
3906
+ get size() {
3907
+ return this._handlers.size;
3908
+ }
3909
+ constructor(_host, _property) {
3910
+ this._host = _host;
3911
+ this._property = _property;
3912
+ this._handlers = /* @__PURE__ */ new Set();
3913
+ this._hostDefinedPromise = null;
3914
+ if (!isServer) {
3915
+ if (customElements.get(this._host.localName)) customElements.upgrade(this._host);
3916
+ else this._hostDefinedPromise = customElements.whenDefined(this._host.localName).then(() => {
3917
+ customElements.upgrade(this._host);
3918
+ this._hostDefinedPromise = null;
3919
+ });
3920
+ }
3921
+ this._value = this._host[this._property];
3922
+ }
3923
+ addHandler(handler) {
3924
+ if (!this._handlers.size) {
3925
+ if (this._host.addController) this._host.addController(this);
3926
+ else if (this._hostDefinedPromise) this._hostDefinedPromise.then(() => this._host.addController(this));
3927
+ }
3928
+ this._handlers.add(handler);
3929
+ if (!this._hostDefinedPromise) handler(this._host);
3930
+ else this._hostDefinedPromise.then(() => handler(this._host));
3931
+ }
3932
+ removeHandler(handler) {
3933
+ this._handlers.delete(handler);
3934
+ if (!this._handlers.size) {
3935
+ if (this._host.removeController) this._host.removeController(this);
3936
+ else if (this._hostDefinedPromise) this._hostDefinedPromise.then(() => this._host.removeController(this));
3937
+ }
3938
+ }
3939
+ hostUpdate() {
3940
+ const currentValue = this._host[this._property];
3941
+ if (this._value !== currentValue) {
3942
+ this._value = currentValue;
3943
+ for (const handler of this._handlers) handler(this._host);
3944
+ }
3945
+ }
3946
+ };
3947
+ const propertyWatchers = /* @__PURE__ */ new WeakMap();
3948
+ var SbbPropertyWatcherController = class {
3949
+ constructor(_host, _referenceResolver, _handlers) {
3950
+ this._host = _host;
3951
+ this._referenceResolver = _referenceResolver;
3952
+ this._handlers = _handlers;
3953
+ this._host.addController(this);
3954
+ }
3955
+ hostConnected() {
3956
+ this.connect();
3957
+ }
3958
+ hostDisconnected() {
3959
+ if (this._reference !== this._referenceResolver()) this.disconnect();
3960
+ }
3961
+ connect() {
3962
+ const reference = this._referenceResolver();
3963
+ if (this._reference === reference) return;
3964
+ this.disconnect();
3965
+ this._reference = reference;
3966
+ if (!this._reference) return;
3967
+ let watchers = propertyWatchers.get(this._reference);
3968
+ if (!watchers) {
3969
+ watchers = /* @__PURE__ */ new Map();
3970
+ propertyWatchers.set(this._reference, watchers);
3971
+ }
3972
+ this._watchers = watchers;
3973
+ for (const [property, handler] of Object.entries(this._handlers)) {
3974
+ let watcher = this._watchers.get(property);
3975
+ if (!watcher) {
3976
+ watcher = new PropertyWatcher(this._reference, property);
3977
+ this._watchers.set(property, watcher);
3978
+ }
3979
+ watcher.addHandler(handler);
3980
+ }
3981
+ }
3982
+ disconnect() {
3983
+ if (!this._reference) return;
3984
+ for (const [property, handler] of Object.entries(this._handlers)) {
3985
+ const watcher = this._watchers?.get(property);
3986
+ if (watcher) {
3987
+ watcher.removeHandler(handler);
3988
+ if (!watcher.size) {
3989
+ this._watchers.delete(property);
3990
+ if (!this._watchers.size && this._reference) propertyWatchers.delete(this._reference);
3991
+ }
3992
+ }
3993
+ }
3994
+ this._reference = null;
3995
+ }
3996
+ };
3997
+
3960
3998
  // src/elements/core/controllers/scroll-controller.ts
3961
3999
  /**
3962
4000
  * Overlays currently holding a scroll lock, shared across all `SbbScrollController` instances.
@@ -4965,6 +5003,7 @@ const SbbAnimationCompleteMixin = (superClass) => {
4965
5003
  /**
4966
5004
  * Mixin for encapsulating the dynamic stylesheet logic.
4967
5005
  * This is used in components that need to dynamically update their stylesheets.
5006
+ * @deprecated will be removed with next major release, use `SbbHostStylesController` instead.
4968
5007
  */
4969
5008
  const SbbDynamicStylesheetMixin = (superClass) => {
4970
5009
  class SbbDynamicStylesheetElement extends superClass {
@@ -6517,4 +6556,4 @@ function removeAriaComboBoxAttributes(trigger) {
6517
6556
  trigger.removeAttribute("aria-expanded");
6518
6557
  }
6519
6558
 
6520
- export { DateAdapter, FORMAT_DATE, FRIDAY, ISO8601_FORMAT_DATE, IS_FOCUSABLE_QUERY, InteractivityChecker, IsFocusableConfig, MONDAY, NativeDateAdapter, NumberOrNull, SATURDAY, SEPARATORLESS_FORMAT_DATE, SUNDAY, SbbActionBaseElement, SbbAnimationCompleteMixin, SbbButtonBaseElement, SbbButtonLikeBaseElement, SbbDarkModeController, SbbDisabledInteractiveMixin, SbbDisabledMixin, SbbDisabledTabIndexActionMixin, SbbDynamicStylesheetMixin, SbbElement, SbbEscapableOverlayController, SbbFocusTrapController, SbbFocusVisibleWithinController, SbbFormAssociatedCheckboxMixin, SbbFormAssociatedInputMixin, SbbFormAssociatedMixin, SbbFormAssociatedRadioButtonMixin, SbbIdReferenceController, SbbInertController, SbbLanguageController, SbbLinkBaseElement, SbbLiveAnnouncer, SbbMediaMatcherController, SbbMediaQueryBreakpointLargeAndAbove, SbbMediaQueryBreakpointLargeAndBelow, SbbMediaQueryBreakpointSmallAndAbove, SbbMediaQueryBreakpointSmallAndBelow, SbbMediaQueryBreakpointUltraAndAbove, SbbMediaQueryBreakpointZeroAndAbove, SbbMediaQueryDarkMode, SbbMediaQueryForcedColors, SbbMediaQueryHover, SbbMediaQueryPointerCoarse, SbbNamedSlotListMixin, SbbNegativeMixin, SbbOpenCloseBaseElement, SbbOverlayOutsidePointerEventListener, SbbOverlayPositionController, SbbPanelMixin, SbbPropertyWatcherController, SbbReadonlyMixin, SbbRequiredMixin, SbbScrollController, SbbScrollHandler, SbbSelectionGroupBaseElement, SbbSelectionPanelMixin, SbbSlottedChangeEvent, SbbTemporaryFocusController, SbbUpdateSchedulerMixin, THURSDAY, TUESDAY, TemporalDateAdapter, WEDNESDAY, appendAriaElements, buttonResetStyles, containsPierceShadowDom, defaultDateAdapter, forceType, forwardEvent, getElementPosition, getElementPositionHorizontal, getElementRectangle, getEventTarget, getNextElementIndex, getOverride, handleDistinctChange, hostScrollbarStyles, i18nAdditionalWagonInformationHeading, i18nAnd, i18nArrival, i18nAutocompleteActionsHint, i18nBlockedPassage, i18nBreadcrumbEllipsisButtonLabel, i18nButton, i18nCalendarDateSelection, i18nCalendarDeselectAll, i18nCalendarDeselectWeek, i18nCalendarDeselectWeekday, i18nCalendarHeaderNavigationHint, i18nCalendarSelectAll, i18nCalendarSelectWeek, i18nCalendarSelectWeekday, i18nCalendarWeekNumber, i18nCarouselArrowsNavigationHint, i18nCarouselItemAriaLabel, i18nCheckboxRequired, i18nChipDelete, i18nChipGroupInputDescription, i18nClass, i18nClearInput, i18nCloseAlert, i18nCloseDialog, i18nCloseNavigation, i18nCloseNotification, i18nClosePopover, i18nCloseSidebar, i18nClosedCompartmentLabel, i18nCollapsed, i18nConnectionFrom, i18nConnectionRoundtrip, i18nConnectionTo, i18nCouchetteWagonLabel, i18nDateChangedTo, i18nDateInvalid, i18nDateMax, i18nDateMin, i18nDatePickerPlaceholder, i18nDeparture, i18nDialog, i18nDirection, i18nDownload, i18nDurationDay, i18nDurationHour, i18nDurationMinute, i18nExpanded, i18nFileSelectorButtonLabel, i18nFileSelectorButtonLabelMultiple, i18nFileSelectorCurrentlySelected, i18nFileSelectorDeleteFile, i18nFileSelectorSubtitleLabel, i18nFileSelectorSubtitleLabelMultiple, i18nFlipCard, i18nFromPlatform, i18nGoBack, i18nInputRequired, i18nItemsPerPage, i18nLocomotiveLabel, i18nLogo125Anniversary, i18nLogo125AnniversaryYears, i18nMapContainerButtonLabel, i18nMeansOfTransport, i18nMultipleSelectionPossible, i18nNew, i18nNextDay, i18nNextMonth, i18nNextPage, i18nNextSlide, i18nNextYear, i18nNextYearRange, i18nNonAccessible, i18nOccupancy, i18nPage, i18nPaginatorOf, i18nPaginatorSelected, i18nPreviousDay, i18nPreviousMonth, i18nPreviousPage, i18nPreviousSlide, i18nPreviousYear, i18nPreviousYearRange, i18nRealTimeInfo, i18nRemainingCharacters, i18nRestaurantWagonLabel, i18nReverseCard, i18nSector, i18nSectorShort, i18nSelectNextDay, i18nSelectPreviousDay, i18nSelectionRequired, i18nShowCalendar, i18nSleepingWagonLabel, i18nSlide, i18nSupersaver, i18nTargetOpensInNewWindow, i18nTimeInputChange, i18nTimeInvalid, i18nTimeMax, i18nTimeMaxLength, i18nTimetableFormSwapButtonLabel, i18nToday, i18nTrain, i18nTrains, i18nTransferProcedure, i18nTransferProcedures, i18nTravelhints, i18nTripDuration, i18nTripQuayChange, i18nWagonLabel, i18nWagonLabelNumber, i18nWagonsLabel, i18nWalkingDistanceArrival, i18nWalkingDistanceDeparture, i18nYearMonthSelection, idReference, interactivityChecker, isAndroid, isArrowKeyOrPageKeysPressed, isArrowKeyPressed, isBlink, isChromium, isEdge, isEventOnElement, isEventPrevented, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader, isFirefox, isIOS, isMacOS, isNextArrowKeyPressed, isNextjs, isPreviousArrowKeyPressed, isSafari, isTrident, isWebkit, isZeroAnimationDuration, listResetStyles, mergeConfig, omitEmptyConverter, pageScrollDisabled, plainDate, plainDateConverter, popoverResetStyles, preventScrollOnSpacebarPress, queueDomContentLoaded, radioButtonRegistry, readConfig, removeAriaComboBoxAttributes, removeAriaElements, removeAriaOverlayTriggerProperties, sbbInputModalityDetector, sbbLiveAnnouncer, sbbOverlayOutsidePointerEventListener, screenReaderOnlyStyles, scrollbarStyles, setAriaComboBoxAttributes, setAriaOverlayTriggerProperties, setOrRemoveAttribute, setOverlayPosition, ɵstateController };
6559
+ export { DateAdapter, FORMAT_DATE, FRIDAY, ISO8601_FORMAT_DATE, IS_FOCUSABLE_QUERY, InteractivityChecker, IsFocusableConfig, MONDAY, NativeDateAdapter, NumberOrNull, SATURDAY, SEPARATORLESS_FORMAT_DATE, SUNDAY, SbbActionBaseElement, SbbAnimationCompleteMixin, SbbButtonBaseElement, SbbButtonLikeBaseElement, SbbDarkModeController, SbbDisabledInteractiveMixin, SbbDisabledMixin, SbbDisabledTabIndexActionMixin, SbbDynamicStylesheetMixin, SbbElement, SbbEscapableOverlayController, SbbFocusTrapController, SbbFocusVisibleWithinController, SbbFormAssociatedCheckboxMixin, SbbFormAssociatedInputMixin, SbbFormAssociatedMixin, SbbFormAssociatedRadioButtonMixin, SbbHostStylesController, SbbIdReferenceController, SbbInertController, SbbLanguageController, SbbLinkBaseElement, SbbLiveAnnouncer, SbbMediaMatcherController, SbbMediaQueryBreakpointLargeAndAbove, SbbMediaQueryBreakpointLargeAndBelow, SbbMediaQueryBreakpointSmallAndAbove, SbbMediaQueryBreakpointSmallAndBelow, SbbMediaQueryBreakpointUltraAndAbove, SbbMediaQueryBreakpointZeroAndAbove, SbbMediaQueryDarkMode, SbbMediaQueryForcedColors, SbbMediaQueryHover, SbbMediaQueryPointerCoarse, SbbNamedSlotListMixin, SbbNegativeMixin, SbbOpenCloseBaseElement, SbbOverlayOutsidePointerEventListener, SbbOverlayPositionController, SbbPanelMixin, SbbPropertyWatcherController, SbbReadonlyMixin, SbbRequiredMixin, SbbScrollController, SbbScrollHandler, SbbSelectionGroupBaseElement, SbbSelectionPanelMixin, SbbSlottedChangeEvent, SbbTemporaryFocusController, SbbUpdateSchedulerMixin, THURSDAY, TUESDAY, TemporalDateAdapter, WEDNESDAY, appendAriaElements, buttonResetStyles, containsPierceShadowDom, defaultDateAdapter, forceType, forwardEvent, getElementPosition, getElementPositionHorizontal, getElementRectangle, getEventTarget, getNextElementIndex, getOverride, handleDistinctChange, hostScrollbarStyles, i18nAdditionalWagonInformationHeading, i18nAnd, i18nArrival, i18nAutocompleteActionsHint, i18nBlockedPassage, i18nBreadcrumbEllipsisButtonLabel, i18nButton, i18nCalendarDateSelection, i18nCalendarDeselectAll, i18nCalendarDeselectWeek, i18nCalendarDeselectWeekday, i18nCalendarHeaderNavigationHint, i18nCalendarSelectAll, i18nCalendarSelectWeek, i18nCalendarSelectWeekday, i18nCalendarWeekNumber, i18nCarouselArrowsNavigationHint, i18nCarouselItemAriaLabel, i18nCheckboxRequired, i18nChipDelete, i18nChipGroupInputDescription, i18nClass, i18nClearInput, i18nCloseAlert, i18nCloseDialog, i18nCloseNavigation, i18nCloseNotification, i18nClosePopover, i18nCloseSidebar, i18nClosedCompartmentLabel, i18nCollapsed, i18nConnectionFrom, i18nConnectionRoundtrip, i18nConnectionTo, i18nCouchetteWagonLabel, i18nDateChangedTo, i18nDateInvalid, i18nDateMax, i18nDateMin, i18nDatePickerPlaceholder, i18nDeparture, i18nDialog, i18nDirection, i18nDownload, i18nDurationDay, i18nDurationHour, i18nDurationMinute, i18nExpanded, i18nFileSelectorButtonLabel, i18nFileSelectorButtonLabelMultiple, i18nFileSelectorCurrentlySelected, i18nFileSelectorDeleteFile, i18nFileSelectorSubtitleLabel, i18nFileSelectorSubtitleLabelMultiple, i18nFlipCard, i18nFromPlatform, i18nGoBack, i18nInputRequired, i18nItemsPerPage, i18nLocomotiveLabel, i18nLogo125Anniversary, i18nLogo125AnniversaryYears, i18nMapContainerButtonLabel, i18nMeansOfTransport, i18nMultipleSelectionPossible, i18nNew, i18nNextDay, i18nNextMonth, i18nNextPage, i18nNextSlide, i18nNextYear, i18nNextYearRange, i18nNonAccessible, i18nOccupancy, i18nPage, i18nPaginatorOf, i18nPaginatorSelected, i18nPreviousDay, i18nPreviousMonth, i18nPreviousPage, i18nPreviousSlide, i18nPreviousYear, i18nPreviousYearRange, i18nRealTimeInfo, i18nRemainingCharacters, i18nRestaurantWagonLabel, i18nReverseCard, i18nSector, i18nSectorShort, i18nSelectNextDay, i18nSelectPreviousDay, i18nSelectionRequired, i18nShowCalendar, i18nSleepingWagonLabel, i18nSlide, i18nSupersaver, i18nTargetOpensInNewWindow, i18nTimeInputChange, i18nTimeInvalid, i18nTimeMax, i18nTimeMaxLength, i18nTimetableFormSwapButtonLabel, i18nToday, i18nTrain, i18nTrains, i18nTransferProcedure, i18nTransferProcedures, i18nTravelhints, i18nTripDuration, i18nTripQuayChange, i18nWagonLabel, i18nWagonLabelNumber, i18nWagonsLabel, i18nWalkingDistanceArrival, i18nWalkingDistanceDeparture, i18nYearMonthSelection, idReference, interactivityChecker, isAndroid, isArrowKeyOrPageKeysPressed, isArrowKeyPressed, isBlink, isChromium, isEdge, isEventOnElement, isEventPrevented, isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader, isFirefox, isIOS, isMacOS, isNextArrowKeyPressed, isNextjs, isPreviousArrowKeyPressed, isSafari, isTrident, isWebkit, isZeroAnimationDuration, listResetStyles, mergeConfig, omitEmptyConverter, pageScrollDisabled, plainDate, plainDateConverter, popoverResetStyles, preventScrollOnSpacebarPress, queueDomContentLoaded, radioButtonRegistry, readConfig, removeAriaComboBoxAttributes, removeAriaElements, removeAriaOverlayTriggerProperties, sbbInputModalityDetector, sbbLiveAnnouncer, sbbOverlayOutsidePointerEventListener, screenReaderOnlyStyles, scrollbarStyles, setAriaComboBoxAttributes, setAriaOverlayTriggerProperties, setOrRemoveAttribute, setOverlayPosition, ɵstateController };
@@ -31,6 +31,7 @@ export declare class SbbFlipCardElement extends SbbElement {
31
31
  /** Whether the card is flipped or not. */
32
32
  private accessor _flipped;
33
33
  private _language;
34
+ private _hostStyles;
34
35
  private _cardDetailsResizeObserver;
35
36
  private _previousImageAlignment?;
36
37
  constructor();
@@ -1,6 +1,6 @@
1
1
  import { MutationController } from "@lit-labs/observers/mutation-controller.js";
2
2
  import { html, isServer, nothing, unsafeCSS } from "lit";
3
- import { IS_FOCUSABLE_QUERY, SbbElement, SbbLanguageController, SbbPropertyWatcherController, buttonResetStyles, forceType, i18nFlipCard, i18nReverseCard, screenReaderOnlyStyles, ɵstateController } from "./core.js";
3
+ import { IS_FOCUSABLE_QUERY, SbbElement, SbbHostStylesController, SbbLanguageController, SbbPropertyWatcherController, buttonResetStyles, forceType, i18nFlipCard, i18nReverseCard, screenReaderOnlyStyles, ɵstateController } from "./core.js";
4
4
  import { __esDecorate, __runInitializers } from "tslib";
5
5
  import { property, state } from "lit/decorators.js";
6
6
  import { ResizeController } from "@lit-labs/observers/resize-controller.js";
@@ -246,6 +246,7 @@ let SbbFlipCardElement = (() => {
246
246
  this.#accessibilityLabel_accessor_storage = __runInitializers(this, _accessibilityLabel_initializers, "");
247
247
  this.#_flipped_accessor_storage = (__runInitializers(this, _accessibilityLabel_extraInitializers), __runInitializers(this, __flipped_initializers, false));
248
248
  this._language = (__runInitializers(this, __flipped_extraInitializers), new SbbLanguageController(this));
249
+ this._hostStyles = new SbbHostStylesController(this);
249
250
  this._cardDetailsResizeObserver = new ResizeController(this, {
250
251
  target: null,
251
252
  skipInitial: true,
@@ -280,7 +281,7 @@ let SbbFlipCardElement = (() => {
280
281
  }
281
282
  _setCardDetailsHeight() {
282
283
  const contentHeight = Math.floor(this._detailsContentElement.offsetHeight);
283
- this.style?.setProperty("--sbb-flip-card-details-height", `${contentHeight}px`);
284
+ this._hostStyles.set(`--sbb-flip-card-details-height`, `${contentHeight}px`);
284
285
  }
285
286
  async _accessibilityLabel() {
286
287
  if (isServer) return "";
@@ -28,6 +28,7 @@ export declare class SbbMenuElement extends SbbOpenCloseBaseElement {
28
28
  private _triggerAbortController;
29
29
  private _isPointerDownEventOnMenu;
30
30
  private _windowEventsController;
31
+ private _hostStyles;
31
32
  private _escapableOverlayController;
32
33
  private _focusTrapController;
33
34
  private _scrollHandler;
@@ -1,5 +1,5 @@
1
1
  import { html, isServer, unsafeCSS } from "lit";
2
- import { SbbButtonBaseElement, SbbDarkModeController, SbbDisabledInteractiveMixin, SbbDisabledMixin, SbbDisabledTabIndexActionMixin, SbbEscapableOverlayController, SbbFocusTrapController, SbbInertController, SbbLanguageController, SbbLinkBaseElement, SbbMediaMatcherController, SbbMediaQueryBreakpointSmallAndBelow, SbbOpenCloseBaseElement, SbbScrollController, forceType, forwardEvent, getElementPosition, getElementPositionHorizontal, getNextElementIndex, i18nGoBack, idReference, interactivityChecker, isArrowKeyOrPageKeysPressed, isEventOnElement, isZeroAnimationDuration, popoverResetStyles, removeAriaOverlayTriggerProperties, scrollbarStyles, setAriaOverlayTriggerProperties, ɵstateController } from "./core.js";
2
+ import { SbbButtonBaseElement, SbbDarkModeController, SbbDisabledInteractiveMixin, SbbDisabledMixin, SbbDisabledTabIndexActionMixin, SbbEscapableOverlayController, SbbFocusTrapController, SbbHostStylesController, SbbInertController, SbbLanguageController, SbbLinkBaseElement, SbbMediaMatcherController, SbbMediaQueryBreakpointSmallAndBelow, SbbOpenCloseBaseElement, SbbScrollController, forceType, forwardEvent, getElementPosition, getElementPositionHorizontal, getNextElementIndex, i18nGoBack, idReference, interactivityChecker, isArrowKeyOrPageKeysPressed, isEventOnElement, isZeroAnimationDuration, popoverResetStyles, removeAriaOverlayTriggerProperties, scrollbarStyles, setAriaOverlayTriggerProperties, ɵstateController } from "./core.js";
3
3
  import { SbbIconNameMixin } from "./icon.pure.js";
4
4
  import { __esDecorate, __runInitializers } from "tslib";
5
5
  import { property } from "lit/decorators.js";
@@ -192,6 +192,7 @@ let SbbMenuElement = (() => {
192
192
  this._menu = __runInitializers(this, _hideIconSpace_extraInitializers);
193
193
  this._triggerElement = null;
194
194
  this._isPointerDownEventOnMenu = false;
195
+ this._hostStyles = new SbbHostStylesController(this);
195
196
  this._escapableOverlayController = new SbbEscapableOverlayController(this);
196
197
  this._focusTrapController = new SbbFocusTrapController(this);
197
198
  this._scrollHandler = new SbbScrollController(this);
@@ -415,9 +416,7 @@ let SbbMenuElement = (() => {
415
416
  verticalOffset: NESTED_MENU_OFFSET,
416
417
  contentSelector: ".sbb-menu__content"
417
418
  });
418
- this.style.setProperty("--sbb-menu-position-x", `${menuPosition.left}px`);
419
- this.style.setProperty("--sbb-menu-position-y", `${menuPosition.top}px`);
420
- this.style.setProperty("--sbb-menu-max-height", menuPosition.maxHeight);
419
+ this._hostStyles.set("--sbb-menu-position-x", `${menuPosition.left}px`).set("--sbb-menu-position-y", `${menuPosition.top}px`).set("--sbb-menu-max-height", menuPosition.maxHeight);
421
420
  }
422
421
  _syncNegative() {
423
422
  this.querySelectorAll(":is(:state(sbb-link),[state--sbb-link]), :is(:state(sbb-button),[state--sbb-button])")?.forEach((el) => {
@@ -11,6 +11,7 @@ export declare class SbbMiniCalendarMonthElement<T = Date> extends SbbElement {
11
11
  /** Date as ISO string (YYYY-MM) */
12
12
  accessor date: string;
13
13
  private _dateAdapter;
14
+ private _hostStyles;
14
15
  private _monthNames;
15
16
  private _monthLabel;
16
17
  private _yearLabel;
@@ -1,7 +1,7 @@
1
1
  import { __esDecorate, __runInitializers } from "tslib";
2
2
  import { html, unsafeCSS } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
- import { SbbButtonBaseElement, SbbElement, SbbPropertyWatcherController, defaultDateAdapter, forceType, isArrowKeyOrPageKeysPressed, omitEmptyConverter, readConfig, ɵstateController } from "./core.js";
4
+ import { SbbButtonBaseElement, SbbElement, SbbHostStylesController, SbbPropertyWatcherController, defaultDateAdapter, forceType, isArrowKeyOrPageKeysPressed, omitEmptyConverter, readConfig, ɵstateController } from "./core.js";
5
5
  import { MutationController } from "@lit-labs/observers/mutation-controller.js";
6
6
 
7
7
  // src/elements/mini-calendar/mini-calendar-day/mini-calendar-day.scss?inline
@@ -188,6 +188,7 @@ let SbbMiniCalendarMonthElement = (() => {
188
188
  super();
189
189
  this.#date_accessor_storage = __runInitializers(this, _date_initializers, "");
190
190
  this._dateAdapter = (__runInitializers(this, _date_extraInitializers), readConfig().datetime?.dateAdapter ?? defaultDateAdapter);
191
+ this._hostStyles = new SbbHostStylesController(this);
191
192
  this._monthNames = this._dateAdapter.getMonthNames("short");
192
193
  this._monthLabel = null;
193
194
  this._yearLabel = null;
@@ -205,7 +206,7 @@ let SbbMiniCalendarMonthElement = (() => {
205
206
  const splitDate = this.date.split("-");
206
207
  const date = this._dateAdapter.createDate(+splitDate[0], +splitDate[1], 1);
207
208
  const offset = this._dateAdapter.getFirstWeekOffset(date);
208
- this.style?.setProperty("--sbb-mini-calendar-month-offset", `${offset + 1}`);
209
+ this._hostStyles.set("--sbb-mini-calendar-month-offset", `${offset + 1}`);
209
210
  this._monthLabel = `${this._monthNames[+splitDate[1] - 1]}.`;
210
211
  this._yearLabel = String(this._dateAdapter.getYear(date));
211
212
  }
@@ -17,6 +17,7 @@ export declare class SbbNavigationMarkerElement extends SbbNavigationMarkerEleme
17
17
  */
18
18
  accessor size: 's' | 'l';
19
19
  private _currentActiveAction?;
20
+ private _hostStyles;
20
21
  constructor();
21
22
  protected willUpdate(changedProperties: PropertyValues<WithListChildren<this>>): void;
22
23
  private _updateMarkerActions;
@@ -1,6 +1,6 @@
1
1
  import { html, isServer, nothing, unsafeCSS } from "lit";
2
2
  import { html as html$1 } from "lit/static-html.js";
3
- import { IS_FOCUSABLE_QUERY, SbbButtonBaseElement, SbbDisabledMixin, SbbElement, SbbEscapableOverlayController, SbbFocusTrapController, SbbInertController, SbbLanguageController, SbbLinkBaseElement, SbbMediaMatcherController, SbbMediaQueryBreakpointSmallAndBelow, SbbNamedSlotListMixin, SbbOpenCloseBaseElement, SbbPropertyWatcherController, SbbScrollController, SbbUpdateSchedulerMixin, forceType, i18nCloseNavigation, i18nGoBack, idReference, isEventOnElement, isZeroAnimationDuration, omitEmptyConverter, popoverResetStyles, removeAriaOverlayTriggerProperties, sbbInputModalityDetector, scrollbarStyles, setAriaOverlayTriggerProperties, ɵstateController } from "./core.js";
3
+ import { IS_FOCUSABLE_QUERY, SbbButtonBaseElement, SbbDisabledMixin, SbbElement, SbbEscapableOverlayController, SbbFocusTrapController, SbbHostStylesController, SbbInertController, SbbLanguageController, SbbLinkBaseElement, SbbMediaMatcherController, SbbMediaQueryBreakpointSmallAndBelow, SbbNamedSlotListMixin, SbbOpenCloseBaseElement, SbbPropertyWatcherController, SbbScrollController, SbbUpdateSchedulerMixin, forceType, i18nCloseNavigation, i18nGoBack, idReference, isEventOnElement, isZeroAnimationDuration, omitEmptyConverter, popoverResetStyles, removeAriaOverlayTriggerProperties, sbbInputModalityDetector, scrollbarStyles, setAriaOverlayTriggerProperties, ɵstateController } from "./core.js";
4
4
  import { SbbIconElement } from "./icon.pure.js";
5
5
  import { __esDecorate, __runInitializers } from "tslib";
6
6
  import { property, state } from "lit/decorators.js";
@@ -220,6 +220,7 @@ let SbbNavigationMarkerElement = (() => {
220
220
  this.listChildLocalNames = ["sbb-navigation-button", "sbb-navigation-link"];
221
221
  this.#size_accessor_storage = __runInitializers(this, _size_initializers, "l");
222
222
  this._currentActiveAction = __runInitializers(this, _size_extraInitializers);
223
+ this._hostStyles = new SbbHostStylesController(this);
223
224
  this.addController(new ResizeController(this, {
224
225
  skipInitial: true,
225
226
  callback: () => this._setMarkerPosition()
@@ -264,7 +265,7 @@ let SbbNavigationMarkerElement = (() => {
264
265
  if (!this._currentActiveAction) return;
265
266
  const index = this.listChildren.indexOf(this._currentActiveAction);
266
267
  const value = this.shadowRoot.querySelector(`li:nth-child(${index + 1})`)?.offsetTop;
267
- if (value != null) this.style?.setProperty("--sbb-navigation-marker-position-y", `${value}px`);
268
+ if (value != null) this._hostStyles.set("--sbb-navigation-marker-position-y", `${value}px`);
268
269
  }
269
270
  render() {
270
271
  return this.renderList();
@@ -35,6 +35,7 @@ export declare class SbbNotificationElement extends SbbNotificationElement_base
35
35
  private _notificationElement;
36
36
  private _resizeObserverTimeout;
37
37
  private _language;
38
+ private _hostStyles;
38
39
  private _notificationResizeObserver;
39
40
  constructor();
40
41
  private _open;
@@ -3,7 +3,7 @@ import { ResizeController } from "@lit-labs/observers/resize-controller.js";
3
3
  import { html, nothing, unsafeCSS } from "lit";
4
4
  import { property } from "lit/decorators.js";
5
5
  import { SbbSecondaryButtonElement } from "./button.pure.js";
6
- import { SbbElement, SbbLanguageController, SbbReadonlyMixin, i18nCloseNotification, isZeroAnimationDuration } from "./core.js";
6
+ import { SbbElement, SbbHostStylesController, SbbLanguageController, SbbReadonlyMixin, i18nCloseNotification, isZeroAnimationDuration } from "./core.js";
7
7
  import { SbbDividerElement } from "./divider.pure.js";
8
8
  import { SbbIconNameMixin } from "./icon.pure.js";
9
9
 
@@ -154,6 +154,7 @@ let SbbNotificationElement = (() => {
154
154
  this._stateInternal = __runInitializers(this, _animation_extraInitializers);
155
155
  this._resizeObserverTimeout = null;
156
156
  this._language = new SbbLanguageController(this);
157
+ this._hostStyles = new SbbHostStylesController(this);
157
158
  this._notificationResizeObserver = new ResizeController(this, {
158
159
  target: null,
159
160
  skipInitial: true,
@@ -193,7 +194,7 @@ let SbbNotificationElement = (() => {
193
194
  _setNotificationHeight() {
194
195
  if (!this._notificationElement?.scrollHeight) return;
195
196
  const notificationHeight = `${this._notificationElement.scrollHeight}px`;
196
- this.style.setProperty("--sbb-notification-height", notificationHeight);
197
+ this._hostStyles.set("--sbb-notification-height", notificationHeight);
197
198
  }
198
199
  _onNotificationResize() {
199
200
  if (this._state !== "opened") return;
@@ -22,6 +22,7 @@ export declare abstract class SbbPopoverBaseElement extends SbbOpenCloseBaseElem
22
22
  private _triggerElement?;
23
23
  private _triggerAbortController?;
24
24
  private _openStateController?;
25
+ private _hostStyles;
25
26
  private _resizeController;
26
27
  private _escapableOverlayController;
27
28
  private _focusTrapController;