New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@justeattakeaway/pie-button

Package Overview
Dependencies
Maintainers
0
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@justeattakeaway/pie-button - npm Package Compare versions

Comparing version

to
0.0.0-snapshot-release-20240927094312

8

custom-elements.json

@@ -51,5 +51,5 @@ {

"type": {
"text": "[\n 'primary', 'secondary', 'outline', 'outline-inverse', 'ghost',\n 'inverse', 'ghost-inverse', 'destructive', 'destructive-ghost',\n]"
"text": "[\r\n 'primary', 'secondary', 'outline', 'outline-inverse', 'ghost',\r\n 'inverse', 'ghost-inverse', 'destructive', 'destructive-ghost',\r\n]"
},
"default": "[\n 'primary', 'secondary', 'outline', 'outline-inverse', 'ghost',\n 'inverse', 'ghost-inverse', 'destructive', 'destructive-ghost',\n]"
"default": "[\r\n 'primary', 'secondary', 'outline', 'outline-inverse', 'ghost',\r\n 'inverse', 'ghost-inverse', 'destructive', 'destructive-ghost',\r\n]"
},

@@ -94,3 +94,3 @@ {

},
"default": "{\n tag: 'button',\n size: 'medium',\n type: 'submit',\n variant: 'primary',\n iconPlacement: 'leading',\n disabled: false,\n isLoading: false,\n isFullWidth: false,\n isResponsive: false,\n}"
"default": "{\r\n tag: 'button',\r\n size: 'medium',\r\n type: 'submit',\r\n variant: 'primary',\r\n iconPlacement: 'leading',\r\n disabled: false,\r\n isLoading: false,\r\n isFullWidth: false,\r\n isResponsive: false,\r\n}"
}

@@ -366,3 +366,3 @@ ],

],
"description": "This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.\nThis is done so that we trigger native form actions, such as submit and reset in the browser. The performance impact of adding and removing a single button to the DOM\nshould be neglible, however this should be monitored.\nThis is the only viable way of guaranteeing native button behaviour when using a web component in place of an actual HTML button.\n\nTODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin."
"description": "This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.\r\nThis is done so that we trigger native form actions, such as submit and reset in the browser. The performance impact of adding and removing a single button to the DOM\r\nshould be neglible, however this should be monitored.\r\nThis is the only viable way of guaranteeing native button behaviour when using a web component in place of an actual HTML button.\r\n\r\nTODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin."
},

@@ -369,0 +369,0 @@ {

@@ -1,10 +0,10 @@

import { LitElement as Ft, html as M, nothing as F, unsafeCSS as At } from "lit";
import { classMap as bt } from "lit/directives/class-map.js";
import { LitElement as At, html as M, nothing as F, unsafeCSS as It } from "lit";
import { classMap as vt } from "lit/directives/class-map.js";
import { ifDefined as K } from "lit/directives/if-defined.js";
import { property as v } from "lit/decorators.js";
import { FormControlMixin as It, validPropertyValues as A, defineCustomElement as Tt } from "@justeattakeaway/pie-webc-core";
import { FormControlMixin as Lt, validPropertyValues as A, defineCustomElement as Tt } from "@justeattakeaway/pie-webc-core";
import "@justeattakeaway/pie-spinner";
(function() {
(function(E) {
const a = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), L = {
(function(k) {
const a = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), j = /* @__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 = {
ariaAtomic: "aria-atomic",

@@ -52,7 +52,7 @@ ariaAutoComplete: "aria-autocomplete",

role: "role"
}, vt = (e, t) => {
for (let o in L) {
}, ht = (e, t) => {
for (let o in T) {
t[o] = null;
let i = null;
const r = L[o];
const n = T[o];
Object.defineProperty(t, o, {

@@ -63,3 +63,3 @@ get() {

set(s) {
i = s, e.isConnected ? e.setAttribute(r, s) : I.set(e, t);
i = s, e.isConnected ? e.setAttribute(n, s) : I.set(e, t);
}

@@ -69,7 +69,7 @@ });

};
function Q(e) {
function X(e) {
const t = c.get(e), { form: o } = t;
ot(e, o, t), et(e, t.labels);
it(e, o, t), ot(e, t.labels);
}
const X = (e, t = !1) => {
const Y = (e, t = !1) => {
const o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {

@@ -81,11 +81,11 @@ acceptNode(s) {

let i = o.nextNode();
const r = !t || e.disabled;
const n = !t || e.disabled;
for (; i; )
i.formDisabledCallback && r && $(i, e.disabled), i = o.nextNode();
}, Y = { attributes: !0, attributeFilter: ["disabled", "name"] }, V = O() ? new MutationObserver((e) => {
i.formDisabledCallback && n && $(i, e.disabled), i = o.nextNode();
}, Z = { attributes: !0, attributeFilter: ["disabled", "name"] }, V = O() ? new MutationObserver((e) => {
for (const t of e) {
const o = t.target;
if (t.attributeName === "disabled" && (o.constructor.formAssociated ? $(o, o.hasAttribute("disabled")) : o.localName === "fieldset" && X(o)), t.attributeName === "name" && o.constructor.formAssociated) {
const i = c.get(o), r = j.get(o);
i.setFormValue(r);
if (t.attributeName === "disabled" && (o.constructor.formAssociated ? $(o, o.hasAttribute("disabled")) : o.localName === "fieldset" && Y(o)), t.attributeName === "name" && o.constructor.formAssociated) {
const i = c.get(o), n = j.get(o);
i.setFormValue(n);
}

@@ -96,17 +96,17 @@ }

e.forEach((t) => {
const { addedNodes: o, removedNodes: i } = t, r = Array.from(o), s = Array.from(i);
r.forEach((l) => {
const { addedNodes: o, removedNodes: i } = t, n = Array.from(o), s = Array.from(i);
n.forEach((l) => {
var u;
if (c.has(l) && l.constructor.formAssociated && Q(l), I.has(l)) {
if (c.has(l) && l.constructor.formAssociated && X(l), I.has(l)) {
const p = I.get(l);
Object.keys(L).filter((y) => p[y] !== null).forEach((y) => {
l.setAttribute(L[y], p[y]);
Object.keys(T).filter((g) => p[g] !== null).forEach((g) => {
l.setAttribute(T[g], p[g]);
}), I.delete(l);
}
if (T.has(l)) {
const p = T.get(l);
l.setAttribute("internals-valid", p.validity.valid.toString()), l.setAttribute("internals-invalid", (!p.validity.valid).toString()), l.setAttribute("aria-invalid", (!p.validity.valid).toString()), T.delete(l);
if (L.has(l)) {
const p = L.get(l);
l.setAttribute("internals-valid", p.validity.valid.toString()), l.setAttribute("internals-invalid", (!p.validity.valid).toString()), l.setAttribute("aria-invalid", (!p.validity.valid).toString()), L.delete(l);
}
if (l.localName === "form") {
const p = k.get(l), x = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
const p = E.get(l), x = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
acceptNode(B) {

@@ -116,26 +116,26 @@ return c.has(B) && B.constructor.formAssociated && !(p && p.has(B)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;

});
let y = x.nextNode();
for (; y; )
Q(y), y = x.nextNode();
let g = x.nextNode();
for (; g; )
X(g), g = x.nextNode();
}
l.localName === "fieldset" && ((u = V.observe) === null || u === void 0 || u.call(V, l, Y), X(l, !0));
l.localName === "fieldset" && ((u = V.observe) === null || u === void 0 || u.call(V, l, Z), Y(l, !0));
}), s.forEach((l) => {
const u = c.get(l);
u && d.get(u) && Z(u), S.has(l) && S.get(l).disconnect();
u && b.get(u) && tt(u), S.has(l) && S.get(l).disconnect();
});
});
}
function ht(e) {
function pt(e) {
e.forEach((t) => {
const { removedNodes: o } = t;
o.forEach((i) => {
const r = G.get(t.target);
c.has(i) && rt(i), r.disconnect();
const n = J.get(t.target);
c.has(i) && nt(i), n.disconnect();
});
});
}
const pt = (e) => {
const mt = (e) => {
var t, o;
const i = new MutationObserver(ht);
!((t = window == null ? void 0 : window.ShadyDOM) === null || t === void 0) && t.inUse && e.mode && e.host && (e = e.host), (o = i.observe) === null || o === void 0 || o.call(i, e, { childList: !0 }), G.set(e, i);
const i = new MutationObserver(pt);
!((t = window == null ? void 0 : window.ShadyDOM) === null || t === void 0) && t.inUse && e.mode && e.host && (e = e.host), (o = i.observe) === null || o === void 0 || o.call(i, e, { childList: !0 }), J.set(e, i);
};

@@ -148,13 +148,13 @@ O() && new MutationObserver(_);

e.toggleAttribute("internals-disabled", t), t ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
}, Z = (e) => {
d.get(e).forEach((o) => {
}, tt = (e) => {
b.get(e).forEach((o) => {
o.remove();
}), d.set(e, []);
}, tt = (e, t) => {
}), b.set(e, []);
}, et = (e, t) => {
const o = document.createElement("input");
return o.type = "hidden", o.name = e.getAttribute("name"), e.after(o), d.get(t).push(o), o;
}, mt = (e, t) => {
return o.type = "hidden", o.name = e.getAttribute("name"), e.after(o), b.get(t).push(o), o;
}, ut = (e, t) => {
var o;
d.set(t, []), (o = V.observe) === null || o === void 0 || o.call(V, e, Y);
}, et = (e, t) => {
b.set(t, []), (o = V.observe) === null || o === void 0 || o.call(V, e, Z);
}, ot = (e, t) => {
if (t.length) {

@@ -166,33 +166,33 @@ Array.from(t).forEach((i) => i.addEventListener("click", e.click.bind(e)));

}, N = (e) => {
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), o = k.get(e) || [], i = Array.from(o).filter((s) => s.isConnected).map((s) => c.get(s).validity.valid), r = [...t, ...i].includes(!1);
e.toggleAttribute("internals-invalid", r), e.toggleAttribute("internals-valid", !r);
}, ut = (e) => {
N(P(e.target));
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), o = E.get(e) || [], i = Array.from(o).filter((s) => s.isConnected).map((s) => c.get(s).validity.valid), n = [...t, ...i].includes(!1);
e.toggleAttribute("internals-invalid", n), e.toggleAttribute("internals-valid", !n);
}, ft = (e) => {
N(P(e.target));
}, gt = (e) => {
N(P(e.target));
}, yt = (e) => {
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((o) => `${o}:not([disabled])`).map((o) => `${o}:not([form])${e.id ? `,${o}[form='${e.id}']` : ""}`).join(",");
e.addEventListener("click", (o) => {
if (o.target.closest(t)) {
const r = k.get(e);
const n = E.get(e);
if (e.noValidate)
return;
r.size && Array.from(r).reverse().map((u) => c.get(u).reportValidity()).includes(!1) && o.preventDefault();
n.size && Array.from(n).reverse().map((u) => c.get(u).reportValidity()).includes(!1) && o.preventDefault();
}
});
}, yt = (e) => {
const t = k.get(e.target);
}, wt = (e) => {
const t = E.get(e.target);
t && t.size && t.forEach((o) => {
o.constructor.formAssociated && o.formResetCallback && o.formResetCallback.apply(o);
});
}, ot = (e, t, o) => {
}, it = (e, t, o) => {
if (t) {
const i = k.get(t);
const i = E.get(t);
if (i)
i.add(e);
else {
const r = /* @__PURE__ */ new Set();
r.add(e), k.set(t, r), gt(t), t.addEventListener("reset", yt), t.addEventListener("input", ut), t.addEventListener("change", ft);
const n = /* @__PURE__ */ new Set();
n.add(e), E.set(t, n), yt(t), t.addEventListener("reset", wt), t.addEventListener("input", ft), t.addEventListener("change", gt);
}
g.set(t, { ref: e, internals: o }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
y.set(t, { ref: e, internals: o }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
e.formAssociatedCallback.apply(e, [t]);

@@ -207,11 +207,11 @@ }, 0), N(t);

throw new o(t);
}, it = (e, t, o) => {
const i = k.get(e);
return i && i.size && i.forEach((r) => {
c.get(r)[o]() || (t = !1);
}, rt = (e, t, o) => {
const i = E.get(e);
return i && i.size && i.forEach((n) => {
c.get(n)[o]() || (t = !1);
}), t;
}, rt = (e) => {
}, nt = (e) => {
if (e.constructor.formAssociated) {
const t = c.get(e), { labels: o, form: i } = t;
et(e, o), ot(e, i, t);
ot(e, o), it(e, i, t);
}

@@ -222,3 +222,3 @@ };

}
class wt {
class xt {
constructor() {

@@ -228,3 +228,3 @@ 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);

}
const xt = (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), Et = (e, t, o) => (e.valid = kt(t), Object.keys(t).forEach((i) => e[i] = t[i]), o && N(o), e), kt = (e) => {
const Et = (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), kt = (e, t, o) => (e.valid = Mt(t), Object.keys(t).forEach((i) => e[i] = t[i]), o && N(o), e), Mt = (e) => {
let t = !0;

@@ -235,3 +235,3 @@ for (let o in e)

}, D = /* @__PURE__ */ new WeakMap();
function nt(e, t) {
function at(e, t) {
e.toggleAttribute(t, !0), e.part && e.part.add(t);

@@ -251,5 +251,5 @@ }

throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
const o = super.add(t), i = D.get(this), r = `state${t}`;
return i.isConnected ? nt(i, r) : setTimeout(() => {
nt(i, r);
const o = super.add(t), i = D.get(this), n = `state${t}`;
return i.isConnected ? at(i, n) : setTimeout(() => {
at(i, n);
}), o;

@@ -269,22 +269,15 @@ }

}
function at(e, t, o, i) {
if (o === "a" && !i)
throw new TypeError("Private accessor was defined without a getter");
if (typeof t == "function" ? e !== t || !i : !t.has(e))
throw new TypeError("Cannot read private member from an object whose class did not declare it");
function st(e, t, o, i) {
if (o === "a" && !i) throw new TypeError("Private accessor was defined without a getter");
if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return o === "m" ? i : o === "a" ? i.call(e) : i ? i.value : t.get(e);
}
function Mt(e, t, o, i, r) {
if (i === "m")
throw new TypeError("Private method is not writable");
if (i === "a" && !r)
throw new TypeError("Private accessor was defined without a setter");
if (typeof t == "function" ? e !== t || !r : !t.has(e))
throw new TypeError("Cannot write private member to an object whose class did not declare it");
return i === "a" ? r.call(e, o) : r ? r.value = o : t.set(e, o), o;
function St(e, t, o, i, n) {
if (typeof t == "function" ? e !== t || !n : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return t.set(e, o), o;
}
var z;
class St {
class Ct {
constructor(t) {
z.set(this, void 0), Mt(this, z, t, "f");
z.set(this, void 0), St(this, z, t);
for (let o = 0; o < t.length; o++) {

@@ -297,6 +290,6 @@ let i = t[o];

get length() {
return at(this, z, "f").length;
return st(this, z, "f").length;
}
[(z = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
return at(this, z, "f")[Symbol.iterator]();
return st(this, z, "f")[Symbol.iterator]();
}

@@ -310,3 +303,3 @@ item(t) {

}
function Ct() {
function zt() {
const e = HTMLFormElement.prototype.checkValidity;

@@ -318,20 +311,20 @@ HTMLFormElement.prototype.checkValidity = o;

let l = e.apply(this, s);
return it(this, l, "checkValidity");
return rt(this, l, "checkValidity");
}
function i(...s) {
let l = t.apply(this, s);
return it(this, l, "reportValidity");
return rt(this, l, "reportValidity");
}
const { get: r } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
const { get: n } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
Object.defineProperty(HTMLFormElement.prototype, "elements", {
get(...s) {
const l = r.call(this, ...s), u = Array.from(k.get(this) || []);
const l = n.call(this, ...s), u = Array.from(E.get(this) || []);
if (u.length === 0)
return l;
const p = Array.from(l).concat(u).sort((x, y) => x.compareDocumentPosition ? x.compareDocumentPosition(y) & 2 ? 1 : -1 : 0);
return new St(p);
const p = Array.from(l).concat(u).sort((x, g) => x.compareDocumentPosition ? x.compareDocumentPosition(g) & 2 ? 1 : -1 : 0);
return new Ct(p);
}
});
}
class st {
class lt {
static get isPolyfilled() {

@@ -343,4 +336,4 @@ return !0;

throw new TypeError("Illegal constructor");
const o = t.getRootNode(), i = new wt();
this.states = new W(t), a.set(this, t), n.set(this, i), c.set(t, this), vt(t, this), mt(t, this), Object.seal(this), o instanceof DocumentFragment && pt(o);
const o = t.getRootNode(), i = new xt();
this.states = new W(t), a.set(this, t), r.set(this, i), c.set(t, this), ht(t, this), ut(t, this), Object.seal(this), o instanceof DocumentFragment && mt(o);
}

@@ -351,3 +344,3 @@ checkValidity() {

return !0;
const o = n.get(this);
const o = r.get(this);
if (!o.valid) {

@@ -379,3 +372,3 @@ const i = new Event("invalid", {

return !0;
const o = this.checkValidity(), i = q.get(this);
const o = this.checkValidity(), i = G.get(this);
if (i && !t.constructor.formAssociated)

@@ -387,34 +380,33 @@ throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");

const o = a.get(this);
if (w(o, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), Z(this), t != null && !(t instanceof FormData)) {
if (w(o, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), tt(this), t != null && !(t instanceof FormData)) {
if (o.getAttribute("name")) {
const i = tt(o, this);
const i = et(o, this);
i.value = t;
}
} else
t != null && t instanceof FormData && Array.from(t).reverse().forEach(([i, r]) => {
if (typeof r == "string") {
const s = tt(o, this);
s.name = i, s.value = r;
}
});
} else t != null && t instanceof FormData && Array.from(t).reverse().forEach(([i, n]) => {
if (typeof n == "string") {
const s = et(o, this);
s.name = i, s.value = n;
}
});
j.set(o, t);
}
setValidity(t, o, i) {
const r = a.get(this);
if (w(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
const n = a.get(this);
if (w(n, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
q.set(this, i);
const s = n.get(this), l = {};
G.set(this, i);
const s = r.get(this), l = {};
for (const x in t)
l[x] = t[x];
Object.keys(l).length === 0 && xt(s);
Object.keys(l).length === 0 && Et(s);
const u = Object.assign(Object.assign({}, s), l);
delete u.valid;
const { valid: p } = Et(s, u, this.form);
const { valid: p } = kt(s, u, this.form);
if (!p && !o)
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.");
m.set(this, p ? "" : o), r.isConnected ? (r.toggleAttribute("internals-invalid", !p), r.toggleAttribute("internals-valid", p), r.setAttribute("aria-invalid", `${!p}`)) : T.set(r, this);
m.set(this, p ? "" : o), n.isConnected ? (n.toggleAttribute("internals-invalid", !p), n.toggleAttribute("internals-valid", p), n.setAttribute("aria-invalid", `${!p}`)) : L.set(n, this);
}
get shadowRoot() {
const t = a.get(this), o = U.get(t);
const t = a.get(this), o = q.get(t);
return o || null;

@@ -428,3 +420,3 @@ }

const t = a.get(this);
return w(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), n.get(this);
return w(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), r.get(this);
}

@@ -436,3 +428,3 @@ get willValidate() {

}
function zt() {
function Ft() {
if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)

@@ -461,5 +453,5 @@ return !1;

}
let lt = !1, ct = !1;
let ct = !1, dt = !1;
function H(e) {
ct || (ct = !0, window.CustomStateSet = W, e && (HTMLElement.prototype.attachInternals = function(...t) {
dt || (dt = !0, window.CustomStateSet = W, e && (HTMLElement.prototype.attachInternals = function(...t) {
const o = e.call(this, t);

@@ -469,14 +461,14 @@ return o.states = new W(this), o;

}
function dt(e = !0) {
if (!lt) {
if (lt = !0, typeof window < "u" && (window.ElementInternals = st), typeof CustomElementRegistry < "u") {
function bt(e = !0) {
if (!ct) {
if (ct = !0, typeof window < "u" && (window.ElementInternals = lt), typeof CustomElementRegistry < "u") {
const t = CustomElementRegistry.prototype.define;
CustomElementRegistry.prototype.define = function(o, i, r) {
CustomElementRegistry.prototype.define = function(o, i, n) {
if (i.formAssociated) {
const s = i.prototype.connectedCallback;
i.prototype.connectedCallback = function() {
J.has(this) || (J.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), s != null && s.apply(this), rt(this);
Q.has(this) || (Q.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), s != null && s.apply(this), nt(this);
};
}
t.call(this, o, i, r);
t.call(this, o, i, n);
};

@@ -488,15 +480,14 @@ }

throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
} else
return {};
} else return {};
if (c.has(this))
throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
return new st(this);
return new lt(this);
}), typeof Element < "u") {
let t = function(...i) {
const r = o.apply(this, i);
if (U.set(this, r), O()) {
const n = o.apply(this, i);
if (q.set(this, n), O()) {
const s = new MutationObserver(_);
window.ShadyDOM ? s.observe(this, R) : s.observe(r, R), S.set(this, s);
window.ShadyDOM ? s.observe(this, R) : s.observe(n, R), S.set(this, s);
}
return r;
return n;
};

@@ -506,9 +497,9 @@ const o = Element.prototype.attachShadow;

}
O() && typeof document < "u" && new MutationObserver(_).observe(document.documentElement, R), typeof HTMLFormElement < "u" && Ct(), (e || typeof window < "u" && !window.CustomStateSet) && H();
O() && typeof document < "u" && new MutationObserver(_).observe(document.documentElement, R), typeof HTMLFormElement < "u" && zt(), (e || typeof window < "u" && !window.CustomStateSet) && H();
}
}
return !!customElements.polyfillWrapFlushCallback || (zt() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : dt(!1)), E.forceCustomStateSetPolyfill = H, E.forceElementInternalsPolyfill = dt, Object.defineProperty(E, "__esModule", { value: !0 }), E;
return !!customElements.polyfillWrapFlushCallback || (Ft() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : bt(!1)), k.forceCustomStateSetPolyfill = H, k.forceElementInternalsPolyfill = bt, Object.defineProperty(k, "__esModule", { value: !0 }), k;
})({});
})();
const Lt = ["button", "a"], Vt = ["xsmall", "small-productive", "small-expressive", "medium", "large"], qt = ["productive", "expressive"], Nt = ["submit", "button", "reset"], Pt = [
const Vt = ["button", "a"], Nt = ["xsmall", "small-productive", "small-expressive", "medium", "large"], qt = ["productive", "expressive"], Pt = ["submit", "button", "reset"], Ot = [
"primary",

@@ -523,3 +514,3 @@ "secondary",

"destructive-ghost"
], Ot = ["leading", "trailing"], Gt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Jt = ["post", "get", "dialog"], Qt = ["_self", "_blank", "_parent", "_top"], f = {
], _t = ["leading", "trailing"], Gt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Jt = ["post", "get", "dialog"], Qt = ["_self", "_blank", "_parent", "_top"], f = {
tag: "button",

@@ -534,11 +525,9 @@ size: "medium",

isResponsive: !1
}, _t = `*,*: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);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-height--xsmall: 32px;--btn-height--small: 40px;--btn-height--medium: 48px;--btn-height--large: 56px;--icon-display-override: block;position:relative;display:inline-flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;height:var(--btn-height);padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-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){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--primary.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--primary.o-btn--xsmall,.o-btn.o-btn--primary.o-btn--small-productive{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn.o-btn--primary.o-btn--xsmall:hover:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive:hover:not(:disabled){--hover-modifier: var(--dt-color-hover-02);--btn-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),.o-btn.o-btn--primary.o-btn--xsmall.is-loading:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive:active:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.is-loading:not(:disabled){--active-modifier: var(--dt-color-active-02);--btn-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)))}@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{--btn-bg-color: var(--dt-color-interactive-brand)}.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive:hover:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive.is-loading:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:active:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}}.o-btn.o-btn--secondary{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn.o-btn--secondary:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--secondary.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--outline{--btn-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){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn.o-btn--outline:active:not(:disabled),.o-btn.o-btn--outline.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn.o-btn--ghost{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn.o-btn--ghost:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn.o-btn--ghost:active:not(:disabled),.o-btn.o-btn--ghost.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn.o-btn--inverse{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn.o-btn--inverse:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--inverse.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--ghost-inverse,.o-btn.o-btn--outline-inverse{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn.o-btn--ghost-inverse:hover:not(:disabled),.o-btn.o-btn--outline-inverse:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn.o-btn--ghost-inverse:active:not(:disabled),.o-btn.o-btn--ghost-inverse.is-loading:not(:disabled),.o-btn.o-btn--outline-inverse:active:not(:disabled),.o-btn.o-btn--outline-inverse.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn.o-btn--outline-inverse:not([disabled]){border:1px solid var(--dt-color-border-strong)}.o-btn.o-btn--destructive{--btn-bg-color: var(--dt-color-support-error)}.o-btn.o-btn--destructive:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--destructive.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--destructive-ghost{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn.o-btn--destructive-ghost:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn.o-btn--destructive-ghost:active:not(:disabled),.o-btn.o-btn--destructive-ghost.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn.o-btn--xsmall{--btn-height: var(--btn-height--xsmall);--btn-padding: 6px var(--dt-spacing-b);--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}@media (min-width: 769px){.o-btn.o-btn--xsmall.o-btn--responsive{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--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}.o-btn.o-btn--xsmall.o-btn--responsive.o-btn--expressive{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--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}}.o-btn.o-btn--small-expressive{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--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}@media (min-width: 769px){.o-btn.o-btn--small-expressive.o-btn--responsive{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--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}}.o-btn.o-btn--small-productive{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--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}@media (min-width: 769px){.o-btn.o-btn--small-productive.o-btn--responsive{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--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}}.o-btn.o-btn--medium{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--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}@media (min-width: 769px){.o-btn.o-btn--medium.o-btn--responsive{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--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}}.o-btn.o-btn--large{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--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}.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){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled].o-btn--outline{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}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}
`;
var Rt = Object.defineProperty, $t = Object.getOwnPropertyDescriptor, h = (E, a, n, d) => {
for (var c = d > 1 ? void 0 : d ? $t(a, n) : a, m = E.length - 1, g; m >= 0; m--)
(g = E[m]) && (c = (d ? g(a, n, c) : g(c)) || c);
return d && c && Rt(a, n, c), c;
}, Rt = "*,*: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);--btn-bg-color: var(--dt-color-interactive-brand);--btn-text-color: var(--dt-color-content-interactive-primary);--btn-height--xsmall: 32px;--btn-height--small: 40px;--btn-height--medium: 48px;--btn-height--large: 56px;--icon-display-override: block;position:relative;display:inline-flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;height:var(--btn-height);padding:var(--btn-padding);border:none;border-radius:var(--btn-border-radius);outline:none;background-color:var(--btn-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){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--primary.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--primary.o-btn--xsmall,.o-btn.o-btn--primary.o-btn--small-productive{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn.o-btn--primary.o-btn--xsmall:hover:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive:hover:not(:disabled){--hover-modifier: var(--dt-color-hover-02);--btn-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),.o-btn.o-btn--primary.o-btn--xsmall.is-loading:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive:active:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.is-loading:not(:disabled){--active-modifier: var(--dt-color-active-02);--btn-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)))}@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{--btn-bg-color: var(--dt-color-interactive-brand)}.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive:hover:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--primary.o-btn--xsmall.o-btn--expressive.o-btn--responsive.is-loading:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive:active:not(:disabled),.o-btn.o-btn--primary.o-btn--small-productive.o-btn--responsive.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}}.o-btn.o-btn--secondary{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn.o-btn--secondary:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--secondary.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--outline{--btn-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){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn.o-btn--outline:active:not(:disabled),.o-btn.o-btn--outline.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn.o-btn--ghost{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn.o-btn--ghost:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn.o-btn--ghost:active:not(:disabled),.o-btn.o-btn--ghost.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn.o-btn--inverse{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn.o-btn--inverse:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--inverse.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--ghost-inverse,.o-btn.o-btn--outline-inverse{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn.o-btn--ghost-inverse:hover:not(:disabled),.o-btn.o-btn--outline-inverse:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--hover-modifier))}.o-btn.o-btn--ghost-inverse:active:not(:disabled),.o-btn.o-btn--ghost-inverse.is-loading:not(:disabled),.o-btn.o-btn--outline-inverse:active:not(:disabled),.o-btn.o-btn--outline-inverse.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-container-default-h), var(--dt-color-container-default-s), var(--dt-color-container-default-l), var(--active-modifier))}.o-btn.o-btn--outline-inverse:not([disabled]){border:1px solid var(--dt-color-border-strong)}.o-btn.o-btn--destructive{--btn-bg-color: var(--dt-color-support-error)}.o-btn.o-btn--destructive:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--btn-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),.o-btn.o-btn--destructive.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--btn-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)))}.o-btn.o-btn--destructive-ghost{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn.o-btn--destructive-ghost:hover:not(:disabled){--hover-modifier: calc(-1 * var(--dt-color-hover-01));--hover-modifier: var(--dt-color-hover-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--hover-modifier))}.o-btn.o-btn--destructive-ghost:active:not(:disabled),.o-btn.o-btn--destructive-ghost.is-loading:not(:disabled){--active-modifier: calc(-1 * var(--dt-color-active-01));--active-modifier: var(--dt-color-active-01);--btn-bg-color: hsl(var(--dt-color-black-h), var(--dt-color-black-s), var(--dt-color-black-l), var(--active-modifier))}.o-btn.o-btn--xsmall{--btn-height: var(--btn-height--xsmall);--btn-padding: 6px var(--dt-spacing-b);--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}@media (min-width: 769px){.o-btn.o-btn--xsmall.o-btn--responsive{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--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}.o-btn.o-btn--xsmall.o-btn--responsive.o-btn--expressive{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--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}}.o-btn.o-btn--small-expressive{--btn-height: var(--btn-height--small);--btn-padding: 6px var(--dt-spacing-d);--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}@media (min-width: 769px){.o-btn.o-btn--small-expressive.o-btn--responsive{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--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}}.o-btn.o-btn--small-productive{--btn-height: var(--btn-height--small);--btn-padding: 8px var(--dt-spacing-d);--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}@media (min-width: 769px){.o-btn.o-btn--small-productive.o-btn--responsive{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--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}}.o-btn.o-btn--medium{--btn-height: var(--btn-height--medium);--btn-padding: 10px var(--dt-spacing-e);--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}@media (min-width: 769px){.o-btn.o-btn--medium.o-btn--responsive{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--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}}.o-btn.o-btn--large{--btn-height: var(--btn-height--large);--btn-padding: 14px var(--dt-spacing-e);--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}.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){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled].o-btn--outline{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}::slotted(svg){height:var(--icon-size-override);width:var(--icon-size-override)}";
var $t = Object.defineProperty, h = (k, a, r, b) => {
for (var c = void 0, m = k.length - 1, y; m >= 0; m--)
(y = k[m]) && (c = y(a, r, c) || c);
return c && $t(a, r, c), c;
};
const C = "pie-button";
class b extends It(Ft) {
const C = "pie-button", U = class U extends Lt(At) {
constructor() {

@@ -548,4 +537,4 @@ super(...arguments), this.tag = f.tag, this.size = f.size, this.type = f.type, this.variant = f.variant, this.iconPlacement = f.iconPlacement, this.disabled = f.disabled, this.isLoading = f.isLoading, this.isFullWidth = f.isFullWidth, this.isResponsive = f.isResponsive, this._handleFormKeyDown = (a) => {

if (a.target instanceof HTMLElement) {
const n = a.target.tagName.toLowerCase();
if (n === "button" || n === "pie-button")
const r = a.target.tagName.toLowerCase();
if (r === "button" || r === "pie-button")
return;

@@ -566,4 +555,4 @@ }

updated(a) {
var n, d;
a.has("type") && (this.type === "submit" ? (n = this.form) == null || n.addEventListener("keydown", this._handleFormKeyDown) : (d = this.form) == null || d.removeEventListener("keydown", this._handleFormKeyDown));
var r, b;
a.has("type") && (this.type === "submit" ? (r = this.form) == null || r.addEventListener("keydown", this._handleFormKeyDown) : (b = this.form) == null || b.removeEventListener("keydown", this._handleFormKeyDown));
}

@@ -579,6 +568,5 @@ /**

_simulateNativeButtonClick(a) {
if (!this.form)
return;
const n = document.createElement("button");
n.type = a, n.style.position = "absolute", n.style.width = "1px", n.style.height = "1px", n.style.padding = "0", n.style.margin = "-1px", n.style.overflow = "hidden", n.style.border = "0", n.style.whiteSpace = "nowrap", a === "submit" && (this.name && (n.name = this.name), this.value && (n.value = this.value), this.formaction && n.setAttribute("formaction", this.formaction), this.formenctype && n.setAttribute("formenctype", this.formenctype), this.formmethod && n.setAttribute("formmethod", this.formmethod), this.formnovalidate && n.setAttribute("formnovalidate", "formnovalidate"), this.formtarget && n.setAttribute("formtarget", this.formtarget)), this.form.append(n), n.click(), n.remove();
if (!this.form) return;
const r = document.createElement("button");
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();
}

@@ -594,5 +582,5 @@ _handleClick() {

renderSpinner() {
const { size: a, variant: n, disabled: d } = this, c = a && a.includes("small") ? "small" : "medium";
const { size: a, variant: r, disabled: b } = this, c = a && a.includes("small") ? "small" : "medium";
let m;
return d ? m = n === "ghost-inverse" ? "inverse" : "secondary" : m = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", M`
return b ? m = r === "ghost-inverse" ? "inverse" : "secondary" : m = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", M`
<pie-spinner

@@ -605,4 +593,4 @@ size="${c}"

const {
href: n,
iconPlacement: d,
href: r,
iconPlacement: b,
rel: c,

@@ -613,9 +601,9 @@ target: m

<a
href="${K(n)}"
href="${K(r)}"
rel="${K(c)}"
target="${K(m)}"
class="${bt(a)}">
${d === "leading" ? M`<slot name="icon"></slot>` : F}
class="${vt(a)}">
${b === "leading" ? M`<slot name="icon"></slot>` : F}
<slot></slot>
${d === "trailing" ? M`<slot name="icon"></slot>` : F}
${b === "trailing" ? M`<slot name="icon"></slot>` : F}
</a>`;

@@ -625,7 +613,7 @@ }

const {
disabled: n,
iconPlacement: d,
disabled: r,
iconPlacement: b,
isLoading: c,
type: m
} = this, g = {
} = this, y = {
...a,

@@ -637,9 +625,9 @@ "is-loading": c

@click=${this._handleClick}
class=${bt(g)}
class=${vt(y)}
type=${m}
?disabled=${n}>
?disabled=${r}>
${c ? this.renderSpinner() : F}
${d === "leading" ? M`<slot name="icon"></slot>` : F}
${b === "leading" ? M`<slot name="icon"></slot>` : F}
<slot></slot>
${d === "trailing" ? M`<slot name="icon"></slot>` : F}
${b === "trailing" ? M`<slot name="icon"></slot>` : F}
</button>`;

@@ -650,13 +638,13 @@ }

isFullWidth: a,
isResponsive: n,
responsiveSize: d,
isResponsive: r,
responsiveSize: b,
size: c,
tag: m,
variant: g
variant: y
} = this, S = {
"o-btn": !0,
"o-btn--fullWidth": a,
"o-btn--responsive": n,
[`o-btn--${d}`]: !!(n && d),
[`o-btn--${g}`]: !0,
"o-btn--responsive": r,
[`o-btn--${b}`]: !!(r && b),
[`o-btn--${y}`]: !0,
[`o-btn--${c}`]: !0

@@ -667,75 +655,76 @@ };

focus() {
var a, n;
(n = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || n.focus();
var a, r;
(r = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || r.focus();
}
}
b.styles = At(_t);
};
U.styles = It(Rt);
let d = U;
h([
v({ type: String }),
A(C, Lt, f.tag)
], b.prototype, "tag", 2);
A(C, Vt, f.tag)
], d.prototype, "tag");
h([
v({ type: String }),
A(C, Vt, f.size)
], b.prototype, "size", 2);
A(C, Nt, f.size)
], d.prototype, "size");
h([
v({ type: String }),
A(C, Nt, f.type)
], b.prototype, "type", 2);
A(C, Pt, f.type)
], d.prototype, "type");
h([
v({ type: String }),
A(C, Pt, f.variant)
], b.prototype, "variant", 2);
A(C, Ot, f.variant)
], d.prototype, "variant");
h([
v({ type: String }),
A(C, Ot, f.iconPlacement)
], b.prototype, "iconPlacement", 2);
A(C, _t, f.iconPlacement)
], d.prototype, "iconPlacement");
h([
v({ type: Boolean })
], b.prototype, "disabled", 2);
], d.prototype, "disabled");
h([
v({ type: Boolean, reflect: !0 })
], b.prototype, "isLoading", 2);
], d.prototype, "isLoading");
h([
v({ type: Boolean })
], b.prototype, "isFullWidth", 2);
], d.prototype, "isFullWidth");
h([
v({ type: Boolean })
], b.prototype, "isResponsive", 2);
], d.prototype, "isResponsive");
h([
v({ type: String })
], b.prototype, "name", 2);
], d.prototype, "name");
h([
v({ type: String })
], b.prototype, "value", 2);
], d.prototype, "value");
h([
v({ type: String })
], b.prototype, "formaction", 2);
], d.prototype, "formaction");
h([
v({ type: String })
], b.prototype, "formenctype", 2);
], d.prototype, "formenctype");
h([
v({ type: String })
], b.prototype, "formmethod", 2);
], d.prototype, "formmethod");
h([
v({ type: Boolean })
], b.prototype, "formnovalidate", 2);
], d.prototype, "formnovalidate");
h([
v({ type: String })
], b.prototype, "formtarget", 2);
], d.prototype, "formtarget");
h([
v({ type: String })
], b.prototype, "responsiveSize", 2);
], d.prototype, "responsiveSize");
h([
v({ type: String })
], b.prototype, "href", 2);
], d.prototype, "href");
h([
v({ type: String })
], b.prototype, "rel", 2);
], d.prototype, "rel");
h([
v({ type: String })
], b.prototype, "target", 2);
Tt(C, b);
], d.prototype, "target");
Tt(C, d);
export {
b as PieButton,
d as PieButton,
f as defaultProps,

@@ -745,8 +734,8 @@ Gt as formEncodingtypes,

Qt as formTargetTypes,
Ot as iconPlacements,
_t as iconPlacements,
qt as responsiveSizes,
Vt as sizes,
Lt as tags,
Nt as types,
Pt as variants
Nt as sizes,
Vt as tags,
Pt as types,
Ot as variants
};
import * as t from "react";
import { createComponent as e } from "@lit/react";
import { PieButton as o } from "./index.js";
import { defaultProps as y, formEncodingtypes as B, formMethodTypes as d, formTargetTypes as g, iconPlacements as v, responsiveSizes as T, sizes as x, tags as z, types as C, variants as N } from "./index.js";
import "lit";
import "lit/directives/class-map.js";
import "lit/directives/if-defined.js";
import "lit/decorators.js";
import "@justeattakeaway/pie-webc-core";
import "@justeattakeaway/pie-spinner";
const r = e({
import { defaultProps as p, formEncodingtypes as c, formMethodTypes as f, formTargetTypes as u, iconPlacements as P, responsiveSizes as l, sizes as y, tags as B, types as d, variants as g } from "./index.js";
const s = e({
displayName: "PieButton",

@@ -17,15 +11,15 @@ elementClass: o,

events: {}
}), u = r;
}), a = s;
export {
u as PieButton,
y as defaultProps,
B as formEncodingtypes,
d as formMethodTypes,
g as formTargetTypes,
v as iconPlacements,
T as responsiveSizes,
x as sizes,
z as tags,
C as types,
N as variants
a as PieButton,
p as defaultProps,
c as formEncodingtypes,
f as formMethodTypes,
u as formTargetTypes,
P as iconPlacements,
l as responsiveSizes,
y as sizes,
B as tags,
d as types,
g as variants
};
{
"name": "@justeattakeaway/pie-button",
"version": "0.0.0-snapshot-release-20240902111409",
"version": "0.0.0-snapshot-release-20240927094312",
"description": "PIE design system button built using web components",

@@ -40,3 +40,3 @@ "type": "module",

"@justeattakeaway/pie-components-config": "0.18.0",
"@justeattakeaway/pie-css": "0.12.1",
"@justeattakeaway/pie-css": "0.13.0",
"@justeattakeaway/pie-wrapper-react": "0.14.1",

@@ -53,6 +53,6 @@ "cem-plugin-module-file-extensions": "0.0.5"

"dependencies": {
"@justeattakeaway/pie-spinner": "0.0.0-snapshot-release-20240902111409",
"@justeattakeaway/pie-webc-core": "0.24.0",
"@justeattakeaway/pie-spinner": "0.0.0-snapshot-release-20240927094312",
"@justeattakeaway/pie-webc-core": "0.0.0-snapshot-release-20240927094312",
"element-internals-polyfill": "1.3.11"
}
}