@justeattakeaway/pie-button 1.13.4 → 1.14.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/custom-elements.json +8 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +134 -127
- package/dist/react.d.ts +9 -0
- package/package.json +6 -8
- package/src/defs.ts +9 -0
- package/src/index.ts +8 -3
package/custom-elements.json
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,15 @@ import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElem
|
|
|
7
7
|
import { PropertyValues } from 'lit';
|
|
8
8
|
import { TemplateResult } from 'lit';
|
|
9
9
|
|
|
10
|
+
declare type AriaProps = {
|
|
11
|
+
label?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
10
14
|
export declare interface ButtonProps {
|
|
15
|
+
/**
|
|
16
|
+
* The ARIA attributes for the button element.
|
|
17
|
+
*/
|
|
18
|
+
aria?: AriaProps;
|
|
11
19
|
/**
|
|
12
20
|
* Which HTML element to use when rendering the button.
|
|
13
21
|
*/
|
|
@@ -131,6 +139,7 @@ export declare class PieButton extends PieButton_base implements ButtonProps {
|
|
|
131
139
|
connectedCallback(): void;
|
|
132
140
|
disconnectedCallback(): void;
|
|
133
141
|
updated(changedProperties: PropertyValues<this>): void;
|
|
142
|
+
aria: ButtonProps['aria'];
|
|
134
143
|
tag: "button" | "a";
|
|
135
144
|
size: "xsmall" | "small-productive" | "small-expressive" | "medium" | "large";
|
|
136
145
|
type: "button" | "submit" | "reset";
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { LitElement as Tt, html as z, nothing as
|
|
1
|
+
import { LitElement as Tt, html as z, nothing as C, unsafeCSS as Vt } from "lit";
|
|
2
2
|
import { classMap as mt } from "lit/directives/class-map.js";
|
|
3
|
-
import { ifDefined as
|
|
3
|
+
import { ifDefined as M } from "lit/directives/if-defined.js";
|
|
4
4
|
import { property as m } from "lit/decorators.js";
|
|
5
|
-
import { DelegatesFocusMixin as Nt, FormControlMixin as
|
|
5
|
+
import { DelegatesFocusMixin as Nt, FormControlMixin as Ot, validPropertyValues as F, safeCustomElement as Pt } from "@justeattakeaway/pie-webc-core";
|
|
6
6
|
import "@justeattakeaway/pie-spinner";
|
|
7
7
|
var pt = {}, ht;
|
|
8
8
|
function _t() {
|
|
9
9
|
return ht || (ht = 1, function() {
|
|
10
10
|
(function(l) {
|
|
11
|
-
const r = /* @__PURE__ */ new WeakMap(),
|
|
11
|
+
const r = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), D = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), T = {
|
|
12
12
|
ariaAtomic: "aria-atomic",
|
|
13
13
|
ariaAutoComplete: "aria-autocomplete",
|
|
14
14
|
ariaBusy: "aria-busy",
|
|
@@ -52,16 +52,16 @@ function _t() {
|
|
|
52
52
|
ariaValueText: "aria-valuetext",
|
|
53
53
|
role: "role"
|
|
54
54
|
}, gt = (e, t) => {
|
|
55
|
-
for (let i in
|
|
55
|
+
for (let i in T) {
|
|
56
56
|
t[i] = null;
|
|
57
57
|
let o = null;
|
|
58
|
-
const a =
|
|
58
|
+
const a = T[i];
|
|
59
59
|
Object.defineProperty(t, i, {
|
|
60
60
|
get() {
|
|
61
61
|
return o;
|
|
62
62
|
},
|
|
63
63
|
set(n) {
|
|
64
|
-
o = n, e.isConnected ? e.setAttribute(a, n) :
|
|
64
|
+
o = n, e.isConnected ? e.setAttribute(a, n) : I.set(e, t);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
@@ -80,7 +80,7 @@ function _t() {
|
|
|
80
80
|
const a = !t || e.disabled;
|
|
81
81
|
for (; o; )
|
|
82
82
|
o.formDisabledCallback && a && W(o, e.disabled), o = i.nextNode();
|
|
83
|
-
}, tt = { attributes: !0, attributeFilter: ["disabled", "name"] },
|
|
83
|
+
}, tt = { attributes: !0, attributeFilter: ["disabled", "name"] }, V = P() ? new MutationObserver((e) => {
|
|
84
84
|
for (const t of e) {
|
|
85
85
|
const i = t.target;
|
|
86
86
|
if (t.attributeName === "disabled" && (i.constructor.formAssociated ? W(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && Z(i)), t.attributeName === "name" && i.constructor.formAssociated) {
|
|
@@ -93,31 +93,31 @@ function _t() {
|
|
|
93
93
|
e.forEach((t) => {
|
|
94
94
|
const { addedNodes: i, removedNodes: o } = t, a = Array.from(i), n = Array.from(o);
|
|
95
95
|
a.forEach((s) => {
|
|
96
|
-
var
|
|
97
|
-
if (d.has(s) && s.constructor.formAssociated && Y(s),
|
|
98
|
-
const h = A.get(s);
|
|
99
|
-
Object.keys(L).filter((y) => h[y] !== null).forEach((y) => {
|
|
100
|
-
s.setAttribute(L[y], h[y]);
|
|
101
|
-
}), A.delete(s);
|
|
102
|
-
}
|
|
103
|
-
if (I.has(s)) {
|
|
96
|
+
var u;
|
|
97
|
+
if (d.has(s) && s.constructor.formAssociated && Y(s), I.has(s)) {
|
|
104
98
|
const h = I.get(s);
|
|
105
|
-
|
|
99
|
+
Object.keys(T).filter((x) => h[x] !== null).forEach((x) => {
|
|
100
|
+
s.setAttribute(T[x], h[x]);
|
|
101
|
+
}), I.delete(s);
|
|
102
|
+
}
|
|
103
|
+
if (L.has(s)) {
|
|
104
|
+
const h = L.get(s);
|
|
105
|
+
s.setAttribute("internals-valid", h.validity.valid.toString()), s.setAttribute("internals-invalid", (!h.validity.valid).toString()), s.setAttribute("aria-invalid", (!h.validity.valid).toString()), L.delete(s);
|
|
106
106
|
}
|
|
107
107
|
if (s.localName === "form") {
|
|
108
|
-
const h = E.get(s),
|
|
109
|
-
acceptNode(
|
|
110
|
-
return d.has(
|
|
108
|
+
const h = E.get(s), k = document.createTreeWalker(s, NodeFilter.SHOW_ELEMENT, {
|
|
109
|
+
acceptNode(j) {
|
|
110
|
+
return d.has(j) && j.constructor.formAssociated && !(h && h.has(j)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
let
|
|
114
|
-
for (;
|
|
115
|
-
Y(
|
|
113
|
+
let x = k.nextNode();
|
|
114
|
+
for (; x; )
|
|
115
|
+
Y(x), x = k.nextNode();
|
|
116
116
|
}
|
|
117
|
-
s.localName === "fieldset" && ((
|
|
117
|
+
s.localName === "fieldset" && ((u = V.observe) === null || u === void 0 || u.call(V, s, tt), Z(s, !0));
|
|
118
118
|
}), n.forEach((s) => {
|
|
119
|
-
const
|
|
120
|
-
|
|
119
|
+
const u = d.get(s);
|
|
120
|
+
u && p.get(u) && et(u), D.has(s) && D.get(s).disconnect();
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -150,20 +150,20 @@ function _t() {
|
|
|
150
150
|
return i.type = "hidden", i.name = e.getAttribute("name"), e.after(i), p.get(t).push(i), i;
|
|
151
151
|
}, yt = (e, t) => {
|
|
152
152
|
var i;
|
|
153
|
-
p.set(t, []), (i =
|
|
153
|
+
p.set(t, []), (i = V.observe) === null || i === void 0 || i.call(V, e, tt);
|
|
154
154
|
}, ot = (e, t) => {
|
|
155
155
|
if (t.length) {
|
|
156
156
|
Array.from(t).forEach((o) => o.addEventListener("click", e.click.bind(e)));
|
|
157
157
|
let i = t[0].id;
|
|
158
158
|
t[0].id || (i = `${t[0].htmlFor}_Label`, t[0].id = i), e.setAttribute("aria-labelledby", i);
|
|
159
159
|
}
|
|
160
|
-
},
|
|
160
|
+
}, N = (e) => {
|
|
161
161
|
const t = Array.from(e.elements).filter((n) => !n.tagName.includes("-") && n.validity).map((n) => n.validity.valid), i = E.get(e) || [], o = Array.from(i).filter((n) => n.isConnected).map((n) => d.get(n).validity.valid), a = [...t, ...o].includes(!1);
|
|
162
162
|
e.toggleAttribute("internals-invalid", a), e.toggleAttribute("internals-valid", !a);
|
|
163
163
|
}, xt = (e) => {
|
|
164
|
-
|
|
164
|
+
N(O(e.target));
|
|
165
165
|
}, wt = (e) => {
|
|
166
|
-
|
|
166
|
+
N(O(e.target));
|
|
167
167
|
}, kt = (e) => {
|
|
168
168
|
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${e.id ? `,${i}[form='${e.id}']` : ""}`).join(",");
|
|
169
169
|
e.addEventListener("click", (i) => {
|
|
@@ -171,7 +171,7 @@ function _t() {
|
|
|
171
171
|
const a = E.get(e);
|
|
172
172
|
if (e.noValidate)
|
|
173
173
|
return;
|
|
174
|
-
a.size && Array.from(a).reverse().map((
|
|
174
|
+
a.size && Array.from(a).reverse().map((u) => d.get(u).reportValidity()).includes(!1) && i.preventDefault();
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}, Et = (e) => {
|
|
@@ -188,14 +188,14 @@ function _t() {
|
|
|
188
188
|
const a = /* @__PURE__ */ new Set();
|
|
189
189
|
a.add(e), E.set(t, a), kt(t), t.addEventListener("reset", Et), t.addEventListener("input", xt), t.addEventListener("change", wt);
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
f.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
192
192
|
e.formAssociatedCallback.apply(e, [t]);
|
|
193
|
-
}, 0),
|
|
193
|
+
}, 0), N(t);
|
|
194
194
|
}
|
|
195
|
-
},
|
|
195
|
+
}, O = (e) => {
|
|
196
196
|
let t = e.parentNode;
|
|
197
|
-
return t && t.tagName !== "FORM" && (t =
|
|
198
|
-
},
|
|
197
|
+
return t && t.tagName !== "FORM" && (t = O(t)), t;
|
|
198
|
+
}, w = (e, t, i = DOMException) => {
|
|
199
199
|
if (!e.constructor.formAssociated)
|
|
200
200
|
throw new i(t);
|
|
201
201
|
}, at = (e, t, i) => {
|
|
@@ -217,7 +217,7 @@ function _t() {
|
|
|
217
217
|
this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
const Mt = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), St = (e, t, i) => (e.valid = Ct(t), Object.keys(t).forEach((o) => e[o] = t[o]), i &&
|
|
220
|
+
const Mt = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), St = (e, t, i) => (e.valid = Ct(t), Object.keys(t).forEach((o) => e[o] = t[o]), i && N(i), e), Ct = (e) => {
|
|
221
221
|
let t = !0;
|
|
222
222
|
for (let i in e)
|
|
223
223
|
i !== "valid" && e[i] !== !1 && (t = !1);
|
|
@@ -263,10 +263,10 @@ function _t() {
|
|
|
263
263
|
if (typeof t == "function" ? e !== t || !0 : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
264
264
|
return t.set(e, i), i;
|
|
265
265
|
}
|
|
266
|
-
var
|
|
266
|
+
var S;
|
|
267
267
|
class At {
|
|
268
268
|
constructor(t) {
|
|
269
|
-
|
|
269
|
+
S.set(this, void 0), Ft(this, S, t);
|
|
270
270
|
for (let i = 0; i < t.length; i++) {
|
|
271
271
|
let o = t[i];
|
|
272
272
|
this[i] = o, o.hasAttribute("name") && (this[o.getAttribute("name")] = o);
|
|
@@ -274,10 +274,10 @@ function _t() {
|
|
|
274
274
|
Object.freeze(this);
|
|
275
275
|
}
|
|
276
276
|
get length() {
|
|
277
|
-
return lt(this,
|
|
277
|
+
return lt(this, S, "f").length;
|
|
278
278
|
}
|
|
279
|
-
[(
|
|
280
|
-
return lt(this,
|
|
279
|
+
[(S = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
280
|
+
return lt(this, S, "f")[Symbol.iterator]();
|
|
281
281
|
}
|
|
282
282
|
item(t) {
|
|
283
283
|
return this[t] == null ? null : this[t];
|
|
@@ -302,10 +302,10 @@ function _t() {
|
|
|
302
302
|
const { get: a } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
303
303
|
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
304
304
|
get(...n) {
|
|
305
|
-
const s = a.call(this, ...n),
|
|
306
|
-
if (
|
|
305
|
+
const s = a.call(this, ...n), u = Array.from(E.get(this) || []);
|
|
306
|
+
if (u.length === 0)
|
|
307
307
|
return s;
|
|
308
|
-
const h = Array.from(s).concat(
|
|
308
|
+
const h = Array.from(s).concat(u).sort((k, x) => k.compareDocumentPosition ? k.compareDocumentPosition(x) & 2 ? 1 : -1 : 0);
|
|
309
309
|
return new At(h);
|
|
310
310
|
}
|
|
311
311
|
});
|
|
@@ -318,13 +318,13 @@ function _t() {
|
|
|
318
318
|
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
319
319
|
throw new TypeError("Illegal constructor");
|
|
320
320
|
const i = t.getRootNode(), o = new zt();
|
|
321
|
-
this.states = new B(t), r.set(this, t),
|
|
321
|
+
this.states = new B(t), r.set(this, t), v.set(this, o), d.set(t, this), gt(t, this), yt(t, this), Object.seal(this), i instanceof DocumentFragment && ft(i);
|
|
322
322
|
}
|
|
323
323
|
checkValidity() {
|
|
324
324
|
const t = r.get(this);
|
|
325
|
-
if (
|
|
325
|
+
if (w(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
326
326
|
return !0;
|
|
327
|
-
const i =
|
|
327
|
+
const i = v.get(this);
|
|
328
328
|
if (!i.valid) {
|
|
329
329
|
const o = new Event("invalid", {
|
|
330
330
|
bubbles: !1,
|
|
@@ -337,19 +337,19 @@ function _t() {
|
|
|
337
337
|
}
|
|
338
338
|
get form() {
|
|
339
339
|
const t = r.get(this);
|
|
340
|
-
|
|
340
|
+
w(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
341
341
|
let i;
|
|
342
|
-
return t.constructor.formAssociated === !0 && (i =
|
|
342
|
+
return t.constructor.formAssociated === !0 && (i = O(t)), i;
|
|
343
343
|
}
|
|
344
344
|
get labels() {
|
|
345
345
|
const t = r.get(this);
|
|
346
|
-
|
|
346
|
+
w(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
347
347
|
const i = t.getAttribute("id"), o = t.getRootNode();
|
|
348
348
|
return o && i ? o.querySelectorAll(`[for="${i}"]`) : [];
|
|
349
349
|
}
|
|
350
350
|
reportValidity() {
|
|
351
351
|
const t = r.get(this);
|
|
352
|
-
if (
|
|
352
|
+
if (w(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
353
353
|
return !0;
|
|
354
354
|
const i = this.checkValidity(), o = J.get(this);
|
|
355
355
|
if (o && !t.constructor.formAssociated)
|
|
@@ -358,7 +358,7 @@ function _t() {
|
|
|
358
358
|
}
|
|
359
359
|
setFormValue(t) {
|
|
360
360
|
const i = r.get(this);
|
|
361
|
-
if (
|
|
361
|
+
if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), et(this), t != null && !(t instanceof FormData)) {
|
|
362
362
|
if (i.getAttribute("name")) {
|
|
363
363
|
const o = it(i, this);
|
|
364
364
|
o.value = t;
|
|
@@ -373,19 +373,19 @@ function _t() {
|
|
|
373
373
|
}
|
|
374
374
|
setValidity(t, i, o) {
|
|
375
375
|
const a = r.get(this);
|
|
376
|
-
if (
|
|
376
|
+
if (w(a, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
377
377
|
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
378
378
|
J.set(this, o);
|
|
379
|
-
const n =
|
|
380
|
-
for (const
|
|
381
|
-
s[
|
|
379
|
+
const n = v.get(this), s = {};
|
|
380
|
+
for (const k in t)
|
|
381
|
+
s[k] = t[k];
|
|
382
382
|
Object.keys(s).length === 0 && Mt(n);
|
|
383
|
-
const
|
|
384
|
-
delete
|
|
385
|
-
const { valid: h } = St(n,
|
|
383
|
+
const u = Object.assign(Object.assign({}, n), s);
|
|
384
|
+
delete u.valid;
|
|
385
|
+
const { valid: h } = St(n, u, this.form);
|
|
386
386
|
if (!h && !i)
|
|
387
387
|
throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
|
|
388
|
-
|
|
388
|
+
g.set(this, h ? "" : i), a.isConnected ? (a.toggleAttribute("internals-invalid", !h), a.toggleAttribute("internals-valid", h), a.setAttribute("aria-invalid", `${!h}`)) : L.set(a, this);
|
|
389
389
|
}
|
|
390
390
|
get shadowRoot() {
|
|
391
391
|
const t = r.get(this), i = G.get(t);
|
|
@@ -393,15 +393,15 @@ function _t() {
|
|
|
393
393
|
}
|
|
394
394
|
get validationMessage() {
|
|
395
395
|
const t = r.get(this);
|
|
396
|
-
return
|
|
396
|
+
return w(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), g.get(this);
|
|
397
397
|
}
|
|
398
398
|
get validity() {
|
|
399
399
|
const t = r.get(this);
|
|
400
|
-
return
|
|
400
|
+
return w(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), v.get(this);
|
|
401
401
|
}
|
|
402
402
|
get willValidate() {
|
|
403
403
|
const t = r.get(this);
|
|
404
|
-
return
|
|
404
|
+
return w(t, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(t.disabled || t.hasAttribute("disabled") || t.hasAttribute("readonly"));
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
function Lt() {
|
|
@@ -482,8 +482,8 @@ const _ = class _ extends Tt {
|
|
|
482
482
|
this.getAttribute("v") || this.setAttribute("v", _.v);
|
|
483
483
|
}
|
|
484
484
|
};
|
|
485
|
-
_.v = "1.
|
|
486
|
-
let
|
|
485
|
+
_.v = "1.14.0";
|
|
486
|
+
let U = _;
|
|
487
487
|
const Dt = ["button", "a"], Rt = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Zt = ["productive", "expressive"], $t = ["submit", "button", "reset"], Wt = [
|
|
488
488
|
"primary",
|
|
489
489
|
"primary-alternative",
|
|
@@ -498,7 +498,7 @@ const Dt = ["button", "a"], Rt = ["xsmall", "small-productive", "small-expressiv
|
|
|
498
498
|
"ghost-inverse-light",
|
|
499
499
|
"destructive",
|
|
500
500
|
"destructive-ghost"
|
|
501
|
-
], Ht = ["leading", "trailing"], te = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], ee = ["post", "get", "dialog"], ie = ["_self", "_blank", "_parent", "_top"],
|
|
501
|
+
], Ht = ["leading", "trailing"], te = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], ee = ["post", "get", "dialog"], ie = ["_self", "_blank", "_parent", "_top"], y = {
|
|
502
502
|
tag: "button",
|
|
503
503
|
size: "medium",
|
|
504
504
|
type: "submit",
|
|
@@ -509,15 +509,15 @@ const Dt = ["button", "a"], Rt = ["xsmall", "small-productive", "small-expressiv
|
|
|
509
509
|
isFullWidth: !1,
|
|
510
510
|
isResponsive: !1
|
|
511
511
|
}, Bt = "*,*:after,*:before{box-sizing:inherit}:host{display:inline-block}:host([isfullwidth]){display:block;width:100%}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-l-family);--btn-font-weight: var(--dt-font-interactive-l-weight);--int-states-mixin-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-light-solid);--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);position:relative;display:inline-flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--int-states-mixin-bg-color);cursor:pointer;-webkit-user-select:none;user-select:none;text-decoration:none;font-family:var(--btn-font-family);font-size:var(--btn-font-size);font-weight:var(--btn-font-weight);color:var(--btn-text-color);line-height:var(--btn-line-height);inline-size:var(--btn-inline-size)}.o-btn:focus-visible{box-shadow:0 0 0 2px var(--dt-color-focus-inner),0 0 0 4px var(--dt-color-focus-outer);outline:none}.o-btn.o-btn--primary:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn.o-btn--primary:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--primary:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-brand))}.o-btn.o-btn--primary:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-brand))}}.o-btn.o-btn--primary.o-btn--xsmall,.o-btn.o-btn--primary.o-btn--small-productive{--int-states-mixin-bg-color: var(--dt-color-interactive-primary);--btn-text-color: var(--dt-color-content-interactive-primary-solid)}.o-btn.o-btn--primary.o-btn--xsmall:hover:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: var(--dt-color-hover-02);--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn.o-btn--primary.o-btn--xsmall:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--xsmall.is-loading:not(:disabled,.is-disabled),.o-btn.o-btn--primary.o-btn--small-productive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive.is-loading:not(:disabled,.is-disabled){--active-modifier: var(--dt-color-active-02);--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--primary.o-btn--xsmall:hover:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-02-bg) var(--dt-color-hover-02), var(--dt-color-interactive-primary))}.o-btn.o-btn--primary.o-btn--xsmall:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--xsmall.is-loading:not(:disabled,.is-disabled),.o-btn.o-btn--primary.o-btn--small-productive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-02-bg) var(--dt-color-active-02), var(--dt-color-interactive-primary))}}@media (min-width: 769px){.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive,.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive{--int-states-mixin-bg-color: var(--dt-color-interactive-brand)}.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive:hover:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--hover-modifier)))}.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive.is-loading:not(:disabled,.is-disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-brand-h), var(--dt-color-interactive-brand-s), calc(var(--dt-color-interactive-brand-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive:hover:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-brand))}.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive.is-loading:not(:disabled,.is-disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-brand))}}}.o-btn.o-btn--primary-alternative{--int-states-mixin-bg-color: var(--dt-color-interactive-primary);--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn.o-btn--primary-alternative:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: var(--dt-color-hover-02);--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--hover-modifier)))}.o-btn.o-btn--primary-alternative:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary-alternative.is-loading:not(:disabled,.is-disabled){--active-modifier: var(--dt-color-active-02);--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-primary-h), var(--dt-color-interactive-primary-s), calc(var(--dt-color-interactive-primary-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--primary-alternative:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-02-bg) var(--dt-color-hover-02), var(--dt-color-interactive-primary))}.o-btn.o-btn--primary-alternative:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary-alternative.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-02-bg) var(--dt-color-active-02), var(--dt-color-interactive-primary))}}.o-btn.o-btn--primary-alternative-dark{--int-states-mixin-bg-color: var(--dt-color-interactive-dark);--btn-text-color: var(--dt-color-content-interactive-light)}.o-btn.o-btn--primary-alternative-dark:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: var(--dt-color-hover-02);--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-dark-h), var(--dt-color-interactive-dark-s), calc(var(--dt-color-interactive-dark-l) + var(--hover-modifier)))}.o-btn.o-btn--primary-alternative-dark:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary-alternative-dark.is-loading:not(:disabled,.is-disabled){--active-modifier: var(--dt-color-active-02);--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-dark-h), var(--dt-color-interactive-dark-s), calc(var(--dt-color-interactive-dark-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--primary-alternative-dark:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-02-bg) var(--dt-color-hover-02), var(--dt-color-interactive-dark))}.o-btn.o-btn--primary-alternative-dark:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--primary-alternative-dark.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-02-bg) var(--dt-color-active-02), var(--dt-color-interactive-dark))}}.o-btn.o-btn--secondary{--int-states-mixin-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn.o-btn--secondary:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--hover-modifier)))}.o-btn.o-btn--secondary:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--secondary.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-secondary-h), var(--dt-color-interactive-secondary-s), calc(var(--dt-color-interactive-secondary-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--secondary:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-secondary))}.o-btn.o-btn--secondary:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--secondary.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-secondary))}}.o-btn.o-btn--outline{--int-states-mixin-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary-solid);border:1px solid var(--dt-color-border-strong)}.o-btn.o-btn--outline:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--hover-modifier)))}.o-btn.o-btn--outline:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--outline.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--outline:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-transparent))}.o-btn.o-btn--outline:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--outline.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-transparent))}}.o-btn.o-btn--ghost{--int-states-mixin-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary-solid)}.o-btn.o-btn--ghost:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--hover-modifier)))}.o-btn.o-btn--ghost:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--ghost:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-transparent))}.o-btn.o-btn--ghost:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-transparent))}}.o-btn.o-btn--ghost-dark{--int-states-mixin-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-dark-solid)}.o-btn.o-btn--ghost-dark:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--hover-modifier)))}.o-btn.o-btn--ghost-dark:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost-dark.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--ghost-dark:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-transparent))}.o-btn.o-btn--ghost-dark:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost-dark.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-transparent))}}.o-btn.o-btn--inverse{--int-states-mixin-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn.o-btn--inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--hover-modifier)))}.o-btn.o-btn--inverse:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--inverse.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-interactive-inverse-h), var(--dt-color-interactive-inverse-s), calc(var(--dt-color-interactive-inverse-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-interactive-inverse))}.o-btn.o-btn--inverse:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--inverse.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-interactive-inverse))}}.o-btn.o-btn--ghost-inverse,.o-btn.o-btn--outline-inverse{--int-states-mixin-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary-solid)}.o-btn.o-btn--ghost-inverse:hover:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--outline-inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-02);--int-states-mixin-bg-color: hsl(var(--dt-color-white-h), var(--dt-color-white-s), var(--dt-color-white-l), var(--active-modifier))}.o-btn.o-btn--ghost-inverse:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost-inverse.is-loading:not(:disabled,.is-disabled),.o-btn.o-btn--outline-inverse:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--outline-inverse.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-02);--int-states-mixin-bg-color: hsl(var(--dt-color-white-h), var(--dt-color-white-s), var(--dt-color-white-l), var(--active-modifier))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--ghost-inverse:hover:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--outline-inverse:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-02-bg) var(--dt-color-hover-02), var(--dt-color-transparent))}.o-btn.o-btn--ghost-inverse:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost-inverse.is-loading:not(:disabled,.is-disabled),.o-btn.o-btn--outline-inverse:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--outline-inverse.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-02-bg) var(--dt-color-active-02), var(--dt-color-transparent))}}.o-btn.o-btn--ghost-inverse-light{--int-states-mixin-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-light-solid)}.o-btn.o-btn--ghost-inverse-light:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-02);--int-states-mixin-bg-color: hsl(var(--dt-color-white-h), var(--dt-color-white-s), var(--dt-color-white-l), var(--active-modifier))}.o-btn.o-btn--ghost-inverse-light:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost-inverse-light.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-02);--int-states-mixin-bg-color: hsl(var(--dt-color-white-h), var(--dt-color-white-s), var(--dt-color-white-l), var(--active-modifier))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--ghost-inverse-light:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-02-bg) var(--dt-color-hover-02), var(--dt-color-transparent))}.o-btn.o-btn--ghost-inverse-light:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--ghost-inverse-light.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-02-bg) var(--dt-color-active-02), var(--dt-color-transparent))}}.o-btn.o-btn--outline-inverse{border:1px solid var(--dt-color-border-strong)}.o-btn.o-btn--destructive{--int-states-mixin-bg-color: var(--dt-color-support-error)}.o-btn.o-btn--destructive:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--int-states-mixin-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--hover-modifier)))}.o-btn.o-btn--destructive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--destructive.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--int-states-mixin-bg-color: hsl(var(--dt-color-support-error-h), var(--dt-color-support-error-s), calc(var(--dt-color-support-error-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--destructive:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-support-error))}.o-btn.o-btn--destructive:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--destructive.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-support-error))}}.o-btn.o-btn--destructive-ghost{--int-states-mixin-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error-solid)}.o-btn.o-btn--destructive-ghost:hover:not(:disabled,.is-disabled,.is-dismissible){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--hover-modifier)))}.o-btn.o-btn--destructive-ghost:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--destructive-ghost.is-loading:not(:disabled,.is-disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--int-states-mixin-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier));--int-states-mixin-bg-color: hsl(var(--dt-color-transparent-h), var(--dt-color-transparent-s), calc(var(--dt-color-transparent-l) + var(--active-modifier)))}@supports (background-color: color-mix(in srgb,black,white)){.o-btn.o-btn--destructive-ghost:hover:not(:disabled,.is-disabled,.is-dismissible){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-hover-01-bg) var(--dt-color-hover-01), var(--dt-color-transparent))}.o-btn.o-btn--destructive-ghost:active:not(:disabled,.is-disabled,.is-dismissible),.o-btn.o-btn--destructive-ghost.is-loading:not(:disabled,.is-disabled){--int-states-mixin-bg-color: color-mix(in srgb, var(--dt-color-active-01-bg) var(--dt-color-active-01), var(--dt-color-transparent))}}.o-btn.o-btn--xsmall{--btn-font-size: calc(var(--dt-font-interactive-xs-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-xs-line-height) * 1px);--btn-icon-size: 16px;--icon-size-override: 16px;padding:var(--btn-padding-vertical-xsmall) var(--btn-padding-horizontal-small)}@media (min-width: 769px){.o-btn.o-btn--xsmall.o-btn--responsive{--btn-font-size: calc(var(--dt-font-interactive-s-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-s-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-productive) var(--btn-padding-horizontal-medium)}.o-btn.o-btn--xsmall.o-btn--responsive.o-btn--expressive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-expressive) var(--btn-padding-horizontal-medium)}}.o-btn.o-btn--xsmall.o-btn--outline,.o-btn.o-btn--xsmall.o-btn--outline-inverse{padding:calc(var(--btn-padding-vertical-xsmall) - 1px) var(--btn-padding-horizontal-small)}@media (min-width: 769px){.o-btn.o-btn--xsmall.o-btn--outline.o-btn--responsive,.o-btn.o-btn--xsmall.o-btn--outline-inverse.o-btn--responsive{padding:calc(var(--btn-padding-vertical-small-productive) - 1px) var(--btn-padding-horizontal-medium)}.o-btn.o-btn--xsmall.o-btn--outline.o-btn--responsive.o-btn--expressive,.o-btn.o-btn--xsmall.o-btn--outline-inverse.o-btn--responsive.o-btn--expressive{padding:calc(var(--btn-padding-vertical-small-expressive) - 1px) var(--btn-padding-horizontal-medium)}}.o-btn.o-btn--small-expressive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-expressive) var(--btn-padding-horizontal-medium)}@media (min-width: 769px){.o-btn.o-btn--small-expressive.o-btn--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}}.o-btn.o-btn--small-expressive.o-btn--outline,.o-btn.o-btn--small-expressive.o-btn--outline-inverse{padding:calc(var(--btn-padding-vertical-small-expressive) - 1px) var(--btn-padding-horizontal-medium)}@media (min-width: 769px){.o-btn.o-btn--small-expressive.o-btn--outline.o-btn--responsive,.o-btn.o-btn--small-expressive.o-btn--outline-inverse.o-btn--responsive{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}}.o-btn.o-btn--small-productive{--btn-font-size: calc(var(--dt-font-interactive-s-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-s-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-productive) var(--btn-padding-horizontal-medium)}@media (min-width: 769px){.o-btn.o-btn--small-productive.o-btn--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}}.o-btn.o-btn--small-productive.o-btn--outline,.o-btn.o-btn--small-productive.o-btn--outline-inverse{padding:calc(var(--btn-padding-vertical-small-productive) - 1px) var(--btn-padding-horizontal-medium)}@media (min-width: 769px){.o-btn.o-btn--small-productive.o-btn--outline.o-btn--responsive,.o-btn.o-btn--small-productive.o-btn--outline-inverse.o-btn--responsive{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}}.o-btn.o-btn--medium{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}@media (min-width: 769px){.o-btn.o-btn--medium.o-btn--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-large) var(--btn-padding-horizontal-large)}}.o-btn.o-btn--medium.o-btn--outline,.o-btn.o-btn--medium.o-btn--outline-inverse{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}@media (min-width: 769px){.o-btn.o-btn--medium.o-btn--outline.o-btn--responsive,.o-btn.o-btn--medium.o-btn--outline-inverse.o-btn--responsive{padding:calc(var(--btn-padding-vertical-large) - 1px) var(--btn-padding-horizontal-large)}}.o-btn.o-btn--large{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-large) var(--btn-padding-horizontal-large)}.o-btn.o-btn--large.o-btn--outline,.o-btn.o-btn--large.o-btn--outline-inverse{padding:calc(var(--btn-padding-vertical-large) - 1px) var(--btn-padding-horizontal-large)}.o-btn.o-btn--fullWidth{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled-solid) !important;cursor:not-allowed}.o-btn[disabled]:not(.o-btn--ghost,.o-btn--ghost-dark,.o-btn--ghost-inverse,.o-btn--ghost-inverse-light,.o-btn--destructive-ghost){--int-states-mixin-bg-color: var(--dt-color-disabled-01) !important;--btn-text-color: var(--dt-color-content-disabled) !important}.o-btn[disabled].o-btn--outline,.o-btn[disabled].o-btn--outline-inverse{border-color:var(--dt-color-disabled-01)!important}.o-btn.is-loading>*:not(pie-spinner){visibility:hidden}.o-btn.is-loading pie-spinner{position:absolute}.o-btn-text{text-overflow:ellipsis;overflow:hidden}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}";
|
|
512
|
-
var Kt = Object.defineProperty,
|
|
513
|
-
for (var d = p > 1 ? void 0 : p ?
|
|
514
|
-
(
|
|
515
|
-
return p && d && Kt(r,
|
|
512
|
+
var Kt = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, b = (l, r, v, p) => {
|
|
513
|
+
for (var d = p > 1 ? void 0 : p ? jt(r, v) : r, g = l.length - 1, f; g >= 0; g--)
|
|
514
|
+
(f = l[g]) && (d = (p ? f(r, v, d) : f(d)) || d);
|
|
515
|
+
return p && d && Kt(r, v, d), d;
|
|
516
516
|
};
|
|
517
|
-
const
|
|
518
|
-
let c = class extends Nt(
|
|
517
|
+
const A = "pie-button";
|
|
518
|
+
let c = class extends Nt(Ot(U)) {
|
|
519
519
|
constructor() {
|
|
520
|
-
super(...arguments), this.tag =
|
|
520
|
+
super(...arguments), this.tag = y.tag, this.size = y.size, this.type = y.type, this.variant = y.variant, this.iconPlacement = y.iconPlacement, this.disabled = y.disabled, this.isLoading = y.isLoading, this.isFullWidth = y.isFullWidth, this.isResponsive = y.isResponsive, this._handleFormKeyDown = (l) => {
|
|
521
521
|
if (!(l.key !== "Enter" || this.type !== "submit" || this.disabled)) {
|
|
522
522
|
if (l.target instanceof HTMLElement) {
|
|
523
523
|
const r = l.target.tagName.toLowerCase();
|
|
@@ -537,8 +537,8 @@ let c = class extends Nt(Pt(j)) {
|
|
|
537
537
|
super.disconnectedCallback(), this.type === "submit" && ((l = this.form) == null || l.removeEventListener("keydown", this._handleFormKeyDown));
|
|
538
538
|
}
|
|
539
539
|
updated(l) {
|
|
540
|
-
var r,
|
|
541
|
-
l.has("type") && (this.type === "submit" ? (r = this.form) == null || r.addEventListener("keydown", this._handleFormKeyDown) : (
|
|
540
|
+
var r, v;
|
|
541
|
+
l.has("type") && (this.type === "submit" ? (r = this.form) == null || r.addEventListener("keydown", this._handleFormKeyDown) : (v = this.form) == null || v.removeEventListener("keydown", this._handleFormKeyDown));
|
|
542
542
|
}
|
|
543
543
|
/**
|
|
544
544
|
* This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.
|
|
@@ -562,9 +562,9 @@ let c = class extends Nt(Pt(j)) {
|
|
|
562
562
|
* @private
|
|
563
563
|
*/
|
|
564
564
|
renderSpinner() {
|
|
565
|
-
const { size: l, variant: r, disabled:
|
|
565
|
+
const { size: l, variant: r, disabled: v } = this, p = l && l.includes("small") ? "small" : "medium";
|
|
566
566
|
let d;
|
|
567
|
-
return
|
|
567
|
+
return v ? d = r === "ghost-inverse" ? "inverse" : "secondary" : d = ["primary", "destructive", "outline-inverse", "ghost-inverse", "ghost-inverse-light"].includes(this.variant) ? "inverse" : "secondary", z`
|
|
568
568
|
<pie-spinner
|
|
569
569
|
size="${p}"
|
|
570
570
|
variant="${d}">
|
|
@@ -573,29 +573,32 @@ let c = class extends Nt(Pt(j)) {
|
|
|
573
573
|
renderAnchor(l) {
|
|
574
574
|
const {
|
|
575
575
|
href: r,
|
|
576
|
-
iconPlacement:
|
|
576
|
+
iconPlacement: v,
|
|
577
577
|
rel: p,
|
|
578
578
|
target: d,
|
|
579
|
-
download:
|
|
579
|
+
download: g,
|
|
580
|
+
aria: f
|
|
580
581
|
} = this;
|
|
581
582
|
return z`
|
|
582
583
|
<a
|
|
583
|
-
href="${
|
|
584
|
-
rel="${
|
|
585
|
-
target="${
|
|
586
|
-
download="${
|
|
584
|
+
href="${M(r)}"
|
|
585
|
+
rel="${M(p)}"
|
|
586
|
+
target="${M(d)}"
|
|
587
|
+
download="${M(g)}"
|
|
588
|
+
aria-label="${M(f == null ? void 0 : f.label)}"
|
|
587
589
|
class="${mt(l)}">
|
|
588
|
-
${
|
|
590
|
+
${v === "leading" ? z`<slot name="icon"></slot>` : C}
|
|
589
591
|
<slot></slot>
|
|
590
|
-
${
|
|
592
|
+
${v === "trailing" ? z`<slot name="icon"></slot>` : C}
|
|
591
593
|
</a>`;
|
|
592
594
|
}
|
|
593
595
|
renderButton(l) {
|
|
594
596
|
const {
|
|
595
597
|
disabled: r,
|
|
596
|
-
iconPlacement:
|
|
598
|
+
iconPlacement: v,
|
|
597
599
|
isLoading: p,
|
|
598
|
-
type: d
|
|
600
|
+
type: d,
|
|
601
|
+
aria: g
|
|
599
602
|
} = this, f = {
|
|
600
603
|
...l,
|
|
601
604
|
"is-loading": p
|
|
@@ -605,107 +608,111 @@ let c = class extends Nt(Pt(j)) {
|
|
|
605
608
|
@click=${this._handleClick}
|
|
606
609
|
class=${mt(f)}
|
|
607
610
|
type=${d}
|
|
608
|
-
?disabled=${r}
|
|
609
|
-
|
|
610
|
-
${
|
|
611
|
+
?disabled=${r}
|
|
612
|
+
aria-label="${M(g == null ? void 0 : g.label)}">
|
|
613
|
+
${p ? this.renderSpinner() : C}
|
|
614
|
+
${v === "leading" ? z`<slot name="icon"></slot>` : C}
|
|
611
615
|
<span class="o-btn-text"><slot></slot></span>
|
|
612
|
-
${
|
|
616
|
+
${v === "trailing" ? z`<slot name="icon"></slot>` : C}
|
|
613
617
|
</button>`;
|
|
614
618
|
}
|
|
615
619
|
render() {
|
|
616
620
|
const {
|
|
617
621
|
isFullWidth: l,
|
|
618
622
|
isResponsive: r,
|
|
619
|
-
responsiveSize:
|
|
623
|
+
responsiveSize: v,
|
|
620
624
|
size: p,
|
|
621
625
|
tag: d,
|
|
622
|
-
variant:
|
|
623
|
-
} = this,
|
|
626
|
+
variant: g
|
|
627
|
+
} = this, f = {
|
|
624
628
|
"o-btn": !0,
|
|
625
629
|
"o-btn--fullWidth": l,
|
|
626
630
|
"o-btn--responsive": r,
|
|
627
|
-
[`o-btn--${
|
|
628
|
-
[`o-btn--${
|
|
631
|
+
[`o-btn--${v}`]: !!(r && v),
|
|
632
|
+
[`o-btn--${g}`]: !0,
|
|
629
633
|
[`o-btn--${p}`]: !0
|
|
630
634
|
};
|
|
631
|
-
return d === "a" ? this.renderAnchor(
|
|
635
|
+
return d === "a" ? this.renderAnchor(f) : this.renderButton(f);
|
|
632
636
|
}
|
|
633
637
|
};
|
|
634
638
|
c.styles = Vt(Bt);
|
|
635
|
-
|
|
639
|
+
b([
|
|
640
|
+
m({ type: Object })
|
|
641
|
+
], c.prototype, "aria", 2);
|
|
642
|
+
b([
|
|
636
643
|
m({ type: String }),
|
|
637
|
-
|
|
644
|
+
F(A, Dt, y.tag)
|
|
638
645
|
], c.prototype, "tag", 2);
|
|
639
|
-
|
|
646
|
+
b([
|
|
640
647
|
m({ type: String }),
|
|
641
|
-
|
|
648
|
+
F(A, Rt, y.size)
|
|
642
649
|
], c.prototype, "size", 2);
|
|
643
|
-
|
|
650
|
+
b([
|
|
644
651
|
m({ type: String }),
|
|
645
|
-
|
|
652
|
+
F(A, $t, y.type)
|
|
646
653
|
], c.prototype, "type", 2);
|
|
647
|
-
|
|
654
|
+
b([
|
|
648
655
|
m({ type: String }),
|
|
649
|
-
|
|
656
|
+
F(A, Wt, y.variant)
|
|
650
657
|
], c.prototype, "variant", 2);
|
|
651
|
-
|
|
658
|
+
b([
|
|
652
659
|
m({ type: String }),
|
|
653
|
-
|
|
660
|
+
F(A, Ht, y.iconPlacement)
|
|
654
661
|
], c.prototype, "iconPlacement", 2);
|
|
655
|
-
|
|
662
|
+
b([
|
|
656
663
|
m({ type: Boolean })
|
|
657
664
|
], c.prototype, "disabled", 2);
|
|
658
|
-
|
|
665
|
+
b([
|
|
659
666
|
m({ type: Boolean, reflect: !0 })
|
|
660
667
|
], c.prototype, "isLoading", 2);
|
|
661
|
-
|
|
668
|
+
b([
|
|
662
669
|
m({ type: Boolean, reflect: !0 })
|
|
663
670
|
], c.prototype, "isFullWidth", 2);
|
|
664
|
-
|
|
671
|
+
b([
|
|
665
672
|
m({ type: Boolean })
|
|
666
673
|
], c.prototype, "isResponsive", 2);
|
|
667
|
-
|
|
674
|
+
b([
|
|
668
675
|
m({ type: String })
|
|
669
676
|
], c.prototype, "name", 2);
|
|
670
|
-
|
|
677
|
+
b([
|
|
671
678
|
m({ type: String })
|
|
672
679
|
], c.prototype, "value", 2);
|
|
673
|
-
|
|
680
|
+
b([
|
|
674
681
|
m({ type: String })
|
|
675
682
|
], c.prototype, "formaction", 2);
|
|
676
|
-
|
|
683
|
+
b([
|
|
677
684
|
m({ type: String })
|
|
678
685
|
], c.prototype, "formenctype", 2);
|
|
679
|
-
|
|
686
|
+
b([
|
|
680
687
|
m({ type: String })
|
|
681
688
|
], c.prototype, "formmethod", 2);
|
|
682
|
-
|
|
689
|
+
b([
|
|
683
690
|
m({ type: Boolean })
|
|
684
691
|
], c.prototype, "formnovalidate", 2);
|
|
685
|
-
|
|
692
|
+
b([
|
|
686
693
|
m({ type: String })
|
|
687
694
|
], c.prototype, "formtarget", 2);
|
|
688
|
-
|
|
695
|
+
b([
|
|
689
696
|
m({ type: String })
|
|
690
697
|
], c.prototype, "responsiveSize", 2);
|
|
691
|
-
|
|
698
|
+
b([
|
|
692
699
|
m({ type: String })
|
|
693
700
|
], c.prototype, "href", 2);
|
|
694
|
-
|
|
701
|
+
b([
|
|
695
702
|
m({ type: String })
|
|
696
703
|
], c.prototype, "rel", 2);
|
|
697
|
-
|
|
704
|
+
b([
|
|
698
705
|
m({ type: String })
|
|
699
706
|
], c.prototype, "target", 2);
|
|
700
|
-
|
|
707
|
+
b([
|
|
701
708
|
m({ type: String })
|
|
702
709
|
], c.prototype, "download", 2);
|
|
703
|
-
c =
|
|
704
|
-
|
|
710
|
+
c = b([
|
|
711
|
+
Pt("pie-button")
|
|
705
712
|
], c);
|
|
706
713
|
export {
|
|
707
714
|
c as PieButton,
|
|
708
|
-
|
|
715
|
+
y as defaultProps,
|
|
709
716
|
te as formEncodingtypes,
|
|
710
717
|
ee as formMethodTypes,
|
|
711
718
|
ie as formTargetTypes,
|
package/dist/react.d.ts
CHANGED
|
@@ -8,7 +8,15 @@ import { PropertyValues } from 'lit';
|
|
|
8
8
|
import * as React_2 from 'react';
|
|
9
9
|
import { TemplateResult } from 'lit';
|
|
10
10
|
|
|
11
|
+
declare type AriaProps = {
|
|
12
|
+
label?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
11
15
|
export declare interface ButtonProps {
|
|
16
|
+
/**
|
|
17
|
+
* The ARIA attributes for the button element.
|
|
18
|
+
*/
|
|
19
|
+
aria?: AriaProps;
|
|
12
20
|
/**
|
|
13
21
|
* Which HTML element to use when rendering the button.
|
|
14
22
|
*/
|
|
@@ -134,6 +142,7 @@ declare class PieButton_2 extends PieButton_base implements ButtonProps {
|
|
|
134
142
|
connectedCallback(): void;
|
|
135
143
|
disconnectedCallback(): void;
|
|
136
144
|
updated(changedProperties: PropertyValues<this>): void;
|
|
145
|
+
aria: ButtonProps['aria'];
|
|
137
146
|
tag: "button" | "a";
|
|
138
147
|
size: "xsmall" | "small-productive" | "small-expressive" | "medium" | "large";
|
|
139
148
|
type: "button" | "submit" | "reset";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-button",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "PIE design system button built using web components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "run -T vite build",
|
|
32
32
|
"build:react-wrapper": "npx build-react-wrapper",
|
|
33
|
-
"create:manifest": "
|
|
33
|
+
"create:manifest": "run -T cem analyze --litelement",
|
|
34
34
|
"lint:scripts": "run -T eslint .",
|
|
35
35
|
"lint:scripts:fix": "run -T eslint . --fix",
|
|
36
36
|
"lint:style": "run -T stylelint ./src/**/*.{css,scss}",
|
|
@@ -44,12 +44,10 @@
|
|
|
44
44
|
"author": "Just Eat Takeaway.com - Design System Team",
|
|
45
45
|
"license": "Apache-2.0",
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@justeattakeaway/pie-
|
|
49
|
-
"@justeattakeaway/pie-css": "1.1.0",
|
|
47
|
+
"@justeattakeaway/pie-components-config": "0.21.1",
|
|
48
|
+
"@justeattakeaway/pie-css": "1.1.1",
|
|
50
49
|
"@justeattakeaway/pie-monorepo-utils": "0.9.0",
|
|
51
|
-
"@justeattakeaway/pie-wrapper-react": "0.14.4"
|
|
52
|
-
"cem-plugin-module-file-extensions": "0.0.5"
|
|
50
|
+
"@justeattakeaway/pie-wrapper-react": "0.14.4"
|
|
53
51
|
},
|
|
54
52
|
"volta": {
|
|
55
53
|
"extends": "../../../package.json"
|
|
@@ -59,7 +57,7 @@
|
|
|
59
57
|
"dist/*.js"
|
|
60
58
|
],
|
|
61
59
|
"dependencies": {
|
|
62
|
-
"@justeattakeaway/pie-spinner": "1.4.
|
|
60
|
+
"@justeattakeaway/pie-spinner": "1.4.14",
|
|
63
61
|
"@justeattakeaway/pie-webc-core": "14.0.1",
|
|
64
62
|
"element-internals-polyfill": "1.3.11"
|
|
65
63
|
}
|
package/src/defs.ts
CHANGED
|
@@ -12,11 +12,20 @@ export const iconPlacements = ['leading', 'trailing'] as const;
|
|
|
12
12
|
|
|
13
13
|
export type Variant = typeof variants[number];
|
|
14
14
|
|
|
15
|
+
type AriaProps = {
|
|
16
|
+
label?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
15
19
|
export const formEncodingtypes = ['application/x-www-form-urlencoded', 'multipart/form-data', 'text/plain'] as const;
|
|
16
20
|
export const formMethodTypes = ['post', 'get', 'dialog'] as const;
|
|
17
21
|
export const formTargetTypes = ['_self', '_blank', '_parent', '_top'] as const;
|
|
18
22
|
|
|
19
23
|
export interface ButtonProps {
|
|
24
|
+
/**
|
|
25
|
+
* The ARIA attributes for the button element.
|
|
26
|
+
*/
|
|
27
|
+
aria?: AriaProps;
|
|
28
|
+
|
|
20
29
|
/**
|
|
21
30
|
* Which HTML element to use when rendering the button.
|
|
22
31
|
*/
|
package/src/index.ts
CHANGED
|
@@ -58,6 +58,9 @@ export class PieButton extends DelegatesFocusMixin(FormControlMixin(PieElement))
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
@property({ type: Object })
|
|
62
|
+
public aria: ButtonProps['aria'];
|
|
63
|
+
|
|
61
64
|
@property({ type: String })
|
|
62
65
|
@validPropertyValues(componentSelector, tags, defaultProps.tag)
|
|
63
66
|
public tag = defaultProps.tag;
|
|
@@ -239,7 +242,7 @@ export class PieButton extends DelegatesFocusMixin(FormControlMixin(PieElement))
|
|
|
239
242
|
|
|
240
243
|
renderAnchor (classes: ClassInfo) {
|
|
241
244
|
const {
|
|
242
|
-
href, iconPlacement, rel, target, download,
|
|
245
|
+
href, iconPlacement, rel, target, download, aria,
|
|
243
246
|
} = this;
|
|
244
247
|
|
|
245
248
|
return html`
|
|
@@ -248,6 +251,7 @@ export class PieButton extends DelegatesFocusMixin(FormControlMixin(PieElement))
|
|
|
248
251
|
rel="${ifDefined(rel)}"
|
|
249
252
|
target="${ifDefined(target)}"
|
|
250
253
|
download="${ifDefined(download)}"
|
|
254
|
+
aria-label="${ifDefined(aria?.label)}"
|
|
251
255
|
class="${classMap(classes)}">
|
|
252
256
|
${iconPlacement === 'leading' ? html`<slot name="icon"></slot>` : nothing}
|
|
253
257
|
<slot></slot>
|
|
@@ -257,7 +261,7 @@ export class PieButton extends DelegatesFocusMixin(FormControlMixin(PieElement))
|
|
|
257
261
|
|
|
258
262
|
renderButton (classes: ClassInfo) {
|
|
259
263
|
const {
|
|
260
|
-
disabled, iconPlacement, isLoading, type,
|
|
264
|
+
disabled, iconPlacement, isLoading, type, aria,
|
|
261
265
|
} = this;
|
|
262
266
|
|
|
263
267
|
const buttonClasses = {
|
|
@@ -270,7 +274,8 @@ export class PieButton extends DelegatesFocusMixin(FormControlMixin(PieElement))
|
|
|
270
274
|
@click=${this._handleClick}
|
|
271
275
|
class=${classMap(buttonClasses)}
|
|
272
276
|
type=${type}
|
|
273
|
-
?disabled=${disabled}
|
|
277
|
+
?disabled=${disabled}
|
|
278
|
+
aria-label="${ifDefined(aria?.label)}">
|
|
274
279
|
${isLoading ? this.renderSpinner() : nothing}
|
|
275
280
|
${iconPlacement === 'leading' ? html`<slot name="icon"></slot>` : nothing}
|
|
276
281
|
<span class="o-btn-text"><slot></slot></span>
|