@justeattakeaway/pie-button 0.47.5 → 0.47.7
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 -5
- package/dist/index.js +108 -107
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -21,16 +21,14 @@ This component can be easily integrated into various frontend frameworks and cus
|
|
|
21
21
|
To install `pie-button` in your application, run the following on your command line:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
25
|
-
$ npm i @justeattakeaway/pie-button
|
|
24
|
+
npm i @justeattakeaway/pie-button
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
$ yarn add @justeattakeaway/pie-button
|
|
26
|
+
yarn add @justeattakeaway/pie-button
|
|
29
27
|
```
|
|
30
28
|
|
|
31
29
|
## Documentation
|
|
32
30
|
|
|
33
|
-
Visit [Button | PIE Design System](https://pie.design/components/button
|
|
31
|
+
Visit [Button | PIE Design System](https://pie.design/components/button) to view more information on this component.
|
|
34
32
|
|
|
35
33
|
## Questions
|
|
36
34
|
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LitElement as Ct, html as
|
|
2
|
-
import { property as
|
|
1
|
+
import { LitElement as Ct, html as P, nothing as K, unsafeCSS as Ft } from "lit";
|
|
2
|
+
import { property as m } from "lit/decorators.js";
|
|
3
3
|
import { ifDefined as Lt } from "lit/directives/if-defined.js";
|
|
4
|
-
import { FormControlMixin as St, validPropertyValues as
|
|
4
|
+
import { FormControlMixin as St, validPropertyValues as O, defineCustomElement as At } from "@justeattakeaway/pie-webc-core";
|
|
5
5
|
import "@justeattakeaway/pie-spinner";
|
|
6
6
|
const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Kt = ["productive", "expressive"], Tt = ["submit", "button", "reset"], Vt = [
|
|
7
7
|
"primary",
|
|
@@ -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
|
-
],
|
|
16
|
+
], Nt = ["leading", "trailing"], jt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Ut = ["post", "get", "dialog"], qt = ["_self", "_blank", "_parent", "_top"], b = {
|
|
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
|
-
}, Nt = `*,*: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[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)}
|
|
26
26
|
`;
|
|
27
27
|
(function() {
|
|
28
28
|
(function(k) {
|
|
29
|
-
const a = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(),
|
|
29
|
+
const a = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), A = {
|
|
30
30
|
ariaAtomic: "aria-atomic",
|
|
31
31
|
ariaAutoComplete: "aria-autocomplete",
|
|
32
32
|
ariaBusy: "aria-busy",
|
|
@@ -36,6 +36,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
36
36
|
ariaColIndexText: "aria-colindextext",
|
|
37
37
|
ariaColSpan: "aria-colspan",
|
|
38
38
|
ariaCurrent: "aria-current",
|
|
39
|
+
ariaDescription: "aria-description",
|
|
39
40
|
ariaDisabled: "aria-disabled",
|
|
40
41
|
ariaExpanded: "aria-expanded",
|
|
41
42
|
ariaHasPopup: "aria-haspopup",
|
|
@@ -69,16 +70,16 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
69
70
|
ariaValueText: "aria-valuetext",
|
|
70
71
|
role: "role"
|
|
71
72
|
}, dt = (e, t) => {
|
|
72
|
-
for (let i in
|
|
73
|
+
for (let i in A) {
|
|
73
74
|
t[i] = null;
|
|
74
75
|
let r = null;
|
|
75
|
-
const o =
|
|
76
|
+
const o = A[i];
|
|
76
77
|
Object.defineProperty(t, i, {
|
|
77
78
|
get() {
|
|
78
79
|
return r;
|
|
79
80
|
},
|
|
80
81
|
set(s) {
|
|
81
|
-
r = s, e.isConnected ? e.setAttribute(o, s) :
|
|
82
|
+
r = s, e.isConnected ? e.setAttribute(o, s) : L.set(e, t);
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
}
|
|
@@ -96,30 +97,30 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
96
97
|
let r = i.nextNode();
|
|
97
98
|
const o = !t || e.disabled;
|
|
98
99
|
for (; r; )
|
|
99
|
-
r.formDisabledCallback && o &&
|
|
100
|
-
}, X = { attributes: !0, attributeFilter: ["disabled", "name"] },
|
|
100
|
+
r.formDisabledCallback && o && D(r, e.disabled), r = i.nextNode();
|
|
101
|
+
}, X = { attributes: !0, attributeFilter: ["disabled", "name"] }, I = N() ? new MutationObserver((e) => {
|
|
101
102
|
for (const t of e) {
|
|
102
103
|
const i = t.target;
|
|
103
|
-
if (t.attributeName === "disabled" && (i.constructor.formAssociated ?
|
|
104
|
-
const r = c.get(i), o =
|
|
104
|
+
if (t.attributeName === "disabled" && (i.constructor.formAssociated ? D(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && Q(i)), t.attributeName === "name" && i.constructor.formAssociated) {
|
|
105
|
+
const r = c.get(i), o = F.get(i);
|
|
105
106
|
r.setFormValue(o);
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
}) : {};
|
|
109
|
-
function
|
|
110
|
+
function R(e) {
|
|
110
111
|
e.forEach((t) => {
|
|
111
112
|
const { addedNodes: i, removedNodes: r } = t, o = Array.from(i), s = Array.from(r);
|
|
112
113
|
o.forEach((l) => {
|
|
113
114
|
var u;
|
|
114
|
-
if (c.has(l) && l.constructor.formAssociated && J(l),
|
|
115
|
-
const d =
|
|
116
|
-
Object.keys(
|
|
117
|
-
l.setAttribute(
|
|
118
|
-
}),
|
|
115
|
+
if (c.has(l) && l.constructor.formAssociated && J(l), L.has(l)) {
|
|
116
|
+
const d = L.get(l);
|
|
117
|
+
Object.keys(A).filter((y) => d[y] !== null).forEach((y) => {
|
|
118
|
+
l.setAttribute(A[y], d[y]);
|
|
119
|
+
}), L.delete(l);
|
|
119
120
|
}
|
|
120
|
-
if (
|
|
121
|
-
const d =
|
|
122
|
-
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 (S.has(l)) {
|
|
122
|
+
const d = S.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()), S.delete(l);
|
|
123
124
|
}
|
|
124
125
|
if (l.localName === "form") {
|
|
125
126
|
const d = g.get(l), E = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
|
|
@@ -131,10 +132,10 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
131
132
|
for (; y; )
|
|
132
133
|
J(y), y = E.nextNode();
|
|
133
134
|
}
|
|
134
|
-
l.localName === "fieldset" && ((u =
|
|
135
|
+
l.localName === "fieldset" && ((u = I.observe) === null || u === void 0 || u.call(I, l, X), Q(l, !0));
|
|
135
136
|
}), s.forEach((l) => {
|
|
136
137
|
const u = c.get(l);
|
|
137
|
-
u && h.get(u) && Y(u),
|
|
138
|
+
u && h.get(u) && Y(u), z.has(l) && z.get(l).disconnect();
|
|
138
139
|
});
|
|
139
140
|
});
|
|
140
141
|
}
|
|
@@ -142,21 +143,21 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
142
143
|
e.forEach((t) => {
|
|
143
144
|
const { removedNodes: i } = t;
|
|
144
145
|
i.forEach((r) => {
|
|
145
|
-
const o =
|
|
146
|
+
const o = q.get(t.target);
|
|
146
147
|
c.has(r) && rt(r), o.disconnect();
|
|
147
148
|
});
|
|
148
149
|
});
|
|
149
150
|
}
|
|
150
151
|
const ht = (e) => {
|
|
151
|
-
var
|
|
152
|
-
const
|
|
153
|
-
(
|
|
152
|
+
var t, i;
|
|
153
|
+
const r = new MutationObserver(vt);
|
|
154
|
+
!((t = window == null ? void 0 : window.ShadyDOM) === null || t === void 0) && t.inUse && e.mode && e.host && (e = e.host), (i = r.observe) === null || i === void 0 || i.call(r, e, { childList: !0 }), q.set(e, r);
|
|
154
155
|
};
|
|
155
|
-
|
|
156
|
-
const
|
|
156
|
+
N() && new MutationObserver(R);
|
|
157
|
+
const _ = {
|
|
157
158
|
childList: !0,
|
|
158
159
|
subtree: !0
|
|
159
|
-
},
|
|
160
|
+
}, D = (e, t) => {
|
|
160
161
|
e.toggleAttribute("internals-disabled", t), t ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
|
|
161
162
|
}, Y = (e) => {
|
|
162
163
|
h.get(e).forEach((i) => {
|
|
@@ -165,9 +166,9 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
165
166
|
}, Z = (e, t) => {
|
|
166
167
|
const i = document.createElement("input");
|
|
167
168
|
return i.type = "hidden", i.name = e.getAttribute("name"), e.after(i), h.get(t).push(i), i;
|
|
168
|
-
},
|
|
169
|
+
}, mt = (e, t) => {
|
|
169
170
|
var i;
|
|
170
|
-
h.set(t, []), (i =
|
|
171
|
+
h.set(t, []), (i = I.observe) === null || i === void 0 || i.call(I, e, X);
|
|
171
172
|
}, tt = (e, t) => {
|
|
172
173
|
if (t.length) {
|
|
173
174
|
Array.from(t).forEach((r) => r.addEventListener("click", e.click.bind(e)));
|
|
@@ -177,7 +178,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
177
178
|
}, T = (e) => {
|
|
178
179
|
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i = g.get(e) || [], r = Array.from(i).filter((s) => s.isConnected).map((s) => c.get(s).validity.valid), o = [...t, ...r].includes(!1);
|
|
179
180
|
e.toggleAttribute("internals-invalid", o), e.toggleAttribute("internals-valid", !o);
|
|
180
|
-
},
|
|
181
|
+
}, pt = (e) => {
|
|
181
182
|
T(V(e.target));
|
|
182
183
|
}, ut = (e) => {
|
|
183
184
|
T(V(e.target));
|
|
@@ -203,7 +204,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
203
204
|
r.add(e);
|
|
204
205
|
else {
|
|
205
206
|
const o = /* @__PURE__ */ new Set();
|
|
206
|
-
o.add(e), g.set(t, o), ft(t), t.addEventListener("reset", bt), t.addEventListener("input",
|
|
207
|
+
o.add(e), g.set(t, o), ft(t), t.addEventListener("reset", bt), t.addEventListener("input", pt), t.addEventListener("change", ut);
|
|
207
208
|
}
|
|
208
209
|
w.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
209
210
|
e.formAssociatedCallback.apply(e, [t]);
|
|
@@ -226,7 +227,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
226
227
|
tt(e, i), et(e, r, t);
|
|
227
228
|
}
|
|
228
229
|
};
|
|
229
|
-
function
|
|
230
|
+
function N() {
|
|
230
231
|
return typeof MutationObserver < "u";
|
|
231
232
|
}
|
|
232
233
|
class gt {
|
|
@@ -288,10 +289,10 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
288
289
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
289
290
|
return r === "a" ? o.call(e, i) : o ? o.value = i : t.set(e, i), i;
|
|
290
291
|
}
|
|
291
|
-
var
|
|
292
|
+
var M;
|
|
292
293
|
class kt {
|
|
293
294
|
constructor(t) {
|
|
294
|
-
|
|
295
|
+
M.set(this, void 0), Et(this, M, t, "f");
|
|
295
296
|
for (let i = 0; i < t.length; i++) {
|
|
296
297
|
let r = t[i];
|
|
297
298
|
this[i] = r, r.hasAttribute("name") && (this[r.getAttribute("name")] = r);
|
|
@@ -299,10 +300,10 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
299
300
|
Object.freeze(this);
|
|
300
301
|
}
|
|
301
302
|
get length() {
|
|
302
|
-
return at(this,
|
|
303
|
+
return at(this, M, "f").length;
|
|
303
304
|
}
|
|
304
|
-
[(
|
|
305
|
-
return at(this,
|
|
305
|
+
[(M = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
306
|
+
return at(this, M, "f")[Symbol.iterator]();
|
|
306
307
|
}
|
|
307
308
|
item(t) {
|
|
308
309
|
return this[t] == null ? null : this[t];
|
|
@@ -343,7 +344,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
343
344
|
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
344
345
|
throw new TypeError("Illegal constructor");
|
|
345
346
|
const i = t.getRootNode(), r = new gt();
|
|
346
|
-
this.states = new $(t), a.set(this, t), n.set(this, r), c.set(t, this), dt(t, this),
|
|
347
|
+
this.states = new $(t), a.set(this, t), n.set(this, r), c.set(t, this), dt(t, this), mt(t, this), Object.seal(this), i instanceof DocumentFragment && ht(i);
|
|
347
348
|
}
|
|
348
349
|
checkValidity() {
|
|
349
350
|
const t = a.get(this);
|
|
@@ -376,7 +377,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
376
377
|
const t = a.get(this);
|
|
377
378
|
if (x(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
378
379
|
return !0;
|
|
379
|
-
const i = this.checkValidity(), r =
|
|
380
|
+
const i = this.checkValidity(), r = U.get(this);
|
|
380
381
|
if (r && !t.constructor.formAssociated)
|
|
381
382
|
throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
382
383
|
return !i && r && (t.focus(), r.focus()), i;
|
|
@@ -395,26 +396,26 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
395
396
|
s.name = r, s.value = o;
|
|
396
397
|
}
|
|
397
398
|
});
|
|
398
|
-
|
|
399
|
+
F.set(i, t);
|
|
399
400
|
}
|
|
400
401
|
setValidity(t, i, r) {
|
|
401
402
|
const o = a.get(this);
|
|
402
403
|
if (x(o, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
403
404
|
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
404
|
-
|
|
405
|
+
U.set(this, r);
|
|
405
406
|
const s = n.get(this), l = {};
|
|
406
407
|
for (const E in t)
|
|
407
408
|
l[E] = t[E];
|
|
408
409
|
Object.keys(l).length === 0 && yt(s);
|
|
409
|
-
const u = {
|
|
410
|
+
const u = Object.assign(Object.assign({}, s), l);
|
|
410
411
|
delete u.valid;
|
|
411
412
|
const { valid: d } = wt(s, u, this.form);
|
|
412
413
|
if (!d && !i)
|
|
413
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.");
|
|
414
|
-
f.set(this, d ? "" : i), o.isConnected ? (o.toggleAttribute("internals-invalid", !d), o.toggleAttribute("internals-valid", d), o.setAttribute("aria-invalid", `${!d}`)) :
|
|
415
|
+
f.set(this, d ? "" : i), o.isConnected ? (o.toggleAttribute("internals-invalid", !d), o.toggleAttribute("internals-valid", d), o.setAttribute("aria-invalid", `${!d}`)) : S.set(o, this);
|
|
415
416
|
}
|
|
416
417
|
get shadowRoot() {
|
|
417
|
-
const t = a.get(this), i =
|
|
418
|
+
const t = a.get(this), i = j.get(t);
|
|
418
419
|
return i || null;
|
|
419
420
|
}
|
|
420
421
|
get validationMessage() {
|
|
@@ -469,7 +470,7 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
469
470
|
if (r.formAssociated) {
|
|
470
471
|
const s = r.prototype.connectedCallback;
|
|
471
472
|
r.prototype.connectedCallback = function() {
|
|
472
|
-
G.has(this) || (G.set(this, !0), this.hasAttribute("disabled") &&
|
|
473
|
+
G.has(this) || (G.set(this, !0), this.hasAttribute("disabled") && D(this, !0)), s != null && s.apply(this), rt(this);
|
|
473
474
|
};
|
|
474
475
|
}
|
|
475
476
|
t.call(this, i, r, o);
|
|
@@ -487,27 +488,27 @@ const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
487
488
|
}), typeof Element < "u") {
|
|
488
489
|
let t = function(...r) {
|
|
489
490
|
const o = i.apply(this, r);
|
|
490
|
-
if (
|
|
491
|
-
const s = new MutationObserver(
|
|
492
|
-
window.ShadyDOM ? s.observe(this,
|
|
491
|
+
if (j.set(this, o), N()) {
|
|
492
|
+
const s = new MutationObserver(R);
|
|
493
|
+
window.ShadyDOM ? s.observe(this, _) : s.observe(o, _), z.set(this, s);
|
|
493
494
|
}
|
|
494
495
|
return o;
|
|
495
496
|
};
|
|
496
497
|
const i = Element.prototype.attachShadow;
|
|
497
498
|
Element.prototype.attachShadow = t;
|
|
498
499
|
}
|
|
499
|
-
|
|
500
|
+
N() && typeof document < "u" && new MutationObserver(R).observe(document.documentElement, _), typeof HTMLFormElement < "u" && zt(), (e || typeof window < "u" && !window.CustomStateSet) && H();
|
|
500
501
|
}
|
|
501
502
|
}
|
|
502
503
|
return !!customElements.polyfillWrapFlushCallback || (Mt() ? typeof window < "u" && !window.CustomStateSet && H(HTMLElement.prototype.attachInternals) : ct(!1)), k.forceCustomStateSetPolyfill = H, k.forceElementInternalsPolyfill = ct, Object.defineProperty(k, "__esModule", { value: !0 }), k;
|
|
503
504
|
})({});
|
|
504
505
|
})();
|
|
505
|
-
var
|
|
506
|
-
for (var c = h > 1 ? void 0 : h ?
|
|
506
|
+
var Ot = Object.defineProperty, Rt = Object.getOwnPropertyDescriptor, p = (k, a, n, h) => {
|
|
507
|
+
for (var c = h > 1 ? void 0 : h ? Rt(a, n) : a, f = k.length - 1, w; f >= 0; f--)
|
|
507
508
|
(w = k[f]) && (c = (h ? w(a, n, c) : w(c)) || c);
|
|
508
|
-
return h && c &&
|
|
509
|
+
return h && c && Ot(a, n, c), c;
|
|
509
510
|
};
|
|
510
|
-
const
|
|
511
|
+
const C = "pie-button";
|
|
511
512
|
class v extends St(Ct) {
|
|
512
513
|
constructor() {
|
|
513
514
|
super(...arguments), this.size = b.size, this.type = b.type, this.variant = b.variant, this.iconPlacement = b.iconPlacement, this.disabled = b.disabled, this.isLoading = b.isLoading, this.isFullWidth = b.isFullWidth, this.isResponsive = b.isResponsive, this._handleFormKeyDown = (a) => {
|
|
@@ -558,7 +559,7 @@ class v extends St(Ct) {
|
|
|
558
559
|
renderSpinner() {
|
|
559
560
|
const { size: a, variant: n, disabled: h } = this, c = a && a.includes("small") ? "small" : "medium";
|
|
560
561
|
let f;
|
|
561
|
-
return h ? f = n === "ghost-inverse" ? "inverse" : "secondary" : f = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary",
|
|
562
|
+
return h ? f = n === "ghost-inverse" ? "inverse" : "secondary" : f = ["primary", "destructive", "outline-inverse", "ghost-inverse"].includes(this.variant) ? "inverse" : "secondary", P`
|
|
562
563
|
<pie-spinner
|
|
563
564
|
size="${c}"
|
|
564
565
|
variant="${f}">
|
|
@@ -572,26 +573,26 @@ class v extends St(Ct) {
|
|
|
572
573
|
variant: c,
|
|
573
574
|
size: f,
|
|
574
575
|
isLoading: w,
|
|
575
|
-
isResponsive:
|
|
576
|
+
isResponsive: z,
|
|
576
577
|
iconPlacement: g,
|
|
577
|
-
responsiveSize:
|
|
578
|
+
responsiveSize: F
|
|
578
579
|
} = this;
|
|
579
|
-
return
|
|
580
|
+
return P`
|
|
580
581
|
<button
|
|
581
582
|
@click=${this._handleClick}
|
|
582
583
|
class="o-btn"
|
|
583
584
|
type=${a || "submit"}
|
|
584
585
|
variant=${c || "primary"}
|
|
585
586
|
size=${f || "medium"}
|
|
586
|
-
responsiveSize=${Lt(
|
|
587
|
+
responsiveSize=${Lt(F)}
|
|
587
588
|
?disabled=${n}
|
|
588
589
|
?isFullWidth=${h}
|
|
589
|
-
?isResponsive=${
|
|
590
|
+
?isResponsive=${z}
|
|
590
591
|
?isLoading=${w}>
|
|
591
592
|
${w ? this.renderSpinner() : K}
|
|
592
|
-
${g === "leading" ?
|
|
593
|
+
${g === "leading" ? P`<slot name="icon"></slot>` : K}
|
|
593
594
|
<slot></slot>
|
|
594
|
-
${g === "trailing" ?
|
|
595
|
+
${g === "trailing" ? P`<slot name="icon"></slot>` : K}
|
|
595
596
|
</button>`;
|
|
596
597
|
}
|
|
597
598
|
focus() {
|
|
@@ -599,67 +600,67 @@ class v extends St(Ct) {
|
|
|
599
600
|
(n = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || n.focus();
|
|
600
601
|
}
|
|
601
602
|
}
|
|
602
|
-
v.styles = Ft(
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
603
|
+
v.styles = Ft(Pt);
|
|
604
|
+
p([
|
|
605
|
+
m(),
|
|
606
|
+
O(C, It, b.size)
|
|
606
607
|
], v.prototype, "size", 2);
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
608
|
+
p([
|
|
609
|
+
m(),
|
|
610
|
+
O(C, Tt, b.type)
|
|
610
611
|
], v.prototype, "type", 2);
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
p([
|
|
613
|
+
m(),
|
|
614
|
+
O(C, Vt, b.variant)
|
|
614
615
|
], v.prototype, "variant", 2);
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
616
|
+
p([
|
|
617
|
+
m({ type: String }),
|
|
618
|
+
O(C, Nt, b.iconPlacement)
|
|
618
619
|
], v.prototype, "iconPlacement", 2);
|
|
619
|
-
|
|
620
|
-
|
|
620
|
+
p([
|
|
621
|
+
m({ type: Boolean })
|
|
621
622
|
], v.prototype, "disabled", 2);
|
|
622
|
-
|
|
623
|
-
|
|
623
|
+
p([
|
|
624
|
+
m({ type: Boolean, reflect: !0 })
|
|
624
625
|
], v.prototype, "isLoading", 2);
|
|
625
|
-
|
|
626
|
-
|
|
626
|
+
p([
|
|
627
|
+
m({ type: Boolean })
|
|
627
628
|
], v.prototype, "isFullWidth", 2);
|
|
628
|
-
|
|
629
|
-
|
|
629
|
+
p([
|
|
630
|
+
m({ type: Boolean })
|
|
630
631
|
], v.prototype, "isResponsive", 2);
|
|
631
|
-
|
|
632
|
-
|
|
632
|
+
p([
|
|
633
|
+
m({ type: String })
|
|
633
634
|
], v.prototype, "name", 2);
|
|
634
|
-
|
|
635
|
-
|
|
635
|
+
p([
|
|
636
|
+
m({ type: String })
|
|
636
637
|
], v.prototype, "value", 2);
|
|
637
|
-
|
|
638
|
-
|
|
638
|
+
p([
|
|
639
|
+
m()
|
|
639
640
|
], v.prototype, "formaction", 2);
|
|
640
|
-
|
|
641
|
-
|
|
641
|
+
p([
|
|
642
|
+
m()
|
|
642
643
|
], v.prototype, "formenctype", 2);
|
|
643
|
-
|
|
644
|
-
|
|
644
|
+
p([
|
|
645
|
+
m()
|
|
645
646
|
], v.prototype, "formmethod", 2);
|
|
646
|
-
|
|
647
|
-
|
|
647
|
+
p([
|
|
648
|
+
m({ type: Boolean })
|
|
648
649
|
], v.prototype, "formnovalidate", 2);
|
|
649
|
-
|
|
650
|
-
|
|
650
|
+
p([
|
|
651
|
+
m()
|
|
651
652
|
], v.prototype, "formtarget", 2);
|
|
652
|
-
|
|
653
|
-
|
|
653
|
+
p([
|
|
654
|
+
m({ type: String })
|
|
654
655
|
], v.prototype, "responsiveSize", 2);
|
|
655
|
-
At(
|
|
656
|
+
At(C, v);
|
|
656
657
|
export {
|
|
657
658
|
v as PieButton,
|
|
658
659
|
b as defaultProps,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
660
|
+
jt as formEncodingtypes,
|
|
661
|
+
Ut as formMethodTypes,
|
|
662
|
+
qt as formTargetTypes,
|
|
663
|
+
Nt as iconPlacements,
|
|
663
664
|
Kt as responsiveSizes,
|
|
664
665
|
It as sizes,
|
|
665
666
|
Tt as types,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-button",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.7",
|
|
4
4
|
"description": "PIE design system button built using web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
39
39
|
"@justeattakeaway/pie-components-config": "0.16.0",
|
|
40
|
-
"@justeattakeaway/pie-wrapper-react": "0.14.
|
|
40
|
+
"@justeattakeaway/pie-wrapper-react": "0.14.1",
|
|
41
41
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
42
42
|
},
|
|
43
43
|
"volta": {
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@justeattakeaway/pie-spinner": "0.6.5",
|
|
52
52
|
"@justeattakeaway/pie-webc-core": "0.23.0",
|
|
53
|
-
"element-internals-polyfill": "1.3.
|
|
53
|
+
"element-internals-polyfill": "1.3.11"
|
|
54
54
|
}
|
|
55
55
|
}
|