@sbb-esta/lyne-elements 1.15.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +6 -6
  2. package/core/base-elements/link-base-element.d.ts +1 -0
  3. package/core/base-elements/link-base-element.d.ts.map +1 -1
  4. package/core/base-elements.js +46 -43
  5. package/core/config/config.d.ts +3 -0
  6. package/core/config/config.d.ts.map +1 -1
  7. package/core/styles/scrollbar.scss +44 -0
  8. package/core/styles/standard-theme.scss +1 -0
  9. package/custom-elements.json +364 -35
  10. package/development/core/base-elements/link-base-element.d.ts +1 -0
  11. package/development/core/base-elements/link-base-element.d.ts.map +1 -1
  12. package/development/core/base-elements.js +5 -2
  13. package/development/core/config/config.d.ts +3 -0
  14. package/development/core/config/config.d.ts.map +1 -1
  15. package/development/core/config.js +1 -1
  16. package/development/form-field/form-field/form-field.d.ts +2 -0
  17. package/development/form-field/form-field/form-field.d.ts.map +1 -1
  18. package/development/form-field/form-field.js +44 -4
  19. package/development/navigation/navigation.js +2 -7
  20. package/development/tabs/tab-group/tab-group.d.ts.map +1 -1
  21. package/development/tabs/tab-group.js +7 -2
  22. package/development/teaser/teaser.d.ts +2 -1
  23. package/development/teaser/teaser.d.ts.map +1 -1
  24. package/development/teaser-product/common/teaser-product-common.d.ts +1 -1
  25. package/development/teaser-product/common/teaser-product-common.d.ts.map +1 -1
  26. package/development/teaser-product/common.js +19 -19
  27. package/development/teaser-product/teaser-product/teaser-product.d.ts +2 -1
  28. package/development/teaser-product/teaser-product/teaser-product.d.ts.map +1 -1
  29. package/development/teaser-product/teaser-product.js +44 -12
  30. package/development/teaser.js +33 -7
  31. package/form-field/form-field/form-field.d.ts +2 -0
  32. package/form-field/form-field/form-field.d.ts.map +1 -1
  33. package/form-field/form-field.js +155 -132
  34. package/navigation/navigation.js +1 -1
  35. package/package.json +13 -5
  36. package/scrollbar.css +158 -0
  37. package/standard-theme.css +159 -0
  38. package/table.css +217 -0
  39. package/tabs/tab-group/tab-group.d.ts.map +1 -1
  40. package/tabs/tab-group.js +62 -60
  41. package/teaser/teaser.d.ts +2 -1
  42. package/teaser/teaser.d.ts.map +1 -1
  43. package/teaser-product/common/teaser-product-common.d.ts +1 -1
  44. package/teaser-product/common/teaser-product-common.d.ts.map +1 -1
  45. package/teaser-product/common.js +22 -20
  46. package/teaser-product/teaser-product/teaser-product.d.ts +2 -1
  47. package/teaser-product/teaser-product/teaser-product.d.ts.map +1 -1
  48. package/teaser-product/teaser-product.js +26 -13
  49. package/teaser.js +38 -26
package/tabs/tab-group.js CHANGED
@@ -1,8 +1,8 @@
1
- var I = (n) => {
2
- throw TypeError(n);
1
+ var S = (a) => {
2
+ throw TypeError(a);
3
3
  };
4
- var S = (n, r, l) => r.has(n) || I("Cannot " + l);
5
- var y = (n, r, l) => (S(n, r, "read from private field"), l ? l.call(n) : r.get(n)), z = (n, r, l) => r.has(n) ? I("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, l), _ = (n, r, l, c) => (S(n, r, "write to private field"), c ? c.call(n, l) : r.set(n, l), l);
4
+ var I = (a, r, l) => r.has(a) || S("Cannot " + l);
5
+ var y = (a, r, l) => (I(a, r, "read from private field"), l ? l.call(a) : r.get(a)), z = (a, r, l) => r.has(a) ? S("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, l), _ = (a, r, l, c) => (I(a, r, "write to private field"), c ? c.call(a, l) : r.set(a, l), l);
6
6
  import { __runInitializers as h, __esDecorate as m } from "tslib";
7
7
  import { MutationController as w } from "@lit-labs/observers/mutation-controller.js";
8
8
  import { ResizeController as E } from "@lit-labs/observers/resize-controller.js";
@@ -20,7 +20,7 @@ const F = k`*,:before,:after{box-sizing:border-box}:host{--sbb-tab-group-animati
20
20
  };
21
21
  let B = 0, ot = (() => {
22
22
  var b, d;
23
- let n = [$("sbb-tab-group")], r, l = [], c, p = U(R), v = [], g, A, x = [], T = [];
23
+ let a = [$("sbb-tab-group")], r, l = [], c, p = U(R), v = [], g, A, x = [], T = [];
24
24
  var f = (d = class extends p {
25
25
  constructor() {
26
26
  super(...arguments);
@@ -38,15 +38,16 @@ let B = 0, ot = (() => {
38
38
  skipInitial: !0,
39
39
  callback: (t) => this._onTabContentElementResize(t)
40
40
  }), this._size = "l", _(this, b, h(this, x, 0)), this._selectedTabChanged = (h(this, T), new j(this, f.events.didChange)), this._onContentSlotChange = () => {
41
+ var i, e;
41
42
  this._tabContentElement = this.shadowRoot.querySelector("div.tab-content");
42
- const t = this._getTabs().filter((e) => !this._tabs.includes(e));
43
- t.length && (t.forEach((e) => this._configure(e)), this._tabs = this._tabs.concat(t));
43
+ const t = this._getTabs().filter((s) => !this._tabs.includes(s));
44
+ t.length && (t.forEach((s) => this._configure(s)), this._tabs = this._tabs.concat(t), (e = (i = t.find((s) => s.active)) == null ? void 0 : i.tabGroupActions) == null || e.select());
44
45
  }, this._onTabsSlotChange = () => {
45
46
  const t = this._getTabs();
46
- t.length < this._tabs.length && (this._tabs.filter((i) => !t.includes(i)).forEach((i) => {
47
- var a;
48
- (a = i.tab) == null || a.remove();
49
- }), this._tabs = t), this._tabs.forEach((e) => e.setAttribute("data-size", this.size));
47
+ t.length < this._tabs.length && (this._tabs.filter((e) => !t.includes(e)).forEach((e) => {
48
+ var s;
49
+ (s = e.tab) == null || s.remove();
50
+ }), this._tabs = t), this._tabs.forEach((i) => i.setAttribute("data-size", this.size));
50
51
  };
51
52
  }
52
53
  /** Size variant, either s, l or xl. */
@@ -69,34 +70,34 @@ let B = 0, ot = (() => {
69
70
  connectedCallback() {
70
71
  super.connectedCallback();
71
72
  const t = this._abort.signal;
72
- this.addEventListener("keydown", (e) => this._handleKeyDown(e), { signal: t });
73
+ this.addEventListener("keydown", (i) => this._handleKeyDown(i), { signal: t });
73
74
  }
74
75
  firstUpdated(t) {
75
- super.firstUpdated(t), this._tabs = this._getTabs(), this._tabs.forEach((e) => this._configure(e)), this._initSelection(), this._tabGroupResizeObserver.observe(this._tabGroupElement);
76
+ super.firstUpdated(t), this._tabs = this._getTabs(), this._tabs.forEach((i) => this._configure(i)), this._initSelection(), this._tabGroupResizeObserver.observe(this._tabGroupElement);
76
77
  }
77
78
  /**
78
79
  * Disables a tab by index.
79
80
  * @param tabIndex The index of the tab you want to disable.
80
81
  */
81
82
  disableTab(t) {
82
- var e, i;
83
- (i = (e = this._tabs[t]) == null ? void 0 : e.tabGroupActions) == null || i.disable();
83
+ var i, e;
84
+ (e = (i = this._tabs[t]) == null ? void 0 : i.tabGroupActions) == null || e.disable();
84
85
  }
85
86
  /**
86
87
  * Enables a tab by index.
87
88
  * @param tabIndex The index of the tab you want to enable.
88
89
  */
89
90
  enableTab(t) {
90
- var e, i;
91
- (i = (e = this._tabs[t]) == null ? void 0 : e.tabGroupActions) == null || i.enable();
91
+ var i, e;
92
+ (e = (i = this._tabs[t]) == null ? void 0 : i.tabGroupActions) == null || e.enable();
92
93
  }
93
94
  /**
94
95
  * Activates a tab by index.
95
96
  * @param tabIndex The index of the tab you want to activate.
96
97
  */
97
98
  activateTab(t) {
98
- var e, i;
99
- (i = (e = this._tabs[t]) == null ? void 0 : e.tabGroupActions) == null || i.select();
99
+ var i, e;
100
+ (e = (i = this._tabs[t]) == null ? void 0 : i.tabGroupActions) == null || e.select();
100
101
  }
101
102
  _getTabs() {
102
103
  return Array.from(this.children ?? []).filter((t) => /^sbb-tab-label$/u.test(t.localName));
@@ -112,77 +113,78 @@ let B = 0, ot = (() => {
112
113
  return `sbb-tab-panel-${++B}`;
113
114
  }
114
115
  _initSelection() {
115
- var t, e, i;
116
- this.initialSelectedIndex >= 0 && this.initialSelectedIndex < this._tabs.length && !this._tabs[this.initialSelectedIndex].disabled ? (t = this._tabs[this.initialSelectedIndex].tabGroupActions) == null || t.select() : (i = (e = this._enabledTabs()[0]) == null ? void 0 : e.tabGroupActions) == null || i.select();
116
+ var t, i, e;
117
+ this.initialSelectedIndex >= 0 && this.initialSelectedIndex < this._tabs.length && !this._tabs[this.initialSelectedIndex].disabled ? (t = this._tabs[this.initialSelectedIndex].tabGroupActions) == null || t.select() : (e = (i = this._enabledTabs()[0]) == null ? void 0 : i.tabGroupActions) == null || e.select();
117
118
  }
118
119
  _onTabAttributesChange(t) {
119
- var e, i, a;
120
- for (const s of t) {
121
- if (s.type !== "attributes")
120
+ var i, e, s;
121
+ for (const n of t) {
122
+ if (n.type !== "attributes")
122
123
  return;
123
- const o = s.target;
124
- s.attributeName === "disabled" && (o.hasAttribute("disabled") && o !== this._selectedTab ? (e = o.tabGroupActions) == null || e.disable() : o.disabled && ((i = o.tabGroupActions) == null || i.enable())), s.attributeName === "active" && (o.hasAttribute("active") && !o.disabled ? (a = o.tabGroupActions) == null || a.select() : o === this._selectedTab && o.toggleAttribute("active", !0));
124
+ const o = n.target;
125
+ n.attributeName === "disabled" && (o.hasAttribute("disabled") && o !== this._selectedTab ? (i = o.tabGroupActions) == null || i.disable() : o.disabled && ((e = o.tabGroupActions) == null || e.enable())), n.attributeName === "active" && (o.hasAttribute("active") && !o.disabled ? (s = o.tabGroupActions) == null || s.select() : o === this._selectedTab && o.toggleAttribute("active", !0));
125
126
  }
126
127
  }
127
128
  _onTabGroupElementResize(t) {
128
- for (const e of t) {
129
- const i = e.target.firstElementChild.assignedElements();
130
- for (const a of i)
131
- a.toggleAttribute("data-has-divider", a === i[0] || a.offsetLeft === i[0].offsetLeft), this.style.setProperty("--sbb-tab-group-width", `${this._tabGroupElement.clientWidth}px`);
129
+ for (const i of t) {
130
+ const e = i.target.firstElementChild.assignedElements();
131
+ for (const s of e)
132
+ s.toggleAttribute("data-has-divider", s === e[0] || s.offsetLeft === e[0].offsetLeft), this.style.setProperty("--sbb-tab-group-width", `${this._tabGroupElement.clientWidth}px`);
132
133
  }
133
134
  }
134
135
  _onTabContentElementResize(t) {
135
- for (const e of t) {
136
- const i = Math.floor(e.contentRect.height);
137
- this._tabContentElement.style.height = `${i}px`;
138
- }
136
+ if (this._tabContentElement)
137
+ for (const i of t) {
138
+ const e = Math.floor(i.contentRect.height);
139
+ this._tabContentElement.style.height = `${e}px`;
140
+ }
139
141
  }
140
142
  _configure(t) {
141
- var e;
143
+ var i;
142
144
  t.tabGroupActions = {
143
145
  activate: () => {
144
- var i;
145
- t.toggleAttribute("active", !0), t.active = !0, t.tabIndex = 0, t.setAttribute("aria-selected", "true"), (i = t.tab) == null || i.toggleAttribute("active", !0);
146
+ var e;
147
+ t.toggleAttribute("active", !0), t.active = !0, t.tabIndex = 0, t.setAttribute("aria-selected", "true"), (e = t.tab) == null || e.toggleAttribute("active", !0);
146
148
  },
147
149
  deactivate: () => {
148
- var i;
149
- t.removeAttribute("active"), t.active = !1, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (i = t.tab) == null || i.removeAttribute("active");
150
+ var e;
151
+ t.removeAttribute("active"), t.active = !1, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (e = t.tab) == null || e.removeAttribute("active");
150
152
  },
151
153
  disable: () => {
152
- var i, a, s;
153
- t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (i = t.tab) == null || i.removeAttribute("active"), t.active && (t.removeAttribute("active"), t.active = !1, (s = (a = this._enabledTabs()[0]) == null ? void 0 : a.tabGroupActions) == null || s.select()));
154
+ var e, s, n;
155
+ t.disabled || (t.hasAttribute("disabled") || t.toggleAttribute("disabled", !0), t.disabled = !0, t.tabIndex = -1, t.setAttribute("aria-selected", "false"), (e = t.tab) == null || e.removeAttribute("active"), t.active && (t.removeAttribute("active"), t.active = !1, (n = (s = this._enabledTabs()[0]) == null ? void 0 : s.tabGroupActions) == null || n.select()));
154
156
  },
155
157
  enable: () => {
156
158
  t.disabled && (t.removeAttribute("disabled"), t.disabled = !1);
157
159
  },
158
160
  select: () => {
159
- var i, a;
161
+ var e, s;
160
162
  if (t !== this._selectedTab && !t.disabled) {
161
- const s = this._selectedTab;
162
- s && ((i = s.tabGroupActions) == null || i.deactivate(), this._tabContentResizeObserver.unobserve(s.tab)), (a = t.tabGroupActions) == null || a.activate(), this._selectedTab = t, this._tabContentResizeObserver.observe(t.tab);
163
+ const n = this._selectedTab;
164
+ n && ((e = n.tabGroupActions) == null || e.deactivate(), this._tabContentResizeObserver.unobserve(n.tab)), (s = t.tabGroupActions) == null || s.activate(), this._selectedTab = t, this._tabContentResizeObserver.observe(t.tab);
163
165
  const o = this._tabs;
164
166
  this._selectedTabChanged.emit({
165
167
  activeIndex: o.findIndex((u) => u === t),
166
168
  activeTabLabel: t,
167
169
  activeTab: t.tab,
168
- previousIndex: o.findIndex((u) => u === s),
169
- previousTabLabel: s,
170
- previousTab: s == null ? void 0 : s.tab
170
+ previousIndex: o.findIndex((u) => u === n),
171
+ previousTabLabel: n,
172
+ previousTab: n == null ? void 0 : n.tab
171
173
  });
172
174
  }
173
175
  }
174
- }, ((e = t.nextElementSibling) == null ? void 0 : e.localName) === "sbb-tab" && (t.tab = t.nextElementSibling, t.tab.id = this._assignId(), t.tab instanceof q && (t.tab.tabIndex = 0, t.tab.configure())), t.tabIndex = -1, t.disabled = t.hasAttribute("disabled"), t.active = t.hasAttribute("active") && !t.disabled, t.setAttribute("role", "tab"), t.setAttribute("aria-selected", "false"), t.addEventListener("click", () => {
175
- var i;
176
- (i = t.tabGroupActions) == null || i.select();
176
+ }, ((i = t.nextElementSibling) == null ? void 0 : i.localName) === "sbb-tab" && (t.tab = t.nextElementSibling, t.tab.id = this._assignId(), t.tab instanceof q && (t.tab.tabIndex = 0, t.tab.configure())), t.tabIndex = -1, t.disabled = t.hasAttribute("disabled"), t.active = t.hasAttribute("active") && !t.disabled, t.setAttribute("role", "tab"), t.setAttribute("aria-selected", String(t.active)), t.addEventListener("click", () => {
177
+ var e;
178
+ (e = t.tabGroupActions) == null || e.select();
177
179
  }), t.tab && (t.setAttribute("aria-controls", t.tab.id), t.tab.setAttribute("role", "tabpanel"), t.tab.toggleAttribute("active", t.active)), this._tabAttributeObserver.observe(t), t.slot = "tab-bar";
178
180
  }
179
181
  _handleKeyDown(t) {
180
- var i, a, s;
181
- const e = this._enabledTabs();
182
- if (!(!e || // don't trap nested handling
182
+ var e, s, n;
183
+ const i = this._enabledTabs();
184
+ if (!(!i || // don't trap nested handling
183
185
  t.target !== this && t.target.parentElement !== this) && N(t)) {
184
- const o = e.findIndex((G) => G.active), u = K(t, o, e.length);
185
- (a = (i = e[u]) == null ? void 0 : i.tabGroupActions) == null || a.select(), (s = e[u]) == null || s.focus(), t.preventDefault();
186
+ const o = i.findIndex((G) => G.active), u = K(t, o, i.length);
187
+ (s = (e = i[u]) == null ? void 0 : e.tabGroupActions) == null || s.select(), (n = i[u]) == null || n.focus(), t.preventDefault();
186
188
  }
187
189
  }
188
190
  render() {
@@ -202,11 +204,11 @@ let B = 0, ot = (() => {
202
204
  }
203
205
  }, b = new WeakMap(), c = d, (() => {
204
206
  const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(p[Symbol.metadata] ?? null) : void 0;
205
- g = [C()], A = [P(), C({ attribute: "initial-selected-index", type: Number })], m(d, null, g, { kind: "setter", name: "size", static: !1, private: !1, access: { has: (e) => "size" in e, set: (e, i) => {
206
- e.size = i;
207
- } }, metadata: t }, null, v), m(d, null, A, { kind: "accessor", name: "initialSelectedIndex", static: !1, private: !1, access: { has: (e) => "initialSelectedIndex" in e, get: (e) => e.initialSelectedIndex, set: (e, i) => {
208
- e.initialSelectedIndex = i;
209
- } }, metadata: t }, x, T), m(null, r = { value: c }, n, { kind: "class", name: c.name, metadata: t }, null, l), f = c = r.value, t && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
207
+ g = [C()], A = [P(), C({ attribute: "initial-selected-index", type: Number })], m(d, null, g, { kind: "setter", name: "size", static: !1, private: !1, access: { has: (i) => "size" in i, set: (i, e) => {
208
+ i.size = e;
209
+ } }, metadata: t }, null, v), m(d, null, A, { kind: "accessor", name: "initialSelectedIndex", static: !1, private: !1, access: { has: (i) => "initialSelectedIndex" in i, get: (i) => i.initialSelectedIndex, set: (i, e) => {
210
+ i.initialSelectedIndex = e;
211
+ } }, metadata: t }, x, T), m(null, r = { value: c }, a, { kind: "class", name: c.name, metadata: t }, null, l), f = c = r.value, t && Object.defineProperty(c, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
210
212
  })(), d.styles = F, d.events = {
211
213
  didChange: "didChange"
212
214
  }, h(c, l), d);
@@ -19,7 +19,8 @@ export declare class SbbTeaserElement extends SbbLinkBaseElement {
19
19
  accessor titleContent: string;
20
20
  /** Content of chip. */
21
21
  accessor chipContent: string;
22
- protected renderTemplate(): TemplateResult;
22
+ protected render(): TemplateResult;
23
+ protected renderContent(): TemplateResult;
23
24
  }
24
25
  declare global {
25
26
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"teaser.d.ts","sourceRoot":"","sources":["../../../src/elements/teaser/teaser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,OAAO,YAAY,CAAC;AACpB,OAAO,aAAa,CAAC;AAErB;;;;;;;GAOG;AACH,qBAGM,gBAAiB,SAAQ,kBAAkB;IAC/C,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,gFAAgF;IAChF,SAA6C,SAAS,EAAE,gBAAgB,GAAG,OAAO,GAAG,OAAO,CACzE;IAEnB,2DAA2D;IAC3D,SAAwD,UAAU,EAAE,aAAa,CAAO;IAExF,wBAAwB;IACxB,SAEgB,YAAY,EAAE,MAAM,CAAM;IAE1C,uBAAuB;IACvB,SAEgB,WAAW,EAAE,MAAM,CAAM;cAEtB,cAAc,IAAI,cAAc;CAoBpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,YAAY,EAAE,gBAAgB,CAAC;KAChC;CACF"}
1
+ {"version":3,"file":"teaser.d.ts","sourceRoot":"","sources":["../../../src/elements/teaser/teaser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,OAAO,YAAY,CAAC;AACpB,OAAO,0BAA0B,CAAC;AAClC,OAAO,aAAa,CAAC;AAErB;;;;;;;GAOG;AACH,qBAGM,gBAAiB,SAAQ,kBAAkB;IAC/C,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,gFAAgF;IAChF,SAA6C,SAAS,EAAE,gBAAgB,GAAG,OAAO,GAAG,OAAO,CACzE;IAEnB,2DAA2D;IAC3D,SAAwD,UAAU,EAAE,aAAa,CAAO;IAExF,wBAAwB;IACxB,SAEgB,YAAY,EAAE,MAAM,CAAM;IAE1C,uBAAuB;IACvB,SAEgB,WAAW,EAAE,MAAM,CAAM;cAEtB,MAAM,IAAI,cAAc;IAa3C,SAAS,CAAC,aAAa,IAAI,cAAc;CAoB1C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,YAAY,EAAE,gBAAgB,CAAC;KAChC;CACF"}
@@ -1,5 +1,5 @@
1
1
  import { SbbActionBaseElement } from '../../core/base-elements.js';
2
- import { SbbNegativeMixinType, AbstractConstructor } from '../../core/mixins.js';
2
+ import { AbstractConstructor, SbbNegativeMixinType } from '../../core/mixins.js';
3
3
  export declare class SbbTeaserProductCommonElementMixinType extends SbbNegativeMixinType {
4
4
  accessor imageAlignment: 'after' | 'before';
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"teaser-product-common.d.ts","sourceRoot":"","sources":["../../../../src/elements/teaser-product/common/teaser-product-common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,sCAAuC,SAAQ,oBAAoB;IACtF,SAAgB,cAAc,EAAE,OAAO,GAAG,QAAQ,CAAC;CACpD;AAGD,eAAO,MAAM,kCAAkC,GAC7C,CAAC,SAAS,mBAAmB,CAAC,oBAAoB,CAAC,cAEvC,CAAC,KACZ,mBAAmB,CAAC,sCAAsC,CAAC,GAAG,CA6BhE,CAAC"}
1
+ {"version":3,"file":"teaser-product-common.d.ts","sourceRoot":"","sources":["../../../../src/elements/teaser-product/common/teaser-product-common.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,sCAAuC,SAAQ,oBAAoB;IACtF,SAAgB,cAAc,EAAE,OAAO,GAAG,QAAQ,CAAC;CACpD;AAGD,eAAO,MAAM,kCAAkC,GAC7C,CAAC,SAAS,mBAAmB,CAAC,oBAAoB,CAAC,cAEvC,CAAC,KACZ,mBAAmB,CAAC,sCAAsC,CAAC,GAAG,CA+BhE,CAAC"}
@@ -2,19 +2,19 @@ var m = (t) => {
2
2
  throw TypeError(t);
3
3
  };
4
4
  var v = (t, e, r) => e.has(t) || m("Cannot " + r);
5
- var f = (t, e, r) => (v(t, e, "read from private field"), r ? r.call(t) : e.get(t)), _ = (t, e, r) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), h = (t, e, r, b) => (v(t, e, "write to private field"), b ? b.call(t, r) : e.set(t, r), r);
5
+ var f = (t, e, r) => (v(t, e, "read from private field"), r ? r.call(t) : e.get(t)), _ = (t, e, r) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), h = (t, e, r, i) => (v(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
6
6
  import { __esDecorate as k, __runInitializers as c } from "tslib";
7
7
  import { html as y, css as S } from "lit";
8
8
  import { property as w } from "lit/decorators.js";
9
9
  import { slotState as A } from "../core/decorators.js";
10
10
  import { SbbNegativeMixin as z } from "../core/mixins.js";
11
11
  const M = (t) => (() => {
12
- var n, a;
13
- let r = [A()], b, d = [], o, l = z(t), p, u = [], g = [];
12
+ var b, a;
13
+ let r = [A()], i, d = [], o, l = z(t), u, p = [], g = [];
14
14
  return a = class extends l {
15
15
  constructor() {
16
16
  super(...arguments);
17
- _(this, n, c(this, u, "after"));
17
+ _(this, b, c(this, p, "after"));
18
18
  c(this, g);
19
19
  }
20
20
  /**
@@ -22,31 +22,33 @@ const M = (t) => (() => {
22
22
  * Only relevant starting from large breakpoint.
23
23
  */
24
24
  get imageAlignment() {
25
- return f(this, n);
25
+ return f(this, b);
26
26
  }
27
27
  set imageAlignment(s) {
28
- h(this, n, s);
28
+ h(this, b, s);
29
29
  }
30
30
  renderTemplate() {
31
31
  return y`
32
- <span class="sbb-teaser-product__image-container"><slot name="image"></slot></span>
33
- <span class="sbb-teaser-product__container">
34
- <span class="sbb-teaser-product__content">
35
- <slot></slot>
36
- </span>
37
- <span class="sbb-teaser-product__footnote">
38
- <slot name="footnote"></slot>
39
- </span>
40
- </span>
32
+ <div class="sbb-teaser-product__root">
33
+ <div class="sbb-teaser-product__image-container"><slot name="image"></slot></div>
34
+ <div class="sbb-teaser-product__container">
35
+ <span class="sbb-teaser-product__content">
36
+ <slot></slot>
37
+ </span>
38
+ <div class="sbb-teaser-product__footnote">
39
+ <slot name="footnote"></slot>
40
+ </div>
41
+ </div>
42
+ </div>
41
43
  `;
42
44
  }
43
- }, n = new WeakMap(), o = a, (() => {
45
+ }, b = new WeakMap(), o = a, (() => {
44
46
  const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(l[Symbol.metadata] ?? null) : void 0;
45
- p = [w({ attribute: "image-alignment", reflect: !0 })], k(a, null, p, { kind: "accessor", name: "imageAlignment", static: !1, private: !1, access: { has: (i) => "imageAlignment" in i, get: (i) => i.imageAlignment, set: (i, x) => {
46
- i.imageAlignment = x;
47
- } }, metadata: s }, u, g), k(null, b = { value: o }, r, { kind: "class", name: o.name, metadata: s }, null, d), o = b.value, s && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s }), c(o, d);
47
+ u = [w({ attribute: "image-alignment", reflect: !0 })], k(a, null, u, { kind: "accessor", name: "imageAlignment", static: !1, private: !1, access: { has: (n) => "imageAlignment" in n, get: (n) => n.imageAlignment, set: (n, x) => {
48
+ n.imageAlignment = x;
49
+ } }, metadata: s }, p, g), k(null, i = { value: o }, r, { kind: "class", name: o.name, metadata: s }, null, d), o = i.value, s && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s }), c(o, d);
48
50
  })(), o;
49
- })(), O = S`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-teaser-product-background-color: var(--sbb-color-cloud);--sbb-teaser-product-background-gradient-direction: to right;--sbb-teaser-product-background: var(--sbb-teaser-product-background-color);--sbb-teaser-product-border-radius: var(--sbb-border-radius-4x);--sbb-teaser-product-content-color: var(--sbb-color-iron);--sbb-teaser-product-footer-color: var(--sbb-color-anthracite);--sbb-teaser-product-container-padding-block: var(--sbb-spacing-responsive-l);--sbb-teaser-product-min-height: 37.5rem;--sbb-teaser-product-background-gradient-start: 25%;--sbb-teaser-product-background-gradient-end: 75%}@media (min-width: 64rem){:host{--sbb-teaser-product-background: linear-gradient( var(--sbb-teaser-product-background-gradient-direction), var(--sbb-teaser-product-background-color) var(--sbb-teaser-product-background-gradient-start), transparent var(--sbb-teaser-product-background-gradient-end) )}}:host([negative]){--sbb-teaser-product-background-color: var(--sbb-color-midnight);--sbb-teaser-product-content-color: var(--sbb-color-cloud);--sbb-teaser-product-footer-color: var(--sbb-color-cloud);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-title-text-color-normal-override: var(--sbb-color-milk)}:host([image-alignment=before]){--sbb-teaser-product-background-gradient-direction: to left}.sbb-teaser-product__image-container{display:block;overflow:hidden;border-radius:var(--sbb-teaser-product-border-radius) var(--sbb-teaser-product-border-radius) 0 0}@media (min-width: 64rem){.sbb-teaser-product__image-container{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--sbb-teaser-product-border-radius)}}::slotted(img){display:flex;width:100%;height:100%;object-fit:cover;aspect-ratio:16/9}::slotted(sbb-image){--sbb-image-border-radius: 0;height:100%}::slotted(p.sbb-teaser-product--spacing){margin:0}::slotted(sbb-title.sbb-teaser-product--spacing){--sbb-title-margin-block-start: 0}::slotted(:is(sbb-action-group,[data-action]).sbb-teaser-product--spacing){margin-block-start:var(--sbb-spacing-responsive-xxs)}.sbb-action-base{display:block;position:relative;text-decoration:none}@media (forced-colors: active){.sbb-action-base:after{content:"";position:absolute;display:block;top:0;right:0;bottom:0;left:0;pointer-events:none;border:var(--sbb-border-width-2x) solid CanvasText;border-radius:var(--sbb-teaser-product-border-radius)}}.sbb-teaser-product__container{display:block;background:var(--sbb-teaser-product-background);border-radius:0 0 var(--sbb-teaser-product-border-radius) var(--sbb-teaser-product-border-radius);padding:var(--sbb-spacing-responsive-s)}@media (min-width: 64rem){.sbb-teaser-product__container{display:grid;grid:"content ." 1fr "footnote ." auto/1fr 1fr;column-gap:var(--sbb-spacing-responsive-xxl);background:var(--sbb-teaser-product-background);border-radius:var(--sbb-teaser-product-border-radius);padding-block:var(--sbb-teaser-product-container-padding-block) 0;padding-inline:var(--sbb-spacing-responsive-xl);position:relative}:host([image-alignment=before]) .sbb-teaser-product__container{grid-template-areas:". content" ". footnote"}}.sbb-teaser-product__content{grid-area:content;align-self:center;margin:0;color:var(--sbb-teaser-product-content-color)}@media (min-width: 64rem){.sbb-teaser-product__content{align-content:center;min-height:calc(var(--sbb-teaser-product-min-height) - 2 * var(--sbb-teaser-product-container-padding-block))}}.sbb-teaser-product__footnote{grid-area:footnote;display:block;padding-block-start:var(--sbb-spacing-responsive-s);color:var(--sbb-teaser-product-footer-color);--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}:host(:not([data-slot-names~=footnote])) .sbb-teaser-product__footnote{padding-block-start:0}@media (min-width: 64rem){.sbb-teaser-product__footnote{min-height:var(--sbb-teaser-product-container-padding-block);padding-block:var(--sbb-spacing-responsive-xs)}}`;
51
+ })(), O = S`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-teaser-product-background-color: var(--sbb-color-cloud);--sbb-teaser-product-background-gradient-direction: to right;--sbb-teaser-product-background: var(--sbb-teaser-product-background-color);--sbb-teaser-product-border-radius: var(--sbb-border-radius-4x);--sbb-teaser-product-content-color: var(--sbb-color-iron);--sbb-teaser-product-footer-color: var(--sbb-color-anthracite);--sbb-teaser-product-container-padding-block: var(--sbb-spacing-responsive-l);--sbb-teaser-product-min-height: 37.5rem;--sbb-teaser-product-background-gradient-start: 25%;--sbb-teaser-product-background-gradient-end: 75%}@media (min-width: 64rem){:host{--sbb-teaser-product-background: linear-gradient( var(--sbb-teaser-product-background-gradient-direction), var(--sbb-teaser-product-background-color) var(--sbb-teaser-product-background-gradient-start), transparent var(--sbb-teaser-product-background-gradient-end) )}}:host([negative]){--sbb-teaser-product-background-color: var(--sbb-color-midnight);--sbb-teaser-product-content-color: var(--sbb-color-cloud);--sbb-teaser-product-footer-color: var(--sbb-color-cloud);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-title-text-color-normal-override: var(--sbb-color-milk)}:host([image-alignment=before]){--sbb-teaser-product-background-gradient-direction: to left}.sbb-teaser-product__image-container{overflow:hidden;border-radius:var(--sbb-teaser-product-border-radius) var(--sbb-teaser-product-border-radius) 0 0}@media (min-width: 64rem){.sbb-teaser-product__image-container{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--sbb-teaser-product-border-radius)}}::slotted(img){display:flex;width:100%;height:100%;object-fit:cover;aspect-ratio:16/9}::slotted(sbb-image){--sbb-image-border-radius: 0;height:100%}::slotted(p.sbb-teaser-product--spacing){margin:0}::slotted(sbb-title.sbb-teaser-product--spacing){--sbb-title-margin-block-start: 0}::slotted(:is(sbb-action-group,[data-action]).sbb-teaser-product--spacing){margin-block-start:var(--sbb-spacing-responsive-xxs)}@media (forced-colors: active){.sbb-teaser-product__root:after{content:"";position:absolute;display:block;top:0;right:0;bottom:0;left:0;pointer-events:none;border:var(--sbb-border-width-2x) solid CanvasText;border-radius:var(--sbb-teaser-product-border-radius)}}.sbb-action-base{display:block;position:relative;text-decoration:none}.sbb-teaser-product__container{background:var(--sbb-teaser-product-background);border-radius:0 0 var(--sbb-teaser-product-border-radius) var(--sbb-teaser-product-border-radius);padding:var(--sbb-spacing-responsive-s)}@media (min-width: 64rem){.sbb-teaser-product__container{display:grid;grid:"content ." 1fr "footnote ." auto/1fr 1fr;column-gap:var(--sbb-spacing-responsive-xxl);background:var(--sbb-teaser-product-background);border-radius:var(--sbb-teaser-product-border-radius);padding-block:var(--sbb-teaser-product-container-padding-block) 0;padding-inline:var(--sbb-spacing-responsive-xl);position:relative}:host([image-alignment=before]) .sbb-teaser-product__container{grid-template-areas:". content" ". footnote"}}.sbb-teaser-product__content{grid-area:content;align-self:center;margin:0;color:var(--sbb-teaser-product-content-color)}@media (min-width: 64rem){.sbb-teaser-product__content{align-content:center;min-height:calc(var(--sbb-teaser-product-min-height) - 2 * var(--sbb-teaser-product-container-padding-block))}}.sbb-teaser-product__footnote{grid-area:footnote;padding-block-start:var(--sbb-spacing-responsive-s);color:var(--sbb-teaser-product-footer-color);--sbb-text-font-size: var(--sbb-font-size-text-xxs);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size)}:host(:not([data-slot-names~=footnote])) .sbb-teaser-product__footnote{padding-block-start:0}@media (min-width: 64rem){.sbb-teaser-product__footnote{min-height:var(--sbb-teaser-product-container-padding-block);padding-block:var(--sbb-spacing-responsive-xs)}}`;
50
52
  export {
51
53
  M as SbbTeaserProductCommonElementMixin,
52
54
  O as teaserProductCommonStyle
@@ -1,4 +1,4 @@
1
- import { CSSResultGroup } from 'lit';
1
+ import { CSSResultGroup, TemplateResult } from 'lit';
2
2
  import { SbbLinkBaseElement } from '../../core/base-elements.js';
3
3
  declare const SbbTeaserProductElement_base: import('../../core/mixins.js').AbstractConstructor<import('../common.js').SbbTeaserProductCommonElementMixinType> & typeof SbbLinkBaseElement;
4
4
  /**
@@ -12,6 +12,7 @@ declare const SbbTeaserProductElement_base: import('../../core/mixins.js').Abstr
12
12
  */
13
13
  export declare class SbbTeaserProductElement extends SbbTeaserProductElement_base {
14
14
  static styles: CSSResultGroup;
15
+ protected render(): TemplateResult;
15
16
  }
16
17
  declare global {
17
18
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"teaser-product.d.ts","sourceRoot":"","sources":["../../../../src/elements/teaser-product/teaser-product/teaser-product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;;AAKjE;;;;;;;;GAQG;AACH,qBAEM,uBAAwB,SAAQ,4BAAsD;IAC1F,OAAuB,MAAM,EAAE,cAAc,CAAqC;CACnF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,oBAAoB,EAAE,uBAAuB,CAAC;KAC/C;CACF"}
1
+ {"version":3,"file":"teaser-product.d.ts","sourceRoot":"","sources":["../../../../src/elements/teaser-product/teaser-product/teaser-product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAKjE,OAAO,6BAA6B,CAAC;;AAErC;;;;;;;;GAQG;AACH,qBAEM,uBAAwB,SAAQ,4BAAsD;IAC1F,OAAuB,MAAM,EAAE,cAAc,CAAqC;cAE/D,MAAM,IAAI,cAAc;CAY5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,oBAAoB,EAAE,uBAAuB,CAAC;KAC/C;CACF"}
@@ -1,18 +1,31 @@
1
- import { __esDecorate as b, __runInitializers as n } from "tslib";
2
- import { customElement as l } from "lit/decorators.js";
3
- import { SbbLinkBaseElement as u } from "../core/base-elements.js";
4
- import { SbbTeaserProductCommonElementMixin as c, teaserProductCommonStyle as d } from "./common.js";
5
- import { css as m } from "lit";
6
- const f = m`:host{--sbb-teaser-product-brightness-hover: var(--sbb-hover-image-brightness);--sbb-teaser-product-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );--sbb-teaser-product-animation-easing: var(--sbb-animation-easing);--sbb-teaser-product-border-radius: var(--sbb-border-radius-4x)}@media (any-hover: hover){:host(:hover){--sbb-teaser-product-brightness: var(--sbb-teaser-product-brightness-hover)}}:host(:not([data-focus-origin=mouse],[data-focus-origin=touch])) .sbb-teaser-product:focus-visible{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:var(--sbb-teaser-product-border-radius)}@media (forced-colors: active){:host(:hover) .sbb-teaser-product:after{border-color:Highlight}}::slotted(:is(img,sbb-image)){will-change:filter;transition-property:filter;transition-duration:var(--sbb-teaser-product-animation-duration);transition-timing-function:var(--sbb-animation-easing);filter:brightness(var(--sbb-teaser-product-brightness, 1))}`;
7
- let _ = (() => {
1
+ import { __esDecorate as b, __runInitializers as l } from "tslib";
2
+ import { customElement as c } from "lit/decorators.js";
3
+ import { html as i } from "lit/static-html.js";
4
+ import { SbbLinkBaseElement as d } from "../core/base-elements.js";
5
+ import { SbbTeaserProductCommonElementMixin as u, teaserProductCommonStyle as m } from "./common.js";
6
+ import { css as p } from "lit";
7
+ import "../screen-reader-only.js";
8
+ const v = p`:host{--sbb-teaser-product-brightness-hover: var(--sbb-hover-image-brightness);--sbb-teaser-product-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );--sbb-teaser-product-animation-easing: var(--sbb-animation-easing);--sbb-teaser-product-border-radius: var(--sbb-border-radius-4x)}@media (forced-colors: active){:host{--sbb-title-text-color-normal-override: LinkText !important;--sbb-teaser-product-content-color: LinkText !important;--sbb-teaser-product-footer-color: LinkText !important}}@media (any-hover: hover){:host(:hover){--sbb-teaser-product-brightness: var(--sbb-teaser-product-brightness-hover)}}::slotted(:is(img,sbb-image)){will-change:filter;transition-property:filter;transition-duration:var(--sbb-teaser-product-animation-duration);transition-timing-function:var(--sbb-animation-easing);filter:brightness(var(--sbb-teaser-product-brightness, 1))}.sbb-teaser-product__wrapper{position:relative}.sbb-teaser-product__root{pointer-events:none}@media (forced-colors: active){:host(:hover) .sbb-teaser-product__root:after{border-color:Highlight}}.sbb-teaser-product{position:absolute;top:0;right:0;bottom:0;left:0}:host(:not([data-focus-origin=mouse],[data-focus-origin=touch])) .sbb-teaser-product:focus-visible{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:var(--sbb-teaser-product-border-radius)}`;
9
+ let T = (() => {
8
10
  var e;
9
- let i = [l("sbb-teaser-product")], s, a = [], t, o = c(u);
10
- return e = class extends o {
11
+ let n = [c("sbb-teaser-product")], o, s = [], t, a = u(d);
12
+ return e = class extends a {
13
+ render() {
14
+ return i`
15
+ <div class="sbb-teaser-product__wrapper">
16
+ ${this.renderLink(
17
+ // For SEO we add the accessibility hidden as hidden content of the link
18
+ i`<sbb-screen-reader-only>${this.accessibilityLabel}</sbb-screen-reader-only>`
19
+ )}
20
+ ${this.renderTemplate()}
21
+ </div>
22
+ `;
23
+ }
11
24
  }, t = e, (() => {
12
- const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
13
- b(null, s = { value: t }, i, { kind: "class", name: t.name, metadata: r }, null, a), t = s.value, r && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
14
- })(), e.styles = [d, f], n(t, a), t;
25
+ const r = typeof Symbol == "function" && Symbol.metadata ? Object.create(a[Symbol.metadata] ?? null) : void 0;
26
+ b(null, o = { value: t }, n, { kind: "class", name: t.name, metadata: r }, null, s), t = o.value, r && Object.defineProperty(t, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: r });
27
+ })(), e.styles = [m, v], l(t, s), t;
15
28
  })();
16
29
  export {
17
- _ as SbbTeaserProductElement
30
+ T as SbbTeaserProductElement
18
31
  };
package/teaser.js CHANGED
@@ -4,24 +4,25 @@ var j = (t) => {
4
4
  var D = (t, s, i) => s.has(t) || j("Cannot " + i);
5
5
  var v = (t, s, i) => (D(t, s, "read from private field"), i ? i.call(t) : s.get(t)), m = (t, s, i) => s.has(t) ? j("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, i), p = (t, s, i, o) => (D(t, s, "write to private field"), o ? o.call(t, i) : s.set(t, i), i);
6
6
  import { __esDecorate as f, __runInitializers as n } from "tslib";
7
- import { customElement as O, property as g } from "lit/decorators.js";
8
- import { html as B } from "lit/static-html.js";
7
+ import { customElement as B, property as _ } from "lit/decorators.js";
8
+ import { html as u } from "lit/static-html.js";
9
9
  import { SbbLinkBaseElement as F } from "./core/base-elements.js";
10
- import { slotState as H, forceType as $, omitEmptyConverter as P } from "./core/decorators.js";
10
+ import { slotState as H, forceType as O, omitEmptyConverter as P } from "./core/decorators.js";
11
11
  import { css as U } from "lit";
12
12
  import "./chip.js";
13
+ import "./screen-reader-only.js";
13
14
  import "./title.js";
14
- const q = U`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{display:inline-block;outline:none!important;--sbb-teaser-scale-hover: 1.02;--sbb-teaser-description-color: var(--sbb-color-granite);--sbb-teaser-flex-direction: row;--sbb-teaser-align-items: center;--sbb-teaser-gap: var(--sbb-spacing-fixed-4x);--sbb-teaser-width: fit-content;--sbb-teaser-border-radius: var(--sbb-border-radius-4x);--sbb-teaser-brightness-hover: var(--sbb-hover-image-brightness);--sbb-teaser-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) )}: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);--sbb-teaser-width: 100%}.sbb-teaser{display:flex;text-decoration:none}.sbb-teaser:before{content:"​";-webkit-user-select:none;user-select:none;width:0;height:0}:host(:not([data-focus-origin=mouse],[data-focus-origin=touch])) .sbb-teaser:focus-visible{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:var(--sbb-teaser-border-radius)}@media (forced-colors: active){.sbb-teaser{outline-offset:var(--sbb-focus-outline-offset);outline:CanvasText solid var(--sbb-focus-outline-width);border-radius:var(--sbb-teaser-border-radius)}.sbb-teaser:hover{outline-color:Highlight}}.sbb-teaser__container{display:flex;flex-flow:var(--sbb-teaser-flex-direction) nowrap;align-items:var(--sbb-teaser-align-items);gap:var(--sbb-teaser-gap);max-width:100%;width:100%}.sbb-teaser__text{overflow:hidden;max-width:100%}::slotted([slot=image]){width:18.75rem;will-change:transform;display:block;filter:brightness(var(--sbb-teaser-brightness, 1));transition:var(--sbb-teaser-animation-duration) var(--sbb-animation-easing)}@media (any-hover: hover){.sbb-teaser:hover ::slotted([slot=image]){transform:scale(var(--sbb-teaser-scale-hover));--sbb-teaser-brightness: var(--sbb-teaser-brightness-hover)}}::slotted(sbb-image[slot=image]){--sbb-image-aspect-ratio: 4 / 3}::slotted(img[slot=image]){aspect-ratio:4/3;object-fit:cover}.sbb-teaser__image-wrapper{flex-shrink:0;overflow:hidden;border-radius:var(--sbb-teaser-border-radius);transition:var(--sbb-teaser-animation-duration) var(--sbb-animation-easing)}@media (any-hover: hover){.sbb-teaser:hover .sbb-teaser__image-wrapper{box-shadow:var(--sbb-shadow-elevation-level-9-shadow-2-offset-x) var(--sbb-shadow-elevation-level-9-shadow-2-offset-y) var(--sbb-shadow-elevation-level-9-shadow-2-blur) var(--sbb-shadow-elevation-level-9-shadow-2-spread) var(--sbb-shadow-elevation-level-9-hard-2-color),var(--sbb-shadow-elevation-level-9-shadow-1-offset-x) var(--sbb-shadow-elevation-level-9-shadow-1-offset-y) var(--sbb-shadow-elevation-level-9-shadow-1-blur) var(--sbb-shadow-elevation-level-9-shadow-1-spread) var(--sbb-shadow-elevation-level-9-hard-1-color)}}.sbb-teaser__chip{display:block;max-width:fit-content;margin-block-end:var(--sbb-spacing-fixed-1x)}:host(:not([data-slot-names~=chip],[chip-content])) .sbb-teaser__chip{display:none}.sbb-teaser__lead{margin:0}.sbb-teaser__description{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:inline-block;color:var(--sbb-teaser-description-color)}`;
15
- let X = (() => {
16
- var b, c, h, d, r;
17
- let t = [O("sbb-teaser"), H()], s, i = [], o, u = F, _, w = [], x = [], y, C = [], z = [], k, L = [], S = [], I, T = [], E = [];
18
- return r = class extends u {
15
+ const q = U`@charset "UTF-8";*,:before,:after{box-sizing:border-box}:host{display:inline-block;outline:none!important;--sbb-teaser-scale-hover: 1.02;--sbb-teaser-description-color: var(--sbb-color-granite);--sbb-teaser-flex-direction: row;--sbb-teaser-align-items: center;--sbb-teaser-gap: var(--sbb-spacing-fixed-4x);--sbb-teaser-width: fit-content;--sbb-teaser-border-radius: var(--sbb-border-radius-4x);--sbb-teaser-brightness-hover: var(--sbb-hover-image-brightness);--sbb-teaser-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) )}@media (forced-colors: active){:host{--sbb-teaser-description-color: LinkText;--sbb-title-text-color-normal-override: 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);--sbb-teaser-width: 100%}.sbb-teaser__wrapper{display:flex;position:relative;cursor:pointer}.sbb-teaser__wrapper:before{content:"​";-webkit-user-select:none;user-select:none;width:0;height:0}.sbb-teaser{text-decoration:none;position:absolute;top:0;right:0;bottom:0;left:0}:host(:not([data-focus-origin=mouse],[data-focus-origin=touch])) .sbb-teaser:focus-visible{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);border-radius:var(--sbb-teaser-border-radius)}@media (forced-colors: active){.sbb-teaser{outline-offset:var(--sbb-focus-outline-offset);outline:CanvasText solid var(--sbb-focus-outline-width);border-radius:var(--sbb-teaser-border-radius)}.sbb-teaser:hover{outline-color:Highlight}}.sbb-teaser__container{display:flex;flex-flow:var(--sbb-teaser-flex-direction) nowrap;align-items:var(--sbb-teaser-align-items);gap:var(--sbb-teaser-gap);max-width:100%;width:100%;pointer-events:none}.sbb-teaser__text{overflow:hidden;max-width:100%}::slotted([slot=image]){width:18.75rem;will-change:transform;display:block;filter:brightness(var(--sbb-teaser-brightness, 1));transition:var(--sbb-teaser-animation-duration) var(--sbb-animation-easing)}@media (any-hover: hover){.sbb-teaser__wrapper:hover ::slotted([slot=image]){transform:scale(var(--sbb-teaser-scale-hover));--sbb-teaser-brightness: var(--sbb-teaser-brightness-hover)}}::slotted(sbb-image[slot=image]){--sbb-image-aspect-ratio: 4 / 3}::slotted(img[slot=image]){aspect-ratio:4/3;object-fit:cover}.sbb-teaser__image-wrapper{flex-shrink:0;overflow:hidden;border-radius:var(--sbb-teaser-border-radius);transition:var(--sbb-teaser-animation-duration) var(--sbb-animation-easing)}@media (any-hover: hover){.sbb-teaser__wrapper:hover .sbb-teaser__image-wrapper{box-shadow:var(--sbb-shadow-elevation-level-9-shadow-2-offset-x) var(--sbb-shadow-elevation-level-9-shadow-2-offset-y) var(--sbb-shadow-elevation-level-9-shadow-2-blur) var(--sbb-shadow-elevation-level-9-shadow-2-spread) var(--sbb-shadow-elevation-level-9-hard-2-color),var(--sbb-shadow-elevation-level-9-shadow-1-offset-x) var(--sbb-shadow-elevation-level-9-shadow-1-offset-y) var(--sbb-shadow-elevation-level-9-shadow-1-blur) var(--sbb-shadow-elevation-level-9-shadow-1-spread) var(--sbb-shadow-elevation-level-9-hard-1-color)}}.sbb-teaser__chip{display:block;max-width:fit-content;margin-block-end:var(--sbb-spacing-fixed-1x)}:host(:not([data-slot-names~=chip],[chip-content])) .sbb-teaser__chip{display:none}.sbb-teaser__lead{margin:0}.sbb-teaser__description{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:inline-block;color:var(--sbb-teaser-description-color)}`;
16
+ let Y = (() => {
17
+ var b, c, d, h, r;
18
+ let t = [B("sbb-teaser"), H()], s, i = [], o, g = F, w, x = [], y = [], C, z = [], k = [], L, S = [], T = [], I, $ = [], E = [];
19
+ return r = class extends g {
19
20
  constructor() {
20
21
  super(...arguments);
21
- m(this, b, n(this, w, "after-centered"));
22
- m(this, c, (n(this, x), n(this, C, "5")));
23
- m(this, h, (n(this, z), n(this, L, "")));
24
- m(this, d, (n(this, S), n(this, T, "")));
22
+ m(this, b, n(this, x, "after-centered"));
23
+ m(this, c, (n(this, y), n(this, z, "5")));
24
+ m(this, d, (n(this, k), n(this, S, "")));
25
+ m(this, h, (n(this, T), n(this, $, "")));
25
26
  n(this, E);
26
27
  }
27
28
  /** Teaser variant - define the position and the alignment of the text block. */
@@ -40,20 +41,31 @@ let X = (() => {
40
41
  }
41
42
  /** Content of title. */
42
43
  get titleContent() {
43
- return v(this, h);
44
+ return v(this, d);
44
45
  }
45
46
  set titleContent(a) {
46
- p(this, h, a);
47
+ p(this, d, a);
47
48
  }
48
49
  /** Content of chip. */
49
50
  get chipContent() {
50
- return v(this, d);
51
+ return v(this, h);
51
52
  }
52
53
  set chipContent(a) {
53
- p(this, d, a);
54
+ p(this, h, a);
55
+ }
56
+ render() {
57
+ return u`
58
+ <div class="sbb-teaser__wrapper">
59
+ ${this.renderLink(
60
+ // For SEO we add the accessibility hidden as hidden content of the link
61
+ u`<sbb-screen-reader-only>${this.accessibilityLabel}</sbb-screen-reader-only>`
62
+ )}
63
+ ${this.renderContent()}
64
+ </div>
65
+ `;
54
66
  }
55
- renderTemplate() {
56
- return B`
67
+ renderContent() {
68
+ return u`
57
69
  <span class="sbb-teaser__container">
58
70
  <span class="sbb-teaser__image-wrapper">
59
71
  <slot name="image"></slot>
@@ -72,19 +84,19 @@ let X = (() => {
72
84
  </span>
73
85
  `;
74
86
  }
75
- }, b = new WeakMap(), c = new WeakMap(), h = new WeakMap(), d = new WeakMap(), o = r, (() => {
76
- const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
77
- _ = [g({ reflect: !0 })], y = [g({ attribute: "title-level" })], k = [$(), g({ attribute: "title-content" })], I = [$(), g({ attribute: "chip-content", reflect: !0, converter: P })], f(r, null, _, { kind: "accessor", name: "alignment", static: !1, private: !1, access: { has: (e) => "alignment" in e, get: (e) => e.alignment, set: (e, l) => {
87
+ }, b = new WeakMap(), c = new WeakMap(), d = new WeakMap(), h = new WeakMap(), o = r, (() => {
88
+ const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(g[Symbol.metadata] ?? null) : void 0;
89
+ w = [_({ reflect: !0 })], C = [_({ attribute: "title-level" })], L = [O(), _({ attribute: "title-content" })], I = [O(), _({ attribute: "chip-content", reflect: !0, converter: P })], f(r, null, w, { kind: "accessor", name: "alignment", static: !1, private: !1, access: { has: (e) => "alignment" in e, get: (e) => e.alignment, set: (e, l) => {
78
90
  e.alignment = l;
79
- } }, metadata: a }, w, x), f(r, null, y, { kind: "accessor", name: "titleLevel", static: !1, private: !1, access: { has: (e) => "titleLevel" in e, get: (e) => e.titleLevel, set: (e, l) => {
91
+ } }, metadata: a }, x, y), f(r, null, C, { kind: "accessor", name: "titleLevel", static: !1, private: !1, access: { has: (e) => "titleLevel" in e, get: (e) => e.titleLevel, set: (e, l) => {
80
92
  e.titleLevel = l;
81
- } }, metadata: a }, C, z), f(r, null, k, { kind: "accessor", name: "titleContent", static: !1, private: !1, access: { has: (e) => "titleContent" in e, get: (e) => e.titleContent, set: (e, l) => {
93
+ } }, metadata: a }, z, k), f(r, null, L, { kind: "accessor", name: "titleContent", static: !1, private: !1, access: { has: (e) => "titleContent" in e, get: (e) => e.titleContent, set: (e, l) => {
82
94
  e.titleContent = l;
83
- } }, metadata: a }, L, S), f(r, null, I, { kind: "accessor", name: "chipContent", static: !1, private: !1, access: { has: (e) => "chipContent" in e, get: (e) => e.chipContent, set: (e, l) => {
95
+ } }, metadata: a }, S, T), f(r, null, I, { kind: "accessor", name: "chipContent", static: !1, private: !1, access: { has: (e) => "chipContent" in e, get: (e) => e.chipContent, set: (e, l) => {
84
96
  e.chipContent = l;
85
- } }, metadata: a }, T, E), f(null, s = { value: o }, t, { kind: "class", name: o.name, metadata: a }, null, i), o = s.value, a && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
97
+ } }, metadata: a }, $, E), f(null, s = { value: o }, t, { kind: "class", name: o.name, metadata: a }, null, i), o = s.value, a && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
86
98
  })(), r.styles = q, n(o, i), o;
87
99
  })();
88
100
  export {
89
- X as SbbTeaserElement
101
+ Y as SbbTeaserElement
90
102
  };