@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.
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js +56 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js +13 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js +37 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query.js +34 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js +260 -0
- package/dist/node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js +50 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js +37 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js +10 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/map.js +15 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/range.js +14 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js +39 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js +259 -0
- package/dist/packages/web-components/classes/event-manager/event-manager.js +50 -0
- package/dist/packages/web-components/classes/index.js +4 -0
- package/dist/packages/web-components/components/badge/badge.js +146 -0
- package/dist/packages/web-components/components/banner/banner.js +389 -0
- package/dist/packages/web-components/components/banner-image/banner-image.js +161 -0
- package/dist/packages/web-components/components/box/box.js +208 -0
- package/dist/packages/web-components/components/button/button.js +336 -0
- package/dist/packages/web-components/components/button-group/button-group.js +98 -0
- package/dist/packages/web-components/components/button-icon/button-icon.js +246 -0
- package/dist/packages/web-components/components/caption-card/caption-card.js +331 -0
- package/dist/packages/web-components/components/deferred-media/deferred-media.js +212 -0
- package/dist/packages/web-components/components/disclosure/disclosure.js +255 -0
- package/dist/packages/web-components/components/event-table/event-content.js +106 -0
- package/dist/packages/web-components/components/event-table/event-date.js +45 -0
- package/dist/packages/web-components/components/event-table/event-table.js +74 -0
- package/dist/packages/web-components/components/event-table/event.js +45 -0
- package/dist/packages/web-components/components/footer/footer.js +153 -0
- package/dist/packages/web-components/components/grid/grid-cell.js +40 -0
- package/dist/packages/web-components/components/grid/grid.js +106 -0
- package/dist/packages/web-components/components/header/header.js +368 -0
- package/dist/packages/web-components/components/header-drawer/header-drawer.js +292 -0
- package/dist/packages/web-components/components/header-drawer/menu-drawer.js +176 -0
- package/dist/packages/web-components/components/horizontal-stack/horizontal-stack.js +93 -0
- package/dist/packages/web-components/components/icon/icon.js +81 -0
- package/dist/packages/web-components/components/icon/icons.svg.js +191 -0
- package/dist/packages/web-components/components/image/image.js +157 -0
- package/dist/packages/web-components/components/index.js +82 -0
- package/dist/packages/web-components/components/link/link.js +95 -0
- package/dist/packages/web-components/components/link-group/link-group.js +126 -0
- package/dist/packages/web-components/components/logo/logo.js +161 -0
- package/dist/packages/web-components/components/media-gallery/media-gallery.js +82 -0
- package/dist/packages/web-components/components/media-gallery/media.js +31 -0
- package/dist/packages/web-components/components/media-text/media-text.js +276 -0
- package/dist/packages/web-components/components/media-text/styles/media-size.js +119 -0
- package/dist/packages/web-components/components/menu/menu.js +328 -0
- package/dist/packages/web-components/components/modal/modal.js +143 -0
- package/dist/packages/web-components/components/number-field/number-field.js +339 -0
- package/dist/packages/web-components/components/overlay/overlay.js +77 -0
- package/dist/packages/web-components/components/page/page.js +105 -0
- package/dist/packages/web-components/components/popover/popover.js +163 -0
- package/dist/packages/web-components/components/rich-text/rich-text.js +126 -0
- package/dist/packages/web-components/components/section/section.js +400 -0
- package/dist/packages/web-components/components/select/select.js +359 -0
- package/dist/packages/web-components/components/slider/slide.js +68 -0
- package/dist/packages/web-components/components/slider/slider-controls.js +258 -0
- package/dist/packages/web-components/components/slider/slider.js +374 -0
- package/dist/packages/web-components/components/slider/styles/controls.js +98 -0
- package/dist/packages/web-components/components/slider/styles/slider.js +233 -0
- package/dist/packages/web-components/components/socials/socials.js +96 -0
- package/dist/packages/web-components/components/table/table.js +158 -0
- package/dist/packages/web-components/components/text/text.js +245 -0
- package/dist/packages/web-components/components/text-field/text-field.js +257 -0
- package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slide.js +51 -0
- package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slider.js +88 -0
- package/dist/packages/web-components/components/vertical-stack/vertical-stack.js +95 -0
- package/dist/packages/web-components/components/video/video.js +185 -0
- package/dist/packages/web-components/scripts/mergeStyles.js +8 -0
- package/dist/packages/web-components/scripts/polyfills/scrollyfills.js +43 -0
- package/dist/packages/web-components/scripts/settings.js +7 -0
- package/dist/packages/web-components/scripts/themeStyleSheet.js +9 -0
- package/dist/packages/web-components/scripts/utilities/debounce.js +9 -0
- package/dist/packages/web-components/scripts/utilities/paddingTransformations.js +46 -0
- package/dist/packages/web-components/styles/button.js +55 -0
- package/dist/packages/web-components/styles/fonts.js +181 -0
- package/dist/packages/web-components/styles/global.js +40 -0
- package/dist/packages/web-components/styles/grid.js +114 -0
- package/dist/packages/web-components/styles/group.js +121 -0
- package/dist/packages/web-components/styles/icon-size.js +19 -0
- package/dist/packages/web-components/styles/link.js +30 -0
- package/dist/packages/web-components/styles/placeholder-media.js +27 -0
- package/package.json +92 -0
- package/readme.md +266 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as l } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as h } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as m } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as e } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { ifDefined as b } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js";
|
|
7
|
+
import { classMap as p } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
8
|
+
import { styleMap as d } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js";
|
|
9
|
+
import { global as f } from "../../styles/global.js";
|
|
10
|
+
import { iconSize as y } from "../../styles/icon-size.js";
|
|
11
|
+
import { settings as g } from "../../scripts/settings.js";
|
|
12
|
+
import { mergeStyles as v } from "../../scripts/mergeStyles.js";
|
|
13
|
+
import "../icon/icon.js";
|
|
14
|
+
import { css as x } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
15
|
+
var $ = Object.defineProperty, w = Object.getOwnPropertyDescriptor, i = (t, n, a, s) => {
|
|
16
|
+
for (var r = s > 1 ? void 0 : s ? w(n, a) : n, c = t.length - 1, u; c >= 0; c--)
|
|
17
|
+
(u = t[c]) && (r = (s ? u(n, a, r) : u(r)) || r);
|
|
18
|
+
return s && r && $(n, a, r), r;
|
|
19
|
+
};
|
|
20
|
+
const { prefix: I } = g;
|
|
21
|
+
let o = class extends h {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(), this.as = "button", this.for = void 0, this.clickAction = void 0, this.url = void 0, this.target = "_self", this.type = "button", this.icon = "user", this.size = "xLarge", this.extendInteraction = !1, this.disabled = !1, this.padding = "", this.border = !1, this.label = "Accessible", this._extendedInteraction();
|
|
24
|
+
}
|
|
25
|
+
async _extendedInteraction() {
|
|
26
|
+
await this.updateComplete, !this.disabled && this.as === "link" && this.url !== void 0 && this.extendInteraction && this.dispatchEvent(new CustomEvent("extend-interaction", {
|
|
27
|
+
detail: {
|
|
28
|
+
url: this.url,
|
|
29
|
+
target: this.target
|
|
30
|
+
},
|
|
31
|
+
bubbles: !0,
|
|
32
|
+
composed: !0
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
handleClick() {
|
|
36
|
+
if (!this.disabled && this.clickAction) {
|
|
37
|
+
const t = new CustomEvent(this.clickAction, {
|
|
38
|
+
bubbles: !0,
|
|
39
|
+
composed: !0
|
|
40
|
+
});
|
|
41
|
+
this.dispatchEvent(t);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
buttonIconClasses() {
|
|
45
|
+
return {
|
|
46
|
+
"btn--border": this.border,
|
|
47
|
+
"btn--extend-interactive": this.extendInteraction
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
buttonIconStyles() {
|
|
51
|
+
let t = {};
|
|
52
|
+
return this.border && (t = {
|
|
53
|
+
...t,
|
|
54
|
+
"--um-border-button-icon-width": "var(--um-border-width-" + this.borderWidth + ")"
|
|
55
|
+
}), this.borderRadius && (t = {
|
|
56
|
+
...t,
|
|
57
|
+
"--um-border-button-icon-radius": "var(--um-border-radius-" + this.borderRadius + ")"
|
|
58
|
+
}), this.padding && (t = {
|
|
59
|
+
...t,
|
|
60
|
+
"--um-space-button-icon-padding": "var(--um-space-" + this.padding + ", 0)"
|
|
61
|
+
}), this.colorBgOpacity && (t = {
|
|
62
|
+
...t,
|
|
63
|
+
"--um-opacity-button-icon-bg": this.colorBgOpacity
|
|
64
|
+
}), this.colorBg && (t = {
|
|
65
|
+
...t,
|
|
66
|
+
"--um-color-button-icon-bg": this.colorBg
|
|
67
|
+
}), this.colorText && (t = {
|
|
68
|
+
...t,
|
|
69
|
+
"--um-color-button-icon-text": this.colorText
|
|
70
|
+
}), this.size && (t = {
|
|
71
|
+
...t,
|
|
72
|
+
"--um-font-size-button-icon": y(this.size)
|
|
73
|
+
}), t;
|
|
74
|
+
}
|
|
75
|
+
buttonAs() {
|
|
76
|
+
if (this.as === "button" || this.url === void 0 || this.url === "")
|
|
77
|
+
return l`
|
|
78
|
+
<button
|
|
79
|
+
type=${this.type}
|
|
80
|
+
class="button-icon${p(this.buttonIconClasses())}"
|
|
81
|
+
style="${d(this.buttonIconStyles())}"
|
|
82
|
+
?disabled=${this.disabled}
|
|
83
|
+
aria-label=${this.label}
|
|
84
|
+
aria-controls=${b(this.for)}
|
|
85
|
+
clickAction=${b(this.clickAction)}
|
|
86
|
+
@click=${this.handleClick}
|
|
87
|
+
part="button-icon"
|
|
88
|
+
>
|
|
89
|
+
<umg-icon
|
|
90
|
+
icon=${this.icon}
|
|
91
|
+
part="umg-icon"
|
|
92
|
+
exportparts="icon"
|
|
93
|
+
>
|
|
94
|
+
</umg-icon>
|
|
95
|
+
</button>
|
|
96
|
+
`;
|
|
97
|
+
if (this.url)
|
|
98
|
+
return l`
|
|
99
|
+
<a
|
|
100
|
+
href="${this.url}"
|
|
101
|
+
class="button-icon${p(this.buttonIconClasses())}"
|
|
102
|
+
style="${d(this.buttonIconStyles())}"
|
|
103
|
+
target="${this.target}"
|
|
104
|
+
?disabled=${this.disabled}
|
|
105
|
+
aria-label=${this.label}
|
|
106
|
+
part="button-icon"
|
|
107
|
+
>
|
|
108
|
+
<umg-icon
|
|
109
|
+
icon=${this.icon}
|
|
110
|
+
part="umg-icon"
|
|
111
|
+
exportparts="icon"
|
|
112
|
+
>
|
|
113
|
+
</umg-icon>
|
|
114
|
+
</a>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
return l`
|
|
119
|
+
${this.buttonAs()}
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
o.styles = v([
|
|
124
|
+
f,
|
|
125
|
+
x`
|
|
126
|
+
:host {
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
}
|
|
129
|
+
button[disabled] {
|
|
130
|
+
opacity: 0.3;
|
|
131
|
+
cursor: default;
|
|
132
|
+
}
|
|
133
|
+
.button-icon {
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
color: rgb(var(--um-color-button-icon-text, 0,0,0), var(--um-opacity-button-icon-inactive, 1));
|
|
136
|
+
background-color: rgb(var(--um-color-button-icon-bg, 240,240,240), var(--um-opacity-button-icon-bg, 0));
|
|
137
|
+
border: none;
|
|
138
|
+
border-radius: var(--um-border-button-icon-radius, 0);
|
|
139
|
+
font-size: var(--um-font-size-button-icon, 1.5rem);
|
|
140
|
+
padding: 0;
|
|
141
|
+
}
|
|
142
|
+
a.button-icon {
|
|
143
|
+
display: inline-block;
|
|
144
|
+
line-height: normal
|
|
145
|
+
}
|
|
146
|
+
.button-icon > * {
|
|
147
|
+
position: relative;
|
|
148
|
+
display: block;
|
|
149
|
+
padding: var(--um-space-button-icon-padding, 0.5rem);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* States */
|
|
153
|
+
.button-icon:hover {
|
|
154
|
+
opacity: 0.7;
|
|
155
|
+
}
|
|
156
|
+
.button-icon[disabled]:hover {
|
|
157
|
+
opacity: 0.3;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Behaviour */
|
|
161
|
+
.btn--extend-interactive::after {
|
|
162
|
+
content: '';
|
|
163
|
+
position:absolute;
|
|
164
|
+
top:0;
|
|
165
|
+
left:0;
|
|
166
|
+
height: 100%;
|
|
167
|
+
width: 100%;
|
|
168
|
+
z-index: 1;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Shape */
|
|
172
|
+
.btn--border > *::after {
|
|
173
|
+
content: '';
|
|
174
|
+
position: absolute;
|
|
175
|
+
left: 0;
|
|
176
|
+
right: 0;
|
|
177
|
+
top: 0;
|
|
178
|
+
bottom: 0;
|
|
179
|
+
box-shadow: 0 0 0 var(--um-border-button-icon-width, var(--um-border-width-10, 0.0625rem)) rgb(var(--um-color-button-icon-text, 255,255,255), var(--um-opacity-button-icon-border, 0.8));
|
|
180
|
+
border-radius: var(--um-border-button-icon-radius, 0);
|
|
181
|
+
}
|
|
182
|
+
.button-icon:hover > *::after {
|
|
183
|
+
box-shadow: 0 0 0 var(--um-border-button-icon-width, var(--um-border-width-10, 0.0625rem)) rgb(var(--um-color-button-icon-text, 255,255,255), 1);
|
|
184
|
+
}
|
|
185
|
+
`
|
|
186
|
+
]);
|
|
187
|
+
i([
|
|
188
|
+
e()
|
|
189
|
+
], o.prototype, "as", 2);
|
|
190
|
+
i([
|
|
191
|
+
e()
|
|
192
|
+
], o.prototype, "for", 2);
|
|
193
|
+
i([
|
|
194
|
+
e()
|
|
195
|
+
], o.prototype, "clickAction", 2);
|
|
196
|
+
i([
|
|
197
|
+
e()
|
|
198
|
+
], o.prototype, "url", 2);
|
|
199
|
+
i([
|
|
200
|
+
e()
|
|
201
|
+
], o.prototype, "target", 2);
|
|
202
|
+
i([
|
|
203
|
+
e()
|
|
204
|
+
], o.prototype, "type", 2);
|
|
205
|
+
i([
|
|
206
|
+
e()
|
|
207
|
+
], o.prototype, "icon", 2);
|
|
208
|
+
i([
|
|
209
|
+
e()
|
|
210
|
+
], o.prototype, "size", 2);
|
|
211
|
+
i([
|
|
212
|
+
e({ type: Boolean })
|
|
213
|
+
], o.prototype, "extendInteraction", 2);
|
|
214
|
+
i([
|
|
215
|
+
e({ type: Boolean, reflect: !0 })
|
|
216
|
+
], o.prototype, "disabled", 2);
|
|
217
|
+
i([
|
|
218
|
+
e()
|
|
219
|
+
], o.prototype, "padding", 2);
|
|
220
|
+
i([
|
|
221
|
+
e({ type: Boolean })
|
|
222
|
+
], o.prototype, "border", 2);
|
|
223
|
+
i([
|
|
224
|
+
e()
|
|
225
|
+
], o.prototype, "borderRadius", 2);
|
|
226
|
+
i([
|
|
227
|
+
e()
|
|
228
|
+
], o.prototype, "borderWidth", 2);
|
|
229
|
+
i([
|
|
230
|
+
e()
|
|
231
|
+
], o.prototype, "colorText", 2);
|
|
232
|
+
i([
|
|
233
|
+
e()
|
|
234
|
+
], o.prototype, "colorBg", 2);
|
|
235
|
+
i([
|
|
236
|
+
e({ type: Number })
|
|
237
|
+
], o.prototype, "colorBgOpacity", 2);
|
|
238
|
+
i([
|
|
239
|
+
e()
|
|
240
|
+
], o.prototype, "label", 2);
|
|
241
|
+
o = i([
|
|
242
|
+
m(`${I}-button-icon`)
|
|
243
|
+
], o);
|
|
244
|
+
export {
|
|
245
|
+
o as ButtonIcon
|
|
246
|
+
};
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as l } 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 u } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as o } 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 v } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js";
|
|
8
|
+
import { classMap as h } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
9
|
+
import { styleMap as f } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js";
|
|
10
|
+
import { EventManager as g } from "../../classes/event-manager/event-manager.js";
|
|
11
|
+
import { global as b } from "../../styles/global.js";
|
|
12
|
+
import { settings as y } from "../../scripts/settings.js";
|
|
13
|
+
import { mergeStyles as _ } from "../../scripts/mergeStyles.js";
|
|
14
|
+
import "../box/box.js";
|
|
15
|
+
import "../vertical-stack/vertical-stack.js";
|
|
16
|
+
import "../popover/popover.js";
|
|
17
|
+
import { css as x } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
18
|
+
var E = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (t, r, s, n) => {
|
|
19
|
+
for (var a = n > 1 ? void 0 : n ? C(r, s) : r, p = t.length - 1, c; p >= 0; p--)
|
|
20
|
+
(c = t[p]) && (a = (n ? c(r, s, a) : c(a)) || a);
|
|
21
|
+
return n && a && E(r, s, a), a;
|
|
22
|
+
};
|
|
23
|
+
const { prefix: M } = y;
|
|
24
|
+
let e = class extends m {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(), this.position = "under", this.colorBlend = !1, this.border = !1, this.opacityOverlay = 0, this.cardPopover = !1, this._popoverVisible = !1, this.cardEventManager = new g(this), this._eventsHandler = (t) => {
|
|
27
|
+
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())), this.cardPopover && (t.pointerType !== "touch" && (t.type === "pointerenter" && !this._popoverVisible && (this._popoverVisible = !0), t.type === "pointerleave" && this._popoverVisible && (this._popoverVisible = !1)), t.pointerType === "touch" && t.type === "pointerenter" && !this._popoverVisible && (this._popoverVisible = !0), t.type === "close-popover" && this._popoverVisible && (this._popoverVisible = !1), t.type === "focusin" && !this._popoverVisible && (this._popoverVisible = !0), t.type === "focusout" && this._popoverVisible && (t.currentTarget.contains(t.relatedTarget) || (this._popoverVisible = !1)));
|
|
28
|
+
}, this.cardEventManager.addEventListener("media-details", this._eventsHandler);
|
|
29
|
+
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
super.connectedCallback(), this.cardPopover && (this.cardEventManager.addEventListener("close-popover", this._eventsHandler), this.cardEventManager.addEventListener("pointerenter", this._eventsHandler), this.cardEventManager.addEventListener("pointerleave", this._eventsHandler), this.cardEventManager.addEventListener("focusin", this._eventsHandler), this.cardEventManager.addEventListener("focusout", this._eventsHandler));
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
this.cardPopover && (this.cardEventManager.removeEventListener("close-popover", this._eventsHandler), this.cardEventManager.removeEventListener("pointerenter", this._eventsHandler), this.cardEventManager.removeEventListener("pointerleave", this._eventsHandler), this.cardEventManager.removeEventListener("focusin", this._eventsHandler), this.cardEventManager.removeEventListener("focusout", this._eventsHandler)), super.disconnectedCallback();
|
|
35
|
+
}
|
|
36
|
+
popoverClose() {
|
|
37
|
+
this._popoverVisible = !1;
|
|
38
|
+
}
|
|
39
|
+
cardClasses() {
|
|
40
|
+
const t = {
|
|
41
|
+
"caption-card--border": this.border
|
|
42
|
+
};
|
|
43
|
+
return this.position === "under" && (t["caption--inline"] = !0, t["caption-position--" + this.position] = !0), this.position === "over" && (t["caption-position--" + this.position] = !0), t;
|
|
44
|
+
}
|
|
45
|
+
cardStyles() {
|
|
46
|
+
let t = {};
|
|
47
|
+
return t = {
|
|
48
|
+
"--um-caption-card-overlay-opacity": this.opacityOverlay,
|
|
49
|
+
"--um-aspect-ratio": this._mediaAspectRatio,
|
|
50
|
+
"--um-mobile-aspect-ratio": this._mobileMediaAspectRatio
|
|
51
|
+
}, this.colorText && (t = {
|
|
52
|
+
...t,
|
|
53
|
+
"--um-color-box-text": this.colorText,
|
|
54
|
+
"--um-color-icon-text": this.colorText
|
|
55
|
+
}), this.colorBg && (t = {
|
|
56
|
+
...t,
|
|
57
|
+
"--um-color-box-bg": this.colorBg
|
|
58
|
+
}), this.opacityBg && (t = {
|
|
59
|
+
...t,
|
|
60
|
+
"--um-opacity-box-bg": this.opacityBg
|
|
61
|
+
}), this.borderRadius && (t = {
|
|
62
|
+
...t,
|
|
63
|
+
"--um-border-caption-card-radius": "var(--um-border-radius-" + this.borderRadius + ")"
|
|
64
|
+
}), this.colorOverlay && (t = {
|
|
65
|
+
...t,
|
|
66
|
+
"--um-caption-card-overlay-color": this.colorOverlay
|
|
67
|
+
}), t;
|
|
68
|
+
}
|
|
69
|
+
captionClasses() {
|
|
70
|
+
const t = {};
|
|
71
|
+
return this.align && (t["caption-align--" + this.align] = !0), this.justify && (t["caption-justify--" + this.justify] = !0), t;
|
|
72
|
+
}
|
|
73
|
+
popoverContent() {
|
|
74
|
+
if (this.cardPopover)
|
|
75
|
+
return l`
|
|
76
|
+
<umg-popover slot="popover" ?visible=${this._popoverVisible}>
|
|
77
|
+
<slot name="popover-title" slot="title"></slot>
|
|
78
|
+
<slot name="popover-content" slot="content"></slot>
|
|
79
|
+
</umg-popover>
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
return l`
|
|
84
|
+
<div
|
|
85
|
+
part="caption-card"
|
|
86
|
+
class="caption-card${h(this.cardClasses())}"
|
|
87
|
+
style="${f(this.cardStyles())}"
|
|
88
|
+
tabindex=${this.cardPopover ? "0" : "-1"}
|
|
89
|
+
>
|
|
90
|
+
<div class="caption-card__inner">
|
|
91
|
+
<div part="media" class="media">
|
|
92
|
+
<slot name="media"></slot>
|
|
93
|
+
<div class="badge">
|
|
94
|
+
<slot name="badge"></slot>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
<div part="caption" class="caption${h(this.captionClasses())}">
|
|
98
|
+
<div class="caption-inner">
|
|
99
|
+
<umg-box
|
|
100
|
+
padding=${v(this.padding)}
|
|
101
|
+
mobilePadding=${v(this.mobilePadding)}
|
|
102
|
+
?colorBlend="${this.colorBlend}"
|
|
103
|
+
blendDirection="to-top"
|
|
104
|
+
>
|
|
105
|
+
<umg-vertical-stack
|
|
106
|
+
class="caption-stack"
|
|
107
|
+
gap="${this.spacing ? this.spacing : "12"}"
|
|
108
|
+
justify="space-between"
|
|
109
|
+
>
|
|
110
|
+
<slot name="content"></slot>
|
|
111
|
+
</umg-vertical-stack>
|
|
112
|
+
</umg-box>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
${this.popoverContent()}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
`;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
e.styles = _([
|
|
122
|
+
b,
|
|
123
|
+
x`
|
|
124
|
+
:host {
|
|
125
|
+
position: relative;
|
|
126
|
+
display: block;
|
|
127
|
+
height: 100%;
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Card */
|
|
132
|
+
.caption-card {
|
|
133
|
+
position: relative;
|
|
134
|
+
height: 100%;
|
|
135
|
+
width: 100%;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
}
|
|
138
|
+
.caption-card__inner {
|
|
139
|
+
height: 100%;
|
|
140
|
+
position: relative;
|
|
141
|
+
border-radius: var(--um-border-caption-card-radius);
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Card overlay */
|
|
146
|
+
.caption-card__inner::after {
|
|
147
|
+
content: '';
|
|
148
|
+
background-color: rgba(var(--um-caption-card-overlay-color),var(--um-caption-card-overlay-opacity, 0));
|
|
149
|
+
display: block;
|
|
150
|
+
height: 100%;
|
|
151
|
+
left: 0;
|
|
152
|
+
position: absolute;
|
|
153
|
+
top: 0;
|
|
154
|
+
width: 100%;
|
|
155
|
+
z-index: 1;
|
|
156
|
+
pointer-events: none;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Card padded border */
|
|
160
|
+
.caption-card--border .caption-card__inner {
|
|
161
|
+
padding: var(--um-space-16);
|
|
162
|
+
background-color: rgb(var(--um-color-box-bg), var(--um-opacity-box-bg))
|
|
163
|
+
}
|
|
164
|
+
.caption-card--border .caption ::part(box-content) {
|
|
165
|
+
background-color: transparent;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Card badge */
|
|
169
|
+
.badge {
|
|
170
|
+
position: absolute;
|
|
171
|
+
top: 0;
|
|
172
|
+
left: 0;
|
|
173
|
+
z-index: 1;
|
|
174
|
+
letter-spacing: 0.07rem;
|
|
175
|
+
pointer-events: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Caption content */
|
|
179
|
+
.caption {
|
|
180
|
+
flex: 1;
|
|
181
|
+
z-index: 20;
|
|
182
|
+
}
|
|
183
|
+
.caption pu-vertical-stack ::slotted(:last-child) {
|
|
184
|
+
margin-top: auto;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Media content */
|
|
188
|
+
.media {
|
|
189
|
+
position: relative;
|
|
190
|
+
aspect-ratio: var(--um-mobile-aspect-ratio);
|
|
191
|
+
flex-shrink: 1;
|
|
192
|
+
height: auto;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@media only screen and (min-width: 30.06rem) {
|
|
196
|
+
.media {
|
|
197
|
+
aspect-ratio: var(--um-aspect-ratio);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Caption positioning */
|
|
202
|
+
.caption--inline .caption-card__inner {
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-direction: column;
|
|
205
|
+
}
|
|
206
|
+
.caption-position--under .media {
|
|
207
|
+
order: 1;
|
|
208
|
+
}
|
|
209
|
+
.caption-position--under .caption {
|
|
210
|
+
order: 2;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@media only screen and (min-width: 30.06rem) {
|
|
214
|
+
.caption-card:not(.caption--inline) .caption {
|
|
215
|
+
position: absolute;
|
|
216
|
+
top: 0;
|
|
217
|
+
left: 0;
|
|
218
|
+
height: 100%;
|
|
219
|
+
width: 100%;
|
|
220
|
+
z-index: 10;
|
|
221
|
+
}
|
|
222
|
+
.caption-position--over {
|
|
223
|
+
aspect-ratio: var(--um-mobile-aspect-ratio);
|
|
224
|
+
height: auto;
|
|
225
|
+
aspect-ratio: var(--um-aspect-ratio);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Caption alignment */
|
|
230
|
+
.caption-card .caption-inner {
|
|
231
|
+
display: flex;
|
|
232
|
+
height: 100%;
|
|
233
|
+
width: 100%;
|
|
234
|
+
}
|
|
235
|
+
.caption-align--start .caption-inner {
|
|
236
|
+
align-items: start;
|
|
237
|
+
}
|
|
238
|
+
.caption-align--center .caption-inner {
|
|
239
|
+
align-items: center;
|
|
240
|
+
}
|
|
241
|
+
.caption-align--end .caption-inner {
|
|
242
|
+
align-items: end;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* Caption text alignment */
|
|
246
|
+
.caption-justify--start .caption-inner {
|
|
247
|
+
justify-content: start;
|
|
248
|
+
text-align: left;
|
|
249
|
+
}
|
|
250
|
+
.caption-justify--center .caption-inner {
|
|
251
|
+
justify-content: center;
|
|
252
|
+
text-align: center;
|
|
253
|
+
}
|
|
254
|
+
.caption-justify--end .caption-inner {
|
|
255
|
+
justify-content: end;
|
|
256
|
+
text-align: right;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* Extended interaction */
|
|
260
|
+
.caption-card.is-button .media {
|
|
261
|
+
position: relative;
|
|
262
|
+
}
|
|
263
|
+
.caption-card.is-button .media::after {
|
|
264
|
+
content: '';
|
|
265
|
+
position: absolute;
|
|
266
|
+
inset: 0;
|
|
267
|
+
z-index: 10;
|
|
268
|
+
cursor: pointer;
|
|
269
|
+
}
|
|
270
|
+
`
|
|
271
|
+
]);
|
|
272
|
+
i([
|
|
273
|
+
o()
|
|
274
|
+
], e.prototype, "position", 2);
|
|
275
|
+
i([
|
|
276
|
+
o()
|
|
277
|
+
], e.prototype, "align", 2);
|
|
278
|
+
i([
|
|
279
|
+
o()
|
|
280
|
+
], e.prototype, "justify", 2);
|
|
281
|
+
i([
|
|
282
|
+
o()
|
|
283
|
+
], e.prototype, "padding", 2);
|
|
284
|
+
i([
|
|
285
|
+
o()
|
|
286
|
+
], e.prototype, "mobilePadding", 2);
|
|
287
|
+
i([
|
|
288
|
+
o()
|
|
289
|
+
], e.prototype, "spacing", 2);
|
|
290
|
+
i([
|
|
291
|
+
o()
|
|
292
|
+
], e.prototype, "colorBg", 2);
|
|
293
|
+
i([
|
|
294
|
+
o()
|
|
295
|
+
], e.prototype, "colorText", 2);
|
|
296
|
+
i([
|
|
297
|
+
o()
|
|
298
|
+
], e.prototype, "opacityBg", 2);
|
|
299
|
+
i([
|
|
300
|
+
o({ type: Boolean })
|
|
301
|
+
], e.prototype, "colorBlend", 2);
|
|
302
|
+
i([
|
|
303
|
+
o({ type: Boolean })
|
|
304
|
+
], e.prototype, "border", 2);
|
|
305
|
+
i([
|
|
306
|
+
o()
|
|
307
|
+
], e.prototype, "borderRadius", 2);
|
|
308
|
+
i([
|
|
309
|
+
o()
|
|
310
|
+
], e.prototype, "colorOverlay", 2);
|
|
311
|
+
i([
|
|
312
|
+
o({ type: Number })
|
|
313
|
+
], e.prototype, "opacityOverlay", 2);
|
|
314
|
+
i([
|
|
315
|
+
o({ type: Boolean })
|
|
316
|
+
], e.prototype, "cardPopover", 2);
|
|
317
|
+
i([
|
|
318
|
+
d()
|
|
319
|
+
], e.prototype, "_mediaAspectRatio", 2);
|
|
320
|
+
i([
|
|
321
|
+
d()
|
|
322
|
+
], e.prototype, "_mobileMediaAspectRatio", 2);
|
|
323
|
+
i([
|
|
324
|
+
d()
|
|
325
|
+
], e.prototype, "_popoverVisible", 2);
|
|
326
|
+
e = i([
|
|
327
|
+
u(`${M}-caption-card`)
|
|
328
|
+
], e);
|
|
329
|
+
export {
|
|
330
|
+
e as CaptionCard
|
|
331
|
+
};
|