@spectrum-web-components/action-button 0.34.1-rc.0 → 0.35.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.
- package/custom-elements.json +21 -4
- package/package.json +8 -8
- package/src/ActionButton.d.ts +1 -0
- package/src/ActionButton.dev.js +13 -0
- package/src/ActionButton.dev.js.map +2 -2
- package/src/ActionButton.js +1 -1
- package/src/ActionButton.js.map +2 -2
- package/src/action-button.css.dev.js +88 -80
- package/src/action-button.css.dev.js.map +2 -2
- package/src/action-button.css.js +88 -80
- package/src/action-button.css.js.map +2 -2
- package/src/spectrum-action-button.css.dev.js +88 -80
- package/src/spectrum-action-button.css.dev.js.map +2 -2
- package/src/spectrum-action-button.css.js +88 -80
- package/src/spectrum-action-button.css.js.map +2 -2
- package/src/spectrum-config.js +1 -1
- package/stories/index.js +1 -1
- package/stories/index.js.map +2 -2
package/custom-elements.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "javascript-module",
|
|
7
|
-
"path": "sp-action-button.
|
|
7
|
+
"path": "sp-action-button.js",
|
|
8
8
|
"declarations": [],
|
|
9
9
|
"exports": [
|
|
10
10
|
{
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"kind": "javascript-module",
|
|
22
|
-
"path": "src/ActionButton.
|
|
22
|
+
"path": "src/ActionButton.js",
|
|
23
23
|
"declarations": [
|
|
24
24
|
{
|
|
25
25
|
"kind": "variable",
|
|
@@ -112,6 +112,16 @@
|
|
|
112
112
|
"attribute": "toggles",
|
|
113
113
|
"reflects": true
|
|
114
114
|
},
|
|
115
|
+
{
|
|
116
|
+
"kind": "field",
|
|
117
|
+
"name": "static",
|
|
118
|
+
"type": {
|
|
119
|
+
"text": "'white' | 'black' | undefined"
|
|
120
|
+
},
|
|
121
|
+
"privacy": "public",
|
|
122
|
+
"attribute": "static",
|
|
123
|
+
"reflects": true
|
|
124
|
+
},
|
|
115
125
|
{
|
|
116
126
|
"kind": "field",
|
|
117
127
|
"name": "variant",
|
|
@@ -292,6 +302,13 @@
|
|
|
292
302
|
"description": "Whether to automatically manage the `selected`\nattribute on interaction and whether `aria-pressed=\"false\"`\nshould be used when `selected === false`",
|
|
293
303
|
"fieldName": "toggles"
|
|
294
304
|
},
|
|
305
|
+
{
|
|
306
|
+
"name": "static",
|
|
307
|
+
"type": {
|
|
308
|
+
"text": "'white' | 'black' | undefined"
|
|
309
|
+
},
|
|
310
|
+
"fieldName": "static"
|
|
311
|
+
},
|
|
295
312
|
{
|
|
296
313
|
"name": "variant",
|
|
297
314
|
"type": {
|
|
@@ -327,7 +344,7 @@
|
|
|
327
344
|
"name": "LONGPRESS_DURATION",
|
|
328
345
|
"declaration": {
|
|
329
346
|
"name": "LONGPRESS_DURATION",
|
|
330
|
-
"module": "src/ActionButton.
|
|
347
|
+
"module": "src/ActionButton.js"
|
|
331
348
|
}
|
|
332
349
|
},
|
|
333
350
|
{
|
|
@@ -335,7 +352,7 @@
|
|
|
335
352
|
"name": "ActionButton",
|
|
336
353
|
"declaration": {
|
|
337
354
|
"name": "ActionButton",
|
|
338
|
-
"module": "src/ActionButton.
|
|
355
|
+
"module": "src/ActionButton.js"
|
|
339
356
|
}
|
|
340
357
|
}
|
|
341
358
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/action-button",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"lit-html"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@spectrum-web-components/base": "^0.
|
|
61
|
-
"@spectrum-web-components/button": "^0.
|
|
62
|
-
"@spectrum-web-components/icon": "^0.
|
|
63
|
-
"@spectrum-web-components/icons-ui": "^0.
|
|
64
|
-
"@spectrum-web-components/shared": "^0.
|
|
60
|
+
"@spectrum-web-components/base": "^0.35.0",
|
|
61
|
+
"@spectrum-web-components/button": "^0.35.0",
|
|
62
|
+
"@spectrum-web-components/icon": "^0.35.0",
|
|
63
|
+
"@spectrum-web-components/icons-ui": "^0.35.0",
|
|
64
|
+
"@spectrum-web-components/shared": "^0.35.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@spectrum-css/actionbutton": "^
|
|
67
|
+
"@spectrum-css/actionbutton": "^4.0.9"
|
|
68
68
|
},
|
|
69
69
|
"types": "./src/index.d.ts",
|
|
70
70
|
"customElements": "custom-elements.json",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"./sp-*.js",
|
|
73
73
|
"./**/*.dev.js"
|
|
74
74
|
],
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "1ee5a6c92838cdf48321276d97f61c20f8476ac1"
|
|
76
76
|
}
|
package/src/ActionButton.d.ts
CHANGED
package/src/ActionButton.dev.js
CHANGED
|
@@ -171,6 +171,16 @@ export class ActionButton extends SizedMixin(ButtonBase, {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
+
if (changes.has("variant") && (this.variant || typeof changes.get("variant"))) {
|
|
175
|
+
this.static = this.variant;
|
|
176
|
+
if (true) {
|
|
177
|
+
window.__swc.warn(
|
|
178
|
+
this,
|
|
179
|
+
`The "variant" attribute/property of <${this.localName}> have been deprecated. Use "static" with any of the same values instead. "variant" will be removed in a future release.`,
|
|
180
|
+
"https://opensource.adobe.com/spectrum-web-components/components/badge/#fixed"
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
174
184
|
}
|
|
175
185
|
}
|
|
176
186
|
__decorateClass([
|
|
@@ -191,6 +201,9 @@ __decorateClass([
|
|
|
191
201
|
__decorateClass([
|
|
192
202
|
property({ type: Boolean, reflect: true })
|
|
193
203
|
], ActionButton.prototype, "toggles", 2);
|
|
204
|
+
__decorateClass([
|
|
205
|
+
property({ reflect: true })
|
|
206
|
+
], ActionButton.prototype, "static", 2);
|
|
194
207
|
__decorateClass([
|
|
195
208
|
property({ reflect: true })
|
|
196
209
|
], ActionButton.prototype, "variant", 2);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ActionButton.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 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 '@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 wher 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}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, cornerTriangleStyles];\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 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 @property({ reflect: true })\n public variant?: '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 this.addEventListener('pointerdown', this.onPointerdown);\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 })\n );\n if (!applyDefault) {\n this.selected = !this.selected;\n }\n };\n\n private onPointerdown(event: PointerEvent): void {\n if (event.button !== 0) return;\n this.addEventListener('pointerup', this.onPointerup);\n this.addEventListener('pointercancel', this.onPointerup);\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 onPointerup(): void {\n clearTimeout(LONGPRESS_TIMEOUT);\n this.removeEventListener('pointerup', this.onPointerup);\n this.removeEventListener('pointercancel', this.onPointerup);\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 }\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;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;AAC1C,CAAC,EAAE;AAAA,
|
|
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 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 '@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 wher 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}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, cornerTriangleStyles];\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 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 @property({ reflect: true })\n public static?: 'white' | 'black';\n\n @property({ reflect: true })\n public variant?: '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 this.addEventListener('pointerdown', this.onPointerdown);\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 })\n );\n if (!applyDefault) {\n this.selected = !this.selected;\n }\n };\n\n private onPointerdown(event: PointerEvent): void {\n if (event.button !== 0) return;\n this.addEventListener('pointerup', this.onPointerup);\n this.addEventListener('pointercancel', this.onPointerup);\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 onPointerup(): void {\n clearTimeout(LONGPRESS_TIMEOUT);\n this.removeEventListener('pointerup', this.onPointerup);\n this.removeEventListener('pointercancel', this.onPointerup);\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 (\n changes.has('variant') &&\n (this.variant || typeof changes.get('variant'))\n ) {\n this.static = this.variant;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"variant\" attribute/property of <${this.localName}> have been deprecated. Use \"static\" with any of the same values instead. \"variant\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/badge/#fixed'\n );\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;AAEP,MAAM,sBAAsB;AAAA,EACxB,IAAI;AAAA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AbjC,aAcF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAhBlB,aAiBF;AAOA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAvBjC,aAwBF;AAQA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GA/BjC,aAgCF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAlClB,aAmCF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GArClB,aAsCF;AAGI;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAxCjB,aAyCE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/ActionButton.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
<sp-icon-corner-triangle300
|
|
3
3
|
class="hold-affordance ${m[this.size]}"
|
|
4
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")))}}s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"emphasized",2),s([i({type:Boolean,reflect:!0,attribute:"hold-affordance"})],ActionButton.prototype,"holdAffordance",2),s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"quiet",2),s([i({reflect:!0})],ActionButton.prototype,"role",2),s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"selected",2),s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"toggles",2),s([i({reflect:!0})],ActionButton.prototype,"variant",2),s([i({type:String})],ActionButton.prototype,"value",1);
|
|
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("variant")&&(this.variant||typeof e.get("variant"))&&(this.static=this.variant)}}s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"emphasized",2),s([i({type:Boolean,reflect:!0,attribute:"hold-affordance"})],ActionButton.prototype,"holdAffordance",2),s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"quiet",2),s([i({reflect:!0})],ActionButton.prototype,"role",2),s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"selected",2),s([i({type:Boolean,reflect:!0})],ActionButton.prototype,"toggles",2),s([i({reflect:!0})],ActionButton.prototype,"static",2),s([i({reflect:!0})],ActionButton.prototype,"variant",2),s([i({type:String})],ActionButton.prototype,"value",1);
|
|
6
6
|
//# sourceMappingURL=ActionButton.js.map
|
package/src/ActionButton.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ActionButton.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 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 '@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 wher 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}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, cornerTriangleStyles];\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 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 @property({ reflect: true })\n public variant?: '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 this.addEventListener('pointerdown', this.onPointerdown);\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 })\n );\n if (!applyDefault) {\n this.selected = !this.selected;\n }\n };\n\n private onPointerdown(event: PointerEvent): void {\n if (event.button !== 0) return;\n this.addEventListener('pointerup', this.onPointerup);\n this.addEventListener('pointercancel', this.onPointerup);\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 onPointerup(): void {\n clearTimeout(LONGPRESS_TIMEOUT);\n this.removeEventListener('pointerup', this.onPointerup);\n this.removeEventListener('pointercancel', this.onPointerup);\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 }\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,MAAO,wEAEP,MAAMC,EAAsB,CACxB,GAAI,mCACJ,EAAG,mCACH,EAAG,oCACH,EAAG,oCACH,GAAI,mCACR,EAEO,aAAM,mBAAqB,IAClC,IAAIC,EAgBG,aAAM,qBAAqBN,EAAWE,EAAY,CACrD,WAAY,CAAC,KAAM,IAAK,IAAK,IAAK,IAAI,CAC1C,CAAC,CAAE,
|
|
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 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 '@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 wher 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}) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, cornerTriangleStyles];\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 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 @property({ reflect: true })\n public static?: 'white' | 'black';\n\n @property({ reflect: true })\n public variant?: '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 this.addEventListener('pointerdown', this.onPointerdown);\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 })\n );\n if (!applyDefault) {\n this.selected = !this.selected;\n }\n };\n\n private onPointerdown(event: PointerEvent): void {\n if (event.button !== 0) return;\n this.addEventListener('pointerup', this.onPointerup);\n this.addEventListener('pointercancel', this.onPointerup);\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 onPointerup(): void {\n clearTimeout(LONGPRESS_TIMEOUT);\n this.removeEventListener('pointerup', this.onPointerup);\n this.removeEventListener('pointercancel', this.onPointerup);\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 (\n changes.has('variant') &&\n (this.variant || typeof changes.get('variant'))\n ) {\n this.static = this.variant;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"variant\" attribute/property of <${this.localName}> have been deprecated. Use \"static\" with any of the same values instead. \"variant\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/badge/#fixed'\n );\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,MAAO,wEAEP,MAAMC,EAAsB,CACxB,GAAI,mCACJ,EAAG,mCACH,EAAG,oCACH,EAAG,oCACH,GAAI,mCACR,EAEO,aAAM,mBAAqB,IAClC,IAAIC,EAgBG,aAAM,qBAAqBN,EAAWE,EAAY,CACrD,WAAY,CAAC,KAAM,IAAK,IAAK,IAAK,IAAI,CAC1C,CAAC,CAAE,CA8DC,aAAc,CACV,MAAM,EAzDV,KAAO,WAAa,GAGpB,KAAO,eAAiB,GAGxB,KAAO,MAAQ,GAGf,KAAO,KAAO,SAOd,KAAO,SAAW,GAQlB,KAAO,QAAU,GAuBjB,KAAQ,OAAS,GAejB,KAAQ,QAAU,IAAY,CAC1B,GAAI,CAAC,KAAK,QACN,OAEJ,KAAK,SAAW,CAAC,KAAK,SACD,KAAK,cACtB,IAAI,MAAM,SAAU,CAChB,WAAY,EAChB,CAAC,CACL,IAEI,KAAK,SAAW,CAAC,KAAK,SAE9B,EAjBI,KAAK,iBAAiB,QAAS,KAAK,OAAO,EAC3C,KAAK,iBAAiB,cAAe,KAAK,aAAa,CAC3D,CAjEA,WAA2B,QAAyB,CAChD,MAAO,CAAC,GAAG,MAAM,OAAQC,EAAcC,CAAoB,CAC/D,CAoCA,IAAW,OAAgB,CACvB,OAAO,KAAK,QAAU,KAA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E,QAAS,EAAK,CAAC,GArClB,aAsCF,uBAGIc,EAAA,CADVd,EAAS,CAAE,KAAM,MAAO,CAAC,GAxCjB,aAyCE",
|
|
6
6
|
"names": ["html", "SizedMixin", "property", "ButtonBase", "buttonStyles", "cornerTriangleStyles", "holdAffordanceClass", "LONGPRESS_TIMEOUT", "value", "event", "code", "altKey", "buttonContent", "changes", "isButton", "canBePressed", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -13,13 +13,53 @@ const styles = css`
|
|
|
13
13
|
--mod-animation-duration-100,var(--spectrum-animation-duration-100)
|
|
14
14
|
) ease-out;-webkit-user-select:none;user-select:none;vertical-align:top}:host(:focus){outline:none}:host([disabled]){cursor:default}::slotted([slot=icon]){max-block-size:100%}#label{place-self:center;text-align:center}#label:empty{display:none}:host{--spectrum-actionbutton-animation-duration:var(
|
|
15
15
|
--spectrum-animation-duration-100
|
|
16
|
-
);--spectrum-actionbutton-border-radius:var(--spectrum-corner-radius-100);--spectrum-actionbutton-border-width:var(--spectrum-border-width-100);--spectrum-actionbutton-
|
|
16
|
+
);--spectrum-actionbutton-border-radius:var(--spectrum-corner-radius-100);--spectrum-actionbutton-border-width:var(--spectrum-border-width-100);--spectrum-actionbutton-content-color-default:var(
|
|
17
|
+
--spectrum-neutral-content-color-default
|
|
18
|
+
);--spectrum-actionbutton-content-color-hover:var(
|
|
19
|
+
--spectrum-neutral-content-color-hover
|
|
20
|
+
);--spectrum-actionbutton-content-color-down:var(
|
|
21
|
+
--spectrum-neutral-content-color-down
|
|
22
|
+
);--spectrum-actionbutton-content-color-focus:var(
|
|
23
|
+
--spectrum-neutral-content-color-key-focus
|
|
24
|
+
);--spectrum-actionbutton-focus-indicator-gap:var(
|
|
17
25
|
--spectrum-focus-indicator-gap
|
|
18
26
|
);--spectrum-actionbutton-focus-indicator-thickness:var(
|
|
19
27
|
--spectrum-focus-indicator-thickness
|
|
20
28
|
);--spectrum-actionbutton-focus-indicator-color:var(
|
|
21
29
|
--spectrum-focus-indicator-color
|
|
22
|
-
);--spectrum-actionbutton-focus-indicator-border-radius:calc(var(--spectrum-actionbutton-border-radius) + var(--spectrum-actionbutton-focus-indicator-gap))}:host([
|
|
30
|
+
);--spectrum-actionbutton-focus-indicator-border-radius:calc(var(--spectrum-actionbutton-border-radius) + var(--spectrum-actionbutton-focus-indicator-gap))}:host([selected]){--mod-actionbutton-background-color-default:var(
|
|
31
|
+
--mod-actionbutton-background-color-default-selected,var(--spectrum-neutral-background-color-selected-default)
|
|
32
|
+
);--mod-actionbutton-background-color-hover:var(
|
|
33
|
+
--mod-actionbutton-background-color-hover-selected,var(--spectrum-neutral-background-color-selected-hover)
|
|
34
|
+
);--mod-actionbutton-background-color-down:var(
|
|
35
|
+
--mod-actionbutton-background-color-down-selected,var(--spectrum-neutral-background-color-selected-down)
|
|
36
|
+
);--mod-actionbutton-background-color-focus:var(
|
|
37
|
+
--mod-actionbutton-background-color-focus-selected,var(--spectrum-neutral-background-color-selected-key-focus)
|
|
38
|
+
);--mod-actionbutton-content-color-default:var(
|
|
39
|
+
--mod-actionbutton-content-color-default-selected,var(--spectrum-gray-50)
|
|
40
|
+
);--mod-actionbutton-content-color-hover:var(
|
|
41
|
+
--mod-actionbutton-content-color-hover-selected,var(--spectrum-gray-50)
|
|
42
|
+
);--mod-actionbutton-content-color-down:var(
|
|
43
|
+
--mod-actionbutton-content-color-down-selected,var(--spectrum-gray-50)
|
|
44
|
+
);--mod-actionbutton-content-color-focus:var(
|
|
45
|
+
--mod-actionbutton-content-color-focus-selected,var(--spectrum-gray-50)
|
|
46
|
+
)}:host([selected][emphasized]){--mod-actionbutton-background-color-default:var(
|
|
47
|
+
--mod-actionbutton-background-color-default-selected-emphasized,var(--spectrum-accent-background-color-default)
|
|
48
|
+
);--mod-actionbutton-background-color-hover:var(
|
|
49
|
+
--mod-actionbutton-background-color-hover-selected-emphasized,var(--spectrum-accent-background-color-hover)
|
|
50
|
+
);--mod-actionbutton-background-color-down:var(
|
|
51
|
+
--mod-actionbutton-background-color-down-selected-emphasized,var(--spectrum-accent-background-color-down)
|
|
52
|
+
);--mod-actionbutton-background-color-focus:var(
|
|
53
|
+
--mod-actionbutton-background-color-focus-selected-emphasized,var(--spectrum-accent-background-color-key-focus)
|
|
54
|
+
);--mod-actionbutton-content-color-default:var(
|
|
55
|
+
--mod-actionbutton-content-color-default-selected-emphasized,var(--spectrum-white)
|
|
56
|
+
);--mod-actionbutton-content-color-hover:var(
|
|
57
|
+
--mod-actionbutton-content-color-hover-selected-emphasized,var(--spectrum-white)
|
|
58
|
+
);--mod-actionbutton-content-color-down:var(
|
|
59
|
+
--mod-actionbutton-content-color-down-selected-emphasized,var(--spectrum-white)
|
|
60
|
+
);--mod-actionbutton-content-color-focus:var(
|
|
61
|
+
--mod-actionbutton-content-color-focus-selected-emphasized,var(--spectrum-white)
|
|
62
|
+
)}:host([size=xs]){--spectrum-actionbutton-min-width:calc(var(--spectrum-component-edge-to-visual-only-75)*2 + var(--spectrum-workflow-icon-size-75));--spectrum-actionbutton-height:var(--spectrum-component-height-50);--spectrum-actionbutton-icon-size:var(--spectrum-workflow-icon-size-50);--spectrum-actionbutton-font-size:var(--spectrum-font-size-50);--spectrum-actionbutton-text-to-visual:var(--spectrum-text-to-visual-50);--spectrum-actionbutton-edge-to-hold-icon:var(
|
|
23
63
|
--spectrum-action-button-edge-to-hold-icon-extra-small
|
|
24
64
|
);--spectrum-actionbutton-edge-to-visual:calc(var(--spectrum-component-edge-to-visual-50) - var(--spectrum-actionbutton-border-width));--spectrum-actionbutton-edge-to-text:calc(var(--spectrum-component-edge-to-text-50) - var(--spectrum-actionbutton-border-width));--spectrum-actionbutton-edge-to-visual-only:calc(var(--spectrum-component-edge-to-visual-only-50) - var(--spectrum-actionbutton-border-width))}:host([size=s]){--spectrum-actionbutton-min-width:calc(var(--spectrum-component-edge-to-visual-only-75)*2 + var(--spectrum-workflow-icon-size-75));--spectrum-actionbutton-height:var(--spectrum-component-height-75);--spectrum-actionbutton-icon-size:var(--spectrum-workflow-icon-size-75);--spectrum-actionbutton-font-size:var(--spectrum-font-size-75);--spectrum-actionbutton-text-to-visual:var(--spectrum-text-to-visual-75);--spectrum-actionbutton-edge-to-hold-icon:var(
|
|
25
65
|
--spectrum-action-button-edge-to-hold-icon-small
|
|
@@ -152,7 +192,7 @@ var(--spectrum-actionbutton-edge-to-visual-only)
|
|
|
152
192
|
) - var(
|
|
153
193
|
--mod-actionbutton-edge-to-text,
|
|
154
194
|
var(--spectrum-actionbutton-edge-to-text)
|
|
155
|
-
))}#label{color:inherit;font-size:var(
|
|
195
|
+
))}#label{color:var(--mod-actionbutton-label-color,inherit);font-size:var(
|
|
156
196
|
--mod-actionbutton-font-size,var(--spectrum-actionbutton-font-size)
|
|
157
197
|
);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([dir=rtl]) .hold-affordance{transform:matrix(-1,0,0,1,0,0)}.hold-affordance{color:inherit;inset-block-end:calc(var(
|
|
158
198
|
--mod-actionbutton-edge-to-hold-icon,
|
|
@@ -212,14 +252,6 @@ var(--spectrum-actionbutton-border-width)
|
|
|
212
252
|
--system-spectrum-actionbutton-border-color-down
|
|
213
253
|
);--spectrum-actionbutton-border-color-focus:var(
|
|
214
254
|
--system-spectrum-actionbutton-border-color-focus
|
|
215
|
-
);--spectrum-actionbutton-content-color-default:var(
|
|
216
|
-
--system-spectrum-actionbutton-content-color-default
|
|
217
|
-
);--spectrum-actionbutton-content-color-hover:var(
|
|
218
|
-
--system-spectrum-actionbutton-content-color-hover
|
|
219
|
-
);--spectrum-actionbutton-content-color-down:var(
|
|
220
|
-
--system-spectrum-actionbutton-content-color-down
|
|
221
|
-
);--spectrum-actionbutton-content-color-focus:var(
|
|
222
|
-
--system-spectrum-actionbutton-content-color-focus
|
|
223
255
|
);--spectrum-actionbutton-background-color-disabled:var(
|
|
224
256
|
--system-spectrum-actionbutton-background-color-disabled
|
|
225
257
|
);--spectrum-actionbutton-border-color-disabled:var(
|
|
@@ -246,15 +278,7 @@ var(--spectrum-actionbutton-border-width)
|
|
|
246
278
|
--system-spectrum-actionbutton-quiet-background-color-disabled
|
|
247
279
|
);--spectrum-actionbutton-border-color-disabled:var(
|
|
248
280
|
--system-spectrum-actionbutton-quiet-border-color-disabled
|
|
249
|
-
)}:host([selected]){--spectrum-actionbutton-
|
|
250
|
-
--system-spectrum-actionbutton-selected-background-color-default
|
|
251
|
-
);--spectrum-actionbutton-background-color-hover:var(
|
|
252
|
-
--system-spectrum-actionbutton-selected-background-color-hover
|
|
253
|
-
);--spectrum-actionbutton-background-color-down:var(
|
|
254
|
-
--system-spectrum-actionbutton-selected-background-color-down
|
|
255
|
-
);--spectrum-actionbutton-background-color-focus:var(
|
|
256
|
-
--system-spectrum-actionbutton-selected-background-color-focus
|
|
257
|
-
);--spectrum-actionbutton-border-color-default:var(
|
|
281
|
+
)}:host([selected]){--spectrum-actionbutton-border-color-default:var(
|
|
258
282
|
--system-spectrum-actionbutton-selected-border-color-default
|
|
259
283
|
);--spectrum-actionbutton-border-color-hover:var(
|
|
260
284
|
--system-spectrum-actionbutton-selected-border-color-hover
|
|
@@ -262,27 +286,11 @@ var(--spectrum-actionbutton-border-width)
|
|
|
262
286
|
--system-spectrum-actionbutton-selected-border-color-down
|
|
263
287
|
);--spectrum-actionbutton-border-color-focus:var(
|
|
264
288
|
--system-spectrum-actionbutton-selected-border-color-focus
|
|
265
|
-
);--spectrum-actionbutton-content-color-default:var(
|
|
266
|
-
--system-spectrum-actionbutton-selected-content-color-default
|
|
267
|
-
);--spectrum-actionbutton-content-color-hover:var(
|
|
268
|
-
--system-spectrum-actionbutton-selected-content-color-hover
|
|
269
|
-
);--spectrum-actionbutton-content-color-down:var(
|
|
270
|
-
--system-spectrum-actionbutton-selected-content-color-down
|
|
271
|
-
);--spectrum-actionbutton-content-color-focus:var(
|
|
272
|
-
--system-spectrum-actionbutton-selected-content-color-focus
|
|
273
289
|
);--spectrum-actionbutton-background-color-disabled:var(
|
|
274
290
|
--system-spectrum-actionbutton-selected-background-color-disabled
|
|
275
291
|
);--spectrum-actionbutton-border-color-disabled:var(
|
|
276
292
|
--system-spectrum-actionbutton-selected-border-color-disabled
|
|
277
|
-
)}:host([
|
|
278
|
-
--system-spectrum-actionbutton-selected-emphasized-background-color-default
|
|
279
|
-
);--spectrum-actionbutton-background-color-hover:var(
|
|
280
|
-
--system-spectrum-actionbutton-selected-emphasized-background-color-hover
|
|
281
|
-
);--spectrum-actionbutton-background-color-down:var(
|
|
282
|
-
--system-spectrum-actionbutton-selected-emphasized-background-color-down
|
|
283
|
-
);--spectrum-actionbutton-background-color-focus:var(
|
|
284
|
-
--system-spectrum-actionbutton-selected-emphasized-background-color-focus
|
|
285
|
-
)}:host([variant=black][quiet]){--spectrum-actionbutton-border-color-default:var(
|
|
293
|
+
)}:host([static=black][quiet]){--spectrum-actionbutton-border-color-default:var(
|
|
286
294
|
--system-spectrum-actionbutton-staticblack-quiet-border-color-default
|
|
287
295
|
);--spectrum-actionbutton-border-color-hover:var(
|
|
288
296
|
--system-spectrum-actionbutton-staticblack-quiet-border-color-hover
|
|
@@ -292,7 +300,7 @@ var(--spectrum-actionbutton-border-width)
|
|
|
292
300
|
--system-spectrum-actionbutton-staticblack-quiet-border-color-focus
|
|
293
301
|
);--spectrum-actionbutton-border-color-disabled:var(
|
|
294
302
|
--system-spectrum-actionbutton-staticblack-quiet-border-color-disabled
|
|
295
|
-
)}:host([
|
|
303
|
+
)}:host([static=white][quiet]){--spectrum-actionbutton-border-color-default:var(
|
|
296
304
|
--system-spectrum-actionbutton-staticwhite-quiet-border-color-default
|
|
297
305
|
);--spectrum-actionbutton-border-color-hover:var(
|
|
298
306
|
--system-spectrum-actionbutton-staticwhite-quiet-border-color-hover
|
|
@@ -302,7 +310,7 @@ var(--spectrum-actionbutton-border-width)
|
|
|
302
310
|
--system-spectrum-actionbutton-staticwhite-quiet-border-color-focus
|
|
303
311
|
);--spectrum-actionbutton-border-color-disabled:var(
|
|
304
312
|
--system-spectrum-actionbutton-staticwhite-quiet-border-color-disabled
|
|
305
|
-
)}:host([
|
|
313
|
+
)}:host([static=black]){--spectrum-actionbutton-background-color-default:var(
|
|
306
314
|
--system-spectrum-actionbutton-staticblack-background-color-default
|
|
307
315
|
);--spectrum-actionbutton-background-color-hover:var(
|
|
308
316
|
--system-spectrum-actionbutton-staticblack-background-color-hover
|
|
@@ -334,35 +342,35 @@ var(--spectrum-actionbutton-border-width)
|
|
|
334
342
|
--system-spectrum-actionbutton-staticblack-border-color-disabled
|
|
335
343
|
);--spectrum-actionbutton-content-color-disabled:var(
|
|
336
344
|
--system-spectrum-actionbutton-staticblack-content-color-disabled
|
|
337
|
-
)}:host([
|
|
338
|
-
--system-spectrum-actionbutton-staticblack-selected-background-color-default
|
|
339
|
-
);--
|
|
340
|
-
--system-spectrum-actionbutton-staticblack-selected-background-color-hover
|
|
341
|
-
);--
|
|
342
|
-
--system-spectrum-actionbutton-staticblack-selected-background-color-down
|
|
343
|
-
);--
|
|
344
|
-
--system-spectrum-actionbutton-staticblack-selected-background-color-focus
|
|
345
|
-
);--
|
|
346
|
-
--system-spectrum-actionbutton-staticblack-selected-border-color-disabled
|
|
347
|
-
);--spectrum-actionbutton-content-color-default:var(
|
|
345
|
+
)}:host([static=black][selected]){--mod-actionbutton-background-color-default:var(
|
|
346
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-background-color-default
|
|
347
|
+
);--mod-actionbutton-background-color-hover:var(
|
|
348
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-background-color-hover
|
|
349
|
+
);--mod-actionbutton-background-color-down:var(
|
|
350
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-background-color-down
|
|
351
|
+
);--mod-actionbutton-background-color-focus:var(
|
|
352
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-background-color-focus
|
|
353
|
+
);--mod-actionbutton-content-color-default:var(
|
|
348
354
|
--mod-actionbutton-static-content-color,var(
|
|
349
|
-
--system-spectrum-actionbutton-staticblack-selected-content-color-default
|
|
355
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-content-color-default
|
|
350
356
|
)
|
|
351
|
-
);--
|
|
357
|
+
);--mod-actionbutton-content-color-hover:var(
|
|
352
358
|
--mod-actionbutton-static-content-color,var(
|
|
353
|
-
--system-spectrum-actionbutton-staticblack-selected-content-color-hover
|
|
359
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-content-color-hover
|
|
354
360
|
)
|
|
355
|
-
);--
|
|
361
|
+
);--mod-actionbutton-content-color-down:var(
|
|
356
362
|
--mod-actionbutton-static-content-color,var(
|
|
357
|
-
--system-spectrum-actionbutton-staticblack-selected-content-color-down
|
|
363
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-content-color-down
|
|
358
364
|
)
|
|
359
|
-
);--
|
|
365
|
+
);--mod-actionbutton-content-color-focus:var(
|
|
360
366
|
--mod-actionbutton-static-content-color,var(
|
|
361
|
-
--system-spectrum-actionbutton-staticblack-selected-content-color-focus
|
|
367
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-content-color-focus
|
|
362
368
|
)
|
|
363
|
-
);--
|
|
364
|
-
--system-spectrum-actionbutton-staticblack-selected-background-color-disabled
|
|
365
|
-
)
|
|
369
|
+
);--mod-actionbutton-background-color-disabled:var(
|
|
370
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-background-color-disabled
|
|
371
|
+
);--mod-actionbutton-border-color-disabled:var(
|
|
372
|
+
--system-spectrum-actionbutton-staticblack-selected-mod-actionbutton-border-color-disabled
|
|
373
|
+
)}:host([static=white]){--spectrum-actionbutton-background-color-default:var(
|
|
366
374
|
--system-spectrum-actionbutton-staticwhite-background-color-default
|
|
367
375
|
);--spectrum-actionbutton-background-color-hover:var(
|
|
368
376
|
--system-spectrum-actionbutton-staticwhite-background-color-hover
|
|
@@ -394,34 +402,34 @@ var(--spectrum-actionbutton-border-width)
|
|
|
394
402
|
--system-spectrum-actionbutton-staticwhite-border-color-disabled
|
|
395
403
|
);--spectrum-actionbutton-content-color-disabled:var(
|
|
396
404
|
--system-spectrum-actionbutton-staticwhite-content-color-disabled
|
|
397
|
-
)}:host([
|
|
398
|
-
--system-spectrum-actionbutton-staticwhite-selected-background-color-default
|
|
399
|
-
);--
|
|
400
|
-
--system-spectrum-actionbutton-staticwhite-selected-background-color-hover
|
|
401
|
-
);--
|
|
402
|
-
--system-spectrum-actionbutton-staticwhite-selected-background-color-down
|
|
403
|
-
);--
|
|
404
|
-
--system-spectrum-actionbutton-staticwhite-selected-background-color-focus
|
|
405
|
-
);--
|
|
405
|
+
)}:host([static=white][selected]){--mod-actionbutton-background-color-default:var(
|
|
406
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-background-color-default
|
|
407
|
+
);--mod-actionbutton-background-color-hover:var(
|
|
408
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-background-color-hover
|
|
409
|
+
);--mod-actionbutton-background-color-down:var(
|
|
410
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-background-color-down
|
|
411
|
+
);--mod-actionbutton-background-color-focus:var(
|
|
412
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-background-color-focus
|
|
413
|
+
);--mod-actionbutton-content-color-default:var(
|
|
406
414
|
--mod-actionbutton-static-content-color,var(
|
|
407
|
-
--system-spectrum-actionbutton-staticwhite-selected-content-color-default
|
|
415
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-content-color-default
|
|
408
416
|
)
|
|
409
|
-
);--
|
|
417
|
+
);--mod-actionbutton-content-color-hover:var(
|
|
410
418
|
--mod-actionbutton-static-content-color,var(
|
|
411
|
-
--system-spectrum-actionbutton-staticwhite-selected-content-color-hover
|
|
419
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-content-color-hover
|
|
412
420
|
)
|
|
413
|
-
);--
|
|
421
|
+
);--mod-actionbutton-content-color-down:var(
|
|
414
422
|
--mod-actionbutton-static-content-color,var(
|
|
415
|
-
--system-spectrum-actionbutton-staticwhite-selected-content-color-down
|
|
423
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-content-color-down
|
|
416
424
|
)
|
|
417
|
-
);--
|
|
425
|
+
);--mod-actionbutton-content-color-focus:var(
|
|
418
426
|
--mod-actionbutton-static-content-color,var(
|
|
419
|
-
--system-spectrum-actionbutton-staticwhite-selected-content-color-focus
|
|
427
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-content-color-focus
|
|
420
428
|
)
|
|
421
|
-
);--
|
|
422
|
-
--system-spectrum-actionbutton-staticwhite-selected-background-color-disabled
|
|
423
|
-
);--
|
|
424
|
-
--system-spectrum-actionbutton-staticwhite-selected-border-color-disabled
|
|
429
|
+
);--mod-actionbutton-background-color-disabled:var(
|
|
430
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-background-color-disabled
|
|
431
|
+
);--mod-actionbutton-border-color-disabled:var(
|
|
432
|
+
--system-spectrum-actionbutton-staticwhite-selected-mod-actionbutton-border-color-disabled
|
|
425
433
|
)}::slotted([slot=icon]){flex-shrink:0}#label{flex-grow:var(--spectrum-actionbutton-label-flex-grow);pointer-events:none!important;text-align:var(--spectrum-actionbutton-label-text-align)}:host([size=xs]){min-width:var(--spectrum-actionbutton-height,0)}@media (forced-colors:active){:host{--highcontrast-actionbutton-border-color-disabled:GrayText;--highcontrast-actionbutton-content-color-disabled:GrayText}}
|
|
426
434
|
`;
|
|
427
435
|
export default styles;
|