@justeattakeaway/pie-button 0.47.4 → 0.47.5
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/custom-elements.json +16 -40
- package/dist/index.d.ts +5 -0
- package/dist/index.js +202 -192
- package/dist/react.d.ts +5 -0
- package/dist/react.js +8 -7
- package/package.json +3 -3
- package/src/defs.ts +15 -0
- package/src/index.ts +13 -13
package/custom-elements.json
CHANGED
|
@@ -75,6 +75,14 @@
|
|
|
75
75
|
"text": "['_self', '_blank', '_parent', '_top']"
|
|
76
76
|
},
|
|
77
77
|
"default": "['_self', '_blank', '_parent', '_top']"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"kind": "variable",
|
|
81
|
+
"name": "defaultProps",
|
|
82
|
+
"type": {
|
|
83
|
+
"text": "DefaultProps"
|
|
84
|
+
},
|
|
85
|
+
"default": "{\n size: 'medium',\n type: 'submit',\n variant: 'primary',\n iconPlacement: 'leading',\n disabled: false,\n isLoading: false,\n isFullWidth: false,\n isResponsive: false,\n}"
|
|
78
86
|
}
|
|
79
87
|
],
|
|
80
88
|
"exports": [
|
|
@@ -141,6 +149,14 @@
|
|
|
141
149
|
"name": "formTargetTypes",
|
|
142
150
|
"module": "src/defs.js"
|
|
143
151
|
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"kind": "js",
|
|
155
|
+
"name": "defaultProps",
|
|
156
|
+
"declaration": {
|
|
157
|
+
"name": "defaultProps",
|
|
158
|
+
"module": "src/defs.js"
|
|
159
|
+
}
|
|
144
160
|
}
|
|
145
161
|
]
|
|
146
162
|
},
|
|
@@ -170,7 +186,6 @@
|
|
|
170
186
|
"text": "ButtonProps['size']"
|
|
171
187
|
},
|
|
172
188
|
"privacy": "public",
|
|
173
|
-
"default": "'medium'",
|
|
174
189
|
"attribute": "size"
|
|
175
190
|
},
|
|
176
191
|
{
|
|
@@ -180,7 +195,6 @@
|
|
|
180
195
|
"text": "ButtonProps['type']"
|
|
181
196
|
},
|
|
182
197
|
"privacy": "public",
|
|
183
|
-
"default": "'submit'",
|
|
184
198
|
"attribute": "type"
|
|
185
199
|
},
|
|
186
200
|
{
|
|
@@ -190,7 +204,6 @@
|
|
|
190
204
|
"text": "ButtonProps['variant']"
|
|
191
205
|
},
|
|
192
206
|
"privacy": "public",
|
|
193
|
-
"default": "'primary'",
|
|
194
207
|
"attribute": "variant"
|
|
195
208
|
},
|
|
196
209
|
{
|
|
@@ -200,48 +213,31 @@
|
|
|
200
213
|
"text": "ButtonProps['iconPlacement']"
|
|
201
214
|
},
|
|
202
215
|
"privacy": "public",
|
|
203
|
-
"default": "'leading'",
|
|
204
216
|
"attribute": "iconPlacement"
|
|
205
217
|
},
|
|
206
218
|
{
|
|
207
219
|
"kind": "field",
|
|
208
220
|
"name": "disabled",
|
|
209
|
-
"type": {
|
|
210
|
-
"text": "boolean"
|
|
211
|
-
},
|
|
212
221
|
"privacy": "public",
|
|
213
|
-
"default": "false",
|
|
214
222
|
"attribute": "disabled"
|
|
215
223
|
},
|
|
216
224
|
{
|
|
217
225
|
"kind": "field",
|
|
218
226
|
"name": "isLoading",
|
|
219
|
-
"type": {
|
|
220
|
-
"text": "boolean"
|
|
221
|
-
},
|
|
222
227
|
"privacy": "public",
|
|
223
|
-
"default": "false",
|
|
224
228
|
"attribute": "isLoading",
|
|
225
229
|
"reflects": true
|
|
226
230
|
},
|
|
227
231
|
{
|
|
228
232
|
"kind": "field",
|
|
229
233
|
"name": "isFullWidth",
|
|
230
|
-
"type": {
|
|
231
|
-
"text": "boolean"
|
|
232
|
-
},
|
|
233
234
|
"privacy": "public",
|
|
234
|
-
"default": "false",
|
|
235
235
|
"attribute": "isFullWidth"
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
"kind": "field",
|
|
239
239
|
"name": "isResponsive",
|
|
240
|
-
"type": {
|
|
241
|
-
"text": "boolean"
|
|
242
|
-
},
|
|
243
240
|
"privacy": "public",
|
|
244
|
-
"default": "false",
|
|
245
241
|
"attribute": "isResponsive"
|
|
246
242
|
},
|
|
247
243
|
{
|
|
@@ -362,7 +358,6 @@
|
|
|
362
358
|
"type": {
|
|
363
359
|
"text": "ButtonProps['size']"
|
|
364
360
|
},
|
|
365
|
-
"default": "'medium'",
|
|
366
361
|
"fieldName": "size"
|
|
367
362
|
},
|
|
368
363
|
{
|
|
@@ -370,7 +365,6 @@
|
|
|
370
365
|
"type": {
|
|
371
366
|
"text": "ButtonProps['type']"
|
|
372
367
|
},
|
|
373
|
-
"default": "'submit'",
|
|
374
368
|
"fieldName": "type"
|
|
375
369
|
},
|
|
376
370
|
{
|
|
@@ -378,7 +372,6 @@
|
|
|
378
372
|
"type": {
|
|
379
373
|
"text": "ButtonProps['variant']"
|
|
380
374
|
},
|
|
381
|
-
"default": "'primary'",
|
|
382
375
|
"fieldName": "variant"
|
|
383
376
|
},
|
|
384
377
|
{
|
|
@@ -386,39 +379,22 @@
|
|
|
386
379
|
"type": {
|
|
387
380
|
"text": "ButtonProps['iconPlacement']"
|
|
388
381
|
},
|
|
389
|
-
"default": "'leading'",
|
|
390
382
|
"fieldName": "iconPlacement"
|
|
391
383
|
},
|
|
392
384
|
{
|
|
393
385
|
"name": "disabled",
|
|
394
|
-
"type": {
|
|
395
|
-
"text": "boolean"
|
|
396
|
-
},
|
|
397
|
-
"default": "false",
|
|
398
386
|
"fieldName": "disabled"
|
|
399
387
|
},
|
|
400
388
|
{
|
|
401
389
|
"name": "isLoading",
|
|
402
|
-
"type": {
|
|
403
|
-
"text": "boolean"
|
|
404
|
-
},
|
|
405
|
-
"default": "false",
|
|
406
390
|
"fieldName": "isLoading"
|
|
407
391
|
},
|
|
408
392
|
{
|
|
409
393
|
"name": "isFullWidth",
|
|
410
|
-
"type": {
|
|
411
|
-
"text": "boolean"
|
|
412
|
-
},
|
|
413
|
-
"default": "false",
|
|
414
394
|
"fieldName": "isFullWidth"
|
|
415
395
|
},
|
|
416
396
|
{
|
|
417
397
|
"name": "isResponsive",
|
|
418
|
-
"type": {
|
|
419
|
-
"text": "boolean"
|
|
420
|
-
},
|
|
421
|
-
"default": "false",
|
|
422
398
|
"fieldName": "isResponsive"
|
|
423
399
|
},
|
|
424
400
|
{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core';
|
|
1
2
|
import type { CSSResult } from 'lit';
|
|
2
3
|
import type { FormControlInterface } from '@justeattakeaway/pie-webc-core';
|
|
3
4
|
import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
|
|
@@ -82,6 +83,10 @@ export declare interface ButtonProps {
|
|
|
82
83
|
responsiveSize?: typeof responsiveSizes[number];
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
export declare type DefaultProps = ComponentDefaultPropsGeneric<ButtonProps, 'size' | 'type' | 'variant' | 'iconPlacement' | 'disabled' | 'isLoading' | 'isFullWidth' | 'isResponsive'>;
|
|
87
|
+
|
|
88
|
+
export declare const defaultProps: DefaultProps;
|
|
89
|
+
|
|
85
90
|
export declare const formEncodingtypes: readonly ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
|
|
86
91
|
|
|
87
92
|
export declare const formMethodTypes: readonly ["post", "get", "dialog"];
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { property as
|
|
3
|
-
import { ifDefined as
|
|
4
|
-
import { FormControlMixin as
|
|
1
|
+
import { LitElement as Ct, html as N, nothing as K, unsafeCSS as Ft } from "lit";
|
|
2
|
+
import { property as p } from "lit/decorators.js";
|
|
3
|
+
import { ifDefined as Lt } from "lit/directives/if-defined.js";
|
|
4
|
+
import { FormControlMixin as St, validPropertyValues as R, defineCustomElement as At } from "@justeattakeaway/pie-webc-core";
|
|
5
5
|
import "@justeattakeaway/pie-spinner";
|
|
6
|
-
const
|
|
6
|
+
const It = ["xsmall", "small-productive", "small-expressive", "medium", "large"], Kt = ["productive", "expressive"], Tt = ["submit", "button", "reset"], Vt = [
|
|
7
7
|
"primary",
|
|
8
8
|
"secondary",
|
|
9
9
|
"outline",
|
|
@@ -13,11 +13,20 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
13
13
|
"ghost-inverse",
|
|
14
14
|
"destructive",
|
|
15
15
|
"destructive-ghost"
|
|
16
|
-
], Vt = ["leading", "trailing"], Kt = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], Ut = ["post", "get", "dialog"], qt = ["_self", "_blank", "_parent", "_top"], 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)}
|
|
16
|
+
], Pt = ["leading", "trailing"], Ut = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], qt = ["post", "get", "dialog"], jt = ["_self", "_blank", "_parent", "_top"], b = {
|
|
17
|
+
size: "medium",
|
|
18
|
+
type: "submit",
|
|
19
|
+
variant: "primary",
|
|
20
|
+
iconPlacement: "leading",
|
|
21
|
+
disabled: !1,
|
|
22
|
+
isLoading: !1,
|
|
23
|
+
isFullWidth: !1,
|
|
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)}
|
|
17
26
|
`;
|
|
18
27
|
(function() {
|
|
19
|
-
(function(
|
|
20
|
-
const a = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(),
|
|
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(), M = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), I = {
|
|
21
30
|
ariaAtomic: "aria-atomic",
|
|
22
31
|
ariaAutoComplete: "aria-autocomplete",
|
|
23
32
|
ariaBusy: "aria-busy",
|
|
@@ -59,26 +68,26 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
59
68
|
ariaValueNow: "aria-valuenow",
|
|
60
69
|
ariaValueText: "aria-valuetext",
|
|
61
70
|
role: "role"
|
|
62
|
-
},
|
|
63
|
-
for (let i in
|
|
71
|
+
}, dt = (e, t) => {
|
|
72
|
+
for (let i in I) {
|
|
64
73
|
t[i] = null;
|
|
65
74
|
let r = null;
|
|
66
|
-
const o =
|
|
75
|
+
const o = I[i];
|
|
67
76
|
Object.defineProperty(t, i, {
|
|
68
77
|
get() {
|
|
69
78
|
return r;
|
|
70
79
|
},
|
|
71
80
|
set(s) {
|
|
72
|
-
r = s, e.isConnected ? e.setAttribute(o, s) :
|
|
81
|
+
r = s, e.isConnected ? e.setAttribute(o, s) : S.set(e, t);
|
|
73
82
|
}
|
|
74
83
|
});
|
|
75
84
|
}
|
|
76
85
|
};
|
|
77
|
-
function
|
|
86
|
+
function J(e) {
|
|
78
87
|
const t = c.get(e), { form: i } = t;
|
|
79
|
-
|
|
88
|
+
et(e, i, t), tt(e, t.labels);
|
|
80
89
|
}
|
|
81
|
-
const
|
|
90
|
+
const Q = (e, t = !1) => {
|
|
82
91
|
const i = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
83
92
|
acceptNode(s) {
|
|
84
93
|
return c.has(s) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
@@ -87,151 +96,151 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
87
96
|
let r = i.nextNode();
|
|
88
97
|
const o = !t || e.disabled;
|
|
89
98
|
for (; r; )
|
|
90
|
-
r.formDisabledCallback && o &&
|
|
91
|
-
},
|
|
99
|
+
r.formDisabledCallback && o && O(r, e.disabled), r = i.nextNode();
|
|
100
|
+
}, X = { attributes: !0, attributeFilter: ["disabled", "name"] }, z = P() ? new MutationObserver((e) => {
|
|
92
101
|
for (const t of e) {
|
|
93
102
|
const i = t.target;
|
|
94
|
-
if (t.attributeName === "disabled" && (i.constructor.formAssociated ?
|
|
95
|
-
const r = c.get(i), o =
|
|
103
|
+
if (t.attributeName === "disabled" && (i.constructor.formAssociated ? O(i, i.hasAttribute("disabled")) : i.localName === "fieldset" && Q(i)), t.attributeName === "name" && i.constructor.formAssociated) {
|
|
104
|
+
const r = c.get(i), o = L.get(i);
|
|
96
105
|
r.setFormValue(o);
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
}) : {};
|
|
100
|
-
function
|
|
109
|
+
function _(e) {
|
|
101
110
|
e.forEach((t) => {
|
|
102
111
|
const { addedNodes: i, removedNodes: r } = t, o = Array.from(i), s = Array.from(r);
|
|
103
112
|
o.forEach((l) => {
|
|
104
113
|
var u;
|
|
105
|
-
if (c.has(l) && l.constructor.formAssociated &&
|
|
106
|
-
const d =
|
|
107
|
-
Object.keys(
|
|
108
|
-
l.setAttribute(
|
|
109
|
-
}),
|
|
114
|
+
if (c.has(l) && l.constructor.formAssociated && J(l), S.has(l)) {
|
|
115
|
+
const d = S.get(l);
|
|
116
|
+
Object.keys(I).filter((y) => d[y] !== null).forEach((y) => {
|
|
117
|
+
l.setAttribute(I[y], d[y]);
|
|
118
|
+
}), S.delete(l);
|
|
110
119
|
}
|
|
111
|
-
if (
|
|
112
|
-
const d =
|
|
113
|
-
l.setAttribute("internals-valid", d.validity.valid.toString()), l.setAttribute("internals-invalid", (!d.validity.valid).toString()), l.setAttribute("aria-invalid", (!d.validity.valid).toString()),
|
|
120
|
+
if (A.has(l)) {
|
|
121
|
+
const d = A.get(l);
|
|
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()), A.delete(l);
|
|
114
123
|
}
|
|
115
124
|
if (l.localName === "form") {
|
|
116
|
-
const d =
|
|
117
|
-
acceptNode(
|
|
118
|
-
return c.has(
|
|
125
|
+
const d = g.get(l), E = document.createTreeWalker(l, NodeFilter.SHOW_ELEMENT, {
|
|
126
|
+
acceptNode(B) {
|
|
127
|
+
return c.has(B) && B.constructor.formAssociated && !(d && d.has(B)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
119
128
|
}
|
|
120
129
|
});
|
|
121
|
-
let
|
|
122
|
-
for (;
|
|
123
|
-
|
|
130
|
+
let y = E.nextNode();
|
|
131
|
+
for (; y; )
|
|
132
|
+
J(y), y = E.nextNode();
|
|
124
133
|
}
|
|
125
|
-
l.localName === "fieldset" && ((u =
|
|
134
|
+
l.localName === "fieldset" && ((u = z.observe) == null || u.call(z, l, X), Q(l, !0));
|
|
126
135
|
}), s.forEach((l) => {
|
|
127
136
|
const u = c.get(l);
|
|
128
|
-
u && h.get(u) &&
|
|
137
|
+
u && h.get(u) && Y(u), M.has(l) && M.get(l).disconnect();
|
|
129
138
|
});
|
|
130
139
|
});
|
|
131
140
|
}
|
|
132
|
-
function
|
|
141
|
+
function vt(e) {
|
|
133
142
|
e.forEach((t) => {
|
|
134
143
|
const { removedNodes: i } = t;
|
|
135
144
|
i.forEach((r) => {
|
|
136
|
-
const o =
|
|
137
|
-
c.has(r) &&
|
|
145
|
+
const o = j.get(t.target);
|
|
146
|
+
c.has(r) && rt(r), o.disconnect();
|
|
138
147
|
});
|
|
139
148
|
});
|
|
140
149
|
}
|
|
141
|
-
const
|
|
150
|
+
const ht = (e) => {
|
|
142
151
|
var i, r;
|
|
143
|
-
const t = new MutationObserver(
|
|
144
|
-
(i = window == null ? void 0 : window.ShadyDOM) != null && i.inUse && e.mode && e.host && (e = e.host), (r = t.observe) == null || r.call(t, e, { childList: !0 }),
|
|
152
|
+
const t = new MutationObserver(vt);
|
|
153
|
+
(i = window == null ? void 0 : window.ShadyDOM) != null && i.inUse && e.mode && e.host && (e = e.host), (r = t.observe) == null || r.call(t, e, { childList: !0 }), j.set(e, t);
|
|
145
154
|
};
|
|
146
|
-
|
|
147
|
-
const
|
|
155
|
+
P() && new MutationObserver(_);
|
|
156
|
+
const D = {
|
|
148
157
|
childList: !0,
|
|
149
158
|
subtree: !0
|
|
150
|
-
},
|
|
159
|
+
}, O = (e, t) => {
|
|
151
160
|
e.toggleAttribute("internals-disabled", t), t ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
|
|
152
|
-
},
|
|
161
|
+
}, Y = (e) => {
|
|
153
162
|
h.get(e).forEach((i) => {
|
|
154
163
|
i.remove();
|
|
155
164
|
}), h.set(e, []);
|
|
156
|
-
},
|
|
165
|
+
}, Z = (e, t) => {
|
|
157
166
|
const i = document.createElement("input");
|
|
158
167
|
return i.type = "hidden", i.name = e.getAttribute("name"), e.after(i), h.get(t).push(i), i;
|
|
159
|
-
},
|
|
168
|
+
}, pt = (e, t) => {
|
|
160
169
|
var i;
|
|
161
|
-
h.set(t, []), (i =
|
|
162
|
-
},
|
|
170
|
+
h.set(t, []), (i = z.observe) == null || i.call(z, e, X);
|
|
171
|
+
}, tt = (e, t) => {
|
|
163
172
|
if (t.length) {
|
|
164
173
|
Array.from(t).forEach((r) => r.addEventListener("click", e.click.bind(e)));
|
|
165
174
|
let i = t[0].id;
|
|
166
175
|
t[0].id || (i = `${t[0].htmlFor}_Label`, t[0].id = i), e.setAttribute("aria-labelledby", i);
|
|
167
176
|
}
|
|
168
|
-
},
|
|
169
|
-
const t = Array.from(e.elements).filter((s) => !s.tagName.includes("-") && s.validity).map((s) => s.validity.valid), i =
|
|
177
|
+
}, T = (e) => {
|
|
178
|
+
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);
|
|
170
179
|
e.toggleAttribute("internals-invalid", o), e.toggleAttribute("internals-valid", !o);
|
|
171
180
|
}, mt = (e) => {
|
|
172
|
-
|
|
173
|
-
}, pt = (e) => {
|
|
174
|
-
I(T(e.target));
|
|
181
|
+
T(V(e.target));
|
|
175
182
|
}, ut = (e) => {
|
|
183
|
+
T(V(e.target));
|
|
184
|
+
}, ft = (e) => {
|
|
176
185
|
const t = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${e.id ? `,${i}[form='${e.id}']` : ""}`).join(",");
|
|
177
186
|
e.addEventListener("click", (i) => {
|
|
178
187
|
if (i.target.closest(t)) {
|
|
179
|
-
const o =
|
|
188
|
+
const o = g.get(e);
|
|
180
189
|
if (e.noValidate)
|
|
181
190
|
return;
|
|
182
191
|
o.size && Array.from(o).reverse().map((u) => c.get(u).reportValidity()).includes(!1) && i.preventDefault();
|
|
183
192
|
}
|
|
184
193
|
});
|
|
185
|
-
},
|
|
186
|
-
const t =
|
|
194
|
+
}, bt = (e) => {
|
|
195
|
+
const t = g.get(e.target);
|
|
187
196
|
t && t.size && t.forEach((i) => {
|
|
188
197
|
i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
|
|
189
198
|
});
|
|
190
|
-
},
|
|
199
|
+
}, et = (e, t, i) => {
|
|
191
200
|
if (t) {
|
|
192
|
-
const r =
|
|
201
|
+
const r = g.get(t);
|
|
193
202
|
if (r)
|
|
194
203
|
r.add(e);
|
|
195
204
|
else {
|
|
196
205
|
const o = /* @__PURE__ */ new Set();
|
|
197
|
-
o.add(e),
|
|
206
|
+
o.add(e), g.set(t, o), ft(t), t.addEventListener("reset", bt), t.addEventListener("input", mt), t.addEventListener("change", ut);
|
|
198
207
|
}
|
|
199
|
-
|
|
208
|
+
w.set(t, { ref: e, internals: i }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
200
209
|
e.formAssociatedCallback.apply(e, [t]);
|
|
201
|
-
}, 0),
|
|
210
|
+
}, 0), T(t);
|
|
202
211
|
}
|
|
203
|
-
},
|
|
212
|
+
}, V = (e) => {
|
|
204
213
|
let t = e.parentNode;
|
|
205
|
-
return t && t.tagName !== "FORM" && (t =
|
|
206
|
-
},
|
|
214
|
+
return t && t.tagName !== "FORM" && (t = V(t)), t;
|
|
215
|
+
}, x = (e, t, i = DOMException) => {
|
|
207
216
|
if (!e.constructor.formAssociated)
|
|
208
217
|
throw new i(t);
|
|
209
|
-
},
|
|
210
|
-
const r =
|
|
218
|
+
}, it = (e, t, i) => {
|
|
219
|
+
const r = g.get(e);
|
|
211
220
|
return r && r.size && r.forEach((o) => {
|
|
212
221
|
c.get(o)[i]() || (t = !1);
|
|
213
222
|
}), t;
|
|
214
|
-
},
|
|
223
|
+
}, rt = (e) => {
|
|
215
224
|
if (e.constructor.formAssociated) {
|
|
216
225
|
const t = c.get(e), { labels: i, form: r } = t;
|
|
217
|
-
|
|
226
|
+
tt(e, i), et(e, r, t);
|
|
218
227
|
}
|
|
219
228
|
};
|
|
220
|
-
function
|
|
229
|
+
function P() {
|
|
221
230
|
return typeof MutationObserver < "u";
|
|
222
231
|
}
|
|
223
|
-
class
|
|
232
|
+
class gt {
|
|
224
233
|
constructor() {
|
|
225
234
|
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);
|
|
226
235
|
}
|
|
227
236
|
}
|
|
228
|
-
const
|
|
237
|
+
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, i) => (e.valid = xt(t), Object.keys(t).forEach((r) => e[r] = t[r]), i && T(i), e), xt = (e) => {
|
|
229
238
|
let t = !0;
|
|
230
239
|
for (let i in e)
|
|
231
240
|
i !== "valid" && e[i] !== !1 && (t = !1);
|
|
232
241
|
return t;
|
|
233
|
-
},
|
|
234
|
-
function
|
|
242
|
+
}, W = /* @__PURE__ */ new WeakMap();
|
|
243
|
+
function ot(e, t) {
|
|
235
244
|
e.toggleAttribute(t, !0), e.part && e.part.add(t);
|
|
236
245
|
}
|
|
237
246
|
class $ extends Set {
|
|
@@ -241,14 +250,14 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
241
250
|
constructor(t) {
|
|
242
251
|
if (super(), !t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
243
252
|
throw new TypeError("Illegal constructor");
|
|
244
|
-
|
|
253
|
+
W.set(this, t);
|
|
245
254
|
}
|
|
246
255
|
add(t) {
|
|
247
256
|
if (!/^--/.test(t) || typeof t != "string")
|
|
248
257
|
throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);
|
|
249
|
-
const i = super.add(t), r =
|
|
250
|
-
return r.isConnected ?
|
|
251
|
-
|
|
258
|
+
const i = super.add(t), r = W.get(this), o = `state${t}`;
|
|
259
|
+
return r.isConnected ? ot(r, o) : setTimeout(() => {
|
|
260
|
+
ot(r, o);
|
|
252
261
|
}), i;
|
|
253
262
|
}
|
|
254
263
|
clear() {
|
|
@@ -257,20 +266,20 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
257
266
|
super.clear();
|
|
258
267
|
}
|
|
259
268
|
delete(t) {
|
|
260
|
-
const i = super.delete(t), r =
|
|
269
|
+
const i = super.delete(t), r = W.get(this);
|
|
261
270
|
return r.isConnected ? (r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`)) : setTimeout(() => {
|
|
262
271
|
r.toggleAttribute(`state${t}`, !1), r.part && r.part.remove(`state${t}`);
|
|
263
272
|
}), i;
|
|
264
273
|
}
|
|
265
274
|
}
|
|
266
|
-
function
|
|
275
|
+
function at(e, t, i, r) {
|
|
267
276
|
if (i === "a" && !r)
|
|
268
277
|
throw new TypeError("Private accessor was defined without a getter");
|
|
269
278
|
if (typeof t == "function" ? e !== t || !r : !t.has(e))
|
|
270
279
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
271
280
|
return i === "m" ? r : i === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
272
281
|
}
|
|
273
|
-
function
|
|
282
|
+
function Et(e, t, i, r, o) {
|
|
274
283
|
if (r === "m")
|
|
275
284
|
throw new TypeError("Private method is not writable");
|
|
276
285
|
if (r === "a" && !o)
|
|
@@ -279,10 +288,10 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
279
288
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
280
289
|
return r === "a" ? o.call(e, i) : o ? o.value = i : t.set(e, i), i;
|
|
281
290
|
}
|
|
282
|
-
var
|
|
283
|
-
class
|
|
291
|
+
var C;
|
|
292
|
+
class kt {
|
|
284
293
|
constructor(t) {
|
|
285
|
-
|
|
294
|
+
C.set(this, void 0), Et(this, C, t, "f");
|
|
286
295
|
for (let i = 0; i < t.length; i++) {
|
|
287
296
|
let r = t[i];
|
|
288
297
|
this[i] = r, r.hasAttribute("name") && (this[r.getAttribute("name")] = r);
|
|
@@ -290,10 +299,10 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
290
299
|
Object.freeze(this);
|
|
291
300
|
}
|
|
292
301
|
get length() {
|
|
293
|
-
return
|
|
302
|
+
return at(this, C, "f").length;
|
|
294
303
|
}
|
|
295
|
-
[(
|
|
296
|
-
return
|
|
304
|
+
[(C = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
|
|
305
|
+
return at(this, C, "f")[Symbol.iterator]();
|
|
297
306
|
}
|
|
298
307
|
item(t) {
|
|
299
308
|
return this[t] == null ? null : this[t];
|
|
@@ -302,43 +311,43 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
302
311
|
return this[t] == null ? null : this[t];
|
|
303
312
|
}
|
|
304
313
|
}
|
|
305
|
-
function
|
|
314
|
+
function zt() {
|
|
306
315
|
const e = HTMLFormElement.prototype.checkValidity;
|
|
307
316
|
HTMLFormElement.prototype.checkValidity = i;
|
|
308
317
|
const t = HTMLFormElement.prototype.reportValidity;
|
|
309
318
|
HTMLFormElement.prototype.reportValidity = r;
|
|
310
319
|
function i(...s) {
|
|
311
320
|
let l = e.apply(this, s);
|
|
312
|
-
return
|
|
321
|
+
return it(this, l, "checkValidity");
|
|
313
322
|
}
|
|
314
323
|
function r(...s) {
|
|
315
324
|
let l = t.apply(this, s);
|
|
316
|
-
return
|
|
325
|
+
return it(this, l, "reportValidity");
|
|
317
326
|
}
|
|
318
327
|
const { get: o } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
319
328
|
Object.defineProperty(HTMLFormElement.prototype, "elements", {
|
|
320
329
|
get(...s) {
|
|
321
|
-
const l = o.call(this, ...s), u = Array.from(
|
|
330
|
+
const l = o.call(this, ...s), u = Array.from(g.get(this) || []);
|
|
322
331
|
if (u.length === 0)
|
|
323
332
|
return l;
|
|
324
|
-
const d = Array.from(l).concat(u).sort((
|
|
325
|
-
return new
|
|
333
|
+
const d = Array.from(l).concat(u).sort((E, y) => E.compareDocumentPosition ? E.compareDocumentPosition(y) & 2 ? 1 : -1 : 0);
|
|
334
|
+
return new kt(d);
|
|
326
335
|
}
|
|
327
336
|
});
|
|
328
337
|
}
|
|
329
|
-
class
|
|
338
|
+
class nt {
|
|
330
339
|
static get isPolyfilled() {
|
|
331
340
|
return !0;
|
|
332
341
|
}
|
|
333
342
|
constructor(t) {
|
|
334
343
|
if (!t || !t.tagName || t.tagName.indexOf("-") === -1)
|
|
335
344
|
throw new TypeError("Illegal constructor");
|
|
336
|
-
const i = t.getRootNode(), r = new
|
|
337
|
-
this.states = new $(t), a.set(this, t), n.set(this, r), c.set(t, this),
|
|
345
|
+
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), pt(t, this), Object.seal(this), i instanceof DocumentFragment && ht(i);
|
|
338
347
|
}
|
|
339
348
|
checkValidity() {
|
|
340
349
|
const t = a.get(this);
|
|
341
|
-
if (
|
|
350
|
+
if (x(t, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
342
351
|
return !0;
|
|
343
352
|
const i = n.get(this);
|
|
344
353
|
if (!i.valid) {
|
|
@@ -353,72 +362,72 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
353
362
|
}
|
|
354
363
|
get form() {
|
|
355
364
|
const t = a.get(this);
|
|
356
|
-
|
|
365
|
+
x(t, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
357
366
|
let i;
|
|
358
|
-
return t.constructor.formAssociated === !0 && (i =
|
|
367
|
+
return t.constructor.formAssociated === !0 && (i = V(t)), i;
|
|
359
368
|
}
|
|
360
369
|
get labels() {
|
|
361
370
|
const t = a.get(this);
|
|
362
|
-
|
|
371
|
+
x(t, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
363
372
|
const i = t.getAttribute("id"), r = t.getRootNode();
|
|
364
373
|
return r && i ? r.querySelectorAll(`[for="${i}"]`) : [];
|
|
365
374
|
}
|
|
366
375
|
reportValidity() {
|
|
367
376
|
const t = a.get(this);
|
|
368
|
-
if (
|
|
377
|
+
if (x(t, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
|
|
369
378
|
return !0;
|
|
370
|
-
const i = this.checkValidity(), r =
|
|
379
|
+
const i = this.checkValidity(), r = q.get(this);
|
|
371
380
|
if (r && !t.constructor.formAssociated)
|
|
372
381
|
throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
373
382
|
return !i && r && (t.focus(), r.focus()), i;
|
|
374
383
|
}
|
|
375
384
|
setFormValue(t) {
|
|
376
385
|
const i = a.get(this);
|
|
377
|
-
if (
|
|
386
|
+
if (x(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), Y(this), t != null && !(t instanceof FormData)) {
|
|
378
387
|
if (i.getAttribute("name")) {
|
|
379
|
-
const r =
|
|
388
|
+
const r = Z(i, this);
|
|
380
389
|
r.value = t;
|
|
381
390
|
}
|
|
382
391
|
} else
|
|
383
392
|
t != null && t instanceof FormData && Array.from(t).reverse().forEach(([r, o]) => {
|
|
384
393
|
if (typeof o == "string") {
|
|
385
|
-
const s =
|
|
394
|
+
const s = Z(i, this);
|
|
386
395
|
s.name = r, s.value = o;
|
|
387
396
|
}
|
|
388
397
|
});
|
|
389
|
-
|
|
398
|
+
L.set(i, t);
|
|
390
399
|
}
|
|
391
400
|
setValidity(t, i, r) {
|
|
392
401
|
const o = a.get(this);
|
|
393
|
-
if (
|
|
402
|
+
if (x(o, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !t)
|
|
394
403
|
throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
395
|
-
|
|
404
|
+
q.set(this, r);
|
|
396
405
|
const s = n.get(this), l = {};
|
|
397
|
-
for (const
|
|
398
|
-
l[
|
|
399
|
-
Object.keys(l).length === 0 &&
|
|
406
|
+
for (const E in t)
|
|
407
|
+
l[E] = t[E];
|
|
408
|
+
Object.keys(l).length === 0 && yt(s);
|
|
400
409
|
const u = { ...s, ...l };
|
|
401
410
|
delete u.valid;
|
|
402
|
-
const { valid: d } =
|
|
411
|
+
const { valid: d } = wt(s, u, this.form);
|
|
403
412
|
if (!d && !i)
|
|
404
413
|
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.");
|
|
405
|
-
f.set(this, d ? "" : i), o.isConnected ? (o.toggleAttribute("internals-invalid", !d), o.toggleAttribute("internals-valid", d), o.setAttribute("aria-invalid", `${!d}`)) :
|
|
414
|
+
f.set(this, d ? "" : i), o.isConnected ? (o.toggleAttribute("internals-invalid", !d), o.toggleAttribute("internals-valid", d), o.setAttribute("aria-invalid", `${!d}`)) : A.set(o, this);
|
|
406
415
|
}
|
|
407
416
|
get shadowRoot() {
|
|
408
|
-
const t = a.get(this), i =
|
|
417
|
+
const t = a.get(this), i = U.get(t);
|
|
409
418
|
return i || null;
|
|
410
419
|
}
|
|
411
420
|
get validationMessage() {
|
|
412
421
|
const t = a.get(this);
|
|
413
|
-
return
|
|
422
|
+
return x(t, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), f.get(this);
|
|
414
423
|
}
|
|
415
424
|
get validity() {
|
|
416
425
|
const t = a.get(this);
|
|
417
|
-
return
|
|
426
|
+
return x(t, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), n.get(this);
|
|
418
427
|
}
|
|
419
428
|
get willValidate() {
|
|
420
429
|
const t = a.get(this);
|
|
421
|
-
return
|
|
430
|
+
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"));
|
|
422
431
|
}
|
|
423
432
|
}
|
|
424
433
|
function Mt() {
|
|
@@ -445,22 +454,22 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
445
454
|
"reportValidity"
|
|
446
455
|
].every((r) => r in i.internals);
|
|
447
456
|
}
|
|
448
|
-
let
|
|
449
|
-
function
|
|
450
|
-
|
|
457
|
+
let st = !1, lt = !1;
|
|
458
|
+
function H(e) {
|
|
459
|
+
lt || (lt = !0, window.CustomStateSet = $, e && (HTMLElement.prototype.attachInternals = function(...t) {
|
|
451
460
|
const i = e.call(this, t);
|
|
452
461
|
return i.states = new $(this), i;
|
|
453
462
|
}));
|
|
454
463
|
}
|
|
455
|
-
function
|
|
456
|
-
if (!
|
|
457
|
-
if (
|
|
464
|
+
function ct(e = !0) {
|
|
465
|
+
if (!st) {
|
|
466
|
+
if (st = !0, typeof window < "u" && (window.ElementInternals = nt), typeof CustomElementRegistry < "u") {
|
|
458
467
|
const t = CustomElementRegistry.prototype.define;
|
|
459
468
|
CustomElementRegistry.prototype.define = function(i, r, o) {
|
|
460
469
|
if (r.formAssociated) {
|
|
461
470
|
const s = r.prototype.connectedCallback;
|
|
462
471
|
r.prototype.connectedCallback = function() {
|
|
463
|
-
|
|
472
|
+
G.has(this) || (G.set(this, !0), this.hasAttribute("disabled") && O(this, !0)), s != null && s.apply(this), rt(this);
|
|
464
473
|
};
|
|
465
474
|
}
|
|
466
475
|
t.call(this, i, r, o);
|
|
@@ -474,34 +483,34 @@ const At = ["xsmall", "small-productive", "small-expressive", "medium", "large"]
|
|
|
474
483
|
return {};
|
|
475
484
|
if (c.has(this))
|
|
476
485
|
throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
|
|
477
|
-
return new
|
|
486
|
+
return new nt(this);
|
|
478
487
|
}), typeof Element < "u") {
|
|
479
488
|
let t = function(...r) {
|
|
480
489
|
const o = i.apply(this, r);
|
|
481
|
-
if (
|
|
482
|
-
const s = new MutationObserver(
|
|
483
|
-
window.ShadyDOM ? s.observe(this,
|
|
490
|
+
if (U.set(this, o), P()) {
|
|
491
|
+
const s = new MutationObserver(_);
|
|
492
|
+
window.ShadyDOM ? s.observe(this, D) : s.observe(o, D), M.set(this, s);
|
|
484
493
|
}
|
|
485
494
|
return o;
|
|
486
495
|
};
|
|
487
496
|
const i = Element.prototype.attachShadow;
|
|
488
497
|
Element.prototype.attachShadow = t;
|
|
489
498
|
}
|
|
490
|
-
|
|
499
|
+
P() && typeof document < "u" && new MutationObserver(_).observe(document.documentElement, D), typeof HTMLFormElement < "u" && zt(), (e || typeof window < "u" && !window.CustomStateSet) && H();
|
|
491
500
|
}
|
|
492
501
|
}
|
|
493
|
-
return !!customElements.polyfillWrapFlushCallback || (Mt() ? typeof window < "u" && !window.CustomStateSet &&
|
|
502
|
+
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;
|
|
494
503
|
})({});
|
|
495
504
|
})();
|
|
496
|
-
var
|
|
497
|
-
for (var c = h > 1 ? void 0 : h ?
|
|
498
|
-
(
|
|
499
|
-
return h && c &&
|
|
505
|
+
var Rt = Object.defineProperty, _t = Object.getOwnPropertyDescriptor, m = (k, a, n, h) => {
|
|
506
|
+
for (var c = h > 1 ? void 0 : h ? _t(a, n) : a, f = k.length - 1, w; f >= 0; f--)
|
|
507
|
+
(w = k[f]) && (c = (h ? w(a, n, c) : w(c)) || c);
|
|
508
|
+
return h && c && Rt(a, n, c), c;
|
|
500
509
|
};
|
|
501
|
-
const
|
|
502
|
-
class v extends
|
|
510
|
+
const F = "pie-button";
|
|
511
|
+
class v extends St(Ct) {
|
|
503
512
|
constructor() {
|
|
504
|
-
super(...arguments), this.size =
|
|
513
|
+
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) => {
|
|
505
514
|
if (!(a.key !== "Enter" || this.type !== "submit" || this.disabled)) {
|
|
506
515
|
if (a.target instanceof HTMLElement) {
|
|
507
516
|
const n = a.target.tagName.toLowerCase();
|
|
@@ -562,10 +571,10 @@ class v extends Ft(zt) {
|
|
|
562
571
|
isFullWidth: h,
|
|
563
572
|
variant: c,
|
|
564
573
|
size: f,
|
|
565
|
-
isLoading:
|
|
574
|
+
isLoading: w,
|
|
566
575
|
isResponsive: M,
|
|
567
|
-
iconPlacement:
|
|
568
|
-
responsiveSize:
|
|
576
|
+
iconPlacement: g,
|
|
577
|
+
responsiveSize: L
|
|
569
578
|
} = this;
|
|
570
579
|
return N`
|
|
571
580
|
<button
|
|
@@ -574,15 +583,15 @@ class v extends Ft(zt) {
|
|
|
574
583
|
type=${a || "submit"}
|
|
575
584
|
variant=${c || "primary"}
|
|
576
585
|
size=${f || "medium"}
|
|
577
|
-
responsiveSize=${
|
|
586
|
+
responsiveSize=${Lt(L)}
|
|
578
587
|
?disabled=${n}
|
|
579
588
|
?isFullWidth=${h}
|
|
580
589
|
?isResponsive=${M}
|
|
581
|
-
?isLoading=${
|
|
582
|
-
${
|
|
583
|
-
${
|
|
590
|
+
?isLoading=${w}>
|
|
591
|
+
${w ? this.renderSpinner() : K}
|
|
592
|
+
${g === "leading" ? N`<slot name="icon"></slot>` : K}
|
|
584
593
|
<slot></slot>
|
|
585
|
-
${
|
|
594
|
+
${g === "trailing" ? N`<slot name="icon"></slot>` : K}
|
|
586
595
|
</button>`;
|
|
587
596
|
}
|
|
588
597
|
focus() {
|
|
@@ -590,68 +599,69 @@ class v extends Ft(zt) {
|
|
|
590
599
|
(n = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || n.focus();
|
|
591
600
|
}
|
|
592
601
|
}
|
|
593
|
-
v.styles =
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
602
|
+
v.styles = Ft(Nt);
|
|
603
|
+
m([
|
|
604
|
+
p(),
|
|
605
|
+
R(F, It, b.size)
|
|
597
606
|
], v.prototype, "size", 2);
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
607
|
+
m([
|
|
608
|
+
p(),
|
|
609
|
+
R(F, Tt, b.type)
|
|
601
610
|
], v.prototype, "type", 2);
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
611
|
+
m([
|
|
612
|
+
p(),
|
|
613
|
+
R(F, Vt, b.variant)
|
|
605
614
|
], v.prototype, "variant", 2);
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
615
|
+
m([
|
|
616
|
+
p({ type: String }),
|
|
617
|
+
R(F, Pt, b.iconPlacement)
|
|
609
618
|
], v.prototype, "iconPlacement", 2);
|
|
610
|
-
|
|
611
|
-
|
|
619
|
+
m([
|
|
620
|
+
p({ type: Boolean })
|
|
612
621
|
], v.prototype, "disabled", 2);
|
|
613
|
-
|
|
614
|
-
|
|
622
|
+
m([
|
|
623
|
+
p({ type: Boolean, reflect: !0 })
|
|
615
624
|
], v.prototype, "isLoading", 2);
|
|
616
|
-
|
|
617
|
-
|
|
625
|
+
m([
|
|
626
|
+
p({ type: Boolean })
|
|
618
627
|
], v.prototype, "isFullWidth", 2);
|
|
619
|
-
|
|
620
|
-
|
|
628
|
+
m([
|
|
629
|
+
p({ type: Boolean })
|
|
621
630
|
], v.prototype, "isResponsive", 2);
|
|
622
|
-
|
|
623
|
-
|
|
631
|
+
m([
|
|
632
|
+
p({ type: String })
|
|
624
633
|
], v.prototype, "name", 2);
|
|
625
|
-
|
|
626
|
-
|
|
634
|
+
m([
|
|
635
|
+
p({ type: String })
|
|
627
636
|
], v.prototype, "value", 2);
|
|
628
|
-
|
|
629
|
-
|
|
637
|
+
m([
|
|
638
|
+
p()
|
|
630
639
|
], v.prototype, "formaction", 2);
|
|
631
|
-
|
|
632
|
-
|
|
640
|
+
m([
|
|
641
|
+
p()
|
|
633
642
|
], v.prototype, "formenctype", 2);
|
|
634
|
-
|
|
635
|
-
|
|
643
|
+
m([
|
|
644
|
+
p()
|
|
636
645
|
], v.prototype, "formmethod", 2);
|
|
637
|
-
|
|
638
|
-
|
|
646
|
+
m([
|
|
647
|
+
p({ type: Boolean })
|
|
639
648
|
], v.prototype, "formnovalidate", 2);
|
|
640
|
-
|
|
641
|
-
|
|
649
|
+
m([
|
|
650
|
+
p()
|
|
642
651
|
], v.prototype, "formtarget", 2);
|
|
643
|
-
|
|
644
|
-
|
|
652
|
+
m([
|
|
653
|
+
p({ type: String })
|
|
645
654
|
], v.prototype, "responsiveSize", 2);
|
|
646
|
-
|
|
655
|
+
At(F, v);
|
|
647
656
|
export {
|
|
648
657
|
v as PieButton,
|
|
649
|
-
|
|
650
|
-
Ut as
|
|
651
|
-
qt as
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
It as
|
|
656
|
-
Tt as
|
|
658
|
+
b as defaultProps,
|
|
659
|
+
Ut as formEncodingtypes,
|
|
660
|
+
qt as formMethodTypes,
|
|
661
|
+
jt as formTargetTypes,
|
|
662
|
+
Pt as iconPlacements,
|
|
663
|
+
Kt as responsiveSizes,
|
|
664
|
+
It as sizes,
|
|
665
|
+
Tt as types,
|
|
666
|
+
Vt as variants
|
|
657
667
|
};
|
package/dist/react.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core';
|
|
1
2
|
import type { CSSResult } from 'lit';
|
|
2
3
|
import type { FormControlInterface } from '@justeattakeaway/pie-webc-core';
|
|
3
4
|
import type { GenericConstructor } from '@justeattakeaway/pie-webc-core';
|
|
@@ -83,6 +84,10 @@ export declare interface ButtonProps {
|
|
|
83
84
|
responsiveSize?: typeof responsiveSizes[number];
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
export declare type DefaultProps = ComponentDefaultPropsGeneric<ButtonProps, 'size' | 'type' | 'variant' | 'iconPlacement' | 'disabled' | 'isLoading' | 'isFullWidth' | 'isResponsive'>;
|
|
88
|
+
|
|
89
|
+
export declare const defaultProps: DefaultProps;
|
|
90
|
+
|
|
86
91
|
export declare const formEncodingtypes: readonly ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
|
|
87
92
|
|
|
88
93
|
export declare const formMethodTypes: readonly ["post", "get", "dialog"];
|
package/dist/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as t from "react";
|
|
2
2
|
import { createComponent as e } from "@lit/react";
|
|
3
3
|
import { PieButton as o } from "./index.js";
|
|
4
|
-
import { formEncodingtypes as y, formMethodTypes as B, formTargetTypes as
|
|
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
6
|
import "lit/decorators.js";
|
|
7
7
|
import "lit/directives/if-defined.js";
|
|
@@ -16,12 +16,13 @@ const r = e({
|
|
|
16
16
|
}), f = r;
|
|
17
17
|
export {
|
|
18
18
|
f as PieButton,
|
|
19
|
+
l as defaultProps,
|
|
19
20
|
y as formEncodingtypes,
|
|
20
21
|
B as formMethodTypes,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
d as formTargetTypes,
|
|
23
|
+
g as iconPlacements,
|
|
24
|
+
v as responsiveSizes,
|
|
25
|
+
T as sizes,
|
|
26
|
+
x as types,
|
|
27
|
+
z as variants
|
|
27
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-button",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.5",
|
|
4
4
|
"description": "PIE design system button built using web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"dist/*.js"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@justeattakeaway/pie-spinner": "0.6.
|
|
52
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
51
|
+
"@justeattakeaway/pie-spinner": "0.6.5",
|
|
52
|
+
"@justeattakeaway/pie-webc-core": "0.23.0",
|
|
53
53
|
"element-internals-polyfill": "1.3.10"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/src/defs.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type ComponentDefaultPropsGeneric } from '@justeattakeaway/pie-webc-core';
|
|
2
|
+
|
|
1
3
|
export const sizes = ['xsmall', 'small-productive', 'small-expressive', 'medium', 'large'] as const;
|
|
2
4
|
export const responsiveSizes = ['productive', 'expressive'] as const;
|
|
3
5
|
export const types = ['submit', 'button', 'reset'] as const;
|
|
@@ -98,3 +100,16 @@ export interface ButtonProps {
|
|
|
98
100
|
*/
|
|
99
101
|
responsiveSize?: typeof responsiveSizes[number];
|
|
100
102
|
}
|
|
103
|
+
|
|
104
|
+
export type DefaultProps = ComponentDefaultPropsGeneric<ButtonProps, 'size' | 'type' | 'variant' | 'iconPlacement' | 'disabled' | 'isLoading' | 'isFullWidth' | 'isResponsive'>;
|
|
105
|
+
|
|
106
|
+
export const defaultProps: DefaultProps = {
|
|
107
|
+
size: 'medium',
|
|
108
|
+
type: 'submit',
|
|
109
|
+
variant: 'primary',
|
|
110
|
+
iconPlacement: 'leading',
|
|
111
|
+
disabled: false,
|
|
112
|
+
isLoading: false,
|
|
113
|
+
isFullWidth: false,
|
|
114
|
+
isResponsive: false,
|
|
115
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { property } from 'lit/decorators.js';
|
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
6
|
import { validPropertyValues, defineCustomElement, FormControlMixin } from '@justeattakeaway/pie-webc-core';
|
|
7
7
|
import {
|
|
8
|
-
ButtonProps, sizes, types, variants, iconPlacements,
|
|
8
|
+
ButtonProps, sizes, types, variants, iconPlacements, defaultProps,
|
|
9
9
|
} from './defs';
|
|
10
10
|
import styles from './button.scss?inline';
|
|
11
11
|
import 'element-internals-polyfill';
|
|
@@ -52,32 +52,32 @@ export class PieButton extends FormControlMixin(LitElement) implements ButtonPro
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
@property()
|
|
55
|
-
@validPropertyValues(componentSelector, sizes,
|
|
56
|
-
public size: ButtonProps['size'] =
|
|
55
|
+
@validPropertyValues(componentSelector, sizes, defaultProps.size)
|
|
56
|
+
public size: ButtonProps['size'] = defaultProps.size;
|
|
57
57
|
|
|
58
58
|
@property()
|
|
59
|
-
@validPropertyValues(componentSelector, types,
|
|
60
|
-
public type: ButtonProps['type'] =
|
|
59
|
+
@validPropertyValues(componentSelector, types, defaultProps.type)
|
|
60
|
+
public type: ButtonProps['type'] = defaultProps.type;
|
|
61
61
|
|
|
62
62
|
@property()
|
|
63
|
-
@validPropertyValues(componentSelector, variants,
|
|
64
|
-
public variant: ButtonProps['variant'] =
|
|
63
|
+
@validPropertyValues(componentSelector, variants, defaultProps.variant)
|
|
64
|
+
public variant: ButtonProps['variant'] = defaultProps.variant;
|
|
65
65
|
|
|
66
66
|
@property({ type: String })
|
|
67
|
-
@validPropertyValues(componentSelector, iconPlacements,
|
|
68
|
-
public iconPlacement: ButtonProps['iconPlacement'] =
|
|
67
|
+
@validPropertyValues(componentSelector, iconPlacements, defaultProps.iconPlacement)
|
|
68
|
+
public iconPlacement: ButtonProps['iconPlacement'] = defaultProps.iconPlacement;
|
|
69
69
|
|
|
70
70
|
@property({ type: Boolean })
|
|
71
|
-
public disabled =
|
|
71
|
+
public disabled = defaultProps.disabled;
|
|
72
72
|
|
|
73
73
|
@property({ type: Boolean, reflect: true })
|
|
74
|
-
public isLoading =
|
|
74
|
+
public isLoading = defaultProps.isLoading;
|
|
75
75
|
|
|
76
76
|
@property({ type: Boolean })
|
|
77
|
-
public isFullWidth =
|
|
77
|
+
public isFullWidth = defaultProps.isFullWidth;
|
|
78
78
|
|
|
79
79
|
@property({ type: Boolean })
|
|
80
|
-
public isResponsive =
|
|
80
|
+
public isResponsive = defaultProps.isResponsive;
|
|
81
81
|
|
|
82
82
|
@property({ type: String })
|
|
83
83
|
public name?: string;
|