@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,328 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as n, nothing as d } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as p } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as h } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as a } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { styleMap as v } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js";
|
|
7
|
+
import { classMap as c } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
8
|
+
import { global as f } from "../../styles/global.js";
|
|
9
|
+
import { settings as _ } from "../../scripts/settings.js";
|
|
10
|
+
import { mergeStyles as b } from "../../scripts/mergeStyles.js";
|
|
11
|
+
import "../disclosure/disclosure.js";
|
|
12
|
+
import { css as y } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
13
|
+
var g = Object.defineProperty, x = Object.getOwnPropertyDescriptor, o = (e, t, i, l) => {
|
|
14
|
+
for (var r = l > 1 ? void 0 : l ? x(t, i) : t, u = e.length - 1, m; u >= 0; u--)
|
|
15
|
+
(m = e[u]) && (r = (l ? m(t, i, r) : m(r)) || r);
|
|
16
|
+
return l && r && g(t, i, r), r;
|
|
17
|
+
};
|
|
18
|
+
const { prefix: w } = _;
|
|
19
|
+
let s = class extends p {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(), this.src = "", this.layout = "extended", this.vertical = !1, this.hideMenuTitle = !1, this.width = "page-width", this.divider = !1, this._outsideClick = (e) => {
|
|
22
|
+
console.log("outside click"), e.composedPath().includes(this) || this._closeDisclosures();
|
|
23
|
+
}, this.addEventListener("summary-click", this._handleMenuEvents);
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
window.removeEventListener("click", this._outsideClick), super.disconnectedCallback();
|
|
27
|
+
}
|
|
28
|
+
async firstUpdated() {
|
|
29
|
+
this.data === void 0 && this.src && await this.fetchData();
|
|
30
|
+
}
|
|
31
|
+
async fetchData() {
|
|
32
|
+
this.data = await fetch(this.src).then((e) => e.json()), this.requestUpdate();
|
|
33
|
+
}
|
|
34
|
+
_handleMenuEvents(e) {
|
|
35
|
+
var t;
|
|
36
|
+
if (e.type === "summary-click" && e.detail.eventName === "open") {
|
|
37
|
+
const i = e.detail.target, l = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll("umg-disclosure");
|
|
38
|
+
l && l.length && l.forEach((r) => {
|
|
39
|
+
r !== i && r.closeDisclosure();
|
|
40
|
+
}), this.dispatchEvent(new CustomEvent("overlay-open", {
|
|
41
|
+
bubbles: !0,
|
|
42
|
+
composed: !0
|
|
43
|
+
})), window.addEventListener("click", this._outsideClick);
|
|
44
|
+
}
|
|
45
|
+
e.type === "summary-click" && e.detail.eventName === "close" && (this.dispatchEvent(new CustomEvent("overlay-close", {
|
|
46
|
+
bubbles: !0,
|
|
47
|
+
composed: !0
|
|
48
|
+
})), window.removeEventListener("click", this._outsideClick));
|
|
49
|
+
}
|
|
50
|
+
_closeDisclosures() {
|
|
51
|
+
var t;
|
|
52
|
+
const e = (t = this.shadowRoot) == null ? void 0 : t.querySelectorAll("umg-disclosure");
|
|
53
|
+
e && e.length && e.forEach((i) => {
|
|
54
|
+
i.closeDisclosure();
|
|
55
|
+
}), this.dispatchEvent(new CustomEvent("overlay-close", {
|
|
56
|
+
bubbles: !0,
|
|
57
|
+
composed: !0
|
|
58
|
+
})), window.removeEventListener("click", this._outsideClick);
|
|
59
|
+
}
|
|
60
|
+
menuStyles() {
|
|
61
|
+
let e = {};
|
|
62
|
+
return this.width === "full-width" && (e = {
|
|
63
|
+
...e,
|
|
64
|
+
"--um-size-page-width": "100%"
|
|
65
|
+
}), this.colorText && (e = {
|
|
66
|
+
...e,
|
|
67
|
+
"--um-color-disclosure-text": this.colorText
|
|
68
|
+
}), this.colorBg && (e = {
|
|
69
|
+
...e,
|
|
70
|
+
"--um-color-disclosure-bg": this.colorBg
|
|
71
|
+
}), e;
|
|
72
|
+
}
|
|
73
|
+
menuClasses() {
|
|
74
|
+
const e = {};
|
|
75
|
+
return this.layout === "compact" && (e["menu--compact"] = !0), e;
|
|
76
|
+
}
|
|
77
|
+
menuListClasses() {
|
|
78
|
+
const e = {};
|
|
79
|
+
return this.vertical && this.layout !== "compact" && (e["menu-list--vertical"] = !0), this.divider && (e["menu-list--divider"] = !0), this.layout === "extended" && (e["menu-list--extended"] = !0), this.layout === "compact" && (e["menu-list--compact"] = !0), e;
|
|
80
|
+
}
|
|
81
|
+
menuTitle(e) {
|
|
82
|
+
return this.layout === "extended" && !this.hideMenuTitle ? n`
|
|
83
|
+
<li class="menu__title" part="menu__title">
|
|
84
|
+
<span>
|
|
85
|
+
${e}
|
|
86
|
+
</span>
|
|
87
|
+
</li>
|
|
88
|
+
` : d;
|
|
89
|
+
}
|
|
90
|
+
menuList() {
|
|
91
|
+
if (this.data)
|
|
92
|
+
return n`
|
|
93
|
+
<nav>
|
|
94
|
+
<ul
|
|
95
|
+
part="menu"
|
|
96
|
+
class="menu${c(this.menuClasses())}"
|
|
97
|
+
style="${v(this.menuStyles())}"
|
|
98
|
+
>
|
|
99
|
+
${this.data.map((e) => n`
|
|
100
|
+
<li>
|
|
101
|
+
${e.subItems ? n`
|
|
102
|
+
<umg-disclosure
|
|
103
|
+
class="menu-disclosure"
|
|
104
|
+
overlay
|
|
105
|
+
>
|
|
106
|
+
<span slot="summary" class="summary" part="summary">
|
|
107
|
+
${e.linkText}
|
|
108
|
+
</span>
|
|
109
|
+
<span slot="icon" class="summary-icon" part="summary-icon">
|
|
110
|
+
<umg-icon
|
|
111
|
+
part="icon"
|
|
112
|
+
icon="chevron-down"
|
|
113
|
+
size="xSmall"
|
|
114
|
+
>
|
|
115
|
+
</umg-icon>
|
|
116
|
+
</span>
|
|
117
|
+
<div
|
|
118
|
+
slot="content"
|
|
119
|
+
class="menu__container${c(this.menuListClasses())}"
|
|
120
|
+
>
|
|
121
|
+
<ul class="menu__list" part="menu-list">
|
|
122
|
+
${this.menuTitle(e.linkText)}
|
|
123
|
+
${e.subItems.map((t) => n`
|
|
124
|
+
<li slot="items">
|
|
125
|
+
${t.subItems ? n`
|
|
126
|
+
<div class="submenu" part="submenu">
|
|
127
|
+
<span class="submenu__title" part="submenu-title">
|
|
128
|
+
${t.linkText}
|
|
129
|
+
</span>
|
|
130
|
+
<ul class="submenu__list" part="submenu-list">
|
|
131
|
+
${t.subItems.map((i) => n`
|
|
132
|
+
<li part="submenu-item" slot="items">
|
|
133
|
+
<a class="submenu__link" part="submenu-link" href="${i.linkUrl}">
|
|
134
|
+
${i.linkText}
|
|
135
|
+
</a>
|
|
136
|
+
</li>
|
|
137
|
+
`)}
|
|
138
|
+
</ul>
|
|
139
|
+
</div>
|
|
140
|
+
` : n`
|
|
141
|
+
<a class="menu__link" href="${t.linkUrl}">
|
|
142
|
+
${t.linkText}
|
|
143
|
+
</a>
|
|
144
|
+
`}
|
|
145
|
+
</li>
|
|
146
|
+
`)}
|
|
147
|
+
</ul>
|
|
148
|
+
</div>
|
|
149
|
+
</umg-disclosure>
|
|
150
|
+
` : n`
|
|
151
|
+
<a class="menu__link" part="submenu-title" href="${e.linkUrl}">
|
|
152
|
+
${e.linkText}
|
|
153
|
+
</a>
|
|
154
|
+
`}
|
|
155
|
+
</li>
|
|
156
|
+
`)}
|
|
157
|
+
</ul>
|
|
158
|
+
</nav>
|
|
159
|
+
`;
|
|
160
|
+
}
|
|
161
|
+
render() {
|
|
162
|
+
return n`
|
|
163
|
+
${this.menuList()}
|
|
164
|
+
`;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
s.styles = b([
|
|
168
|
+
f,
|
|
169
|
+
y`
|
|
170
|
+
.menu {
|
|
171
|
+
display: flex;
|
|
172
|
+
gap: var(--um-space-8, 0.5rem);
|
|
173
|
+
align-items: center;
|
|
174
|
+
color: rgb(var(--um-color-menu-text, var(--um-color-section-text, var(--um-color-base-text, 62,62,62))), 1);
|
|
175
|
+
font-family: var(--um-font-family-menu, inherit);
|
|
176
|
+
font-size: var(--um-font-size-menu, inherit);
|
|
177
|
+
letter-spacing: 0.05rem;
|
|
178
|
+
list-style: none;
|
|
179
|
+
margin: 0;
|
|
180
|
+
padding: 0;
|
|
181
|
+
}
|
|
182
|
+
.menu__title {
|
|
183
|
+
font-weight: var(--um-font-weight-menu, 700);
|
|
184
|
+
text-transform: uppercase;
|
|
185
|
+
width: 100%;
|
|
186
|
+
border-bottom: 0.0625rem solid rgb(var(--um-color-disclosure-text, var(--um-color-section-text, var(--um-color-base-text, 62,62,62))), 0.1);
|
|
187
|
+
padding-bottom: var(--um-space-12, 0.75rem);
|
|
188
|
+
}
|
|
189
|
+
.menu > li > * {
|
|
190
|
+
display: inline-block;
|
|
191
|
+
padding: var(--um-space-8, 0.5rem) var(--um-space-12, 0.75rem);
|
|
192
|
+
}
|
|
193
|
+
.menu__link {
|
|
194
|
+
color: inherit;
|
|
195
|
+
text-decoration: none;
|
|
196
|
+
transition: all var(--um-animation-duration-04, 0.4s) ease;
|
|
197
|
+
}
|
|
198
|
+
.menu__link:hover {
|
|
199
|
+
text-decoration: underline;
|
|
200
|
+
text-underline-offset: 0.3rem;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* Menu disclosure */
|
|
204
|
+
.menu-disclosure {
|
|
205
|
+
position: initial;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.menu-disclosure::part(disclosure-drawer) {
|
|
209
|
+
top: var(--um-size-header-inner-height, 0);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Menus */
|
|
213
|
+
.menu__container.menu-list--divider {
|
|
214
|
+
border-top: 0.0625rem solid rgb(var(--um-color-menu-text, var(--um-color-section-text, var(--um-color-base-text, 62,62,62))), 0.1);
|
|
215
|
+
|
|
216
|
+
}
|
|
217
|
+
.menu__container.menu-list--vertical .submenu__list {
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
gap: var(--um-space-4, 0.25rem);
|
|
220
|
+
}
|
|
221
|
+
.menu__list {
|
|
222
|
+
font-family: var(--um-font-family-menu, inherit);
|
|
223
|
+
font-size: var(--um-font-size-menu, inherit);
|
|
224
|
+
list-style: none;
|
|
225
|
+
padding: var(--um-space-32, 2rem) var(--um-space-48, 3rem);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Extended */
|
|
229
|
+
.menu-list--extended .menu__list {
|
|
230
|
+
display: flex;
|
|
231
|
+
flex-wrap: wrap;
|
|
232
|
+
column-gap: var(--um-space-32, 2rem);
|
|
233
|
+
row-gap: var(--um-space-20, 1.25rem);
|
|
234
|
+
margin: 0 auto;
|
|
235
|
+
max-width: var(--um-size-page-width, 75rem);
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Compact */
|
|
240
|
+
.menu.menu--compact .menu-disclosure::part(disclosure-drawer) {
|
|
241
|
+
top: 4.5rem;
|
|
242
|
+
left: unset;
|
|
243
|
+
right: unset;
|
|
244
|
+
border-radius: var(--um-border-radius-30);
|
|
245
|
+
}
|
|
246
|
+
.menu.menu--compact .menu-disclosure::part(disclosure-content) {
|
|
247
|
+
border: 0.0625rem solid rgb(var(--um-color-disclosure-text, var(--um-color-section-text, var(--um-color-base-text, 62,62,62))), 0.8);
|
|
248
|
+
border-radius: var(--um-border-radius-30);
|
|
249
|
+
}
|
|
250
|
+
.menu-list--compact .menu__list {
|
|
251
|
+
padding: var(--um-space-24, 1.5rem);
|
|
252
|
+
}
|
|
253
|
+
.menu-list--compact .menu__list > *:not(:last-child) {
|
|
254
|
+
margin-bottom: var(--um-space-24, 1.5rem);
|
|
255
|
+
}
|
|
256
|
+
.menu-list--compact .submenu__list {
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
gap: var(--um-space-4, 0.25rem);
|
|
259
|
+
}
|
|
260
|
+
.menu-list--compact .submenu__link {
|
|
261
|
+
padding: var(--um-space-4, 0.25rem) 0;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* Submenus */
|
|
265
|
+
.submenu {
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-direction: column;
|
|
268
|
+
gap: var(--um-space-12, 0.75rem);
|
|
269
|
+
}
|
|
270
|
+
.submenu__title {
|
|
271
|
+
font-size: var(--um-font-size-body-xs, 0.75rem);
|
|
272
|
+
font-weight: var(--um-font-weight-light, 300);
|
|
273
|
+
padding-right: var(--um-space-8, 0.5rem);
|
|
274
|
+
text-transform: uppercase;
|
|
275
|
+
}
|
|
276
|
+
.submenu__list {
|
|
277
|
+
display: flex;
|
|
278
|
+
gap: var(--um-space-12, 0.75rem);
|
|
279
|
+
list-style: none;
|
|
280
|
+
padding: 0;
|
|
281
|
+
}
|
|
282
|
+
.submenu__link {
|
|
283
|
+
display: block;
|
|
284
|
+
color: inherit;
|
|
285
|
+
padding: var(--um-space-4, 0.25rem) var(--um-space-8, 0.5rem);
|
|
286
|
+
padding-left: 0;
|
|
287
|
+
text-decoration: none;
|
|
288
|
+
transition: all var(--um-animation-duration-04, 0.4s) ease;
|
|
289
|
+
}
|
|
290
|
+
.submenu__link:hover {
|
|
291
|
+
text-decoration: underline;
|
|
292
|
+
text-underline-offset: 0.3rem;
|
|
293
|
+
}
|
|
294
|
+
`
|
|
295
|
+
]);
|
|
296
|
+
o([
|
|
297
|
+
a()
|
|
298
|
+
], s.prototype, "src", 2);
|
|
299
|
+
o([
|
|
300
|
+
a({ type: Object })
|
|
301
|
+
], s.prototype, "data", 2);
|
|
302
|
+
o([
|
|
303
|
+
a()
|
|
304
|
+
], s.prototype, "layout", 2);
|
|
305
|
+
o([
|
|
306
|
+
a({ type: Boolean })
|
|
307
|
+
], s.prototype, "vertical", 2);
|
|
308
|
+
o([
|
|
309
|
+
a({ type: Boolean })
|
|
310
|
+
], s.prototype, "hideMenuTitle", 2);
|
|
311
|
+
o([
|
|
312
|
+
a()
|
|
313
|
+
], s.prototype, "width", 2);
|
|
314
|
+
o([
|
|
315
|
+
a({ type: Boolean })
|
|
316
|
+
], s.prototype, "divider", 2);
|
|
317
|
+
o([
|
|
318
|
+
a()
|
|
319
|
+
], s.prototype, "colorText", 2);
|
|
320
|
+
o([
|
|
321
|
+
a()
|
|
322
|
+
], s.prototype, "colorBg", 2);
|
|
323
|
+
s = o([
|
|
324
|
+
h(`${w}-menu`)
|
|
325
|
+
], s);
|
|
326
|
+
export {
|
|
327
|
+
s as Menu
|
|
328
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as m } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as d } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as c } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as p } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { classMap as v } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
7
|
+
import { global as g } from "../../styles/global.js";
|
|
8
|
+
import { settings as u } from "../../scripts/settings.js";
|
|
9
|
+
import { mergeStyles as b } from "../../scripts/mergeStyles.js";
|
|
10
|
+
import "../button-icon/button-icon.js";
|
|
11
|
+
import { css as _ } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
12
|
+
var f = Object.defineProperty, h = Object.getOwnPropertyDescriptor, n = (e, t, a, l) => {
|
|
13
|
+
for (var o = l > 1 ? void 0 : l ? h(t, a) : t, i = e.length - 1, r; i >= 0; i--)
|
|
14
|
+
(r = e[i]) && (o = (l ? r(t, a, o) : r(o)) || o);
|
|
15
|
+
return l && o && f(t, a, o), o;
|
|
16
|
+
};
|
|
17
|
+
const { prefix: x } = u;
|
|
18
|
+
let s = class extends d {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(), this.visible = !1, this.addEventListener("keyup", (e) => {
|
|
21
|
+
e.code.toUpperCase() === "ESCAPE" && this.toggleModal();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback(), window.addEventListener("toggle-modal", this.toggleModal.bind(this));
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
window.removeEventListener("toggle-modal", this.toggleModal.bind(this)), super.disconnectedCallback();
|
|
29
|
+
}
|
|
30
|
+
modalClasses() {
|
|
31
|
+
return {
|
|
32
|
+
"modal--visible": !!this.visible
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
toggleModal() {
|
|
36
|
+
if (this.visible = !this.visible, !this.visible) {
|
|
37
|
+
const e = new CustomEvent("close-modal", {
|
|
38
|
+
bubbles: !0,
|
|
39
|
+
composed: !0
|
|
40
|
+
});
|
|
41
|
+
this.dispatchEvent(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
return m`
|
|
46
|
+
<div
|
|
47
|
+
part="modal"
|
|
48
|
+
class="modal${v(this.modalClasses())}"
|
|
49
|
+
>
|
|
50
|
+
<div class="modal__close">
|
|
51
|
+
<umg-button-icon
|
|
52
|
+
@click=${this.toggleModal}
|
|
53
|
+
type="button"
|
|
54
|
+
icon="close"
|
|
55
|
+
size="xLarge"
|
|
56
|
+
label="Close modal"
|
|
57
|
+
borderRadius="full"
|
|
58
|
+
borderWidth='10'
|
|
59
|
+
colorText="80,80,80"
|
|
60
|
+
colorBg="255,255,255"
|
|
61
|
+
colorBgOpacity="0.7"
|
|
62
|
+
border
|
|
63
|
+
>
|
|
64
|
+
</umg-button-icon>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="modal__content">
|
|
67
|
+
<div class="modal__content-inner">
|
|
68
|
+
<slot name="content"></slot>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
s.styles = b([
|
|
76
|
+
g,
|
|
77
|
+
_`
|
|
78
|
+
/* Base */
|
|
79
|
+
.modal {
|
|
80
|
+
display: none;
|
|
81
|
+
position: fixed;
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
bottom: 0;
|
|
85
|
+
overflow-y: scroll;
|
|
86
|
+
overflow-x: hidden;
|
|
87
|
+
width: 100%;
|
|
88
|
+
z-index: 101;
|
|
89
|
+
background-color: rgba(var(--um-color-modal-bg, 255, 255, 255), var(--um-opacity-modal-bg, 0.9));
|
|
90
|
+
}
|
|
91
|
+
.modal--visible {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
align-items: center;
|
|
95
|
+
}
|
|
96
|
+
.modal__content {
|
|
97
|
+
padding: var(--um-space-48, 3rem) 0;
|
|
98
|
+
width: calc(var(--um-breakpoint-lg, 64rem) - var(--um-space-48, 3rem));
|
|
99
|
+
}
|
|
100
|
+
.modal__content-inner {
|
|
101
|
+
padding: 0 var(--um-space-24, 1.5rem);
|
|
102
|
+
}
|
|
103
|
+
.modal__content-inner ::slotted(*) {
|
|
104
|
+
display: block;
|
|
105
|
+
margin-bottom: var(--um-space-grid-desktop-vertical, 1.5rem);
|
|
106
|
+
}
|
|
107
|
+
.modal__close {
|
|
108
|
+
position: fixed;
|
|
109
|
+
right: var(--um-space-24, 1.5rem);
|
|
110
|
+
top: var(--um-space-24, 1.5rem);
|
|
111
|
+
z-index: 201;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@media only screen and (max-width: 64rem) {
|
|
115
|
+
.modal__close {
|
|
116
|
+
top: var(--um-space-12, 0.75rem);
|
|
117
|
+
right: var(--um-space-12, 0.75rem);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.modal__content {
|
|
121
|
+
padding: var(--um-space-64, 4rem) 0;
|
|
122
|
+
width: 100%;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.modal__content-inner {
|
|
126
|
+
padding: 0 var(--um-space-16, 1rem);
|
|
127
|
+
position: relative;
|
|
128
|
+
}
|
|
129
|
+
.modal__content-inner ::slotted(*) {
|
|
130
|
+
margin-bottom: var(--um-space-grid-mobile-vertical, 1rem);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`
|
|
134
|
+
]);
|
|
135
|
+
n([
|
|
136
|
+
p({ type: Boolean })
|
|
137
|
+
], s.prototype, "visible", 2);
|
|
138
|
+
s = n([
|
|
139
|
+
c(`${x}-modal`)
|
|
140
|
+
], s);
|
|
141
|
+
export {
|
|
142
|
+
s as Modal
|
|
143
|
+
};
|