@pushengineering/umg-web-components 2.0.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 (88) hide show
  1. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js +56 -0
  2. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/base.js +9 -0
  3. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js +13 -0
  4. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js +37 -0
  5. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
  6. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query.js +34 -0
  7. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/state.js +12 -0
  8. package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js +260 -0
  9. package/dist/node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js +50 -0
  10. package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directive.js +27 -0
  11. package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js +37 -0
  12. package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js +10 -0
  13. package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/map.js +15 -0
  14. package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/range.js +14 -0
  15. package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js +39 -0
  16. package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js +259 -0
  17. package/dist/packages/web-components/classes/event-manager/event-manager.js +50 -0
  18. package/dist/packages/web-components/classes/index.js +4 -0
  19. package/dist/packages/web-components/components/badge/badge.js +146 -0
  20. package/dist/packages/web-components/components/banner/banner.js +389 -0
  21. package/dist/packages/web-components/components/banner-image/banner-image.js +161 -0
  22. package/dist/packages/web-components/components/box/box.js +208 -0
  23. package/dist/packages/web-components/components/button/button.js +336 -0
  24. package/dist/packages/web-components/components/button-group/button-group.js +98 -0
  25. package/dist/packages/web-components/components/button-icon/button-icon.js +246 -0
  26. package/dist/packages/web-components/components/caption-card/caption-card.js +331 -0
  27. package/dist/packages/web-components/components/deferred-media/deferred-media.js +212 -0
  28. package/dist/packages/web-components/components/disclosure/disclosure.js +255 -0
  29. package/dist/packages/web-components/components/event-table/event-content.js +106 -0
  30. package/dist/packages/web-components/components/event-table/event-date.js +45 -0
  31. package/dist/packages/web-components/components/event-table/event-table.js +74 -0
  32. package/dist/packages/web-components/components/event-table/event.js +45 -0
  33. package/dist/packages/web-components/components/footer/footer.js +153 -0
  34. package/dist/packages/web-components/components/grid/grid-cell.js +40 -0
  35. package/dist/packages/web-components/components/grid/grid.js +106 -0
  36. package/dist/packages/web-components/components/header/header.js +368 -0
  37. package/dist/packages/web-components/components/header-drawer/header-drawer.js +292 -0
  38. package/dist/packages/web-components/components/header-drawer/menu-drawer.js +176 -0
  39. package/dist/packages/web-components/components/horizontal-stack/horizontal-stack.js +93 -0
  40. package/dist/packages/web-components/components/icon/icon.js +81 -0
  41. package/dist/packages/web-components/components/icon/icons.svg.js +191 -0
  42. package/dist/packages/web-components/components/image/image.js +157 -0
  43. package/dist/packages/web-components/components/index.js +82 -0
  44. package/dist/packages/web-components/components/link/link.js +95 -0
  45. package/dist/packages/web-components/components/link-group/link-group.js +126 -0
  46. package/dist/packages/web-components/components/logo/logo.js +161 -0
  47. package/dist/packages/web-components/components/media-gallery/media-gallery.js +82 -0
  48. package/dist/packages/web-components/components/media-gallery/media.js +31 -0
  49. package/dist/packages/web-components/components/media-text/media-text.js +276 -0
  50. package/dist/packages/web-components/components/media-text/styles/media-size.js +119 -0
  51. package/dist/packages/web-components/components/menu/menu.js +328 -0
  52. package/dist/packages/web-components/components/modal/modal.js +143 -0
  53. package/dist/packages/web-components/components/number-field/number-field.js +339 -0
  54. package/dist/packages/web-components/components/overlay/overlay.js +77 -0
  55. package/dist/packages/web-components/components/page/page.js +105 -0
  56. package/dist/packages/web-components/components/popover/popover.js +163 -0
  57. package/dist/packages/web-components/components/rich-text/rich-text.js +126 -0
  58. package/dist/packages/web-components/components/section/section.js +400 -0
  59. package/dist/packages/web-components/components/select/select.js +359 -0
  60. package/dist/packages/web-components/components/slider/slide.js +68 -0
  61. package/dist/packages/web-components/components/slider/slider-controls.js +258 -0
  62. package/dist/packages/web-components/components/slider/slider.js +374 -0
  63. package/dist/packages/web-components/components/slider/styles/controls.js +98 -0
  64. package/dist/packages/web-components/components/slider/styles/slider.js +233 -0
  65. package/dist/packages/web-components/components/socials/socials.js +96 -0
  66. package/dist/packages/web-components/components/table/table.js +158 -0
  67. package/dist/packages/web-components/components/text/text.js +245 -0
  68. package/dist/packages/web-components/components/text-field/text-field.js +257 -0
  69. package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slide.js +51 -0
  70. package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slider.js +88 -0
  71. package/dist/packages/web-components/components/vertical-stack/vertical-stack.js +95 -0
  72. package/dist/packages/web-components/components/video/video.js +185 -0
  73. package/dist/packages/web-components/scripts/mergeStyles.js +8 -0
  74. package/dist/packages/web-components/scripts/polyfills/scrollyfills.js +43 -0
  75. package/dist/packages/web-components/scripts/settings.js +7 -0
  76. package/dist/packages/web-components/scripts/themeStyleSheet.js +9 -0
  77. package/dist/packages/web-components/scripts/utilities/debounce.js +9 -0
  78. package/dist/packages/web-components/scripts/utilities/paddingTransformations.js +46 -0
  79. package/dist/packages/web-components/styles/button.js +55 -0
  80. package/dist/packages/web-components/styles/fonts.js +181 -0
  81. package/dist/packages/web-components/styles/global.js +40 -0
  82. package/dist/packages/web-components/styles/grid.js +114 -0
  83. package/dist/packages/web-components/styles/group.js +121 -0
  84. package/dist/packages/web-components/styles/icon-size.js +19 -0
  85. package/dist/packages/web-components/styles/link.js +30 -0
  86. package/dist/packages/web-components/styles/placeholder-media.js +27 -0
  87. package/package.json +92 -0
  88. package/readme.md +266 -0
@@ -0,0 +1,389 @@
1
+ import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
2
+ import { html as r } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
3
+ import { LitElement as g } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
4
+ import { customElement as u } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
5
+ import { property as i } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
6
+ import { state as d } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/state.js";
7
+ import { ifDefined as o } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js";
8
+ import { classMap as p } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
9
+ import { styleMap as b } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js";
10
+ import { global as y } from "../../styles/global.js";
11
+ import { settings as _ } from "../../scripts/settings.js";
12
+ import { mergeStyles as f } from "../../scripts/mergeStyles.js";
13
+ import "../box/box.js";
14
+ import "../vertical-stack/vertical-stack.js";
15
+ import { css as v } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
16
+ var x = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (t, s, h, c) => {
17
+ for (var a = c > 1 ? void 0 : c ? w(s, h) : s, l = t.length - 1, m; l >= 0; l--)
18
+ (m = t[l]) && (a = (c ? m(s, h, a) : m(a)) || a);
19
+ return c && a && x(s, h, a), a;
20
+ };
21
+ const { prefix: A } = _;
22
+ let e = class extends g {
23
+ constructor() {
24
+ super(), this.height = "medium", this.contentPosition = "over", this.contentFullWidth = !1, this.contentAlign = "center", this.contentJustify = "center", this._headerHeight = "", this._withoutContent = !0, this.addEventListener("media-details", this.eventNotifications);
25
+ }
26
+ connectedCallback() {
27
+ super.connectedCallback(), window.addEventListener("header-details", this.eventNotifications.bind(this));
28
+ }
29
+ disconnectedCallback() {
30
+ window.removeEventListener("header-details", this.eventNotifications.bind(this)), super.disconnectedCallback();
31
+ }
32
+ async eventNotifications(t) {
33
+ t.type === "media-details" && (t.detail.mediaAspectRatio && (this._mediaAspectRatio = t.detail.mediaAspectRatio.toString()), t.detail.mobileMediaAspectRatio ? this._mobileMediaAspectRatio = t.detail.mobileMediaAspectRatio.toString() : t.detail.mediaAspectRatio && (this._mediaAspectRatio = t.detail.mediaAspectRatio.toString())), t.type === "header-details" && (this._headerHeight = t.detail.height);
34
+ }
35
+ handleSlotchange(t) {
36
+ t.target && t.target.getAttribute("name") === "content" && (this._withoutContent = !1);
37
+ }
38
+ bannerClasses() {
39
+ const t = {};
40
+ return t["media-height--" + this.height] = !0, (this.contentPosition === "under" || this.contentPosition === "above" || this.contentPosition === "side") && (t["content--inline"] = !0, t["content-position--" + this.contentPosition] = !0), t;
41
+ }
42
+ bannerStyles() {
43
+ let t = {};
44
+ return this.contentPosition === "side" && (t = {
45
+ ...t,
46
+ "--um-color-box-bg": this.colorBg,
47
+ "--um-opacity-box-bg": this.opacity
48
+ }), this._mediaAspectRatio && (t = {
49
+ ...t,
50
+ "--um-aspect-ratio": this._mediaAspectRatio
51
+ }), this._mobileMediaAspectRatio ? t = {
52
+ ...t,
53
+ "--um-mobile-aspect-ratio": this._mobileMediaAspectRatio
54
+ } : this._mediaAspectRatio && (t = {
55
+ ...t,
56
+ "--um-mobile-aspect-ratio": this._mediaAspectRatio
57
+ }), this._headerHeight && this.height === "stretch" && (t = {
58
+ ...t,
59
+ "--um-size-header-outer-height": this._headerHeight + "px"
60
+ }), this.overlayColor && (t = {
61
+ ...t,
62
+ "--um-banner-overlay-color": this.overlayColor
63
+ }), this.overlayOpacity && (t = {
64
+ ...t,
65
+ "--um-banner-overlay-opacity": this.overlayOpacity
66
+ }), t;
67
+ }
68
+ bannercontentClasses() {
69
+ const t = {};
70
+ return t["content-align--" + this.contentAlign] = !0, t["content-justify--" + this.contentJustify] = !0, t["content--without-content"] = this._withoutContent, t;
71
+ }
72
+ bannercontentStyles() {
73
+ let t = {};
74
+ return t = {
75
+ ...t,
76
+ "--um-size-box-width": this.contentFullWidth ? "100%" : "auto"
77
+ }, t;
78
+ }
79
+ contentOuter() {
80
+ return r`
81
+ <umg-box
82
+ part="banner-content-container"
83
+ class="banner-content__inner"
84
+ padding=${this.contentPosition === "over" ? o(this.contentOuterPadding) : "0"}
85
+ mobilePadding='0'
86
+ >
87
+ ${this.contentInner(this.contentFullWidth)}
88
+ </umg-box>
89
+ `;
90
+ }
91
+ contentInner(t) {
92
+ return r`
93
+ <umg-box
94
+ part="content-container"
95
+ class="content__container"
96
+ padding=${o(this.contentInnerPadding)}
97
+ mobilePadding=${o(this.mobilePadding)}
98
+ colorText=${o(this.colorText)}
99
+ colorBg=${o(this.contentPosition === "side" ? void 0 : o(this.colorBg))}
100
+ opacity=${this.contentPosition === "side" ? "0" : o(this.opacity)}
101
+ width="${t ? "expand" : "shrink"}"
102
+ >
103
+ <umg-vertical-stack
104
+ align=${this.contentJustify}
105
+ mobileAlign=${this.mobileContentJustify ? this.mobileContentJustify : this.contentJustify}
106
+ gap="${o(this.contentSpacing)}"
107
+ >
108
+ <slot name="content" @slotchange=${this.handleSlotchange}></slot>
109
+ </umg-vertical-stack>
110
+ </umg-box> `;
111
+ }
112
+ content() {
113
+ return this.contentPosition === "over" || this.contentPosition === "side" ? r`
114
+ ${this.contentOuter()}
115
+ ` : r`
116
+ ${this.contentInner(!0)}
117
+ `;
118
+ }
119
+ render() {
120
+ return r`
121
+ <div
122
+ class="banner${p(this.bannerClasses())}"
123
+ style="${b(this.bannerStyles())}"
124
+ part="banner"
125
+ >
126
+ <div class="banner__inner" part="banner-container">
127
+ <div class="banner-media" part="banner-media-container">
128
+ <slot name="media"></slot>
129
+ </div>
130
+ <div
131
+ class="banner-content${p(this.bannercontentClasses())}"
132
+ style="${b(this.bannercontentStyles())}"
133
+ part="banner-content"
134
+ >
135
+ ${this.content()}
136
+ </div>
137
+ </div>
138
+ </div>
139
+ `;
140
+ }
141
+ };
142
+ e.styles = f([
143
+ y,
144
+ v`
145
+ :host {
146
+ position: relative;
147
+ display: block;
148
+ width: 100%;
149
+ overflow: hidden;
150
+ }
151
+
152
+ /* Media overlay */
153
+ .banner__inner {
154
+ position: relative;
155
+ }
156
+
157
+ .banner:not(.content--inline) .banner__inner::after {
158
+ content: '';
159
+ display: block;
160
+ position: absolute;
161
+ top: 0;
162
+ left: 0;
163
+ height: 100%;
164
+ width: 100%;
165
+ z-index: 1;
166
+ background-color: rgb(var(--um-banner-overlay-color, 255,255,255),var(--um-banner-overlay-opacity, 0));
167
+ }
168
+
169
+ /* Mobile content */
170
+ @media only screen and (max-width: 48.06rem) {
171
+ /* Apply caption background to inner section on mobile at 100% opacity for full bleed background colour */
172
+ .banner__inner {
173
+ background-color: rgb(var(--um-color-box-bg), 1);
174
+ }
175
+ /* Always make content box 100% width on mobile */
176
+ .banner-content__inner .content__container::part(box-content) {
177
+ --um-opacity-box-bg: 1!important;
178
+ }
179
+ }
180
+
181
+ /* Banner media height */
182
+ @media only screen and (max-width: 30rem) {
183
+ .media-height--xsmall .banner-media {
184
+ height: 10em;
185
+ }
186
+ .media-height--small .banner-media {
187
+ height: 15rem;
188
+ }
189
+ .media-height--medium .banner-media {
190
+ height: 20rem;
191
+ }
192
+ .media-height--large .banner-media {
193
+ height: 25rem;
194
+ }
195
+ .media-height--xlarge .banner-media {
196
+ height: 30rem;
197
+ }
198
+ }
199
+ @media only screen and (min-width: 30.06rem) {
200
+ .media-height--xsmall .banner-media {
201
+ height: 15rem;
202
+ }
203
+ .media-height--small .banner-media {
204
+ height: 20rem;
205
+ }
206
+ .media-height--medium .banner-media {
207
+ height: 25rem;
208
+ }
209
+ .media-height--large .banner-media {
210
+ height: 30rem;
211
+ }
212
+ .media-height--xlarge .banner-media {
213
+ height: 40rem;
214
+ }
215
+ }
216
+
217
+ .media-height--stretch .banner-media {
218
+ height: calc(100vh - var(--um-size-header-outer-height, 0px));
219
+ }
220
+
221
+ /* Adapt banner to media height */
222
+ .banner.media-height--adapt .banner-media {
223
+ aspect-ratio: var(--um-mobile-aspect-ratio);
224
+ height: auto;
225
+ }
226
+ @media only screen and (min-width: 30.06rem) {
227
+ .banner.media-height--adapt .banner-media {
228
+ aspect-ratio: var(--um-aspect-ratio);
229
+ }
230
+ }
231
+
232
+ /* Without content? */
233
+ .content--without-content {
234
+ display: none;
235
+ }
236
+
237
+ /* Content positions */
238
+
239
+ @media only screen and (max-width: 48.06rem) {
240
+ /* All positions - mobile content box is full width */
241
+ .content__container {
242
+ width: 100%;
243
+ }
244
+ }
245
+
246
+ /* Desktop content over media */
247
+ @media only screen and (min-width: 48.06rem) {
248
+ .banner:not(.content--inline) .banner-content {
249
+ position: absolute;
250
+ top: 0;
251
+ left: 0;
252
+ height: 100%;
253
+ width: 100%;
254
+ z-index: 10;
255
+ }
256
+ }
257
+
258
+ /* Desktop content to side of media */
259
+ .content-position--side .banner__inner {
260
+ background-color: rgb(var(--um-color-box-bg), var(--um-opacity-box-bg))
261
+ }
262
+
263
+ @media only screen and (min-width: 48.06rem) {
264
+ .content--inline.content-position--side .banner__inner {
265
+ flex-direction: row-reverse
266
+ }
267
+ .content--inline.content-position--side .banner-media {
268
+ flex: 1 0 auto;
269
+ width: 60%;
270
+ }
271
+ .content--inline.content-position--side .banner-content ::slotted(*) {
272
+ height: 100%;
273
+ }
274
+ }
275
+
276
+ /* Inline with media, side/above/under*/
277
+ .content--inline .banner__inner {
278
+ display: flex;
279
+ flex-direction: column;
280
+ }
281
+
282
+ .content-position--above .banner-media {
283
+ order: 2;
284
+ }
285
+ .content-position--above .banner-content {
286
+ order: 1;
287
+ }
288
+ .content-position--under .banner-media {
289
+ order: 1;
290
+ }
291
+ .content-position--under .banner-content {
292
+ order: 2;
293
+ }
294
+
295
+ /* Content over media box alignments */
296
+ .banner-content__inner {
297
+ height: 100%;
298
+ }
299
+ .banner-content__inner:not(.content__container)::part(box-content) {
300
+ background-color: transparent;
301
+ display: flex;
302
+ }
303
+ .content__container::part(box-content) {
304
+ height: auto;
305
+ }
306
+
307
+ .content-justify--start .banner-content__inner:not(.content__container)::part(box-content) {
308
+ justify-content: start;
309
+ }
310
+ .content-justify--center .banner-content__inner:not(.content__container)::part(box-content) {
311
+ justify-content: center;
312
+ }
313
+ .content-justify--end .banner-content__inner:not(.content__container)::part(box-content) {
314
+ justify-content: end;
315
+ }
316
+ .content-align--start .banner-content__inner:not(.content__container)::part(box-content) {
317
+ align-items: start;
318
+ }
319
+ .content-align--center .banner-content__inner:not(.content__container)::part(box-content) {
320
+ align-items: center;
321
+ }
322
+ .content-align--end .banner-content__inner:not(.content__container)::part(box-content) {
323
+ align-items: end;
324
+ }
325
+ `
326
+ ]);
327
+ n([
328
+ i()
329
+ ], e.prototype, "height", 2);
330
+ n([
331
+ i()
332
+ ], e.prototype, "contentPosition", 2);
333
+ n([
334
+ i({ type: Boolean })
335
+ ], e.prototype, "contentFullWidth", 2);
336
+ n([
337
+ i()
338
+ ], e.prototype, "contentAlign", 2);
339
+ n([
340
+ i()
341
+ ], e.prototype, "contentJustify", 2);
342
+ n([
343
+ i()
344
+ ], e.prototype, "mobileContentJustify", 2);
345
+ n([
346
+ i()
347
+ ], e.prototype, "contentSpacing", 2);
348
+ n([
349
+ i()
350
+ ], e.prototype, "contentInnerPadding", 2);
351
+ n([
352
+ i()
353
+ ], e.prototype, "contentOuterPadding", 2);
354
+ n([
355
+ i()
356
+ ], e.prototype, "mobilePadding", 2);
357
+ n([
358
+ i()
359
+ ], e.prototype, "colorText", 2);
360
+ n([
361
+ i()
362
+ ], e.prototype, "colorBg", 2);
363
+ n([
364
+ i()
365
+ ], e.prototype, "opacity", 2);
366
+ n([
367
+ i()
368
+ ], e.prototype, "overlayColor", 2);
369
+ n([
370
+ i({ type: Number })
371
+ ], e.prototype, "overlayOpacity", 2);
372
+ n([
373
+ d()
374
+ ], e.prototype, "_mediaAspectRatio", 2);
375
+ n([
376
+ d()
377
+ ], e.prototype, "_mobileMediaAspectRatio", 2);
378
+ n([
379
+ d()
380
+ ], e.prototype, "_headerHeight", 2);
381
+ n([
382
+ d()
383
+ ], e.prototype, "_withoutContent", 2);
384
+ e = n([
385
+ u(`${A}-banner`)
386
+ ], e);
387
+ export {
388
+ e as Banner
389
+ };
@@ -0,0 +1,161 @@
1
+ import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
2
+ import { html as h, nothing as d } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
3
+ import { LitElement as n } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
4
+ import { customElement as b } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
5
+ import { property as i } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
6
+ import { classMap as c } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
7
+ import { ifDefined as m } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js";
8
+ import { global as y } from "../../styles/global.js";
9
+ import { placeholderMedia as u } from "../../styles/placeholder-media.js";
10
+ import { settings as f } from "../../scripts/settings.js";
11
+ import { mergeStyles as w } from "../../scripts/mergeStyles.js";
12
+ import { css as $ } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
13
+ var v = Object.defineProperty, S = Object.getOwnPropertyDescriptor, e = (s, r, a, l) => {
14
+ for (var o = l > 1 ? void 0 : l ? S(r, a) : r, p = s.length - 1, g; p >= 0; p--)
15
+ (g = s[p]) && (o = (l ? g(r, a, o) : g(o)) || o);
16
+ return l && o && v(r, a, o), o;
17
+ };
18
+ const { prefix: z } = f;
19
+ let t = class extends n {
20
+ constructor() {
21
+ super(...arguments), this.imgAlt = "", this.width = 100, this.height = 100, this.mobileHeight = this.width, this.mobileWidth = this.height, this.load = "lazy";
22
+ }
23
+ dispatchEvents() {
24
+ const s = this.width / this.height, r = this.mobileWidth / this.mobileHeight, a = new CustomEvent("media-details", {
25
+ detail: {
26
+ mediaAspectRatio: s,
27
+ mobileMediaAspectRatio: r
28
+ },
29
+ bubbles: !0,
30
+ composed: !0
31
+ });
32
+ this.dispatchEvent(a);
33
+ }
34
+ imageClasses() {
35
+ const s = {};
36
+ return s["without-mobile"] = !this.mobileSrc, s;
37
+ }
38
+ mobileImage() {
39
+ return this.mobileSrc ? h`
40
+ <img
41
+ class="image image--mobile"
42
+ width="${this.mobileWidth}"
43
+ height="${this.mobileHeight}"
44
+ src="${m(this.mobileSrc)}"
45
+ srcset="${m(this.mobileSrcSet)}"
46
+ sizes="${m(this.mobileSizes)}"
47
+ alt="${this.imgAlt}"
48
+ loading="${this.load}"
49
+ part="image"
50
+ >
51
+ ` : d;
52
+ }
53
+ desktopImage() {
54
+ return this.src ? h`
55
+ <img
56
+ class="image image--desktop${c(this.imageClasses())}"
57
+ width="${this.width}"
58
+ height="${this.height}"
59
+ src="${m(this.src)}"
60
+ srcset="${m(this.imgSrcSet)}"
61
+ sizes="${m(this.sizes)}"
62
+ alt="${this.imgAlt}"
63
+ loading="${this.load}"
64
+ part="image"
65
+ >
66
+ ` : h`
67
+ <div class="placeholder image image--desktop${c(this.imageClasses())}" style="aspect-ratio: ${this.width / this.height}">
68
+ <div class="placeholder-inner">
69
+ <svg class="icon" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512" fill="currentcolor">
70
+ <path d="M70.5 138.1C31 172.2 16 219.1 16 272c0 52 18.4 91.6 46.9 118.3C91.6 417.2 131.5 432 176 432h8.4c18.2 0 34.8-10.3 42.9-26.5l23.2-46.3C257.6 345 272.1 336 288 336s30.4 9 37.5 23.2l23.2 46.3c8.1 16.3 24.8 26.5 42.9 26.5H400c44.5 0 84.4-14.8 113.1-41.7C541.6 363.6 560 324 560 272c0-52.9-15-99.8-54.5-133.9C465.6 103.6 398.1 80 288 80s-177.6 23.6-217.5 58.1zM0 272C0 160 64 64 288 64s288 96 288 208s-80 176-176 176h-8.4c-24.2 0-46.4-13.7-57.2-35.4l-23.2-46.3c-4.4-8.8-13.3-14.3-23.2-14.3s-18.8 5.5-23.2 14.3l-23.2 46.3c-10.8 21.7-33 35.4-57.2 35.4H176C80 448 0 384 0 272zm160 32a48 48 0 1 0 0-96 48 48 0 1 0 0 96zm0-112a64 64 0 1 1 0 128 64 64 0 1 1 0-128zm304 64a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zm-112 0a64 64 0 1 1 128 0 64 64 0 1 1 -128 0z"/>
71
+ </svg>
72
+ </div>
73
+ </div>
74
+ `;
75
+ }
76
+ getImage() {
77
+ return h`
78
+ ${this.desktopImage()}
79
+ ${this.mobileImage()}
80
+ `;
81
+ }
82
+ render() {
83
+ return this.dispatchEvents(), h`
84
+ ${this.getImage()}
85
+ `;
86
+ }
87
+ };
88
+ t.styles = w([
89
+ y,
90
+ u,
91
+ $`
92
+ .image {
93
+ object-fit: cover;
94
+ height: 100%;
95
+ width: 100%;
96
+ max-width: 100%;
97
+ }
98
+
99
+ /* Art directed images */
100
+ .image--desktop {
101
+ display: block;
102
+ }
103
+ .image--mobile {
104
+ display: none;
105
+ }
106
+
107
+ @media only screen and (max-width: 48rem) {
108
+ .image--desktop {
109
+ display: none;
110
+ }
111
+ .image--mobile {
112
+ display: block;
113
+ }
114
+ .without-mobile.image--desktop {
115
+ display: block;
116
+ }
117
+ }
118
+ `
119
+ ]);
120
+ e([
121
+ i()
122
+ ], t.prototype, "imgAlt", 2);
123
+ e([
124
+ i()
125
+ ], t.prototype, "src", 2);
126
+ e([
127
+ i({ type: String })
128
+ ], t.prototype, "imgSrcSet", 2);
129
+ e([
130
+ i({ type: String })
131
+ ], t.prototype, "sizes", 2);
132
+ e([
133
+ i({ type: Number })
134
+ ], t.prototype, "width", 2);
135
+ e([
136
+ i({ type: Number })
137
+ ], t.prototype, "height", 2);
138
+ e([
139
+ i()
140
+ ], t.prototype, "mobileSrc", 2);
141
+ e([
142
+ i({ type: String })
143
+ ], t.prototype, "mobileSrcSet", 2);
144
+ e([
145
+ i({ type: String })
146
+ ], t.prototype, "mobileSizes", 2);
147
+ e([
148
+ i({ type: Number })
149
+ ], t.prototype, "mobileHeight", 2);
150
+ e([
151
+ i({ type: Number })
152
+ ], t.prototype, "mobileWidth", 2);
153
+ e([
154
+ i()
155
+ ], t.prototype, "load", 2);
156
+ t = e([
157
+ b(`${z}-banner-image`)
158
+ ], t);
159
+ export {
160
+ t as BannerImage
161
+ };