@justeattakeaway/pie-button 1.5.0 → 1.5.1
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/index.d.ts +2 -2
- package/dist/index.js +80 -81
- package/dist/react.d.ts +2 -2
- package/package.json +4 -4
- package/declaration.d.ts +0 -9
package/dist/index.d.ts
CHANGED
|
@@ -125,9 +125,9 @@ export declare class PieButton extends PieButton_base implements ButtonProps {
|
|
|
125
125
|
disconnectedCallback(): void;
|
|
126
126
|
updated(changedProperties: PropertyValues<this>): void;
|
|
127
127
|
tag: "button" | "a";
|
|
128
|
-
size: "xsmall" | "
|
|
128
|
+
size: "xsmall" | "small-productive" | "small-expressive" | "medium" | "large";
|
|
129
129
|
type: "button" | "submit" | "reset";
|
|
130
|
-
variant: "
|
|
130
|
+
variant: "primary" | "primary-alternative" | "secondary" | "outline" | "outline-inverse" | "ghost" | "inverse" | "ghost-inverse" | "destructive" | "destructive-ghost";
|
|
131
131
|
iconPlacement: "leading" | "trailing";
|
|
132
132
|
disabled: boolean;
|
|
133
133
|
isLoading: boolean;
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { FormControlMixin as Tt, validPropertyValues as A, defineCustomElement a
|
|
|
6
6
|
import "@justeattakeaway/pie-spinner";
|
|
7
7
|
(function() {
|
|
8
8
|
(function(y) {
|
|
9
|
-
const
|
|
9
|
+
const a = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), T = {
|
|
10
10
|
ariaAtomic: "aria-atomic",
|
|
11
11
|
ariaAutoComplete: "aria-autocomplete",
|
|
12
12
|
ariaBusy: "aria-busy",
|
|
@@ -53,13 +53,13 @@ import "@justeattakeaway/pie-spinner";
|
|
|
53
53
|
for (let i in T) {
|
|
54
54
|
t[i] = null;
|
|
55
55
|
let o = null;
|
|
56
|
-
const
|
|
56
|
+
const n = T[i];
|
|
57
57
|
Object.defineProperty(t, i, {
|
|
58
58
|
get() {
|
|
59
59
|
return o;
|
|
60
60
|
},
|
|
61
61
|
set(s) {
|
|
62
|
-
o = s, e.isConnected ? e.setAttribute(
|
|
62
|
+
o = s, e.isConnected ? e.setAttribute(n, s) : I.set(e, t);
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -75,22 +75,22 @@ import "@justeattakeaway/pie-spinner";
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
let o = i.nextNode();
|
|
78
|
-
const
|
|
78
|
+
const n = !t || e.disabled;
|
|
79
79
|
for (; o; )
|
|
80
|
-
o.formDisabledCallback &&
|
|
80
|
+
o.formDisabledCallback && n && R(o, e.disabled), o = i.nextNode();
|
|
81
81
|
}, Z = { attributes: !0, attributeFilter: ["disabled", "name"] }, V = _() ? new MutationObserver((e) => {
|
|
82
82
|
for (const t of e) {
|
|
83
83
|
const i = t.target;
|
|
84
84
|
if (t.attributeName === "disabled" && (i.constructor.formAssociated ? R(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && Y(i)), t.attributeName === "name" && i.constructor.formAssociated) {
|
|
85
|
-
const o = l.get(i),
|
|
86
|
-
o.setFormValue(
|
|
85
|
+
const o = l.get(i), n = U.get(i);
|
|
86
|
+
o.setFormValue(n);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}) : {};
|
|
90
90
|
function O(e) {
|
|
91
91
|
e.forEach((t) => {
|
|
92
|
-
const { addedNodes: i, removedNodes: o } = t,
|
|
93
|
-
|
|
92
|
+
const { addedNodes: i, removedNodes: o } = t, n = Array.from(i), s = Array.from(o);
|
|
93
|
+
n.forEach((d) => {
|
|
94
94
|
var u;
|
|
95
95
|
if (l.has(d) && d.constructor.formAssociated && X(d), I.has(d)) {
|
|
96
96
|
const h = I.get(d);
|
|
@@ -123,8 +123,8 @@ import "@justeattakeaway/pie-spinner";
|
|
|
123
123
|
e.forEach((t) => {
|
|
124
124
|
const { removedNodes: i } = t;
|
|
125
125
|
i.forEach((o) => {
|
|
126
|
-
const
|
|
127
|
-
l.has(o) &&
|
|
126
|
+
const n = J.get(t.target);
|
|
127
|
+
l.has(o) && at(o), n.disconnect();
|
|
128
128
|
});
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -156,8 +156,8 @@ import "@justeattakeaway/pie-spinner";
|
|
|
156
156
|
t[0].id || (i = `${t[0].htmlFor}_Label`, t[0].id = i), e.setAttribute("aria-labelledby", i);
|
|
157
157
|
}
|
|
158
158
|
}, N = (e) => {
|
|
159
|
-
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i = E.get(e) || [], o = Array.from(i).filter((s) => s.isConnected).map((s) => l.get(s).validity.valid),
|
|
160
|
-
e.toggleAttribute("internals-invalid",
|
|
159
|
+
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i = E.get(e) || [], o = Array.from(i).filter((s) => s.isConnected).map((s) => l.get(s).validity.valid), n = [...t, ...o].includes(!1);
|
|
160
|
+
e.toggleAttribute("internals-invalid", n), e.toggleAttribute("internals-valid", !n);
|
|
161
161
|
}, ft = (e) => {
|
|
162
162
|
N(P(e.target));
|
|
163
163
|
}, yt = (e) => {
|
|
@@ -166,10 +166,10 @@ import "@justeattakeaway/pie-spinner";
|
|
|
166
166
|
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(",");
|
|
167
167
|
e.addEventListener("click", (i) => {
|
|
168
168
|
if (i.target.closest(t)) {
|
|
169
|
-
const
|
|
169
|
+
const n = E.get(e);
|
|
170
170
|
if (e.noValidate)
|
|
171
171
|
return;
|
|
172
|
-
|
|
172
|
+
n.size && Array.from(n).reverse().map((u) => l.get(u).reportValidity()).includes(!1) && i.preventDefault();
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
175
|
}, wt = (e) => {
|
|
@@ -183,8 +183,8 @@ import "@justeattakeaway/pie-spinner";
|
|
|
183
183
|
if (o)
|
|
184
184
|
o.add(e);
|
|
185
185
|
else {
|
|
186
|
-
const
|
|
187
|
-
|
|
186
|
+
const n = /* @__PURE__ */ new Set();
|
|
187
|
+
n.add(e), E.set(t, n), xt(t), t.addEventListener("reset", wt), t.addEventListener("input", ft), t.addEventListener("change", yt);
|
|
188
188
|
}
|
|
189
189
|
f.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
190
190
|
e.formAssociatedCallback.apply(e, [t]);
|
|
@@ -198,10 +198,10 @@ import "@justeattakeaway/pie-spinner";
|
|
|
198
198
|
throw new i(t);
|
|
199
199
|
}, rt = (e, t, i) => {
|
|
200
200
|
const o = E.get(e);
|
|
201
|
-
return o && o.size && o.forEach((
|
|
202
|
-
l.get(
|
|
201
|
+
return o && o.size && o.forEach((n) => {
|
|
202
|
+
l.get(n)[i]() || (t = !1);
|
|
203
203
|
}), t;
|
|
204
|
-
},
|
|
204
|
+
}, at = (e) => {
|
|
205
205
|
if (e.constructor.formAssociated) {
|
|
206
206
|
const t = l.get(e), { labels: i, form: o } = t;
|
|
207
207
|
it(e, i), ot(e, o, t);
|
|
@@ -221,7 +221,7 @@ import "@justeattakeaway/pie-spinner";
|
|
|
221
221
|
i !== "valid" && e[i] !== !1 && (t = !1);
|
|
222
222
|
return t;
|
|
223
223
|
}, D = /* @__PURE__ */ new WeakMap();
|
|
224
|
-
function
|
|
224
|
+
function nt(e, t) {
|
|
225
225
|
e.toggleAttribute(t, !0), e.part && e.part.add(t);
|
|
226
226
|
}
|
|
227
227
|
class W extends Set {
|
|
@@ -236,9 +236,9 @@ import "@justeattakeaway/pie-spinner";
|
|
|
236
236
|
add(t) {
|
|
237
237
|
if (!/^--/.test(t) || typeof t != "string")
|
|
238
238
|
throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
|
|
239
|
-
const i = super.add(t), o = D.get(this),
|
|
240
|
-
return o.isConnected ?
|
|
241
|
-
|
|
239
|
+
const i = super.add(t), o = D.get(this), n = `state${t}`;
|
|
240
|
+
return o.isConnected ? nt(o, n) : setTimeout(() => {
|
|
241
|
+
nt(o, n);
|
|
242
242
|
}), i;
|
|
243
243
|
}
|
|
244
244
|
clear() {
|
|
@@ -254,11 +254,10 @@ import "@justeattakeaway/pie-spinner";
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
function st(e, t, i, o) {
|
|
257
|
-
if (
|
|
258
|
-
if (typeof t == "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
257
|
+
if (typeof t == "function" ? e !== t || !0 : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
259
258
|
return i === "m" ? o : i === "a" ? o.call(e) : o ? o.value : t.get(e);
|
|
260
259
|
}
|
|
261
|
-
function St(e, t, i, o,
|
|
260
|
+
function St(e, t, i, o, n) {
|
|
262
261
|
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");
|
|
263
262
|
return t.set(e, i), i;
|
|
264
263
|
}
|
|
@@ -298,10 +297,10 @@ import "@justeattakeaway/pie-spinner";
|
|
|
298
297
|
let d = t.apply(this, s);
|
|
299
298
|
return rt(this, d, "reportValidity");
|
|
300
299
|
}
|
|
301
|
-
const { get:
|
|
300
|
+
const { get: n } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
302
301
|
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
303
302
|
get(...s) {
|
|
304
|
-
const d =
|
|
303
|
+
const d = n.call(this, ...s), u = Array.from(E.get(this) || []);
|
|
305
304
|
if (u.length === 0)
|
|
306
305
|
return d;
|
|
307
306
|
const h = Array.from(d).concat(u).sort((k, x) => k.compareDocumentPosition ? k.compareDocumentPosition(x) & 2 ? 1 : -1 : 0);
|
|
@@ -317,10 +316,10 @@ import "@justeattakeaway/pie-spinner";
|
|
|
317
316
|
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
318
317
|
throw new TypeError("Illegal constructor");
|
|
319
318
|
const i = t.getRootNode(), o = new kt();
|
|
320
|
-
this.states = new W(t),
|
|
319
|
+
this.states = new W(t), a.set(this, t), r.set(this, o), l.set(t, this), pt(t, this), gt(t, this), Object.seal(this), i instanceof DocumentFragment && ut(i);
|
|
321
320
|
}
|
|
322
321
|
checkValidity() {
|
|
323
|
-
const t =
|
|
322
|
+
const t = a.get(this);
|
|
324
323
|
if (w(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
325
324
|
return !0;
|
|
326
325
|
const i = r.get(this);
|
|
@@ -335,19 +334,19 @@ import "@justeattakeaway/pie-spinner";
|
|
|
335
334
|
return i.valid;
|
|
336
335
|
}
|
|
337
336
|
get form() {
|
|
338
|
-
const t =
|
|
337
|
+
const t = a.get(this);
|
|
339
338
|
w(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
340
339
|
let i;
|
|
341
340
|
return t.constructor.formAssociated === !0 && (i = P(t)), i;
|
|
342
341
|
}
|
|
343
342
|
get labels() {
|
|
344
|
-
const t =
|
|
343
|
+
const t = a.get(this);
|
|
345
344
|
w(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
346
345
|
const i = t.getAttribute("id"), o = t.getRootNode();
|
|
347
346
|
return o && i ? o.querySelectorAll(`[for="${i}"]`) : [];
|
|
348
347
|
}
|
|
349
348
|
reportValidity() {
|
|
350
|
-
const t =
|
|
349
|
+
const t = a.get(this);
|
|
351
350
|
if (w(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
352
351
|
return !0;
|
|
353
352
|
const i = this.checkValidity(), o = G.get(this);
|
|
@@ -356,23 +355,23 @@ import "@justeattakeaway/pie-spinner";
|
|
|
356
355
|
return !i && o && (t.focus(), o.focus()), i;
|
|
357
356
|
}
|
|
358
357
|
setFormValue(t) {
|
|
359
|
-
const i =
|
|
358
|
+
const i = a.get(this);
|
|
360
359
|
if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), tt(this), t != null && !(t instanceof FormData)) {
|
|
361
360
|
if (i.getAttribute("name")) {
|
|
362
361
|
const o = et(i, this);
|
|
363
362
|
o.value = t;
|
|
364
363
|
}
|
|
365
|
-
} else t != null && t instanceof FormData && Array.from(t).reverse().forEach(([o,
|
|
366
|
-
if (typeof
|
|
364
|
+
} else t != null && t instanceof FormData && Array.from(t).reverse().forEach(([o, n]) => {
|
|
365
|
+
if (typeof n == "string") {
|
|
367
366
|
const s = et(i, this);
|
|
368
|
-
s.name = o, s.value =
|
|
367
|
+
s.name = o, s.value = n;
|
|
369
368
|
}
|
|
370
369
|
});
|
|
371
370
|
U.set(i, t);
|
|
372
371
|
}
|
|
373
372
|
setValidity(t, i, o) {
|
|
374
|
-
const
|
|
375
|
-
if (w(
|
|
373
|
+
const n = a.get(this);
|
|
374
|
+
if (w(n, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
376
375
|
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
377
376
|
G.set(this, o);
|
|
378
377
|
const s = r.get(this), d = {};
|
|
@@ -384,22 +383,22 @@ import "@justeattakeaway/pie-spinner";
|
|
|
384
383
|
const { valid: h } = zt(s, u, this.form);
|
|
385
384
|
if (!h && !i)
|
|
386
385
|
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.");
|
|
387
|
-
m.set(this, h ? "" : i),
|
|
386
|
+
m.set(this, h ? "" : i), n.isConnected ? (n.toggleAttribute("internals-invalid", !h), n.toggleAttribute("internals-valid", h), n.setAttribute("aria-invalid", `${!h}`)) : L.set(n, this);
|
|
388
387
|
}
|
|
389
388
|
get shadowRoot() {
|
|
390
|
-
const t =
|
|
389
|
+
const t = a.get(this), i = q.get(t);
|
|
391
390
|
return i || null;
|
|
392
391
|
}
|
|
393
392
|
get validationMessage() {
|
|
394
|
-
const t =
|
|
393
|
+
const t = a.get(this);
|
|
395
394
|
return w(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), m.get(this);
|
|
396
395
|
}
|
|
397
396
|
get validity() {
|
|
398
|
-
const t =
|
|
397
|
+
const t = a.get(this);
|
|
399
398
|
return w(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), r.get(this);
|
|
400
399
|
}
|
|
401
400
|
get willValidate() {
|
|
402
|
-
const t =
|
|
401
|
+
const t = a.get(this);
|
|
403
402
|
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"));
|
|
404
403
|
}
|
|
405
404
|
}
|
|
@@ -438,14 +437,14 @@ import "@justeattakeaway/pie-spinner";
|
|
|
438
437
|
if (!dt) {
|
|
439
438
|
if (dt = !0, typeof window < "u" && (window.ElementInternals = lt), typeof CustomElementRegistry < "u") {
|
|
440
439
|
const t = CustomElementRegistry.prototype.define;
|
|
441
|
-
CustomElementRegistry.prototype.define = function(i, o,
|
|
440
|
+
CustomElementRegistry.prototype.define = function(i, o, n) {
|
|
442
441
|
if (o.formAssociated) {
|
|
443
442
|
const s = o.prototype.connectedCallback;
|
|
444
443
|
o.prototype.connectedCallback = function() {
|
|
445
|
-
Q.has(this) || (Q.set(this, !0), this.hasAttribute("disabled") && R(this, !0)), s != null && s.apply(this),
|
|
444
|
+
Q.has(this) || (Q.set(this, !0), this.hasAttribute("disabled") && R(this, !0)), s != null && s.apply(this), at(this);
|
|
446
445
|
};
|
|
447
446
|
}
|
|
448
|
-
t.call(this, i, o,
|
|
447
|
+
t.call(this, i, o, n);
|
|
449
448
|
};
|
|
450
449
|
}
|
|
451
450
|
if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
|
|
@@ -458,12 +457,12 @@ import "@justeattakeaway/pie-spinner";
|
|
|
458
457
|
return new lt(this);
|
|
459
458
|
}), typeof Element < "u") {
|
|
460
459
|
let t = function(...o) {
|
|
461
|
-
const
|
|
462
|
-
if (q.set(this,
|
|
460
|
+
const n = i.apply(this, o);
|
|
461
|
+
if (q.set(this, n), _()) {
|
|
463
462
|
const s = new MutationObserver(O);
|
|
464
|
-
window.ShadyDOM ? s.observe(this, $) : s.observe(
|
|
463
|
+
window.ShadyDOM ? s.observe(this, $) : s.observe(n, $), M.set(this, s);
|
|
465
464
|
}
|
|
466
|
-
return
|
|
465
|
+
return n;
|
|
467
466
|
};
|
|
468
467
|
const i = Element.prototype.attachShadow;
|
|
469
468
|
Element.prototype.attachShadow = t;
|
|
@@ -474,14 +473,14 @@ import "@justeattakeaway/pie-spinner";
|
|
|
474
473
|
return !!customElements.polyfillWrapFlushCallback || (At() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : bt(!1)), y.forceCustomStateSetPolyfill = H, y.forceElementInternalsPolyfill = bt, Object.defineProperty(y, "__esModule", { value: !0 }), y;
|
|
475
474
|
})({});
|
|
476
475
|
})();
|
|
477
|
-
var Nt = Object.defineProperty, Pt = (y,
|
|
476
|
+
var Nt = Object.defineProperty, Pt = (y, a, r, b) => {
|
|
478
477
|
for (var l = void 0, m = y.length - 1, f; m >= 0; m--)
|
|
479
|
-
(f = y[m]) && (l = f(
|
|
480
|
-
return l && Nt(
|
|
478
|
+
(f = y[m]) && (l = f(a, r, l) || l);
|
|
479
|
+
return l && Nt(a, r, l), l;
|
|
481
480
|
};
|
|
482
481
|
class mt extends It {
|
|
483
482
|
constructor() {
|
|
484
|
-
super(...arguments), this.v = "1.5.
|
|
483
|
+
super(...arguments), this.v = "1.5.1";
|
|
485
484
|
}
|
|
486
485
|
}
|
|
487
486
|
Pt([
|
|
@@ -509,35 +508,35 @@ const _t = ["button", "a"], Ot = ["xsmall", "small-productive", "small-expressiv
|
|
|
509
508
|
isFullWidth: !1,
|
|
510
509
|
isResponsive: !1
|
|
511
510
|
}, Wt = "*,*:after,*:before{box-sizing:inherit}.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);--icon-display-override: block;--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small: 8px;--btn-padding-vertical-medium: 10px;--btn-padding-vertical-large: 14px;--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);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);cursor:pointer;-webkit-user-select:none;user-select:none;text-decoration:none;inline-size:var(--btn-inline-size)}.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)}.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--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);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-link)}.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--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)}.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--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)}.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-size-14) * 1px);--btn-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--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-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px;padding:var(--btn-padding-vertical-small) var(--btn-padding-horizontal-medium)}.o-btn.o-btn--xsmall.o-btn--responsive.o-btn--expressive{--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px;padding:var(--btn-padding-vertical-xsmall) 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) - 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-xsmall) - 1px) var(--btn-padding-horizontal-medium)}}.o-btn.o-btn--small-expressive{--btn-font-size: calc(var(--dt-font-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--icon-size-override: 20px;padding:var(--btn-padding-vertical-xsmall) 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-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--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-xsmall) - 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-size-16) * 1px);--btn-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--icon-size-override: 20px;padding:var(--btn-padding-vertical-small) 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-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--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) - 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-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--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-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--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-size-20) * 1px);--btn-line-height: calc(var(--dt-font-size-20-line-height) * 1px);--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) !important;cursor:not-allowed}.o-btn[disabled]:not(.o-btn--ghost,.o-btn--ghost-inverse,.o-btn--destructive-ghost){--int-states-mixin-bg-color: var(--dt-color-disabled-01) !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: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-text{text-overflow:ellipsis;overflow:hidden}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}";
|
|
512
|
-
var Ht = Object.defineProperty, p = (y,
|
|
511
|
+
var Ht = Object.defineProperty, p = (y, a, r, b) => {
|
|
513
512
|
for (var l = void 0, m = y.length - 1, f; m >= 0; m--)
|
|
514
|
-
(f = y[m]) && (l = f(
|
|
515
|
-
return l && Ht(
|
|
513
|
+
(f = y[m]) && (l = f(a, r, l) || l);
|
|
514
|
+
return l && Ht(a, r, l), l;
|
|
516
515
|
};
|
|
517
516
|
const S = "pie-button", j = class j extends Tt(mt) {
|
|
518
517
|
constructor() {
|
|
519
|
-
super(...arguments), this.tag = g.tag, this.size = g.size, this.type = g.type, this.variant = g.variant, this.iconPlacement = g.iconPlacement, this.disabled = g.disabled, this.isLoading = g.isLoading, this.isFullWidth = g.isFullWidth, this.isResponsive = g.isResponsive, this._handleFormKeyDown = (
|
|
520
|
-
if (!(
|
|
521
|
-
if (
|
|
522
|
-
const r =
|
|
518
|
+
super(...arguments), this.tag = g.tag, this.size = g.size, this.type = g.type, this.variant = g.variant, this.iconPlacement = g.iconPlacement, this.disabled = g.disabled, this.isLoading = g.isLoading, this.isFullWidth = g.isFullWidth, this.isResponsive = g.isResponsive, this._handleFormKeyDown = (a) => {
|
|
519
|
+
if (!(a.key !== "Enter" || this.type !== "submit" || this.disabled)) {
|
|
520
|
+
if (a.target instanceof HTMLElement) {
|
|
521
|
+
const r = a.target.tagName.toLowerCase();
|
|
523
522
|
if (r === "button" || r === "pie-button")
|
|
524
523
|
return;
|
|
525
524
|
}
|
|
526
|
-
|
|
525
|
+
a.preventDefault(), this._handleClick();
|
|
527
526
|
}
|
|
528
527
|
};
|
|
529
528
|
}
|
|
530
529
|
connectedCallback() {
|
|
531
|
-
var
|
|
532
|
-
super.connectedCallback(), this.type === "submit" && ((
|
|
530
|
+
var a;
|
|
531
|
+
super.connectedCallback(), this.type === "submit" && ((a = this.form) == null || a.addEventListener("keydown", this._handleFormKeyDown));
|
|
533
532
|
}
|
|
534
533
|
disconnectedCallback() {
|
|
535
|
-
var
|
|
536
|
-
super.disconnectedCallback(), this.type === "submit" && ((
|
|
534
|
+
var a;
|
|
535
|
+
super.disconnectedCallback(), this.type === "submit" && ((a = this.form) == null || a.removeEventListener("keydown", this._handleFormKeyDown));
|
|
537
536
|
}
|
|
538
|
-
updated(
|
|
537
|
+
updated(a) {
|
|
539
538
|
var r, b;
|
|
540
|
-
|
|
539
|
+
a.has("type") && (this.type === "submit" ? (r = this.form) == null || r.addEventListener("keydown", this._handleFormKeyDown) : (b = this.form) == null || b.removeEventListener("keydown", this._handleFormKeyDown));
|
|
541
540
|
}
|
|
542
541
|
/**
|
|
543
542
|
* This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.
|
|
@@ -547,10 +546,10 @@ const S = "pie-button", j = class j extends Tt(mt) {
|
|
|
547
546
|
*
|
|
548
547
|
* TODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin.
|
|
549
548
|
*/
|
|
550
|
-
_simulateNativeButtonClick(
|
|
549
|
+
_simulateNativeButtonClick(a) {
|
|
551
550
|
if (!this.form) return;
|
|
552
551
|
const r = document.createElement("button");
|
|
553
|
-
r.type =
|
|
552
|
+
r.type = a, r.style.position = "absolute", r.style.width = "1px", r.style.height = "1px", r.style.padding = "0", r.style.margin = "-1px", r.style.overflow = "hidden", r.style.border = "0", r.style.whiteSpace = "nowrap", a === "submit" && (this.name && (r.name = this.name), this.value && (r.value = this.value), this.formaction && r.setAttribute("formaction", this.formaction), this.formenctype && r.setAttribute("formenctype", this.formenctype), this.formmethod && r.setAttribute("formmethod", this.formmethod), this.formnovalidate && r.setAttribute("formnovalidate", "formnovalidate"), this.formtarget && r.setAttribute("formtarget", this.formtarget)), this.form.append(r), r.click(), r.remove();
|
|
554
553
|
}
|
|
555
554
|
_handleClick() {
|
|
556
555
|
this.form && (this.isLoading || this.tag === "button" && (this.type === "submit" ? (this.formnovalidate || this.form.reportValidity()) && this._simulateNativeButtonClick("submit") : this.type === "reset" && this._simulateNativeButtonClick("reset")));
|
|
@@ -561,7 +560,7 @@ const S = "pie-button", j = class j extends Tt(mt) {
|
|
|
561
560
|
* @private
|
|
562
561
|
*/
|
|
563
562
|
renderSpinner() {
|
|
564
|
-
const { size:
|
|
563
|
+
const { size: a, variant: r, disabled: b } = this, l = a && a.includes("small") ? "small" : "medium";
|
|
565
564
|
let m;
|
|
566
565
|
return b ? m = r === "ghost-inverse" ? "inverse" : "secondary" : m = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", z`
|
|
567
566
|
<pie-spinner
|
|
@@ -569,7 +568,7 @@ const S = "pie-button", j = class j extends Tt(mt) {
|
|
|
569
568
|
variant="${m}">
|
|
570
569
|
</pie-spinner>`;
|
|
571
570
|
}
|
|
572
|
-
renderAnchor(
|
|
571
|
+
renderAnchor(a) {
|
|
573
572
|
const {
|
|
574
573
|
href: r,
|
|
575
574
|
iconPlacement: b,
|
|
@@ -581,20 +580,20 @@ const S = "pie-button", j = class j extends Tt(mt) {
|
|
|
581
580
|
href="${K(r)}"
|
|
582
581
|
rel="${K(l)}"
|
|
583
582
|
target="${K(m)}"
|
|
584
|
-
class="${vt(
|
|
583
|
+
class="${vt(a)}">
|
|
585
584
|
${b === "leading" ? z`<slot name="icon"></slot>` : F}
|
|
586
585
|
<slot></slot>
|
|
587
586
|
${b === "trailing" ? z`<slot name="icon"></slot>` : F}
|
|
588
587
|
</a>`;
|
|
589
588
|
}
|
|
590
|
-
renderButton(
|
|
589
|
+
renderButton(a) {
|
|
591
590
|
const {
|
|
592
591
|
disabled: r,
|
|
593
592
|
iconPlacement: b,
|
|
594
593
|
isLoading: l,
|
|
595
594
|
type: m
|
|
596
595
|
} = this, f = {
|
|
597
|
-
...
|
|
596
|
+
...a,
|
|
598
597
|
"is-loading": l
|
|
599
598
|
};
|
|
600
599
|
return z`
|
|
@@ -611,7 +610,7 @@ const S = "pie-button", j = class j extends Tt(mt) {
|
|
|
611
610
|
}
|
|
612
611
|
render() {
|
|
613
612
|
const {
|
|
614
|
-
isFullWidth:
|
|
613
|
+
isFullWidth: a,
|
|
615
614
|
isResponsive: r,
|
|
616
615
|
responsiveSize: b,
|
|
617
616
|
size: l,
|
|
@@ -619,7 +618,7 @@ const S = "pie-button", j = class j extends Tt(mt) {
|
|
|
619
618
|
variant: f
|
|
620
619
|
} = this, M = {
|
|
621
620
|
"o-btn": !0,
|
|
622
|
-
"o-btn--fullWidth":
|
|
621
|
+
"o-btn--fullWidth": a,
|
|
623
622
|
"o-btn--responsive": r,
|
|
624
623
|
[`o-btn--${b}`]: !!(r && b),
|
|
625
624
|
[`o-btn--${f}`]: !0,
|
|
@@ -628,8 +627,8 @@ const S = "pie-button", j = class j extends Tt(mt) {
|
|
|
628
627
|
return m === "a" ? this.renderAnchor(M) : this.renderButton(M);
|
|
629
628
|
}
|
|
630
629
|
focus() {
|
|
631
|
-
var
|
|
632
|
-
(r = (
|
|
630
|
+
var a, r;
|
|
631
|
+
(r = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || r.focus();
|
|
633
632
|
}
|
|
634
633
|
};
|
|
635
634
|
j.styles = Lt(Wt);
|
package/dist/react.d.ts
CHANGED
|
@@ -128,9 +128,9 @@ declare class PieButton_2 extends PieButton_base implements ButtonProps {
|
|
|
128
128
|
disconnectedCallback(): void;
|
|
129
129
|
updated(changedProperties: PropertyValues<this>): void;
|
|
130
130
|
tag: "button" | "a";
|
|
131
|
-
size: "xsmall" | "
|
|
131
|
+
size: "xsmall" | "small-productive" | "small-expressive" | "medium" | "large";
|
|
132
132
|
type: "button" | "submit" | "reset";
|
|
133
|
-
variant: "
|
|
133
|
+
variant: "primary" | "primary-alternative" | "secondary" | "outline" | "outline-inverse" | "ghost" | "inverse" | "ghost-inverse" | "destructive" | "destructive-ghost";
|
|
134
134
|
iconPlacement: "leading" | "trailing";
|
|
135
135
|
disabled: boolean;
|
|
136
136
|
isLoading: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-button",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "PIE design system button built using web components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
42
|
-
"@justeattakeaway/pie-components-config": "0.19.
|
|
42
|
+
"@justeattakeaway/pie-components-config": "0.19.1",
|
|
43
43
|
"@justeattakeaway/pie-css": "0.16.0",
|
|
44
44
|
"@justeattakeaway/pie-monorepo-utils": "0.5.0",
|
|
45
45
|
"@justeattakeaway/pie-wrapper-react": "0.14.3",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"dist/*.js"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@justeattakeaway/pie-spinner": "1.1.
|
|
57
|
-
"@justeattakeaway/pie-webc-core": "0.25.
|
|
56
|
+
"@justeattakeaway/pie-spinner": "1.1.1",
|
|
57
|
+
"@justeattakeaway/pie-webc-core": "0.25.1",
|
|
58
58
|
"element-internals-polyfill": "1.3.11"
|
|
59
59
|
}
|
|
60
60
|
}
|