@justeattakeaway/pie-button 0.38.0 → 0.38.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +278 -266
- package/dist/react.d.ts +13 -1
- package/dist/react.js +39 -60
- package/package.json +3 -3
- package/src/button.scss +73 -32
- package/src/defs.ts +11 -0
- package/src/index.ts +11 -0
package/dist/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { unsafeCSS as wt, LitElement as
|
|
2
|
-
import { property as
|
|
1
|
+
import { unsafeCSS as wt, LitElement as xt, html as N, nothing as O } from "lit";
|
|
2
|
+
import { property as p } from "lit/decorators.js";
|
|
3
|
+
import { ifDefined as Et } from "lit/directives/if-defined.js";
|
|
3
4
|
import "@justeattakeaway/pie-spinner";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
Object.defineProperty(
|
|
5
|
+
const R = (d, n, a) => function(b, y) {
|
|
6
|
+
const u = `#${y}`;
|
|
7
|
+
Object.defineProperty(b, y, {
|
|
7
8
|
get() {
|
|
8
|
-
return this[
|
|
9
|
+
return this[u];
|
|
9
10
|
},
|
|
10
|
-
set(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`<${d}> Invalid value "${u}" provided for property "${y}".`,
|
|
11
|
+
set(f) {
|
|
12
|
+
n.includes(f) ? this[u] = f : (console.error(
|
|
13
|
+
`<${d}> Invalid value "${f}" provided for property "${y}".`,
|
|
14
14
|
`Must be one of: ${n.join(" | ")}.`,
|
|
15
15
|
`Falling back to default value: "${a}"`
|
|
16
|
-
), this[
|
|
17
|
-
}
|
|
16
|
+
), this[u] = a);
|
|
17
|
+
},
|
|
18
|
+
configurable: !0
|
|
18
19
|
});
|
|
19
20
|
};
|
|
20
|
-
function
|
|
21
|
+
function kt(d, n) {
|
|
21
22
|
customElements.get(d) ? console.warn(`PIE Web Component: "${d}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(d, n);
|
|
22
23
|
}
|
|
23
|
-
const
|
|
24
|
+
const zt = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Rt = ["productive", "expressive"], Mt = ["submit", "button", "reset"], Ct = [
|
|
24
25
|
"primary",
|
|
25
26
|
"secondary",
|
|
26
27
|
"outline",
|
|
@@ -30,10 +31,10 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
30
31
|
"ghost-inverse",
|
|
31
32
|
"destructive",
|
|
32
33
|
"destructive-ghost"
|
|
33
|
-
], Lt = ["leading", "trailing"], Vt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Nt = ["post", "get", "dialog"], Pt = ["_self", "_blank", "_parent", "_top"], Ft = `*,*:before,*:after{box-sizing:border-box}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-weight);--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);--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;--btn-height: var(--btn-height--medium);--btn-icon-size: 24px;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;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;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=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[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]: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[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=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[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]: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)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=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[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]: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[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong)}.o-btn[variant=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[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]: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[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn[variant=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[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]: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[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=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[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]: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[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=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[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]: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[variant=outline-inverse]{border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=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[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]: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[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn[variant=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[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]: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[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=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);--btn-icon-size: 16px}.o-btn[size=small-expressive],.o-btn[size=small-productive]{--btn-height: var(--btn-height--small);--btn-icon-size: 20px}.o-btn[size=small-expressive]{--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)}.o-btn[size=small-productive]{--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)}.o-btn[size=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)}.o-btn[isLoading]>*:not(pie-spinner){visibility:hidden}.o-btn[isLoading] 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(--btn-icon-size);width:var(--btn-icon-size)}
|
|
34
|
+
], Lt = ["leading", "trailing"], Pt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], _t = ["post", "get", "dialog"], $t = ["_self", "_blank", "_parent", "_top"], Ft = `*,*:before,*:after{box-sizing:border-box}.o-btn{--btn-border-radius: var(--dt-radius-rounded-e);--btn-font-family: var(--dt-font-interactive-m-family);--btn-font-weight: var(--dt-font-interactive-m-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;position:relative;display:flex;gap:var(--dt-spacing-b);align-items:center;justify-content:center;box-sizing:border-box;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;user-select:none;inline-size:var(--btn-inline-size)}.o-btn[variant=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[variant=primary]:active:not(:disabled),.o-btn[variant=primary][isLoading]: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[variant=primary][size=xsmall],.o-btn[variant=primary][size=small-productive]{--btn-bg-color: var(--dt-color-interactive-primary)}.o-btn[variant=primary][size=xsmall]:hover:not(:disabled),.o-btn[variant=primary][size=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[variant=primary][size=xsmall]:active:not(:disabled),.o-btn[variant=primary][size=xsmall][isLoading]:not(:disabled),.o-btn[variant=primary][size=small-productive]:active:not(:disabled),.o-btn[variant=primary][size=small-productive][isLoading]: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)))}.o-btn[variant=secondary]{--btn-bg-color: var(--dt-color-interactive-secondary);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=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[variant=secondary]:active:not(:disabled),.o-btn[variant=secondary][isLoading]: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[variant=outline]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-secondary);border:1px solid var(--dt-color-border-strong)}.o-btn[variant=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[variant=outline]:active:not(:disabled),.o-btn[variant=outline][isLoading]: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[variant=ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-link)}.o-btn[variant=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[variant=ghost]:active:not(:disabled),.o-btn[variant=ghost][isLoading]: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[variant=inverse]{--btn-bg-color: var(--dt-color-interactive-inverse);--btn-text-color: var(--dt-color-content-interactive-secondary)}.o-btn[variant=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[variant=inverse]:active:not(:disabled),.o-btn[variant=inverse][isLoading]: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[variant=ghost-inverse],.o-btn[variant=outline-inverse]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-primary)}.o-btn[variant=ghost-inverse]:hover:not(:disabled),.o-btn[variant=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[variant=ghost-inverse]:active:not(:disabled),.o-btn[variant=ghost-inverse][isLoading]:not(:disabled),.o-btn[variant=outline-inverse]:active:not(:disabled),.o-btn[variant=outline-inverse][isLoading]: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[variant=outline-inverse]{border:1px solid var(--dt-color-border-strong)}.o-btn[variant=destructive]{--btn-bg-color: var(--dt-color-support-error)}.o-btn[variant=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[variant=destructive]:active:not(:disabled),.o-btn[variant=destructive][isLoading]: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[variant=destructive-ghost]{--btn-bg-color: transparent;--btn-text-color: var(--dt-color-content-interactive-error)}.o-btn[variant=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[variant=destructive-ghost]:active:not(:disabled),.o-btn[variant=destructive-ghost][isLoading]: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[isFullWidth]{--btn-inline-size: 100%}.o-btn[disabled]{--btn-text-color: var(--dt-color-content-disabled) !important;cursor:not-allowed}.o-btn[disabled]:not([variant=ghost],[variant=ghost-inverse],[variant=destructive-ghost]){--btn-bg-color: var(--dt-color-disabled-01) !important}.o-btn[disabled][variant=outline]{border-color:var(--dt-color-disabled-01)!important}.o-btn[size=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);--btn-icon-size: 16px}@media (min-width: 768px){.o-btn[size=xsmall][isResponsive]{--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);--btn-icon-size: 20px}.o-btn[size=xsmall][isResponsive][responsiveSize=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);--btn-icon-size: 20px}}.o-btn[size=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);--btn-icon-size: 20px}@media (min-width: 768px){.o-btn[size=small-expressive][isResponsive]{--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);--btn-icon-size: 24px}}.o-btn[size=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);--btn-icon-size: 20px}@media (min-width: 768px){.o-btn[size=small-productive][isResponsive]{--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);--btn-icon-size: 24px}}.o-btn[size=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);--btn-icon-size: 24px}@media (min-width: 768px){.o-btn[size=medium][isResponsive]{--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);--btn-icon-size: 24px}}.o-btn[size=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);--btn-icon-size: 24px}.o-btn[isLoading]>*:not(pie-spinner){visibility:hidden}.o-btn[isLoading] 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(--btn-icon-size);width:var(--btn-icon-size)}
|
|
34
35
|
`;
|
|
35
36
|
(function() {
|
|
36
|
-
const d = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(),
|
|
37
|
+
const d = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), A = {
|
|
37
38
|
ariaAtomic: "aria-atomic",
|
|
38
39
|
ariaAutoComplete: "aria-autocomplete",
|
|
39
40
|
ariaBusy: "aria-busy",
|
|
@@ -75,165 +76,165 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
75
76
|
ariaValueNow: "aria-valuenow",
|
|
76
77
|
ariaValueText: "aria-valuetext",
|
|
77
78
|
role: "role"
|
|
78
|
-
},
|
|
79
|
-
for (let e in
|
|
79
|
+
}, ot = (i, t) => {
|
|
80
|
+
for (let e in A) {
|
|
80
81
|
t[e] = null;
|
|
81
|
-
let
|
|
82
|
-
const
|
|
82
|
+
let r = null;
|
|
83
|
+
const o = A[e];
|
|
83
84
|
Object.defineProperty(t, e, {
|
|
84
85
|
get() {
|
|
85
|
-
return
|
|
86
|
+
return r;
|
|
86
87
|
},
|
|
87
88
|
set(l) {
|
|
88
|
-
|
|
89
|
+
r = l, i.isConnected ? i.setAttribute(o, l) : k.set(i, t);
|
|
89
90
|
}
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
93
|
};
|
|
93
|
-
function
|
|
94
|
-
const t = c.get(
|
|
95
|
-
X(
|
|
94
|
+
function j(i) {
|
|
95
|
+
const t = c.get(i), { form: e } = t;
|
|
96
|
+
X(i, e, t), Q(i, t.labels);
|
|
96
97
|
}
|
|
97
|
-
const
|
|
98
|
-
const e = document.createTreeWalker(
|
|
98
|
+
const q = (i, t = !1) => {
|
|
99
|
+
const e = document.createTreeWalker(i, NodeFilter.SHOW_ELEMENT, {
|
|
99
100
|
acceptNode(l) {
|
|
100
101
|
return c.has(l) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
101
102
|
}
|
|
102
103
|
});
|
|
103
|
-
let
|
|
104
|
-
const
|
|
105
|
-
for (;
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
for (const t of
|
|
104
|
+
let r = e.nextNode();
|
|
105
|
+
const o = !t || i.disabled;
|
|
106
|
+
for (; r; )
|
|
107
|
+
r.formDisabledCallback && o && $(r, i.disabled), r = e.nextNode();
|
|
108
|
+
}, U = { attributes: !0, attributeFilter: ["disabled", "name"] }, z = T() ? new MutationObserver((i) => {
|
|
109
|
+
for (const t of i) {
|
|
109
110
|
const e = t.target;
|
|
110
|
-
if (t.attributeName === "disabled" && (e.constructor.formAssociated ?
|
|
111
|
-
const
|
|
112
|
-
|
|
111
|
+
if (t.attributeName === "disabled" && (e.constructor.formAssociated ? $(e, e.hasAttribute("disabled")) : e.localName === "fieldset" && q(e)), t.attributeName === "name" && e.constructor.formAssociated) {
|
|
112
|
+
const r = c.get(e), o = M.get(e);
|
|
113
|
+
r.setFormValue(o);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
}) : {};
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
-
const { addedNodes: e, removedNodes:
|
|
119
|
-
|
|
120
|
-
var
|
|
121
|
-
if (c.has(s) && s.constructor.formAssociated &&
|
|
122
|
-
const v =
|
|
123
|
-
Object.keys(
|
|
124
|
-
s.setAttribute(
|
|
125
|
-
}),
|
|
117
|
+
function P(i) {
|
|
118
|
+
i.forEach((t) => {
|
|
119
|
+
const { addedNodes: e, removedNodes: r } = t, o = Array.from(e), l = Array.from(r);
|
|
120
|
+
o.forEach((s) => {
|
|
121
|
+
var g;
|
|
122
|
+
if (c.has(s) && s.constructor.formAssociated && j(s), k.has(s)) {
|
|
123
|
+
const v = k.get(s);
|
|
124
|
+
Object.keys(A).filter((w) => v[w] !== null).forEach((w) => {
|
|
125
|
+
s.setAttribute(A[w], v[w]);
|
|
126
|
+
}), k.delete(s);
|
|
126
127
|
}
|
|
127
|
-
if (
|
|
128
|
-
const v =
|
|
129
|
-
s.setAttribute("internals-valid", v.validity.valid.toString()), s.setAttribute("internals-invalid", (!v.validity.valid).toString()), s.setAttribute("aria-invalid", (!v.validity.valid).toString()),
|
|
128
|
+
if (F.has(s)) {
|
|
129
|
+
const v = F.get(s);
|
|
130
|
+
s.setAttribute("internals-valid", v.validity.valid.toString()), s.setAttribute("internals-invalid", (!v.validity.valid).toString()), s.setAttribute("aria-invalid", (!v.validity.valid).toString()), F.delete(s);
|
|
130
131
|
}
|
|
131
132
|
if (s.localName === "form") {
|
|
132
|
-
const v =
|
|
133
|
-
acceptNode(
|
|
134
|
-
return c.has(
|
|
133
|
+
const v = f.get(s), E = document.createTreeWalker(s, NodeFilter.SHOW_ELEMENT, {
|
|
134
|
+
acceptNode(rt) {
|
|
135
|
+
return c.has(rt) && !(v && v.has(rt)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
135
136
|
}
|
|
136
137
|
});
|
|
137
|
-
let w =
|
|
138
|
+
let w = E.nextNode();
|
|
138
139
|
for (; w; )
|
|
139
|
-
|
|
140
|
+
j(w), w = E.nextNode();
|
|
140
141
|
}
|
|
141
|
-
s.localName === "fieldset" && ((
|
|
142
|
+
s.localName === "fieldset" && ((g = z.observe) == null || g.call(z, s, U), q(s, !0));
|
|
142
143
|
}), l.forEach((s) => {
|
|
143
|
-
const
|
|
144
|
-
|
|
144
|
+
const g = c.get(s);
|
|
145
|
+
g && a.get(g) && G(g), u.has(s) && u.get(s).disconnect();
|
|
145
146
|
});
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
|
-
function at(
|
|
149
|
-
|
|
149
|
+
function at(i) {
|
|
150
|
+
i.forEach((t) => {
|
|
150
151
|
const { removedNodes: e } = t;
|
|
151
|
-
e.forEach((
|
|
152
|
-
const
|
|
153
|
-
c.has(
|
|
152
|
+
e.forEach((r) => {
|
|
153
|
+
const o = B.get(t.target);
|
|
154
|
+
c.has(r) && Z(r), o.disconnect();
|
|
154
155
|
});
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
|
-
const nt = (
|
|
158
|
+
const nt = (i) => {
|
|
158
159
|
var e;
|
|
159
160
|
const t = new MutationObserver(at);
|
|
160
|
-
(e = t.observe) == null || e.call(t,
|
|
161
|
+
(e = t.observe) == null || e.call(t, i, { childList: !0 }), B.set(i, t);
|
|
161
162
|
};
|
|
162
|
-
|
|
163
|
-
const
|
|
163
|
+
T() && new MutationObserver(P);
|
|
164
|
+
const _ = {
|
|
164
165
|
childList: !0,
|
|
165
166
|
subtree: !0
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
}, G = (
|
|
169
|
-
a.get(
|
|
167
|
+
}, $ = (i, t) => {
|
|
168
|
+
i.toggleAttribute("internals-disabled", t), t ? i.setAttribute("aria-disabled", "true") : i.removeAttribute("aria-disabled"), i.formDisabledCallback && i.formDisabledCallback.apply(i, [t]);
|
|
169
|
+
}, G = (i) => {
|
|
170
|
+
a.get(i).forEach((e) => {
|
|
170
171
|
e.remove();
|
|
171
|
-
}), a.set(
|
|
172
|
-
}, J = (
|
|
172
|
+
}), a.set(i, []);
|
|
173
|
+
}, J = (i, t) => {
|
|
173
174
|
const e = document.createElement("input");
|
|
174
|
-
return e.type = "hidden", e.name =
|
|
175
|
-
}, st = (
|
|
175
|
+
return e.type = "hidden", e.name = i.getAttribute("name"), i.after(e), a.get(t).push(e), e;
|
|
176
|
+
}, st = (i, t) => {
|
|
176
177
|
var e;
|
|
177
|
-
a.set(t, []), (e =
|
|
178
|
-
}, Q = (
|
|
178
|
+
a.set(t, []), (e = z.observe) == null || e.call(z, i, U);
|
|
179
|
+
}, Q = (i, t) => {
|
|
179
180
|
if (t.length) {
|
|
180
|
-
Array.from(t).forEach((
|
|
181
|
+
Array.from(t).forEach((r) => r.addEventListener("click", i.click.bind(i)));
|
|
181
182
|
let e = t[0].id;
|
|
182
|
-
t[0].id || (e = `${t[0].htmlFor}_Label`, t[0].id = e),
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
const t = Array.from(
|
|
186
|
-
|
|
187
|
-
}, lt = (
|
|
188
|
-
|
|
189
|
-
}, ct = (
|
|
190
|
-
|
|
191
|
-
}, dt = (
|
|
192
|
-
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((e) => `${e}:not([disabled])`).map((e) => `${e}:not([form])${
|
|
193
|
-
|
|
183
|
+
t[0].id || (e = `${t[0].htmlFor}_Label`, t[0].id = e), i.setAttribute("aria-labelledby", e);
|
|
184
|
+
}
|
|
185
|
+
}, S = (i) => {
|
|
186
|
+
const t = Array.from(i.elements).filter((l) => !l.tagName.includes("-") && l.validity).map((l) => l.validity.valid), e = f.get(i) || [], r = Array.from(e).filter((l) => l.isConnected).map((l) => c.get(l).validity.valid), o = [...t, ...r].includes(!1);
|
|
187
|
+
i.toggleAttribute("internals-invalid", o), i.toggleAttribute("internals-valid", !o);
|
|
188
|
+
}, lt = (i) => {
|
|
189
|
+
S(I(i.target));
|
|
190
|
+
}, ct = (i) => {
|
|
191
|
+
S(I(i.target));
|
|
192
|
+
}, dt = (i) => {
|
|
193
|
+
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((e) => `${e}:not([disabled])`).map((e) => `${e}:not([form])${i.id ? `,${e}[form='${i.id}']` : ""}`).join(",");
|
|
194
|
+
i.addEventListener("click", (e) => {
|
|
194
195
|
if (e.target.closest(t)) {
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
196
|
+
const o = f.get(i);
|
|
197
|
+
if (i.noValidate)
|
|
197
198
|
return;
|
|
198
|
-
|
|
199
|
+
o.size && Array.from(o).reverse().map((g) => c.get(g).reportValidity()).includes(!1) && e.preventDefault();
|
|
199
200
|
}
|
|
200
201
|
});
|
|
201
|
-
}, vt = (
|
|
202
|
-
const t =
|
|
202
|
+
}, vt = (i) => {
|
|
203
|
+
const t = f.get(i.target);
|
|
203
204
|
t && t.size && t.forEach((e) => {
|
|
204
205
|
e.constructor.formAssociated && e.formResetCallback && e.formResetCallback.apply(e);
|
|
205
206
|
});
|
|
206
|
-
}, X = (
|
|
207
|
+
}, X = (i, t, e) => {
|
|
207
208
|
if (t) {
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
210
|
-
|
|
209
|
+
const r = f.get(t);
|
|
210
|
+
if (r)
|
|
211
|
+
r.add(i);
|
|
211
212
|
else {
|
|
212
|
-
const
|
|
213
|
-
|
|
213
|
+
const o = /* @__PURE__ */ new Set();
|
|
214
|
+
o.add(i), f.set(t, o), dt(t), t.addEventListener("reset", vt), t.addEventListener("input", lt), t.addEventListener("change", ct);
|
|
214
215
|
}
|
|
215
|
-
y.set(t, { ref:
|
|
216
|
-
|
|
217
|
-
}, 0),
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
let t =
|
|
221
|
-
return t && t.tagName !== "FORM" && (t =
|
|
222
|
-
},
|
|
223
|
-
if (!
|
|
216
|
+
y.set(t, { ref: i, internals: e }), i.constructor.formAssociated && i.formAssociatedCallback && setTimeout(() => {
|
|
217
|
+
i.formAssociatedCallback.apply(i, [t]);
|
|
218
|
+
}, 0), S(t);
|
|
219
|
+
}
|
|
220
|
+
}, I = (i) => {
|
|
221
|
+
let t = i.parentNode;
|
|
222
|
+
return t && t.tagName !== "FORM" && (t = I(t)), t;
|
|
223
|
+
}, x = (i, t, e = DOMException) => {
|
|
224
|
+
if (!i.constructor.formAssociated)
|
|
224
225
|
throw new e(t);
|
|
225
|
-
}, Y = (
|
|
226
|
-
const
|
|
227
|
-
return
|
|
228
|
-
c.get(
|
|
226
|
+
}, Y = (i, t, e) => {
|
|
227
|
+
const r = f.get(i);
|
|
228
|
+
return r && r.size && r.forEach((o) => {
|
|
229
|
+
c.get(o)[e]() || (t = !1);
|
|
229
230
|
}), t;
|
|
230
|
-
}, Z = (
|
|
231
|
-
if (
|
|
232
|
-
const t = c.get(
|
|
233
|
-
Q(
|
|
231
|
+
}, Z = (i) => {
|
|
232
|
+
if (i.constructor.formAssociated) {
|
|
233
|
+
const t = c.get(i), { labels: e, form: r } = t;
|
|
234
|
+
Q(i, e), X(i, r, t);
|
|
234
235
|
}
|
|
235
236
|
};
|
|
236
|
-
function
|
|
237
|
+
function T() {
|
|
237
238
|
return typeof MutationObserver < "u";
|
|
238
239
|
}
|
|
239
240
|
class ht {
|
|
@@ -241,14 +242,14 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
241
242
|
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);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
|
-
const
|
|
245
|
+
const pt = (i) => (i.badInput = !1, i.customError = !1, i.patternMismatch = !1, i.rangeOverflow = !1, i.rangeUnderflow = !1, i.stepMismatch = !1, i.tooLong = !1, i.tooShort = !1, i.typeMismatch = !1, i.valid = !0, i.valueMissing = !1, i), mt = (i, t, e) => (i.valid = bt(t), Object.keys(t).forEach((r) => i[r] = t[r]), e && S(e), i), bt = (i) => {
|
|
245
246
|
let t = !0;
|
|
246
|
-
for (let e in
|
|
247
|
-
e !== "valid" &&
|
|
247
|
+
for (let e in i)
|
|
248
|
+
e !== "valid" && i[e] !== !1 && (t = !1);
|
|
248
249
|
return t;
|
|
249
|
-
},
|
|
250
|
-
function tt(
|
|
251
|
-
|
|
250
|
+
}, D = /* @__PURE__ */ new WeakMap();
|
|
251
|
+
function tt(i, t) {
|
|
252
|
+
i.toggleAttribute(t, !0), i.part && i.part.add(t);
|
|
252
253
|
}
|
|
253
254
|
class V extends Set {
|
|
254
255
|
static get isPolyfilled() {
|
|
@@ -257,14 +258,14 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
257
258
|
constructor(t) {
|
|
258
259
|
if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
259
260
|
throw new TypeError("Illegal constructor");
|
|
260
|
-
|
|
261
|
+
D.set(this, t);
|
|
261
262
|
}
|
|
262
263
|
add(t) {
|
|
263
264
|
if (!/^--/.test(t) || typeof t != "string")
|
|
264
265
|
throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
|
|
265
|
-
const e = super.add(t),
|
|
266
|
-
return
|
|
267
|
-
tt(
|
|
266
|
+
const e = super.add(t), r = D.get(this), o = `state${t}`;
|
|
267
|
+
return r.isConnected ? tt(r, o) : setTimeout(() => {
|
|
268
|
+
tt(r, o);
|
|
268
269
|
}), e;
|
|
269
270
|
}
|
|
270
271
|
clear() {
|
|
@@ -273,43 +274,43 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
273
274
|
super.clear();
|
|
274
275
|
}
|
|
275
276
|
delete(t) {
|
|
276
|
-
const e = super.delete(t),
|
|
277
|
-
return
|
|
278
|
-
|
|
277
|
+
const e = super.delete(t), r = D.get(this);
|
|
278
|
+
return r.isConnected ? (r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`)) : setTimeout(() => {
|
|
279
|
+
r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`);
|
|
279
280
|
}), e;
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
|
-
function et(
|
|
283
|
-
if (e === "a" && !
|
|
283
|
+
function et(i, t, e, r) {
|
|
284
|
+
if (e === "a" && !r)
|
|
284
285
|
throw new TypeError("Private accessor was defined without a getter");
|
|
285
|
-
if (typeof t == "function" ?
|
|
286
|
+
if (typeof t == "function" ? i !== t || !r : !t.has(i))
|
|
286
287
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
287
|
-
return e === "m" ?
|
|
288
|
+
return e === "m" ? r : e === "a" ? r.call(i) : r ? r.value : t.get(i);
|
|
288
289
|
}
|
|
289
|
-
function
|
|
290
|
-
if (
|
|
290
|
+
function ut(i, t, e, r, o) {
|
|
291
|
+
if (r === "m")
|
|
291
292
|
throw new TypeError("Private method is not writable");
|
|
292
|
-
if (
|
|
293
|
+
if (r === "a" && !o)
|
|
293
294
|
throw new TypeError("Private accessor was defined without a setter");
|
|
294
|
-
if (typeof t == "function" ?
|
|
295
|
+
if (typeof t == "function" ? i !== t || !o : !t.has(i))
|
|
295
296
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
296
|
-
return
|
|
297
|
+
return r === "a" ? o.call(i, e) : o ? o.value = e : t.set(i, e), e;
|
|
297
298
|
}
|
|
298
|
-
var
|
|
299
|
-
class
|
|
299
|
+
var C;
|
|
300
|
+
class ft {
|
|
300
301
|
constructor(t) {
|
|
301
|
-
|
|
302
|
+
C.set(this, void 0), ut(this, C, t, "f");
|
|
302
303
|
for (let e = 0; e < t.length; e++) {
|
|
303
|
-
let
|
|
304
|
-
this[e] =
|
|
304
|
+
let r = t[e];
|
|
305
|
+
this[e] = r, r.hasAttribute("name") && (this[r.getAttribute("name")] = r);
|
|
305
306
|
}
|
|
306
307
|
Object.freeze(this);
|
|
307
308
|
}
|
|
308
309
|
get length() {
|
|
309
|
-
return et(this,
|
|
310
|
+
return et(this, C, "f").length;
|
|
310
311
|
}
|
|
311
|
-
[(
|
|
312
|
-
return et(this,
|
|
312
|
+
[(C = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
313
|
+
return et(this, C, "f")[Symbol.iterator]();
|
|
313
314
|
}
|
|
314
315
|
item(t) {
|
|
315
316
|
return this[t] == null ? null : this[t];
|
|
@@ -319,106 +320,106 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
319
320
|
}
|
|
320
321
|
}
|
|
321
322
|
function gt() {
|
|
322
|
-
const
|
|
323
|
+
const i = HTMLFormElement.prototype.checkValidity;
|
|
323
324
|
HTMLFormElement.prototype.checkValidity = e;
|
|
324
325
|
const t = HTMLFormElement.prototype.reportValidity;
|
|
325
|
-
HTMLFormElement.prototype.reportValidity =
|
|
326
|
+
HTMLFormElement.prototype.reportValidity = r;
|
|
326
327
|
function e(...l) {
|
|
327
|
-
let s =
|
|
328
|
+
let s = i.apply(this, l);
|
|
328
329
|
return Y(this, s, "checkValidity");
|
|
329
330
|
}
|
|
330
|
-
function
|
|
331
|
+
function r(...l) {
|
|
331
332
|
let s = t.apply(this, l);
|
|
332
333
|
return Y(this, s, "reportValidity");
|
|
333
334
|
}
|
|
334
|
-
const { get:
|
|
335
|
+
const { get: o } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
335
336
|
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
336
337
|
get(...l) {
|
|
337
|
-
const s =
|
|
338
|
-
if (
|
|
338
|
+
const s = o.call(this, ...l), g = Array.from(f.get(this) || []);
|
|
339
|
+
if (g.length === 0)
|
|
339
340
|
return s;
|
|
340
|
-
const v = Array.from(s).concat(
|
|
341
|
-
return new
|
|
341
|
+
const v = Array.from(s).concat(g).sort((E, w) => E.compareDocumentPosition ? E.compareDocumentPosition(w) & 2 ? 1 : -1 : 0);
|
|
342
|
+
return new ft(v);
|
|
342
343
|
}
|
|
343
344
|
});
|
|
344
345
|
}
|
|
345
|
-
class
|
|
346
|
+
class it {
|
|
346
347
|
static get isPolyfilled() {
|
|
347
348
|
return !0;
|
|
348
349
|
}
|
|
349
350
|
constructor(t) {
|
|
350
351
|
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
351
352
|
throw new TypeError("Illegal constructor");
|
|
352
|
-
const e = t.getRootNode(),
|
|
353
|
-
this.states = new V(t), d.set(this, t), n.set(this,
|
|
353
|
+
const e = t.getRootNode(), r = new ht();
|
|
354
|
+
this.states = new V(t), d.set(this, t), n.set(this, r), c.set(t, this), ot(t, this), st(t, this), Object.seal(this), e instanceof DocumentFragment && nt(e);
|
|
354
355
|
}
|
|
355
356
|
checkValidity() {
|
|
356
357
|
const t = d.get(this);
|
|
357
|
-
if (
|
|
358
|
+
if (x(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
358
359
|
return !0;
|
|
359
360
|
const e = n.get(this);
|
|
360
361
|
if (!e.valid) {
|
|
361
|
-
const
|
|
362
|
+
const r = new Event("invalid", {
|
|
362
363
|
bubbles: !1,
|
|
363
364
|
cancelable: !0,
|
|
364
365
|
composed: !1
|
|
365
366
|
});
|
|
366
|
-
t.dispatchEvent(
|
|
367
|
+
t.dispatchEvent(r);
|
|
367
368
|
}
|
|
368
369
|
return e.valid;
|
|
369
370
|
}
|
|
370
371
|
get form() {
|
|
371
372
|
const t = d.get(this);
|
|
372
|
-
|
|
373
|
+
x(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
373
374
|
let e;
|
|
374
|
-
return t.constructor.formAssociated === !0 && (e =
|
|
375
|
+
return t.constructor.formAssociated === !0 && (e = I(t)), e;
|
|
375
376
|
}
|
|
376
377
|
get labels() {
|
|
377
378
|
const t = d.get(this);
|
|
378
|
-
|
|
379
|
-
const e = t.getAttribute("id"),
|
|
380
|
-
return
|
|
379
|
+
x(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
380
|
+
const e = t.getAttribute("id"), r = t.getRootNode();
|
|
381
|
+
return r && e ? r.querySelectorAll(`[for="${e}"]`) : [];
|
|
381
382
|
}
|
|
382
383
|
reportValidity() {
|
|
383
384
|
const t = d.get(this);
|
|
384
|
-
if (
|
|
385
|
+
if (x(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
385
386
|
return !0;
|
|
386
|
-
const e = this.checkValidity(),
|
|
387
|
-
if (
|
|
387
|
+
const e = this.checkValidity(), r = H.get(this);
|
|
388
|
+
if (r && !t.constructor.formAssociated)
|
|
388
389
|
throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
389
|
-
return !e &&
|
|
390
|
+
return !e && r && (t.focus(), r.focus()), e;
|
|
390
391
|
}
|
|
391
392
|
setFormValue(t) {
|
|
392
393
|
const e = d.get(this);
|
|
393
|
-
if (
|
|
394
|
+
if (x(e, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), G(this), t != null && !(t instanceof FormData)) {
|
|
394
395
|
if (e.getAttribute("name")) {
|
|
395
|
-
const
|
|
396
|
-
|
|
396
|
+
const r = J(e, this);
|
|
397
|
+
r.value = t;
|
|
397
398
|
}
|
|
398
399
|
} else
|
|
399
|
-
t != null && t instanceof FormData && Array.from(t).reverse().forEach(([
|
|
400
|
-
if (typeof
|
|
400
|
+
t != null && t instanceof FormData && Array.from(t).reverse().forEach(([r, o]) => {
|
|
401
|
+
if (typeof o == "string") {
|
|
401
402
|
const l = J(e, this);
|
|
402
|
-
l.name =
|
|
403
|
+
l.name = r, l.value = o;
|
|
403
404
|
}
|
|
404
405
|
});
|
|
405
|
-
|
|
406
|
+
M.set(e, t);
|
|
406
407
|
}
|
|
407
|
-
setValidity(t, e,
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
408
|
+
setValidity(t, e, r) {
|
|
409
|
+
const o = d.get(this);
|
|
410
|
+
if (x(o, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
410
411
|
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
411
|
-
H.set(this,
|
|
412
|
+
H.set(this, r);
|
|
412
413
|
const l = n.get(this), s = {};
|
|
413
|
-
for (const
|
|
414
|
-
s[
|
|
415
|
-
Object.keys(s).length === 0 &&
|
|
416
|
-
const
|
|
417
|
-
delete
|
|
418
|
-
const { valid: v } =
|
|
414
|
+
for (const E in t)
|
|
415
|
+
s[E] = t[E];
|
|
416
|
+
Object.keys(s).length === 0 && pt(l);
|
|
417
|
+
const g = { ...l, ...s };
|
|
418
|
+
delete g.valid;
|
|
419
|
+
const { valid: v } = mt(l, g, this.form);
|
|
419
420
|
if (!v && !e)
|
|
420
421
|
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.");
|
|
421
|
-
|
|
422
|
+
b.set(this, v ? "" : e), o.isConnected ? (o.toggleAttribute("internals-invalid", !v), o.toggleAttribute("internals-valid", v), o.setAttribute("aria-invalid", `${!v}`)) : F.set(o, this);
|
|
422
423
|
}
|
|
423
424
|
get shadowRoot() {
|
|
424
425
|
const t = d.get(this), e = W.get(t);
|
|
@@ -426,28 +427,28 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
426
427
|
}
|
|
427
428
|
get validationMessage() {
|
|
428
429
|
const t = d.get(this);
|
|
429
|
-
return
|
|
430
|
+
return x(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), b.get(this);
|
|
430
431
|
}
|
|
431
432
|
get validity() {
|
|
432
433
|
const t = d.get(this);
|
|
433
|
-
return
|
|
434
|
+
return x(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), n.get(this);
|
|
434
435
|
}
|
|
435
436
|
get willValidate() {
|
|
436
437
|
const t = d.get(this);
|
|
437
|
-
return
|
|
438
|
+
return x(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"));
|
|
438
439
|
}
|
|
439
440
|
}
|
|
440
441
|
function yt() {
|
|
441
442
|
if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
|
|
442
443
|
return !1;
|
|
443
|
-
class
|
|
444
|
+
class i extends HTMLElement {
|
|
444
445
|
constructor() {
|
|
445
446
|
super(), this.internals = this.attachInternals();
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
|
|
449
|
-
customElements.define(t,
|
|
450
|
-
const e = new
|
|
450
|
+
customElements.define(t, i);
|
|
451
|
+
const e = new i();
|
|
451
452
|
return [
|
|
452
453
|
"shadowRoot",
|
|
453
454
|
"form",
|
|
@@ -459,28 +460,28 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
459
460
|
"setValidity",
|
|
460
461
|
"checkValidity",
|
|
461
462
|
"reportValidity"
|
|
462
|
-
].every((
|
|
463
|
+
].every((r) => r in e.internals);
|
|
463
464
|
}
|
|
464
465
|
if (yt()) {
|
|
465
466
|
if (typeof window < "u" && !window.CustomStateSet) {
|
|
466
467
|
window.CustomStateSet = V;
|
|
467
|
-
const
|
|
468
|
+
const i = HTMLElement.prototype.attachInternals;
|
|
468
469
|
HTMLElement.prototype.attachInternals = function(...t) {
|
|
469
|
-
const e =
|
|
470
|
+
const e = i.call(this, t);
|
|
470
471
|
return e.states = new V(this), e;
|
|
471
472
|
};
|
|
472
473
|
}
|
|
473
474
|
} else {
|
|
474
|
-
if (typeof window < "u" && (window.ElementInternals =
|
|
475
|
-
const
|
|
476
|
-
CustomElementRegistry.prototype.define = function(t, e,
|
|
475
|
+
if (typeof window < "u" && (window.ElementInternals = it), typeof CustomElementRegistry < "u") {
|
|
476
|
+
const i = CustomElementRegistry.prototype.define;
|
|
477
|
+
CustomElementRegistry.prototype.define = function(t, e, r) {
|
|
477
478
|
if (e.formAssociated) {
|
|
478
|
-
const
|
|
479
|
+
const o = e.prototype.connectedCallback;
|
|
479
480
|
e.prototype.connectedCallback = function() {
|
|
480
|
-
K.has(this) || (K.set(this, !0), this.hasAttribute("disabled") &&
|
|
481
|
+
K.has(this) || (K.set(this, !0), this.hasAttribute("disabled") && $(this, !0)), o != null && o.apply(this), Z(this);
|
|
481
482
|
};
|
|
482
483
|
}
|
|
483
|
-
|
|
484
|
+
i.call(this, t, e, r);
|
|
484
485
|
};
|
|
485
486
|
}
|
|
486
487
|
if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
|
|
@@ -491,31 +492,31 @@ const kt = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
491
492
|
return {};
|
|
492
493
|
if (c.has(this))
|
|
493
494
|
throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
|
|
494
|
-
return new
|
|
495
|
+
return new it(this);
|
|
495
496
|
}), typeof Element < "u") {
|
|
496
|
-
let
|
|
497
|
-
const
|
|
498
|
-
if (W.set(this,
|
|
499
|
-
const
|
|
500
|
-
window.ShadyDOM ?
|
|
497
|
+
let i = function(...e) {
|
|
498
|
+
const r = t.apply(this, e);
|
|
499
|
+
if (W.set(this, r), T()) {
|
|
500
|
+
const o = new MutationObserver(P);
|
|
501
|
+
window.ShadyDOM ? o.observe(this, _) : o.observe(r, _), u.set(this, o);
|
|
501
502
|
}
|
|
502
|
-
return
|
|
503
|
+
return r;
|
|
503
504
|
};
|
|
504
505
|
const t = Element.prototype.attachShadow;
|
|
505
|
-
Element.prototype.attachShadow =
|
|
506
|
+
Element.prototype.attachShadow = i;
|
|
506
507
|
}
|
|
507
|
-
|
|
508
|
+
T() && typeof document < "u" && new MutationObserver(P).observe(document.documentElement, _), typeof HTMLFormElement < "u" && gt(), typeof window < "u" && !window.CustomStateSet && (window.CustomStateSet = V);
|
|
508
509
|
}
|
|
509
510
|
})();
|
|
510
|
-
var At = Object.defineProperty,
|
|
511
|
-
for (var
|
|
512
|
-
(
|
|
513
|
-
return c &&
|
|
511
|
+
var At = Object.defineProperty, St = Object.getOwnPropertyDescriptor, m = (d, n, a, c) => {
|
|
512
|
+
for (var b = c > 1 ? void 0 : c ? St(n, a) : n, y = d.length - 1, u; y >= 0; y--)
|
|
513
|
+
(u = d[y]) && (b = (c ? u(n, a, b) : u(b)) || b);
|
|
514
|
+
return c && b && At(n, a, b), b;
|
|
514
515
|
};
|
|
515
|
-
const
|
|
516
|
-
class h extends
|
|
516
|
+
const L = "pie-button";
|
|
517
|
+
class h extends xt {
|
|
517
518
|
constructor() {
|
|
518
|
-
super(), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1, this._handleFormKeyDown = (n) => {
|
|
519
|
+
super(), this.size = "medium", this.type = "submit", this.variant = "primary", this.iconPlacement = "leading", this.disabled = !1, this.isLoading = !1, this.isFullWidth = !1, this.isResponsive = !1, this._handleFormKeyDown = (n) => {
|
|
519
520
|
if (!(n.key !== "Enter" || this.type !== "submit" || this.disabled)) {
|
|
520
521
|
if (n.target instanceof HTMLElement) {
|
|
521
522
|
const a = n.target.tagName.toLowerCase();
|
|
@@ -576,25 +577,29 @@ class h extends Et {
|
|
|
576
577
|
type: n,
|
|
577
578
|
disabled: a,
|
|
578
579
|
isFullWidth: c,
|
|
579
|
-
variant:
|
|
580
|
+
variant: b,
|
|
580
581
|
size: y,
|
|
581
|
-
isLoading:
|
|
582
|
-
|
|
582
|
+
isLoading: u,
|
|
583
|
+
isResponsive: f,
|
|
584
|
+
iconPlacement: M,
|
|
585
|
+
responsiveSize: k
|
|
583
586
|
} = this;
|
|
584
587
|
return N`
|
|
585
588
|
<button
|
|
586
589
|
@click=${this._handleClick}
|
|
587
590
|
class="o-btn"
|
|
588
591
|
type=${n}
|
|
589
|
-
variant=${
|
|
592
|
+
variant=${b}
|
|
590
593
|
size=${y}
|
|
594
|
+
responsiveSize=${Et(k)}
|
|
591
595
|
?disabled=${a}
|
|
592
596
|
?isFullWidth=${c}
|
|
593
|
-
?
|
|
594
|
-
|
|
595
|
-
${u
|
|
597
|
+
?isResponsive=${f}
|
|
598
|
+
?isLoading=${u}>
|
|
599
|
+
${u ? this.renderSpinner() : O}
|
|
600
|
+
${M === "leading" ? N`<slot name="icon"></slot>` : O}
|
|
596
601
|
<slot></slot>
|
|
597
|
-
${
|
|
602
|
+
${M === "trailing" ? N`<slot name="icon"></slot>` : O}
|
|
598
603
|
</button>`;
|
|
599
604
|
}
|
|
600
605
|
focus() {
|
|
@@ -604,60 +609,67 @@ class h extends Et {
|
|
|
604
609
|
}
|
|
605
610
|
h.formAssociated = !0;
|
|
606
611
|
h.styles = wt(Ft);
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
612
|
+
m([
|
|
613
|
+
p(),
|
|
614
|
+
R(L, zt, "medium")
|
|
610
615
|
], h.prototype, "size", 2);
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
616
|
+
m([
|
|
617
|
+
p(),
|
|
618
|
+
R(L, Mt, "submit")
|
|
614
619
|
], h.prototype, "type", 2);
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
620
|
+
m([
|
|
621
|
+
p(),
|
|
622
|
+
R(L, Ct, "primary")
|
|
618
623
|
], h.prototype, "variant", 2);
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
624
|
+
m([
|
|
625
|
+
p({ type: String }),
|
|
626
|
+
R(L, Lt, "leading")
|
|
622
627
|
], h.prototype, "iconPlacement", 2);
|
|
623
|
-
|
|
624
|
-
|
|
628
|
+
m([
|
|
629
|
+
p({ type: Boolean })
|
|
625
630
|
], h.prototype, "disabled", 2);
|
|
626
|
-
|
|
627
|
-
|
|
631
|
+
m([
|
|
632
|
+
p({ type: Boolean, reflect: !0 })
|
|
628
633
|
], h.prototype, "isLoading", 2);
|
|
629
|
-
|
|
630
|
-
|
|
634
|
+
m([
|
|
635
|
+
p({ type: Boolean })
|
|
631
636
|
], h.prototype, "isFullWidth", 2);
|
|
632
|
-
|
|
633
|
-
|
|
637
|
+
m([
|
|
638
|
+
p({ type: Boolean })
|
|
639
|
+
], h.prototype, "isResponsive", 2);
|
|
640
|
+
m([
|
|
641
|
+
p({ type: String })
|
|
634
642
|
], h.prototype, "name", 2);
|
|
635
|
-
|
|
636
|
-
|
|
643
|
+
m([
|
|
644
|
+
p({ type: String })
|
|
637
645
|
], h.prototype, "value", 2);
|
|
638
|
-
|
|
639
|
-
|
|
646
|
+
m([
|
|
647
|
+
p()
|
|
640
648
|
], h.prototype, "formaction", 2);
|
|
641
|
-
|
|
642
|
-
|
|
649
|
+
m([
|
|
650
|
+
p()
|
|
643
651
|
], h.prototype, "formenctype", 2);
|
|
644
|
-
|
|
645
|
-
|
|
652
|
+
m([
|
|
653
|
+
p()
|
|
646
654
|
], h.prototype, "formmethod", 2);
|
|
647
|
-
|
|
648
|
-
|
|
655
|
+
m([
|
|
656
|
+
p({ type: Boolean })
|
|
649
657
|
], h.prototype, "formnovalidate", 2);
|
|
650
|
-
|
|
651
|
-
|
|
658
|
+
m([
|
|
659
|
+
p()
|
|
652
660
|
], h.prototype, "formtarget", 2);
|
|
653
|
-
|
|
661
|
+
m([
|
|
662
|
+
p({ type: String })
|
|
663
|
+
], h.prototype, "responsiveSize", 2);
|
|
664
|
+
kt(L, h);
|
|
654
665
|
export {
|
|
655
666
|
h as PieButton,
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
667
|
+
Pt as formEncodingtypes,
|
|
668
|
+
_t as formMethodTypes,
|
|
669
|
+
$t as formTargetTypes,
|
|
659
670
|
Lt as iconPlacements,
|
|
660
|
-
|
|
671
|
+
Rt as responsiveSizes,
|
|
672
|
+
zt as sizes,
|
|
661
673
|
Mt as types,
|
|
662
674
|
Ct as variants
|
|
663
675
|
};
|