@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,359 @@
1
+ import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
2
+ import { html as c } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
3
+ import { LitElement as m } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
4
+ import { customElement as p } 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 b } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/state.js";
7
+ import { classMap as h } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
8
+ import { styleMap as v } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js";
9
+ import { EventManager as u } from "../../classes/event-manager/event-manager.js";
10
+ import { global as g } from "../../styles/global.js";
11
+ import { settings as y } from "../../scripts/settings.js";
12
+ import { mergeStyles as f } from "../../scripts/mergeStyles.js";
13
+ import "../disclosure/disclosure.js";
14
+ import "../text/text.js";
15
+ import "../icon/icon.js";
16
+ import { css as x } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
17
+ var w = Object.defineProperty, L = Object.getOwnPropertyDescriptor, s = (e, t, a, o) => {
18
+ for (var l = o > 1 ? void 0 : o ? L(t, a) : t, n = e.length - 1, d; n >= 0; n--)
19
+ (d = e[n]) && (l = (o ? d(t, a, l) : d(l)) || l);
20
+ return o && l && w(t, a, l), l;
21
+ };
22
+ const { prefix: _ } = y;
23
+ let r = class extends m {
24
+ constructor() {
25
+ super(...arguments), this.id = "", this.options = [], this.label = "Select box", this.name = "", this.selectedItem = 0, this.defaultLabel = !1, this.border = !1, this.borderRadius = "0", this.disabled = !1, this._currentSelectedLabel = "", this.windowEventManager = new u(window), this.eventManager = new u(this), this._eventsHandler = async (e) => {
26
+ e.type === "click" && !e.composedPath().includes(this) && this._eventsDispatcher(e, "select-close");
27
+ };
28
+ }
29
+ connectedCallback() {
30
+ super.connectedCallback(), this.windowEventManager.addEventListener("click", this._eventsHandler), this.windowEventManager.addEventListener("change", this._eventsHandler);
31
+ }
32
+ disconnectedCallback() {
33
+ this.windowEventManager.removeEventListener("click", this._eventsHandler), super.disconnectedCallback();
34
+ }
35
+ updated(e) {
36
+ if (e.has("defaultLabel"))
37
+ if (this.defaultLabel) {
38
+ if (this.options && this.options.length > this.selectedItem) {
39
+ const t = this.options[this.selectedItem];
40
+ this._currentSelectedLabel = t ? t.label : "";
41
+ }
42
+ } else
43
+ this._currentSelectedLabel = "";
44
+ }
45
+ _eventsDispatcher(e, t) {
46
+ if (!t)
47
+ throw new Error("Missing custom event type");
48
+ const a = { bubbles: !0, composed: !0 };
49
+ let o = {};
50
+ t == "select-close" && (t = "disclosure", o = { eventName: "close" }, this.eventManager.dispatchCustomEvent(t, o, a)), t === "option-change" && (t = "change", o = {
51
+ eventName: this.name,
52
+ fieldId: this.id,
53
+ value: e.target.value
54
+ }, this.windowEventManager.dispatchCustomEvent(t, o, a));
55
+ }
56
+ /** Render UX */
57
+ _onOptionChange(e) {
58
+ const t = e.target.dataset.label;
59
+ t && (this._currentSelectedLabel = t, this._eventsDispatcher(e, "select-close"), this._eventsDispatcher(e, "option-change"));
60
+ }
61
+ optionsListClasses() {
62
+ return {
63
+ "select--disabled": this.disabled,
64
+ "select--border": this.border
65
+ };
66
+ }
67
+ optionsListStyles() {
68
+ let e = {};
69
+ return this.colorText && (e = {
70
+ ...e,
71
+ "--um-color-input-text": this.colorText,
72
+ "--um-color-icon-text": this.colorText,
73
+ "--um-color-disclosure-text": this.colorText,
74
+ "--um-color-input-border": this.colorText
75
+ }), this.colorBg && (e = {
76
+ ...e,
77
+ "--um-color-input-bg": this.colorBg,
78
+ "--um-color-disclosure-bg": this.colorBg
79
+ }), this.borderRadius !== "0" && (e = {
80
+ ...e,
81
+ "--um-border-input-radius": "var(--um-border-radius-" + this.borderRadius + ")"
82
+ }), e;
83
+ }
84
+ optionsList() {
85
+ return c`
86
+ <fieldset>
87
+ <legend class="visually-hidden">${this.label}</legend>
88
+ <ul class="select-list" @change="${this._onOptionChange}">
89
+ ${this.options.map((e, t) => c`
90
+ <li role="option" tabindex="-1">
91
+ <input
92
+ class="visually-hidden"
93
+ type="radio"
94
+ id="${e.id}"
95
+ name="${e.name}"
96
+ value="${e.value}"
97
+ data-label="${e.label}"
98
+ ?checked="${this.selectedItem === t}"
99
+ ?disabled="${e.disabled}"
100
+ />
101
+ <label for="${e.id}">
102
+ <umg-icon icon="check" size="xSmall"></umg-icon>
103
+ <umg-text
104
+ as="span"
105
+ variant="bodySm"
106
+ withoutMargin
107
+ >
108
+ ${e.label}
109
+ </umg-text>
110
+ </label>
111
+ </li>
112
+ `)}
113
+ </ul>
114
+ </fieldset>
115
+ `;
116
+ }
117
+ currentOptionLabel() {
118
+ if (this._currentSelectedLabel)
119
+ return c`
120
+ <umg-text
121
+ slot="summary"
122
+ class="current-selection"
123
+ as="span"
124
+ variant="bodySm"
125
+ withoutMargin
126
+ >
127
+ ${this._currentSelectedLabel}
128
+ </umg-text>
129
+ `;
130
+ }
131
+ render() {
132
+ return c`
133
+ <div
134
+ part="select"
135
+ class="select ${h(this.optionsListClasses())}"
136
+ style="${v(this.optionsListStyles())}"
137
+ >
138
+ <umg-disclosure overlay justifySummary="space-between">
139
+ <div slot="summary">
140
+ <umg-text
141
+ class="label"
142
+ as="span"
143
+ variant="bodySm"
144
+ withoutMargin
145
+ >
146
+ ${this.label}
147
+ </umg-text>
148
+ ${this.currentOptionLabel()}
149
+ </div>
150
+ <umg-icon
151
+ slot="icon"
152
+ part="carat"
153
+ class="carat"
154
+ icon="chevron-down"
155
+ size="xSmall"
156
+ >
157
+ </umg-icon>
158
+ <div slot="content" class="content">
159
+ ${this.optionsList()}
160
+ </div>
161
+ </umg-disclosure>
162
+ </div>
163
+ `;
164
+ }
165
+ };
166
+ r.styles = f([
167
+ g,
168
+ x`
169
+ :host {
170
+ display: block;
171
+ width: fit-content
172
+ }
173
+
174
+ /* Select box */
175
+ .select {
176
+ color: rgb(var(--um-color-input-text, var(--um-color-section-trext, var(--um-color-base-text, 0,0,0))), 1);
177
+
178
+ width: fit-content;
179
+ }
180
+ .select.select--disabled {
181
+ opacity: 0.4;
182
+ pointer-events: none;
183
+ cursor: default;
184
+ }
185
+ umg-disclosure::part(disclosure-summary) {
186
+ background-color: rgb(var(--um-color-input-bg, var(--color-section-bg, var(--um-color-base-bg, 255,255,255))), 1);
187
+ }
188
+ .select--border umg-disclosure::part(disclosure-summary) {
189
+ border: var(--um-border-input-width, 0.0625rem) solid rgba(var(--um-color-input-border, var(--um-color-input-text, var(--um-color-section-text, 0,0,0))), var(--um-opacity-input-border, 1));
190
+ border-radius: var(--um-border-input-radius, 0);
191
+ padding: 0 var(--um-space-16, 1rem);
192
+ min-width: 14rem;
193
+ }
194
+ .select--border umg-disclosure::part(disclosure-content) {
195
+ border-radius: var(--um-border-input-radius, 0);
196
+ }
197
+
198
+ /* Disclosure */
199
+ umg-disclosure::part(disclosure-summary) {
200
+ padding: 0 var(--um-space-12, 0.75rem);
201
+ line-height: 0;
202
+ }
203
+ umg-disclosure::part(disclosure-drawer) {
204
+ top: 3rem;
205
+ }
206
+ umg-disclosure .current-selection {
207
+ padding-left: var(--um-space-4, 0.25rem);
208
+ opacity: 0.5;
209
+ }
210
+ umg-disclosure .content {
211
+ overflow: hidden;
212
+ border: var(--um-border-input-width, 0.0625rem) solid rgba(var(--um-color-input-border, var(--um-color-input-text, var(--um-color-section-text, 0,0,0))), var(--um-opacity-input-border, 1));
213
+ border-radius: var(--um-border-input-radius, 0);
214
+ }
215
+
216
+ /* Form elements */
217
+ fieldset {
218
+ border: none;
219
+ padding: 0;
220
+ margin: 0;
221
+ }
222
+
223
+ /* Select box list/group */
224
+ .select-list {
225
+ list-style: none;
226
+ margin: 0;
227
+ padding: 0;
228
+ max-height: 15rem;
229
+ }
230
+ .select-list {
231
+ min-width: 10rem;
232
+ overflow-y: auto;
233
+ }
234
+ .select-list li {
235
+ gap: var(--um-space-12);
236
+ }
237
+ .select-list li {
238
+ display: flex;
239
+ align-items: center;
240
+ }
241
+
242
+ /* Select box scrollbar */
243
+ .select-list::-webkit-scrollbar {
244
+ width: 0.25rem;
245
+ }
246
+ .select-list::-webkit-scrollbar-track {
247
+ background: rgb(var(--color-section-text, var(--um-color-base-text, 0,0,0)), 0.05);
248
+ border-radius: var(--um-border-radius-30);
249
+ }
250
+ .select-list::-webkit-scrollbar-thumb {
251
+ background: rgb(var(--color-section-text, var(--um-color-base-text, 0,0,0)), 0.1);
252
+ border-radius: var(--um-border-radius-30);
253
+ }
254
+
255
+ /* Inputs */
256
+ .select-list input[type=radio] ~ label umg-icon {
257
+ visibility: hidden;
258
+ }
259
+ .select-list input[type=radio]:checked ~ label umg-icon {
260
+ visibility: visible;
261
+ }
262
+ .select-list input[type=radio]:focus-visible ~ label {
263
+ color: red;
264
+ }
265
+ .select-list input[type=radio]:focus ~ label {
266
+ color: red;
267
+ }
268
+ .select-list input[type=checkbox] ~ label umg-icon {
269
+ visibility: visible;
270
+ border: var(--um-border-input-width, 0.0625rem) solid rgba(var(--um-color-input-border, var(--um-color-input-text, var(--um-color-section-text, 0,0,0))), var(--um-opacity-input-border, 1));
271
+ border-radius: min(calc(var(--um-border-input-radius, 0) * 0.5), 0.3rem);
272
+ padding: 0.0625rem;
273
+ }
274
+ .select-list input[type=checkbox]:checked ~ label umg-icon::part(icon) {
275
+ visibility: visible;
276
+ }
277
+ .select-list input[type=checkbox]:not(:checked) ~ label umg-icon::part(icon) {
278
+ visibility: hidden;
279
+ }
280
+
281
+ /* Input labels */
282
+ .select-list li,
283
+ .select-list label {
284
+ cursor: pointer;
285
+ }
286
+ .select-list label {
287
+ display: flex;
288
+ align-items: center;
289
+ gap: var(--um-space-12, 0.75rem);
290
+ padding: 0.375rem var(--space-8, 0.5rem);
291
+ width: 100%;
292
+ }
293
+ .select-list label .count {
294
+ opacity: 0.4;
295
+ font-style: italic;
296
+ }
297
+ .select-list li:first-child label {
298
+ margin-top: var(--um-space-12);
299
+ }
300
+ .select-list li:last-child label {
301
+ margin-bottom: var(--um-space-12);
302
+ }
303
+ .select-list label:hover {
304
+ background-color: rgb(var(--um-color-section-text, var(--um-color-base-text, 0,0,0)), 0.05);
305
+ }
306
+
307
+ /** Mobile styles */
308
+ @media screen and (max-width: 48rem) {
309
+ :host, .select {
310
+ width: 100%;
311
+ }
312
+ .select {
313
+ padding: 0;
314
+ }
315
+ }
316
+ `
317
+ ]);
318
+ s([
319
+ i()
320
+ ], r.prototype, "id", 2);
321
+ s([
322
+ i({ type: Array })
323
+ ], r.prototype, "options", 2);
324
+ s([
325
+ i()
326
+ ], r.prototype, "label", 2);
327
+ s([
328
+ i()
329
+ ], r.prototype, "name", 2);
330
+ s([
331
+ i({ type: Number })
332
+ ], r.prototype, "selectedItem", 2);
333
+ s([
334
+ i({ type: Boolean })
335
+ ], r.prototype, "defaultLabel", 2);
336
+ s([
337
+ i()
338
+ ], r.prototype, "colorText", 2);
339
+ s([
340
+ i()
341
+ ], r.prototype, "colorBg", 2);
342
+ s([
343
+ i({ type: Boolean })
344
+ ], r.prototype, "border", 2);
345
+ s([
346
+ i()
347
+ ], r.prototype, "borderRadius", 2);
348
+ s([
349
+ i({ type: Boolean, reflect: !0 })
350
+ ], r.prototype, "disabled", 2);
351
+ s([
352
+ b()
353
+ ], r.prototype, "_currentSelectedLabel", 2);
354
+ r = s([
355
+ p(`${_}-select`)
356
+ ], r);
357
+ export {
358
+ r as Select
359
+ };
@@ -0,0 +1,68 @@
1
+ import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
2
+ import { html as p } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
3
+ import { LitElement as c } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
4
+ import { property as a } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
5
+ import { customElement as d } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
6
+ import { global as f } from "../../styles/global.js";
7
+ import { settings as h } from "../../scripts/settings.js";
8
+ import { mergeStyles as u } from "../../scripts/mergeStyles.js";
9
+ import { css as v } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
10
+ var y = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, n = (m, r, o, s) => {
11
+ for (var t = s > 1 ? void 0 : s ? _(r, o) : r, i = m.length - 1, l; i >= 0; i--)
12
+ (l = m[i]) && (t = (s ? l(r, o, t) : l(t)) || t);
13
+ return s && t && y(r, o, t), t;
14
+ };
15
+ const { prefix: g } = h;
16
+ let e = class extends c {
17
+ constructor() {
18
+ super(...arguments), this.contentType = "slider", this.active = !1;
19
+ }
20
+ content() {
21
+ return this.contentType === "slider" ? p`
22
+ <li class="slide grid__item" part="slide">
23
+ <slot></slot>
24
+ </li>
25
+ ` : p`
26
+ <div
27
+ class="slide grid__item"
28
+ part="slide"
29
+ role="group"
30
+ aria-roledescription="slide"
31
+ aria-hidden="false"
32
+ >
33
+ <slot></slot>
34
+ </div>
35
+ `;
36
+ }
37
+ render() {
38
+ return p`
39
+ ${this.content()}
40
+ `;
41
+ }
42
+ };
43
+ e.styles = u([
44
+ f,
45
+ v`
46
+ :host {
47
+ display: block;
48
+ }
49
+ .slide {
50
+ height: 100%;
51
+ }
52
+ ::slotted(*) {
53
+ height: 100%;
54
+ }
55
+ `
56
+ ]);
57
+ n([
58
+ a()
59
+ ], e.prototype, "contentType", 2);
60
+ n([
61
+ a({ type: Boolean })
62
+ ], e.prototype, "active", 2);
63
+ e = n([
64
+ d(`${g}-slide`)
65
+ ], e);
66
+ export {
67
+ e as Slide
68
+ };
@@ -0,0 +1,258 @@
1
+ import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
2
+ import { html as o, nothing as b } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
3
+ import { LitElement as f } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
4
+ import { property as l } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
5
+ import { customElement as y } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
6
+ import { state as m } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/state.js";
7
+ import { map as c } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/map.js";
8
+ import { range as d } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/range.js";
9
+ import { classMap as h } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
10
+ import { global as _ } from "../../styles/global.js";
11
+ import { controls as v } from "./styles/controls.js";
12
+ import { linkState as g } from "../../styles/link.js";
13
+ import { settings as $ } from "../../scripts/settings.js";
14
+ import { mergeStyles as P } from "../../scripts/mergeStyles.js";
15
+ var C = Object.defineProperty, k = Object.getOwnPropertyDescriptor, i = (t, s, r, n) => {
16
+ for (var u = n > 1 ? void 0 : n ? k(s, r) : s, a = t.length - 1, p; a >= 0; a--)
17
+ (p = t[a]) && (u = (n ? p(s, r, u) : p(u)) || u);
18
+ return n && u && C(s, r, u), u;
19
+ };
20
+ const { prefix: O } = $;
21
+ let e = class extends f {
22
+ constructor() {
23
+ super(...arguments), this.sliderId = "", this.controlType = "counter", this.controlPosition = "under", this.numberOfSlides = 1, this.slidesPerPage = 1, this.currentPage = 1, this.autoPlay = !1, this.loopSlides = !1, this.playing = !0, this._pauseHold = !1, this._positionInside = !1, this._positionControls = (t) => {
24
+ t.forEach((s) => {
25
+ this === s.target && (!s.isIntersecting ? this._positionInside = !0 : this._positionInside = !1);
26
+ });
27
+ };
28
+ }
29
+ updated(t) {
30
+ if (super.updated(t), this.controlPosition === "outside") {
31
+ const s = {
32
+ root: document.querySelector("document"),
33
+ rootMargin: "0px -112px 0px -112px",
34
+ threshold: 1
35
+ };
36
+ !this._overflowObserver && this && (this._overflowObserver = new IntersectionObserver(this._positionControls, s), this._overflowObserver.observe(this));
37
+ }
38
+ }
39
+ _dispatchControlAction(t, s) {
40
+ const r = t.currentTarget;
41
+ if (!(r && r.getAttribute("disabled")) && ("onscrollend" in window || (r.style.setProperty("pointer-events", "none"), setTimeout(() => {
42
+ r.style.setProperty("pointer-events", "auto");
43
+ }, 1100 / this.slidesPerPage)), (s === "pause-slider" || s === "play-slider") && this.dispatchEvent(new CustomEvent(s, { bubbles: !0, composed: !0 })), (s === "previous-slide" || s === "next-slide") && this.dispatchEvent(new CustomEvent(s, { bubbles: !0, composed: !0 })), s === "pause-over" && (this.dispatchEvent(new CustomEvent(s, { bubbles: !0, composed: !0 })), this.playing ? this._pauseHold = !0 : this._pauseHold = !1), s === "pause-out" && this.playing && (this.dispatchEvent(new CustomEvent(s, { bubbles: !0, composed: !0 })), this._pauseHold = !1), s === "slide-link")) {
44
+ const n = t.currentTarget, u = n ? n.dataset.slide : null;
45
+ this.dispatchEvent(
46
+ new CustomEvent(
47
+ s,
48
+ {
49
+ detail: {
50
+ slideNumber: u
51
+ },
52
+ bubbles: !0,
53
+ composed: !0
54
+ }
55
+ )
56
+ );
57
+ }
58
+ }
59
+ controlClasses() {
60
+ const t = {};
61
+ return this.controlPosition === "outside" && !this._positionInside ? t["slider-controls--outside"] = !0 : (this.controlPosition === "outside" && this._positionInside || this.controlPosition === "inside") && (t["slider-controls--inside"] = !0), t;
62
+ }
63
+ counterClasses() {
64
+ const t = {};
65
+ return t["slider-counter--" + this.controlType] = !0, t.caption = this.controlType === "counter" || this.controlType === "numbers", t;
66
+ }
67
+ numberButtons() {
68
+ return o`
69
+ ${c(d(1, this.numberOfSlides + 1, 1), (t) => t === this.currentPage ? o`
70
+ <button
71
+ class="slider-counter__link slider-counter__link--numbers link link--active"
72
+ @click="${(s) => this._dispatchControlAction(s, "slide-link")}"
73
+ data-slide=${t}
74
+ >
75
+ ${t}
76
+ </button>
77
+ ` : o`
78
+ <button
79
+ class="slider-counter__link slider-counter__link--numbers link"
80
+ @click="${(s) => this._dispatchControlAction(s, "slide-link")}"
81
+ data-slide=${t}
82
+ >
83
+ ${t}
84
+ </button>
85
+ `)}
86
+ `;
87
+ }
88
+ dotButtons() {
89
+ return o`
90
+ ${c(d(1, this.numberOfSlides + 1, 1), (t) => t === this.currentPage ? o`
91
+ <button
92
+ class="slider-counter__link slider-counter__link--dots slider-counter__link--active link"
93
+ @click="${(s) => this._dispatchControlAction(s, "slide-link")}"
94
+ data-slide="${t}"
95
+ >
96
+ <span class="dot"></span>
97
+ </button>
98
+ ` : o`
99
+ <button
100
+ class="slider-counter__link slider-counter__link--dots link"
101
+ @click="${(s) => this._dispatchControlAction(s, "slide-link")}"
102
+ data-slide="${t}"
103
+ >
104
+ <span class="dot"></span>
105
+ </button>
106
+ `)}
107
+ `;
108
+ }
109
+ controlVisualType() {
110
+ return this.controlType === "counter" ? o`
111
+ <span
112
+ class="slider-counter--current"
113
+ part="counter-current"
114
+ >
115
+ ${this.currentPage}
116
+ </span>
117
+ <span
118
+ aria-hidden="true"
119
+ part="counter-seperator"
120
+ >
121
+ /
122
+ </span>
123
+ <span class="visually-hidden">of</span>
124
+ <span
125
+ class="slider-counter--total"
126
+ part="counter-total"
127
+ >
128
+ ${this.numberOfSlides}
129
+ </span>
130
+ ` : this.controlType === "numbers" ? o`
131
+ ${this.numberButtons()}
132
+ ` : o`
133
+ ${this.dotButtons()}
134
+ `;
135
+ }
136
+ autoPlayButtons() {
137
+ return this.autoPlay && this.playing ? o`
138
+ <div class="autoplay-buttons" part="autoplay-container">
139
+ <umg-button-icon
140
+ for=${this.sliderId}
141
+ label="Pause slides"
142
+ icon=${this._pauseHold === !0 ? "play-pause" : "pause"}
143
+ size="small"
144
+ @click="${(t) => this._dispatchControlAction(t, "pause-slider")}"
145
+ @mouseover="${(t) => this._dispatchControlAction(t, "pause-over")}"
146
+ @mouseout="${(t) => this._dispatchControlAction(t, "pause-out")}"
147
+ @focusin="${(t) => this._dispatchControlAction(t, "pause-over")}"
148
+ @focusout="${(t) => this._dispatchControlAction(t, "pause-out")}"
149
+ >
150
+ </umg-button-icon>
151
+ </div>
152
+ ` : this.autoPlay && !this.playing ? o`
153
+ <umg-button-icon
154
+ class="autoplay-buttons"
155
+ for=${this.sliderId}
156
+ label="Autoplay slides"
157
+ icon="play"
158
+ size="small"
159
+ @click="${(t) => this._dispatchControlAction(t, "play-slider")}"
160
+ >
161
+ </umg-button-icon>
162
+ ` : b;
163
+ }
164
+ navigationButton(t) {
165
+ const s = t === "next" ? !this.loopSlides && this.currentPage === this.numberOfSlides : !this.loopSlides && this.currentPage === 1, r = t === "next" ? "next-slide" : "previous-slide";
166
+ return this.controlPosition === "under" ? o`
167
+ <umg-button-icon
168
+ class="${t}-button"
169
+ for=${this.sliderId}
170
+ label="Next"
171
+ icon="chevron-${t === "next" ? "right" : "left"}"
172
+ size="small"
173
+ ?disabled=${s}
174
+ @click="${(n) => this._dispatchControlAction(n, r)}"
175
+ >
176
+ </umg-button-icon>
177
+ ` : o`
178
+ <umg-button-icon
179
+ id="OuterButton"
180
+ class="${t}-button"
181
+ for=${this.sliderId}
182
+ label="Next"
183
+ icon="chevron-${t === "next" ? "right" : "left"}"
184
+ size="large"
185
+ padding="12"
186
+ ?disabled=${s}
187
+ colorText="255,255,255"
188
+ colorBg="0,0,0"
189
+ colorBgOpacity="0.3"
190
+ border
191
+ borderWidth="10"
192
+ borderRadius="40"
193
+ @click="${(n) => this._dispatchControlAction(n, r)}"
194
+ >
195
+ </umg-button-icon>
196
+ `;
197
+ }
198
+ render() {
199
+ if (this.numberOfSlides > 1)
200
+ return o`
201
+ <div class="slider-controls${h(this.controlClasses())}" part="slider-controls">
202
+ ${this.navigationButton("previous")}
203
+ <div class="slider-counter${h(this.counterClasses())}" part="slider-counter">
204
+ ${this.controlVisualType()}
205
+ </div>
206
+ ${this.navigationButton("next")}
207
+ ${this.autoPlayButtons()}
208
+ </div>
209
+ `;
210
+ }
211
+ };
212
+ e.styles = P([
213
+ _,
214
+ v,
215
+ g
216
+ ]);
217
+ i([
218
+ l()
219
+ ], e.prototype, "sliderId", 2);
220
+ i([
221
+ l()
222
+ ], e.prototype, "controlType", 2);
223
+ i([
224
+ l()
225
+ ], e.prototype, "controlPosition", 2);
226
+ i([
227
+ l({ type: Number })
228
+ ], e.prototype, "numberOfSlides", 2);
229
+ i([
230
+ l({ type: Number })
231
+ ], e.prototype, "slidesPerPage", 2);
232
+ i([
233
+ l({ type: Number })
234
+ ], e.prototype, "currentPage", 2);
235
+ i([
236
+ l({ type: Boolean })
237
+ ], e.prototype, "autoPlay", 2);
238
+ i([
239
+ l({ type: Boolean })
240
+ ], e.prototype, "loopSlides", 2);
241
+ i([
242
+ l({ type: Boolean })
243
+ ], e.prototype, "playing", 2);
244
+ i([
245
+ l({ state: !0, type: Boolean })
246
+ ], e.prototype, "_pauseHold", 2);
247
+ i([
248
+ m()
249
+ ], e.prototype, "_positionInside", 2);
250
+ i([
251
+ m()
252
+ ], e.prototype, "_overflowObserver", 2);
253
+ e = i([
254
+ y(`${O}-slider-controls`)
255
+ ], e);
256
+ export {
257
+ e as SliderControls
258
+ };