@sbb-esta/lyne-elements-experimental 0.52.1 → 0.53.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.
package/core/timetable.js CHANGED
@@ -1,7 +1,7 @@
1
- import { i18nWalkingDistanceDeparture as k, i18nWalkingDistanceArrival as A } from "@sbb-esta/lyne-elements/core/i18n.js";
1
+ import { i18nWalkingDistanceDeparture as k, i18nWalkingDistanceArrival as y } from "@sbb-esta/lyne-elements/core/i18n.js";
2
2
  import { html as b, nothing as m } from "lit";
3
3
  import "@sbb-esta/lyne-elements/icon.js";
4
- const x = (t) => (t == null ? void 0 : t.a) === "PTRideLeg", h = (t) => (t == null ? void 0 : t.a) === "PTConnectionLeg", C = (t) => {
4
+ const x = (t) => (t == null ? void 0 : t.__typename) === "PTRideLeg", _ = (t) => (t == null ? void 0 : t.__typename) === "PTConnectionLeg", A = (t) => {
5
5
  var n, r, u, s, a, o;
6
6
  const i = ((n = t == null ? void 0 : t.text) == null ? void 0 : n.template) && t.text.template.indexOf("(") + 1, e = (s = (r = t == null ? void 0 : t.text) == null ? void 0 : r.template) == null ? void 0 : s.substring(
7
7
  i || 0,
@@ -14,7 +14,7 @@ const x = (t) => (t == null ? void 0 : t.a) === "PTRideLeg", h = (t) => (t == nu
14
14
  };
15
15
  function w(t, i) {
16
16
  var r, u;
17
- const e = h(t) ? t : null, n = e ? (r = e == null ? void 0 : e.notices) == null ? void 0 : r.filter((s) => i.includes(s.name))[0] : null;
17
+ const e = _(t) ? t : null, n = e ? (r = e == null ? void 0 : e.notices) == null ? void 0 : r.filter((s) => i.includes(s.name))[0] : null;
18
18
  return n ? {
19
19
  duration: (e == null ? void 0 : e.duration) || 0,
20
20
  text: ((u = n == null ? void 0 : n.text) == null ? void 0 : u.template) || "",
@@ -25,7 +25,7 @@ function R(t, i) {
25
25
  var r, u, s;
26
26
  const e = x(t) ? (u = (r = t == null ? void 0 : t.serviceJourney) == null ? void 0 : r.notices) == null ? void 0 : u.filter(
27
27
  (a) => ["CI"].includes(a.name)
28
- )[0] : null, n = e && C(e);
28
+ )[0] : null, n = e && A(e);
29
29
  return e ? {
30
30
  duration: ((n == null ? void 0 : n.duration) || 0) + (i || 0),
31
31
  text: (n == null ? void 0 : n.text) || "",
@@ -36,7 +36,7 @@ function Y(t, i) {
36
36
  var r, u, s;
37
37
  const e = x(t) ? (u = (r = t == null ? void 0 : t.serviceJourney) == null ? void 0 : r.notices) == null ? void 0 : u.filter(
38
38
  (a) => ["CO"].includes(a.name)
39
- )[0] : null, n = e && C(e);
39
+ )[0] : null, n = e && A(e);
40
40
  return e ? {
41
41
  duration: ((n == null ? void 0 : n.duration) || 0) + (i || 0),
42
42
  text: (n == null ? void 0 : n.text) || "",
@@ -49,7 +49,7 @@ function T(t, i, e, n, r) {
49
49
  <sbb-icon name=${i}></sbb-icon>
50
50
  <time datetime=${t + "M"}>
51
51
  <span class="sbb-screen-reader-only">
52
- ${!n && r ? r === "departure" ? k[e] : A[e] : m}
52
+ ${!n && r ? r === "departure" ? k[e] : y[e] : m}
53
53
  ${n ? b`<span>${n}</span>` : m}&nbsp;
54
54
  </span>
55
55
  ${t}
@@ -72,12 +72,12 @@ function f(t, i, e) {
72
72
  `;
73
73
  }
74
74
  function E(t, i, e, n) {
75
- const r = t && t.filter((_) => x(_) || h(_))[0], u = ["YM", "YB", "Y", "YT"], s = w(r, u), a = R(r, i), o = i ? {
75
+ const r = t && t.filter((h) => x(h) || _(h))[0], u = ["YM", "YB", "Y", "YT"], s = w(r, u), a = R(r, i), o = i ? {
76
76
  text: k[n],
77
77
  duration: i,
78
78
  icon: "walk-small"
79
- } : null, L = () => s || (o && !a && !s ? o : a || null);
80
- function v() {
79
+ } : null, C = () => s || (o && !a && !s ? o : a || null);
80
+ function L() {
81
81
  return b`
82
82
  ${s ? f(s.duration, s.text, "left") : m}
83
83
  ${o && !a && !s ? f(o.duration, o.text, "left") : m}
@@ -90,11 +90,11 @@ function E(t, i, e, n) {
90
90
  ) : m}
91
91
  `;
92
92
  }
93
- const $ = t && t[t.length - 1], d = (h($) || x($)) && $, c = d && w(d, u), l = d && Y(d, e), p = e ? {
94
- text: A[n],
93
+ const $ = t && t[t.length - 1], d = (_($) || x($)) && $, c = d && w(d, u), l = d && Y(d, e), p = e ? {
94
+ text: y[n],
95
95
  duration: e,
96
96
  icon: "walk-small"
97
- } : null, y = () => c || (p && !l && !c ? p : l || null);
97
+ } : null, v = () => c || (p && !l && !c ? p : l || null);
98
98
  function D() {
99
99
  return b`
100
100
  ${c ? f(c.duration, c.text, "right") : m}
@@ -109,15 +109,15 @@ function E(t, i, e, n) {
109
109
  `;
110
110
  }
111
111
  return {
112
- renderDepartureTimeAttribute: v,
112
+ renderDepartureTimeAttribute: L,
113
113
  renderArrivalTimeAttribute: D,
114
- departureTimeAttribute: L(),
115
- arrivalTimeAttribute: y()
114
+ departureTimeAttribute: C(),
115
+ arrivalTimeAttribute: v()
116
116
  };
117
117
  }
118
118
  export {
119
- C as extractTimeAndStringFromNoticeText,
119
+ A as extractTimeAndStringFromNoticeText,
120
120
  E as getDepartureArrivalTimeAttribute,
121
- h as isConnectionLeg,
121
+ _ as isConnectionLeg,
122
122
  x as isRideLeg
123
123
  };
@@ -811,6 +811,190 @@
811
811
  }
812
812
  ]
813
813
  },
814
+ {
815
+ "kind": "javascript-module",
816
+ "path": "teaser-hero.js",
817
+ "declarations": [
818
+ {
819
+ "kind": "class",
820
+ "description": "It displays an image and an action call within a panel.",
821
+ "name": "SbbTeaserHeroElement",
822
+ "slots": [
823
+ {
824
+ "description": "Use the unnamed slot to add text content to the panel",
825
+ "name": ""
826
+ },
827
+ {
828
+ "description": "Link content of the panel",
829
+ "name": "link-content"
830
+ },
831
+ {
832
+ "description": "The background image that can be a `sbb-image`",
833
+ "name": "image"
834
+ }
835
+ ],
836
+ "members": [
837
+ {
838
+ "kind": "field",
839
+ "name": "linkContent",
840
+ "type": {
841
+ "text": "string | undefined"
842
+ },
843
+ "privacy": "public",
844
+ "description": "Panel link text.",
845
+ "attribute": "link-content"
846
+ },
847
+ {
848
+ "kind": "field",
849
+ "name": "imageSrc",
850
+ "type": {
851
+ "text": "string | undefined"
852
+ },
853
+ "privacy": "public",
854
+ "description": "Image src will be passed to `sbb-image`.",
855
+ "attribute": "image-src"
856
+ },
857
+ {
858
+ "kind": "field",
859
+ "name": "imageAlt",
860
+ "type": {
861
+ "text": "string | undefined"
862
+ },
863
+ "privacy": "public",
864
+ "description": "Image alt text will be passed to `sbb-image`.",
865
+ "attribute": "image-alt"
866
+ },
867
+ {
868
+ "kind": "method",
869
+ "name": "renderTemplate",
870
+ "privacy": "protected",
871
+ "return": {
872
+ "type": {
873
+ "text": "TemplateResult"
874
+ }
875
+ }
876
+ }
877
+ ],
878
+ "attributes": [
879
+ {
880
+ "name": "link-content",
881
+ "type": {
882
+ "text": "string | undefined"
883
+ },
884
+ "description": "Panel link text.",
885
+ "fieldName": "linkContent"
886
+ },
887
+ {
888
+ "name": "image-src",
889
+ "type": {
890
+ "text": "string | undefined"
891
+ },
892
+ "description": "Image src will be passed to `sbb-image`.",
893
+ "fieldName": "imageSrc"
894
+ },
895
+ {
896
+ "name": "image-alt",
897
+ "type": {
898
+ "text": "string | undefined"
899
+ },
900
+ "description": "Image alt text will be passed to `sbb-image`.",
901
+ "fieldName": "imageAlt"
902
+ }
903
+ ],
904
+ "superclass": {
905
+ "name": "SbbLinkBaseElement",
906
+ "package": "@sbb-esta/lyne-elements/core/base-elements.js"
907
+ },
908
+ "tagName": "sbb-teaser-hero",
909
+ "customElement": true
910
+ }
911
+ ],
912
+ "exports": [
913
+ {
914
+ "kind": "js",
915
+ "name": "SbbTeaserHeroElement",
916
+ "declaration": {
917
+ "name": "SbbTeaserHeroElement",
918
+ "module": "teaser-hero.js"
919
+ }
920
+ },
921
+ {
922
+ "kind": "custom-element-definition",
923
+ "name": "sbb-teaser-hero",
924
+ "declaration": {
925
+ "name": "SbbTeaserHeroElement",
926
+ "module": "teaser-hero.js"
927
+ }
928
+ }
929
+ ]
930
+ },
931
+ {
932
+ "kind": "javascript-module",
933
+ "path": "teaser-paid.js",
934
+ "declarations": [
935
+ {
936
+ "kind": "class",
937
+ "description": "It displays an image and a chip with a text.",
938
+ "name": "SbbTeaserPaidElement",
939
+ "slots": [
940
+ {
941
+ "description": "Link content of the panel",
942
+ "name": "chip"
943
+ },
944
+ {
945
+ "description": "The background image that can be a `sbb-image`",
946
+ "name": "image"
947
+ }
948
+ ],
949
+ "members": [
950
+ {
951
+ "kind": "method",
952
+ "name": "_chipSlotChanged",
953
+ "privacy": "private",
954
+ "return": {
955
+ "type": {
956
+ "text": "void"
957
+ }
958
+ }
959
+ },
960
+ {
961
+ "kind": "method",
962
+ "name": "renderTemplate",
963
+ "privacy": "protected",
964
+ "return": {
965
+ "type": {
966
+ "text": "TemplateResult"
967
+ }
968
+ }
969
+ }
970
+ ],
971
+ "superclass": {
972
+ "name": "SbbLinkBaseElement",
973
+ "package": "@sbb-esta/lyne-elements/core/base-elements.js"
974
+ },
975
+ "tagName": "sbb-teaser-paid",
976
+ "customElement": true
977
+ }
978
+ ],
979
+ "exports": [
980
+ {
981
+ "kind": "js",
982
+ "name": "SbbTeaserPaidElement",
983
+ "declaration": {
984
+ "name": "SbbTeaserPaidElement",
985
+ "module": "teaser-paid.js"
986
+ }
987
+ },
988
+ {
989
+ "kind": "custom-element-definition",
990
+ "name": "sbb-teaser-paid",
991
+ "declaration": {
992
+ "name": "SbbTeaserPaidElement",
993
+ "module": "teaser-paid.js"
994
+ }
995
+ }
996
+ ]
997
+ },
814
998
  {
815
999
  "kind": "javascript-module",
816
1000
  "path": "timetable-duration.js",
@@ -0,0 +1,26 @@
1
+ import { SbbLinkBaseElement } from '@sbb-esta/lyne-elements/core/base-elements.js';
2
+ import { CSSResultGroup, TemplateResult } from 'lit';
3
+
4
+ /**
5
+ * It displays an image and an action call within a panel.
6
+ *
7
+ * @slot - Use the unnamed slot to add text content to the panel
8
+ * @slot link-content - Link content of the panel
9
+ * @slot image - The background image that can be a `sbb-image`
10
+ */
11
+ export declare class SbbTeaserHeroElement extends SbbLinkBaseElement {
12
+ static styles: CSSResultGroup;
13
+ /** Panel link text. */
14
+ linkContent?: string;
15
+ /** Image src will be passed to `sbb-image`. */
16
+ imageSrc?: string;
17
+ /** Image alt text will be passed to `sbb-image`. */
18
+ imageAlt?: string;
19
+ protected renderTemplate(): TemplateResult;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'sbb-teaser-hero': SbbTeaserHeroElement;
24
+ }
25
+ }
26
+ //# sourceMappingURL=teaser-hero.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teaser-hero.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/teaser-hero/teaser-hero.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,KAAK,cAAc,EAAW,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAMxE,OAAO,kCAAkC,CAAC;AAC1C,OAAO,mDAAmD,CAAC;AAE3D;;;;;;GAMG;AACH,qBACa,oBAAqB,SAAQ,kBAAkB;IAC1D,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,uBAAuB;IACyB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErE,+CAA+C;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE/D,oDAAoD;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;cAE5C,cAAc,IAAI,cAAc;CAyBpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,iBAAiB,EAAE,oBAAoB,CAAC;KACzC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from './teaser-hero/teaser-hero.js';
2
+ //# sourceMappingURL=teaser-hero.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teaser-hero.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/teaser-hero.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,181 @@
1
+ import { SbbLinkBaseElement } from "@sbb-esta/lyne-elements/core/base-elements.js";
2
+ import { css, nothing } from "lit";
3
+ import { property, customElement } from "lit/decorators.js";
4
+ import { html } from "lit/static-html.js";
5
+ import "@sbb-esta/lyne-elements/image.js";
6
+ import "@sbb-esta/lyne-elements/link/block-link-static.js";
7
+ const style = css`/**
8
+ * Better font rendering (on OS X)
9
+ * http://maximilianhoffmann.com/posts/better-font-rendering-on-osx
10
+ *
11
+ * Usage:
12
+ *
13
+ * .var_dark_on_light {
14
+ * @include font-smoothing;
15
+ * }
16
+ * .var_light_on_dark {
17
+ * @include font-smoothing-reset;
18
+ * }
19
+ */
20
+ /** This mixin can be used to avoid spacing problems by inserting an invisible space as pseudo element. */
21
+ *,
22
+ ::before,
23
+ ::after {
24
+ box-sizing: border-box;
25
+ }
26
+
27
+ :host {
28
+ display: block;
29
+ outline: none !important;
30
+ --sbb-panel-width: 13.9375rem;
31
+ --sbb-panel-inner-height: 10.4375rem;
32
+ --sbb-panel-triangle-height: 2.0625rem;
33
+ --sbb-panel-height: calc(var(--sbb-panel-inner-height) + 2 * var(--sbb-panel-triangle-height));
34
+ --sbb-panel-line-height: var(--sbb-typo-line-height-titles);
35
+ --sbb-panel-font-size: var(--sbb-typo-scale-1-5x);
36
+ --sbb-panel-color: var(--sbb-color-white);
37
+ --sbb-panel-background-color: var(--sbb-color-red-alpha-90);
38
+ --sbb-panel-background-color-hover: var(--sbb-color-red);
39
+ --sbb-panel-padding-inline: var(--sbb-spacing-responsive-m);
40
+ --sbb-panel-gap: var(--sbb-spacing-responsive-xs);
41
+ --sbb-panel-animation-duration: var(
42
+ --sbb-disable-animation-zero-time,
43
+ var(--sbb-animation-duration-4x)
44
+ );
45
+ --sbb-panel-animation-easing: var(--sbb-animation-easing);
46
+ --sbb-teaser-hero-brightness-hover: 1.075;
47
+ }
48
+ @media (min-width: calc(52.5rem)) {
49
+ :host {
50
+ --sbb-panel-width: 20.0625rem;
51
+ --sbb-panel-inner-height: 15.006875rem;
52
+ --sbb-panel-triangle-height: 2.965625rem;
53
+ --sbb-panel-font-size: var(--sbb-typo-scale-2x);
54
+ }
55
+ }
56
+ @media (min-width: calc(64rem)) {
57
+ :host {
58
+ --sbb-panel-width: 26.75rem;
59
+ --sbb-panel-inner-height: 20.02375rem;
60
+ --sbb-panel-triangle-height: 3.956875rem;
61
+ --sbb-panel-font-size: var(--sbb-typo-scale-2-5x);
62
+ --sbb-panel-line-height: 1.2;
63
+ }
64
+ }
65
+
66
+ @media (any-hover: hover) {
67
+ :host(:hover) {
68
+ --sbb-panel-background-color: var(--sbb-panel-background-color-hover);
69
+ --sbb-teaser-hero-brightness: var(--sbb-teaser-hero-brightness-hover);
70
+ }
71
+ }
72
+ .sbb-teaser-hero {
73
+ position: relative;
74
+ display: block;
75
+ min-height: var(--sbb-panel-height);
76
+ }
77
+ :host(:not([data-focus-origin=mouse], [data-focus-origin=touch])) .sbb-teaser-hero:focus-visible {
78
+ outline-offset: var(--sbb-focus-outline-offset);
79
+ outline: var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);
80
+ }
81
+
82
+ .sbb-teaser-hero__panel {
83
+ position: relative;
84
+ display: flex;
85
+ flex-direction: column;
86
+ justify-content: center;
87
+ gap: var(--sbb-panel-gap);
88
+ width: var(--sbb-panel-width);
89
+ height: var(--sbb-panel-height);
90
+ padding-block: var(--sbb-panel-triangle-height);
91
+ padding-inline: var(--sbb-panel-padding-inline);
92
+ clip-path: polygon(0 0, 100% var(--sbb-panel-triangle-height), 100% calc(100% - var(--sbb-panel-triangle-height)), 0% 100%);
93
+ background-color: var(--sbb-panel-background-color);
94
+ transition: background var(--sbb-panel-animation-duration) var(--sbb-panel-animation-easing);
95
+ position: absolute;
96
+ top: 50%;
97
+ transform: translateY(-50%);
98
+ z-index: 1;
99
+ }
100
+ @media (any-hover: hover) {
101
+ .sbb-teaser-hero__panel:hover {
102
+ --sbb-panel-background-color: var(--sbb-panel-background-color-hover);
103
+ }
104
+ }
105
+
106
+ .sbb-teaser-hero__panel-text {
107
+ -webkit-font-smoothing: antialiased;
108
+ -moz-osx-font-smoothing: grayscale;
109
+ font-family: var(--sbb-typo-font-family);
110
+ font-size: var(--sbb-panel-font-size);
111
+ font-weight: 300;
112
+ line-height: var(--sbb-panel-line-height);
113
+ letter-spacing: var(--sbb-typo-letter-spacing-titles);
114
+ color: var(--sbb-panel-color);
115
+ hyphens: auto;
116
+ display: inline;
117
+ margin: 0;
118
+ padding: 0;
119
+ }
120
+
121
+ .sbb-teaser-hero__panel-link {
122
+ -webkit-font-smoothing: antialiased;
123
+ -moz-osx-font-smoothing: grayscale;
124
+ }
125
+
126
+ ::slotted([slot=image]),
127
+ sbb-image {
128
+ will-change: filter;
129
+ filter: brightness(var(--sbb-teaser-hero-brightness, 1));
130
+ transition: filter var(--sbb-panel-animation-duration) var(--sbb-panel-animation-easing);
131
+ }`;
132
+ var __defProp = Object.defineProperty;
133
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
134
+ var __decorateClass = (decorators, target, key, kind) => {
135
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
136
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
137
+ if (decorator = decorators[i])
138
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
139
+ if (kind && result) __defProp(target, key, result);
140
+ return result;
141
+ };
142
+ let SbbTeaserHeroElement = class extends SbbLinkBaseElement {
143
+ renderTemplate() {
144
+ return html`
145
+ <span class="sbb-teaser-hero__panel">
146
+ <p class="sbb-teaser-hero__panel-text">
147
+ <slot></slot>
148
+ </p>
149
+ ${this.href ? html`<sbb-block-link-static
150
+ class="sbb-teaser-hero__panel-link"
151
+ icon-name="chevron-small-right-small"
152
+ icon-placement="end"
153
+ size="m"
154
+ negative
155
+ >
156
+ <slot name="link-content">${this.linkContent}</slot>
157
+ </sbb-block-link-static>` : nothing}
158
+ </span>
159
+ <slot name="image">
160
+ ${this.imageSrc ? html`<sbb-image image-src=${this.imageSrc} alt=${this.imageAlt ?? nothing}></sbb-image>` : nothing}
161
+ </slot>
162
+ `;
163
+ }
164
+ };
165
+ SbbTeaserHeroElement.styles = style;
166
+ __decorateClass([
167
+ property({ attribute: "link-content" })
168
+ ], SbbTeaserHeroElement.prototype, "linkContent", 2);
169
+ __decorateClass([
170
+ property({ attribute: "image-src" })
171
+ ], SbbTeaserHeroElement.prototype, "imageSrc", 2);
172
+ __decorateClass([
173
+ property({ attribute: "image-alt" })
174
+ ], SbbTeaserHeroElement.prototype, "imageAlt", 2);
175
+ SbbTeaserHeroElement = __decorateClass([
176
+ customElement("sbb-teaser-hero")
177
+ ], SbbTeaserHeroElement);
178
+ export {
179
+ SbbTeaserHeroElement
180
+ };
181
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVhc2VyLWhlcm8uanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbGVtZW50cy1leHBlcmltZW50YWwvdGVhc2VyLWhlcm8vdGVhc2VyLWhlcm8udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgU2JiTGlua0Jhc2VFbGVtZW50IH0gZnJvbSAnQHNiYi1lc3RhL2x5bmUtZWxlbWVudHMvY29yZS9iYXNlLWVsZW1lbnRzLmpzJztcbmltcG9ydCB7IHR5cGUgQ1NTUmVzdWx0R3JvdXAsIG5vdGhpbmcsIHR5cGUgVGVtcGxhdGVSZXN1bHQgfSBmcm9tICdsaXQnO1xuaW1wb3J0IHsgY3VzdG9tRWxlbWVudCwgcHJvcGVydHkgfSBmcm9tICdsaXQvZGVjb3JhdG9ycy5qcyc7XG5pbXBvcnQgeyBodG1sIH0gZnJvbSAnbGl0L3N0YXRpYy1odG1sLmpzJztcblxuaW1wb3J0IHN0eWxlIGZyb20gJy4vdGVhc2VyLWhlcm8uc2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BQVcsZ0JBQWdCO0FBQUEsR0FKNUIscUJBSXFDLFdBQUEsZUFBQSxDQUFBO0FBR0gsZ0JBQUE7QUFBQSxFQUE1QyxTQUFTLEVBQUUsV0FBVyxhQUFhO0FBQUEsR0FQekIscUJBT2tDLFdBQUEsWUFBQSxDQUFBO0FBR0EsZ0JBQUE7QUFBQSxFQUE1QyxTQUFTLEVBQUUsV0FBVyxhQUFhO0FBQUEsR0FWekIscUJBVWtDLFdBQUEsWUFBQSxDQUFBO0FBVmxDLHVCQUFOLGdCQUFBO0FBQUEsRUFETixjQUFjLGlCQUFpQjtBQUFBLEdBQ25CLG9CQUFBOyJ9
@@ -0,0 +1,20 @@
1
+ import { SbbLinkBaseElement } from '@sbb-esta/lyne-elements/core/base-elements.js';
2
+ import { CSSResultGroup, TemplateResult } from 'lit';
3
+
4
+ /**
5
+ * It displays an image and a chip with a text.
6
+ *
7
+ * @slot chip - Link content of the panel
8
+ * @slot image - The background image that can be a `sbb-image`
9
+ */
10
+ export declare class SbbTeaserPaidElement extends SbbLinkBaseElement {
11
+ static styles: CSSResultGroup;
12
+ private _chipSlotChanged;
13
+ protected renderTemplate(): TemplateResult;
14
+ }
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'sbb-teaser-paid': SbbTeaserPaidElement;
18
+ }
19
+ }
20
+ //# sourceMappingURL=teaser-paid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teaser-paid.d.ts","sourceRoot":"","sources":["../../../../src/elements-experimental/teaser-paid/teaser-paid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAQ,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAKrE;;;;;GAKG;AACH,qBACa,oBAAqB,SAAQ,kBAAkB;IAC1D,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD,OAAO,CAAC,gBAAgB;cAIL,cAAc,IAAI,cAAc;CAMpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,iBAAiB,EAAE,oBAAoB,CAAC;KACzC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from './teaser-paid/teaser-paid.js';
2
+ //# sourceMappingURL=teaser-paid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teaser-paid.d.ts","sourceRoot":"","sources":["../../../src/elements-experimental/teaser-paid.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,91 @@
1
+ import { SbbLinkBaseElement } from "@sbb-esta/lyne-elements/core/base-elements.js";
2
+ import { css, html } from "lit";
3
+ import { customElement } from "lit/decorators.js";
4
+ const style = css`/**
5
+ * Better font rendering (on OS X)
6
+ * http://maximilianhoffmann.com/posts/better-font-rendering-on-osx
7
+ *
8
+ * Usage:
9
+ *
10
+ * .var_dark_on_light {
11
+ * @include font-smoothing;
12
+ * }
13
+ * .var_light_on_dark {
14
+ * @include font-smoothing-reset;
15
+ * }
16
+ */
17
+ /** This mixin can be used to avoid spacing problems by inserting an invisible space as pseudo element. */
18
+ *,
19
+ ::before,
20
+ ::after {
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ :host {
25
+ display: block;
26
+ outline: none !important;
27
+ --sbb-teaser-paid-chip-inset: var(--sbb-spacing-responsive-xxxs) auto auto
28
+ var(--sbb-spacing-responsive-xxxs);
29
+ --sbb-teaser-paid-brightness-hover: 1.075;
30
+ --sbb-teaser-paid-animation-duration: var(
31
+ --sbb-disable-animation-zero-time,
32
+ var(--sbb-animation-duration-4x)
33
+ );
34
+ --sbb-teaser-paid-animation-easing: var(--sbb-animation-easing);
35
+ }
36
+
37
+ @media (any-hover: hover) {
38
+ :host(:hover) {
39
+ --sbb-teaser-paid-brightness: var(--sbb-teaser-paid-brightness-hover);
40
+ }
41
+ }
42
+ .sbb-teaser-paid {
43
+ position: relative;
44
+ display: block;
45
+ }
46
+ :host(:not([data-focus-origin=mouse], [data-focus-origin=touch])) .sbb-teaser-paid:focus-visible {
47
+ outline-offset: var(--sbb-focus-outline-offset);
48
+ outline: var(--sbb-focus-outline-color) solid var(--sbb-focus-outline-width);
49
+ }
50
+
51
+ ::slotted([slot=chip]) {
52
+ position: absolute;
53
+ inset: var(--sbb-teaser-paid-chip-inset);
54
+ z-index: 1;
55
+ }
56
+
57
+ ::slotted([slot=image]) {
58
+ will-change: filter;
59
+ filter: brightness(var(--sbb-teaser-paid-brightness, 1));
60
+ transition: filter var(--sbb-teaser-paid-animation-duration) var(--sbb-teaser-paid-animation-easing);
61
+ }`;
62
+ var __defProp = Object.defineProperty;
63
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
64
+ var __decorateClass = (decorators, target, key, kind) => {
65
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
66
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
67
+ if (decorator = decorators[i])
68
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
69
+ if (kind && result) __defProp(target, key, result);
70
+ return result;
71
+ };
72
+ let SbbTeaserPaidElement = class extends SbbLinkBaseElement {
73
+ _chipSlotChanged() {
74
+ var _a;
75
+ (_a = this.querySelector("sbb-chip")) == null ? void 0 : _a.setAttribute("color", "charcoal");
76
+ }
77
+ renderTemplate() {
78
+ return html`
79
+ <slot name="chip" @slotchange=${() => this._chipSlotChanged()}></slot>
80
+ <slot name="image"></slot>
81
+ `;
82
+ }
83
+ };
84
+ SbbTeaserPaidElement.styles = style;
85
+ SbbTeaserPaidElement = __decorateClass([
86
+ customElement("sbb-teaser-paid")
87
+ ], SbbTeaserPaidElement);
88
+ export {
89
+ SbbTeaserPaidElement
90
+ };
91
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVhc2VyLXBhaWQuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbGVtZW50cy1leHBlcmltZW50YWw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eElement } from "./pearl-chain-time.js";
4
4
  import { SbbPearlChainVerticalElement } from "./pearl-chain-vertical.js";
5
5
  import { SbbPearlChainVerticalItemElement } from "./pearl-chain-vertical-item.js";
6
+ import { SbbTeaserHeroElement } from "./teaser-hero.js";
7
+ import { SbbTeaserPaidElement } from "./teaser-paid.js";
6
8
  import { SbbTimetableDurationElement } from "./timetable-duration.js";
7
9
  import { SbbTimetableRowElement } from "./timetable-row.js";
8
10
 
@@ -12,6 +14,8 @@ declare global {
12
14
  var SbbPearlChainTimeElement: SbbPearlChainTimeElement;
13
15
  var SbbPearlChainVerticalElement: SbbPearlChainVerticalElement;
14
16
  var SbbPearlChainVerticalItemElement: SbbPearlChainVerticalItemElement;
17
+ var SbbTeaserHeroElement: SbbTeaserHeroElement;
18
+ var SbbTeaserPaidElement: SbbTeaserPaidElement;
15
19
  var SbbTimetableDurationElement: SbbTimetableDurationElement;
16
20
  var SbbTimetableRowElement: SbbTimetableRowElement;
17
21
  }