@spectrum-web-components/action-button 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/custom-elements.json +25 -1
  2. package/package.json +4 -4
  3. package/sp-action-button.dev.js +1 -0
  4. package/sp-action-button.dev.js.map +1 -1
  5. package/sp-action-button.js +1 -1
  6. package/sp-action-button.js.map +2 -2
  7. package/src/ActionButton.d.ts +1 -0
  8. package/src/ActionButton.dev.js +32 -20
  9. package/src/ActionButton.dev.js.map +2 -2
  10. package/src/ActionButton.js +2 -2
  11. package/src/ActionButton.js.map +3 -3
  12. package/src/action-button.css.dev.js +1 -0
  13. package/src/action-button.css.dev.js.map +1 -1
  14. package/src/action-button.css.js +1 -1
  15. package/src/action-button.css.js.map +2 -2
  16. package/src/index.dev.js +1 -0
  17. package/src/index.dev.js.map +1 -1
  18. package/src/index.js +1 -1
  19. package/src/index.js.map +1 -1
  20. package/src/spectrum-action-button.css.dev.js +1 -0
  21. package/src/spectrum-action-button.css.dev.js.map +1 -1
  22. package/src/spectrum-action-button.css.js +1 -1
  23. package/src/spectrum-action-button.css.js.map +2 -2
  24. package/stories/action-button-black-quiet.stories.js +34 -1
  25. package/stories/action-button-black-quiet.stories.js.map +1 -1
  26. package/stories/action-button-black.stories.js +29 -1
  27. package/stories/action-button-black.stories.js.map +1 -1
  28. package/stories/action-button-emphasized-quiet.stories.js +32 -1
  29. package/stories/action-button-emphasized-quiet.stories.js.map +1 -1
  30. package/stories/action-button-emphasized.stories.js +27 -1
  31. package/stories/action-button-emphasized.stories.js.map +1 -1
  32. package/stories/action-button-quiet.stories.js +27 -1
  33. package/stories/action-button-quiet.stories.js.map +1 -1
  34. package/stories/action-button-standard.stories.js +22 -1
  35. package/stories/action-button-standard.stories.js.map +1 -1
  36. package/stories/action-button-white-quiet.stories.js +34 -1
  37. package/stories/action-button-white-quiet.stories.js.map +1 -1
  38. package/stories/action-button-white.stories.js +29 -1
  39. package/stories/action-button-white.stories.js.map +1 -1
  40. package/stories/action-button.stories.js +37 -10
  41. package/stories/action-button.stories.js.map +1 -1
  42. package/stories/index.js +71 -25
  43. package/stories/index.js.map +1 -1
  44. package/test/action-button-black-quiet.test-vrt.js +4 -1
  45. package/test/action-button-black-quiet.test-vrt.js.map +1 -1
  46. package/test/action-button-black.test-vrt.js +4 -1
  47. package/test/action-button-black.test-vrt.js.map +1 -1
  48. package/test/action-button-emphasized-quiet.test-vrt.js +4 -1
  49. package/test/action-button-emphasized-quiet.test-vrt.js.map +1 -1
  50. package/test/action-button-emphasized.test-vrt.js +4 -1
  51. package/test/action-button-emphasized.test-vrt.js.map +1 -1
  52. package/test/action-button-quiet.test-vrt.js +4 -1
  53. package/test/action-button-quiet.test-vrt.js.map +1 -1
  54. package/test/action-button-standard.test-vrt.js +4 -1
  55. package/test/action-button-standard.test-vrt.js.map +1 -1
  56. package/test/action-button-white-quiet.test-vrt.js +4 -1
  57. package/test/action-button-white-quiet.test-vrt.js.map +1 -1
  58. package/test/action-button-white.test-vrt.js +4 -1
  59. package/test/action-button-white.test-vrt.js.map +1 -1
  60. package/test/action-button.test-vrt.js +4 -1
  61. package/test/action-button.test-vrt.js.map +1 -1
  62. package/test/action-button.test.js +160 -9
  63. package/test/action-button.test.js.map +2 -2
  64. package/test/benchmark/basic-test.js +5 -1
  65. package/test/benchmark/basic-test.js.map +1 -1
@@ -1,22 +1,49 @@
1
- import{html as t}from"@spectrum-web-components/base";import"@spectrum-web-components/action-group/sp-action-group.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js";import{renderButton as i}from"./index.js";import"@spectrum-web-components/action-button/sp-action-button.js";export default{component:"sp-action-button",title:"Action Button"};function n(e){const o=Object.assign({},e,{disabled:!0}),s=Object.assign({},e,{selected:!0});return t`
1
+ "use strict";
2
+ import { html } from "@spectrum-web-components/base";
3
+ import "@spectrum-web-components/action-group/sp-action-group.js";
4
+ import "@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js";
5
+ import { renderButton } from "./index.js";
6
+ import "@spectrum-web-components/action-button/sp-action-button.js";
7
+ export default {
8
+ component: "sp-action-button",
9
+ title: "Action Button"
10
+ };
11
+ function renderButtonsSelected(args) {
12
+ const disabled = Object.assign({}, args, { disabled: true });
13
+ const selected = Object.assign({}, args, { selected: true });
14
+ return html`
2
15
  <sp-action-group
3
- ?emphasized="${!!e.emphasized}"
4
- ?quiet="${!!e.quiet}"
16
+ ?emphasized="${!!args.emphasized}"
17
+ ?quiet="${!!args.quiet}"
5
18
  >
6
- ${i(e)} ${i(s)}
7
- ${i(o)}
19
+ ${renderButton(args)} ${renderButton(selected)}
20
+ ${renderButton(disabled)}
8
21
  </sp-action-group>
9
- `}export const toggles=e=>n(e);toggles.args={toggles:!0,icon:t`
22
+ `;
23
+ }
24
+ export const toggles = (args) => renderButtonsSelected(args);
25
+ toggles.args = {
26
+ toggles: true,
27
+ icon: html`
10
28
  <sp-icon-edit hidden slot="icon"></sp-icon-edit>
11
- `};export const iconSizeOverridden=e=>t`
12
- ${i(e)}
29
+ `
30
+ };
31
+ export const iconSizeOverridden = (args) => {
32
+ return html`
33
+ ${renderButton(args)}
13
34
  <h1>For testing purposes only</h1>
14
35
  <p>
15
36
  This is a test to ensure that sizing the icon will still work when
16
37
  it's in the scope of a parent element. You shouldn't normally do
17
38
  this as it deviates from the Spectrum design specification.
18
39
  </p>
19
- `;iconSizeOverridden.args={label:"",size:"xl",icon:t`
40
+ `;
41
+ };
42
+ iconSizeOverridden.args = {
43
+ label: "",
44
+ size: "xl",
45
+ icon: html`
20
46
  <sp-icon-edit slot="icon" size="s"></sp-icon-edit>
21
- `};
47
+ `
48
+ };
22
49
  //# sourceMappingURL=action-button.stories.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button.stories.ts"],
4
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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';\nimport type { Properties } from './index.js';\nimport { renderButton } from './index.js';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button',\n};\n\nfunction renderButtonsSelected(args: Properties): TemplateResult {\n const disabled = Object.assign({}, args, { disabled: true });\n const selected = Object.assign({}, args, { selected: true });\n return html`\n <sp-action-group\n ?emphasized=\"${!!args.emphasized}\"\n ?quiet=\"${!!args.quiet}\"\n >\n ${renderButton(args)} ${renderButton(selected)}\n ${renderButton(disabled)}\n </sp-action-group>\n `;\n}\n\nexport const toggles = (args: Properties): TemplateResult =>\n renderButtonsSelected(args);\ntoggles.args = {\n toggles: true,\n icon: html`\n <sp-icon-edit hidden slot=\"icon\"></sp-icon-edit>\n `,\n};\n\nexport const iconSizeOverridden = (args: Properties): TemplateResult => {\n return html`\n ${renderButton(args)}\n <h1>For testing purposes only</h1>\n <p>\n This is a test to ensure that sizing the icon will still work when\n it's in the scope of a parent element. You shouldn't normally do\n this as it deviates from the Spectrum design specification.\n </p>\n `;\n};\niconSizeOverridden.args = {\n label: '',\n size: 'xl',\n icon: html`\n <sp-icon-edit slot=\"icon\" size=\"s\"></sp-icon-edit>\n `,\n};\n"],
5
- "mappings": "AAWA,qDACA,iEACA,sEAEA,0CAEA,mEAEA,cAAe,CACX,UAAW,mBACX,MAAO,eACX,EAEA,WAA+B,EAAkC,CAC7D,KAAM,GAAW,OAAO,OAAO,CAAC,EAAG,EAAM,CAAE,SAAU,EAAK,CAAC,EACrD,EAAW,OAAO,OAAO,CAAC,EAAG,EAAM,CAAE,SAAU,EAAK,CAAC,EAC3D,MAAO;AAAA;AAAA,2BAEgB,CAAC,CAAC,EAAK;AAAA,sBACZ,CAAC,CAAC,EAAK;AAAA;AAAA,cAEf,EAAa,CAAI,KAAK,EAAa,CAAQ;AAAA,cAC3C,EAAa,CAAQ;AAAA;AAAA,KAGnC,CAEO,YAAM,SAAU,AAAC,GACpB,EAAsB,CAAI,EAC9B,QAAQ,KAAO,CACX,QAAS,GACT,KAAM;AAAA;AAAA,KAGV,EAEO,YAAM,oBAAqB,AAAC,GACxB;AAAA,UACD,EAAa,CAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAS3B,mBAAmB,KAAO,CACtB,MAAO,GACP,KAAM,KACN,KAAM;AAAA;AAAA,KAGV",
5
+ "mappings": ";AAWA,SAAS,YAA4B;AACrC,OAAO;AACP,OAAO;AAEP,SAAS,oBAAoB;AAE7B,OAAO;AAEP,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACX;AAEA,SAAS,sBAAsB,MAAkC;AAC7D,QAAM,WAAW,OAAO,OAAO,CAAC,GAAG,MAAM,EAAE,UAAU,KAAK,CAAC;AAC3D,QAAM,WAAW,OAAO,OAAO,CAAC,GAAG,MAAM,EAAE,UAAU,KAAK,CAAC;AAC3D,SAAO;AAAA;AAAA,2BAEgB,CAAC,CAAC,KAAK;AAAA,sBACZ,CAAC,CAAC,KAAK;AAAA;AAAA,cAEf,aAAa,IAAI,KAAK,aAAa,QAAQ;AAAA,cAC3C,aAAa,QAAQ;AAAA;AAAA;AAGnC;AAEO,aAAM,UAAU,CAAC,SACpB,sBAAsB,IAAI;AAC9B,QAAQ,OAAO;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA;AAAA;AAGV;AAEO,aAAM,qBAAqB,CAAC,SAAqC;AACpE,SAAO;AAAA,UACD,aAAa,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ3B;AACA,mBAAmB,OAAO;AAAA,EACtB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA;AAAA;AAGV;",
6
6
  "names": []
7
7
  }
package/stories/index.js CHANGED
@@ -1,37 +1,83 @@
1
- import{html as t}from"@spectrum-web-components/base";import{ifDefined as i}from"@spectrum-web-components/base/src/directives.js";import"@spectrum-web-components/action-group/sp-action-group.js";import"@spectrum-web-components/icon/sp-icon.js";import"@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js";import"@spectrum-web-components/action-button/sp-action-button.js";export function renderButton(e){return t`
1
+ "use strict";
2
+ import { html } from "@spectrum-web-components/base";
3
+ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
4
+ import "@spectrum-web-components/action-group/sp-action-group.js";
5
+ import "@spectrum-web-components/icon/sp-icon.js";
6
+ import "@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js";
7
+ import "@spectrum-web-components/action-button/sp-action-button.js";
8
+ export function renderButton(properties) {
9
+ return html`
2
10
  <sp-action-button
3
- ?quiet="${!!e.quiet}"
4
- ?emphasized="${!!e.emphasized}"
5
- variant="${i(e.variant)}"
6
- ?disabled=${!!e.disabled}
7
- ?selected=${!!e.selected}
8
- ?toggles=${!!e.toggles}
9
- size=${e.size||"m"}
10
- ?hold-affordance=${!!e.holdAffordance}
11
- ?active=${!!e.active}
11
+ ?quiet="${!!properties.quiet}"
12
+ ?emphasized="${!!properties.emphasized}"
13
+ variant="${ifDefined(properties.variant)}"
14
+ ?disabled=${!!properties.disabled}
15
+ ?selected=${!!properties.selected}
16
+ ?toggles=${!!properties.toggles}
17
+ size=${properties.size || "m"}
18
+ ?hold-affordance=${!!properties.holdAffordance}
19
+ ?active=${!!properties.active}
12
20
  >
13
- ${e.icon}${e.label}
21
+ ${properties.icon}${properties.label}
14
22
  </sp-action-button>
15
- `}function n(e){const o="Edit",l=t`
23
+ `;
24
+ }
25
+ function renderGroup(properties) {
26
+ const label = "Edit";
27
+ const holdAffordance = true;
28
+ const icon = html`
16
29
  <sp-icon-edit slot="icon"></sp-icon-edit>
17
- `;return t`
30
+ `;
31
+ return html`
18
32
  <sp-action-group
19
- ?quiet="${!!e.quiet}"
20
- ?emphasized="${!!e.emphasized}"
33
+ ?quiet="${!!properties.quiet}"
34
+ ?emphasized="${!!properties.emphasized}"
21
35
  >
22
- ${renderButton({...e,label:o})}
23
- ${renderButton({...e,label:o,icon:l})}
24
- ${renderButton({...e,icon:l})}
25
- ${renderButton({...e,icon:l,holdAffordance:!0})}
36
+ ${renderButton({
37
+ ...properties,
38
+ label
39
+ })}
40
+ ${renderButton({
41
+ ...properties,
42
+ label,
43
+ icon
44
+ })}
45
+ ${renderButton({
46
+ ...properties,
47
+ icon
48
+ })}
49
+ ${renderButton({
50
+ ...properties,
51
+ icon,
52
+ holdAffordance
53
+ })}
26
54
  </sp-action-group>
27
- `}export function renderButtons(e){return t`
55
+ `;
56
+ }
57
+ export function renderButtons(properties) {
58
+ const selected = true;
59
+ const disabled = true;
60
+ return html`
28
61
  <div
29
62
  style="display: flex; flex-direction: column; gap: var(--spectrum-global-dimension-size-100);"
30
63
  >
31
- ${n({...e})}
32
- ${n({...e,selected:!0})}
33
- ${n({...e,disabled:!0})}
34
- ${n({...e,disabled:!0,selected:!0})}
64
+ ${renderGroup({
65
+ ...properties
66
+ })}
67
+ ${renderGroup({
68
+ ...properties,
69
+ selected
70
+ })}
71
+ ${renderGroup({
72
+ ...properties,
73
+ disabled
74
+ })}
75
+ ${renderGroup({
76
+ ...properties,
77
+ disabled,
78
+ selected
79
+ })}
35
80
  </div>
36
- `}
81
+ `;
82
+ }
37
83
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["index.ts"],
4
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 variant=\"${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 >\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: var(--spectrum-global-dimension-size-100);\"\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,qDACA,4EACA,iEACA,iDACA,sEAEA,mEAiBO,6BAAsB,EAAwC,CACjE,MAAO;AAAA;AAAA,sBAEW,CAAC,CAAC,EAAW;AAAA,2BACR,CAAC,CAAC,EAAW;AAAA,uBACjB,EAAU,EAAW,OAAO;AAAA,wBAC3B,CAAC,CAAC,EAAW;AAAA,wBACb,CAAC,CAAC,EAAW;AAAA,uBACd,CAAC,CAAC,EAAW;AAAA,mBACjB,EAAW,MAAQ;AAAA,+BACP,CAAC,CAAC,EAAW;AAAA,sBACtB,CAAC,CAAC,EAAW;AAAA;AAAA,cAErB,EAAW,OAAO,EAAW;AAAA;AAAA,KAG3C,CAEA,WAAqB,EAAwC,CACzD,KAAM,GAAQ,OAER,EAAO;AAAA;AAAA,MAGb,MAAO;AAAA;AAAA,sBAEW,CAAC,CAAC,EAAW;AAAA,2BACR,CAAC,CAAC,EAAW;AAAA;AAAA,cAE1B,aAAa,IACR,EACH,OACJ,CAAC;AAAA,cACC,aAAa,IACR,EACH,QACA,MACJ,CAAC;AAAA,cACC,aAAa,IACR,EACH,MACJ,CAAC;AAAA,cACC,aAAa,IACR,EACH,OACA,iBACJ,CAAC;AAAA;AAAA,KAGb,CAEO,8BAAuB,EAAwC,CAGlE,MAAO;AAAA;AAAA;AAAA;AAAA,cAIG,EAAY,IACP,CACP,CAAC;AAAA,cACC,EAAY,IACP,EACH,WACJ,CAAC;AAAA,cACC,EAAY,IACP,EACH,WACJ,CAAC;AAAA,cACC,EAAY,IACP,EACH,YACA,WACJ,CAAC;AAAA;AAAA,KAGb",
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;AAAA,2BACR,CAAC,CAAC,WAAW;AAAA,uBACjB,UAAU,WAAW,OAAO;AAAA,wBAC3B,CAAC,CAAC,WAAW;AAAA,wBACb,CAAC,CAAC,WAAW;AAAA,uBACd,CAAC,CAAC,WAAW;AAAA,mBACjB,WAAW,QAAQ;AAAA,+BACP,CAAC,CAAC,WAAW;AAAA,sBACtB,CAAC,CAAC,WAAW;AAAA;AAAA,cAErB,WAAW,OAAO,WAAW;AAAA;AAAA;AAG3C;AAEA,SAAS,YAAY,YAAwC;AACzD,QAAM,QAAQ;AACd,QAAM,iBAAiB;AACvB,QAAM,OAAO;AAAA;AAAA;AAGb,SAAO;AAAA;AAAA,sBAEW,CAAC,CAAC,WAAW;AAAA,2BACR,CAAC,CAAC,WAAW;AAAA;AAAA,cAE1B,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACJ,CAAC;AAAA,cACC,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC;AAAA,cACC,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACJ,CAAC;AAAA,cACC,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC;AAAA;AAAA;AAGb;AAEO,gBAAS,cAAc,YAAwC;AAClE,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,SAAO;AAAA;AAAA;AAAA;AAAA,cAIG,YAAY;AAAA,IACV,GAAG;AAAA,EACP,CAAC;AAAA,cACC,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,EACJ,CAAC;AAAA,cACC,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,EACJ,CAAC;AAAA,cACC,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC;AAAA;AAAA;AAGb;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as o from"../stories/action-button-black-quiet.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("ActionButtonBlackQuietStories",o);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-black-quiet.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonBlackQuietStories", stories);
2
5
  //# sourceMappingURL=action-button-black-quiet.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-black-quiet.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-black-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonBlackQuietStories', stories);\n"],
5
- "mappings": "AAYA,kEACA,8DAEA,EAAe,gCAAiC,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,iCAAiC,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as o from"../stories/action-button-black.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("ActionButtonBlackStories",o);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-black.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonBlackStories", stories);
2
5
  //# sourceMappingURL=action-button-black.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-black.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-black.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonBlackStories', stories);\n"],
5
- "mappings": "AAYA,4DACA,8DAEA,EAAe,2BAA4B,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,4BAA4B,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as s from"../stories/action-button-emphasized-quiet.stories.js";import{regressVisuals as i}from"../../../test/visual/test.js";i("ActionButtonEmphasizedQuietStories",s);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-emphasized-quiet.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonEmphasizedQuietStories", stories);
2
5
  //# sourceMappingURL=action-button-emphasized-quiet.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-emphasized-quiet.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-emphasized-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonEmphasizedQuietStories', stories);\n"],
5
- "mappings": "AAYA,uEACA,8DAEA,EAAe,qCAAsC,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,sCAAsC,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as s from"../stories/action-button-emphasized.stories.js";import{regressVisuals as o}from"../../../test/visual/test.js";o("ActionButtonEmphasizedStories",s);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-emphasized.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonEmphasizedStories", stories);
2
5
  //# sourceMappingURL=action-button-emphasized.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-emphasized.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-emphasized.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonEmphasizedStories', stories);\n"],
5
- "mappings": "AAYA,iEACA,8DAEA,EAAe,gCAAiC,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,iCAAiC,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as o from"../stories/action-button-quiet.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("ActionButtonQuietStories",o);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-quiet.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonQuietStories", stories);
2
5
  //# sourceMappingURL=action-button-quiet.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-quiet.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonQuietStories', stories);\n"],
5
- "mappings": "AAYA,4DACA,8DAEA,EAAe,2BAA4B,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,4BAA4B,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as r from"../stories/action-button-standard.stories.js";import{regressVisuals as o}from"../../../test/visual/test.js";o("ActionButtonStandardStories",r);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-standard.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonStandardStories", stories);
2
5
  //# sourceMappingURL=action-button-standard.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-standard.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-standard.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonStandardStories', stories);\n"],
5
- "mappings": "AAYA,+DACA,8DAEA,EAAe,8BAA+B,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,+BAA+B,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as t from"../stories/action-button-white-quiet.stories.js";import{regressVisuals as i}from"../../../test/visual/test.js";i("ActionButtonWhiteQuietStories",t);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-white-quiet.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonWhiteQuietStories", stories);
2
5
  //# sourceMappingURL=action-button-white-quiet.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-white-quiet.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-white-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonWhiteQuietStories', stories);\n"],
5
- "mappings": "AAYA,kEACA,8DAEA,EAAe,gCAAiC,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,iCAAiC,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as o from"../stories/action-button-white.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("ActionButtonWhiteStories",o);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button-white.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonWhiteStories", stories);
2
5
  //# sourceMappingURL=action-button-white.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button-white.test-vrt.ts"],
4
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 * as stories from '../stories/action-button-white.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonWhiteStories', stories);\n"],
5
- "mappings": "AAYA,4DACA,8DAEA,EAAe,2BAA4B,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,4BAA4B,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,5 @@
1
- import*as o from"../stories/action-button.stories.js";import{regressVisuals as r}from"../../../test/visual/test.js";r("ActionButtonStories",o);
1
+ "use strict";
2
+ import * as stories from "../stories/action-button.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("ActionButtonStories", stories);
2
5
  //# sourceMappingURL=action-button.test-vrt.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["action-button.test-vrt.ts"],
4
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 * as stories from '../stories/action-button.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonStories', stories);\n"],
5
- "mappings": "AAYA,sDACA,8DAEA,EAAe,sBAAuB,CAAO",
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAE/B,eAAe,uBAAuB,OAAO;",
6
6
  "names": []
7
7
  }
@@ -1,21 +1,172 @@
1
- import"@spectrum-web-components/action-button/sp-action-button.js";import{elementUpdated as a,expect as e,fixture as s,html as n,waitUntil as u}from"@open-wc/testing";import{sendKeys as i}from"@web/test-runner-commands";import{spy as r}from"sinon";import{testForLitDevWarnings as b}from"../../../test/testing-helpers.js";import{m as c}from"../stories/action-button-black.stories.js";describe("ActionButton",()=>{b(async()=>await s(c(c.args))),it("loads default",async()=>{const t=await s(n`
1
+ "use strict";
2
+ import "@spectrum-web-components/action-button/sp-action-button.js";
3
+ import {
4
+ LONGPRESS_DURATION
5
+ } from "@spectrum-web-components/action-button";
6
+ import {
7
+ aTimeout,
8
+ elementUpdated,
9
+ expect,
10
+ fixture,
11
+ html,
12
+ waitUntil
13
+ } from "@open-wc/testing";
14
+ import { sendKeys } from "@web/test-runner-commands";
15
+ import { spy } from "sinon";
16
+ import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
17
+ import { m as BlackActionButton } from "../stories/action-button-black.stories.js";
18
+ describe("ActionButton", () => {
19
+ testForLitDevWarnings(
20
+ async () => await fixture(
21
+ BlackActionButton(BlackActionButton.args)
22
+ )
23
+ );
24
+ it("loads default", async () => {
25
+ const el = await fixture(
26
+ html`
2
27
  <sp-action-button>Button</sp-action-button>
3
- `);await a(t),e(t).to.not.be.undefined,e(t.textContent).to.include("Button"),await e(t).to.be.accessible()}),it("loads [hold-affordance]",async()=>{const t=await s(n`
28
+ `
29
+ );
30
+ await elementUpdated(el);
31
+ expect(el).to.not.be.undefined;
32
+ expect(el.textContent).to.include("Button");
33
+ await expect(el).to.be.accessible();
34
+ });
35
+ it("loads [hold-affordance]", async () => {
36
+ const el = await fixture(
37
+ html`
4
38
  <sp-action-button hold-affordance>Button</sp-action-button>
5
- `);await a(t),e(t).to.not.be.undefined,e(t.textContent).to.include("Button"),await e(t).to.be.accessible()}),it("maintains a `size` attribute",async()=>{const t=await s(n`
39
+ `
40
+ );
41
+ await elementUpdated(el);
42
+ expect(el).to.not.be.undefined;
43
+ expect(el.textContent).to.include("Button");
44
+ await expect(el).to.be.accessible();
45
+ });
46
+ it("maintains a `size` attribute", async () => {
47
+ const el = await fixture(
48
+ html`
6
49
  <sp-action-button>Button</sp-action-button>
7
- `);await a(t),e(t.size).to.equal("m"),e(t.getAttribute("size")).to.equal("m"),t.removeAttribute("size"),await a(t),e(t.size).to.equal("m"),e(t.getAttribute("size")).to.equal("m")}),it("dispatches `longpress` events when [hold-affordance]",async()=>{const t=r(),o=await s(n`
50
+ `
51
+ );
52
+ await elementUpdated(el);
53
+ expect(el.size).to.equal("m");
54
+ expect(el.getAttribute("size")).to.equal("m");
55
+ el.removeAttribute("size");
56
+ await elementUpdated(el);
57
+ expect(el.size).to.equal("m");
58
+ expect(el.getAttribute("size")).to.equal("m");
59
+ });
60
+ it("dispatches `longpress` events when [hold-affordance]", async () => {
61
+ const longpressSpy = spy();
62
+ const el = await fixture(
63
+ html`
8
64
  <sp-action-button
9
65
  hold-affordance
10
- @longpress=${()=>t()}
66
+ @longpress=${() => longpressSpy()}
11
67
  >
12
68
  Button
13
69
  </sp-action-button>
14
- `);await a(o),o.focus(),await i({press:"Space"}),e(t.callCount).to.equal(1),await i({press:"Alt+ArrowDown"}),e(t.callCount).to.equal(2),o.dispatchEvent(new Event("pointerdown")),o.dispatchEvent(new Event("pointerup")),o.dispatchEvent(new Event("pointerdown")),await u(()=>t.callCount===3)}),it(":not([toggles])",async()=>{const t=await s(n`
70
+ `
71
+ );
72
+ await elementUpdated(el);
73
+ el.focus();
74
+ await sendKeys({
75
+ press: "Space"
76
+ });
77
+ expect(longpressSpy.callCount).to.equal(1);
78
+ await sendKeys({
79
+ press: "Alt+ArrowDown"
80
+ });
81
+ expect(longpressSpy.callCount).to.equal(2);
82
+ el.dispatchEvent(new PointerEvent("pointerdown", { button: 0 }));
83
+ el.dispatchEvent(new PointerEvent("pointerup"));
84
+ el.dispatchEvent(new PointerEvent("pointerdown", { button: 0 }));
85
+ await waitUntil(() => longpressSpy.callCount === 3);
86
+ });
87
+ it('does not dispatch `longpress` events when "right click"ed', async () => {
88
+ const longpressSpy = spy();
89
+ const el = await fixture(
90
+ html`
91
+ <sp-action-button
92
+ hold-affordance
93
+ @longpress=${() => longpressSpy()}
94
+ >
95
+ Button
96
+ </sp-action-button>
97
+ `
98
+ );
99
+ await elementUpdated(el);
100
+ expect(longpressSpy.callCount).to.equal(0);
101
+ el.focus();
102
+ el.dispatchEvent(new PointerEvent("pointerdown", { button: 1 }));
103
+ await aTimeout(2 * LONGPRESS_DURATION);
104
+ expect(longpressSpy.callCount).to.equal(0);
105
+ });
106
+ it(":not([toggles])", async () => {
107
+ const el = await fixture(
108
+ html`
15
109
  <sp-action-button>Button</sp-action-button>
16
- `);await a(t);const o=t.focusElement;e(t.toggles).to.be.false,e(t.selected).to.be.false,e(o.hasAttribute("aria-pressed")).to.be.false,t.click(),await a(t),e(t.toggles).to.be.false,e(t.selected).to.be.false,e(o.hasAttribute("aria-pressed")).to.be.false}),it("responds to [selected]",async()=>{const t=await s(n`
110
+ `
111
+ );
112
+ await elementUpdated(el);
113
+ const button = el.focusElement;
114
+ expect(el.toggles).to.be.false;
115
+ expect(el.selected).to.be.false;
116
+ expect(button.hasAttribute("aria-pressed")).to.be.false;
117
+ el.click();
118
+ await elementUpdated(el);
119
+ expect(el.toggles).to.be.false;
120
+ expect(el.selected).to.be.false;
121
+ expect(button.hasAttribute("aria-pressed")).to.be.false;
122
+ });
123
+ it("responds to [selected]", async () => {
124
+ const el = await fixture(
125
+ html`
17
126
  <sp-action-button>Button</sp-action-button>
18
- `);await a(t);const o=t.focusElement;e(t.toggles).to.be.false,e(t.selected).to.be.false,e(o.hasAttribute("aria-pressed")).to.be.false,t.selected=!0,await a(t),e(t.toggles).to.be.false,e(t.selected).to.be.true,e(o.getAttribute("aria-pressed")).to.equal("true"),t.selected=!1,await a(t),e(t.toggles).to.be.false,e(t.selected).to.be.false,e(o.hasAttribute("aria-pressed")).to.be.false}),it("toggles",async()=>{const t=await s(n`
127
+ `
128
+ );
129
+ await elementUpdated(el);
130
+ const button = el.focusElement;
131
+ expect(el.toggles).to.be.false;
132
+ expect(el.selected).to.be.false;
133
+ expect(button.hasAttribute("aria-pressed")).to.be.false;
134
+ el.selected = true;
135
+ await elementUpdated(el);
136
+ expect(el.toggles).to.be.false;
137
+ expect(el.selected).to.be.true;
138
+ expect(button.getAttribute("aria-pressed")).to.equal("true");
139
+ el.selected = false;
140
+ await elementUpdated(el);
141
+ expect(el.toggles).to.be.false;
142
+ expect(el.selected).to.be.false;
143
+ expect(button.hasAttribute("aria-pressed")).to.be.false;
144
+ });
145
+ it("toggles", async () => {
146
+ const el = await fixture(
147
+ html`
19
148
  <sp-action-button toggles>Button</sp-action-button>
20
- `);await a(t);const o=t.focusElement;e(t.toggles).to.be.true,e(t.selected).to.be.false,e(o.getAttribute("aria-pressed")).to.equal("false"),t.focus(),await i({press:"Space"}),await a(t),e(t.toggles).to.be.true,e(t.selected).to.be.true,e(o.getAttribute("aria-pressed")).to.equal("true"),t.addEventListener("change",l=>l.preventDefault()),t.click(),await a(t),e(t.toggles).to.be.true,e(t.selected).to.be.true,e(o.getAttribute("aria-pressed")).to.equal("true")})});
149
+ `
150
+ );
151
+ await elementUpdated(el);
152
+ const button = el.focusElement;
153
+ expect(el.toggles).to.be.true;
154
+ expect(el.selected).to.be.false;
155
+ expect(button.getAttribute("aria-pressed")).to.equal("false");
156
+ el.focus();
157
+ await sendKeys({
158
+ press: "Space"
159
+ });
160
+ await elementUpdated(el);
161
+ expect(el.toggles).to.be.true;
162
+ expect(el.selected).to.be.true;
163
+ expect(button.getAttribute("aria-pressed")).to.equal("true");
164
+ el.addEventListener("change", (event) => event.preventDefault());
165
+ el.click();
166
+ await elementUpdated(el);
167
+ expect(el.toggles).to.be.true;
168
+ expect(el.selected).to.be.true;
169
+ expect(button.getAttribute("aria-pressed")).to.equal("true");
170
+ });
171
+ });
21
172
  //# sourceMappingURL=action-button.test.js.map