@sbb-esta/lyne-elements 0.52.1 → 0.52.2

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 (71) hide show
  1. package/accordion.js +54 -54
  2. package/action-group.js +3 -3
  3. package/alert/alert-group.js +22 -22
  4. package/alert/alert.js +22 -22
  5. package/autocomplete.js +126 -126
  6. package/breadcrumb/breadcrumb-group.js +60 -60
  7. package/breadcrumb/breadcrumb.js +17 -17
  8. package/calendar.js +423 -423
  9. package/card/card-badge.js +17 -17
  10. package/card/card.js +2 -2
  11. package/card/common.js +30 -30
  12. package/checkbox/checkbox-group.js +17 -17
  13. package/checkbox/checkbox.js +34 -34
  14. package/clock.js +83 -83
  15. package/container/sticky-bar.js +16 -16
  16. package/core/a11y.js +91 -91
  17. package/core/base-elements.js +86 -86
  18. package/core/controllers.js +40 -40
  19. package/core/datetime.js +32 -32
  20. package/core/dom.js +26 -26
  21. package/core/eventing.js +33 -33
  22. package/core/mixins.js +122 -122
  23. package/core/testing.js +29 -29
  24. package/datepicker/common.js +55 -55
  25. package/datepicker/datepicker-toggle.js +94 -94
  26. package/datepicker/datepicker.js +144 -144
  27. package/dialog/dialog-title.js +20 -20
  28. package/dialog/dialog.js +66 -66
  29. package/expansion-panel/expansion-panel-header.js +20 -20
  30. package/expansion-panel/expansion-panel.js +60 -60
  31. package/file-selector.js +91 -91
  32. package/form-field/form-field-clear.js +12 -12
  33. package/form-field/form-field.js +111 -111
  34. package/header/header.js +53 -53
  35. package/icon.js +107 -107
  36. package/image.js +87 -87
  37. package/journey-header.js +29 -29
  38. package/map-container.js +23 -23
  39. package/menu/menu.js +91 -91
  40. package/navigation/common.js +16 -16
  41. package/navigation/navigation-marker.js +34 -34
  42. package/navigation/navigation-section.js +83 -83
  43. package/navigation/navigation.js +87 -87
  44. package/notification.js +52 -52
  45. package/option/optgroup.js +45 -45
  46. package/option/option.js +108 -108
  47. package/overlay.js +5 -5
  48. package/package.json +1 -1
  49. package/popover/popover.js +110 -110
  50. package/radio-button/radio-button-group.js +93 -93
  51. package/radio-button/radio-button.js +84 -84
  52. package/select.js +178 -178
  53. package/selection-panel.js +44 -44
  54. package/slider.js +58 -58
  55. package/status.js +6 -6
  56. package/stepper/step-label.js +19 -19
  57. package/stepper/step.js +31 -31
  58. package/stepper/stepper.js +46 -46
  59. package/tabs/tab-group.js +67 -67
  60. package/tag/tag-group.js +8 -8
  61. package/tag/tag.js +27 -27
  62. package/teaser-paid.js +12 -12
  63. package/time-input.js +73 -73
  64. package/timetable-occupancy-icon.js +26 -26
  65. package/timetable-occupancy.js +9 -9
  66. package/toast.js +38 -38
  67. package/toggle/toggle-option.js +33 -33
  68. package/toggle/toggle.js +46 -46
  69. package/train/train-formation.js +36 -36
  70. package/train/train-wagon.js +30 -30
  71. package/train/train.js +13 -13
package/image.js CHANGED
@@ -1,66 +1,66 @@
1
- import { css as y, LitElement as k, html as h, nothing as l } from "lit";
2
- import { property as s, eventOptions as v, customElement as $ } from "lit/decorators.js";
3
- import { ref as _ } from "lit/directives/ref.js";
1
+ import { css as y, LitElement as _, html as d, nothing as l } from "lit";
2
+ import { property as s, eventOptions as k, customElement as v } from "lit/decorators.js";
3
+ import { ref as $ } from "lit/directives/ref.js";
4
4
  import { hostContext as x } from "./core/dom.js";
5
- const w = 0, S = 359, P = 360, M = 599, z = 600, B = 839, O = 840, F = 1023, D = 1024, Q = 1279, C = 1280, E = 1439, L = 1440, j = 2579, R = 16, H = y`*,:before,:after{box-sizing:border-box}:host{--sbb-image-border-radius: var(--sbb-border-radius-4x);--sbb-image-aspect-ratio: auto;--sbb-image-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );display:block}:host([aspect-ratio="1-1"]){--sbb-image-aspect-ratio: 1 / 1}:host([aspect-ratio="1-2"]){--sbb-image-aspect-ratio: 1 / 2}:host([aspect-ratio="2-1"]){--sbb-image-aspect-ratio: 2 / 1}:host([aspect-ratio="2-3"]){--sbb-image-aspect-ratio: 2 / 3}:host([aspect-ratio="3-2"]){--sbb-image-aspect-ratio: 3 / 2}:host([aspect-ratio="3-4"]){--sbb-image-aspect-ratio: 3 / 4}:host([aspect-ratio="4-3"]){--sbb-image-aspect-ratio: 4 / 3}:host([aspect-ratio="4-5"]){--sbb-image-aspect-ratio: 4 / 5}:host([aspect-ratio="5-4"]){--sbb-image-aspect-ratio: 5 / 4}:host([aspect-ratio="16-9"]){--sbb-image-aspect-ratio: 16 / 9}:host([aspect-ratio="9-16"]){--sbb-image-aspect-ratio: 9 / 16}:host([data-teaser]){--sbb-image-aspect-ratio: 1 / 1}@media (min-width: 37.5rem){:host([data-teaser]){--sbb-image-aspect-ratio: 16 / 9}}:host(:is([border-radius=none],[data-teaser])){--sbb-image-border-radius: 0}:host([border-radius=round]:not([data-teaser])){--sbb-image-border-radius: var(--sbb-border-radius-infinity)}.sbb-image__figure{margin:0}.sbb-image__img{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.000001}:host([data-loaded]) .sbb-image__img{opacity:.999999}:host([data-loaded]) .sbb-image__blurred{opacity:0}:is(.sbb-image__img,.sbb-image__blurred){width:100%;height:100%;object-fit:cover;transition:opacity var(--sbb-image-animation-duration) var(--sbb-animation-easing)}.sbb-image__wrapper{position:relative;overflow:hidden;max-width:100%;border-radius:var(--sbb-image-border-radius);aspect-ratio:var(--sbb-image-aspect-ratio)}.sbb-image__caption{--sbb-text-font-size: var(--sbb-font-size-text-xs);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);margin-block-start:var(--sbb-spacing-fixed-4x)}`;
6
- var d = Object.freeze, g = Object.defineProperty, T = Object.getOwnPropertyDescriptor, o = (t, e, r, i) => {
7
- for (var n = i > 1 ? void 0 : i ? T(e, r) : e, p = t.length - 1, c; p >= 0; p--)
8
- (c = t[p]) && (n = (i ? c(e, r, n) : c(n)) || n);
9
- return i && n && g(e, r, n), n;
10
- }, A = (t, e) => d(g(t, "raw", { value: d(t.slice()) })), u;
11
- const V = (t) => {
12
- if (!t || t.length === 0)
5
+ const w = 0, S = 359, P = 360, M = 599, z = 600, C = 839, B = 840, L = 1023, O = 1024, Q = 1279, F = 1280, D = 1439, E = 1440, T = 2579, I = 16, R = y`*,:before,:after{box-sizing:border-box}:host{--sbb-image-border-radius: var(--sbb-border-radius-4x);--sbb-image-aspect-ratio: auto;--sbb-image-animation-duration: var( --sbb-disable-animation-zero-time, var(--sbb-animation-duration-4x) );display:block}:host([aspect-ratio="1-1"]){--sbb-image-aspect-ratio: 1 / 1}:host([aspect-ratio="1-2"]){--sbb-image-aspect-ratio: 1 / 2}:host([aspect-ratio="2-1"]){--sbb-image-aspect-ratio: 2 / 1}:host([aspect-ratio="2-3"]){--sbb-image-aspect-ratio: 2 / 3}:host([aspect-ratio="3-2"]){--sbb-image-aspect-ratio: 3 / 2}:host([aspect-ratio="3-4"]){--sbb-image-aspect-ratio: 3 / 4}:host([aspect-ratio="4-3"]){--sbb-image-aspect-ratio: 4 / 3}:host([aspect-ratio="4-5"]){--sbb-image-aspect-ratio: 4 / 5}:host([aspect-ratio="5-4"]){--sbb-image-aspect-ratio: 5 / 4}:host([aspect-ratio="16-9"]){--sbb-image-aspect-ratio: 16 / 9}:host([aspect-ratio="9-16"]){--sbb-image-aspect-ratio: 9 / 16}:host([data-teaser]){--sbb-image-aspect-ratio: 1 / 1}@media (min-width: 37.5rem){:host([data-teaser]){--sbb-image-aspect-ratio: 16 / 9}}:host(:is([border-radius=none],[data-teaser])){--sbb-image-border-radius: 0}:host([border-radius=round]:not([data-teaser])){--sbb-image-border-radius: var(--sbb-border-radius-infinity)}.sbb-image__figure{margin:0}.sbb-image__img{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.000001}:host([data-loaded]) .sbb-image__img{opacity:.999999}:host([data-loaded]) .sbb-image__blurred{opacity:0}:is(.sbb-image__img,.sbb-image__blurred){width:100%;height:100%;object-fit:cover;transition:opacity var(--sbb-image-animation-duration) var(--sbb-animation-easing)}.sbb-image__wrapper{position:relative;overflow:hidden;max-width:100%;border-radius:var(--sbb-image-border-radius);aspect-ratio:var(--sbb-image-aspect-ratio)}.sbb-image__caption{--sbb-text-font-size: var(--sbb-font-size-text-xs);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);margin-block-start:var(--sbb-spacing-fixed-4x)}`;
6
+ var h = Object.freeze, u = Object.defineProperty, A = Object.getOwnPropertyDescriptor, o = (e, t, r, i) => {
7
+ for (var n = i > 1 ? void 0 : i ? A(t, r) : t, p = e.length - 1, b; p >= 0; p--)
8
+ (b = e[p]) && (n = (i ? b(t, r, n) : b(n)) || n);
9
+ return i && n && u(t, r, n), n;
10
+ }, U = (e, t) => h(u(e, "raw", { value: h(e.slice()) })), g;
11
+ const H = (e) => {
12
+ if (!e || e.length === 0)
13
13
  return [];
14
- let e;
14
+ let t;
15
15
  try {
16
- e = JSON.parse(t);
16
+ t = JSON.parse(e);
17
17
  } catch {
18
18
  return [];
19
19
  }
20
- if (!e.breakpoints || e.breakpoints.length === 0)
20
+ if (!t.breakpoints || t.breakpoints.length === 0)
21
21
  return [];
22
- if (!Array.isArray(e.breakpoints))
22
+ if (!Array.isArray(t.breakpoints))
23
23
  return [];
24
24
  let r = !1, i = !1;
25
25
  const n = ["image", "mediaQueries"];
26
- return e.breakpoints.forEach((p) => {
27
- const c = Object.keys(p);
28
- c.forEach((m) => {
26
+ return t.breakpoints.forEach((p) => {
27
+ const b = Object.keys(p);
28
+ b.forEach((m) => {
29
29
  n.includes(m) || (r = !0);
30
30
  }), n.forEach((m) => {
31
- c.includes(m) || (i = !0);
31
+ b.includes(m) || (i = !0);
32
32
  });
33
- }), r || i ? [] : e.breakpoints;
34
- }, q = {
33
+ }), r || i ? [] : t.breakpoints;
34
+ }, j = {
35
35
  once: !0,
36
36
  passive: !0
37
- }, b = (t) => t / R, U = {
38
- "sbb-breakpoint-zero-min": b(w),
39
- "sbb-breakpoint-zero-max": b(S),
40
- "sbb-breakpoint-micro-min": b(P),
41
- "sbb-breakpoint-micro-max": b(M),
42
- "sbb-breakpoint-small-min": b(z),
43
- "sbb-breakpoint-small-max": b(B),
44
- "sbb-breakpoint-medium-min": b(O),
45
- "sbb-breakpoint-medium-max": b(F),
46
- "sbb-breakpoint-large-min": b(D),
47
- "sbb-breakpoint-large-max": b(Q),
48
- "sbb-breakpoint-wide-min": b(C),
49
- "sbb-breakpoint-wide-max": b(E),
50
- "sbb-breakpoint-ultra-min": b(L),
51
- "sbb-breakpoint-ultra-max": b(j)
37
+ }, c = (e) => e / I, V = {
38
+ "sbb-breakpoint-zero-min": c(w),
39
+ "sbb-breakpoint-zero-max": c(S),
40
+ "sbb-breakpoint-micro-min": c(P),
41
+ "sbb-breakpoint-micro-max": c(M),
42
+ "sbb-breakpoint-small-min": c(z),
43
+ "sbb-breakpoint-small-max": c(C),
44
+ "sbb-breakpoint-medium-min": c(B),
45
+ "sbb-breakpoint-medium-max": c(L),
46
+ "sbb-breakpoint-large-min": c(O),
47
+ "sbb-breakpoint-large-max": c(Q),
48
+ "sbb-breakpoint-wide-min": c(F),
49
+ "sbb-breakpoint-wide-max": c(D),
50
+ "sbb-breakpoint-ultra-min": c(E),
51
+ "sbb-breakpoint-ultra-max": c(T)
52
52
  };
53
- let a = class extends k {
53
+ let a = class extends _ {
54
54
  constructor() {
55
- super(...arguments), this.c = {
55
+ super(...arguments), this._config = {
56
56
  nonRetinaQuality: "45",
57
57
  retinaQuality: "20"
58
58
  }, this.skipLqip = !1, this.copyrightHolder = "Organization", this.customFocalPoint = !1, this.decoding = "auto", this.focalPointDebug = !1, this.focalPointX = 1, this.focalPointY = 1, this.importance = "high", this.loading = "eager", this.borderRadius = "default", this.aspectRatio = "16-9";
59
59
  }
60
60
  /** Whether the image is finished loading or failed to load. */
61
61
  get complete() {
62
- var t, e, r;
63
- return ((r = (e = (t = this.shadowRoot) == null ? void 0 : t.querySelector) == null ? void 0 : e.call(t, ".sbb-image__img")) == null ? void 0 : r.complete) ?? !1;
62
+ var e, t, r;
63
+ return ((r = (t = (e = this.shadowRoot) == null ? void 0 : e.querySelector) == null ? void 0 : t.call(e, ".sbb-image__img")) == null ? void 0 : r.complete) ?? !1;
64
64
  }
65
65
  connectedCallback() {
66
66
  super.connectedCallback(), this.toggleAttribute(
@@ -68,34 +68,34 @@ let a = class extends k {
68
68
  !!x("sbb-teaser-hero", this) || !!this.closest("sbb-teaser-paid")
69
69
  );
70
70
  }
71
- updated(t) {
72
- super.updated(t), this.a && (this.b = this.a.querySelectorAll("a"), this.b && this.e());
71
+ updated(e) {
72
+ super.updated(e), this._captionElement && (this._linksInCaption = this._captionElement.querySelectorAll("a"), this._linksInCaption && this._addFocusAbilityToLinksInCaption());
73
73
  }
74
- async firstUpdated(t) {
75
- super.firstUpdated(t), await this.updateComplete, this.complete && this.toggleAttribute("data-loaded", !0);
74
+ async firstUpdated(e) {
75
+ super.firstUpdated(e), await this.updateComplete, this.complete && this.toggleAttribute("data-loaded", !0);
76
76
  }
77
- f() {
77
+ _logPerformanceMarks() {
78
78
  this.performanceMark && (performance.clearMarks(this.performanceMark), performance.mark(this.performanceMark));
79
79
  }
80
- g(t) {
81
- const e = U[t];
82
- return e ? `${e}rem` : "";
80
+ _matchMediaQueryDesignToken(e) {
81
+ const t = V[e];
82
+ return t ? `${t}rem` : "";
83
83
  }
84
- e() {
85
- var t;
86
- (t = this.b) == null || t.forEach((e) => {
87
- e.removeAttribute("tabindex");
84
+ _addFocusAbilityToLinksInCaption() {
85
+ var e;
86
+ (e = this._linksInCaption) == null || e.forEach((t) => {
87
+ t.removeAttribute("tabindex");
88
88
  });
89
89
  }
90
- d(t, e = !1) {
91
- if (!t || t === "")
90
+ _prepareImageUrl(e, t = !1) {
91
+ if (!e || e === "")
92
92
  return "";
93
- const r = !!t.match(/^\w+:\/\//), i = r ? new URL(t) : new URL(`http://noop/${t}`);
94
- return e ? (i.searchParams.append("blur", "100"), i.searchParams.append("w", "100"), i.searchParams.append("h", "56")) : i.searchParams.append("auto", "format,compress,cs=tinysrgb"), this.customFocalPoint && (i.searchParams.append("fit", "crop"), i.searchParams.append("crop", "focalpoint"), i.searchParams.append("fp-x", this.focalPointX.toString(10)), i.searchParams.append("fp-y", this.focalPointY.toString(10)), i.searchParams.append("fp-z", "1")), this.focalPointDebug && i.searchParams.append("fp-debug", "true"), r ? i.href : i.pathname.substring(1) + i.search;
93
+ const r = !!e.match(/^\w+:\/\//), i = r ? new URL(e) : new URL(`http://noop/${e}`);
94
+ return t ? (i.searchParams.append("blur", "100"), i.searchParams.append("w", "100"), i.searchParams.append("h", "56")) : i.searchParams.append("auto", "format,compress,cs=tinysrgb"), this.customFocalPoint && (i.searchParams.append("fit", "crop"), i.searchParams.append("crop", "focalpoint"), i.searchParams.append("fp-x", this.focalPointX.toString(10)), i.searchParams.append("fp-y", this.focalPointY.toString(10)), i.searchParams.append("fp-z", "1")), this.focalPointDebug && i.searchParams.append("fp-debug", "true"), r ? i.href : i.pathname.substring(1) + i.search;
95
95
  }
96
- h() {
97
- let t;
98
- return this.pictureSizesConfig ? t = this.pictureSizesConfig : t = `{
96
+ _preparePictureSizeConfigs() {
97
+ let e;
98
+ return this.pictureSizesConfig ? e = this.pictureSizesConfig : e = `{
99
99
  "breakpoints": [
100
100
  {
101
101
  "image": {
@@ -146,25 +146,25 @@ let a = class extends k {
146
146
  ]
147
147
  }
148
148
  ]
149
- }`, V(t);
149
+ }`, H(e);
150
150
  }
151
- i(t) {
152
- let e = "";
153
- return t.forEach((r) => {
151
+ _createMediaQueryString(e) {
152
+ let t = "";
153
+ return e.forEach((r) => {
154
154
  const i = r.conditionFeature;
155
155
  let n;
156
- r.conditionFeatureValue.lyneDesignToken ? n = this.g(r.conditionFeatureValue.value) : n = r.conditionFeatureValue.value;
156
+ r.conditionFeatureValue.lyneDesignToken ? n = this._matchMediaQueryDesignToken(r.conditionFeatureValue.value) : n = r.conditionFeatureValue.value;
157
157
  const p = r.conditionOperator ? ` ${r.conditionOperator} ` : "";
158
- e += `(${i}: ${n})${p}`;
159
- }), e;
158
+ t += `(${i}: ${n})${p}`;
159
+ }), t;
160
160
  }
161
- j() {
162
- this.f(), this.toggleAttribute("data-loaded", !0), this.dispatchEvent(new Event("load"));
161
+ _imageLoaded() {
162
+ this._logPerformanceMarks(), this.toggleAttribute("data-loaded", !0), this.dispatchEvent(new Event("load"));
163
163
  }
164
164
  render() {
165
- let { caption: t } = this, e = "";
166
- const r = this.d(this.imageSrc, !0), i = this.d(this.imageSrc, !1);
167
- this.loading === "lazy" && (this.decoding = "async", this.importance = "low"), this.copyright && (t = `${this.caption} ©${this.copyright}`, e = `{
165
+ let { caption: e } = this, t = "";
166
+ const r = this._prepareImageUrl(this.imageSrc, !0), i = this._prepareImageUrl(this.imageSrc, !1);
167
+ this.loading === "lazy" && (this.decoding = "async", this.importance = "low"), this.copyright && (e = `${this.caption} ©${this.copyright}`, t = `{
168
168
  "@context": "https://schema.org",
169
169
  "@type": "Photograph",
170
170
  "image": "${this.imageSrc}",
@@ -173,11 +173,11 @@ let a = class extends k {
173
173
  "name": "${this.copyright}"
174
174
  }
175
175
  }`);
176
- const n = this.h();
177
- return h`
176
+ const n = this._preparePictureSizeConfigs();
177
+ return d`
178
178
  <figure class="sbb-image__figure">
179
179
  <div class="sbb-image__wrapper">
180
- ${this.skipLqip ? l : h`<img
180
+ ${this.skipLqip ? l : d`<img
181
181
  alt=""
182
182
  class="sbb-image__blurred"
183
183
  src=${r}
@@ -190,18 +190,18 @@ let a = class extends k {
190
190
  <picture>
191
191
  <!-- render picture element sources -->
192
192
  ${n.map((p) => {
193
- const c = p.image.height, m = p.image.width, f = this.i(p.mediaQueries);
193
+ const b = p.image.height, m = p.image.width, f = this._createMediaQueryString(p.mediaQueries);
194
194
  return [
195
- h` <source
195
+ d` <source
196
196
  media=${`${f}`}
197
197
  sizes=${`${m}px`}
198
- srcset=${`${i}&w=${m}&h=${c}&q=${this.c.nonRetinaQuality} ${m}w, ${i}&w=${m * 2}&h=${c * 2}&q=${this.c.retinaQuality} ${m * 2}w`}
198
+ srcset=${`${i}&w=${m}&h=${b}&q=${this._config.nonRetinaQuality} ${m}w, ${i}&w=${m * 2}&h=${b * 2}&q=${this._config.retinaQuality} ${m * 2}w`}
199
199
  ></source>`
200
200
  ];
201
201
  })}
202
202
  <img
203
203
  alt=${this.alt || ""}
204
- @load=${this.j}
204
+ @load=${this._imageLoaded}
205
205
  @error=${() => this.dispatchEvent(new Event("error"))}
206
206
  class="sbb-image__img"
207
207
  src=${this.imageSrc}
@@ -213,19 +213,19 @@ let a = class extends k {
213
213
  />
214
214
  </picture>
215
215
  </div>
216
- ${t ? h`<figcaption
216
+ ${e ? d`<figcaption
217
217
  class="sbb-image__caption"
218
- .innerHTML=${t}
219
- ${_((p) => {
220
- this.a = p;
218
+ .innerHTML=${e}
219
+ ${$((p) => {
220
+ this._captionElement = p;
221
221
  })}
222
222
  ></figcaption>` : l}
223
- ${e ? h(u || (u = A(['<script type="application/ld+json" .innerHTML=', "><\/script>"])), e) : l}
223
+ ${t ? d(g || (g = U(['<script type="application/ld+json" .innerHTML=', "><\/script>"])), t) : l}
224
224
  </figure>
225
225
  `;
226
226
  }
227
227
  };
228
- a.styles = H;
228
+ a.styles = R;
229
229
  a.events = {
230
230
  error: "error",
231
231
  load: "load"
@@ -282,10 +282,10 @@ o([
282
282
  s({ attribute: "aspect-ratio", reflect: !0 })
283
283
  ], a.prototype, "aspectRatio", 2);
284
284
  o([
285
- v(q)
286
- ], a.prototype, "j", 1);
285
+ k(j)
286
+ ], a.prototype, "_imageLoaded", 1);
287
287
  a = o([
288
- $("sbb-image")
288
+ v("sbb-image")
289
289
  ], a);
290
290
  export {
291
291
  a as SbbImageElement
package/journey-header.js CHANGED
@@ -1,26 +1,26 @@
1
- import { css as m, LitElement as d, html as p, nothing as c } from "lit";
2
- import { property as n, customElement as h } from "lit/decorators.js";
1
+ import { css as g, LitElement as m, html as p, nothing as c } from "lit";
2
+ import { property as t, customElement as d } from "lit/decorators.js";
3
3
  import { SbbLanguageController as u } from "./core/controllers.js";
4
- import { getDocumentWritingMode as g } from "./core/dom.js";
4
+ import { getDocumentWritingMode as h } from "./core/dom.js";
5
5
  import { i18nConnectionFrom as y, i18nConnectionTo as f, i18nConnectionRoundtrip as v } from "./core/i18n.js";
6
- import { SbbNegativeMixin as x } from "./core/mixins.js";
6
+ import { SbbNegativeMixin as _ } from "./core/mixins.js";
7
7
  import "./icon.js";
8
8
  import "./screen-reader-only.js";
9
9
  import "./title.js";
10
- const $ = m`*,:before,:after{box-sizing:border-box}:host{--sbb-journey-header-gap: var(--sbb-spacing-fixed-1x);display:block}:host([id]){scroll-margin-block-start:var(--sbb-spacing-fixed-10x)}sbb-title{margin:0}sbb-icon{min-width:var(--sbb-size-icon-ui-small)}.sbb-journey-header{display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--sbb-journey-header-gap);width:fit-content}.sbb-journey-header[dir=rtl] sbb-icon{transform:rotate(-180deg)}`;
11
- var j = Object.defineProperty, w = Object.getOwnPropertyDescriptor, t = (s, o, a, i) => {
12
- for (var r = i > 1 ? void 0 : i ? w(o, a) : o, b = s.length - 1, l; b >= 0; b--)
10
+ const x = g`*,:before,:after{box-sizing:border-box}:host{--sbb-journey-header-gap: var(--sbb-spacing-fixed-1x);display:block}:host([id]){scroll-margin-block-start:var(--sbb-spacing-fixed-10x)}sbb-title{margin:0}sbb-icon{min-width:var(--sbb-size-icon-ui-small)}.sbb-journey-header{display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--sbb-journey-header-gap);width:fit-content}.sbb-journey-header[dir=rtl] sbb-icon{transform:rotate(-180deg)}`;
11
+ var $ = Object.defineProperty, j = Object.getOwnPropertyDescriptor, n = (s, o, a, i) => {
12
+ for (var r = i > 1 ? void 0 : i ? j(o, a) : o, b = s.length - 1, l; b >= 0; b--)
13
13
  (l = s[b]) && (r = (i ? l(o, a, r) : l(r)) || r);
14
- return i && r && j(o, a, r), r;
14
+ return i && r && $(o, a, r), r;
15
15
  };
16
- const _ = /* @__PURE__ */ new Map([
16
+ const w = /* @__PURE__ */ new Map([
17
17
  ["s", "6"],
18
18
  ["m", "5"],
19
19
  ["l", "4"]
20
20
  ]);
21
- let e = class extends x(d) {
21
+ let e = class extends _(m) {
22
22
  constructor() {
23
- super(...arguments), this.level = "3", this.size = "m", this.a = new u(this);
23
+ super(...arguments), this.level = "3", this.size = "m", this._language = new u(this);
24
24
  }
25
25
  render() {
26
26
  const s = this.roundTrip ? "arrows-long-right-left-small" : "arrow-long-right-small";
@@ -28,23 +28,23 @@ let e = class extends x(d) {
28
28
  <sbb-title
29
29
  level=${this.level || c}
30
30
  ?negative=${this.negative}
31
- visual-level=${_.get(this.size)}
31
+ visual-level=${w.get(this.size)}
32
32
  >
33
- <span class="sbb-journey-header" dir=${g()}>
33
+ <span class="sbb-journey-header" dir=${h()}>
34
34
  <span class="sbb-journey-header__origin">
35
35
  <sbb-screen-reader-only>
36
- ${y[this.a.current]}&nbsp;
36
+ ${y[this._language.current]}&nbsp;
37
37
  </sbb-screen-reader-only>
38
38
  ${this.origin}
39
39
  </span>
40
40
  <sbb-icon name=${s}></sbb-icon>
41
41
  <span class="sbb-journey-header__destination">
42
42
  <sbb-screen-reader-only>
43
- &nbsp;${f[this.a.current]}&nbsp;
43
+ &nbsp;${f[this._language.current]}&nbsp;
44
44
  </sbb-screen-reader-only>
45
45
  ${this.destination}
46
46
  ${this.roundTrip ? p` <sbb-screen-reader-only>
47
- ${v(this.origin)[this.a.current]}
47
+ ${v(this.origin)[this._language.current]}
48
48
  </sbb-screen-reader-only>` : c}
49
49
  </span>
50
50
  </span>
@@ -52,24 +52,24 @@ let e = class extends x(d) {
52
52
  `;
53
53
  }
54
54
  };
55
- e.styles = $;
56
- t([
57
- n()
55
+ e.styles = x;
56
+ n([
57
+ t()
58
58
  ], e.prototype, "origin", 2);
59
- t([
60
- n()
59
+ n([
60
+ t()
61
61
  ], e.prototype, "destination", 2);
62
- t([
63
- n({ attribute: "round-trip", type: Boolean })
62
+ n([
63
+ t({ attribute: "round-trip", type: Boolean })
64
64
  ], e.prototype, "roundTrip", 2);
65
- t([
66
- n()
65
+ n([
66
+ t()
67
67
  ], e.prototype, "level", 2);
68
- t([
69
- n({ reflect: !0 })
68
+ n([
69
+ t({ reflect: !0 })
70
70
  ], e.prototype, "size", 2);
71
- e = t([
72
- h("sbb-journey-header")
71
+ e = n([
72
+ d("sbb-journey-header")
73
73
  ], e);
74
74
  export {
75
75
  e as SbbJourneyHeaderElement
package/map-container.js CHANGED
@@ -1,27 +1,27 @@
1
- import { css as m, LitElement as p, html as e, nothing as l } from "lit";
1
+ import { css as m, LitElement as p, html as n, nothing as l } from "lit";
2
2
  import { property as h, state as u, customElement as v } from "lit/decorators.js";
3
3
  import { ref as d } from "lit/directives/ref.js";
4
4
  import { SbbLanguageController as g } from "./core/controllers.js";
5
- import { i18nMapContainerButtonLabel as w } from "./core/i18n.js";
6
- import { AgnosticIntersectionObserver as _ } from "./core/observers.js";
5
+ import { i18nMapContainerButtonLabel as _ } from "./core/i18n.js";
6
+ import { AgnosticIntersectionObserver as w } from "./core/observers.js";
7
7
  import "./button/tertiary-button.js";
8
8
  const f = m`*,:before,:after{box-sizing:border-box}:host{--sbb-map-container-map-height-zero: 18.4375rem;--sbb-map-container-map-height-small: 20rem;--sbb-map-container-sidebar-width: 25rem;--sbb-map-container-sidebar-background-color: var(--sbb-color-white);--sbb-map-container-map-height: calc( var(--sbb-map-container-map-height-zero) + var(--sbb-border-radius-4x) );--sbb-map-container-border-radius: var(--sbb-border-radius-4x);--sbb-map-container-animation-duration: var(--sbb-animation-duration-4x);display:block}@media (min-width: 37.5rem){:host{--sbb-map-container-map-height: calc( var(--sbb-map-container-map-height-small) + var(--sbb-map-container-border-radius) )}}@media (min-width: 80rem){:host{--sbb-map-container-sidebar-width: 30rem}}.sbb-map-container{display:grid;grid-template-rows:auto auto;height:100%}@media (min-width: 52.5rem){.sbb-map-container{grid-template-columns:max(var(--sbb-map-container-sidebar-width)) calc(100% - var(--sbb-map-container-sidebar-width));height:calc(100vh - var(--sbb-map-container-margin-start, var(--sbb-header-height)));overflow:hidden}}.sbb-map-container__sidebar-button{position:fixed;left:50%;inset-block-end:var(--sbb-spacing-fixed-5x);visibility:hidden;opacity:0;transform:translate(-50%) translateY(calc(100% + var(--sbb-spacing-fixed-5x)));transition:opacity var(--sbb-map-container-animation-duration) var(--sbb-animation-easing),visibility var(--sbb-map-container-animation-duration) var(--sbb-animation-easing) var(--sbb-map-container-animation-duration),transform var(--sbb-map-container-animation-duration) var(--sbb-animation-easing)}:host([data-scroll-up-button-visible]) .sbb-map-container__sidebar-button{transition:visibility var(--sbb-map-container-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-map-container-animation-duration) var(--sbb-animation-easing),transform var(--sbb-map-container-animation-duration) ease-out;visibility:visible;opacity:1;transform:translate(-50%) translateY(0)}@media (min-width: 52.5rem){.sbb-map-container__sidebar-button{display:none}}.sbb-map-container__sidebar{--sbb-scrollbar-thumb-width: .5rem;--sbb-scrollbar-thumb-width-hover: var(--sbb-scrollbar-thumb-width);--sbb-scrollbar-width-firefox: auto;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: var(--sbb-color-cloud);--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x);grid-column:1/3;grid-row:2/3;width:100%;height:calc(100% + var(--sbb-map-container-border-radius));overflow:hidden auto;position:relative;z-index:2;border-start-end-radius:var(--sbb-map-container-border-radius);border-start-start-radius:var(--sbb-map-container-border-radius);margin-block-start:calc(var(--sbb-map-container-border-radius) * -1);background-color:var(--sbb-map-container-sidebar-background-color)}.sbb-map-container__sidebar::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-map-container__sidebar::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-map-container__sidebar::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-map-container__sidebar::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-map-container__sidebar::-webkit-scrollbar-button,.sbb-map-container__sidebar::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-map-container__sidebar{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}@media (min-width: 52.5rem){.sbb-map-container__sidebar{grid-column:1/2;grid-row:1/3;border-radius:0;margin-block-start:0;border-block-start:var(--sbb-border-width-1x) solid var(--sbb-color-cloud)}}.sbb-map-container__map{position:sticky;inset-block-start:0;inset-inline:0;z-index:1;grid-row:1/2;grid-column:1/3;height:var(--sbb-map-container-map-height)}@media (min-width: 52.5rem){.sbb-map-container__map{grid-row:1/3;grid-column:2/3;height:100%;position:relative}}`;
9
- var k = Object.defineProperty, x = Object.getOwnPropertyDescriptor, c = (r, t, i, b) => {
10
- for (var a = b > 1 ? void 0 : b ? x(t, i) : t, s = r.length - 1, n; s >= 0; s--)
11
- (n = r[s]) && (a = (b ? n(t, i, a) : n(a)) || a);
9
+ var k = Object.defineProperty, y = Object.getOwnPropertyDescriptor, c = (r, t, i, b) => {
10
+ for (var a = b > 1 ? void 0 : b ? y(t, i) : t, s = r.length - 1, e; s >= 0; s--)
11
+ (e = r[s]) && (a = (b ? e(t, i, a) : e(a)) || a);
12
12
  return b && a && k(t, i, a), a;
13
13
  };
14
14
  let o = class extends p {
15
15
  constructor() {
16
- super(...arguments), this.hideScrollUpButton = !1, this.c = !1, this.e = new g(this), this.b = new _(
17
- (r) => this.f(r)
16
+ super(...arguments), this.hideScrollUpButton = !1, this._scrollUpButtonVisible = !1, this._language = new g(this), this._observer = new w(
17
+ (r) => this._toggleButtonVisibilityOnIntersect(r)
18
18
  );
19
19
  }
20
20
  /**
21
21
  * Button click callback to trigger the scroll to container top
22
22
  * @private
23
23
  */
24
- g() {
24
+ _onScrollButtonClick() {
25
25
  this.scrollIntoView({ behavior: "smooth" });
26
26
  }
27
27
  /**
@@ -29,44 +29,44 @@ let o = class extends p {
29
29
  * @param entries
30
30
  * @private
31
31
  */
32
- f(r) {
32
+ _toggleButtonVisibilityOnIntersect(r) {
33
33
  r.forEach((t) => {
34
34
  const i = !t.isIntersecting;
35
- this.toggleAttribute("data-scroll-up-button-visible", i), this.c = i;
35
+ this.toggleAttribute("data-scroll-up-button-visible", i), this._scrollUpButtonVisible = i;
36
36
  });
37
37
  }
38
38
  connectedCallback() {
39
- super.connectedCallback(), this.d();
39
+ super.connectedCallback(), this._updateIntersectionObserver();
40
40
  }
41
- d() {
42
- this.b.disconnect(), !this.hideScrollUpButton && this.a && this.b.observe(this.a);
41
+ _updateIntersectionObserver() {
42
+ this._observer.disconnect(), !this.hideScrollUpButton && this._intersector && this._observer.observe(this._intersector);
43
43
  }
44
44
  disconnectedCallback() {
45
- super.disconnectedCallback(), this.b.disconnect();
45
+ super.disconnectedCallback(), this._observer.disconnect();
46
46
  }
47
47
  render() {
48
- return e`
48
+ return n`
49
49
  <div class="sbb-map-container">
50
50
  <div class="sbb-map-container__sidebar">
51
- ${this.hideScrollUpButton ? l : e`<span
51
+ ${this.hideScrollUpButton ? l : n`<span
52
52
  ${d((r) => {
53
- this.a !== r && (this.a = r, this.d());
53
+ this._intersector !== r && (this._intersector = r, this._updateIntersectionObserver());
54
54
  })}
55
55
  ></span>`}
56
56
 
57
57
  <slot></slot>
58
58
 
59
- ${this.hideScrollUpButton ? l : e`<sbb-tertiary-button
59
+ ${this.hideScrollUpButton ? l : n`<sbb-tertiary-button
60
60
  class="sbb-map-container__sidebar-button"
61
61
  size="l"
62
62
  icon-name="location-pin-map-small"
63
63
  type="button"
64
- @click=${() => this.g()}
64
+ @click=${() => this._onScrollButtonClick()}
65
65
  ${d((r) => {
66
- r && (r.inert = !this.c);
66
+ r && (r.inert = !this._scrollUpButtonVisible);
67
67
  })}
68
68
  >
69
- ${w[this.e.current]}
69
+ ${_[this._language.current]}
70
70
  </sbb-tertiary-button>`}
71
71
  </div>
72
72
  <div class="sbb-map-container__map">
@@ -82,7 +82,7 @@ c([
82
82
  ], o.prototype, "hideScrollUpButton", 2);
83
83
  c([
84
84
  u()
85
- ], o.prototype, "c", 2);
85
+ ], o.prototype, "_scrollUpButtonVisible", 2);
86
86
  o = c([
87
87
  v("sbb-map-container")
88
88
  ], o);