@spectrum-web-components/action-button 1.0.0-rc.0 → 1.0.0-rc.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/action-button",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -58,11 +58,11 @@
58
58
  "lit-html"
59
59
  ],
60
60
  "dependencies": {
61
- "@spectrum-web-components/base": "^1.0.0-rc.0",
62
- "@spectrum-web-components/button": "^1.0.0-rc.0",
63
- "@spectrum-web-components/icon": "^1.0.0-rc.0",
64
- "@spectrum-web-components/icons-ui": "^1.0.0-rc.0",
65
- "@spectrum-web-components/shared": "^1.0.0-rc.0"
61
+ "@spectrum-web-components/base": "^1.0.0-rc.1",
62
+ "@spectrum-web-components/button": "^1.0.0-rc.1",
63
+ "@spectrum-web-components/icon": "^1.0.0-rc.1",
64
+ "@spectrum-web-components/icons-ui": "^1.0.0-rc.1",
65
+ "@spectrum-web-components/shared": "^1.0.0-rc.1"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@spectrum-css/actionbutton": "^7.0.0-s2-foundations.22"
@@ -73,5 +73,5 @@
73
73
  "./sp-*.js",
74
74
  "./**/*.dev.js"
75
75
  ],
76
- "gitHead": "24a3e0d1d0ead33c41454223b290a258b75d3111"
76
+ "gitHead": "9f2638a0500c33adc8e06079a87a55b7d5695966"
77
77
  }
@@ -40,14 +40,6 @@ export declare class ActionButton extends ActionButton_base {
40
40
  * The static color variant to use for the action button.
41
41
  */
42
42
  staticColor?: 'white' | 'black';
43
- /**
44
- * @deprecated Use `staticColor` instead.
45
- */
46
- static?: 'white' | 'black';
47
- /**
48
- * @deprecated Use `staticColor` instead.
49
- */
50
- variant?: 'white' | 'black';
51
43
  get value(): string;
52
44
  set value(value: string);
53
45
  private _value;
@@ -186,28 +186,6 @@ export class ActionButton extends SizedMixin(ButtonBase, {
186
186
  }
187
187
  }
188
188
  }
189
- if (changes.has("variant") && (this.variant !== void 0 || changes.get("variant") !== void 0)) {
190
- this.staticColor = this.variant;
191
- if (true) {
192
- window.__swc.warn(
193
- this,
194
- `The "variant" attribute/property of <${this.localName}> has been deprecated. Use "static-color" with the same values instead. "variant" will be removed in a future release.`,
195
- "https://opensource.adobe.com/spectrum-web-components/components/action-button/api/",
196
- { level: "deprecation" }
197
- );
198
- }
199
- }
200
- if (changes.has("static") && (this.static !== void 0 || changes.get("static") !== void 0)) {
201
- this.staticColor = this.static;
202
- if (true) {
203
- window.__swc.warn(
204
- this,
205
- `The "static" attribute/property of <${this.localName}> has been deprecated. Use "static-color" with the same values instead. "static" will be removed in a future release.`,
206
- "https://opensource.adobe.com/spectrum-web-components/components/action-button/api/",
207
- { level: "deprecation" }
208
- );
209
- }
210
- }
211
189
  if (changes.has("holdAffordance")) {
212
190
  if (this.holdAffordance) {
213
191
  this.addEventListener(
@@ -245,12 +223,6 @@ __decorateClass([
245
223
  __decorateClass([
246
224
  property({ reflect: true, attribute: "static-color" })
247
225
  ], ActionButton.prototype, "staticColor", 2);
248
- __decorateClass([
249
- property({ reflect: true })
250
- ], ActionButton.prototype, "static", 2);
251
- __decorateClass([
252
- property({ reflect: true })
253
- ], ActionButton.prototype, "variant", 2);
254
226
  __decorateClass([
255
227
  property({ type: String })
256
228
  ], ActionButton.prototype, "value", 1);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 /**\n * @deprecated Use `staticColor` instead.\n */\n @property({ reflect: true })\n public static?: 'white' | 'black';\n\n /**\n * @deprecated Use `staticColor` instead.\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 }\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 (\n changes.has('variant') &&\n (this.variant !== undefined || changes.get('variant') !== undefined)\n ) {\n this.staticColor = this.variant;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"variant\" attribute/property of <${this.localName}> has been deprecated. Use \"static-color\" with the same values instead. \"variant\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/action-button/api/',\n { level: 'deprecation' }\n );\n }\n }\n if (\n changes.has('static') &&\n (this.static !== undefined || changes.get('static') !== undefined)\n ) {\n this.staticColor = this.static;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"static\" attribute/property of <${this.localName}> has been deprecated. Use \"static-color\" with the same values instead. \"static\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/action-button/api/',\n { level: 'deprecation' }\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,E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;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;AA7PW;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;AAMA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAjDlB,aAkDF;AAMA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAvDlB,aAwDF;AAGI;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA1DjB,aA2DE;",
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,EACJ;AAAA,EAoCA,IAAW,QAAg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K;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
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
- "use strict";var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var i=(a,o,e,t)=>{for(var r=t>1?void 0:t?p(o,e):o,n=a.length-1,l;n>=0;n--)(l=a[n])&&(r=(t?l(o,e,r):l(r))||r);return t&&r&&c(o,e,r),r};import{html as u,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 w={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(u`
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
2
  <sp-icon-corner-triangle300
3
- class="hold-affordance ${w[this.size]}"
3
+ class="hold-affordance ${g[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"))),e.has("variant")&&(this.variant!==void 0||e.get("variant")!==void 0)&&(this.staticColor=this.variant),e.has("static")&&(this.static!==void 0||e.get("static")!==void 0)&&(this.staticColor=this.static),e.has("holdAffordance")&&(this.holdAffordance?this.addEventListener("pointerdown",this.handlePointerdownHoldAffordance):(this.removeEventListener("pointerdown",this.handlePointerdownHoldAffordance),this.handlePointerupHoldAffordance()))}}i([s({type:Boolean,reflect:!0})],ActionButton.prototype,"emphasized",2),i([s({type:Boolean,reflect:!0,attribute:"hold-affordance"})],ActionButton.prototype,"holdAffordance",2),i([s({type:Boolean,reflect:!0})],ActionButton.prototype,"quiet",2),i([s({reflect:!0})],ActionButton.prototype,"role",2),i([s({type:Boolean,reflect:!0})],ActionButton.prototype,"selected",2),i([s({type:Boolean,reflect:!0})],ActionButton.prototype,"toggles",2),i([s({reflect:!0,attribute:"static-color"})],ActionButton.prototype,"staticColor",2),i([s({reflect:!0})],ActionButton.prototype,"static",2),i([s({reflect:!0})],ActionButton.prototype,"variant",2),i([s({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("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
6
  //# sourceMappingURL=ActionButton.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 /**\n * @deprecated Use `staticColor` instead.\n */\n @property({ reflect: true })\n public static?: 'white' | 'black';\n\n /**\n * @deprecated Use `staticColor` instead.\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 }\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 (\n changes.has('variant') &&\n (this.variant !== undefined || changes.get('variant') !== undefined)\n ) {\n this.staticColor = this.variant;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"variant\" attribute/property of <${this.localName}> has been deprecated. Use \"static-color\" with the same values instead. \"variant\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/action-button/api/',\n { level: 'deprecation' }\n );\n }\n }\n if (\n changes.has('static') &&\n (this.static !== undefined || changes.get('static') !== undefined)\n ) {\n this.staticColor = this.static;\n if (window.__swc.DEBUG) {\n window.__swc.warn(\n this,\n `The \"static\" attribute/property of <${this.localName}> has been deprecated. Use \"static-color\" with the same values instead. \"static\" will be removed in a future release.`,\n 'https://opensource.adobe.com/spectrum-web-components/components/action-button/api/',\n { level: 'deprecation' }\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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KAAK,UAAY,QAAaA,EAAQ,IAAI,SAAS,IAAM,UAE1D,KAAK,YAAc,KAAK,SAWxBA,EAAQ,IAAI,QAAQ,IACnB,KAAK,SAAW,QAAaA,EAAQ,IAAI,QAAQ,IAAM,UAExD,KAAK,YAAc,KAAK,QAUxBA,EAAQ,IAAI,gBAAgB,IACxB,KAAK,eACL,KAAK,iBACD,cACA,KAAK,+BACT,GAEA,KAAK,oBACD,cACA,KAAK,+BACT,EACA,KAAK,8BAA8B,GAG/C,CACJ,CA7PWG,EAAA,CADNf,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAbjC,aAcF,0BAGAe,EAAA,CADNf,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,iBAAkB,CAAC,GAhB/D,aAiBF,8BAGAe,EAAA,CADNf,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAnBjC,aAoBF,qBAGSe,EAAA,CADff,EAAS,CAAE,QAAS,EAAK,CAAC,GAtBlB,aAuBO,oBAOTe,EAAA,CADNf,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA7BjC,aA8BF,wBAQAe,EAAA,CADNf,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GArCjC,aAsCF,uBAMAe,EAAA,CADNf,EAAS,CAAE,QAAS,GAAM,UAAW,cAAe,CAAC,GA3C7C,aA4CF,2BAMAe,EAAA,CADNf,EAAS,CAAE,QAAS,EAAK,CAAC,GAjDlB,aAkDF,sBAMAe,EAAA,CADNf,EAAS,CAAE,QAAS,EAAK,CAAC,GAvDlB,aAwDF,uBAGIe,EAAA,CADVf,EAAS,CAAE,KAAM,MAAO,CAAC,GA1DjB,aA2DE",
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,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ADVf,EAAS,CAAE,KAAM,MAAO,CAAC,GA9CjB,aA+CE",
6
6
  "names": ["html", "SizedMixin", "property", "ButtonBase", "buttonStyles", "cornerTriangleStyles", "cornerTriangleOverrides", "holdAffordanceClass", "LONGPRESS_TIMEOUT", "value", "event", "code", "altKey", "buttonContent", "changes", "isButton", "canBePressed", "__decorateClass"]
7
7
  }
@@ -6,36 +6,36 @@ export default {
6
6
  title: "Action Button/Static Black Quiet",
7
7
  decorators: [makeOverBackground("black")]
8
8
  };
9
- const variant = "black";
9
+ const staticColor = "black";
10
10
  const quiet = true;
11
11
  export const XS = (args) => renderButtons(args);
12
12
  XS.args = {
13
13
  size: "xs",
14
14
  quiet,
15
- variant
15
+ staticColor
16
16
  };
17
17
  export const s = (args) => renderButtons(args);
18
18
  s.args = {
19
19
  size: "s",
20
20
  quiet,
21
- variant
21
+ staticColor
22
22
  };
23
23
  export const m = (args) => renderButtons(args);
24
24
  m.args = {
25
25
  size: "m",
26
26
  quiet,
27
- variant
27
+ staticColor
28
28
  };
29
29
  export const l = (args) => renderButtons(args);
30
30
  l.args = {
31
31
  size: "l",
32
32
  quiet,
33
- variant
33
+ staticColor
34
34
  };
35
35
  export const XL = (args) => renderButtons(args);
36
36
  XL.args = {
37
37
  size: "xl",
38
38
  quiet,
39
- variant
39
+ staticColor
40
40
  };
41
41
  //# sourceMappingURL=action-button-black-quiet.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["action-button-black-quiet.stories.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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static Black Quiet',\n decorators: [makeOverBackground('black')],\n};\n\nconst variant = 'black';\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n quiet,\n variant,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n quiet,\n variant,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n quiet,\n variant,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n quiet,\n variant,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n quiet,\n variant,\n};\n"],
5
- "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,OAAO,CAAC;AAC5C;AAEA,MAAM,UAAU;AAChB,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;",
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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static Black Quiet',\n decorators: [makeOverBackground('black')],\n};\n\nconst staticColor = 'black';\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n quiet,\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n quiet,\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n quiet,\n staticColor,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n quiet,\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n quiet,\n staticColor,\n};\n"],
5
+ "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,OAAO,CAAC;AAC5C;AAEA,MAAM,cAAc;AACpB,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;",
6
6
  "names": []
7
7
  }
@@ -6,30 +6,30 @@ export default {
6
6
  title: "Action Button/Static Black",
7
7
  decorators: [makeOverBackground("black")]
8
8
  };
9
- const variant = "black";
9
+ const staticColor = "black";
10
10
  export const XS = (args) => renderButtons(args);
11
11
  XS.args = {
12
12
  size: "xs",
13
- variant
13
+ staticColor
14
14
  };
15
15
  export const s = (args) => renderButtons(args);
16
16
  s.args = {
17
17
  size: "s",
18
- variant
18
+ staticColor
19
19
  };
20
20
  export const m = (args) => renderButtons(args);
21
21
  m.args = {
22
22
  size: "m",
23
- variant
23
+ staticColor
24
24
  };
25
25
  export const l = (args) => renderButtons(args);
26
26
  l.args = {
27
27
  size: "l",
28
- variant
28
+ staticColor
29
29
  };
30
30
  export const XL = (args) => renderButtons(args);
31
31
  XL.args = {
32
32
  size: "xl",
33
- variant
33
+ staticColor
34
34
  };
35
35
  //# sourceMappingURL=action-button-black.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["action-button-black.stories.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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static Black',\n decorators: [makeOverBackground('black')],\n};\n\nconst variant = 'black';\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n variant,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n variant,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n variant,\n} as Properties;\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n variant,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n variant,\n};\n"],
5
- "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,OAAO,CAAC;AAC5C;AAEA,MAAM,UAAU;AAET,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;",
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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static Black',\n decorators: [makeOverBackground('black')],\n};\n\nconst staticColor = 'black';\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n staticColor,\n} as Properties;\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n staticColor,\n};\n"],
5
+ "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,OAAO,CAAC;AAC5C;AAEA,MAAM,cAAc;AAEb,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;",
6
6
  "names": []
7
7
  }
@@ -6,36 +6,36 @@ export default {
6
6
  title: "Action Button/Static White Quiet",
7
7
  decorators: [makeOverBackground()]
8
8
  };
9
- const variant = "white";
9
+ const staticColor = "white";
10
10
  const quiet = true;
11
11
  export const XS = (args) => renderButtons(args);
12
12
  XS.args = {
13
13
  size: "xs",
14
14
  quiet,
15
- variant
15
+ staticColor
16
16
  };
17
17
  export const s = (args) => renderButtons(args);
18
18
  s.args = {
19
19
  size: "s",
20
20
  quiet,
21
- variant
21
+ staticColor
22
22
  };
23
23
  export const m = (args) => renderButtons(args);
24
24
  m.args = {
25
25
  size: "m",
26
26
  quiet,
27
- variant
27
+ staticColor
28
28
  };
29
29
  export const l = (args) => renderButtons(args);
30
30
  l.args = {
31
31
  size: "l",
32
32
  quiet,
33
- variant
33
+ staticColor
34
34
  };
35
35
  export const XL = (args) => renderButtons(args);
36
36
  XL.args = {
37
37
  size: "xl",
38
38
  quiet,
39
- variant
39
+ staticColor
40
40
  };
41
41
  //# sourceMappingURL=action-button-white-quiet.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["action-button-white-quiet.stories.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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static White Quiet',\n decorators: [makeOverBackground()],\n};\n\nconst variant = 'white';\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n quiet,\n variant,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n quiet,\n variant,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n quiet,\n variant,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n quiet,\n variant,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n quiet,\n variant,\n};\n"],
5
- "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,CAAC;AACrC;AAEA,MAAM,UAAU;AAChB,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;",
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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static White Quiet',\n decorators: [makeOverBackground()],\n};\n\nconst staticColor = 'white';\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n quiet,\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n quiet,\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n quiet,\n staticColor,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n quiet,\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n quiet,\n staticColor,\n};\n"],
5
+ "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,CAAC;AACrC;AAEA,MAAM,cAAc;AACpB,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;",
6
6
  "names": []
7
7
  }
@@ -6,30 +6,30 @@ export default {
6
6
  title: "Action Button/Static White",
7
7
  decorators: [makeOverBackground()]
8
8
  };
9
- const variant = "white";
9
+ const staticColor = "white";
10
10
  export const XS = (args) => renderButtons(args);
11
11
  XS.args = {
12
12
  size: "xs",
13
- variant
13
+ staticColor
14
14
  };
15
15
  export const s = (args) => renderButtons(args);
16
16
  s.args = {
17
17
  size: "s",
18
- variant
18
+ staticColor
19
19
  };
20
20
  export const m = (args) => renderButtons(args);
21
21
  m.args = {
22
22
  size: "m",
23
- variant
23
+ staticColor
24
24
  };
25
25
  export const l = (args) => renderButtons(args);
26
26
  l.args = {
27
27
  size: "l",
28
- variant
28
+ staticColor
29
29
  };
30
30
  export const XL = (args) => renderButtons(args);
31
31
  XL.args = {
32
32
  size: "xl",
33
- variant
33
+ staticColor
34
34
  };
35
35
  //# sourceMappingURL=action-button-white.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["action-button-white.stories.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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static White',\n decorators: [makeOverBackground()],\n};\n\nconst variant = 'white';\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n variant,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n variant,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n variant,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n variant,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n variant,\n};\n"],
5
- "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,CAAC;AACrC;AAEA,MAAM,UAAU;AAET,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;",
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*/\nimport { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static White',\n decorators: [makeOverBackground()],\n};\n\nconst staticColor = 'white';\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n staticColor,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n staticColor,\n};\n"],
5
+ "mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,CAAC;AACrC;AAEA,MAAM,cAAc;AAEb,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;",
6
6
  "names": []
7
7
  }
package/stories/index.js CHANGED
@@ -10,7 +10,7 @@ export function renderButton(properties) {
10
10
  <sp-action-button
11
11
  ?quiet="${!!properties.quiet}"
12
12
  ?emphasized="${!!properties.emphasized}"
13
- static-color="${ifDefined(properties.variant)}"
13
+ static-color="${ifDefined(properties.staticColor)}"
14
14
  ?disabled=${!!properties.disabled}
15
15
  ?selected=${!!properties.selected}
16
16
  ?toggles=${!!properties.toggles}
@@ -33,6 +33,7 @@ function renderGroup(properties) {
33
33
  ?quiet="${!!properties.quiet}"
34
34
  ?emphasized="${!!properties.emphasized}"
35
35
  size=${properties.size || "m"}
36
+ static-color="${ifDefined(properties.staticColor)}"
36
37
  >
37
38
  ${renderButton({
38
39
  ...properties,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["index.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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\n\nexport interface Properties {\n active?: boolean;\n quiet?: boolean;\n disabled?: boolean;\n selected?: boolean;\n toggles?: boolean;\n emphasized?: boolean;\n size?: 's' | 'm' | 'l' | 'xl';\n variant?: 'white' | 'black';\n holdAffordance?: boolean;\n icon?: TemplateResult;\n label?: string;\n [prop: string]: unknown;\n}\n\nexport function renderButton(properties: Properties): TemplateResult {\n return html`\n <sp-action-button\n ?quiet=\"${!!properties.quiet}\"\n ?emphasized=\"${!!properties.emphasized}\"\n static-color=\"${ifDefined(properties.variant)}\"\n ?disabled=${!!properties.disabled}\n ?selected=${!!properties.selected}\n ?toggles=${!!properties.toggles}\n size=${properties.size || 'm'}\n ?hold-affordance=${!!properties.holdAffordance}\n ?active=${!!properties.active}\n >\n ${properties.icon}${properties.label}\n </sp-action-button>\n `;\n}\n\nfunction renderGroup(properties: Properties): TemplateResult {\n const label = 'Edit';\n const holdAffordance = true;\n const icon = html`\n <sp-icon-edit slot=\"icon\"></sp-icon-edit>\n `;\n return html`\n <sp-action-group\n ?quiet=\"${!!properties.quiet}\"\n ?emphasized=\"${!!properties.emphasized}\"\n size=${properties.size || 'm'}\n >\n ${renderButton({\n ...properties,\n label,\n })}\n ${renderButton({\n ...properties,\n label,\n icon,\n })}\n ${renderButton({\n ...properties,\n icon,\n })}\n ${renderButton({\n ...properties,\n icon,\n holdAffordance,\n })}\n </sp-action-group>\n `;\n}\n\nexport function renderButtons(properties: Properties): TemplateResult {\n const selected = true;\n const disabled = true;\n return html`\n <div\n style=\"display: flex; flex-direction: column; gap: calc(var(--spectrum-spacing-100) * var(--swc-scale-factor));\"\n >\n ${renderGroup({\n ...properties,\n })}\n ${renderGroup({\n ...properties,\n selected,\n })}\n ${renderGroup({\n ...properties,\n disabled,\n })}\n ${renderGroup({\n ...properties,\n disabled,\n selected,\n })}\n </div>\n `;\n}\n"],
5
- "mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAC1B,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAiBA,gBAAS,aAAa,YAAwC;AACjE,SAAO;AAAA;AAAA,sBAEW,CAAC,CAAC,WAAW,KAAK;AAAA,2BACb,CAAC,CAAC,WAAW,UAAU;AAAA,4BACtB,UAAU,WAAW,OAAO,CAAC;AAAA,wBACjC,CAAC,CAAC,WAAW,QAAQ;AAAA,wBACrB,CAAC,CAAC,WAAW,QAAQ;AAAA,uBACtB,CAAC,CAAC,WAAW,OAAO;AAAA,mBACxB,WAAW,QAAQ,GAAG;AAAA,+BACV,CAAC,CAAC,WAAW,cAAc;AAAA,sBACpC,CAAC,CAAC,WAAW,MAAM;AAAA;AAAA,cAE3B,WAAW,IAAI,GAAG,WAAW,KAAK;AAAA;AAAA;AAGhD;AAEA,SAAS,YAAY,YAAwC;AACzD,QAAM,QAAQ;AACd,QAAM,iBAAiB;AACvB,QAAM,OAAO;AAAA;AAAA;AAGb,SAAO;AAAA;AAAA,sBAEW,CAAC,CAAC,WAAW,KAAK;AAAA,2BACb,CAAC,CAAC,WAAW,UAAU;AAAA,mBAC/B,WAAW,QAAQ,GAAG;AAAA;AAAA,cAE3B,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC,CAAC;AAAA;AAAA;AAGd;AAEO,gBAAS,cAAc,YAAwC;AAClE,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,SAAO;AAAA;AAAA;AAAA;AAAA,cAIG,YAAY;AAAA,IACV,GAAG;AAAA,EACP,CAAC,CAAC;AAAA,cACA,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC,CAAC;AAAA;AAAA;AAGd;",
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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\n\nexport interface Properties {\n active?: boolean;\n quiet?: boolean;\n disabled?: boolean;\n selected?: boolean;\n toggles?: boolean;\n emphasized?: boolean;\n size?: 's' | 'm' | 'l' | 'xl';\n staticColor?: 'white' | 'black';\n holdAffordance?: boolean;\n icon?: TemplateResult;\n label?: string;\n [prop: string]: unknown;\n}\n\nexport function renderButton(properties: Properties): TemplateResult {\n return html`\n <sp-action-button\n ?quiet=\"${!!properties.quiet}\"\n ?emphasized=\"${!!properties.emphasized}\"\n static-color=\"${ifDefined(properties.staticColor)}\"\n ?disabled=${!!properties.disabled}\n ?selected=${!!properties.selected}\n ?toggles=${!!properties.toggles}\n size=${properties.size || 'm'}\n ?hold-affordance=${!!properties.holdAffordance}\n ?active=${!!properties.active}\n >\n ${properties.icon}${properties.label}\n </sp-action-button>\n `;\n}\n\nfunction renderGroup(properties: Properties): TemplateResult {\n const label = 'Edit';\n const holdAffordance = true;\n const icon = html`\n <sp-icon-edit slot=\"icon\"></sp-icon-edit>\n `;\n return html`\n <sp-action-group\n ?quiet=\"${!!properties.quiet}\"\n ?emphasized=\"${!!properties.emphasized}\"\n size=${properties.size || 'm'}\n static-color=\"${ifDefined(properties.staticColor)}\"\n >\n ${renderButton({\n ...properties,\n label,\n })}\n ${renderButton({\n ...properties,\n label,\n icon,\n })}\n ${renderButton({\n ...properties,\n icon,\n })}\n ${renderButton({\n ...properties,\n icon,\n holdAffordance,\n })}\n </sp-action-group>\n `;\n}\n\nexport function renderButtons(properties: Properties): TemplateResult {\n const selected = true;\n const disabled = true;\n return html`\n <div\n style=\"display: flex; flex-direction: column; gap: calc(var(--spectrum-spacing-100) * var(--swc-scale-factor));\"\n >\n ${renderGroup({\n ...properties,\n })}\n ${renderGroup({\n ...properties,\n selected,\n })}\n ${renderGroup({\n ...properties,\n disabled,\n })}\n ${renderGroup({\n ...properties,\n disabled,\n selected,\n })}\n </div>\n `;\n}\n"],
5
+ "mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAC1B,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAiBA,gBAAS,aAAa,YAAwC;AACjE,SAAO;AAAA;AAAA,sBAEW,CAAC,CAAC,WAAW,KAAK;AAAA,2BACb,CAAC,CAAC,WAAW,UAAU;AAAA,4BACtB,UAAU,WAAW,WAAW,CAAC;AAAA,wBACrC,CAAC,CAAC,WAAW,QAAQ;AAAA,wBACrB,CAAC,CAAC,WAAW,QAAQ;AAAA,uBACtB,CAAC,C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";
14
14
  import { sendKeys } from "@web/test-runner-commands";
15
- import { spy, stub } from "sinon";
15
+ import { spy } from "sinon";
16
16
  import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
17
17
  import { m as BlackActionButton } from "../stories/action-button-black.stories.js";
18
18
  describe("ActionButton", () => {
@@ -228,69 +228,17 @@ describe("ActionButton", () => {
228
228
  expect(button).to.have.attribute("aria-haspopup", "true");
229
229
  expect(button).to.have.attribute("aria-expanded", "true");
230
230
  });
231
- describe("dev mode", () => {
232
- let consoleWarnStub;
233
- before(() => {
234
- window.__swc.verbose = true;
235
- consoleWarnStub = stub(console, "warn");
236
- });
237
- afterEach(() => {
238
- consoleWarnStub.resetHistory();
239
- });
240
- after(() => {
241
- window.__swc.verbose = false;
242
- consoleWarnStub.restore();
243
- });
244
- it("warns that `variant` is deprecated", async () => {
245
- const el = await fixture(html`
246
- <sp-action-button variant="white">Button</sp-action-button>
247
- `);
248
- await elementUpdated(el);
249
- expect(consoleWarnStub.called).to.be.true;
250
- const spyCall = consoleWarnStub.getCall(0);
251
- expect(
252
- spyCall.args.at(0).includes('"variant"'),
253
- "confirm variant-centric message"
254
- ).to.be.true;
255
- expect(spyCall.args.at(-1), "confirm `data` shape").to.deep.equal({
256
- data: {
257
- localName: "sp-action-button",
258
- type: "api",
259
- level: "deprecation"
260
- }
261
- });
262
- });
263
- it("warns that `variant` is deprecated", async () => {
264
- const el = await fixture(html`
265
- <sp-action-button static="white">Button</sp-action-button>
266
- `);
267
- await elementUpdated(el);
268
- expect(consoleWarnStub.called).to.be.true;
269
- const spyCall = consoleWarnStub.getCall(0);
270
- expect(
271
- spyCall.args.at(0).includes('"static"'),
272
- "confirm static-centric message"
273
- ).to.be.true;
274
- expect(spyCall.args.at(-1), "confirm `data` shape").to.deep.equal({
275
- data: {
276
- localName: "sp-action-button",
277
- type: "api",
278
- level: "deprecation"
279
- }
280
- });
281
- });
282
- it("prefers `staticColor` over `static`", async () => {
283
- const el = await fixture(html`
284
- <sp-action-button static="white">Button</sp-action-button>
285
- `);
286
- await elementUpdated(el);
287
- expect(el.staticColor).to.equal("white");
288
- el.setAttribute("static", "white");
289
- await elementUpdated(el);
290
- expect(el.staticColor).to.equal("white");
291
- expect(el.static).to.equal("white");
292
- expect(el.getAttribute("static-color")).to.equal("white");
293
- });
231
+ it("manages a `static-color` attribute", async () => {
232
+ const el = await fixture(html`
233
+ <sp-action-button static-color="black">Button</sp-action-button>
234
+ `);
235
+ await elementUpdated(el);
236
+ expect(el.staticColor).to.equal("black");
237
+ expect(el.getAttribute("static-color")).to.equal("black");
238
+ el.removeAttribute("static-color");
239
+ await elementUpdated(el);
240
+ expect(el.staticColor).to.be.null;
241
+ expect(el.hasAttribute("static-color")).to.be.false;
294
242
  });
295
243
  });
296
244
  //# sourceMappingURL=action-button.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["action-button.test.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 '@spectrum-web-components/action-button/sp-action-button.js';\nimport {\n ActionButton,\n LONGPRESS_DURATION,\n} from '@spectrum-web-components/action-button';\nimport {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n waitUntil,\n} from '@open-wc/testing';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { spy, stub } from 'sinon';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport { m as BlackActionButton } from '../stories/action-button-black.stories.js';\n\ndescribe('ActionButton', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<ActionButton>(\n BlackActionButton(BlackActionButton.args)\n )\n );\n it('loads default', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n expect(el.textContent).to.include('Button');\n await expect(el).to.be.accessible();\n });\n it('gardens \"value\" as a property', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.hasAttribute('value')).to.be.false;\n el.value = 'Value';\n await elementUpdated(el);\n expect(el.hasAttribute('value')).to.be.true;\n el.value = '';\n await elementUpdated(el);\n expect(el.hasAttribute('value')).to.be.false;\n });\n it('loads [hold-affordance]', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button hold-affordance>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n expect(el.textContent).to.include('Button');\n await expect(el).to.be.accessible();\n });\n it('manages a `tabindex`', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n expect(el.tabIndex).to.equal(0);\n expect(el.disabled).to.be.false;\n\n el.setAttribute('tabindex', '-1');\n await elementUpdated(el);\n\n expect(el.tabIndex).to.equal(-1);\n expect(el.disabled).to.be.false;\n\n el.disabled = true;\n await elementUpdated(el);\n\n expect(el.tabIndex).to.equal(-1);\n expect(el.disabled).to.be.true;\n\n el.disabled = false;\n await elementUpdated(el);\n\n expect(el.tabIndex).to.equal(-1);\n expect(el.disabled).to.be.false;\n });\n it('manages a `size` attribute', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button size=\"xl\">Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.size).to.equal('xl');\n expect(el.getAttribute('size')).to.equal('xl');\n el.removeAttribute('size');\n await elementUpdated(el);\n expect(el.size).to.equal('m');\n expect(el.hasAttribute('size')).to.be.false;\n });\n it('does not apply a default `size` attribute', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.size).to.equal('m');\n expect(el.hasAttribute('size')).to.be.false;\n });\n it('dispatches `longpress` events when [hold-affordance]', async () => {\n const longpressSpy = spy();\n const el = await fixture<ActionButton>(html`\n <sp-action-button\n hold-affordance\n @longpress=${() => longpressSpy()}\n >\n Button\n </sp-action-button>\n `);\n\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n\n expect(longpressSpy.callCount).to.equal(1);\n await sendKeys({\n press: 'Alt+ArrowDown',\n });\n\n expect(longpressSpy.callCount).to.equal(2);\n el.dispatchEvent(new PointerEvent('pointerdown', { button: 0 }));\n el.dispatchEvent(new PointerEvent('pointerup'));\n el.dispatchEvent(new PointerEvent('pointerdown', { button: 0 }));\n await waitUntil(() => longpressSpy.callCount === 3);\n });\n it('does not dispatch `longpress` events when \"right click\"ed', async () => {\n const longpressSpy = spy();\n const el = await fixture<ActionButton>(html`\n <sp-action-button\n hold-affordance\n @longpress=${() => longpressSpy()}\n >\n Button\n </sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(longpressSpy.callCount).to.equal(0);\n\n el.focus();\n el.dispatchEvent(new PointerEvent('pointerdown', { button: 1 }));\n await aTimeout(2 * LONGPRESS_DURATION);\n expect(longpressSpy.callCount).to.equal(0);\n });\n it(':not([toggles])', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n\n el.click();\n await elementUpdated(el);\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n });\n it('responds to [selected]', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n\n el.selected = true;\n await elementUpdated(el);\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.true;\n expect(button.getAttribute('aria-pressed')).to.equal('true');\n\n el.selected = false;\n await elementUpdated(el);\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n });\n it('toggles', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button toggles>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.false;\n expect(button.getAttribute('aria-pressed')).to.equal('false');\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button.getAttribute('aria-pressed')).to.equal('true');\n\n el.addEventListener('change', (event: Event) => event.preventDefault());\n el.click();\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button.getAttribute('aria-pressed')).to.equal('true');\n });\n it('toggles [aria-haspopup][aria-expanded]', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button\n toggles\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n >\n Button\n </sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.false;\n expect(button).not.to.have.attribute('aria-pressed');\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'false');\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button).not.to.have.attribute('aria-pressed');\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'true');\n\n el.addEventListener('change', (event: Event) => event.preventDefault());\n el.click();\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button).not.to.have.attribute('aria-pressed');\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'true');\n });\n describe('dev mode', () => {\n let consoleWarnStub!: ReturnType<typeof stub>;\n before(() => {\n window.__swc.verbose = true;\n consoleWarnStub = stub(console, 'warn');\n });\n afterEach(() => {\n consoleWarnStub.resetHistory();\n });\n after(() => {\n window.__swc.verbose = false;\n consoleWarnStub.restore();\n });\n\n it('warns that `variant` is deprecated', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button variant=\"white\">Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n (spyCall.args.at(0) as string).includes('\"variant\"'),\n 'confirm variant-centric message'\n ).to.be.true;\n expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({\n data: {\n localName: 'sp-action-button',\n type: 'api',\n level: 'deprecation',\n },\n });\n });\n\n it('warns that `variant` is deprecated', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button static=\"white\">Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n\n expect(consoleWarnStub.called).to.be.true;\n const spyCall = consoleWarnStub.getCall(0);\n expect(\n (spyCall.args.at(0) as string).includes('\"static\"'),\n 'confirm static-centric message'\n ).to.be.true;\n expect(spyCall.args.at(-1), 'confirm `data` shape').to.deep.equal({\n data: {\n localName: 'sp-action-button',\n type: 'api',\n level: 'deprecation',\n },\n });\n });\n\n it('prefers `staticColor` over `static`', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button static=\"white\">Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.staticColor).to.equal('white');\n el.setAttribute('static', 'white');\n await elementUpdated(el);\n expect(el.staticColor).to.equal('white');\n expect(el.static).to.equal('white');\n expect(el.getAttribute('static-color')).to.equal('white');\n });\n });\n});\n"],
5
- "mappings": ";AAYA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AM,UAAU,gBAAgB,QAAQ,CAAC;AACzC;AAAA,QACK,QAAQ,KAAK,GAAG,CAAC,EAAa,SAAS,UAAU;AAAA,QAClD;AAAA,MACJ,EAAE,GAAG,GAAG;AACR,aAAO,QAAQ,KAAK,GAAG,EAAE,GAAG,sBAAsB,EAAE,GAAG,KAAK,MAAM;AAAA,QAC9D,MAAM;AAAA,UACF,WAAW;AAAA,UACX,MAAM;AAAA,UACN,OAAO;AAAA,QACX;AAAA,MACJ,CAAC;AAAA,IACL,CAAC;AAED,OAAG,uCAAuC,YAAY;AAClD,YAAM,KAAK,MAAM,QAAsB;AAAA;AAAA,aAEtC;AAED,YAAM,eAAe,EAAE;AACvB,aAAO,GAAG,WAAW,EAAE,GAAG,MAAM,OAAO;AACvC,SAAG,aAAa,UAAU,OAAO;AACjC,YAAM,eAAe,EAAE;AACvB,aAAO,GAAG,WAAW,EAAE,GAAG,MAAM,OAAO;AACvC,aAAO,GAAG,MAAM,EAAE,GAAG,MAAM,OAAO;AAClC,aAAO,GAAG,aAAa,cAAc,CAAC,EAAE,GAAG,MAAM,OAAO;AAAA,IAC5D,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
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 '@spectrum-web-components/action-button/sp-action-button.js';\nimport {\n ActionButton,\n LONGPRESS_DURATION,\n} from '@spectrum-web-components/action-button';\nimport {\n aTimeout,\n elementUpdated,\n expect,\n fixture,\n html,\n waitUntil,\n} from '@open-wc/testing';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { spy } from 'sinon';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport { m as BlackActionButton } from '../stories/action-button-black.stories.js';\n\ndescribe('ActionButton', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<ActionButton>(\n BlackActionButton(BlackActionButton.args)\n )\n );\n it('loads default', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n expect(el.textContent).to.include('Button');\n await expect(el).to.be.accessible();\n });\n it('gardens \"value\" as a property', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.hasAttribute('value')).to.be.false;\n el.value = 'Value';\n await elementUpdated(el);\n expect(el.hasAttribute('value')).to.be.true;\n el.value = '';\n await elementUpdated(el);\n expect(el.hasAttribute('value')).to.be.false;\n });\n it('loads [hold-affordance]', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button hold-affordance>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el).to.not.be.undefined;\n expect(el.textContent).to.include('Button');\n await expect(el).to.be.accessible();\n });\n it('manages a `tabindex`', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n expect(el.tabIndex).to.equal(0);\n expect(el.disabled).to.be.false;\n\n el.setAttribute('tabindex', '-1');\n await elementUpdated(el);\n\n expect(el.tabIndex).to.equal(-1);\n expect(el.disabled).to.be.false;\n\n el.disabled = true;\n await elementUpdated(el);\n\n expect(el.tabIndex).to.equal(-1);\n expect(el.disabled).to.be.true;\n\n el.disabled = false;\n await elementUpdated(el);\n\n expect(el.tabIndex).to.equal(-1);\n expect(el.disabled).to.be.false;\n });\n it('manages a `size` attribute', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button size=\"xl\">Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.size).to.equal('xl');\n expect(el.getAttribute('size')).to.equal('xl');\n el.removeAttribute('size');\n await elementUpdated(el);\n expect(el.size).to.equal('m');\n expect(el.hasAttribute('size')).to.be.false;\n });\n it('does not apply a default `size` attribute', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.size).to.equal('m');\n expect(el.hasAttribute('size')).to.be.false;\n });\n it('dispatches `longpress` events when [hold-affordance]', async () => {\n const longpressSpy = spy();\n const el = await fixture<ActionButton>(html`\n <sp-action-button\n hold-affordance\n @longpress=${() => longpressSpy()}\n >\n Button\n </sp-action-button>\n `);\n\n await elementUpdated(el);\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n\n expect(longpressSpy.callCount).to.equal(1);\n await sendKeys({\n press: 'Alt+ArrowDown',\n });\n\n expect(longpressSpy.callCount).to.equal(2);\n el.dispatchEvent(new PointerEvent('pointerdown', { button: 0 }));\n el.dispatchEvent(new PointerEvent('pointerup'));\n el.dispatchEvent(new PointerEvent('pointerdown', { button: 0 }));\n await waitUntil(() => longpressSpy.callCount === 3);\n });\n it('does not dispatch `longpress` events when \"right click\"ed', async () => {\n const longpressSpy = spy();\n const el = await fixture<ActionButton>(html`\n <sp-action-button\n hold-affordance\n @longpress=${() => longpressSpy()}\n >\n Button\n </sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(longpressSpy.callCount).to.equal(0);\n\n el.focus();\n el.dispatchEvent(new PointerEvent('pointerdown', { button: 1 }));\n await aTimeout(2 * LONGPRESS_DURATION);\n expect(longpressSpy.callCount).to.equal(0);\n });\n it(':not([toggles])', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n\n el.click();\n await elementUpdated(el);\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n });\n it('responds to [selected]', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n\n el.selected = true;\n await elementUpdated(el);\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.true;\n expect(button.getAttribute('aria-pressed')).to.equal('true');\n\n el.selected = false;\n await elementUpdated(el);\n\n expect(el.toggles).to.be.false;\n expect(el.selected).to.be.false;\n expect(button.hasAttribute('aria-pressed')).to.be.false;\n });\n it('toggles', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button toggles>Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.false;\n expect(button.getAttribute('aria-pressed')).to.equal('false');\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button.getAttribute('aria-pressed')).to.equal('true');\n\n el.addEventListener('change', (event: Event) => event.preventDefault());\n el.click();\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button.getAttribute('aria-pressed')).to.equal('true');\n });\n it('toggles [aria-haspopup][aria-expanded]', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button\n toggles\n aria-haspopup=\"true\"\n aria-expanded=\"false\"\n >\n Button\n </sp-action-button>\n `);\n\n await elementUpdated(el);\n const button = el.focusElement;\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.false;\n expect(button).not.to.have.attribute('aria-pressed');\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'false');\n\n el.focus();\n await sendKeys({\n press: 'Space',\n });\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button).not.to.have.attribute('aria-pressed');\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'true');\n\n el.addEventListener('change', (event: Event) => event.preventDefault());\n el.click();\n await elementUpdated(el);\n\n expect(el.toggles).to.be.true;\n expect(el.selected).to.be.true;\n expect(button).not.to.have.attribute('aria-pressed');\n expect(button).to.have.attribute('aria-haspopup', 'true');\n expect(button).to.have.attribute('aria-expanded', 'true');\n });\n it('manages a `static-color` attribute', async () => {\n const el = await fixture<ActionButton>(html`\n <sp-action-button static-color=\"black\">Button</sp-action-button>\n `);\n\n await elementUpdated(el);\n expect(el.staticColor).to.equal('black');\n expect(el.getAttribute('static-color')).to.equal('black');\n el.removeAttribute('static-color');\n await elementUpdated(el);\n expect(el.staticColor).to.be.null;\n expect(el.hasAttribute('static-color')).to.be.false;\n });\n});\n"],
5
+ "mappings": ";AAYA,OAAO;AACP;AAAA,EAEI;AAAA,OACG;AACP;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,gBAAgB;AACzB,SAAS,WAAW;AACpB,SAAS,6BAA6B;AACtC,SAAS,KAAK,yBAAyB;AAEvC,SAAS,gBAAgB,MAAM;AAC3B;AAAA,IACI,YACI,MAAM;AAAA,MACF,kBAAkB,kBAAkB,IAAI;AAAA,IAC5C;AAAA,EACR;AACA,KAAG,iBAAiB,YAAY;AAC5B,UAAM,KAAK,MAAM,QAAsB;AAAA;AAAA,SAEtC;AAED,UAAM,eAAe,EAAE;AACvB,WAAO,EAAE,EAAE,GAAG,IAAI,GAAG;AACrB,WAAO,GAAG,WAAW,EAAE,GAAG,QAAQ,QAAQ;AAC1C,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,iCAAiC,YAAY;AAC5C,UAAM,KAAK,MAAM,QAAsB;AAAA;AAAA,SAEtC;AAED,UAAM,eAAe,EAAE;AACvB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