@sbb-esta/lyne-elements-dev 5.1.0-dev.1782307952 → 5.1.0-dev.1782310821

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.
package/clock.pure.js CHANGED
@@ -3,7 +3,7 @@ import{__esDecorate as e,__runInitializers as t}from"tslib";import{html as n,isS
3
3
  `,u=`<svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 105 105"><path d="M55.1,64.5h-5.2l0.8-58h3.6L55.1,64.5z"/></svg>
4
4
  `,d=`<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>
5
5
  `,f=`:host{aspect-ratio:1;contain:content;display:block;position:relative;overflow:hidden}.sbb-clock__face,.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds{transform-origin:50%;transform-style:preserve-3d;backface-visibility:hidden;position:absolute;inset:0;transform:rotate(0)}.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__face{fill:var(--sbb-clock-face-color)}.sbb-clock__hand-minutes{transition:transform var(--sbb-disable-animation-duration,.2s) cubic-bezier(.4, 2.08, .55, .44)}@supports not (aspect-ratio:1/1){.sbb-clock__hand-minutes{transform-origin:50% 49.625%}}.sbb-clock__hand-hours{animation-name:rotate;animation-duration:43200s;animation-timing-function:linear;animation-iteration-count:infinite;animation-play-state:var(--sbb-clock-animation-play-state,"paused")}.sbb-clock__hand-hours--initial-hour{animation-name:hand-hours-animation-initial-hour;animation-duration:var(--sbb-clock-hours-animation-duration,0s);animation-play-state:var(--sbb-clock-animation-play-state,"paused");animation-iteration-count:1}.sbb-clock__hand-minutes--no-transition{transition:none}.sbb-clock__hand-seconds{animation-name:hand-seconds-animation;animation-duration:60s;animation-timing-function:linear;animation-play-state:var(--sbb-clock-animation-play-state,"paused");fill:var(--sbb-clock-seconds-hand-color);animation-iteration-count:infinite}.sbb-clock__hand-seconds--initial-minute{animation-name:hand-seconds-animation-initial-minute;animation-duration:var(--sbb-clock-seconds-animation-duration,0s);animation-play-state:var(--sbb-clock-animation-play-state,"paused");animation-iteration-count:1}:host(:not(:is(:state(initialized),[state--initialized]))) :is(.sbb-clock__hand-hours,.sbb-clock__hand-minutes,.sbb-clock__hand-seconds){display:none}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes hand-hours-animation-initial-hour{0%{transform:rotateZ(var(--sbb-clock-hours-animation-start-angle,0deg))}to{transform:rotate(360deg)}}@keyframes hand-seconds-animation{0%{transform:rotate(0)}97.5%,to{transform:rotate(360deg)}}@keyframes hand-seconds-animation-initial-minute{0%{transform:rotateZ(var(--sbb-clock-seconds-animation-start-angle,0deg))}97.5%,to{transform:rotate(360deg)}}
6
- `;const p={once:!0,passive:!0};let m=(()=>{let m=s,h,g=[],_=[];return class extends m{constructor(){super(...arguments),this.#e=t(this,g,null),this._state=(t(this,_),`paused`),this._moveHoursHandFn=()=>this._moveHoursHand(),this._moveMinutesHandFn=()=>this._moveMinutesHand(),this._handlePageVisibilityChange=async()=>{this.now||(document.visibilityState===`hidden`?await this._stopClock():await this._startClock())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;h=[a()],e(this,null,h,{kind:`accessor`,name:`now`,static:!1,private:!1,access:{has:e=>`now`in e,get:e=>e.now,set:(e,t)=>{e.now=t}},metadata:t},g,_),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-clock`}static{this.styles=[i(f)]}#e;get now(){return this.#e}set now(e){this.#e=e}connectedCallback(){super.connectedCallback(),this._resetIntervalId=setInterval(()=>this._resetClock(),1800*1e3)}willUpdate(e){super.willUpdate(e),!r&&e.has(`now`)&&this._startOrConfigureClock()}firstUpdated(e){super.firstUpdated(e),r||(document.addEventListener(`visibilitychange`,this._handlePageVisibilityChange,!1),this._startOrConfigureClock())}disconnectedCallback(){super.disconnectedCallback(),this._removeEventListeners(),clearInterval(this._resetIntervalId)}async _startOrConfigureClock(){this.now?(await this._stopClock(),this._resetSecondsHandAnimation(),this._setHandsStartingPosition()):await this._startClock()}async _startClock(){this._clockHandHours?.addEventListener(`animationend`,this._moveHoursHandFn,p),this._clockHandSeconds?.addEventListener(`animationend`,this._moveMinutesHandFn,p),await new Promise(e=>setTimeout(()=>{this._setHandsStartingPosition(),this.style?.setProperty(`--sbb-clock-animation-play-state`,`running`),this._state=`running`,e()},50))}async _stopClock(){clearInterval(this._handMovement),this._removeSecondsAnimationStyles(),this._removeHoursAnimationStyles(),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._clockHandMinutes?.classList.add(`sbb-clock__hand-minutes--no-transition`),this.style?.setProperty(`--sbb-clock-animation-play-state`,`paused`),this._state=`paused`}async _resetClock(){this._state===`running`&&(await this._stopClock(),await this._startClock())}_setHandsStartingPosition(){this._assignCurrentTime();let e=60-this._seconds,t=60-this._minutes,n=12-this._hours,r=0,i=0;e>0&&(r+=e,i=1),t>0&&(r+=(t-i)*60,i=1),n>0&&(r+=(n-i)*3600),this.style?.setProperty(`--sbb-clock-hours-animation-start-angle`,`${Math.ceil(this._hours*30+this._minutes/2)}deg`),this.style?.setProperty(`--sbb-clock-hours-animation-duration`,`${r}s`),this.style?.setProperty(`--sbb-clock-seconds-animation-start-angle`,`${Math.ceil(this._seconds*6.153846153846154)}deg`),this.style?.setProperty(`--sbb-clock-seconds-animation-duration`,`${e}s`),this._setMinutesHand(),this._clockHandSeconds?.classList.add(`sbb-clock__hand-seconds--initial-minute`),this._clockHandHours?.classList.add(`sbb-clock__hand-hours--initial-hour`),this.internals.states.add(`initialized`)}_assignCurrentTime(){let e=this.now?null:new Date,[t,n,r]=e?[e.getHours(),e.getMinutes(),e.getSeconds()]:this.now.split(`:`).map(e=>+e);this._hours=t%12,this._minutes=n,this._seconds=r}_setMinutesHand(){this._clockHandMinutes?.style.setProperty(`transform`,`rotateZ(${Math.ceil(this._minutes*6)}deg)`)}_moveHoursHand(){this._removeHoursAnimationStyles();let e=Math.ceil(this._hours*30+this._minutes/2);e>=360&&(e-=360),this._clockHandHours?.style.setProperty(`transform`,`rotateZ(${e}deg)`)}_moveMinutesHand(){this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._removeSecondsAnimationStyles(),this._addMinutesAndSetHands(),this._handMovement=setInterval(()=>this._addMinutesAndSetHands(),60*1e3)}_addMinutesAndSetHands(){this._minutes++,this._setMinutesHand()}_resetSecondsHandAnimation(){this._clockHandSeconds&&(this._clockHandSeconds.style.animation=``,this._clockHandSeconds.offsetHeight,this._clockHandSeconds.style.removeProperty(`animation`))}_removeEventListeners(){document?.removeEventListener(`visibilitychange`,this._handlePageVisibilityChange),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),clearInterval(this._handMovement)}_removeHoursAnimationStyles(){this._clockHandHours?.classList.remove(`sbb-clock__hand-hours--initial-hour`),this.style.removeProperty(`--sbb-clock-hours-animation-start-angle`),this.style.removeProperty(`--sbb-clock-hours-animation-duration`)}_removeSecondsAnimationStyles(){this._clockHandSeconds?.classList.remove(`sbb-clock__hand-seconds--initial-minute`),this._clockHandMinutes?.classList.remove(`sbb-clock__hand-minutes--no-transition`),this.style.removeProperty(`--sbb-clock-seconds-animation-start-angle`),this.style.removeProperty(`--sbb-clock-seconds-animation-duration`)}render(){return n`
6
+ `;const p={once:!0,passive:!0};let m=(()=>{let m=s,h,g=[],_=[];return class extends m{constructor(){super(...arguments),this.#e=t(this,g,null),this._state=(t(this,_),`paused`),this._moveHoursHandFn=()=>this._moveHoursHand(),this._moveMinutesHandFn=()=>this._moveMinutesHand(),this._handlePageVisibilityChange=()=>{this.now||(document.visibilityState===`hidden`?this._stopClock():this._startClock())}}static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;h=[a()],e(this,null,h,{kind:`accessor`,name:`now`,static:!1,private:!1,access:{has:e=>`now`in e,get:e=>e.now,set:(e,t)=>{e.now=t}},metadata:t},g,_),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-clock`}static{this.styles=[i(f)]}#e;get now(){return this.#e}set now(e){this.#e=e}connectedCallback(){super.connectedCallback(),this._resetIntervalId=setInterval(()=>this._resetClock(),1800*1e3)}willUpdate(e){super.willUpdate(e),!(r||!this.hasUpdated)&&e.has(`now`)&&this._startOrConfigureClock()}firstUpdated(e){super.firstUpdated(e),r||(document.addEventListener(`visibilitychange`,this._handlePageVisibilityChange,!1),this._startOrConfigureClock())}disconnectedCallback(){super.disconnectedCallback(),this._removeEventListeners(),clearInterval(this._resetIntervalId)}_startOrConfigureClock(){this.now?(this._stopClock(),this._resetSecondsHandAnimation(),this._setHandsStartingPosition()):this._startClock()}_startClock(){this._clockHandHours?.addEventListener(`animationend`,this._moveHoursHandFn,p),this._clockHandSeconds?.addEventListener(`animationend`,this._moveMinutesHandFn,p),this._setHandsStartingPosition(),this.style?.setProperty(`--sbb-clock-animation-play-state`,`running`),this._state=`running`}_stopClock(){clearInterval(this._handMovement),this._removeSecondsAnimationStyles(),this._removeHoursAnimationStyles(),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._clockHandMinutes?.classList.add(`sbb-clock__hand-minutes--no-transition`),this.style?.setProperty(`--sbb-clock-animation-play-state`,`paused`),this._state=`paused`}async _resetClock(){this._state===`running`&&(this._stopClock(),setTimeout(()=>this._startClock(),50))}_setHandsStartingPosition(){this._assignCurrentTime();let e=60-this._seconds,t=60-this._minutes,n=12-this._hours,r=0,i=0;e>0&&(r+=e,i=1),t>0&&(r+=(t-i)*60,i=1),n>0&&(r+=(n-i)*3600),this.style?.setProperty(`--sbb-clock-hours-animation-start-angle`,`${Math.ceil(this._hours*30+this._minutes/2)}deg`),this.style?.setProperty(`--sbb-clock-hours-animation-duration`,`${r}s`),this.style?.setProperty(`--sbb-clock-seconds-animation-start-angle`,`${Math.ceil(this._seconds*6.153846153846154)}deg`),this.style?.setProperty(`--sbb-clock-seconds-animation-duration`,`${e}s`),this._setMinutesHand(),this._clockHandSeconds?.classList.add(`sbb-clock__hand-seconds--initial-minute`),this._clockHandHours?.classList.add(`sbb-clock__hand-hours--initial-hour`),this.internals.states.add(`initialized`)}_assignCurrentTime(){let e=this.now?null:new Date,[t,n,r]=e?[e.getHours(),e.getMinutes(),e.getSeconds()]:this.now.split(`:`).map(e=>+e);this._hours=t%12,this._minutes=n,this._seconds=r}_setMinutesHand(){this._clockHandMinutes?.style.setProperty(`transform`,`rotateZ(${Math.ceil(this._minutes*6)}deg)`)}_moveHoursHand(){this._removeHoursAnimationStyles();let e=Math.ceil(this._hours*30+this._minutes/2);e>=360&&(e-=360),this._clockHandHours?.style.setProperty(`transform`,`rotateZ(${e}deg)`)}_moveMinutesHand(){this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),this._removeSecondsAnimationStyles(),this._addMinutesAndSetHands(),this._handMovement=setInterval(()=>this._addMinutesAndSetHands(),60*1e3)}_addMinutesAndSetHands(){this._minutes++,this._setMinutesHand()}_resetSecondsHandAnimation(){this._clockHandSeconds&&(this._clockHandSeconds.style.animation=``,this._clockHandSeconds.offsetHeight,this._clockHandSeconds.style.removeProperty(`animation`))}_removeEventListeners(){document?.removeEventListener(`visibilitychange`,this._handlePageVisibilityChange),this._clockHandHours?.removeEventListener(`animationend`,this._moveHoursHandFn),this._clockHandSeconds?.removeEventListener(`animationend`,this._moveMinutesHandFn),clearInterval(this._handMovement)}_removeHoursAnimationStyles(){this._clockHandHours?.classList.remove(`sbb-clock__hand-hours--initial-hour`),this.style.removeProperty(`--sbb-clock-hours-animation-start-angle`),this.style.removeProperty(`--sbb-clock-hours-animation-duration`)}_removeSecondsAnimationStyles(){this._clockHandSeconds?.classList.remove(`sbb-clock__hand-seconds--initial-minute`),this._clockHandMinutes?.classList.remove(`sbb-clock__hand-minutes--no-transition`),this.style.removeProperty(`--sbb-clock-seconds-animation-start-angle`),this.style.removeProperty(`--sbb-clock-seconds-animation-duration`)}render(){return n`
7
7
  <span class="sbb-clock__face" .innerHTML=${c}></span>
8
8
  <span
9
9
  class="sbb-clock__hand-hours"
@@ -88671,7 +88671,7 @@
88671
88671
  "privacy": "private",
88672
88672
  "return": {
88673
88673
  "type": {
88674
- "text": "Promise<void>"
88674
+ "text": "void"
88675
88675
  }
88676
88676
  }
88677
88677
  },
@@ -88681,7 +88681,7 @@
88681
88681
  "privacy": "private",
88682
88682
  "return": {
88683
88683
  "type": {
88684
- "text": "Promise<void>"
88684
+ "text": "void"
88685
88685
  }
88686
88686
  },
88687
88687
  "description": "Starts the clock by defining the hands starting position then starting the animations."
@@ -88692,7 +88692,7 @@
88692
88692
  "privacy": "private",
88693
88693
  "return": {
88694
88694
  "type": {
88695
- "text": "Promise<void>"
88695
+ "text": "void"
88696
88696
  }
88697
88697
  },
88698
88698
  "description": "Stops the clock by removing all the animations."
@@ -69,10 +69,10 @@ let SbbClockElement = (() => {
69
69
  this._moveHoursHandFn = () => this._moveHoursHand();
70
70
  /** Callback function for minutes hand. */
71
71
  this._moveMinutesHandFn = () => this._moveMinutesHand();
72
- this._handlePageVisibilityChange = async () => {
72
+ this._handlePageVisibilityChange = () => {
73
73
  if (this.now) return;
74
- if (document.visibilityState === "hidden") await this._stopClock();
75
- else await this._startClock();
74
+ if (document.visibilityState === "hidden") this._stopClock();
75
+ else this._startClock();
76
76
  };
77
77
  }
78
78
  static {
@@ -122,7 +122,8 @@ let SbbClockElement = (() => {
122
122
  }
123
123
  willUpdate(changedProperties) {
124
124
  super.willUpdate(changedProperties);
125
- if (!isServer && changedProperties.has("now")) this._startOrConfigureClock();
125
+ if (isServer || !this.hasUpdated) return;
126
+ if (changedProperties.has("now")) this._startOrConfigureClock();
126
127
  }
127
128
  firstUpdated(changedProperties) {
128
129
  super.firstUpdated(changedProperties);
@@ -136,26 +137,23 @@ let SbbClockElement = (() => {
136
137
  this._removeEventListeners();
137
138
  clearInterval(this._resetIntervalId);
138
139
  }
139
- async _startOrConfigureClock() {
140
+ _startOrConfigureClock() {
140
141
  if (this.now) {
141
- await this._stopClock();
142
+ this._stopClock();
142
143
  this._resetSecondsHandAnimation();
143
144
  this._setHandsStartingPosition();
144
- } else await this._startClock();
145
+ } else this._startClock();
145
146
  }
146
147
  /** Starts the clock by defining the hands starting position then starting the animations. */
147
- async _startClock() {
148
+ _startClock() {
148
149
  this._clockHandHours?.addEventListener("animationend", this._moveHoursHandFn, ADD_EVENT_LISTENER_OPTIONS);
149
150
  this._clockHandSeconds?.addEventListener("animationend", this._moveMinutesHandFn, ADD_EVENT_LISTENER_OPTIONS);
150
- await new Promise((resolve) => setTimeout(() => {
151
- this._setHandsStartingPosition();
152
- this.style?.setProperty("--sbb-clock-animation-play-state", "running");
153
- this._state = "running";
154
- resolve();
155
- }, INITIAL_TIMEOUT_DURATION));
151
+ this._setHandsStartingPosition();
152
+ this.style?.setProperty("--sbb-clock-animation-play-state", "running");
153
+ this._state = "running";
156
154
  }
157
155
  /** Stops the clock by removing all the animations. */
158
- async _stopClock() {
156
+ _stopClock() {
159
157
  clearInterval(this._handMovement);
160
158
  this._removeSecondsAnimationStyles();
161
159
  this._removeHoursAnimationStyles();
@@ -170,8 +168,8 @@ let SbbClockElement = (() => {
170
168
  */
171
169
  async _resetClock() {
172
170
  if (this._state !== "running") return;
173
- await this._stopClock();
174
- await this._startClock();
171
+ this._stopClock();
172
+ setTimeout(() => this._startClock(), INITIAL_TIMEOUT_DURATION);
175
173
  }
176
174
  /** Set the starting position for the three hands on the clock face. */
177
175
  _setHandsStartingPosition() {
@@ -5,7 +5,7 @@ import { html } from "lit/static-html.js";
5
5
  import { SbbLinkBaseElement, screenReaderOnlyStyles } from "./core.js";
6
6
 
7
7
  //#region src/elements/teaser/teaser.scss?inline
8
- var teaser_default = "@charset \"UTF-8\";\n:host {\n --_sbb-teaser-forced-colors-inset: calc(-1 * var(--sbb-focus-outline-offset));\n --_sbb-teaser-forced-colors-outline-offset: calc(2 * var(--sbb-focus-outline-offset));\n --_sbb-teaser-forced-colors-border-radius: calc(\n var(--sbb-teaser-border-radius) + var(--sbb-focus-outline-offset)\n );\n display: inline-block;\n outline: none !important;\n}\n@media (forced-colors: active) {\n :host {\n --sbb-teaser-description-color: LinkText;\n --sbb-title-color: LinkText !important;\n }\n}\n\n:host([alignment=after]) {\n --sbb-teaser-align-items: start;\n}\n\n:host([alignment=below]) {\n --sbb-teaser-flex-direction: column;\n --sbb-teaser-align-items: baseline;\n --sbb-teaser-gap: var(--sbb-spacing-fixed-3x);\n}\n\n@media (any-hover: hover) {\n :host(:hover) {\n --sbb-teaser-scale: var(--sbb-teaser-scale-hover);\n }\n}\n.sbb-teaser__wrapper {\n display: flex;\n position: relative;\n cursor: var(--sbb-cursor-pointer);\n}\n.sbb-teaser__wrapper::before {\n content: \"​\";\n user-select: none;\n width: 0;\n height: 0;\n}\n\n.sbb-teaser {\n text-decoration: none;\n position: absolute;\n inset: 0;\n}\n.sbb-teaser:focus-visible {\n outline-offset: var(--sbb-focus-outline-offset);\n outline: var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);\n border-radius: var(--sbb-teaser-border-radius);\n}\n@media (forced-colors: active) {\n .sbb-teaser:focus-visible {\n outline-offset: var(--_sbb-teaser-forced-colors-outline-offset);\n }\n}\n@media (forced-colors: active) {\n .sbb-teaser::before {\n content: \"\";\n position: absolute;\n inset: var(--_sbb-teaser-forced-colors-inset);\n pointer-events: none;\n border-radius: var(--_sbb-teaser-forced-colors-border-radius);\n border: var(--sbb-border-width-1x) solid CanvasText;\n }\n}\n\n.sbb-teaser__container {\n display: flex;\n flex-flow: var(--sbb-teaser-flex-direction) nowrap;\n align-items: var(--sbb-teaser-align-items);\n gap: var(--sbb-teaser-gap);\n max-width: 100%;\n width: 100%;\n pointer-events: none;\n}\n\n.sbb-teaser__text {\n color: var(--sbb-teaser-description-color);\n font-size: var(--sbb-teaser-font-size);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n overflow: hidden;\n max-width: 100%;\n}\n\n::slotted([slot=image]) {\n display: block;\n width: var(--sbb-teaser-image-width);\n}\n\n.sbb-teaser__image-wrapper {\n flex-shrink: 0;\n overflow: hidden;\n border-radius: var(--sbb-teaser-border-radius);\n transition: box-shadow var(--sbb-teaser-image-animation-duration) var(--sbb-animation-easing);\n}\n:host(:not(:is(:state(slotted-image),[state--slotted-image]))) .sbb-teaser__image-wrapper {\n display: none;\n}\n@media (any-hover: hover) {\n :host(:hover) .sbb-teaser__image-wrapper {\n box-shadow: var(--sbb-box-shadow-level-9-hard);\n }\n}\n\n.sbb-teaser__description {\n display: inline-block;\n margin: 0;\n padding: 0;\n}\n\n::slotted(sbb-chip-label) {\n display: flex;\n width: fit-content;\n max-width: 100%;\n margin-block-end: var(--sbb-spacing-fixed-1x);\n}\n\n::slotted(sbb-title) {\n margin-block: 0;\n}\n";
8
+ var teaser_default = "@charset \"UTF-8\";\n:host {\n --_sbb-teaser-forced-colors-inset: calc(-1 * var(--sbb-focus-outline-offset));\n --_sbb-teaser-forced-colors-outline-offset: calc(2 * var(--sbb-focus-outline-offset));\n --_sbb-teaser-forced-colors-border-radius: calc(\n var(--sbb-teaser-border-radius) + var(--sbb-focus-outline-offset)\n );\n display: inline-block;\n outline: none !important;\n}\n@media (forced-colors: active) {\n :host {\n --sbb-teaser-description-color: LinkText;\n --sbb-title-color: LinkText !important;\n }\n}\n\n:host([alignment=after]) {\n --sbb-teaser-align-items: start;\n}\n\n:host([alignment=below]) {\n --sbb-teaser-flex-direction: column;\n --sbb-teaser-align-items: baseline;\n --sbb-teaser-gap: var(--sbb-spacing-fixed-3x);\n}\n\n@media (any-hover: hover) {\n :host(:hover) {\n --sbb-teaser-scale: var(--sbb-teaser-scale-hover);\n }\n}\n.sbb-teaser__wrapper {\n display: flex;\n position: relative;\n cursor: var(--sbb-cursor-pointer);\n}\n.sbb-teaser__wrapper::before {\n content: \"​\";\n user-select: none;\n width: 0;\n height: 0;\n}\n\n.sbb-teaser {\n text-decoration: none;\n position: absolute;\n inset: 0;\n}\n.sbb-teaser:focus-visible {\n outline-offset: var(--sbb-focus-outline-offset);\n outline: var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);\n border-radius: var(--sbb-teaser-border-radius);\n}\n@media (forced-colors: active) {\n .sbb-teaser:focus-visible {\n outline-offset: var(--_sbb-teaser-forced-colors-outline-offset);\n }\n}\n@media (forced-colors: active) {\n .sbb-teaser::before {\n content: \"\";\n position: absolute;\n inset: var(--_sbb-teaser-forced-colors-inset);\n pointer-events: none;\n border-radius: var(--_sbb-teaser-forced-colors-border-radius);\n border: var(--sbb-border-width-1x) solid CanvasText;\n }\n}\n\n.sbb-teaser__container {\n display: flex;\n flex-flow: var(--sbb-teaser-flex-direction) nowrap;\n align-items: var(--sbb-teaser-align-items);\n gap: var(--sbb-teaser-gap);\n max-width: 100%;\n width: 100%;\n pointer-events: none;\n}\n\n.sbb-teaser__text {\n color: var(--sbb-teaser-description-color);\n font-size: var(--sbb-teaser-font-size);\n letter-spacing: var(--sbb-typo-letter-spacing-text);\n overflow: hidden;\n max-width: 100%;\n}\n\n::slotted([slot=image]) {\n display: block;\n width: var(--sbb-teaser-image-width);\n}\n\n.sbb-teaser__image-wrapper {\n flex-shrink: 0;\n overflow: hidden;\n border-radius: var(--sbb-teaser-border-radius);\n transition: box-shadow var(--sbb-teaser-image-animation-duration) var(--sbb-animation-easing);\n max-width: 100%;\n}\n:host(:not(:is(:state(slotted-image),[state--slotted-image]))) .sbb-teaser__image-wrapper {\n display: none;\n}\n@media (any-hover: hover) {\n :host(:hover) .sbb-teaser__image-wrapper {\n box-shadow: var(--sbb-box-shadow-level-9-hard);\n }\n}\n\n.sbb-teaser__description {\n display: inline-block;\n margin: 0;\n padding: 0;\n}\n\n::slotted(sbb-chip-label) {\n display: flex;\n width: fit-content;\n max-width: 100%;\n margin-block-end: var(--sbb-spacing-fixed-1x);\n}\n\n::slotted(sbb-title) {\n margin-block: 0;\n}\n";
9
9
 
10
10
  //#endregion
11
11
  //#region src/elements/teaser/teaser.component.ts
@@ -2797,6 +2797,9 @@ sbb-tab-nav-bar .sbb-tab-amount {
2797
2797
  filter: brightness(var(--sbb-teaser-image-brightness, 1));
2798
2798
  transition: filter, scale var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
2799
2799
  }
2800
+ :is(sbb-teaser, sbb-teaser-hero, sbb-teaser-product) .sbb-figure {
2801
+ max-width: 100%;
2802
+ }
2800
2803
 
2801
2804
  sbb-teaser :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2802
2805
  --sbb-image-object-fit: cover;
@@ -2797,6 +2797,9 @@ sbb-tab-nav-bar .sbb-tab-amount {
2797
2797
  filter: brightness(var(--sbb-teaser-image-brightness, 1));
2798
2798
  transition: filter, scale var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
2799
2799
  }
2800
+ :is(sbb-teaser, sbb-teaser-hero, sbb-teaser-product) .sbb-figure {
2801
+ max-width: 100%;
2802
+ }
2800
2803
 
2801
2804
  sbb-teaser :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2802
2805
  --sbb-image-object-fit: cover;
package/lean-theme.css CHANGED
@@ -2797,6 +2797,9 @@ sbb-tab-nav-bar .sbb-tab-amount {
2797
2797
  filter: brightness(var(--sbb-teaser-image-brightness, 1));
2798
2798
  transition: filter, scale var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
2799
2799
  }
2800
+ :is(sbb-teaser, sbb-teaser-hero, sbb-teaser-product) .sbb-figure {
2801
+ max-width: 100%;
2802
+ }
2800
2803
 
2801
2804
  sbb-teaser :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2802
2805
  --sbb-image-object-fit: cover;
@@ -2797,6 +2797,9 @@ sbb-tab-nav-bar .sbb-tab-amount {
2797
2797
  filter: brightness(var(--sbb-teaser-image-brightness, 1));
2798
2798
  transition: filter, scale var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
2799
2799
  }
2800
+ :is(sbb-teaser, sbb-teaser-hero, sbb-teaser-product) .sbb-figure {
2801
+ max-width: 100%;
2802
+ }
2800
2803
 
2801
2804
  sbb-teaser :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2802
2805
  --sbb-image-object-fit: cover;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements-dev",
3
- "version": "5.1.0-dev.1782307952",
3
+ "version": "5.1.0-dev.1782310821",
4
4
  "description": "Lyne Design System",
5
5
  "keywords": [
6
6
  "design system",
7
7
  "web components",
8
8
  "lit",
9
- "https://github.com/sbb-design-systems/lyne-components/commit/e05787f487cd8c128a4483f3d9f6d77726d6f873"
9
+ "https://github.com/sbb-design-systems/lyne-components/commit/df89eb5f2b1da996b9817ca1292e7c25186ce2b0"
10
10
  ],
11
11
  "type": "module",
12
12
  "exports": {
package/safety-theme.css CHANGED
@@ -2797,6 +2797,9 @@ sbb-tab-nav-bar .sbb-tab-amount {
2797
2797
  filter: brightness(var(--sbb-teaser-image-brightness, 1));
2798
2798
  transition: filter, scale var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
2799
2799
  }
2800
+ :is(sbb-teaser, sbb-teaser-hero, sbb-teaser-product) .sbb-figure {
2801
+ max-width: 100%;
2802
+ }
2800
2803
 
2801
2804
  sbb-teaser :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2802
2805
  --sbb-image-object-fit: cover;
@@ -2797,6 +2797,9 @@ sbb-tab-nav-bar .sbb-tab-amount {
2797
2797
  filter: brightness(var(--sbb-teaser-image-brightness, 1));
2798
2798
  transition: filter, scale var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
2799
2799
  }
2800
+ :is(sbb-teaser, sbb-teaser-hero, sbb-teaser-product) .sbb-figure {
2801
+ max-width: 100%;
2802
+ }
2800
2803
 
2801
2804
  sbb-teaser :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2802
2805
  --sbb-image-object-fit: cover;
@@ -39,6 +39,10 @@ $theme: 'standard' !default;
39
39
  filter,
40
40
  scale var(--sbb-teaser-image-animation-duration) var(--sbb-teaser-image-animation-easing);
41
41
  }
42
+
43
+ .sbb-figure {
44
+ max-width: 100%;
45
+ }
42
46
  }
43
47
 
44
48
  sbb-teaser :is(sbb-image, img):not(.sbb-figure-overlap-image) {
package/teaser.pure.js CHANGED
@@ -1,4 +1,4 @@
1
- import{__esDecorate as e,__runInitializers as t}from"tslib";import{unsafeCSS as n}from"lit";import{property as r}from"lit/decorators.js";import{html as i}from"lit/static-html.js";import{SbbLinkBaseElement as a,screenReaderOnlyStyles as o}from"./core.js";var s=`:host{--_sbb-teaser-forced-colors-inset:calc(-1 * var(--sbb-focus-outline-offset));--_sbb-teaser-forced-colors-outline-offset:calc(2 * var(--sbb-focus-outline-offset));--_sbb-teaser-forced-colors-border-radius:calc(var(--sbb-teaser-border-radius) + var(--sbb-focus-outline-offset));display:inline-block;outline:none!important}@media (forced-colors:active){:host{--sbb-teaser-description-color:LinkText;--sbb-title-color:LinkText!important}}:host([alignment=after]){--sbb-teaser-align-items:start}:host([alignment=below]){--sbb-teaser-flex-direction:column;--sbb-teaser-align-items:baseline;--sbb-teaser-gap:var(--sbb-spacing-fixed-3x)}@media (any-hover:hover){:host(:hover){--sbb-teaser-scale:var(--sbb-teaser-scale-hover)}}.sbb-teaser__wrapper{cursor:var(--sbb-cursor-pointer);display:flex;position:relative}.sbb-teaser__wrapper:before{content:"​";user-select:none;width:0;height:0}.sbb-teaser{text-decoration:none;position:absolute;inset:0}.sbb-teaser:focus-visible{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-teaser-border-radius)}@media (forced-colors:active){.sbb-teaser:focus-visible{outline-offset:var(--_sbb-teaser-forced-colors-outline-offset)}.sbb-teaser:before{content:"";inset:var(--_sbb-teaser-forced-colors-inset);pointer-events:none;border-radius:var(--_sbb-teaser-forced-colors-border-radius);border:var(--sbb-border-width-1x) solid CanvasText;position:absolute}}.sbb-teaser__container{flex-flow:var(--sbb-teaser-flex-direction) nowrap;align-items:var(--sbb-teaser-align-items);gap:var(--sbb-teaser-gap);pointer-events:none;width:100%;max-width:100%;display:flex}.sbb-teaser__text{color:var(--sbb-teaser-description-color);font-size:var(--sbb-teaser-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);max-width:100%;overflow:hidden}::slotted([slot=image]){width:var(--sbb-teaser-image-width);display:block}.sbb-teaser__image-wrapper{border-radius:var(--sbb-teaser-border-radius);transition:box-shadow var(--sbb-teaser-image-animation-duration) var(--sbb-animation-easing);flex-shrink:0;overflow:hidden}:host(:not(:is(:state(slotted-image),[state--slotted-image]))) .sbb-teaser__image-wrapper{display:none}@media (any-hover:hover){:host(:hover) .sbb-teaser__image-wrapper{box-shadow:var(--sbb-box-shadow-level-9-hard)}}.sbb-teaser__description{margin:0;padding:0;display:inline-block}::slotted(sbb-chip-label){width:fit-content;max-width:100%;margin-block-end:var(--sbb-spacing-fixed-1x);display:flex}::slotted(sbb-title){margin-block:0}
1
+ import{__esDecorate as e,__runInitializers as t}from"tslib";import{unsafeCSS as n}from"lit";import{property as r}from"lit/decorators.js";import{html as i}from"lit/static-html.js";import{SbbLinkBaseElement as a,screenReaderOnlyStyles as o}from"./core.js";var s=`:host{--_sbb-teaser-forced-colors-inset:calc(-1 * var(--sbb-focus-outline-offset));--_sbb-teaser-forced-colors-outline-offset:calc(2 * var(--sbb-focus-outline-offset));--_sbb-teaser-forced-colors-border-radius:calc(var(--sbb-teaser-border-radius) + var(--sbb-focus-outline-offset));display:inline-block;outline:none!important}@media (forced-colors:active){:host{--sbb-teaser-description-color:LinkText;--sbb-title-color:LinkText!important}}:host([alignment=after]){--sbb-teaser-align-items:start}:host([alignment=below]){--sbb-teaser-flex-direction:column;--sbb-teaser-align-items:baseline;--sbb-teaser-gap:var(--sbb-spacing-fixed-3x)}@media (any-hover:hover){:host(:hover){--sbb-teaser-scale:var(--sbb-teaser-scale-hover)}}.sbb-teaser__wrapper{cursor:var(--sbb-cursor-pointer);display:flex;position:relative}.sbb-teaser__wrapper:before{content:"​";user-select:none;width:0;height:0}.sbb-teaser{text-decoration:none;position:absolute;inset:0}.sbb-teaser:focus-visible{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-teaser-border-radius)}@media (forced-colors:active){.sbb-teaser:focus-visible{outline-offset:var(--_sbb-teaser-forced-colors-outline-offset)}.sbb-teaser:before{content:"";inset:var(--_sbb-teaser-forced-colors-inset);pointer-events:none;border-radius:var(--_sbb-teaser-forced-colors-border-radius);border:var(--sbb-border-width-1x) solid CanvasText;position:absolute}}.sbb-teaser__container{flex-flow:var(--sbb-teaser-flex-direction) nowrap;align-items:var(--sbb-teaser-align-items);gap:var(--sbb-teaser-gap);pointer-events:none;width:100%;max-width:100%;display:flex}.sbb-teaser__text{color:var(--sbb-teaser-description-color);font-size:var(--sbb-teaser-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);max-width:100%;overflow:hidden}::slotted([slot=image]){width:var(--sbb-teaser-image-width);display:block}.sbb-teaser__image-wrapper{border-radius:var(--sbb-teaser-border-radius);transition:box-shadow var(--sbb-teaser-image-animation-duration) var(--sbb-animation-easing);flex-shrink:0;max-width:100%;overflow:hidden}:host(:not(:is(:state(slotted-image),[state--slotted-image]))) .sbb-teaser__image-wrapper{display:none}@media (any-hover:hover){:host(:hover) .sbb-teaser__image-wrapper{box-shadow:var(--sbb-box-shadow-level-9-hard)}}.sbb-teaser__description{margin:0;padding:0;display:inline-block}::slotted(sbb-chip-label){width:fit-content;max-width:100%;margin-block-end:var(--sbb-spacing-fixed-1x);display:flex}::slotted(sbb-title){margin-block:0}
2
2
  `;let c=(()=>{let c=a,l,u=[],d=[];return class extends c{static{let t=typeof Symbol==`function`&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;l=[r({reflect:!0})],e(this,null,l,{kind:`accessor`,name:`alignment`,static:!1,private:!1,access:{has:e=>`alignment`in e,get:e=>e.alignment,set:(e,t)=>{e.alignment=t}},metadata:t},u,d),t&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:t})}static{this.elementName=`sbb-teaser`}static{this.styles=[o,n(s)]}#e=t(this,u,`after-centered`);get alignment(){return this.#e}set alignment(e){this.#e=e}_handleSlotchange(){let e=Array.from(this.children).find(e=>e.localName===`sbb-chip-label`);e&&(e.slot=`chip`);let t=Array.from(this.children).find(e=>e.localName===`sbb-title`);t&&(t.slot=`title`)}_configureChip(e){let t=e.target.assignedElements().find(e=>e.localName===`sbb-chip-label`);t&&(customElements.upgrade(t),t.color=`charcoal`,t.size=`xxs`)}_configureTitle(e){let t=e.target.assignedElements().find(e=>e.localName===`sbb-title`);t&&(customElements.upgrade(t),t.visualLevel=`5`)}render(){return i`
3
3
  <div class="sbb-teaser__wrapper">
4
4
  ${this.renderLink(i`<span class="sbb-screen-reader-only">${this.accessibilityLabel}</span>`)}