@spectrum-web-components/button 0.40.1 → 0.40.3

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.
Files changed (75) hide show
  1. package/README.md +20 -4
  2. package/custom-elements.json +74 -28
  3. package/package.json +9 -9
  4. package/src/Button.d.ts +7 -1
  5. package/src/Button.dev.js +59 -0
  6. package/src/Button.dev.js.map +2 -2
  7. package/src/Button.js +10 -1
  8. package/src/Button.js.map +3 -3
  9. package/src/button-base.css.dev.js +4 -4
  10. package/src/button-base.css.dev.js.map +1 -1
  11. package/src/button-base.css.js +4 -4
  12. package/src/button-base.css.js.map +1 -1
  13. package/src/button.css.dev.js +16 -4
  14. package/src/button.css.dev.js.map +2 -2
  15. package/src/button.css.js +16 -4
  16. package/src/button.css.js.map +2 -2
  17. package/src/spectrum-button-base.css.dev.js.map +1 -1
  18. package/src/spectrum-button-base.css.js.map +1 -1
  19. package/src/spectrum-button.css.dev.js +3 -3
  20. package/src/spectrum-button.css.dev.js.map +1 -1
  21. package/src/spectrum-button.css.js +3 -3
  22. package/src/spectrum-button.css.js.map +1 -1
  23. package/src/spectrum-config.js +6 -1
  24. package/stories/button-accent-fill-pending.stories.js +34 -0
  25. package/stories/button-accent-fill-pending.stories.js.map +7 -0
  26. package/stories/button-accent-outline-pending.stories.js +34 -0
  27. package/stories/button-accent-outline-pending.stories.js.map +7 -0
  28. package/stories/button-black-fill-pending.stories.js +34 -0
  29. package/stories/button-black-fill-pending.stories.js.map +7 -0
  30. package/stories/button-black-outline-pending.stories.js +34 -0
  31. package/stories/button-black-outline-pending.stories.js.map +7 -0
  32. package/stories/button-negative-fill-pending.stories.js +34 -0
  33. package/stories/button-negative-fill-pending.stories.js.map +7 -0
  34. package/stories/button-negative-outline-pending.stories.js +34 -0
  35. package/stories/button-negative-outline-pending.stories.js.map +7 -0
  36. package/stories/button-primary-fill-pending.stories.js +34 -0
  37. package/stories/button-primary-fill-pending.stories.js.map +7 -0
  38. package/stories/button-primary-outline-pending.stories.js +34 -0
  39. package/stories/button-primary-outline-pending.stories.js.map +7 -0
  40. package/stories/button-secondary-fill-pending.stories.js +34 -0
  41. package/stories/button-secondary-fill-pending.stories.js.map +7 -0
  42. package/stories/button-secondary-outline-pending.stories.js +34 -0
  43. package/stories/button-secondary-outline-pending.stories.js.map +7 -0
  44. package/stories/button-white-fill-pending.stories.js +34 -0
  45. package/stories/button-white-fill-pending.stories.js.map +7 -0
  46. package/stories/button-white-outline-pending.stories.js +34 -0
  47. package/stories/button-white-outline-pending.stories.js.map +7 -0
  48. package/stories/index.js +16 -1
  49. package/stories/index.js.map +2 -2
  50. package/test/button-accent-fill-pending.test-vrt.js +5 -0
  51. package/test/button-accent-fill-pending.test-vrt.js.map +7 -0
  52. package/test/button-accent-outline-pending.test-vrt.js +5 -0
  53. package/test/button-accent-outline-pending.test-vrt.js.map +7 -0
  54. package/test/button-black-fill-pending.test-vrt.js +5 -0
  55. package/test/button-black-fill-pending.test-vrt.js.map +7 -0
  56. package/test/button-black-outline-pending.test-vrt.js +5 -0
  57. package/test/button-black-outline-pending.test-vrt.js.map +7 -0
  58. package/test/button-negative-fill-pending.test-vrt.js +5 -0
  59. package/test/button-negative-fill-pending.test-vrt.js.map +7 -0
  60. package/test/button-negative-outline-pending.test-vrt.js +5 -0
  61. package/test/button-negative-outline-pending.test-vrt.js.map +7 -0
  62. package/test/button-primary-fill-pending.test-vrt.js +5 -0
  63. package/test/button-primary-fill-pending.test-vrt.js.map +7 -0
  64. package/test/button-primary-outline-pending.test-vrt.js +5 -0
  65. package/test/button-primary-outline-pending.test-vrt.js.map +7 -0
  66. package/test/button-secondary-fill-pending.test-vrt.js +5 -0
  67. package/test/button-secondary-fill-pending.test-vrt.js.map +7 -0
  68. package/test/button-secondary-outline-pending.test-vrt.js +5 -0
  69. package/test/button-secondary-outline-pending.test-vrt.js.map +7 -0
  70. package/test/button-white-fill-pending.test-vrt.js +5 -0
  71. package/test/button-white-fill-pending.test-vrt.js.map +7 -0
  72. package/test/button-white-outline-pending.test-vrt.js +5 -0
  73. package/test/button-white-outline-pending.test-vrt.js.map +7 -0
  74. package/test/button.test.js +113 -0
  75. package/test/button.test.js.map +2 -2
package/README.md CHANGED
@@ -285,10 +285,11 @@ The `treatment` attribute accepts `fill` and `outline` as values, and defaults t
285
285
 
286
286
  ## States
287
287
 
288
- In addition to the variant, `<sp-button>` elements have a disabled state visual state
289
- which can be applied by adding the attribute `disabled`. All `<sp-button>`
290
- variants support this. In addition to affectng the visual state, the `disabled`
291
- attribute prevents focus and disallows `click` events.
288
+ In addition to the variant, `<sp-button>` elements support two different visual states, disabled and pending, which can be applied by adding the attribute `disabled` or `pending` respectively. All `<sp-button>` variants support these states.
289
+
290
+ ### Disabled
291
+
292
+ While disabled, `<sp-button>` elements will not respond to click events and will appear faded.
292
293
 
293
294
  ```html
294
295
  <sp-button-group>
@@ -297,6 +298,21 @@ attribute prevents focus and disallows `click` events.
297
298
  </sp-button-group>
298
299
  ```
299
300
 
301
+ ### Pending
302
+
303
+ While in pending state, `<sp-button>` elements will not respond to click events and will appear faded with an indeterminent `<sp-progress-circle>`.
304
+ `<sp-button>` elements label and icon will be hidden while in pending state.
305
+
306
+ Note: `pending` state of the `<sp-button>` element is applied after 1s delay to avoid flashing the pending state for quick actions.
307
+ You can override the delay by adding custom css var `--pending-delay` to your css.
308
+
309
+ ```html
310
+ <sp-button-group>
311
+ <sp-button variant="primary">Normal</sp-button>
312
+ <sp-button variant="primary" pending>Pending</sp-button>
313
+ </sp-button-group>
314
+ ```
315
+
300
316
  ## Handling events
301
317
 
302
318
  Events handlers for clicks and other user actions can be registered on a
@@ -82,6 +82,50 @@
82
82
  }
83
83
  ],
84
84
  "members": [
85
+ {
86
+ "kind": "field",
87
+ "name": "pendingLabel",
88
+ "type": {
89
+ "text": "string"
90
+ },
91
+ "privacy": "public",
92
+ "default": "'Pending'",
93
+ "attribute": "pending-label"
94
+ },
95
+ {
96
+ "kind": "field",
97
+ "name": "pending",
98
+ "type": {
99
+ "text": "boolean"
100
+ },
101
+ "privacy": "public",
102
+ "default": "false",
103
+ "attribute": "pending",
104
+ "reflects": true
105
+ },
106
+ {
107
+ "kind": "field",
108
+ "name": "cachedAriaLabel",
109
+ "type": {
110
+ "text": "string | null"
111
+ },
112
+ "privacy": "private",
113
+ "default": "null"
114
+ },
115
+ {
116
+ "kind": "method",
117
+ "name": "click",
118
+ "privacy": "public",
119
+ "return": {
120
+ "type": {
121
+ "text": "void"
122
+ }
123
+ },
124
+ "inheritedFrom": {
125
+ "name": "ButtonBase",
126
+ "module": "src/ButtonBase.js"
127
+ }
128
+ },
85
129
  {
86
130
  "kind": "field",
87
131
  "name": "variant",
@@ -133,6 +177,20 @@
133
177
  },
134
178
  "attribute": "quiet"
135
179
  },
180
+ {
181
+ "kind": "method",
182
+ "name": "renderButton",
183
+ "privacy": "protected",
184
+ "return": {
185
+ "type": {
186
+ "text": "TemplateResult"
187
+ }
188
+ },
189
+ "inheritedFrom": {
190
+ "name": "ButtonBase",
191
+ "module": "src/ButtonBase.js"
192
+ }
193
+ },
136
194
  {
137
195
  "kind": "field",
138
196
  "name": "active",
@@ -213,20 +271,6 @@
213
271
  "module": "src/ButtonBase.js"
214
272
  }
215
273
  },
216
- {
217
- "kind": "method",
218
- "name": "click",
219
- "privacy": "public",
220
- "return": {
221
- "type": {
222
- "text": "void"
223
- }
224
- },
225
- "inheritedFrom": {
226
- "name": "ButtonBase",
227
- "module": "src/ButtonBase.js"
228
- }
229
- },
230
274
  {
231
275
  "kind": "method",
232
276
  "name": "handleClickCapture",
@@ -291,20 +335,6 @@
291
335
  "module": "src/ButtonBase.js"
292
336
  }
293
337
  },
294
- {
295
- "kind": "method",
296
- "name": "renderButton",
297
- "privacy": "protected",
298
- "return": {
299
- "type": {
300
- "text": "TemplateResult"
301
- }
302
- },
303
- "inheritedFrom": {
304
- "name": "ButtonBase",
305
- "module": "src/ButtonBase.js"
306
- }
307
- },
308
338
  {
309
339
  "kind": "method",
310
340
  "name": "handleKeydown",
@@ -415,6 +445,22 @@
415
445
  }
416
446
  ],
417
447
  "attributes": [
448
+ {
449
+ "name": "pending-label",
450
+ "type": {
451
+ "text": "string"
452
+ },
453
+ "default": "'Pending'",
454
+ "fieldName": "pendingLabel"
455
+ },
456
+ {
457
+ "name": "pending",
458
+ "type": {
459
+ "text": "boolean"
460
+ },
461
+ "default": "false",
462
+ "fieldName": "pending"
463
+ },
418
464
  {
419
465
  "name": "variant",
420
466
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/button",
3
- "version": "0.40.1",
3
+ "version": "0.40.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -82,15 +82,15 @@
82
82
  "lit-html"
83
83
  ],
84
84
  "dependencies": {
85
- "@spectrum-web-components/base": "^0.40.1",
86
- "@spectrum-web-components/clear-button": "^0.40.1",
87
- "@spectrum-web-components/close-button": "^0.40.1",
88
- "@spectrum-web-components/icon": "^0.40.1",
89
- "@spectrum-web-components/icons-ui": "^0.40.1",
90
- "@spectrum-web-components/shared": "^0.40.1"
85
+ "@spectrum-web-components/base": "^0.40.3",
86
+ "@spectrum-web-components/clear-button": "^0.40.3",
87
+ "@spectrum-web-components/close-button": "^0.40.3",
88
+ "@spectrum-web-components/icon": "^0.40.3",
89
+ "@spectrum-web-components/icons-ui": "^0.40.3",
90
+ "@spectrum-web-components/shared": "^0.40.3"
91
91
  },
92
92
  "devDependencies": {
93
- "@spectrum-css/button": "^11.0.8"
93
+ "@spectrum-css/button": "^11.0.18"
94
94
  },
95
95
  "types": "./src/index.d.ts",
96
96
  "customElements": "custom-elements.json",
@@ -98,5 +98,5 @@
98
98
  "./sp-*.js",
99
99
  "./**/*.dev.js"
100
100
  ],
101
- "gitHead": "a75c4f83094c505d64658dbc7de20b5f18a8fde1"
101
+ "gitHead": "76467a3470aeafa4beefce1e4fc76341f1d6733f"
102
102
  }
package/src/Button.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CSSResultArray, PropertyValues } from '@spectrum-web-components/base';
1
+ import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
2
2
  import { ButtonBase } from './ButtonBase.js';
3
3
  export declare type DeprecatedButtonVariants = 'cta' | 'overBackground';
4
4
  export declare type ButtonStatics = 'white' | 'black';
@@ -18,6 +18,10 @@ declare const Button_base: typeof ButtonBase & {
18
18
  */
19
19
  export declare class Button extends Button_base {
20
20
  static get styles(): CSSResultArray;
21
+ pendingLabel: string;
22
+ pending: boolean;
23
+ private cachedAriaLabel;
24
+ click(): void;
21
25
  /**
22
26
  * The visual variant to apply to this button.
23
27
  */
@@ -35,5 +39,7 @@ export declare class Button extends Button_base {
35
39
  set quiet(quiet: boolean);
36
40
  get quiet(): boolean;
37
41
  protected firstUpdated(changes: PropertyValues<this>): void;
42
+ protected updated(changed: PropertyValues): void;
43
+ protected renderButton(): TemplateResult;
38
44
  }
39
45
  export {};
package/src/Button.dev.js CHANGED
@@ -11,11 +11,13 @@ var __decorateClass = (decorators, target, key, kind) => {
11
11
  return result;
12
12
  };
13
13
  import {
14
+ html,
14
15
  SizedMixin
15
16
  } from "@spectrum-web-components/base";
16
17
  import { property } from "@spectrum-web-components/base/src/decorators.js";
17
18
  import { ButtonBase } from "./ButtonBase.dev.js";
18
19
  import buttonStyles from "./button.css.js";
20
+ import { when } from "@spectrum-web-components/base/src/directives.js";
19
21
  export const VALID_VARIANTS = [
20
22
  "accent",
21
23
  "primary",
@@ -28,12 +30,21 @@ export const VALID_STATICS = ["white", "black"];
28
30
  export class Button extends SizedMixin(ButtonBase, { noDefaultSize: true }) {
29
31
  constructor() {
30
32
  super(...arguments);
33
+ this.pendingLabel = "Pending";
34
+ this.pending = false;
35
+ this.cachedAriaLabel = null;
31
36
  this._variant = "accent";
32
37
  this.treatment = "fill";
33
38
  }
34
39
  static get styles() {
35
40
  return [...super.styles, buttonStyles];
36
41
  }
42
+ click() {
43
+ if (this.pending) {
44
+ return;
45
+ }
46
+ super.click();
47
+ }
37
48
  get variant() {
38
49
  return this._variant;
39
50
  }
@@ -100,7 +111,55 @@ export class Button extends SizedMixin(ButtonBase, { noDefaultSize: true }) {
100
111
  this.setAttribute("variant", this.variant);
101
112
  }
102
113
  }
114
+ updated(changed) {
115
+ super.updated(changed);
116
+ if (changed.has("pending")) {
117
+ if (this.pending && this.pendingLabel !== this.getAttribute("aria-label")) {
118
+ if (!this.disabled) {
119
+ this.cachedAriaLabel = this.getAttribute("aria-label") || "";
120
+ this.setAttribute("aria-label", this.pendingLabel);
121
+ }
122
+ } else if (!this.pending && this.cachedAriaLabel) {
123
+ this.setAttribute("aria-label", this.cachedAriaLabel);
124
+ } else if (!this.pending && this.cachedAriaLabel === "") {
125
+ this.removeAttribute("aria-label");
126
+ }
127
+ }
128
+ if (changed.has("disabled")) {
129
+ if (!this.disabled && this.pendingLabel !== this.getAttribute("aria-label")) {
130
+ if (this.pending) {
131
+ this.cachedAriaLabel = this.getAttribute("aria-label") || "";
132
+ this.setAttribute("aria-label", this.pendingLabel);
133
+ }
134
+ } else if (this.disabled && this.cachedAriaLabel) {
135
+ this.setAttribute("aria-label", this.cachedAriaLabel);
136
+ } else if (this.disabled && this.cachedAriaLabel == "") {
137
+ this.removeAttribute("aria-label");
138
+ }
139
+ }
140
+ }
141
+ renderButton() {
142
+ return html`
143
+ ${this.buttonContent}
144
+ ${when(this.pending, () => {
145
+ import("@spectrum-web-components/progress-circle/sp-progress-circle.js");
146
+ return html`
147
+ <sp-progress-circle
148
+ indeterminate
149
+ static="white"
150
+ aria-hidden="true"
151
+ ></sp-progress-circle>
152
+ `;
153
+ })}
154
+ `;
155
+ }
103
156
  }
157
+ __decorateClass([
158
+ property({ type: String, attribute: "pending-label" })
159
+ ], Button.prototype, "pendingLabel", 2);
160
+ __decorateClass([
161
+ property({ type: Boolean, reflect: true, attribute: true })
162
+ ], Button.prototype, "pending", 2);
104
163
  __decorateClass([
105
164
  property()
106
165
  ], Button.prototype, "variant", 1);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Button.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n PropertyValues,\n SizedMixin,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ButtonBase } from './ButtonBase.dev.js'\nimport buttonStyles from './button.css.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\nexport const VALID_STATICS = ['white', 'black'];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(ButtonBase, { noDefaultSize: true }) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"cta\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"variant='accent'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#variants'\n );\n }\n break;\n case 'overBackground':\n this.removeAttribute('variant');\n this.static = 'white';\n this.treatment = 'outline';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"overBackground\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='white'\" with \"treatment='outline'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case 'white':\n case 'black':\n this.static = variant;\n this.removeAttribute('variant');\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"black\" and \"white\" values of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='black'\" or \"static='white'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case null:\n return;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n @property({ type: String, reflect: true })\n public static: 'black' | 'white' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n public get quiet(): boolean {\n return this.treatment === 'outline';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n // There is no Spectrum design context for an `<sp-button>` without a variant\n // apply one manually when a consumer has not applied one themselves.\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;AAYA;AAAA,EAGI;AAAA,OACG;AACP,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,OAAO,kBAAkB;AAWlB,aAAM,iBAAiB;AAAA,EAC1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;AAAA,EAC7C;AAAA,EAgBA,IAAW,MAAM,OAAgB;AAC7B,SAAK,YAAY,QAAQ,YAAY;AAAA,EACzC;AAAA,EAEA,IAAW,QAAiB;AACxB,WAAO,KAAK,cAAc;AAAA,EAC9B;AAAA,EAEmB,aAAa,SAAqC;AACjE,UAAM,aAAa,OAAO;AAG1B,QAAI,CAAC,KAAK,aAAa,SAAS,GAAG;AAC/B,WAAK,aAAa,WAAW,KAAK,OAAO;AAAA,IAC7C;AAAA,EACJ;AACJ;AArFe;AAAA,EADV,SAAS;AAAA,GARD,OASE;AAyDJ;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAjEhC,OAkEF;AAMA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAvElB,OAwEF;AAMI;AAAA,EADV,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GA7ElB,OA8EE;",
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ButtonBase } from './ButtonBase.dev.js'\nimport buttonStyles from './button.css.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\nexport const VALID_STATICS = ['white', 'black'];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(ButtonBase, { noDefaultSize: true }) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n @property({ type: String, attribute: 'pending-label' })\n public pendingLabel = 'Pending';\n\n // pending is the property that consumers can use to set the button into a pending state\n @property({ type: Boolean, reflect: true, attribute: true })\n public pending = false;\n\n private cachedAriaLabel: string | null = null;\n\n public override click(): void {\n if (this.pending) {\n return;\n }\n super.click();\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"cta\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"variant='accent'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#variants'\n );\n }\n break;\n case 'overBackground':\n this.removeAttribute('variant');\n this.static = 'white';\n this.treatment = 'outline';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"overBackground\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='white'\" with \"treatment='outline'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case 'white':\n case 'black':\n this.static = variant;\n this.removeAttribute('variant');\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"black\" and \"white\" values of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='black'\" or \"static='white'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case null:\n return;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n @property({ type: String, reflect: true })\n public static: 'black' | 'white' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n public get quiet(): boolean {\n return this.treatment === 'outline';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n // There is no Spectrum design context for an `<sp-button>` without a variant\n // apply one manually when a consumer has not applied one themselves.\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n\n if (changed.has('pending')) {\n if (\n this.pending &&\n this.pendingLabel !== this.getAttribute('aria-label')\n ) {\n if (!this.disabled) {\n this.cachedAriaLabel =\n this.getAttribute('aria-label') || '';\n this.setAttribute('aria-label', this.pendingLabel);\n }\n } else if (!this.pending && this.cachedAriaLabel) {\n this.setAttribute('aria-label', this.cachedAriaLabel);\n } else if (!this.pending && this.cachedAriaLabel === '') {\n this.removeAttribute('aria-label');\n }\n }\n\n if (changed.has('disabled')) {\n if (\n !this.disabled &&\n this.pendingLabel !== this.getAttribute('aria-label')\n ) {\n if (this.pending) {\n this.cachedAriaLabel =\n this.getAttribute('aria-label') || '';\n this.setAttribute('aria-label', this.pendingLabel);\n }\n } else if (this.disabled && this.cachedAriaLabel) {\n this.setAttribute('aria-label', this.cachedAriaLabel);\n } else if (this.disabled && this.cachedAriaLabel == '') {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n protected override renderButton(): TemplateResult {\n return html`\n ${this.buttonContent}\n ${when(this.pending, () => {\n import(\n '@spectrum-web-components/progress-circle/sp-progress-circle.js'\n );\n return html`\n <sp-progress-circle\n indeterminate\n static=\"white\"\n aria-hidden=\"true\"\n ></sp-progress-circle>\n `;\n })}\n `;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,OAAO,kBAAkB;AACzB,SAAS,YAAY;AAWd,aAAM,iBAAiB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AACO,aAAM,gBAAgB,CAAC,SAAS,OAAO;AAUvC,aAAM,eAAe,WAAW,YAAY,EAAE,eAAe,KAAK,CAAC,EAAE;AAAA,EAArE;AAAA;AAMH,SAAO,eAAe;AAItB,SAAO,UAAU;AAEjB,SAAQ,kBAAiC;AAmEzC,SAAQ,WAA2B;AASnC,SAAO,YAA8B;AAAA;AAAA,EAvFrC,WAA2B,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,YAAY;AAAA,EACzC;AAAA,EAWgB,QAAc;AAC1B,QAAI,KAAK,SAAS;AACd;AAAA,IACJ;AACA,UAAM,MAAM;AAAA,EAChB;AAAA,EAMA,IAAW,UAA0B;AACjC,WAAO,KAAK;AAAA,EAChB;AAAA,EACA,IAAW,QAAQ,SAAyB;AACxC,QAAI,YAAY,KAAK;AAAS;AAE9B,SAAK,cAAc,WAAW,KAAK,OAAO;AAC1C,YAAQ,SAAS;AAAA,MACb,KAAK;AACD,aAAK,WAAW;AAChB,YAAI,MAAoB;AACpB,iBAAO,MAAM;AAAA,YACT;AAAA,YACA,kDAAkD,KAAK,SAAS;AAAA,YAChE;AAAA,UACJ;AAAA,QACJ;AACA;AAAA,MACJ,KAAK;AACD,aAAK,gBAAgB,SAAS;AAC9B,aAAK,SAAS;AACd,aAAK,YAAY;AACjB,YAAI,MAAoB;AACpB,iBAAO,MAAM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,MACrC;AAAA,IACJ;AAEA,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,UACI,CAAC,KAAK,YACN,KAAK,iBAAiB,KAAK,aAAa,YAAY,GACtD;AACE,YAAI,KAAK,SAAS;AACd,eAAK,kBACD,KAAK,aAAa,YAAY,KAAK;AACvC,eAAK,aAAa,cAAc,KAAK,YAAY;AAAA,QACrD;AAAA,MACJ,WAAW,KAAK,YAAY,KAAK,iBAAiB;AAC9C,aAAK,aAAa,cAAc,KAAK,eAAe;AAAA,MACxD,WAAW,KAAK,YAAY,KAAK,mBAAmB,IAAI;AACpD,aAAK,gBAAgB,YAAY;AAAA,MACrC;AAAA,IACJ;AAAA,EACJ;AAAA,EAEmB,eAA+B;AAC9C,WAAO;AAAA,cACD,KAAK,aAAa;AAAA,cAClB,KAAK,KAAK,SAAS,MAAM;AACvB,aACI,gEACJ;AACA,aAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOX,CAAC,CAAC;AAAA;AAAA,EAEV;AACJ;AAhKW;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB,CAAC;AAAA,GAL7C,OAMF;AAIA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,KAAK,CAAC;AAAA,GATlD,OAUF;AAeI;AAAA,EADV,SAAS;AAAA,GAxBD,OAyBE;AAyDJ;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAjFhC,OAkFF;AAMA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAvFlB,OAwFF;AAMI;AAAA,EADV,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GA7FlB,OA8FE;",
6
6
  "names": []
7
7
  }
package/src/Button.js CHANGED
@@ -1,2 +1,11 @@
1
- "use strict";var u=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var i=(s,a,t,r)=>{for(var e=r>1?void 0:r?l(a,t):a,o=s.length-1,c;o>=0;o--)(c=s[o])&&(e=(r?c(a,t,e):c(e))||e);return r&&e&&u(a,t,e),e};import{SizedMixin as p}from"@spectrum-web-components/base";import{property as n}from"@spectrum-web-components/base/src/decorators.js";import{ButtonBase as h}from"./ButtonBase.js";import d from"./button.css.js";export const VALID_VARIANTS=["accent","primary","secondary","negative","white","black"],VALID_STATICS=["white","black"];export class Button extends p(h,{noDefaultSize:!0}){constructor(){super(...arguments);this._variant="accent";this.treatment="fill"}static get styles(){return[...super.styles,d]}get variant(){return this._variant}set variant(t){if(t!==this.variant){switch(this.requestUpdate("variant",this.variant),t){case"cta":this._variant="accent";break;case"overBackground":this.removeAttribute("variant"),this.static="white",this.treatment="outline";return;case"white":case"black":this.static=t,this.removeAttribute("variant");return;case null:return;default:VALID_VARIANTS.includes(t)?this._variant=t:this._variant="accent";break}this.setAttribute("variant",this.variant)}}set quiet(t){this.treatment=t?"outline":"fill"}get quiet(){return this.treatment==="outline"}firstUpdated(t){super.firstUpdated(t),this.hasAttribute("variant")||this.setAttribute("variant",this.variant)}}i([n()],Button.prototype,"variant",1),i([n({type:String,reflect:!0})],Button.prototype,"static",2),i([n({reflect:!0})],Button.prototype,"treatment",2),i([n({type:Boolean})],Button.prototype,"quiet",1);
1
+ "use strict";var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=(n,r,t,s)=>{for(var e=s>1?void 0:s?h(r,t):r,l=n.length-1,o;l>=0;l--)(o=n[l])&&(e=(s?o(r,t,e):o(e))||e);return s&&e&&u(r,t,e),e};import{html as c,SizedMixin as d}from"@spectrum-web-components/base";import{property as a}from"@spectrum-web-components/base/src/decorators.js";import{ButtonBase as p}from"./ButtonBase.js";import b from"./button.css.js";import{when as m}from"@spectrum-web-components/base/src/directives.js";export const VALID_VARIANTS=["accent","primary","secondary","negative","white","black"],VALID_STATICS=["white","black"];export class Button extends d(p,{noDefaultSize:!0}){constructor(){super(...arguments);this.pendingLabel="Pending";this.pending=!1;this.cachedAriaLabel=null;this._variant="accent";this.treatment="fill"}static get styles(){return[...super.styles,b]}click(){this.pending||super.click()}get variant(){return this._variant}set variant(t){if(t!==this.variant){switch(this.requestUpdate("variant",this.variant),t){case"cta":this._variant="accent";break;case"overBackground":this.removeAttribute("variant"),this.static="white",this.treatment="outline";return;case"white":case"black":this.static=t,this.removeAttribute("variant");return;case null:return;default:VALID_VARIANTS.includes(t)?this._variant=t:this._variant="accent";break}this.setAttribute("variant",this.variant)}}set quiet(t){this.treatment=t?"outline":"fill"}get quiet(){return this.treatment==="outline"}firstUpdated(t){super.firstUpdated(t),this.hasAttribute("variant")||this.setAttribute("variant",this.variant)}updated(t){super.updated(t),t.has("pending")&&(this.pending&&this.pendingLabel!==this.getAttribute("aria-label")?this.disabled||(this.cachedAriaLabel=this.getAttribute("aria-label")||"",this.setAttribute("aria-label",this.pendingLabel)):!this.pending&&this.cachedAriaLabel?this.setAttribute("aria-label",this.cachedAriaLabel):!this.pending&&this.cachedAriaLabel===""&&this.removeAttribute("aria-label")),t.has("disabled")&&(!this.disabled&&this.pendingLabel!==this.getAttribute("aria-label")?this.pending&&(this.cachedAriaLabel=this.getAttribute("aria-label")||"",this.setAttribute("aria-label",this.pendingLabel)):this.disabled&&this.cachedAriaLabel?this.setAttribute("aria-label",this.cachedAriaLabel):this.disabled&&this.cachedAriaLabel==""&&this.removeAttribute("aria-label"))}renderButton(){return c`
2
+ ${this.buttonContent}
3
+ ${m(this.pending,()=>(import("@spectrum-web-components/progress-circle/sp-progress-circle.js"),c`
4
+ <sp-progress-circle
5
+ indeterminate
6
+ static="white"
7
+ aria-hidden="true"
8
+ ></sp-progress-circle>
9
+ `))}
10
+ `}}i([a({type:String,attribute:"pending-label"})],Button.prototype,"pendingLabel",2),i([a({type:Boolean,reflect:!0,attribute:!0})],Button.prototype,"pending",2),i([a()],Button.prototype,"variant",1),i([a({type:String,reflect:!0})],Button.prototype,"static",2),i([a({reflect:!0})],Button.prototype,"treatment",2),i([a({type:Boolean})],Button.prototype,"quiet",1);
2
11
  //# sourceMappingURL=Button.js.map
package/src/Button.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["Button.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n PropertyValues,\n SizedMixin,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ButtonBase } from './ButtonBase.js';\nimport buttonStyles from './button.css.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\nexport const VALID_STATICS = ['white', 'black'];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(ButtonBase, { noDefaultSize: true }) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"cta\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"variant='accent'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#variants'\n );\n }\n break;\n case 'overBackground':\n this.removeAttribute('variant');\n this.static = 'white';\n this.treatment = 'outline';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"overBackground\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='white'\" with \"treatment='outline'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case 'white':\n case 'black':\n this.static = variant;\n this.removeAttribute('variant');\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"black\" and \"white\" values of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='black'\" or \"static='white'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case null:\n return;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n @property({ type: String, reflect: true })\n public static: 'black' | 'white' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n public get quiet(): boolean {\n return this.treatment === 'outline';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n // There is no Spectrum design context for an `<sp-button>` without a variant\n // apply one manually when a consumer has not applied one themselves.\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n}\n"],
5
- "mappings": "qNAYA,OAGI,cAAAA,MACG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,cAAAC,MAAkB,kBAC3B,OAAOC,MAAkB,kBA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EE",
6
- "names": ["SizedMixin", "property", "ButtonBase", "buttonStyles", "variant", "quiet", "changes", "__decorateClass"]
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { ButtonBase } from './ButtonBase.js';\nimport buttonStyles from './button.css.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\nexport const VALID_STATICS = ['white', 'black'];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(ButtonBase, { noDefaultSize: true }) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n @property({ type: String, attribute: 'pending-label' })\n public pendingLabel = 'Pending';\n\n // pending is the property that consumers can use to set the button into a pending state\n @property({ type: Boolean, reflect: true, attribute: true })\n public pending = false;\n\n private cachedAriaLabel: string | null = null;\n\n public override click(): void {\n if (this.pending) {\n return;\n }\n super.click();\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"cta\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"variant='accent'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button/#variants'\n );\n }\n break;\n case 'overBackground':\n this.removeAttribute('variant');\n this.static = 'white';\n this.treatment = 'outline';\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"overBackground\" value of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='white'\" with \"treatment='outline'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case 'white':\n case 'black':\n this.static = variant;\n this.removeAttribute('variant');\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"black\" and \"white\" values of the \"variant\" attribute on <${this.localName}> has been deprecated and will be removed in a future release. Use \"static='black'\" or \"static='white'\" instead.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/button#static'\n );\n }\n return;\n case null:\n return;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n @property({ type: String, reflect: true })\n public static: 'black' | 'white' | undefined;\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n public get quiet(): boolean {\n return this.treatment === 'outline';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n // There is no Spectrum design context for an `<sp-button>` without a variant\n // apply one manually when a consumer has not applied one themselves.\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n\n if (changed.has('pending')) {\n if (\n this.pending &&\n this.pendingLabel !== this.getAttribute('aria-label')\n ) {\n if (!this.disabled) {\n this.cachedAriaLabel =\n this.getAttribute('aria-label') || '';\n this.setAttribute('aria-label', this.pendingLabel);\n }\n } else if (!this.pending && this.cachedAriaLabel) {\n this.setAttribute('aria-label', this.cachedAriaLabel);\n } else if (!this.pending && this.cachedAriaLabel === '') {\n this.removeAttribute('aria-label');\n }\n }\n\n if (changed.has('disabled')) {\n if (\n !this.disabled &&\n this.pendingLabel !== this.getAttribute('aria-label')\n ) {\n if (this.pending) {\n this.cachedAriaLabel =\n this.getAttribute('aria-label') || '';\n this.setAttribute('aria-label', this.pendingLabel);\n }\n } else if (this.disabled && this.cachedAriaLabel) {\n this.setAttribute('aria-label', this.cachedAriaLabel);\n } else if (this.disabled && this.cachedAriaLabel == '') {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n protected override renderButton(): TemplateResult {\n return html`\n ${this.buttonContent}\n ${when(this.pending, () => {\n import(\n '@spectrum-web-components/progress-circle/sp-progress-circle.js'\n );\n return html`\n <sp-progress-circle\n indeterminate\n static=\"white\"\n aria-hidden=\"true\"\n ></sp-progress-circle>\n `;\n })}\n `;\n }\n}\n"],
5
+ "mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,cAAAC,MAAkB,kBAC3B,OAAOC,MAAkB,kBACzB,OAAS,QAAAC,MAAY,kDAWd,aAAM,eAAiB,CAC1B,SACA,UACA,YACA,WACA,QACA,OACJ,EACa,cAAgB,CAAC,QAAS,OAAO,EAUvC,aAAM,eAAeJ,EAAWE,EAAY,CAAE,cAAe,EAAK,CAAC,CAAE,CAArE,kCAMH,KAAO,aAAe,UAItB,KAAO,QAAU,GAEjB,KAAQ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YAAY,GAIrCA,EAAQ,IAAI,UAAU,IAElB,CAAC,KAAK,UACN,KAAK,eAAiB,KAAK,aAAa,YAAY,EAEhD,KAAK,UACL,KAAK,gBACD,KAAK,aAAa,YAAY,GAAK,GACvC,KAAK,aAAa,aAAc,KAAK,YAAY,GAE9C,KAAK,UAAY,KAAK,gBAC7B,KAAK,aAAa,aAAc,KAAK,eAAe,EAC7C,KAAK,UAAY,KAAK,iBAAmB,IAChD,KAAK,gBAAgB,YAAY,EAG7C,CAEmB,cAA+B,CAC9C,OAAOT;AAAA,cACD,KAAK,aAAa;AAAA,cAClBK,EAAK,KAAK,QAAS,KACjB,OACI,gEACJ,EACOL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAOV,CAAC;AAAA,SAEV,CACJ,CAhKWU,EAAA,CADNR,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,GAL7C,OAMF,4BAIAQ,EAAA,CADNR,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,EAAK,CAAC,GATlD,OAUF,uBAeIQ,EAAA,CADVR,EAAS,GAxBD,OAyBE,uBAyDJQ,EAAA,CADNR,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAjFhC,OAkFF,sBAMAQ,EAAA,CADNR,EAAS,CAAE,QAAS,EAAK,CAAC,GAvFlB,OAwFF,yBAMIQ,EAAA,CADVR,EAAS,CAAE,KAAM,OAAQ,CAAC,GA7FlB,OA8FE",
6
+ "names": ["html", "SizedMixin", "property", "ButtonBase", "buttonStyles", "when", "variant", "quiet", "changes", "changed", "__decorateClass"]
7
7
  }
@@ -13,7 +13,7 @@ const styles = css`
13
13
  --spectrum-alias-ui-icon-cornertriangle-size-75
14
14
  );--spectrum-ui-icon-tshirt-size-width:var(
15
15
  --spectrum-alias-ui-icon-cornertriangle-size-75
16
- )}:host([size=m]){--spectrum-icon-tshirt-size-height:var(
16
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-s)}:host([size=m]){--spectrum-icon-tshirt-size-height:var(
17
17
  --spectrum-alias-workflow-icon-size-m
18
18
  );--spectrum-icon-tshirt-size-width:var(
19
19
  --spectrum-alias-workflow-icon-size-m
@@ -21,7 +21,7 @@ const styles = css`
21
21
  --spectrum-alias-ui-icon-cornertriangle-size-100
22
22
  );--spectrum-ui-icon-tshirt-size-width:var(
23
23
  --spectrum-alias-ui-icon-cornertriangle-size-100
24
- )}:host([size=l]){--spectrum-icon-tshirt-size-height:var(
24
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-m)}:host([size=l]){--spectrum-icon-tshirt-size-height:var(
25
25
  --spectrum-alias-workflow-icon-size-l
26
26
  );--spectrum-icon-tshirt-size-width:var(
27
27
  --spectrum-alias-workflow-icon-size-l
@@ -29,7 +29,7 @@ const styles = css`
29
29
  --spectrum-alias-ui-icon-cornertriangle-size-200
30
30
  );--spectrum-ui-icon-tshirt-size-width:var(
31
31
  --spectrum-alias-ui-icon-cornertriangle-size-200
32
- )}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(
32
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-l)}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(
33
33
  --spectrum-alias-workflow-icon-size-xl
34
34
  );--spectrum-icon-tshirt-size-width:var(
35
35
  --spectrum-alias-workflow-icon-size-xl
@@ -37,7 +37,7 @@ const styles = css`
37
37
  --spectrum-alias-ui-icon-cornertriangle-size-300
38
38
  );--spectrum-ui-icon-tshirt-size-width:var(
39
39
  --spectrum-alias-ui-icon-cornertriangle-size-300
40
- )}
40
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-xl)}
41
41
  `;
42
42
  export default styles;
43
43
  //# sourceMappingURL=button-base.css.dev.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["button-base.css.ts"],
4
- "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{inset:0;position:absolute}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(img),slot[name=icon]::slotted(svg){fill:currentcolor;stroke:currentcolor;height:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n);width:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n)}[icon-only]+#label{display:contents}:host([size=s]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n)}:host([size=m]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n)}:host([size=l]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n)}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n)}\n`;\nexport default styles;"],
4
+ "sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{inset:0;position:absolute}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(img),slot[name=icon]::slotted(svg){fill:currentcolor;stroke:currentcolor;height:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n);width:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n)}[icon-only]+#label{display:contents}:host([size=s]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-s)}:host([size=m]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-m)}:host([size=l]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-l)}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-xl)}\n`;\nexport default styles;"],
5
5
  "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuCf,eAAe;",
6
6
  "names": []
7
7
  }
@@ -11,7 +11,7 @@
11
11
  --spectrum-alias-ui-icon-cornertriangle-size-75
12
12
  );--spectrum-ui-icon-tshirt-size-width:var(
13
13
  --spectrum-alias-ui-icon-cornertriangle-size-75
14
- )}:host([size=m]){--spectrum-icon-tshirt-size-height:var(
14
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-s)}:host([size=m]){--spectrum-icon-tshirt-size-height:var(
15
15
  --spectrum-alias-workflow-icon-size-m
16
16
  );--spectrum-icon-tshirt-size-width:var(
17
17
  --spectrum-alias-workflow-icon-size-m
@@ -19,7 +19,7 @@
19
19
  --spectrum-alias-ui-icon-cornertriangle-size-100
20
20
  );--spectrum-ui-icon-tshirt-size-width:var(
21
21
  --spectrum-alias-ui-icon-cornertriangle-size-100
22
- )}:host([size=l]){--spectrum-icon-tshirt-size-height:var(
22
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-m)}:host([size=l]){--spectrum-icon-tshirt-size-height:var(
23
23
  --spectrum-alias-workflow-icon-size-l
24
24
  );--spectrum-icon-tshirt-size-width:var(
25
25
  --spectrum-alias-workflow-icon-size-l
@@ -27,7 +27,7 @@
27
27
  --spectrum-alias-ui-icon-cornertriangle-size-200
28
28
  );--spectrum-ui-icon-tshirt-size-width:var(
29
29
  --spectrum-alias-ui-icon-cornertriangle-size-200
30
- )}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(
30
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-l)}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(
31
31
  --spectrum-alias-workflow-icon-size-xl
32
32
  );--spectrum-icon-tshirt-size-width:var(
33
33
  --spectrum-alias-workflow-icon-size-xl
@@ -35,6 +35,6 @@
35
35
  --spectrum-alias-ui-icon-cornertriangle-size-300
36
36
  );--spectrum-ui-icon-tshirt-size-width:var(
37
37
  --spectrum-alias-ui-icon-cornertriangle-size-300
38
- )}
38
+ );--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-xl)}
39
39
  `;export default s;
40
40
  //# sourceMappingURL=button-base.css.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["button-base.css.ts"],
4
- "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{inset:0;position:absolute}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(img),slot[name=icon]::slotted(svg){fill:currentcolor;stroke:currentcolor;height:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n);width:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n)}[icon-only]+#label{display:contents}:host([size=s]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n)}:host([size=m]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n)}:host([size=l]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n)}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n)}\n`;\nexport default styles;"],
4
+ "sourcesContent": ["/*\nCopyright 2024 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{inset:0;position:absolute}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(img),slot[name=icon]::slotted(svg){fill:currentcolor;stroke:currentcolor;height:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n);width:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n)}[icon-only]+#label{display:contents}:host([size=s]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-s\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-75\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-s)}:host([size=m]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-m\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-100\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-m)}:host([size=l]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-l\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-200\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-l)}:host([size=xl]){--spectrum-icon-tshirt-size-height:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-icon-tshirt-size-width:var(\n--spectrum-alias-workflow-icon-size-xl\n);--spectrum-ui-icon-tshirt-size-height:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n);--spectrum-ui-icon-tshirt-size-width:var(\n--spectrum-alias-ui-icon-cornertriangle-size-300\n);--mod-progress-circle-size:var(--spectrum-alias-workflow-icon-size-xl)}\n`;\nexport default styles;"],
5
5
  "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuCf,eAAeC",
6
6
  "names": ["css", "styles"]
7
7
  }
@@ -11,13 +11,13 @@ const styles = css`
11
11
  --mod-animation-duration-100,var(--spectrum-animation-duration-100)
12
12
  ) ease-out,box-shadow var(
13
13
  --mod-animation-duration-100,var(--spectrum-animation-duration-100)
14
- ) ease-out;-webkit-user-select:none;user-select:none;vertical-align:top}:host(:focus){outline:none}:host([disabled]){cursor:default}:host:after{display:block;margin:calc(var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap))*-1);transition:opacity var(
14
+ ) ease-out;-webkit-user-select:none;user-select:none;vertical-align:top}:host(:focus){outline:none}:host([disabled]){cursor:default}:host:after{display:block;inset-block:0;inset-inline:0;margin:calc(var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap))*-1);transition:opacity var(
15
15
  --mod-animation-duration-100,var(--spectrum-animation-duration-100)
16
16
  ) ease-out,margin var(
17
17
  --mod-animation-duration-100,var(--spectrum-animation-duration-100)
18
18
  ) ease-out}:host(.focus-visible):after{margin:calc(var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap))*-2)}:host(:focus-visible):after{margin:calc(var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap))*-2)}#label{place-self:center;text-align:center}#label[hidden]{display:none}:host{--spectrum-button-animation-duration:var(
19
19
  --spectrum-animation-duration-100
20
- );--spectrum-button-border-radius:var(--spectrum-corner-radius-100);--spectrum-button-border-width:var(--spectrum-border-width-200);--spectrum-button-line-height:1.2;--spectrum-button-focus-ring-border-radius:calc(var(--spectrum-button-border-radius) + var(--spectrum-button-focus-ring-gap));--spectrum-button-focus-ring-gap:var(--spectrum-focus-indicator-gap);--spectrum-button-focus-ring-thickness:var(
20
+ );--spectrum-button-border-radius:var(--spectrum-corner-radius-100);--spectrum-button-border-width:var(--spectrum-border-width-200);--spectrum-button-line-height:1.2;--spectrum-button-focus-ring-gap:var(--spectrum-focus-indicator-gap);--spectrum-button-focus-ring-border-radius:calc(var(--spectrum-button-border-radius) + var(--spectrum-button-focus-ring-gap));--spectrum-button-focus-ring-thickness:var(
21
21
  --spectrum-focus-indicator-thickness
22
22
  );--spectrum-button-focus-indicator-color:var(
23
23
  --spectrum-focus-indicator-color
@@ -158,7 +158,7 @@ var(--spectrum-button-border-width)
158
158
  --highcontrast-button-content-color-down,var(
159
159
  --mod-button-content-color-down,var(--spectrum-button-content-color-down)
160
160
  )
161
- )}:host([disabled]){background-color:var(
161
+ )}:host .is-disabled,:host([disabled]){background-color:var(
162
162
  --highcontrast-button-background-color-disabled,var(
163
163
  --mod-button-background-color-disabled,var(--spectrum-button-background-color-disabled)
164
164
  )
@@ -800,7 +800,19 @@ var(--spectrum-button-border-width)
800
800
  --system-spectrum-button-staticblack-secondary-outline-border-color-disabled
801
801
  );--spectrum-button-content-color-disabled:var(
802
802
  --system-spectrum-button-staticblack-secondary-outline-content-color-disabled
803
- )}@media (forced-colors:active){:host([treatment][disabled]){border-color:graytext}:host([treatment]:not([disabled]):hover){border-color:highlight}}
803
+ )}@media (forced-colors:active){:host([treatment][disabled]){border-color:graytext}:host([treatment]:not([disabled]):hover){border-color:highlight}}@keyframes show-progress-circle{0%{visibility:hidden}to{visibility:visible}}@keyframes hide-icons-label{0%{visibility:visible}to{visibility:hidden}}@keyframes update-pending-button-styles{to{background-color:var(
804
+ --highcontrast-button-background-color-disabled,var(
805
+ --mod-button-background-color-disabled,var(--spectrum-button-background-color-disabled)
806
+ )
807
+ );border-color:var(
808
+ --highcontrast-button-border-color-disabled,var(
809
+ --mod-button-border-color-disabled,var(--spectrum-button-border-color-disabled)
810
+ )
811
+ );color:var(
812
+ --highcontrast-button-content-color-disabled,var(
813
+ --mod-button-content-color-disabled,var(--spectrum-button-content-color-disabled)
814
+ )
815
+ )}}:host([pending]:not([disabled])){animation:update-pending-button-styles 0s var(--pending-delay,1s) forwards;cursor:default;pointer-events:none}sp-progress-circle{display:block;left:50%;position:absolute;transform:translate(-50%);visibility:hidden}:host([pending]:not([disabled])) sp-progress-circle{animation:show-progress-circle 0s var(--pending-delay,1s) forwards}:host([pending]:not([disabled])) #label,:host([pending]:not([disabled])) slot[name=icon]{animation:hide-icons-label 0s var(--pending-delay,1s) forwards}
804
816
  `;
805
817
  export default styles;
806
818
  //# sourceMappingURL=button.css.dev.js.map