@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,208 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as h } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as l } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as x } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as d } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.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 { styleMap as c } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js";
|
|
8
|
+
import { classMap as u } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
9
|
+
import { mergePaddingArrays as p, paddingToRem as b, paddingToCssShorthandArray as f } from "../../scripts/utilities/paddingTransformations.js";
|
|
10
|
+
import { global as v } from "../../styles/global.js";
|
|
11
|
+
import { settings as _ } from "../../scripts/settings.js";
|
|
12
|
+
import { mergeStyles as y } from "../../scripts/mergeStyles.js";
|
|
13
|
+
import { css as P } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
14
|
+
var w = Object.defineProperty, B = Object.getOwnPropertyDescriptor, i = (o, r, s, a) => {
|
|
15
|
+
for (var e = a > 1 ? void 0 : a ? B(r, s) : r, n = o.length - 1, g; n >= 0; n--)
|
|
16
|
+
(g = o[n]) && (e = (a ? g(r, s, e) : g(e)) || e);
|
|
17
|
+
return a && e && w(r, s, e), e;
|
|
18
|
+
};
|
|
19
|
+
const { prefix: R } = _;
|
|
20
|
+
let t = class extends l {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments), this.width = "expand", this.colorBlend = !1, this.blendDirection = "to-top", this.border = !1, this.borderRadius = "0";
|
|
23
|
+
}
|
|
24
|
+
firstUpdated() {
|
|
25
|
+
this._mergedPadding = p(this.getPadding()), this._mobilePadding = b(this.mobilePadding);
|
|
26
|
+
}
|
|
27
|
+
updated(o) {
|
|
28
|
+
(o.has("padding") || o.has("paddingTop") || o.has("paddingRight") || o.has("paddingBottom") || o.has("paddingLeft") || o.has("mobilePadding")) && (this._mergedPadding = p(this.getPadding()), this._mobilePadding = b(this.mobilePadding));
|
|
29
|
+
}
|
|
30
|
+
getPadding() {
|
|
31
|
+
const o = [], r = f(this.padding);
|
|
32
|
+
if (r && o.push(...o, r), (this.paddingTop || this.paddingRight || this.paddingBottom || this.paddingLeft) && o.push(...o, [
|
|
33
|
+
this.paddingTop !== void 0 ? this.paddingTop : "",
|
|
34
|
+
this.paddingRight !== void 0 ? this.paddingRight : "",
|
|
35
|
+
this.paddingBottom !== void 0 ? this.paddingBottom : "",
|
|
36
|
+
this.paddingLeft !== void 0 ? this.paddingLeft : ""
|
|
37
|
+
]), o.length)
|
|
38
|
+
return o;
|
|
39
|
+
}
|
|
40
|
+
boxStyles() {
|
|
41
|
+
let o = {};
|
|
42
|
+
return this.maxWidth !== void 0 && this.maxWidth > 0 ? this.style.maxWidth = this.maxWidth / 16 + "rem" : this.maxWidth !== void 0 && this.maxWidth <= 0 && (this.style.maxWidth = "100%"), this.colorText && (o = {
|
|
43
|
+
...o,
|
|
44
|
+
"--um-color-box-text": this.colorText
|
|
45
|
+
}), this.colorBg && (o = {
|
|
46
|
+
...o,
|
|
47
|
+
"--um-color-box-bg": this.colorBg
|
|
48
|
+
}), this.opacity !== void 0 && (o = {
|
|
49
|
+
...o,
|
|
50
|
+
"--um-opacity-box-bg": this.opacity
|
|
51
|
+
}), this.borderRadius !== "0" && (o = {
|
|
52
|
+
...o,
|
|
53
|
+
"--um-border-box-radius": "var(--um-border-radius-" + this.borderRadius + ")"
|
|
54
|
+
}), this._mergedPadding && (o = {
|
|
55
|
+
...o,
|
|
56
|
+
"--um-space-box-padding-top": this._mergedPadding.unitless.top,
|
|
57
|
+
"--um-space-box-padding-right": this._mergedPadding.unitless.right,
|
|
58
|
+
"--um-space-box-padding-bottom": this._mergedPadding.unitless.bottom,
|
|
59
|
+
"--um-space-box-padding-left": this._mergedPadding.unitless.left,
|
|
60
|
+
"--um-space-box-padding-top-rem": this._mergedPadding.rem.top,
|
|
61
|
+
"--um-space-box-padding-right-rem": this._mergedPadding.rem.right,
|
|
62
|
+
"--um-space-box-padding-bottom-rem": this._mergedPadding.rem.bottom,
|
|
63
|
+
"--um-space-box-padding-left-rem": this._mergedPadding.rem.left
|
|
64
|
+
}), this._mobilePadding && (o = {
|
|
65
|
+
...o,
|
|
66
|
+
"--um-space-box-mobile-padding": this._mobilePadding
|
|
67
|
+
}), o;
|
|
68
|
+
}
|
|
69
|
+
boxClasses() {
|
|
70
|
+
const o = {};
|
|
71
|
+
return this.colorBlend && (o["box--gradient"] = !0, o["box--gradient-" + this.blendDirection] = !0), this._mergedPadding ? o["box--responsive-padding"] = !0 : o["box--fixed-padding"] = !0, this.border && (o["box--border"] = !0), this.borderRadius !== "0" && (o["box--border-radius"] = !0), o;
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
return h`
|
|
75
|
+
<div
|
|
76
|
+
class="box${u(this.boxClasses())}"
|
|
77
|
+
style="${c(this.boxStyles())}"
|
|
78
|
+
part="box"
|
|
79
|
+
>
|
|
80
|
+
<div class="box__content" part="box-content">
|
|
81
|
+
<slot></slot>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
t.styles = y([
|
|
88
|
+
v,
|
|
89
|
+
P`
|
|
90
|
+
:host {
|
|
91
|
+
display: block;
|
|
92
|
+
width: var(--um-size-box-width, 100%);
|
|
93
|
+
}
|
|
94
|
+
:host([width=shrink]) {
|
|
95
|
+
width: fit-content;
|
|
96
|
+
}
|
|
97
|
+
:host([width=auto]) {
|
|
98
|
+
width: auto;
|
|
99
|
+
}
|
|
100
|
+
.box {
|
|
101
|
+
height: 100%;
|
|
102
|
+
}
|
|
103
|
+
.box--border {
|
|
104
|
+
border: rgb(var(--um-color-border, 235,235,235)) var(--um-border-box-width, 0.0625rem) solid;
|
|
105
|
+
}
|
|
106
|
+
.box--border-radius {
|
|
107
|
+
border-radius: var(--um-border-box-radius, 0);
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
}
|
|
110
|
+
.box__content {
|
|
111
|
+
color: rgba(var(--um-color-box-text, var(--um-color-section-text, 0,0,0)), 1);
|
|
112
|
+
background-color: rgba(var(--um-color-box-bg, var(--um-color-section-bg, 245,245,245)), var(--um-opacity-box-bg, 1));
|
|
113
|
+
height: 100%;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Gradient background */
|
|
117
|
+
.box--gradient.box--gradient-to-top .box__content {
|
|
118
|
+
background-image: linear-gradient(to top, rgb(var(--um-color-box-bg), 1), rgb(var(--um-color-box-bg), var(--um-opacity-box-bg, 1)));
|
|
119
|
+
}
|
|
120
|
+
.box--gradient.box--gradient-to-bottom .box__content {
|
|
121
|
+
background-image: linear-gradient(to bottom, rgb(var(--um-color-box-bg), 1), rgb(var(--um-color-box-bg), var(--um-opacity-box-bg, 1)));
|
|
122
|
+
}
|
|
123
|
+
.box--gradient.box--gradient-to-left .box__content {
|
|
124
|
+
background-image: linear-gradient(to left, rgb(var(--um-color-box-bg), 1), rgb(var(--um-color-box-bg), var(--um-opacity-box-bg, 1)));
|
|
125
|
+
}
|
|
126
|
+
.box--gradient.box--gradient-to-right .box__content {
|
|
127
|
+
background-image: linear-gradient(to right, rgb(var(--um-color-box-bg), 1), rgb(var(--um-color-box-bg), var(--um-opacity-box-bg, 1)));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* responsive padding */
|
|
131
|
+
.box--responsive-padding .box__content {
|
|
132
|
+
padding-top: clamp(1rem, 100vw * 0.08, var(--um-space-box-padding-top-rem));
|
|
133
|
+
padding-right: clamp(1rem, 100vw * 0.08, var(--um-space-box-padding-right-rem));
|
|
134
|
+
padding-bottom: clamp(1rem, 100vw * 0.08, var(--um-space-box-padding-bottom-rem));
|
|
135
|
+
padding-left: clamp(1rem, 100vw * 0.08, var(--um-space-box-padding-left-rem));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Fixed padding */
|
|
139
|
+
.box--fixed-padding .box__content {
|
|
140
|
+
padding: var(--um-space-box-padding, 0.5rem);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@media screen and (max-width: 48rem) {
|
|
144
|
+
.box__content,
|
|
145
|
+
.box--responsive-padding .box__content,
|
|
146
|
+
.box--fixed-padding .box__content {
|
|
147
|
+
padding: var(--um-space-box-mobile-padding, 0.5rem);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`
|
|
151
|
+
]);
|
|
152
|
+
i([
|
|
153
|
+
d()
|
|
154
|
+
], t.prototype, "width", 2);
|
|
155
|
+
i([
|
|
156
|
+
d({ type: Number })
|
|
157
|
+
], t.prototype, "maxWidth", 2);
|
|
158
|
+
i([
|
|
159
|
+
d()
|
|
160
|
+
], t.prototype, "padding", 2);
|
|
161
|
+
i([
|
|
162
|
+
d()
|
|
163
|
+
], t.prototype, "mobilePadding", 2);
|
|
164
|
+
i([
|
|
165
|
+
d()
|
|
166
|
+
], t.prototype, "paddingTop", 2);
|
|
167
|
+
i([
|
|
168
|
+
d()
|
|
169
|
+
], t.prototype, "paddingRight", 2);
|
|
170
|
+
i([
|
|
171
|
+
d()
|
|
172
|
+
], t.prototype, "paddingBottom", 2);
|
|
173
|
+
i([
|
|
174
|
+
d()
|
|
175
|
+
], t.prototype, "paddingLeft", 2);
|
|
176
|
+
i([
|
|
177
|
+
d()
|
|
178
|
+
], t.prototype, "colorText", 2);
|
|
179
|
+
i([
|
|
180
|
+
d()
|
|
181
|
+
], t.prototype, "colorBg", 2);
|
|
182
|
+
i([
|
|
183
|
+
d({ type: Boolean })
|
|
184
|
+
], t.prototype, "colorBlend", 2);
|
|
185
|
+
i([
|
|
186
|
+
d()
|
|
187
|
+
], t.prototype, "blendDirection", 2);
|
|
188
|
+
i([
|
|
189
|
+
d({ type: Boolean })
|
|
190
|
+
], t.prototype, "border", 2);
|
|
191
|
+
i([
|
|
192
|
+
d()
|
|
193
|
+
], t.prototype, "borderRadius", 2);
|
|
194
|
+
i([
|
|
195
|
+
d()
|
|
196
|
+
], t.prototype, "opacity", 2);
|
|
197
|
+
i([
|
|
198
|
+
m()
|
|
199
|
+
], t.prototype, "_mergedPadding", 2);
|
|
200
|
+
i([
|
|
201
|
+
m()
|
|
202
|
+
], t.prototype, "_mobilePadding", 2);
|
|
203
|
+
t = i([
|
|
204
|
+
x(`${R}-box`)
|
|
205
|
+
], t);
|
|
206
|
+
export {
|
|
207
|
+
t as Box
|
|
208
|
+
};
|
|
@@ -0,0 +1,336 @@
|
|
|
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 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 n } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { ifDefined as d } 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 c } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js";
|
|
9
|
+
import { global as g } from "../../styles/global.js";
|
|
10
|
+
import { buttonState as f } from "../../styles/button.js";
|
|
11
|
+
import { settings as y } from "../../scripts/settings.js";
|
|
12
|
+
import { mergeStyles as v } from "../../scripts/mergeStyles.js";
|
|
13
|
+
import { css as x } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
14
|
+
var w = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (o, a, l, s) => {
|
|
15
|
+
for (var i = s > 1 ? void 0 : s ? _(a, l) : a, u = o.length - 1, b; u >= 0; u--)
|
|
16
|
+
(b = o[u]) && (i = (s ? b(a, l, i) : b(i)) || i);
|
|
17
|
+
return s && i && w(a, l, i), i;
|
|
18
|
+
};
|
|
19
|
+
const { prefix: z } = y;
|
|
20
|
+
let t = class extends h {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(), this.as = "button", this.type = "button", this.for = void 0, this.clickAction = void 0, this.url = void 0, this.target = "_self", this.size = "medium", this.buttonStyle = "solid", this.textAlign = "center", this.disabled = !1, this.fullWidth = !1, this.extendInteraction = !1, this.extendInteractionHidden = !1, this.loading = !1, this._extendedInteraction();
|
|
23
|
+
}
|
|
24
|
+
async _extendedInteraction() {
|
|
25
|
+
await this.updateComplete, !this.disabled && this.as === "link" && this.url !== void 0 && this.extendInteraction && this.dispatchEvent(new CustomEvent("extend-interaction", {
|
|
26
|
+
detail: {
|
|
27
|
+
url: this.url,
|
|
28
|
+
target: this.target
|
|
29
|
+
},
|
|
30
|
+
bubbles: !0,
|
|
31
|
+
composed: !0
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
handleClick() {
|
|
35
|
+
if (!this.disabled && this.clickAction) {
|
|
36
|
+
const o = new CustomEvent(this.clickAction, {
|
|
37
|
+
bubbles: !0,
|
|
38
|
+
composed: !0
|
|
39
|
+
});
|
|
40
|
+
this.dispatchEvent(o);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
buttonClasses() {
|
|
44
|
+
const o = {
|
|
45
|
+
"btn--plain": this.buttonStyle === "plain",
|
|
46
|
+
"btn--plain-underline": this.buttonStyle === "plain-underline",
|
|
47
|
+
"btn--outline": this.buttonStyle === "outline",
|
|
48
|
+
"btn--fullwidth": this.fullWidth,
|
|
49
|
+
"btn--extend": this.extendInteraction,
|
|
50
|
+
"btn--extend-hidden": this.extendInteractionHidden,
|
|
51
|
+
"btn--loading": this.loading
|
|
52
|
+
};
|
|
53
|
+
return o["btn--size-" + this.size] = !0, o["btn--text-align-" + this.textAlign] = !0, o;
|
|
54
|
+
}
|
|
55
|
+
buttonStyles() {
|
|
56
|
+
let o = {};
|
|
57
|
+
return this.colorText && (o = {
|
|
58
|
+
...o,
|
|
59
|
+
"--um-color-button-primary-text": this.colorText,
|
|
60
|
+
"--um-color-button-secondary-bg": this.colorText
|
|
61
|
+
}), this.colorBg && (o = {
|
|
62
|
+
...o,
|
|
63
|
+
"--um-color-button-primary-bg": this.colorBg,
|
|
64
|
+
"--um-color-button-secondary-text": this.colorBg
|
|
65
|
+
}), this.colorBgOpacity && (o = {
|
|
66
|
+
...o,
|
|
67
|
+
"--um-opacity-button-bg": this.colorBgOpacity
|
|
68
|
+
}), this.borderRadius && this.borderRadius !== "0" && (o = {
|
|
69
|
+
...o,
|
|
70
|
+
"--um-border-button-radius": "var(--um-border-radius-" + this.borderRadius + ")"
|
|
71
|
+
}), o;
|
|
72
|
+
}
|
|
73
|
+
buttonAs() {
|
|
74
|
+
if (this.as === "button" || this.url === void 0 || this.url === "")
|
|
75
|
+
return r`
|
|
76
|
+
<button
|
|
77
|
+
type=${this.type}
|
|
78
|
+
class="button${p(this.buttonClasses())}"
|
|
79
|
+
style="${c(this.buttonStyles())}"
|
|
80
|
+
aria-controls="${d(this.for)}"
|
|
81
|
+
clickAction="${d(this.clickAction)}"
|
|
82
|
+
?disabled=${this.disabled}
|
|
83
|
+
@click=${this.handleClick}
|
|
84
|
+
part="button"
|
|
85
|
+
>
|
|
86
|
+
${this.buttonContent()}
|
|
87
|
+
</button>
|
|
88
|
+
`;
|
|
89
|
+
if (this.url)
|
|
90
|
+
return r`
|
|
91
|
+
<a
|
|
92
|
+
href="${this.url}"
|
|
93
|
+
class="button${p(this.buttonClasses())}"
|
|
94
|
+
style="${c(this.buttonStyles())}"
|
|
95
|
+
target="${this.target}"
|
|
96
|
+
?disabled=${this.disabled}
|
|
97
|
+
part="button"
|
|
98
|
+
>
|
|
99
|
+
${this.buttonContent()}
|
|
100
|
+
</a>
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
buttonContent() {
|
|
104
|
+
return this.loading ? r`
|
|
105
|
+
<slot name="label"></slot>
|
|
106
|
+
<slot>
|
|
107
|
+
<span class="button__label">Label</span>
|
|
108
|
+
</slot>
|
|
109
|
+
<svg class="button__spinner" width="16" height="16" xmlns="http://www.w3.org/2000/svg" focusable="false" role="presentation" aria-hidden="true" viewBox="0 0 512 512">
|
|
110
|
+
<path d="M463.9 376c7.6 4.4 17.5 1.8 21.4-6.1c17.1-34.3 26.7-73 26.7-113.9C512 120 405.9 8.8 272 .5c-8.8-.5-16 6.7-16 15.5v0c0 8.8 7.2 15.9 16 16.6C388.2 40.8 480 137.7 480 256c0 35.1-8.1 68.3-22.5 97.9c-3.9 8-1.3 17.7 6.4 22.2v0z"/>
|
|
111
|
+
</svg>
|
|
112
|
+
` : r`
|
|
113
|
+
<span class="button__label">
|
|
114
|
+
<slot name="label"></slot>
|
|
115
|
+
<slot>
|
|
116
|
+
Label
|
|
117
|
+
</slot>
|
|
118
|
+
</span>
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
render() {
|
|
122
|
+
return r`
|
|
123
|
+
${this.buttonAs()}
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
t.styles = v([
|
|
128
|
+
g,
|
|
129
|
+
f,
|
|
130
|
+
x`
|
|
131
|
+
/* Parent */
|
|
132
|
+
:host([fullwidth]) {
|
|
133
|
+
width: 100%;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host([extendInteractionHidden]) {
|
|
137
|
+
display: block;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
width: 0;
|
|
140
|
+
height: 0!important;
|
|
141
|
+
margin: -1px;
|
|
142
|
+
padding: 0;
|
|
143
|
+
border: 0;
|
|
144
|
+
clip: rect(0 0 0 0);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.button {
|
|
148
|
+
line-height: 0;
|
|
149
|
+
height: var(--um-size-button-height, var(--um-space-48, 2.5rem));
|
|
150
|
+
width: var(--um-size-button-width, auto);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.button__label {
|
|
154
|
+
display: flex;
|
|
155
|
+
gap: 0.25rem;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: center;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* State */
|
|
161
|
+
.btn--outline {
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
border-color: rgb(var(--um-color-button-primary-bg, var(--um-color-page-text, 62, 62, 62)), 1);
|
|
164
|
+
color: rgb(var(--um-color-button-primary-bg, var(--um-color-page-text, 62, 62, 62)), 1);
|
|
165
|
+
}
|
|
166
|
+
.btn--outline[disabled],
|
|
167
|
+
.btn--outline[disabled]:hover {
|
|
168
|
+
cursor: default;
|
|
169
|
+
color: rgb(var(--um-color-base-text-disabled,136, 136, 136), 0.7);
|
|
170
|
+
background-color: transparent;
|
|
171
|
+
border-color: rgb(var(--um-color-base-text-disabled,136, 136, 136), 0.7);
|
|
172
|
+
box-shadow: none;
|
|
173
|
+
}
|
|
174
|
+
.btn--outline:hover {
|
|
175
|
+
box-shadow: 0 0 0 0.0625rem rgb(var(--um-color-button-primary-bg, var(--um-color-page-text, 62, 62, 62)), 0.8);
|
|
176
|
+
border-color: transparent;
|
|
177
|
+
}
|
|
178
|
+
.btn--outline:focus-visible {
|
|
179
|
+
outline-offset: 3px;
|
|
180
|
+
outline: var(--um-border-width-20, 0.125rem) solid rgb(var(--um-color-button-primary-bg, var(--um-color-page-text, 62, 62, 62)),1);
|
|
181
|
+
}
|
|
182
|
+
.btn--plain, .btn--plain-underline {
|
|
183
|
+
background-color: transparent;
|
|
184
|
+
color: rgb(var(--um-color-button-primary-bg, var(--um-color-page-text, 62, 62, 62)),1);
|
|
185
|
+
border: none;
|
|
186
|
+
padding: 0;
|
|
187
|
+
}
|
|
188
|
+
.btn--plain:not(.btn--plain-underline):not([disabled]):hover {
|
|
189
|
+
text-decoration: underline;
|
|
190
|
+
text-underline-offset: 0.3rem;
|
|
191
|
+
}
|
|
192
|
+
.btn--plain-underline {
|
|
193
|
+
text-decoration: underline;
|
|
194
|
+
text-underline-offset: 0.3rem;
|
|
195
|
+
transition: text-decoration-color 0.2s;
|
|
196
|
+
}
|
|
197
|
+
.btn--plain-underline:not([disabled]):hover {
|
|
198
|
+
text-decoration-color: rgb(var(--um-color-button-primary-bg, var(--um-color-page-text, 62, 62, 62)),0.5)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Text alignment */
|
|
202
|
+
.btn--text-align-left .button__label {
|
|
203
|
+
justify-content: start;
|
|
204
|
+
}
|
|
205
|
+
.btn--text-align-center .button__label {
|
|
206
|
+
justify-content: center;
|
|
207
|
+
}
|
|
208
|
+
.btn--text-align-right .button__label {
|
|
209
|
+
justify-content: end;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Width */
|
|
213
|
+
.btn--fullwidth {
|
|
214
|
+
width: 100%;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Size */
|
|
218
|
+
.btn--size-large:not(.btn--plain) {
|
|
219
|
+
--um-size-button-height: var(--um-space-48, 3rem);
|
|
220
|
+
padding: 0 var(--um-space-32, 2rem);
|
|
221
|
+
}
|
|
222
|
+
.btn--size-medium:not(.btn--plain) {
|
|
223
|
+
--um-size-button-height: var(--um-space-48, 2.5rem);
|
|
224
|
+
padding: 0 var(--um-space-20, 1.5rem);
|
|
225
|
+
}
|
|
226
|
+
.btn--size-small:not(.btn--plain) {
|
|
227
|
+
--um-size-button-height: var(--um-space-32, 2rem);
|
|
228
|
+
padding: 0 var(--um-space-12, 0.75rem);
|
|
229
|
+
font-size: var(--um-font-size-body-sm);
|
|
230
|
+
font-weight: var(--um-font-weight-regular);
|
|
231
|
+
}
|
|
232
|
+
.btn--size-slim:not(.btn--plain) {
|
|
233
|
+
--um-size-button-height: var(--um-space-24, 1.5rem);
|
|
234
|
+
font-weight: var(--um-font-weight-regular);
|
|
235
|
+
font-size: var(--um-font-size-body-xs);
|
|
236
|
+
padding: 0 var(--um-space-8, 0.5rem);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Behaviour */
|
|
240
|
+
.btn--extend:after,
|
|
241
|
+
.btn--extend-hidden:after {
|
|
242
|
+
content: '';
|
|
243
|
+
position:absolute;
|
|
244
|
+
top:0;
|
|
245
|
+
left:0;
|
|
246
|
+
height: 100%;
|
|
247
|
+
width: 100%;
|
|
248
|
+
z-index: 1;
|
|
249
|
+
cursor: pointer;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Loading state */
|
|
253
|
+
.btn--loading {
|
|
254
|
+
position: relative;
|
|
255
|
+
}
|
|
256
|
+
.btn--loading ::slotted(*),
|
|
257
|
+
.btn--loading .button__label {
|
|
258
|
+
opacity: 0;
|
|
259
|
+
}
|
|
260
|
+
.button__spinner {
|
|
261
|
+
animation-name: spin;
|
|
262
|
+
animation-duration: 500ms;
|
|
263
|
+
animation-timing-function: cubic-bezier(0, 0, 1, 1);
|
|
264
|
+
animation-iteration-count: infinite;
|
|
265
|
+
animation-direction: both;
|
|
266
|
+
fill: currentColor;
|
|
267
|
+
height: 1rem;
|
|
268
|
+
left: 50%;
|
|
269
|
+
margin: calc(var(--um-space-16, 1rem) / 2 * -1) 0 0 calc(var(--um-space-16, 1rem) / 2 * -1);
|
|
270
|
+
position: absolute;
|
|
271
|
+
top: 50%;
|
|
272
|
+
width: 1rem;
|
|
273
|
+
}
|
|
274
|
+
@keyframes spin {to{transform: rotate(1turn)}};
|
|
275
|
+
`
|
|
276
|
+
]);
|
|
277
|
+
e([
|
|
278
|
+
n()
|
|
279
|
+
], t.prototype, "as", 2);
|
|
280
|
+
e([
|
|
281
|
+
n()
|
|
282
|
+
], t.prototype, "type", 2);
|
|
283
|
+
e([
|
|
284
|
+
n()
|
|
285
|
+
], t.prototype, "for", 2);
|
|
286
|
+
e([
|
|
287
|
+
n()
|
|
288
|
+
], t.prototype, "clickAction", 2);
|
|
289
|
+
e([
|
|
290
|
+
n()
|
|
291
|
+
], t.prototype, "url", 2);
|
|
292
|
+
e([
|
|
293
|
+
n()
|
|
294
|
+
], t.prototype, "target", 2);
|
|
295
|
+
e([
|
|
296
|
+
n()
|
|
297
|
+
], t.prototype, "size", 2);
|
|
298
|
+
e([
|
|
299
|
+
n()
|
|
300
|
+
], t.prototype, "buttonStyle", 2);
|
|
301
|
+
e([
|
|
302
|
+
n()
|
|
303
|
+
], t.prototype, "borderRadius", 2);
|
|
304
|
+
e([
|
|
305
|
+
n()
|
|
306
|
+
], t.prototype, "textAlign", 2);
|
|
307
|
+
e([
|
|
308
|
+
n({ type: Boolean, reflect: !0 })
|
|
309
|
+
], t.prototype, "disabled", 2);
|
|
310
|
+
e([
|
|
311
|
+
n({ type: Boolean })
|
|
312
|
+
], t.prototype, "fullWidth", 2);
|
|
313
|
+
e([
|
|
314
|
+
n({ type: Boolean })
|
|
315
|
+
], t.prototype, "extendInteraction", 2);
|
|
316
|
+
e([
|
|
317
|
+
n({ type: Boolean })
|
|
318
|
+
], t.prototype, "extendInteractionHidden", 2);
|
|
319
|
+
e([
|
|
320
|
+
n()
|
|
321
|
+
], t.prototype, "colorBg", 2);
|
|
322
|
+
e([
|
|
323
|
+
n()
|
|
324
|
+
], t.prototype, "colorBgOpacity", 2);
|
|
325
|
+
e([
|
|
326
|
+
n()
|
|
327
|
+
], t.prototype, "colorText", 2);
|
|
328
|
+
e([
|
|
329
|
+
n({ type: Boolean })
|
|
330
|
+
], t.prototype, "loading", 2);
|
|
331
|
+
t = e([
|
|
332
|
+
m(`${z}-button`)
|
|
333
|
+
], t);
|
|
334
|
+
export {
|
|
335
|
+
t as Button
|
|
336
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
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 n } 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 e } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { classMap as b } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
7
|
+
import { global as f } from "../../styles/global.js";
|
|
8
|
+
import { groupSpacing as g, groupJustify as h, groupMobileJustify as y } from "../../styles/group.js";
|
|
9
|
+
import { settings as d } from "../../scripts/settings.js";
|
|
10
|
+
import { mergeStyles as w } from "../../scripts/mergeStyles.js";
|
|
11
|
+
import { css as k } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
12
|
+
var v = Object.defineProperty, x = Object.getOwnPropertyDescriptor, r = (t, i, u, p) => {
|
|
13
|
+
for (var s = p > 1 ? void 0 : p ? x(i, u) : i, a = t.length - 1, l; a >= 0; a--)
|
|
14
|
+
(l = t[a]) && (s = (p ? l(i, u, s) : l(s)) || s);
|
|
15
|
+
return p && s && v(i, u, s), s;
|
|
16
|
+
};
|
|
17
|
+
const { prefix: j } = d;
|
|
18
|
+
let o = class extends n {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.spacing = "normal", this.justify = "start", this.mobileJustify = "start", this.stack = !1, this.mobileStack = !1;
|
|
21
|
+
}
|
|
22
|
+
buttonGroupClasses() {
|
|
23
|
+
const t = {
|
|
24
|
+
"button-group": !0
|
|
25
|
+
};
|
|
26
|
+
return t["group-spacing--" + this.spacing] = !0, t["group-justify--" + this.justify] = !0, t["group-mobile-justify--" + this.mobileJustify] = !0, t["group--stack"] = this.stack, t["group--mobile-stack"] = this.mobileStack, t;
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return m`
|
|
30
|
+
<div
|
|
31
|
+
part="button-group"
|
|
32
|
+
class="${b(this.buttonGroupClasses())}"
|
|
33
|
+
>
|
|
34
|
+
<slot part="button"></slot>
|
|
35
|
+
</div>
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
o.styles = w([
|
|
40
|
+
f,
|
|
41
|
+
k`
|
|
42
|
+
:host([stack]), :host([mobileStack]) {
|
|
43
|
+
display: block;
|
|
44
|
+
width: var(--um-size-button-width, 100%);
|
|
45
|
+
}
|
|
46
|
+
.button-group {
|
|
47
|
+
align-items: center;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@media screen and (max-width: 48rem) {
|
|
54
|
+
.button-group.group--mobile-stack {
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
}
|
|
57
|
+
.button-group.group--mobile-stack ::slotted(*) {
|
|
58
|
+
display: block;
|
|
59
|
+
width: 100%;
|
|
60
|
+
--um-size-button-width: 100%
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
@media screen and (min-width: 48.06rem) {
|
|
64
|
+
.button-group.group--stack {
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
}
|
|
67
|
+
.button-group.group--stack ::slotted(*) {
|
|
68
|
+
display: block;
|
|
69
|
+
width: 100%;
|
|
70
|
+
--um-size-button-width: 100%
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`,
|
|
74
|
+
g,
|
|
75
|
+
h,
|
|
76
|
+
y
|
|
77
|
+
]);
|
|
78
|
+
r([
|
|
79
|
+
e()
|
|
80
|
+
], o.prototype, "spacing", 2);
|
|
81
|
+
r([
|
|
82
|
+
e()
|
|
83
|
+
], o.prototype, "justify", 2);
|
|
84
|
+
r([
|
|
85
|
+
e()
|
|
86
|
+
], o.prototype, "mobileJustify", 2);
|
|
87
|
+
r([
|
|
88
|
+
e({ type: Boolean })
|
|
89
|
+
], o.prototype, "stack", 2);
|
|
90
|
+
r([
|
|
91
|
+
e({ type: Boolean })
|
|
92
|
+
], o.prototype, "mobileStack", 2);
|
|
93
|
+
o = r([
|
|
94
|
+
c(`${j}-button-group`)
|
|
95
|
+
], o);
|
|
96
|
+
export {
|
|
97
|
+
o as ButtonGroup
|
|
98
|
+
};
|