@spectrum-web-components/action-button 1.1.0-beta.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +22 -0
  2. package/package.json +8 -8
  3. package/sp-action-button.d.ts +0 -6
  4. package/sp-action-button.dev.js +0 -5
  5. package/sp-action-button.dev.js.map +0 -7
  6. package/sp-action-button.js +0 -2
  7. package/sp-action-button.js.map +0 -7
  8. package/src/ActionButton.d.ts +0 -67
  9. package/src/ActionButton.dev.js +0 -229
  10. package/src/ActionButton.dev.js.map +0 -7
  11. package/src/ActionButton.js +0 -6
  12. package/src/ActionButton.js.map +0 -7
  13. package/src/action-button-overrides.css.d.ts +0 -2
  14. package/src/action-button-overrides.css.dev.js +0 -7
  15. package/src/action-button-overrides.css.dev.js.map +0 -7
  16. package/src/action-button-overrides.css.js +0 -4
  17. package/src/action-button-overrides.css.js.map +0 -7
  18. package/src/action-button.css.d.ts +0 -2
  19. package/src/action-button.css.dev.js +0 -7
  20. package/src/action-button.css.dev.js.map +0 -7
  21. package/src/action-button.css.js +0 -4
  22. package/src/action-button.css.js.map +0 -7
  23. package/src/index.d.ts +0 -1
  24. package/src/index.dev.js +0 -3
  25. package/src/index.dev.js.map +0 -7
  26. package/src/index.js +0 -2
  27. package/src/index.js.map +0 -7
  28. package/src/spectrum-action-button.css.d.ts +0 -2
  29. package/src/spectrum-action-button.css.dev.js +0 -7
  30. package/src/spectrum-action-button.css.dev.js.map +0 -7
  31. package/src/spectrum-action-button.css.js +0 -4
  32. package/src/spectrum-action-button.css.js.map +0 -7
  33. package/stories/action-button-black-quiet.stories.js +0 -41
  34. package/stories/action-button-black-quiet.stories.js.map +0 -7
  35. package/stories/action-button-black.stories.js +0 -35
  36. package/stories/action-button-black.stories.js.map +0 -7
  37. package/stories/action-button-emphasized-quiet.stories.js +0 -39
  38. package/stories/action-button-emphasized-quiet.stories.js.map +0 -7
  39. package/stories/action-button-emphasized.stories.js +0 -33
  40. package/stories/action-button-emphasized.stories.js.map +0 -7
  41. package/stories/action-button-quiet.stories.js +0 -33
  42. package/stories/action-button-quiet.stories.js.map +0 -7
  43. package/stories/action-button-standard.stories.js +0 -27
  44. package/stories/action-button-standard.stories.js.map +0 -7
  45. package/stories/action-button-white-quiet.stories.js +0 -41
  46. package/stories/action-button-white-quiet.stories.js.map +0 -7
  47. package/stories/action-button-white.stories.js +0 -35
  48. package/stories/action-button-white.stories.js.map +0 -7
  49. package/stories/action-button.stories.js +0 -31
  50. package/stories/action-button.stories.js.map +0 -7
  51. package/stories/index.js +0 -85
  52. package/stories/index.js.map +0 -7
  53. package/test/action-button-black-quiet.test-vrt.js +0 -5
  54. package/test/action-button-black-quiet.test-vrt.js.map +0 -7
  55. package/test/action-button-black.test-vrt.js +0 -5
  56. package/test/action-button-black.test-vrt.js.map +0 -7
  57. package/test/action-button-emphasized-quiet.test-vrt.js +0 -5
  58. package/test/action-button-emphasized-quiet.test-vrt.js.map +0 -7
  59. package/test/action-button-emphasized.test-vrt.js +0 -5
  60. package/test/action-button-emphasized.test-vrt.js.map +0 -7
  61. package/test/action-button-memory.test.js +0 -5
  62. package/test/action-button-memory.test.js.map +0 -7
  63. package/test/action-button-quiet.test-vrt.js +0 -5
  64. package/test/action-button-quiet.test-vrt.js.map +0 -7
  65. package/test/action-button-standard.test-vrt.js +0 -5
  66. package/test/action-button-standard.test-vrt.js.map +0 -7
  67. package/test/action-button-white-quiet.test-vrt.js +0 -5
  68. package/test/action-button-white-quiet.test-vrt.js.map +0 -7
  69. package/test/action-button-white.test-vrt.js +0 -5
  70. package/test/action-button-white.test-vrt.js.map +0 -7
  71. package/test/action-button.test-vrt.js +0 -5
  72. package/test/action-button.test-vrt.js.map +0 -7
  73. package/test/action-button.test.js +0 -244
  74. package/test/action-button.test.js.map +0 -7
  75. package/test/benchmark/basic-test.js +0 -19
  76. package/test/benchmark/basic-test.js.map +0 -7
package/README.md CHANGED
@@ -540,3 +540,25 @@ With the application of the `toggles` attribute, the button will self manage its
540
540
  </div>
541
541
  </div>
542
542
  ```
543
+
544
+ ## Handling events
545
+
546
+ Events handlers for clicks and other user actions can be registered on a
547
+ `<sp-action-button>` as on a standard HTML `<button>` element.
548
+
549
+ ```html
550
+ <sp-button onclick="spAlert(this, '<sp-action-button> clicked!')">
551
+ Click me
552
+ </sp-button>
553
+ ```
554
+
555
+ In addition to handling events like a native `<button>` HTML element, one can also use a `<sp-action-button>` in place of the `<a>` HTML element by using the `href` and optional `target` attribute.
556
+
557
+ ```html
558
+ <sp-action-button
559
+ href="https://github.com/adobe/spectrum-web-components"
560
+ target="_blank"
561
+ >
562
+ Click me
563
+ </sp-action-button>
564
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/action-button",
3
- "version": "1.1.0-beta.8",
3
+ "version": "1.1.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -58,14 +58,14 @@
58
58
  "lit-html"
59
59
  ],
60
60
  "dependencies": {
61
- "@spectrum-web-components/base": "^1.1.0-beta.8",
62
- "@spectrum-web-components/button": "^1.1.0-beta.8",
63
- "@spectrum-web-components/icon": "^1.1.0-beta.8",
64
- "@spectrum-web-components/icons-ui": "^1.1.0-beta.8",
65
- "@spectrum-web-components/shared": "^1.1.0-beta.8"
61
+ "@spectrum-web-components/base": "^1.1.0",
62
+ "@spectrum-web-components/button": "^1.1.0",
63
+ "@spectrum-web-components/icon": "^1.1.0",
64
+ "@spectrum-web-components/icons-ui": "^1.1.0",
65
+ "@spectrum-web-components/shared": "^1.1.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@spectrum-css/actionbutton": "^7.0.0-s2-foundations.22"
68
+ "@spectrum-css/actionbutton": "7.0.0-s2-foundations.22"
69
69
  },
70
70
  "types": "./src/index.d.ts",
71
71
  "customElements": "custom-elements.json",
@@ -73,5 +73,5 @@
73
73
  "./sp-*.js",
74
74
  "./**/*.dev.js"
75
75
  ],
76
- "gitHead": "19d5d5747da9d5b167173b571ead76225fc09319"
76
+ "gitHead": "e3c6e52501451acc6fa85b10dd718267b80a01ab"
77
77
  }
@@ -1,6 +0,0 @@
1
- import { ActionButton } from './src/ActionButton.js';
2
- declare global {
3
- interface HTMLElementTagNameMap {
4
- 'sp-action-button': ActionButton;
5
- }
6
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
- import { ActionButton } from "./src/ActionButton.dev.js";
3
- import { defineElement } from "@spectrum-web-components/base/src/define-element.js";
4
- defineElement("sp-action-button", ActionButton);
5
- //# sourceMappingURL=sp-action-button.dev.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["sp-action-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 { ActionButton } from './src/ActionButton.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-action-button', ActionButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-button': ActionButton;\n }\n}\n"],
5
- "mappings": ";AAYA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAE9B,cAAc,oBAAoB,YAAY;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";import{ActionButton as t}from"./src/ActionButton.js";import{defineElement as o}from"@spectrum-web-components/base/src/define-element.js";o("sp-action-button",t);
2
- //# sourceMappingURL=sp-action-button.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["sp-action-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 { ActionButton } from './src/ActionButton.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-action-button', ActionButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-action-button': ActionButton;\n }\n}\n"],
5
- "mappings": "aAYA,OAAS,gBAAAA,MAAoB,wBAC7B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,mBAAoBD,CAAY",
6
- "names": ["ActionButton", "defineElement"]
7
- }
@@ -1,67 +0,0 @@
1
- import { CSSResultArray, PropertyValues, TemplateResult } from '@spectrum-web-components/base';
2
- import { ButtonBase } from '@spectrum-web-components/button';
3
- import '@spectrum-web-components/icons-ui/icons/sp-icon-corner-triangle300.js';
4
- export declare const LONGPRESS_DURATION = 300;
5
- export type LongpressEvent = {
6
- source: 'pointer' | 'keyboard';
7
- };
8
- declare const ActionButton_base: typeof ButtonBase & {
9
- new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
10
- prototype: import("@spectrum-web-components/base").SizedElementInterface;
11
- };
12
- /**
13
- * @element sp-action-button
14
- *
15
- * @slot - text label of the Action Button
16
- * @slot icon - The icon to use for Action Button
17
- * @fires change - Announces a change in the `selected` property of an action button
18
- * @fires longpress - Synthesizes a "longpress" interaction that signifies a
19
- * `pointerdown` event that is >=300ms or a keyboard event where code is `Space` or code is `ArrowDown`
20
- * while `altKey===true`.
21
- */
22
- export declare class ActionButton extends ActionButton_base {
23
- static get styles(): CSSResultArray;
24
- emphasized: boolean;
25
- holdAffordance: boolean;
26
- quiet: boolean;
27
- role: string;
28
- /**
29
- * Whether an Action Button with `role='button'`
30
- * should also be `aria-pressed='true'`
31
- */
32
- selected: boolean;
33
- /**
34
- * Whether to automatically manage the `selected`
35
- * attribute on interaction and whether `aria-pressed="false"`
36
- * should be used when `selected === false`
37
- */
38
- toggles: boolean;
39
- /**
40
- * The static color variant to use for the action button.
41
- */
42
- staticColor?: 'white' | 'black';
43
- get value(): string;
44
- set value(value: string);
45
- private _value;
46
- /**
47
- * @private
48
- */
49
- get itemText(): string;
50
- constructor();
51
- private onClick;
52
- private handlePointerdownHoldAffordance;
53
- private handlePointerupHoldAffordance;
54
- /**
55
- * @private
56
- */
57
- protected handleKeydown(event: KeyboardEvent): void;
58
- protected handleKeyup(event: KeyboardEvent): void;
59
- protected get buttonContent(): TemplateResult[];
60
- protected updated(changes: PropertyValues): void;
61
- }
62
- declare global {
63
- interface GlobalEventHandlersEventMap {
64
- longpress: CustomEvent<LongpressEvent>;
65
- }
66
- }
67
- export {};
@@ -1,229 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __decorateClass = (decorators, target, key, kind) => {
5
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
6
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
7
- if (decorator = decorators[i])
8
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9
- if (kind && result) __defProp(target, key, result);
10
- return result;
11
- };
12
- import {
13
- html,
14
- SizedMixin
15
- } from "@spectrum-web-components/base";
16
- import { property } from "@spectrum-web-components/base/src/decorators.js";
17
- import { ButtonBase } from "@spectrum-web-components/button";
18
- import buttonStyles from "./action-button.css.js";
19
- import cornerTriangleStyles from "@spectrum-web-components/icon/src/spectrum-icon-corner-triangle.css.js";
20
- import cornerTriangleOverrides from "@spectrum-web-components/icon/src/icon-corner-triangle-overrides.css.js";
21
- import "@spectrum-web-components/icons-ui/icons/sp-icon-corner-triangle300.js";
22
- const holdAffordanceClass = {
23
- xs: "spectrum-UIIcon-CornerTriangle75",
24
- s: "spectrum-UIIcon-CornerTriangle75",
25
- m: "spectrum-UIIcon-CornerTriangle100",
26
- l: "spectrum-UIIcon-CornerTriangle200",
27
- xl: "spectrum-UIIcon-CornerTriangle300"
28
- };
29
- export const LONGPRESS_DURATION = 300;
30
- let LONGPRESS_TIMEOUT;
31
- export class ActionButton extends SizedMixin(ButtonBase, {
32
- validSizes: ["xs", "s", "m", "l", "xl"],
33
- noDefaultSize: true
34
- }) {
35
- constructor() {
36
- super();
37
- this.emphasized = false;
38
- this.holdAffordance = false;
39
- this.quiet = false;
40
- this.role = "button";
41
- this.selected = false;
42
- this.toggles = false;
43
- this._value = "";
44
- this.onClick = () => {
45
- if (!this.toggles) {
46
- return;
47
- }
48
- this.selected = !this.selected;
49
- const applyDefault = this.dispatchEvent(
50
- new Event("change", {
51
- cancelable: true,
52
- bubbles: true,
53
- composed: true
54
- })
55
- );
56
- if (!applyDefault) {
57
- this.selected = !this.selected;
58
- }
59
- };
60
- this.addEventListener("click", this.onClick);
61
- }
62
- static get styles() {
63
- return [
64
- ...super.styles,
65
- buttonStyles,
66
- cornerTriangleStyles,
67
- cornerTriangleOverrides
68
- ];
69
- }
70
- get value() {
71
- return this._value || this.itemText;
72
- }
73
- set value(value) {
74
- if (value === this._value) {
75
- return;
76
- }
77
- this._value = value || "";
78
- if (this._value) {
79
- this.setAttribute("value", this._value);
80
- } else {
81
- this.removeAttribute("value");
82
- }
83
- }
84
- /**
85
- * @private
86
- */
87
- get itemText() {
88
- return (this.textContent || /* c8 ignore next */
89
- "").trim();
90
- }
91
- handlePointerdownHoldAffordance(event) {
92
- if (event.button !== 0) return;
93
- this.addEventListener("pointerup", this.handlePointerupHoldAffordance);
94
- this.addEventListener(
95
- "pointercancel",
96
- this.handlePointerupHoldAffordance
97
- );
98
- LONGPRESS_TIMEOUT = setTimeout(() => {
99
- this.dispatchEvent(
100
- new CustomEvent("longpress", {
101
- bubbles: true,
102
- composed: true,
103
- detail: {
104
- source: "pointer"
105
- }
106
- })
107
- );
108
- }, LONGPRESS_DURATION);
109
- }
110
- handlePointerupHoldAffordance() {
111
- clearTimeout(LONGPRESS_TIMEOUT);
112
- this.removeEventListener(
113
- "pointerup",
114
- this.handlePointerupHoldAffordance
115
- );
116
- this.removeEventListener(
117
- "pointercancel",
118
- this.handlePointerupHoldAffordance
119
- );
120
- }
121
- /**
122
- * @private
123
- */
124
- handleKeydown(event) {
125
- if (!this.holdAffordance) {
126
- return super.handleKeydown(event);
127
- }
128
- const { code, altKey } = event;
129
- if (code === "Space" || altKey && code === "ArrowDown") {
130
- event.preventDefault();
131
- if (code === "ArrowDown") {
132
- event.stopPropagation();
133
- event.stopImmediatePropagation();
134
- }
135
- this.addEventListener("keyup", this.handleKeyup);
136
- this.active = true;
137
- }
138
- }
139
- handleKeyup(event) {
140
- if (!this.holdAffordance) {
141
- return super.handleKeyup(event);
142
- }
143
- const { code, altKey } = event;
144
- if (code === "Space" || altKey && code === "ArrowDown") {
145
- event.stopPropagation();
146
- this.dispatchEvent(
147
- new CustomEvent("longpress", {
148
- bubbles: true,
149
- composed: true,
150
- detail: {
151
- source: "keyboard"
152
- }
153
- })
154
- );
155
- this.active = false;
156
- }
157
- }
158
- get buttonContent() {
159
- const buttonContent = super.buttonContent;
160
- if (this.holdAffordance) {
161
- buttonContent.unshift(html`
162
- <sp-icon-corner-triangle300
163
- class="hold-affordance ${holdAffordanceClass[this.size]}"
164
- ></sp-icon-corner-triangle300>
165
- `);
166
- }
167
- return buttonContent;
168
- }
169
- updated(changes) {
170
- super.updated(changes);
171
- const isButton = this.role === "button";
172
- const canBePressed = isButton && (this.selected || this.toggles) && !(this.hasAttribute("aria-haspopup") && this.hasAttribute("aria-expanded"));
173
- if (changes.has("selected") || changes.has("role")) {
174
- if (canBePressed) {
175
- this.setAttribute(
176
- "aria-pressed",
177
- this.selected ? "true" : "false"
178
- );
179
- } else {
180
- this.removeAttribute("aria-pressed");
181
- if (isButton && this.toggles && this.hasAttribute("aria-expanded")) {
182
- this.setAttribute(
183
- "aria-expanded",
184
- this.selected ? "true" : "false"
185
- );
186
- }
187
- }
188
- }
189
- if (changes.has("holdAffordance")) {
190
- if (this.holdAffordance) {
191
- this.addEventListener(
192
- "pointerdown",
193
- this.handlePointerdownHoldAffordance
194
- );
195
- } else {
196
- this.removeEventListener(
197
- "pointerdown",
198
- this.handlePointerdownHoldAffordance
199
- );
200
- this.handlePointerupHoldAffordance();
201
- }
202
- }
203
- }
204
- }
205
- __decorateClass([
206
- property({ type: Boolean, reflect: true })
207
- ], ActionButton.prototype, "emphasized", 2);
208
- __decorateClass([
209
- property({ type: Boolean, reflect: true, attribute: "hold-affordance" })
210
- ], ActionButton.prototype, "holdAffordance", 2);
211
- __decorateClass([
212
- property({ type: Boolean, reflect: true })
213
- ], ActionButton.prototype, "quiet", 2);
214
- __decorateClass([
215
- property({ reflect: true })
216
- ], ActionButton.prototype, "role", 2);
217
- __decorateClass([
218
- property({ type: Boolean, reflect: true })
219
- ], ActionButton.prototype, "selected", 2);
220
- __decorateClass([
221
- property({ type: Boolean, reflect: true })
222
- ], ActionButton.prototype, "toggles", 2);
223
- __decorateClass([
224
- property({ reflect: true, attribute: "static-color" })
225
- ], ActionButton.prototype, "staticColor", 2);
226
- __decorateClass([
227
- property({ type: String })
228
- ], ActionButton.prototype, "value", 1);
229
- //# sourceMappingURL=ActionButton.dev.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["ActionButton.ts"],
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*/\n\nimport {\n CSSResultArray,\n DefaultElementSize,\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 '@spectrum-web-components/button';\nimport buttonStyles from './action-button.css.js';\nimport cornerTriangleStyles from '@spectrum-web-components/icon/src/spectrum-icon-corner-triangle.css.js';\nimport cornerTriangleOverrides from '@spectrum-web-components/icon/src/icon-corner-triangle-overrides.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-corner-triangle300.js';\n\nconst holdAffordanceClass = {\n xs: 'spectrum-UIIcon-CornerTriangle75',\n s: 'spectrum-UIIcon-CornerTriangle75',\n m: 'spectrum-UIIcon-CornerTriangle100',\n l: 'spectrum-UIIcon-CornerTriangle200',\n xl: 'spectrum-UIIcon-CornerTriangle300',\n};\n\nexport const LONGPRESS_DURATION = 300;\nlet LONGPRESS_TIMEOUT: ReturnType<typeof setTimeout>;\n\nexport type LongpressEvent = {\n source: 'pointer' | 'keyboard';\n};\n\n/**\n * @element sp-action-button\n *\n * @slot - text label of the Action Button\n * @slot icon - The icon to use for Action Button\n * @fires change - Announces a change in the `selected` property of an action button\n * @fires longpress - Synthesizes a \"longpress\" interaction that signifies a\n * `pointerdown` event that is >=300ms or a keyboard event where code is `Space` or code is `ArrowDown`\n * while `altKey===true`.\n */\nexport class ActionButton extends SizedMixin(ButtonBase, {\n validSizes: ['xs', 's', 'm', 'l', 'xl'],\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [\n ...super.styles,\n buttonStyles,\n cornerTriangleStyles,\n cornerTriangleOverrides,\n ];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'hold-affordance' })\n public holdAffordance = false;\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n @property({ reflect: true })\n public override role = 'button';\n\n /**\n * Whether an Action Button with `role='button'`\n * should also be `aria-pressed='true'`\n */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /**\n * Whether to automatically manage the `selected`\n * attribute on interaction and whether `aria-pressed=\"false\"`\n * should be used when `selected === false`\n */\n @property({ type: Boolean, reflect: true })\n public toggles = false;\n\n /**\n * The static color variant to use for the action button.\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\n\n @property({ type: String })\n public get value(): string {\n return this._value || this.itemText;\n }\n public set value(value: string) {\n if (value === this._value) {\n return;\n }\n this._value = value || '';\n if (this._value) {\n this.setAttribute('value', this._value);\n } else {\n this.removeAttribute('value');\n }\n }\n private _value = '';\n\n /**\n * @private\n */\n public get itemText(): string {\n return (this.textContent || /* c8 ignore next */ '').trim();\n }\n\n constructor() {\n super();\n this.addEventListener('click', this.onClick);\n }\n\n private onClick = (): void => {\n if (!this.toggles) {\n return;\n }\n this.selected = !this.selected;\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n cancelable: true,\n bubbles: true,\n composed: true,\n })\n );\n if (!applyDefault) {\n this.selected = !this.selected;\n }\n };\n\n private handlePointerdownHoldAffordance(event: PointerEvent): void {\n if (event.button !== 0) return;\n this.addEventListener('pointerup', this.handlePointerupHoldAffordance);\n this.addEventListener(\n 'pointercancel',\n this.handlePointerupHoldAffordance\n );\n LONGPRESS_TIMEOUT = setTimeout(() => {\n this.dispatchEvent(\n new CustomEvent<LongpressEvent>('longpress', {\n bubbles: true,\n composed: true,\n detail: {\n source: 'pointer',\n },\n })\n );\n }, LONGPRESS_DURATION);\n }\n\n private handlePointerupHoldAffordance(): void {\n clearTimeout(LONGPRESS_TIMEOUT);\n this.removeEventListener(\n 'pointerup',\n this.handlePointerupHoldAffordance\n );\n this.removeEventListener(\n 'pointercancel',\n this.handlePointerupHoldAffordance\n );\n }\n\n /**\n * @private\n */\n protected override handleKeydown(event: KeyboardEvent): void {\n if (!this.holdAffordance) {\n return super.handleKeydown(event);\n }\n const { code, altKey } = event;\n if (code === 'Space' || (altKey && code === 'ArrowDown')) {\n event.preventDefault();\n if (code === 'ArrowDown') {\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n this.addEventListener('keyup', this.handleKeyup);\n this.active = true;\n }\n }\n\n protected override handleKeyup(event: KeyboardEvent): void {\n if (!this.holdAffordance) {\n return super.handleKeyup(event);\n }\n const { code, altKey } = event;\n if (code === 'Space' || (altKey && code === 'ArrowDown')) {\n event.stopPropagation();\n this.dispatchEvent(\n new CustomEvent<LongpressEvent>('longpress', {\n bubbles: true,\n composed: true,\n detail: {\n source: 'keyboard',\n },\n })\n );\n this.active = false;\n }\n }\n\n protected override get buttonContent(): TemplateResult[] {\n const buttonContent = super.buttonContent;\n if (this.holdAffordance) {\n buttonContent.unshift(html`\n <sp-icon-corner-triangle300\n class=\"hold-affordance ${holdAffordanceClass[\n this.size as DefaultElementSize\n ]}\"\n ></sp-icon-corner-triangle300>\n `);\n }\n return buttonContent;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n const isButton = this.role === 'button';\n const canBePressed =\n isButton &&\n (this.selected || this.toggles) &&\n !(\n this.hasAttribute('aria-haspopup') &&\n this.hasAttribute('aria-expanded')\n );\n if (changes.has('selected') || changes.has('role')) {\n // When role !== 'button' then the Action Button is within\n // an Action Group that manages selects which means the\n // Action Button is a \"checkbox\" or \"radio\" and cannot\n // accept the `aria-pressed` attribute.\n if (canBePressed) {\n this.setAttribute(\n 'aria-pressed',\n this.selected ? 'true' : 'false'\n );\n } else {\n // When !this.toggles the lack of \"aria-pressed\" is inconsequential.\n this.removeAttribute('aria-pressed');\n if (\n isButton &&\n this.toggles &&\n this.hasAttribute('aria-expanded')\n ) {\n this.setAttribute(\n 'aria-expanded',\n this.selected ? 'true' : 'false'\n );\n }\n }\n }\n if (changes.has('holdAffordance')) {\n if (this.holdAffordance) {\n this.addEventListener(\n 'pointerdown',\n this.handlePointerdownHoldAffordance\n );\n } else {\n this.removeEventListener(\n 'pointerdown',\n this.handlePointerdownHoldAffordance\n );\n this.handlePointerupHoldAffordance();\n }\n }\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n longpress: CustomEvent<LongpressEvent>;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAYA;AAAA,EAGI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,OAAO,kBAAkB;AACzB,OAAO,0BAA0B;AACjC,OAAO,6BAA6B;AACpC,OAAO;AAEP,MAAM,sBAAsB;AAAA,EACxB,IAAI;AAAA,EACJ,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,IAAI;AACR;AAEO,aAAM,qBAAqB;AAClC,IAAI;AAgBG,aAAM,qBAAqB,WAAW,YAAY;AAAA,EACrD,YAAY,CAAC,MAAM,KAAK,KAAK,KAAK,IAAI;AAAA,EACtC,eAAe;AACnB,CAAC,EAAE;AAAA,EAmEC,cAAc;AACV,UAAM;AAzDV,SAAO,aAAa;AAGpB,SAAO,iBAAiB;AAGxB,SAAO,QAAQ;AAGf,SAAgB,OAAO;AAOvB,SAAO,WAAW;AAQlB,SAAO,UAAU;AAuBjB,SAAQ,SAAS;AAcjB,SAAQ,UAAU,MAAY;AAC1B,UAAI,CAAC,KAAK,SAAS;AACf;AAAA,MACJ;AACA,WAAK,WAAW,CAAC,KAAK;AACtB,YAAM,eAAe,KAAK;AAAA,QACtB,IAAI,MAAM,UAAU;AAAA,UAChB,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,UAAU;AAAA,QACd,CAAC;AAAA,MACL;AACA,UAAI,CAAC,cAAc;AACf,aAAK,WAAW,CAAC,KAAK;AAAA,MAC1B;AAAA,IACJ;AAlBI,SAAK,iBAAiB,SAAS,KAAK,OAAO;AAAA,EAC/C;AAAA,EArEA,WAA2B,SAAyB;AAChD,WAAO;AAAA,MACH,GAAG,MAAM;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAAA,E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AAI,KAAK,gBAAgB;AACrB,aAAK;AAAA,UACD;AAAA,UACA,KAAK;AAAA,QACT;AAAA,MACJ,OAAO;AACH,aAAK;AAAA,UACD;AAAA,UACA,KAAK;AAAA,QACT;AACA,aAAK,8BAA8B;AAAA,MACvC;AAAA,IACJ;AAAA,EACJ;AACJ;AArNW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAbjC,aAcF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,kBAAkB,CAAC;AAAA,GAhB/D,aAiBF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAnBjC,aAoBF;AAGS;AAAA,EADf,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAtBlB,aAuBO;AAOT;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GA7BjC,aA8BF;AAQA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GArCjC,aAsCF;AAMA;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,eAAe,CAAC;AAAA,GA3C7C,aA4CF;AAGI;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA9CjB,aA+CE;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- "use strict";var p=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var o=(n,i,e,t)=>{for(var r=t>1?void 0:t?u(i,e):i,l=n.length-1,a;l>=0;l--)(a=n[l])&&(r=(t?a(i,e,r):a(r))||r);return t&&r&&p(i,e,r),r};import{html as c,SizedMixin as h}from"@spectrum-web-components/base";import{property as s}from"@spectrum-web-components/base/src/decorators.js";import{ButtonBase as f}from"@spectrum-web-components/button";import v from"./action-button.css.js";import b from"@spectrum-web-components/icon/src/spectrum-icon-corner-triangle.css.js";import m from"@spectrum-web-components/icon/src/icon-corner-triangle-overrides.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-corner-triangle300.js";const g={xs:"spectrum-UIIcon-CornerTriangle75",s:"spectrum-UIIcon-CornerTriangle75",m:"spectrum-UIIcon-CornerTriangle100",l:"spectrum-UIIcon-CornerTriangle200",xl:"spectrum-UIIcon-CornerTriangle300"};export const LONGPRESS_DURATION=300;let d;export class ActionButton extends h(f,{validSizes:["xs","s","m","l","xl"],noDefaultSize:!0}){constructor(){super();this.emphasized=!1;this.holdAffordance=!1;this.quiet=!1;this.role="button";this.selected=!1;this.toggles=!1;this._value="";this.onClick=()=>{if(!this.toggles)return;this.selected=!this.selected,this.dispatchEvent(new Event("change",{cancelable:!0,bubbles:!0,composed:!0}))||(this.selected=!this.selected)};this.addEventListener("click",this.onClick)}static get styles(){return[...super.styles,v,b,m]}get value(){return this._value||this.itemText}set value(e){e!==this._value&&(this._value=e||"",this._value?this.setAttribute("value",this._value):this.removeAttribute("value"))}get itemText(){return(this.textContent||"").trim()}handlePointerdownHoldAffordance(e){e.button===0&&(this.addEventListener("pointerup",this.handlePointerupHoldAffordance),this.addEventListener("pointercancel",this.handlePointerupHoldAffordance),d=setTimeout(()=>{this.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"pointer"}}))},LONGPRESS_DURATION))}handlePointerupHoldAffordance(){clearTimeout(d),this.removeEventListener("pointerup",this.handlePointerupHoldAffordance),this.removeEventListener("pointercancel",this.handlePointerupHoldAffordance)}handleKeydown(e){if(!this.holdAffordance)return super.handleKeydown(e);const{code:t,altKey:r}=e;(t==="Space"||r&&t==="ArrowDown")&&(e.preventDefault(),t==="ArrowDown"&&(e.stopPropagation(),e.stopImmediatePropagation()),this.addEventListener("keyup",this.handleKeyup),this.active=!0)}handleKeyup(e){if(!this.holdAffordance)return super.handleKeyup(e);const{code:t,altKey:r}=e;(t==="Space"||r&&t==="ArrowDown")&&(e.stopPropagation(),this.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"keyboard"}})),this.active=!1)}get buttonContent(){const e=super.buttonContent;return this.holdAffordance&&e.unshift(c`
2
- <sp-icon-corner-triangle300
3
- class="hold-affordance ${g[this.size]}"
4
- ></sp-icon-corner-triangle300>
5
- `),e}updated(e){super.updated(e);const t=this.role==="button",r=t&&(this.selected||this.toggles)&&!(this.hasAttribute("aria-haspopup")&&this.hasAttribute("aria-expanded"));(e.has("selected")||e.has("role"))&&(r?this.setAttribute("aria-pressed",this.selected?"true":"false"):(this.removeAttribute("aria-pressed"),t&&this.toggles&&this.hasAttribute("aria-expanded")&&this.setAttribute("aria-expanded",this.selected?"true":"false"))),e.has("holdAffordance")&&(this.holdAffordance?this.addEventListener("pointerdown",this.handlePointerdownHoldAffordance):(this.removeEventListener("pointerdown",this.handlePointerdownHoldAffordance),this.handlePointerupHoldAffordance()))}}o([s({type:Boolean,reflect:!0})],ActionButton.prototype,"emphasized",2),o([s({type:Boolean,reflect:!0,attribute:"hold-affordance"})],ActionButton.prototype,"holdAffordance",2),o([s({type:Boolean,reflect:!0})],ActionButton.prototype,"quiet",2),o([s({reflect:!0})],ActionButton.prototype,"role",2),o([s({type:Boolean,reflect:!0})],ActionButton.prototype,"selected",2),o([s({type:Boolean,reflect:!0})],ActionButton.prototype,"toggles",2),o([s({reflect:!0,attribute:"static-color"})],ActionButton.prototype,"staticColor",2),o([s({type:String})],ActionButton.prototype,"value",1);
6
- //# sourceMappingURL=ActionButton.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["ActionButton.ts"],
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*/\n\nimport {\n CSSResultArray,\n DefaultElementSize,\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 '@spectrum-web-components/button';\nimport buttonStyles from './action-button.css.js';\nimport cornerTriangleStyles from '@spectrum-web-components/icon/src/spectrum-icon-corner-triangle.css.js';\nimport cornerTriangleOverrides from '@spectrum-web-components/icon/src/icon-corner-triangle-overrides.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-corner-triangle300.js';\n\nconst holdAffordanceClass = {\n xs: 'spectrum-UIIcon-CornerTriangle75',\n s: 'spectrum-UIIcon-CornerTriangle75',\n m: 'spectrum-UIIcon-CornerTriangle100',\n l: 'spectrum-UIIcon-CornerTriangle200',\n xl: 'spectrum-UIIcon-CornerTriangle300',\n};\n\nexport const LONGPRESS_DURATION = 300;\nlet LONGPRESS_TIMEOUT: ReturnType<typeof setTimeout>;\n\nexport type LongpressEvent = {\n source: 'pointer' | 'keyboard';\n};\n\n/**\n * @element sp-action-button\n *\n * @slot - text label of the Action Button\n * @slot icon - The icon to use for Action Button\n * @fires change - Announces a change in the `selected` property of an action button\n * @fires longpress - Synthesizes a \"longpress\" interaction that signifies a\n * `pointerdown` event that is >=300ms or a keyboard event where code is `Space` or code is `ArrowDown`\n * while `altKey===true`.\n */\nexport class ActionButton extends SizedMixin(ButtonBase, {\n validSizes: ['xs', 's', 'm', 'l', 'xl'],\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [\n ...super.styles,\n buttonStyles,\n cornerTriangleStyles,\n cornerTriangleOverrides,\n ];\n }\n\n @property({ type: Boolean, reflect: true })\n public emphasized = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'hold-affordance' })\n public holdAffordance = false;\n\n @property({ type: Boolean, reflect: true })\n public quiet = false;\n\n @property({ reflect: true })\n public override role = 'button';\n\n /**\n * Whether an Action Button with `role='button'`\n * should also be `aria-pressed='true'`\n */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /**\n * Whether to automatically manage the `selected`\n * attribute on interaction and whether `aria-pressed=\"false\"`\n * should be used when `selected === false`\n */\n @property({ type: Boolean, reflect: true })\n public toggles = false;\n\n /**\n * The static color variant to use for the action button.\n */\n @property({ reflect: true, attribute: 'static-color' })\n public staticColor?: 'white' | 'black';\n\n @property({ type: String })\n public get value(): string {\n return this._value || this.itemText;\n }\n public set value(value: string) {\n if (value === this._value) {\n return;\n }\n this._value = value || '';\n if (this._value) {\n this.setAttribute('value', this._value);\n } else {\n this.removeAttribute('value');\n }\n }\n private _value = '';\n\n /**\n * @private\n */\n public get itemText(): string {\n return (this.textContent || /* c8 ignore next */ '').trim();\n }\n\n constructor() {\n super();\n this.addEventListener('click', this.onClick);\n }\n\n private onClick = (): void => {\n if (!this.toggles) {\n return;\n }\n this.selected = !this.selected;\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n cancelable: true,\n bubbles: true,\n composed: true,\n })\n );\n if (!applyDefault) {\n this.selected = !this.selected;\n }\n };\n\n private handlePointerdownHoldAffordance(event: PointerEvent): void {\n if (event.button !== 0) return;\n this.addEventListener('pointerup', this.handlePointerupHoldAffordance);\n this.addEventListener(\n 'pointercancel',\n this.handlePointerupHoldAffordance\n );\n LONGPRESS_TIMEOUT = setTimeout(() => {\n this.dispatchEvent(\n new CustomEvent<LongpressEvent>('longpress', {\n bubbles: true,\n composed: true,\n detail: {\n source: 'pointer',\n },\n })\n );\n }, LONGPRESS_DURATION);\n }\n\n private handlePointerupHoldAffordance(): void {\n clearTimeout(LONGPRESS_TIMEOUT);\n this.removeEventListener(\n 'pointerup',\n this.handlePointerupHoldAffordance\n );\n this.removeEventListener(\n 'pointercancel',\n this.handlePointerupHoldAffordance\n );\n }\n\n /**\n * @private\n */\n protected override handleKeydown(event: KeyboardEvent): void {\n if (!this.holdAffordance) {\n return super.handleKeydown(event);\n }\n const { code, altKey } = event;\n if (code === 'Space' || (altKey && code === 'ArrowDown')) {\n event.preventDefault();\n if (code === 'ArrowDown') {\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n this.addEventListener('keyup', this.handleKeyup);\n this.active = true;\n }\n }\n\n protected override handleKeyup(event: KeyboardEvent): void {\n if (!this.holdAffordance) {\n return super.handleKeyup(event);\n }\n const { code, altKey } = event;\n if (code === 'Space' || (altKey && code === 'ArrowDown')) {\n event.stopPropagation();\n this.dispatchEvent(\n new CustomEvent<LongpressEvent>('longpress', {\n bubbles: true,\n composed: true,\n detail: {\n source: 'keyboard',\n },\n })\n );\n this.active = false;\n }\n }\n\n protected override get buttonContent(): TemplateResult[] {\n const buttonContent = super.buttonContent;\n if (this.holdAffordance) {\n buttonContent.unshift(html`\n <sp-icon-corner-triangle300\n class=\"hold-affordance ${holdAffordanceClass[\n this.size as DefaultElementSize\n ]}\"\n ></sp-icon-corner-triangle300>\n `);\n }\n return buttonContent;\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n const isButton = this.role === 'button';\n const canBePressed =\n isButton &&\n (this.selected || this.toggles) &&\n !(\n this.hasAttribute('aria-haspopup') &&\n this.hasAttribute('aria-expanded')\n );\n if (changes.has('selected') || changes.has('role')) {\n // When role !== 'button' then the Action Button is within\n // an Action Group that manages selects which means the\n // Action Button is a \"checkbox\" or \"radio\" and cannot\n // accept the `aria-pressed` attribute.\n if (canBePressed) {\n this.setAttribute(\n 'aria-pressed',\n this.selected ? 'true' : 'false'\n );\n } else {\n // When !this.toggles the lack of \"aria-pressed\" is inconsequential.\n this.removeAttribute('aria-pressed');\n if (\n isButton &&\n this.toggles &&\n this.hasAttribute('aria-expanded')\n ) {\n this.setAttribute(\n 'aria-expanded',\n this.selected ? 'true' : 'false'\n );\n }\n }\n }\n if (changes.has('holdAffordance')) {\n if (this.holdAffordance) {\n this.addEventListener(\n 'pointerdown',\n this.handlePointerdownHoldAffordance\n );\n } else {\n this.removeEventListener(\n 'pointerdown',\n this.handlePointerdownHoldAffordance\n );\n this.handlePointerupHoldAffordance();\n }\n }\n }\n}\n\ndeclare global {\n interface GlobalEventHandlersEventMap {\n longpress: CustomEvent<LongpressEvent>;\n }\n}\n"],
5
- "mappings": "qNAYA,OAGI,QAAAA,EAEA,cAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,cAAAC,MAAkB,kCAC3B,OAAOC,MAAkB,yBACzB,OAAOC,MAA0B,yEACjC,OAAOC,MAA6B,0EACpC,MAAO,wEAEP,MAAMC,EAAsB,CACxB,GAAI,mCACJ,EAAG,mCACH,EAAG,oCACH,EAAG,oCACH,GAAI,mCACR,EAEO,aAAM,mBAAqB,IAClC,IAAIC,EAgBG,aAAM,qBAAqBP,EAAWE,EAAY,CACrD,WAAY,CAAC,KAAM,IAAK,IAAK,IAAK,IAAI,EACtC,cAAe,EACnB,CAAC,CAAE,CAmEC,aAAc,CACV,MAAM,EAzDV,KAAO,WAAa,GAGpB,KAAO,eAAiB,GAGxB,KAAO,MAAQ,GAGf,KAAgB,KAAO,SAOvB,KAAO,SAAW,GAQlB,KAAO,QAAU,GAuBjB,KAAQ,OAAS,GAcjB,KAAQ,QAAU,IAAY,CAC1B,GAAI,CAAC,KAAK,QACN,OAEJ,KAAK,SAAW,CAAC,KAAK,SACD,KAAK,cACtB,IAAI,MAAM,SAAU,CAChB,WAAY,GACZ,QAAS,GACT,SAAU,EACd,CAAC,CACL,IAEI,KAAK,SAAW,CAAC,KAAK,SAE9B,EAlBI,KAAK,iBAAiB,QAAS,KAAK,OAAO,CAC/C,CArEA,WAA2B,QAAyB,CAChD,MAAO,CACH,GAAG,MAAM,OACTC,EACAC,EACAC,CACJ,CACJ,CAoCA,IAAW,OAAgB,CACvB,OAAO,KAAK,QAAU,KAAK,QAC/B,CACA,IAAW,MAAMG,EAAe,CACxBA,IAAU,KAAK,SAGnB,KAAK,OAASA,GAAS,GACnB,KAAK,OACL,KAAK,aAAa,QAAS,KAAK,MAAM,EAEt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riangleStyles", "cornerTriangleOverrides", "holdAffordanceClass", "LONGPRESS_TIMEOUT", "value", "event", "code", "altKey", "buttonContent", "changes", "isButton", "canBePressed", "__decorateClass"]
7
- }
@@ -1,2 +0,0 @@
1
- declare const styles: import("@spectrum-web-components/base").CSSResult;
2
- export default styles;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- import { css } from "@spectrum-web-components/base";
3
- const styles = css`
4
- :host{--spectrum-actionbutton-animation-duration:var(--system-action-button-animation-duration);--spectrum-actionbutton-border-radius:var(--system-action-button-border-radius);--spectrum-actionbutton-border-width:var(--system-action-button-border-width);--spectrum-actionbutton-content-color-default:var(--system-action-button-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-content-color-focus);--spectrum-actionbutton-focus-indicator-gap:var(--system-action-button-focus-indicator-gap);--spectrum-actionbutton-focus-indicator-thickness:var(--system-action-button-focus-indicator-thickness);--spectrum-actionbutton-focus-indicator-color:var(--system-action-button-focus-indicator-color);--spectrum-actionbutton-background-color-default:var(--system-action-button-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-background-color-focus);--spectrum-actionbutton-border-color-default:var(--system-action-button-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-border-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-background-color-disabled);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-border-color-disabled);--spectrum-actionbutton-content-color-disabled:var(--system-action-button-content-color-disabled);--spectrum-actionbutton-min-width:var(--system-action-button-min-width);--spectrum-actionbutton-height:var(--system-action-button-height);--spectrum-actionbutton-icon-size:var(--system-action-button-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-edge-to-text-size)}:host([quiet]){--spectrum-actionbutton-background-color-default:var(--system-action-button-quiet-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-quiet-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-quiet-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-quiet-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-quiet-background-color-disabled);--spectrum-actionbutton-border-color-default:var(--system-action-button-quiet-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-quiet-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-quiet-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-quiet-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-quiet-border-color-disabled)}:host([selected]){--spectrum-actionbutton-background-color-default:var(--system-action-button-selected-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-selected-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-selected-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-selected-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-selected-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-selected-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-selected-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-selected-content-color-focus);--spectrum-actionbutton-border-color-default:var(--system-action-button-selected-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-selected-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-selected-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-selected-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-selected-border-color-disabled);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-selected-background-color-disabled)}:host([selected][emphasized]){--spectrum-actionbutton-background-color-default:var(--system-action-button-selected-emphasized-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-selected-emphasized-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-selected-emphasized-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-selected-emphasized-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-selected-emphasized-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-selected-emphasized-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-selected-emphasized-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-selected-emphasized-content-color-focus)}:host([static-color=black][quiet]){--spectrum-actionbutton-border-color-default:var(--system-action-button-static-black-quiet-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-black-quiet-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-black-quiet-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-black-quiet-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-black-quiet-border-color-disabled)}:host([static-color=white][quiet]){--spectrum-actionbutton-border-color-default:var(--system-action-button-static-white-quiet-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-white-quiet-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-white-quiet-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-white-quiet-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-white-quiet-border-color-disabled)}:host([static-color=black]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-black-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-black-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-black-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-black-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-black-background-color-disabled);--spectrum-actionbutton-border-color-default:var(--system-action-button-static-black-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-black-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-black-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-black-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-black-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-black-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-black-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-black-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-black-content-color-focus);--spectrum-actionbutton-content-color-disabled:var(--system-action-button-static-black-content-color-disabled);--spectrum-actionbutton-focus-indicator-color:var(--system-action-button-static-black-focus-indicator-color)}:host([static-color=black][selected]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-black-selected-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-black-selected-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-black-selected-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-black-selected-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-black-selected-background-color-disabled);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-black-selected-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-black-selected-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-black-selected-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-black-selected-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-black-selected-content-color-focus)}:host([static-color=black][selected][emphasized]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-black-selected-emphasized-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-black-selected-emphasized-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-black-selected-emphasized-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-black-selected-emphasized-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-black-selected-emphasized-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-black-selected-emphasized-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-black-selected-emphasized-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-black-selected-emphasized-content-color-focus)}:host([static-color=white]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-white-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-white-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-white-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-white-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-white-background-color-disabled);--spectrum-actionbutton-border-color-default:var(--system-action-button-static-white-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-white-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-white-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-white-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-white-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-white-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-white-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-white-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-white-content-color-focus);--spectrum-actionbutton-content-color-disabled:var(--system-action-button-static-white-content-color-disabled);--spectrum-actionbutton-focus-indicator-color:var(--system-action-button-static-white-focus-indicator-color)}:host([static-color=white][selected]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-white-selected-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-white-selected-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-white-selected-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-white-selected-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-white-selected-background-color-disabled);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-white-selected-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-white-selected-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-white-selected-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-white-selected-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-white-selected-content-color-focus)}:host([static-color=white][selected][emphasized]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-white-selected-emphasized-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-white-selected-emphasized-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-white-selected-emphasized-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-white-selected-emphasized-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-white-selected-emphasized-content-color-default)}:host{--spectrum-actionbutton-min-width:var(--system-action-button-size-m-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-m-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-m-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-m-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-m-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-m-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-m-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-m-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-m-edge-to-text-size)}:host([size=xs]){--spectrum-actionbutton-min-width:var(--system-action-button-size-xs-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-xs-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-xs-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-xs-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-xs-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-xs-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-xs-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-xs-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-xs-edge-to-text-size)}:host([size=s]){--spectrum-actionbutton-min-width:var(--system-action-button-size-s-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-s-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-s-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-s-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-s-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-s-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-s-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-s-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-s-edge-to-text-size)}:host([size=l]){--spectrum-actionbutton-min-width:var(--system-action-button-size-l-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-l-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-l-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-l-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-l-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-l-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-l-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-l-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-l-edge-to-text-size)}:host([size=xl]){--spectrum-actionbutton-min-width:var(--system-action-button-size-xl-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-xl-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-xl-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-xl-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-xl-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-xl-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-xl-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-xl-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-xl-edge-to-text-size)}
5
- `;
6
- export default styles;
7
- //# sourceMappingURL=action-button-overrides.css.dev.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-overrides.css.ts"],
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{--spectrum-actionbutton-animation-duration:var(--system-action-button-animation-duration);--spectrum-actionbutton-border-radius:var(--system-action-button-border-radius);--spectrum-actionbutton-border-width:var(--system-action-button-border-width);--spectrum-actionbutton-content-color-default:var(--system-action-button-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-content-color-focus);--spectrum-actionbutton-focus-indicator-gap:var(--system-action-button-focus-indicator-gap);--spectrum-actionbutton-focus-indicator-thickness:var(--system-action-button-focus-indicator-thickness);--spectrum-actionbutton-focus-indicator-color:var(--system-action-button-focus-indicator-color);--spectrum-actionbutton-background-color-default:var(--system-action-button-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-background-color-focus);--spectrum-actionbutton-border-color-default:var(--system-action-button-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-border-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-background-color-disabled);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-border-color-disabled);--spectrum-actionbutton-content-color-disabled:var(--system-action-button-content-color-disabled);--spectrum-actionbutton-min-width:var(--system-action-button-min-width);--spectrum-actionbutton-height:var(--system-action-button-height);--spectrum-actionbutton-icon-size:var(--system-action-button-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-edge-to-text-size)}:host([quiet]){--spectrum-actionbutton-background-color-default:var(--system-action-button-quiet-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-quiet-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-quiet-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-quiet-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-quiet-background-color-disabled);--spectrum-actionbutton-border-color-default:var(--system-action-button-quiet-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-quiet-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-quiet-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-quiet-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-quiet-border-color-disabled)}:host([selected]){--spectrum-actionbutton-background-color-default:var(--system-action-button-selected-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-selected-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-selected-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-selected-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-selected-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-selected-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-selected-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-selected-content-color-focus);--spectrum-actionbutton-border-color-default:var(--system-action-button-selected-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-selected-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-selected-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-selected-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-selected-border-color-disabled);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-selected-background-color-disabled)}:host([selected][emphasized]){--spectrum-actionbutton-background-color-default:var(--system-action-button-selected-emphasized-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-selected-emphasized-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-selected-emphasized-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-selected-emphasized-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-selected-emphasized-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-selected-emphasized-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-selected-emphasized-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-selected-emphasized-content-color-focus)}:host([static-color=black][quiet]){--spectrum-actionbutton-border-color-default:var(--system-action-button-static-black-quiet-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-black-quiet-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-black-quiet-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-black-quiet-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-black-quiet-border-color-disabled)}:host([static-color=white][quiet]){--spectrum-actionbutton-border-color-default:var(--system-action-button-static-white-quiet-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-white-quiet-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-white-quiet-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-white-quiet-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-white-quiet-border-color-disabled)}:host([static-color=black]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-black-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-black-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-black-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-black-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-black-background-color-disabled);--spectrum-actionbutton-border-color-default:var(--system-action-button-static-black-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-black-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-black-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-black-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-black-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-black-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-black-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-black-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-black-content-color-focus);--spectrum-actionbutton-content-color-disabled:var(--system-action-button-static-black-content-color-disabled);--spectrum-actionbutton-focus-indicator-color:var(--system-action-button-static-black-focus-indicator-color)}:host([static-color=black][selected]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-black-selected-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-black-selected-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-black-selected-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-black-selected-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-black-selected-background-color-disabled);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-black-selected-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-black-selected-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-black-selected-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-black-selected-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-black-selected-content-color-focus)}:host([static-color=black][selected][emphasized]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-black-selected-emphasized-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-black-selected-emphasized-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-black-selected-emphasized-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-black-selected-emphasized-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-black-selected-emphasized-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-black-selected-emphasized-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-black-selected-emphasized-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-black-selected-emphasized-content-color-focus)}:host([static-color=white]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-white-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-white-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-white-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-white-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-white-background-color-disabled);--spectrum-actionbutton-border-color-default:var(--system-action-button-static-white-border-color-default);--spectrum-actionbutton-border-color-hover:var(--system-action-button-static-white-border-color-hover);--spectrum-actionbutton-border-color-down:var(--system-action-button-static-white-border-color-down);--spectrum-actionbutton-border-color-focus:var(--system-action-button-static-white-border-color-focus);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-white-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-white-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-white-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-white-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-white-content-color-focus);--spectrum-actionbutton-content-color-disabled:var(--system-action-button-static-white-content-color-disabled);--spectrum-actionbutton-focus-indicator-color:var(--system-action-button-static-white-focus-indicator-color)}:host([static-color=white][selected]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-white-selected-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-white-selected-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-white-selected-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-white-selected-background-color-focus);--spectrum-actionbutton-background-color-disabled:var(--system-action-button-static-white-selected-background-color-disabled);--spectrum-actionbutton-border-color-disabled:var(--system-action-button-static-white-selected-border-color-disabled);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-white-selected-content-color-default);--spectrum-actionbutton-content-color-hover:var(--system-action-button-static-white-selected-content-color-hover);--spectrum-actionbutton-content-color-down:var(--system-action-button-static-white-selected-content-color-down);--spectrum-actionbutton-content-color-focus:var(--system-action-button-static-white-selected-content-color-focus)}:host([static-color=white][selected][emphasized]){--spectrum-actionbutton-background-color-default:var(--system-action-button-static-white-selected-emphasized-background-color-default);--spectrum-actionbutton-background-color-hover:var(--system-action-button-static-white-selected-emphasized-background-color-hover);--spectrum-actionbutton-background-color-down:var(--system-action-button-static-white-selected-emphasized-background-color-down);--spectrum-actionbutton-background-color-focus:var(--system-action-button-static-white-selected-emphasized-background-color-focus);--spectrum-actionbutton-content-color-default:var(--system-action-button-static-white-selected-emphasized-content-color-default)}:host{--spectrum-actionbutton-min-width:var(--system-action-button-size-m-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-m-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-m-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-m-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-m-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-m-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-m-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-m-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-m-edge-to-text-size)}:host([size=xs]){--spectrum-actionbutton-min-width:var(--system-action-button-size-xs-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-xs-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-xs-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-xs-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-xs-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-xs-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-xs-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-xs-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-xs-edge-to-text-size)}:host([size=s]){--spectrum-actionbutton-min-width:var(--system-action-button-size-s-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-s-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-s-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-s-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-s-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-s-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-s-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-s-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-s-edge-to-text-size)}:host([size=l]){--spectrum-actionbutton-min-width:var(--system-action-button-size-l-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-l-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-l-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-l-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-l-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-l-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-l-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-l-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-l-edge-to-text-size)}:host([size=xl]){--spectrum-actionbutton-min-width:var(--system-action-button-size-xl-min-width);--spectrum-actionbutton-height:var(--system-action-button-size-xl-height);--spectrum-actionbutton-icon-size:var(--system-action-button-size-xl-icon-size);--spectrum-actionbutton-font-size:var(--system-action-button-size-xl-font-size);--spectrum-actionbutton-text-to-visual:var(--system-action-button-size-xl-text-to-visual);--spectrum-actionbutton-edge-to-hold-icon:var(--system-action-button-size-xl-edge-to-hold-icon);--spectrum-actionbutton-edge-to-visual-size:var(--system-action-button-size-xl-edge-to-visual-size);--spectrum-actionbutton-edge-to-visual-only-size:var(--system-action-button-size-xl-edge-to-visual-only-size);--spectrum-actionbutton-edge-to-text-size:var(--system-action-button-size-xl-edge-to-text-size)}\n`;\nexport default styles;"],
5
- "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
6
- "names": []
7
- }