@justeattakeaway/pie-button 0.47.8 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +291 -289
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/src/button.scss +75 -45
- package/src/index.ts +13 -9
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { FormControlMixin as
|
|
1
|
+
import { LitElement as zt, html as P, nothing as K, unsafeCSS as Ft } from "lit";
|
|
2
|
+
import { classMap as St } from "lit/directives/class-map.js";
|
|
3
|
+
import { property as h } from "lit/decorators.js";
|
|
4
|
+
import { FormControlMixin as At, validPropertyValues as O, defineCustomElement as It } from "@justeattakeaway/pie-webc-core";
|
|
5
5
|
import "@justeattakeaway/pie-spinner";
|
|
6
|
-
const
|
|
6
|
+
const Tt = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Kt = ["productive", "expressive"], Lt = ["submit", "button", "reset"], Vt = [
|
|
7
7
|
"primary",
|
|
8
8
|
"secondary",
|
|
9
9
|
"outline",
|
|
@@ -13,7 +13,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
13
13
|
"ghost-inverse",
|
|
14
14
|
"destructive",
|
|
15
15
|
"destructive-ghost"
|
|
16
|
-
], Nt = ["leading", "trailing"], jt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Ut = ["post", "get", "dialog"], qt = ["_self", "_blank", "_parent", "_top"],
|
|
16
|
+
], Nt = ["leading", "trailing"], jt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Ut = ["post", "get", "dialog"], qt = ["_self", "_blank", "_parent", "_top"], f = {
|
|
17
17
|
size: "medium",
|
|
18
18
|
type: "submit",
|
|
19
19
|
variant: "primary",
|
|
@@ -22,11 +22,11 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
22
22
|
isLoading: !1,
|
|
23
23
|
isFullWidth: !1,
|
|
24
24
|
isResponsive: !1
|
|
25
|
-
}, Pt = `*,*: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: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;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]:not([disabled]){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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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);--icon-size-override: 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(--icon-size-override);width:var(--icon-size-override)}
|
|
25
|
+
}, Pt = `*,*: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: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;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)}
|
|
26
26
|
`;
|
|
27
27
|
(function() {
|
|
28
28
|
(function(k) {
|
|
29
|
-
const
|
|
29
|
+
const n = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), I = {
|
|
30
30
|
ariaAtomic: "aria-atomic",
|
|
31
31
|
ariaAutoComplete: "aria-autocomplete",
|
|
32
32
|
ariaBusy: "aria-busy",
|
|
@@ -70,57 +70,57 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
70
70
|
ariaValueText: "aria-valuetext",
|
|
71
71
|
role: "role"
|
|
72
72
|
}, dt = (e, t) => {
|
|
73
|
-
for (let
|
|
74
|
-
t[
|
|
75
|
-
let
|
|
76
|
-
const
|
|
77
|
-
Object.defineProperty(t,
|
|
73
|
+
for (let o in I) {
|
|
74
|
+
t[o] = null;
|
|
75
|
+
let i = null;
|
|
76
|
+
const r = I[o];
|
|
77
|
+
Object.defineProperty(t, o, {
|
|
78
78
|
get() {
|
|
79
|
-
return
|
|
79
|
+
return i;
|
|
80
80
|
},
|
|
81
81
|
set(s) {
|
|
82
|
-
|
|
82
|
+
i = s, e.isConnected ? e.setAttribute(r, s) : C.set(e, t);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
function J(e) {
|
|
88
|
-
const t = c.get(e), { form:
|
|
89
|
-
et(e,
|
|
88
|
+
const t = c.get(e), { form: o } = t;
|
|
89
|
+
et(e, o, t), tt(e, t.labels);
|
|
90
90
|
}
|
|
91
91
|
const Q = (e, t = !1) => {
|
|
92
|
-
const
|
|
92
|
+
const o = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
93
93
|
acceptNode(s) {
|
|
94
94
|
return c.has(s) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
let
|
|
98
|
-
const
|
|
99
|
-
for (;
|
|
100
|
-
|
|
101
|
-
}, X = { attributes: !0, attributeFilter: ["disabled", "name"] },
|
|
97
|
+
let i = o.nextNode();
|
|
98
|
+
const r = !t || e.disabled;
|
|
99
|
+
for (; i; )
|
|
100
|
+
i.formDisabledCallback && r && D(i, e.disabled), i = o.nextNode();
|
|
101
|
+
}, X = { attributes: !0, attributeFilter: ["disabled", "name"] }, T = N() ? new MutationObserver((e) => {
|
|
102
102
|
for (const t of e) {
|
|
103
|
-
const
|
|
104
|
-
if (t.attributeName === "disabled" && (
|
|
105
|
-
const
|
|
106
|
-
|
|
103
|
+
const o = t.target;
|
|
104
|
+
if (t.attributeName === "disabled" && (o.constructor.formAssociated ? D(o, o.hasAttribute("disabled")) : o.localName === "fieldset" && Q(o)), t.attributeName === "name" && o.constructor.formAssociated) {
|
|
105
|
+
const i = c.get(o), r = z.get(o);
|
|
106
|
+
i.setFormValue(r);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
}) : {};
|
|
110
|
-
function
|
|
110
|
+
function _(e) {
|
|
111
111
|
e.forEach((t) => {
|
|
112
|
-
const { addedNodes:
|
|
113
|
-
|
|
114
|
-
var
|
|
115
|
-
if (c.has(l) && l.constructor.formAssociated && J(l),
|
|
116
|
-
const d =
|
|
117
|
-
Object.keys(
|
|
118
|
-
l.setAttribute(
|
|
119
|
-
}),
|
|
112
|
+
const { addedNodes: o, removedNodes: i } = t, r = Array.from(o), s = Array.from(i);
|
|
113
|
+
r.forEach((l) => {
|
|
114
|
+
var m;
|
|
115
|
+
if (c.has(l) && l.constructor.formAssociated && J(l), C.has(l)) {
|
|
116
|
+
const d = C.get(l);
|
|
117
|
+
Object.keys(I).filter((y) => d[y] !== null).forEach((y) => {
|
|
118
|
+
l.setAttribute(I[y], d[y]);
|
|
119
|
+
}), C.delete(l);
|
|
120
120
|
}
|
|
121
|
-
if (
|
|
122
|
-
const d =
|
|
123
|
-
l.setAttribute("internals-valid", d.validity.valid.toString()), l.setAttribute("internals-invalid", (!d.validity.valid).toString()), l.setAttribute("aria-invalid", (!d.validity.valid).toString()),
|
|
121
|
+
if (A.has(l)) {
|
|
122
|
+
const d = A.get(l);
|
|
123
|
+
l.setAttribute("internals-valid", d.validity.valid.toString()), l.setAttribute("internals-invalid", (!d.validity.valid).toString()), l.setAttribute("aria-invalid", (!d.validity.valid).toString()), A.delete(l);
|
|
124
124
|
}
|
|
125
125
|
if (l.localName === "form") {
|
|
126
126
|
const d = g.get(l), E = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
|
|
@@ -132,99 +132,99 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
132
132
|
for (; y; )
|
|
133
133
|
J(y), y = E.nextNode();
|
|
134
134
|
}
|
|
135
|
-
l.localName === "fieldset" && ((
|
|
135
|
+
l.localName === "fieldset" && ((m = T.observe) === null || m === void 0 || m.call(T, l, X), Q(l, !0));
|
|
136
136
|
}), s.forEach((l) => {
|
|
137
|
-
const
|
|
138
|
-
|
|
137
|
+
const m = c.get(l);
|
|
138
|
+
m && v.get(m) && Y(m), M.has(l) && M.get(l).disconnect();
|
|
139
139
|
});
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function bt(e) {
|
|
143
143
|
e.forEach((t) => {
|
|
144
|
-
const { removedNodes:
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
c.has(
|
|
144
|
+
const { removedNodes: o } = t;
|
|
145
|
+
o.forEach((i) => {
|
|
146
|
+
const r = q.get(t.target);
|
|
147
|
+
c.has(i) && it(i), r.disconnect();
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
var t,
|
|
153
|
-
const
|
|
154
|
-
!((t = window == null ? void 0 : window.ShadyDOM) === null || t === void 0) && t.inUse && e.mode && e.host && (e = e.host), (
|
|
151
|
+
const vt = (e) => {
|
|
152
|
+
var t, o;
|
|
153
|
+
const i = new MutationObserver(bt);
|
|
154
|
+
!((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 }), q.set(e, i);
|
|
155
155
|
};
|
|
156
|
-
N() && new MutationObserver(
|
|
157
|
-
const
|
|
156
|
+
N() && new MutationObserver(_);
|
|
157
|
+
const R = {
|
|
158
158
|
childList: !0,
|
|
159
159
|
subtree: !0
|
|
160
160
|
}, D = (e, t) => {
|
|
161
161
|
e.toggleAttribute("internals-disabled", t), t ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
|
|
162
162
|
}, Y = (e) => {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}),
|
|
163
|
+
v.get(e).forEach((o) => {
|
|
164
|
+
o.remove();
|
|
165
|
+
}), v.set(e, []);
|
|
166
166
|
}, Z = (e, t) => {
|
|
167
|
-
const
|
|
168
|
-
return
|
|
169
|
-
},
|
|
170
|
-
var
|
|
171
|
-
|
|
167
|
+
const o = document.createElement("input");
|
|
168
|
+
return o.type = "hidden", o.name = e.getAttribute("name"), e.after(o), v.get(t).push(o), o;
|
|
169
|
+
}, ht = (e, t) => {
|
|
170
|
+
var o;
|
|
171
|
+
v.set(t, []), (o = T.observe) === null || o === void 0 || o.call(T, e, X);
|
|
172
172
|
}, tt = (e, t) => {
|
|
173
173
|
if (t.length) {
|
|
174
|
-
Array.from(t).forEach((
|
|
175
|
-
let
|
|
176
|
-
t[0].id || (
|
|
174
|
+
Array.from(t).forEach((i) => i.addEventListener("click", e.click.bind(e)));
|
|
175
|
+
let o = t[0].id;
|
|
176
|
+
t[0].id || (o = `${t[0].htmlFor}_Label`, t[0].id = o), e.setAttribute("aria-labelledby", o);
|
|
177
177
|
}
|
|
178
|
-
},
|
|
179
|
-
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid),
|
|
180
|
-
e.toggleAttribute("internals-invalid",
|
|
178
|
+
}, L = (e) => {
|
|
179
|
+
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), o = g.get(e) || [], i = Array.from(o).filter((s) => s.isConnected).map((s) => c.get(s).validity.valid), r = [...t, ...i].includes(!1);
|
|
180
|
+
e.toggleAttribute("internals-invalid", r), e.toggleAttribute("internals-valid", !r);
|
|
181
181
|
}, pt = (e) => {
|
|
182
|
-
|
|
182
|
+
L(V(e.target));
|
|
183
|
+
}, mt = (e) => {
|
|
184
|
+
L(V(e.target));
|
|
183
185
|
}, ut = (e) => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (i.target.closest(t)) {
|
|
189
|
-
const o = g.get(e);
|
|
186
|
+
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(",");
|
|
187
|
+
e.addEventListener("click", (o) => {
|
|
188
|
+
if (o.target.closest(t)) {
|
|
189
|
+
const r = g.get(e);
|
|
190
190
|
if (e.noValidate)
|
|
191
191
|
return;
|
|
192
|
-
|
|
192
|
+
r.size && Array.from(r).reverse().map((m) => c.get(m).reportValidity()).includes(!1) && o.preventDefault();
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
-
},
|
|
195
|
+
}, ft = (e) => {
|
|
196
196
|
const t = g.get(e.target);
|
|
197
|
-
t && t.size && t.forEach((
|
|
198
|
-
|
|
197
|
+
t && t.size && t.forEach((o) => {
|
|
198
|
+
o.constructor.formAssociated && o.formResetCallback && o.formResetCallback.apply(o);
|
|
199
199
|
});
|
|
200
|
-
}, et = (e, t,
|
|
200
|
+
}, et = (e, t, o) => {
|
|
201
201
|
if (t) {
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
204
|
-
|
|
202
|
+
const i = g.get(t);
|
|
203
|
+
if (i)
|
|
204
|
+
i.add(e);
|
|
205
205
|
else {
|
|
206
|
-
const
|
|
207
|
-
|
|
206
|
+
const r = /* @__PURE__ */ new Set();
|
|
207
|
+
r.add(e), g.set(t, r), ut(t), t.addEventListener("reset", ft), t.addEventListener("input", pt), t.addEventListener("change", mt);
|
|
208
208
|
}
|
|
209
|
-
w.set(t, { ref: e, internals:
|
|
209
|
+
w.set(t, { ref: e, internals: o }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
210
210
|
e.formAssociatedCallback.apply(e, [t]);
|
|
211
|
-
}, 0),
|
|
211
|
+
}, 0), L(t);
|
|
212
212
|
}
|
|
213
213
|
}, V = (e) => {
|
|
214
214
|
let t = e.parentNode;
|
|
215
215
|
return t && t.tagName !== "FORM" && (t = V(t)), t;
|
|
216
|
-
}, x = (e, t,
|
|
216
|
+
}, x = (e, t, o = DOMException) => {
|
|
217
217
|
if (!e.constructor.formAssociated)
|
|
218
|
-
throw new
|
|
219
|
-
},
|
|
220
|
-
const
|
|
221
|
-
return
|
|
222
|
-
c.get(
|
|
218
|
+
throw new o(t);
|
|
219
|
+
}, ot = (e, t, o) => {
|
|
220
|
+
const i = g.get(e);
|
|
221
|
+
return i && i.size && i.forEach((r) => {
|
|
222
|
+
c.get(r)[o]() || (t = !1);
|
|
223
223
|
}), t;
|
|
224
|
-
},
|
|
224
|
+
}, it = (e) => {
|
|
225
225
|
if (e.constructor.formAssociated) {
|
|
226
|
-
const t = c.get(e), { labels:
|
|
227
|
-
tt(e,
|
|
226
|
+
const t = c.get(e), { labels: o, form: i } = t;
|
|
227
|
+
tt(e, o), et(e, i, t);
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
230
|
function N() {
|
|
@@ -235,13 +235,13 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
235
235
|
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);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
const yt = (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), wt = (e, t,
|
|
238
|
+
const yt = (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), wt = (e, t, o) => (e.valid = xt(t), Object.keys(t).forEach((i) => e[i] = t[i]), o && L(o), e), xt = (e) => {
|
|
239
239
|
let t = !0;
|
|
240
|
-
for (let
|
|
241
|
-
|
|
240
|
+
for (let o in e)
|
|
241
|
+
o !== "valid" && e[o] !== !1 && (t = !1);
|
|
242
242
|
return t;
|
|
243
243
|
}, W = /* @__PURE__ */ new WeakMap();
|
|
244
|
-
function
|
|
244
|
+
function rt(e, t) {
|
|
245
245
|
e.toggleAttribute(t, !0), e.part && e.part.add(t);
|
|
246
246
|
}
|
|
247
247
|
class $ extends Set {
|
|
@@ -256,10 +256,10 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
256
256
|
add(t) {
|
|
257
257
|
if (!/^--/.test(t) || typeof t != "string")
|
|
258
258
|
throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
|
|
259
|
-
const
|
|
260
|
-
return
|
|
261
|
-
|
|
262
|
-
}),
|
|
259
|
+
const o = super.add(t), i = W.get(this), r = `state${t}`;
|
|
260
|
+
return i.isConnected ? rt(i, r) : setTimeout(() => {
|
|
261
|
+
rt(i, r);
|
|
262
|
+
}), o;
|
|
263
263
|
}
|
|
264
264
|
clear() {
|
|
265
265
|
for (let [t] of this.entries())
|
|
@@ -267,43 +267,43 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
267
267
|
super.clear();
|
|
268
268
|
}
|
|
269
269
|
delete(t) {
|
|
270
|
-
const
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
}),
|
|
270
|
+
const o = super.delete(t), i = W.get(this);
|
|
271
|
+
return i.isConnected ? (i.toggleAttribute(`state${t}`, !1), i.part && i.part.remove(`state${t}`)) : setTimeout(() => {
|
|
272
|
+
i.toggleAttribute(`state${t}`, !1), i.part && i.part.remove(`state${t}`);
|
|
273
|
+
}), o;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
if (
|
|
276
|
+
function nt(e, t, o, i) {
|
|
277
|
+
if (o === "a" && !i)
|
|
278
278
|
throw new TypeError("Private accessor was defined without a getter");
|
|
279
|
-
if (typeof t == "function" ? e !== t || !
|
|
279
|
+
if (typeof t == "function" ? e !== t || !i : !t.has(e))
|
|
280
280
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
281
|
-
return
|
|
281
|
+
return o === "m" ? i : o === "a" ? i.call(e) : i ? i.value : t.get(e);
|
|
282
282
|
}
|
|
283
|
-
function Et(e, t, i, r
|
|
284
|
-
if (
|
|
283
|
+
function Et(e, t, o, i, r) {
|
|
284
|
+
if (i === "m")
|
|
285
285
|
throw new TypeError("Private method is not writable");
|
|
286
|
-
if (
|
|
286
|
+
if (i === "a" && !r)
|
|
287
287
|
throw new TypeError("Private accessor was defined without a setter");
|
|
288
|
-
if (typeof t == "function" ? e !== t || !
|
|
288
|
+
if (typeof t == "function" ? e !== t || !r : !t.has(e))
|
|
289
289
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
290
|
-
return
|
|
290
|
+
return i === "a" ? r.call(e, o) : r ? r.value = o : t.set(e, o), o;
|
|
291
291
|
}
|
|
292
|
-
var
|
|
292
|
+
var F;
|
|
293
293
|
class kt {
|
|
294
294
|
constructor(t) {
|
|
295
|
-
|
|
296
|
-
for (let
|
|
297
|
-
let
|
|
298
|
-
this[
|
|
295
|
+
F.set(this, void 0), Et(this, F, t, "f");
|
|
296
|
+
for (let o = 0; o < t.length; o++) {
|
|
297
|
+
let i = t[o];
|
|
298
|
+
this[o] = i, i.hasAttribute("name") && (this[i.getAttribute("name")] = i);
|
|
299
299
|
}
|
|
300
300
|
Object.freeze(this);
|
|
301
301
|
}
|
|
302
302
|
get length() {
|
|
303
|
-
return
|
|
303
|
+
return nt(this, F, "f").length;
|
|
304
304
|
}
|
|
305
|
-
[(
|
|
306
|
-
return
|
|
305
|
+
[(F = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
306
|
+
return nt(this, F, "f")[Symbol.iterator]();
|
|
307
307
|
}
|
|
308
308
|
item(t) {
|
|
309
309
|
return this[t] == null ? null : this[t];
|
|
@@ -312,126 +312,126 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
312
312
|
return this[t] == null ? null : this[t];
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function Mt() {
|
|
316
316
|
const e = HTMLFormElement.prototype.checkValidity;
|
|
317
|
-
HTMLFormElement.prototype.checkValidity =
|
|
317
|
+
HTMLFormElement.prototype.checkValidity = o;
|
|
318
318
|
const t = HTMLFormElement.prototype.reportValidity;
|
|
319
|
-
HTMLFormElement.prototype.reportValidity =
|
|
320
|
-
function
|
|
319
|
+
HTMLFormElement.prototype.reportValidity = i;
|
|
320
|
+
function o(...s) {
|
|
321
321
|
let l = e.apply(this, s);
|
|
322
|
-
return
|
|
322
|
+
return ot(this, l, "checkValidity");
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function i(...s) {
|
|
325
325
|
let l = t.apply(this, s);
|
|
326
|
-
return
|
|
326
|
+
return ot(this, l, "reportValidity");
|
|
327
327
|
}
|
|
328
|
-
const { get:
|
|
328
|
+
const { get: r } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
329
329
|
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
330
330
|
get(...s) {
|
|
331
|
-
const l =
|
|
332
|
-
if (
|
|
331
|
+
const l = r.call(this, ...s), m = Array.from(g.get(this) || []);
|
|
332
|
+
if (m.length === 0)
|
|
333
333
|
return l;
|
|
334
|
-
const d = Array.from(l).concat(
|
|
334
|
+
const d = Array.from(l).concat(m).sort((E, y) => E.compareDocumentPosition ? E.compareDocumentPosition(y) & 2 ? 1 : -1 : 0);
|
|
335
335
|
return new kt(d);
|
|
336
336
|
}
|
|
337
337
|
});
|
|
338
338
|
}
|
|
339
|
-
class
|
|
339
|
+
class at {
|
|
340
340
|
static get isPolyfilled() {
|
|
341
341
|
return !0;
|
|
342
342
|
}
|
|
343
343
|
constructor(t) {
|
|
344
344
|
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
345
345
|
throw new TypeError("Illegal constructor");
|
|
346
|
-
const
|
|
347
|
-
this.states = new $(t),
|
|
346
|
+
const o = t.getRootNode(), i = new gt();
|
|
347
|
+
this.states = new $(t), n.set(this, t), a.set(this, i), c.set(t, this), dt(t, this), ht(t, this), Object.seal(this), o instanceof DocumentFragment && vt(o);
|
|
348
348
|
}
|
|
349
349
|
checkValidity() {
|
|
350
|
-
const t =
|
|
350
|
+
const t = n.get(this);
|
|
351
351
|
if (x(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
352
352
|
return !0;
|
|
353
|
-
const
|
|
354
|
-
if (!
|
|
355
|
-
const
|
|
353
|
+
const o = a.get(this);
|
|
354
|
+
if (!o.valid) {
|
|
355
|
+
const i = new Event("invalid", {
|
|
356
356
|
bubbles: !1,
|
|
357
357
|
cancelable: !0,
|
|
358
358
|
composed: !1
|
|
359
359
|
});
|
|
360
|
-
t.dispatchEvent(
|
|
360
|
+
t.dispatchEvent(i);
|
|
361
361
|
}
|
|
362
|
-
return
|
|
362
|
+
return o.valid;
|
|
363
363
|
}
|
|
364
364
|
get form() {
|
|
365
|
-
const t =
|
|
365
|
+
const t = n.get(this);
|
|
366
366
|
x(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
367
|
-
let
|
|
368
|
-
return t.constructor.formAssociated === !0 && (
|
|
367
|
+
let o;
|
|
368
|
+
return t.constructor.formAssociated === !0 && (o = V(t)), o;
|
|
369
369
|
}
|
|
370
370
|
get labels() {
|
|
371
|
-
const t =
|
|
371
|
+
const t = n.get(this);
|
|
372
372
|
x(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
373
|
-
const
|
|
374
|
-
return
|
|
373
|
+
const o = t.getAttribute("id"), i = t.getRootNode();
|
|
374
|
+
return i && o ? i.querySelectorAll(`[for="${o}"]`) : [];
|
|
375
375
|
}
|
|
376
376
|
reportValidity() {
|
|
377
|
-
const t =
|
|
377
|
+
const t = n.get(this);
|
|
378
378
|
if (x(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
379
379
|
return !0;
|
|
380
|
-
const
|
|
381
|
-
if (
|
|
380
|
+
const o = this.checkValidity(), i = U.get(this);
|
|
381
|
+
if (i && !t.constructor.formAssociated)
|
|
382
382
|
throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
383
|
-
return !
|
|
383
|
+
return !o && i && (t.focus(), i.focus()), o;
|
|
384
384
|
}
|
|
385
385
|
setFormValue(t) {
|
|
386
|
-
const
|
|
387
|
-
if (x(
|
|
388
|
-
if (
|
|
389
|
-
const
|
|
390
|
-
|
|
386
|
+
const o = n.get(this);
|
|
387
|
+
if (x(o, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), Y(this), t != null && !(t instanceof FormData)) {
|
|
388
|
+
if (o.getAttribute("name")) {
|
|
389
|
+
const i = Z(o, this);
|
|
390
|
+
i.value = t;
|
|
391
391
|
}
|
|
392
392
|
} else
|
|
393
|
-
t != null && t instanceof FormData && Array.from(t).reverse().forEach(([
|
|
394
|
-
if (typeof
|
|
395
|
-
const s = Z(
|
|
396
|
-
s.name =
|
|
393
|
+
t != null && t instanceof FormData && Array.from(t).reverse().forEach(([i, r]) => {
|
|
394
|
+
if (typeof r == "string") {
|
|
395
|
+
const s = Z(o, this);
|
|
396
|
+
s.name = i, s.value = r;
|
|
397
397
|
}
|
|
398
398
|
});
|
|
399
|
-
|
|
399
|
+
z.set(o, t);
|
|
400
400
|
}
|
|
401
|
-
setValidity(t,
|
|
402
|
-
const
|
|
403
|
-
if (x(
|
|
401
|
+
setValidity(t, o, i) {
|
|
402
|
+
const r = n.get(this);
|
|
403
|
+
if (x(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
404
404
|
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
405
|
-
U.set(this,
|
|
406
|
-
const s =
|
|
405
|
+
U.set(this, i);
|
|
406
|
+
const s = a.get(this), l = {};
|
|
407
407
|
for (const E in t)
|
|
408
408
|
l[E] = t[E];
|
|
409
409
|
Object.keys(l).length === 0 && yt(s);
|
|
410
|
-
const
|
|
411
|
-
delete
|
|
412
|
-
const { valid: d } = wt(s,
|
|
413
|
-
if (!d && !
|
|
410
|
+
const m = Object.assign(Object.assign({}, s), l);
|
|
411
|
+
delete m.valid;
|
|
412
|
+
const { valid: d } = wt(s, m, this.form);
|
|
413
|
+
if (!d && !o)
|
|
414
414
|
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.");
|
|
415
|
-
|
|
415
|
+
u.set(this, d ? "" : o), r.isConnected ? (r.toggleAttribute("internals-invalid", !d), r.toggleAttribute("internals-valid", d), r.setAttribute("aria-invalid", `${!d}`)) : A.set(r, this);
|
|
416
416
|
}
|
|
417
417
|
get shadowRoot() {
|
|
418
|
-
const t =
|
|
419
|
-
return
|
|
418
|
+
const t = n.get(this), o = j.get(t);
|
|
419
|
+
return o || null;
|
|
420
420
|
}
|
|
421
421
|
get validationMessage() {
|
|
422
|
-
const t =
|
|
423
|
-
return x(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),
|
|
422
|
+
const t = n.get(this);
|
|
423
|
+
return x(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), u.get(this);
|
|
424
424
|
}
|
|
425
425
|
get validity() {
|
|
426
|
-
const t =
|
|
427
|
-
return x(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),
|
|
426
|
+
const t = n.get(this);
|
|
427
|
+
return x(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), a.get(this);
|
|
428
428
|
}
|
|
429
429
|
get willValidate() {
|
|
430
|
-
const t =
|
|
430
|
+
const t = n.get(this);
|
|
431
431
|
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"));
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function Ct() {
|
|
435
435
|
if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals)
|
|
436
436
|
return !1;
|
|
437
437
|
class e extends HTMLElement {
|
|
@@ -441,7 +441,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
441
441
|
}
|
|
442
442
|
const t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
|
|
443
443
|
customElements.define(t, e);
|
|
444
|
-
const
|
|
444
|
+
const o = new e();
|
|
445
445
|
return [
|
|
446
446
|
"shadowRoot",
|
|
447
447
|
"form",
|
|
@@ -453,27 +453,27 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
453
453
|
"setValidity",
|
|
454
454
|
"checkValidity",
|
|
455
455
|
"reportValidity"
|
|
456
|
-
].every((
|
|
456
|
+
].every((i) => i in o.internals);
|
|
457
457
|
}
|
|
458
458
|
let st = !1, lt = !1;
|
|
459
459
|
function H(e) {
|
|
460
460
|
lt || (lt = !0, window.CustomStateSet = $, e && (HTMLElement.prototype.attachInternals = function(...t) {
|
|
461
|
-
const
|
|
462
|
-
return
|
|
461
|
+
const o = e.call(this, t);
|
|
462
|
+
return o.states = new $(this), o;
|
|
463
463
|
}));
|
|
464
464
|
}
|
|
465
465
|
function ct(e = !0) {
|
|
466
466
|
if (!st) {
|
|
467
|
-
if (st = !0, typeof window < "u" && (window.ElementInternals =
|
|
467
|
+
if (st = !0, typeof window < "u" && (window.ElementInternals = at), typeof CustomElementRegistry < "u") {
|
|
468
468
|
const t = CustomElementRegistry.prototype.define;
|
|
469
|
-
CustomElementRegistry.prototype.define = function(i, r
|
|
470
|
-
if (
|
|
471
|
-
const s =
|
|
472
|
-
|
|
473
|
-
G.has(this) || (G.set(this, !0), this.hasAttribute("disabled") && D(this, !0)), s != null && s.apply(this),
|
|
469
|
+
CustomElementRegistry.prototype.define = function(o, i, r) {
|
|
470
|
+
if (i.formAssociated) {
|
|
471
|
+
const s = i.prototype.connectedCallback;
|
|
472
|
+
i.prototype.connectedCallback = function() {
|
|
473
|
+
G.has(this) || (G.set(this, !0), this.hasAttribute("disabled") && D(this, !0)), s != null && s.apply(this), it(this);
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
|
-
t.call(this, i, r
|
|
476
|
+
t.call(this, o, i, r);
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
479
|
if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
|
|
@@ -484,55 +484,55 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
484
484
|
return {};
|
|
485
485
|
if (c.has(this))
|
|
486
486
|
throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
|
|
487
|
-
return new
|
|
487
|
+
return new at(this);
|
|
488
488
|
}), typeof Element < "u") {
|
|
489
|
-
let t = function(...
|
|
490
|
-
const
|
|
491
|
-
if (j.set(this,
|
|
492
|
-
const s = new MutationObserver(
|
|
493
|
-
window.ShadyDOM ? s.observe(this,
|
|
489
|
+
let t = function(...i) {
|
|
490
|
+
const r = o.apply(this, i);
|
|
491
|
+
if (j.set(this, r), N()) {
|
|
492
|
+
const s = new MutationObserver(_);
|
|
493
|
+
window.ShadyDOM ? s.observe(this, R) : s.observe(r, R), M.set(this, s);
|
|
494
494
|
}
|
|
495
|
-
return
|
|
495
|
+
return r;
|
|
496
496
|
};
|
|
497
|
-
const
|
|
497
|
+
const o = Element.prototype.attachShadow;
|
|
498
498
|
Element.prototype.attachShadow = t;
|
|
499
499
|
}
|
|
500
|
-
N() && typeof document < "u" && new MutationObserver(
|
|
500
|
+
N() && typeof document < "u" && new MutationObserver(_).observe(document.documentElement, R), typeof HTMLFormElement < "u" && Mt(), (e || typeof window < "u" && !window.CustomStateSet) && H();
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
return !!customElements.polyfillWrapFlushCallback || (
|
|
503
|
+
return !!customElements.polyfillWrapFlushCallback || (Ct() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : ct(!1)), k.forceCustomStateSetPolyfill = H, k.forceElementInternalsPolyfill = ct, Object.defineProperty(k, "__esModule", { value: !0 }), k;
|
|
504
504
|
})({});
|
|
505
505
|
})();
|
|
506
|
-
var Ot = Object.defineProperty,
|
|
507
|
-
for (var c =
|
|
508
|
-
(w = k[
|
|
509
|
-
return
|
|
506
|
+
var Ot = Object.defineProperty, _t = Object.getOwnPropertyDescriptor, p = (k, n, a, v) => {
|
|
507
|
+
for (var c = v > 1 ? void 0 : v ? _t(n, a) : n, u = k.length - 1, w; u >= 0; u--)
|
|
508
|
+
(w = k[u]) && (c = (v ? w(n, a, c) : w(c)) || c);
|
|
509
|
+
return v && c && Ot(n, a, c), c;
|
|
510
510
|
};
|
|
511
|
-
const
|
|
512
|
-
class
|
|
511
|
+
const S = "pie-button";
|
|
512
|
+
class b extends At(zt) {
|
|
513
513
|
constructor() {
|
|
514
|
-
super(...arguments), this.size =
|
|
515
|
-
if (!(
|
|
516
|
-
if (
|
|
517
|
-
const
|
|
518
|
-
if (
|
|
514
|
+
super(...arguments), 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 = (n) => {
|
|
515
|
+
if (!(n.key !== "Enter" || this.type !== "submit" || this.disabled)) {
|
|
516
|
+
if (n.target instanceof HTMLElement) {
|
|
517
|
+
const a = n.target.tagName.toLowerCase();
|
|
518
|
+
if (a === "button" || a === "pie-button")
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
521
|
-
|
|
521
|
+
n.preventDefault(), this._handleClick();
|
|
522
522
|
}
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
525
|
connectedCallback() {
|
|
526
|
-
var
|
|
527
|
-
super.connectedCallback(), this.type === "submit" && ((
|
|
526
|
+
var n;
|
|
527
|
+
super.connectedCallback(), this.type === "submit" && ((n = this.form) == null || n.addEventListener("keydown", this._handleFormKeyDown));
|
|
528
528
|
}
|
|
529
529
|
disconnectedCallback() {
|
|
530
|
-
var
|
|
531
|
-
super.disconnectedCallback(), this.type === "submit" && ((
|
|
530
|
+
var n;
|
|
531
|
+
super.disconnectedCallback(), this.type === "submit" && ((n = this.form) == null || n.removeEventListener("keydown", this._handleFormKeyDown));
|
|
532
532
|
}
|
|
533
|
-
updated(
|
|
534
|
-
var
|
|
535
|
-
super.updated(
|
|
533
|
+
updated(n) {
|
|
534
|
+
var a, v;
|
|
535
|
+
super.updated(n), n.has("type") && (this.type === "submit" ? (a = this.form) == null || a.addEventListener("keydown", this._handleFormKeyDown) : (v = this.form) == null || v.removeEventListener("keydown", this._handleFormKeyDown));
|
|
536
536
|
}
|
|
537
537
|
/**
|
|
538
538
|
* This method creates an invisible button of the same type as pie-button. It is then clicked, and immediately removed from the DOM.
|
|
@@ -542,11 +542,11 @@ class v extends St(Ct) {
|
|
|
542
542
|
*
|
|
543
543
|
* TODO: if we need to repeat this logic elsewhere, then we should consider moving this code to a shared class or mixin.
|
|
544
544
|
*/
|
|
545
|
-
_simulateNativeButtonClick(
|
|
545
|
+
_simulateNativeButtonClick(n) {
|
|
546
546
|
if (!this.form)
|
|
547
547
|
return;
|
|
548
|
-
const
|
|
549
|
-
|
|
548
|
+
const a = document.createElement("button");
|
|
549
|
+
a.type = n, a.style.position = "absolute", a.style.width = "1px", a.style.height = "1px", a.style.padding = "0", a.style.margin = "-1px", a.style.overflow = "hidden", a.style.border = "0", a.style.whiteSpace = "nowrap", n === "submit" && (this.name && (a.name = this.name), this.value && (a.value = this.value), this.formaction && a.setAttribute("formaction", this.formaction), this.formenctype && a.setAttribute("formenctype", this.formenctype), this.formmethod && a.setAttribute("formmethod", this.formmethod), this.formnovalidate && a.setAttribute("formnovalidate", "formnovalidate"), this.formtarget && a.setAttribute("formtarget", this.formtarget)), this.form.append(a), a.click(), a.remove();
|
|
550
550
|
}
|
|
551
551
|
_handleClick() {
|
|
552
552
|
!this.isLoading && this.form && (this.type === "submit" && (this.formnovalidate || this.form.reportValidity()) && this._simulateNativeButtonClick("submit"), this.type === "reset" && this._simulateNativeButtonClick("reset"));
|
|
@@ -557,38 +557,40 @@ class v extends St(Ct) {
|
|
|
557
557
|
* @private
|
|
558
558
|
*/
|
|
559
559
|
renderSpinner() {
|
|
560
|
-
const { size:
|
|
561
|
-
let
|
|
562
|
-
return
|
|
560
|
+
const { size: n, variant: a, disabled: v } = this, c = n && n.includes("small") ? "small" : "medium";
|
|
561
|
+
let u;
|
|
562
|
+
return v ? u = a === "ghost-inverse" ? "inverse" : "secondary" : u = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", P`
|
|
563
563
|
<pie-spinner
|
|
564
564
|
size="${c}"
|
|
565
|
-
variant="${
|
|
565
|
+
variant="${u}">
|
|
566
566
|
</pie-spinner>`;
|
|
567
567
|
}
|
|
568
568
|
render() {
|
|
569
569
|
const {
|
|
570
|
-
type:
|
|
571
|
-
disabled:
|
|
572
|
-
isFullWidth:
|
|
570
|
+
type: n,
|
|
571
|
+
disabled: a,
|
|
572
|
+
isFullWidth: v,
|
|
573
573
|
variant: c,
|
|
574
|
-
size:
|
|
574
|
+
size: u,
|
|
575
575
|
isLoading: w,
|
|
576
|
-
isResponsive:
|
|
576
|
+
isResponsive: M,
|
|
577
577
|
iconPlacement: g,
|
|
578
|
-
responsiveSize:
|
|
579
|
-
} = this
|
|
578
|
+
responsiveSize: z
|
|
579
|
+
} = this, C = {
|
|
580
|
+
"o-btn": !0,
|
|
581
|
+
"o-btn--fullWidth": v,
|
|
582
|
+
"o-btn--responsive": M,
|
|
583
|
+
[`o-btn--${z}`]: !!(M && z),
|
|
584
|
+
[`o-btn--${c}`]: !0,
|
|
585
|
+
[`o-btn--${u}`]: !0,
|
|
586
|
+
"is-loading": w
|
|
587
|
+
};
|
|
580
588
|
return P`
|
|
581
589
|
<button
|
|
582
590
|
@click=${this._handleClick}
|
|
583
|
-
class
|
|
584
|
-
type=${
|
|
585
|
-
|
|
586
|
-
size=${f || "medium"}
|
|
587
|
-
responsiveSize=${Lt(F)}
|
|
588
|
-
?disabled=${n}
|
|
589
|
-
?isFullWidth=${h}
|
|
590
|
-
?isResponsive=${z}
|
|
591
|
-
?isLoading=${w}>
|
|
591
|
+
class=${St(C)}
|
|
592
|
+
type=${n || "submit"}
|
|
593
|
+
?disabled=${a}>
|
|
592
594
|
${w ? this.renderSpinner() : K}
|
|
593
595
|
${g === "leading" ? P`<slot name="icon"></slot>` : K}
|
|
594
596
|
<slot></slot>
|
|
@@ -596,73 +598,73 @@ class v extends St(Ct) {
|
|
|
596
598
|
</button>`;
|
|
597
599
|
}
|
|
598
600
|
focus() {
|
|
599
|
-
var
|
|
600
|
-
(
|
|
601
|
+
var n, a;
|
|
602
|
+
(a = (n = this.shadowRoot) == null ? void 0 : n.querySelector("button")) == null || a.focus();
|
|
601
603
|
}
|
|
602
604
|
}
|
|
603
|
-
|
|
605
|
+
b.styles = Ft(Pt);
|
|
604
606
|
p([
|
|
605
|
-
|
|
606
|
-
O(
|
|
607
|
-
],
|
|
607
|
+
h(),
|
|
608
|
+
O(S, Tt, f.size)
|
|
609
|
+
], b.prototype, "size", 2);
|
|
608
610
|
p([
|
|
609
|
-
|
|
610
|
-
O(
|
|
611
|
-
],
|
|
611
|
+
h(),
|
|
612
|
+
O(S, Lt, f.type)
|
|
613
|
+
], b.prototype, "type", 2);
|
|
612
614
|
p([
|
|
613
|
-
|
|
614
|
-
O(
|
|
615
|
-
],
|
|
615
|
+
h(),
|
|
616
|
+
O(S, Vt, f.variant)
|
|
617
|
+
], b.prototype, "variant", 2);
|
|
616
618
|
p([
|
|
617
|
-
|
|
618
|
-
O(
|
|
619
|
-
],
|
|
619
|
+
h({ type: String }),
|
|
620
|
+
O(S, Nt, f.iconPlacement)
|
|
621
|
+
], b.prototype, "iconPlacement", 2);
|
|
620
622
|
p([
|
|
621
|
-
|
|
622
|
-
],
|
|
623
|
+
h({ type: Boolean })
|
|
624
|
+
], b.prototype, "disabled", 2);
|
|
623
625
|
p([
|
|
624
|
-
|
|
625
|
-
],
|
|
626
|
+
h({ type: Boolean, reflect: !0 })
|
|
627
|
+
], b.prototype, "isLoading", 2);
|
|
626
628
|
p([
|
|
627
|
-
|
|
628
|
-
],
|
|
629
|
+
h({ type: Boolean })
|
|
630
|
+
], b.prototype, "isFullWidth", 2);
|
|
629
631
|
p([
|
|
630
|
-
|
|
631
|
-
],
|
|
632
|
+
h({ type: Boolean })
|
|
633
|
+
], b.prototype, "isResponsive", 2);
|
|
632
634
|
p([
|
|
633
|
-
|
|
634
|
-
],
|
|
635
|
+
h({ type: String })
|
|
636
|
+
], b.prototype, "name", 2);
|
|
635
637
|
p([
|
|
636
|
-
|
|
637
|
-
],
|
|
638
|
+
h({ type: String })
|
|
639
|
+
], b.prototype, "value", 2);
|
|
638
640
|
p([
|
|
639
|
-
|
|
640
|
-
],
|
|
641
|
+
h()
|
|
642
|
+
], b.prototype, "formaction", 2);
|
|
641
643
|
p([
|
|
642
|
-
|
|
643
|
-
],
|
|
644
|
+
h()
|
|
645
|
+
], b.prototype, "formenctype", 2);
|
|
644
646
|
p([
|
|
645
|
-
|
|
646
|
-
],
|
|
647
|
+
h()
|
|
648
|
+
], b.prototype, "formmethod", 2);
|
|
647
649
|
p([
|
|
648
|
-
|
|
649
|
-
],
|
|
650
|
+
h({ type: Boolean })
|
|
651
|
+
], b.prototype, "formnovalidate", 2);
|
|
650
652
|
p([
|
|
651
|
-
|
|
652
|
-
],
|
|
653
|
+
h()
|
|
654
|
+
], b.prototype, "formtarget", 2);
|
|
653
655
|
p([
|
|
654
|
-
|
|
655
|
-
],
|
|
656
|
-
|
|
656
|
+
h({ type: String })
|
|
657
|
+
], b.prototype, "responsiveSize", 2);
|
|
658
|
+
It(S, b);
|
|
657
659
|
export {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
+
b as PieButton,
|
|
661
|
+
f as defaultProps,
|
|
660
662
|
jt as formEncodingtypes,
|
|
661
663
|
Ut as formMethodTypes,
|
|
662
664
|
qt as formTargetTypes,
|
|
663
665
|
Nt as iconPlacements,
|
|
664
666
|
Kt as responsiveSizes,
|
|
665
|
-
|
|
666
|
-
|
|
667
|
+
Tt as sizes,
|
|
668
|
+
Lt as types,
|
|
667
669
|
Vt as variants
|
|
668
670
|
};
|
package/dist/react.js
CHANGED
|
@@ -3,8 +3,8 @@ import { createComponent as e } from "@lit/react";
|
|
|
3
3
|
import { PieButton as o } from "./index.js";
|
|
4
4
|
import { defaultProps as l, formEncodingtypes as y, formMethodTypes as B, formTargetTypes as d, iconPlacements as g, responsiveSizes as v, sizes as T, types as x, variants as z } from "./index.js";
|
|
5
5
|
import "lit";
|
|
6
|
+
import "lit/directives/class-map.js";
|
|
6
7
|
import "lit/decorators.js";
|
|
7
|
-
import "lit/directives/if-defined.js";
|
|
8
8
|
import "@justeattakeaway/pie-webc-core";
|
|
9
9
|
import "@justeattakeaway/pie-spinner";
|
|
10
10
|
const r = e({
|
package/package.json
CHANGED
package/src/button.scss
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
@use '@justeattakeaway/pie-css/scss' as p;
|
|
2
|
-
|
|
3
|
-
$breakpoint-wide: 768px;
|
|
2
|
+
@use '@justeattakeaway/pie-css/scss/settings' as *;
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Mixin for adding the responsive behaviour.
|
|
7
6
|
* Takes in the the particular settings for the wide breakpoint.
|
|
8
7
|
*/
|
|
9
8
|
@mixin responsive-wide {
|
|
10
|
-
|
|
11
|
-
@media
|
|
9
|
+
&.o-btn--responsive {
|
|
10
|
+
@include media('>md') {
|
|
12
11
|
@content;
|
|
13
12
|
}
|
|
14
13
|
}
|
|
@@ -94,12 +93,14 @@ $breakpoint-wide: 768px;
|
|
|
94
93
|
// used to specify whether the button should be full width or not
|
|
95
94
|
inline-size: var(--btn-inline-size);
|
|
96
95
|
|
|
97
|
-
//
|
|
98
|
-
|
|
96
|
+
// ************************
|
|
97
|
+
// Button Variant Modifiers
|
|
98
|
+
// ************************
|
|
99
|
+
&.o-btn--primary {
|
|
99
100
|
@include p.button-interactive-states('--dt-color-interactive-brand');
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
&.o-btn--xsmall,
|
|
103
|
+
&.o-btn--small-productive {
|
|
103
104
|
/**
|
|
104
105
|
* Where the font-size is smaller,
|
|
105
106
|
* update the button backgrounds so that the text is accessible
|
|
@@ -108,16 +109,27 @@ $breakpoint-wide: 768px;
|
|
|
108
109
|
|
|
109
110
|
@include p.button-interactive-states('--dt-color-interactive-primary', 'inverse');
|
|
110
111
|
}
|
|
112
|
+
|
|
113
|
+
// This is to handle the background colour change getting overridden above, but then being put in responsive mode
|
|
114
|
+
// can't use :not for this unfortunately, as then the smaller narrow state would lose its background colour too
|
|
115
|
+
&.o-btn--xsmall.o-btn--expressive,
|
|
116
|
+
&.o-btn--small-productive {
|
|
117
|
+
@include responsive-wide {
|
|
118
|
+
--btn-bg-color: var(--dt-color-interactive-brand);
|
|
119
|
+
|
|
120
|
+
@include p.button-interactive-states('--dt-color-interactive-brand');
|
|
121
|
+
}
|
|
122
|
+
}
|
|
111
123
|
}
|
|
112
124
|
|
|
113
|
-
|
|
125
|
+
&.o-btn--secondary {
|
|
114
126
|
--btn-bg-color: var(--dt-color-interactive-secondary);
|
|
115
127
|
--btn-text-color: var(--dt-color-content-interactive-secondary);
|
|
116
128
|
|
|
117
129
|
@include p.button-interactive-states('--dt-color-interactive-secondary');
|
|
118
130
|
}
|
|
119
131
|
|
|
120
|
-
|
|
132
|
+
&.o-btn--outline {
|
|
121
133
|
--btn-bg-color: transparent;
|
|
122
134
|
--btn-text-color: var(--dt-color-content-interactive-secondary);
|
|
123
135
|
|
|
@@ -128,7 +140,7 @@ $breakpoint-wide: 768px;
|
|
|
128
140
|
@include p.button-interactive-states('--dt-color-black', 'transparent');
|
|
129
141
|
}
|
|
130
142
|
|
|
131
|
-
|
|
143
|
+
&.o-btn--ghost {
|
|
132
144
|
--btn-bg-color: transparent;
|
|
133
145
|
--btn-text-color: var(--dt-color-content-link);
|
|
134
146
|
|
|
@@ -137,15 +149,15 @@ $breakpoint-wide: 768px;
|
|
|
137
149
|
@include p.button-interactive-states('--dt-color-black', 'transparent');
|
|
138
150
|
}
|
|
139
151
|
|
|
140
|
-
|
|
152
|
+
&.o-btn--inverse {
|
|
141
153
|
--btn-bg-color: var(--dt-color-interactive-inverse);
|
|
142
154
|
--btn-text-color: var(--dt-color-content-interactive-secondary);
|
|
143
155
|
|
|
144
156
|
@include p.button-interactive-states('--dt-color-interactive-inverse');
|
|
145
157
|
}
|
|
146
158
|
|
|
147
|
-
|
|
148
|
-
|
|
159
|
+
&.o-btn--ghost-inverse,
|
|
160
|
+
&.o-btn--outline-inverse {
|
|
149
161
|
--btn-bg-color: transparent;
|
|
150
162
|
--btn-text-color: var(--dt-color-content-interactive-primary);
|
|
151
163
|
|
|
@@ -154,17 +166,17 @@ $breakpoint-wide: 768px;
|
|
|
154
166
|
@include p.button-interactive-states('--dt-color-container-default', 'transparent');
|
|
155
167
|
}
|
|
156
168
|
|
|
157
|
-
|
|
169
|
+
&.o-btn--outline-inverse:not([disabled]) {
|
|
158
170
|
border: 1px solid var(--dt-color-border-strong);
|
|
159
171
|
}
|
|
160
172
|
|
|
161
|
-
|
|
173
|
+
&.o-btn--destructive {
|
|
162
174
|
--btn-bg-color: var(--dt-color-support-error);
|
|
163
175
|
|
|
164
176
|
@include p.button-interactive-states('--dt-color-support-error');
|
|
165
177
|
}
|
|
166
178
|
|
|
167
|
-
|
|
179
|
+
&.o-btn--destructive-ghost {
|
|
168
180
|
--btn-bg-color: transparent;
|
|
169
181
|
--btn-text-color: var(--dt-color-content-interactive-error);
|
|
170
182
|
|
|
@@ -173,65 +185,80 @@ $breakpoint-wide: 768px;
|
|
|
173
185
|
@include p.button-interactive-states('--dt-color-black', 'transparent');
|
|
174
186
|
}
|
|
175
187
|
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
&[disabled] {
|
|
182
|
-
--btn-text-color: var(--dt-color-content-disabled) !important;
|
|
183
|
-
|
|
184
|
-
cursor: not-allowed;
|
|
185
|
-
|
|
186
|
-
// For every variant (except ghost variants) set the disabled background color
|
|
187
|
-
&:not([variant='ghost'], [variant='ghost-inverse'], [variant='destructive-ghost']) {
|
|
188
|
-
--btn-bg-color: var(--dt-color-disabled-01) !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// For outline variants, set the border to the disabled color
|
|
192
|
-
&[variant='outline'] {
|
|
193
|
-
border-color: var(--dt-color-disabled-01) !important;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
&[size='xsmall'] {
|
|
188
|
+
// *********************
|
|
189
|
+
// Button Size Modifiers
|
|
190
|
+
// *********************
|
|
191
|
+
&.o-btn--xsmall {
|
|
198
192
|
@include button-size(xsmall);
|
|
193
|
+
|
|
199
194
|
@include responsive-wide {
|
|
200
195
|
// productive is the default size when responsive is enabled
|
|
201
196
|
@include button-size(small-productive);
|
|
202
197
|
|
|
203
|
-
|
|
198
|
+
&.o-btn--expressive {
|
|
204
199
|
@include button-size(small-expressive);
|
|
205
200
|
}
|
|
206
201
|
}
|
|
207
202
|
}
|
|
208
203
|
|
|
209
|
-
|
|
204
|
+
&.o-btn--small-expressive {
|
|
210
205
|
@include button-size(small-expressive);
|
|
206
|
+
|
|
211
207
|
@include responsive-wide {
|
|
212
208
|
@include button-size(medium);
|
|
213
209
|
}
|
|
214
210
|
}
|
|
215
211
|
|
|
216
|
-
|
|
212
|
+
&.o-btn--small-productive {
|
|
217
213
|
@include button-size(small-productive);
|
|
214
|
+
|
|
218
215
|
@include responsive-wide {
|
|
219
216
|
@include button-size(medium);
|
|
220
217
|
}
|
|
221
218
|
}
|
|
222
219
|
|
|
223
|
-
|
|
220
|
+
&.o-btn--medium {
|
|
224
221
|
@include button-size(medium);
|
|
222
|
+
|
|
225
223
|
@include responsive-wide {
|
|
226
224
|
@include button-size(large);
|
|
227
225
|
}
|
|
228
226
|
}
|
|
229
227
|
|
|
230
|
-
|
|
228
|
+
&.o-btn--large {
|
|
231
229
|
@include button-size(large);
|
|
232
230
|
}
|
|
233
231
|
|
|
234
|
-
|
|
232
|
+
// ******************************
|
|
233
|
+
// Additional component modifiers
|
|
234
|
+
// ******************************
|
|
235
|
+
&.o-btn--fullWidth {
|
|
236
|
+
--btn-inline-size: 100%;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// **************
|
|
240
|
+
// Disabled state
|
|
241
|
+
// **************
|
|
242
|
+
&[disabled] {
|
|
243
|
+
--btn-text-color: var(--dt-color-content-disabled) !important;
|
|
244
|
+
|
|
245
|
+
cursor: not-allowed;
|
|
246
|
+
|
|
247
|
+
// For every variant (except ghost variants) set the disabled background color
|
|
248
|
+
&:not(.o-btn--ghost, .o-btn--ghost-inverse, .o-btn--destructive-ghost) {
|
|
249
|
+
--btn-bg-color: var(--dt-color-disabled-01) !important;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// For outline variants, set the border to the disabled color
|
|
253
|
+
&.o-btn--outline {
|
|
254
|
+
border-color: var(--dt-color-disabled-01) !important;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// *************
|
|
259
|
+
// Loading state
|
|
260
|
+
// *************
|
|
261
|
+
&.is-loading {
|
|
235
262
|
& > *:not(pie-spinner) {
|
|
236
263
|
visibility: hidden;
|
|
237
264
|
}
|
|
@@ -241,6 +268,9 @@ $breakpoint-wide: 768px;
|
|
|
241
268
|
}
|
|
242
269
|
}
|
|
243
270
|
|
|
271
|
+
// ************
|
|
272
|
+
// Focus styles
|
|
273
|
+
// ************
|
|
244
274
|
&:focus-visible {
|
|
245
275
|
@include p.focus;
|
|
246
276
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LitElement, html, unsafeCSS, nothing, PropertyValues, TemplateResult,
|
|
3
3
|
} from 'lit';
|
|
4
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
5
|
import { property } from 'lit/decorators.js';
|
|
5
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
6
|
import { validPropertyValues, defineCustomElement, FormControlMixin } from '@justeattakeaway/pie-webc-core';
|
|
7
7
|
import {
|
|
8
8
|
ButtonProps, sizes, types, variants, iconPlacements, defaultProps,
|
|
@@ -226,18 +226,22 @@ export class PieButton extends FormControlMixin(LitElement) implements ButtonPro
|
|
|
226
226
|
responsiveSize,
|
|
227
227
|
} = this;
|
|
228
228
|
|
|
229
|
+
const classes = {
|
|
230
|
+
'o-btn': true,
|
|
231
|
+
'o-btn--fullWidth': isFullWidth,
|
|
232
|
+
'o-btn--responsive': isResponsive,
|
|
233
|
+
[`o-btn--${responsiveSize}`]: Boolean(isResponsive && responsiveSize),
|
|
234
|
+
[`o-btn--${variant}`]: true,
|
|
235
|
+
[`o-btn--${size}`]: true,
|
|
236
|
+
'is-loading': isLoading,
|
|
237
|
+
};
|
|
238
|
+
|
|
229
239
|
return html`
|
|
230
240
|
<button
|
|
231
241
|
@click=${this._handleClick}
|
|
232
|
-
class
|
|
242
|
+
class=${classMap(classes)}
|
|
233
243
|
type=${type || 'submit'}
|
|
234
|
-
|
|
235
|
-
size=${size || 'medium'}
|
|
236
|
-
responsiveSize=${ifDefined(responsiveSize)}
|
|
237
|
-
?disabled=${disabled}
|
|
238
|
-
?isFullWidth=${isFullWidth}
|
|
239
|
-
?isResponsive=${isResponsive}
|
|
240
|
-
?isLoading=${isLoading}>
|
|
244
|
+
?disabled=${disabled}>
|
|
241
245
|
${isLoading ? this.renderSpinner() : nothing}
|
|
242
246
|
${iconPlacement === 'leading' ? html`<slot name="icon"></slot>` : nothing}
|
|
243
247
|
<slot></slot>
|