@justeattakeaway/pie-button 0.47.4 → 0.47.6

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