@spectrum-web-components/action-button 1.0.0 → 1.0.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 (47) hide show
  1. package/README.md +22 -0
  2. package/package.json +7 -8
  3. package/LICENSE +0 -201
  4. package/stories/action-button-black-quiet.stories.js +0 -41
  5. package/stories/action-button-black-quiet.stories.js.map +0 -7
  6. package/stories/action-button-black.stories.js +0 -35
  7. package/stories/action-button-black.stories.js.map +0 -7
  8. package/stories/action-button-emphasized-quiet.stories.js +0 -39
  9. package/stories/action-button-emphasized-quiet.stories.js.map +0 -7
  10. package/stories/action-button-emphasized.stories.js +0 -33
  11. package/stories/action-button-emphasized.stories.js.map +0 -7
  12. package/stories/action-button-quiet.stories.js +0 -33
  13. package/stories/action-button-quiet.stories.js.map +0 -7
  14. package/stories/action-button-standard.stories.js +0 -27
  15. package/stories/action-button-standard.stories.js.map +0 -7
  16. package/stories/action-button-white-quiet.stories.js +0 -41
  17. package/stories/action-button-white-quiet.stories.js.map +0 -7
  18. package/stories/action-button-white.stories.js +0 -35
  19. package/stories/action-button-white.stories.js.map +0 -7
  20. package/stories/action-button.stories.js +0 -31
  21. package/stories/action-button.stories.js.map +0 -7
  22. package/stories/index.js +0 -85
  23. package/stories/index.js.map +0 -7
  24. package/test/action-button-black-quiet.test-vrt.js +0 -5
  25. package/test/action-button-black-quiet.test-vrt.js.map +0 -7
  26. package/test/action-button-black.test-vrt.js +0 -5
  27. package/test/action-button-black.test-vrt.js.map +0 -7
  28. package/test/action-button-emphasized-quiet.test-vrt.js +0 -5
  29. package/test/action-button-emphasized-quiet.test-vrt.js.map +0 -7
  30. package/test/action-button-emphasized.test-vrt.js +0 -5
  31. package/test/action-button-emphasized.test-vrt.js.map +0 -7
  32. package/test/action-button-memory.test.js +0 -5
  33. package/test/action-button-memory.test.js.map +0 -7
  34. package/test/action-button-quiet.test-vrt.js +0 -5
  35. package/test/action-button-quiet.test-vrt.js.map +0 -7
  36. package/test/action-button-standard.test-vrt.js +0 -5
  37. package/test/action-button-standard.test-vrt.js.map +0 -7
  38. package/test/action-button-white-quiet.test-vrt.js +0 -5
  39. package/test/action-button-white-quiet.test-vrt.js.map +0 -7
  40. package/test/action-button-white.test-vrt.js +0 -5
  41. package/test/action-button-white.test-vrt.js.map +0 -7
  42. package/test/action-button.test-vrt.js +0 -5
  43. package/test/action-button.test-vrt.js.map +0 -7
  44. package/test/action-button.test.js +0 -244
  45. package/test/action-button.test.js.map +0 -7
  46. package/test/benchmark/basic-test.js +0 -19
  47. package/test/benchmark/basic-test.js.map +0 -7
@@ -1,31 +0,0 @@
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`
15
- <sp-action-group
16
- ?emphasized="${!!args.emphasized}"
17
- ?quiet="${!!args.quiet}"
18
- >
19
- ${renderButton(args)} ${renderButton(selected)}
20
- ${renderButton(disabled)}
21
- </sp-action-group>
22
- `;
23
- }
24
- export const toggles = (args) => renderButtonsSelected(args);
25
- toggles.args = {
26
- toggles: true,
27
- icon: html`
28
- <sp-icon-edit hidden slot="icon"></sp-icon-edit>
29
- `
30
- };
31
- //# sourceMappingURL=action-button.stories.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button.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 { 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"],
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,UAAU;AAAA,sBACtB,CAAC,CAAC,KAAK,KAAK;AAAA;AAAA,cAEpB,aAAa,IAAI,CAAC,IAAI,aAAa,QAAQ,CAAC;AAAA,cAC5C,aAAa,QAAQ,CAAC;AAAA;AAAA;AAGpC;AAEO,aAAM,UAAU,CAAC,SACpB,sBAAsB,IAAI;AAC9B,QAAQ,OAAO;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA;AAAA;AAGV;",
6
- "names": []
7
- }
package/stories/index.js DELETED
@@ -1,85 +0,0 @@
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`
10
- <sp-action-button
11
- ?quiet="${!!properties.quiet}"
12
- ?emphasized="${!!properties.emphasized}"
13
- static-color="${ifDefined(properties.staticColor)}"
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}
20
- >
21
- ${properties.icon}${properties.label}
22
- </sp-action-button>
23
- `;
24
- }
25
- function renderGroup(properties) {
26
- const label = "Edit";
27
- const holdAffordance = true;
28
- const icon = html`
29
- <sp-icon-edit slot="icon"></sp-icon-edit>
30
- `;
31
- return html`
32
- <sp-action-group
33
- ?quiet="${!!properties.quiet}"
34
- ?emphasized="${!!properties.emphasized}"
35
- size=${properties.size || "m"}
36
- static-color="${ifDefined(properties.staticColor)}"
37
- >
38
- ${renderButton({
39
- ...properties,
40
- label
41
- })}
42
- ${renderButton({
43
- ...properties,
44
- label,
45
- icon
46
- })}
47
- ${renderButton({
48
- ...properties,
49
- icon
50
- })}
51
- ${renderButton({
52
- ...properties,
53
- icon,
54
- holdAffordance
55
- })}
56
- </sp-action-group>
57
- `;
58
- }
59
- export function renderButtons(properties) {
60
- const selected = true;
61
- const disabled = true;
62
- return html`
63
- <div
64
- style="display: flex; flex-direction: column; gap: calc(var(--spectrum-spacing-100) * var(--swc-scale-factor));"
65
- >
66
- ${renderGroup({
67
- ...properties
68
- })}
69
- ${renderGroup({
70
- ...properties,
71
- selected
72
- })}
73
- ${renderGroup({
74
- ...properties,
75
- disabled
76
- })}
77
- ${renderGroup({
78
- ...properties,
79
- disabled,
80
- selected
81
- })}
82
- </div>
83
- `;
84
- }
85
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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 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,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,4BACb,UAAU,WAAW,WAAW,CAAC;AAAA;AAAA,cAE/C,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;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-black-quiet.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-black-quiet.test-vrt.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 * as stories from '../stories/action-button-black-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonBlackQuietStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,iCAAiC,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-black.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-black.test-vrt.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 * as stories from '../stories/action-button-black.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonBlackStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,4BAA4B,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-emphasized-quiet.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-emphasized-quiet.test-vrt.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 * as stories from '../stories/action-button-emphasized-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonEmphasizedQuietStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,sCAAsC,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-emphasized.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-emphasized.test-vrt.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 * as stories from '../stories/action-button-emphasized.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonEmphasizedStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,iCAAiC,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
- import { m as BlackActionButton } from "../stories/action-button-black.stories.js";
3
- import { testForMemoryLeaks } from "../../../test/testing-helpers.js";
4
- testForMemoryLeaks(BlackActionButton(BlackActionButton.args));
5
- //# sourceMappingURL=action-button-memory.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-memory.test.ts"],
4
- "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\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 { m as BlackActionButton } from '../stories/action-button-black.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(BlackActionButton(BlackActionButton.args));\n"],
5
- "mappings": ";AAWA,SAAS,KAAK,yBAAyB;AACvC,SAAS,0BAA0B;AAEnC,mBAAmB,kBAAkB,kBAAkB,IAAI,CAAC;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-quiet.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-quiet.test-vrt.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 * as stories from '../stories/action-button-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonQuietStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,4BAA4B,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-standard.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-standard.test-vrt.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 * as stories from '../stories/action-button-standard.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonStandardStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,+BAA+B,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-white-quiet.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-white-quiet.test-vrt.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 * as stories from '../stories/action-button-white-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonWhiteQuietStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,iCAAiC,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button-white.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button-white.test-vrt.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 * as stories from '../stories/action-button-white.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonWhiteStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,4BAA4B,OAA+B;",
6
- "names": []
7
- }
@@ -1,5 +0,0 @@
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);
5
- //# sourceMappingURL=action-button.test-vrt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["action-button.test-vrt.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 * as stories from '../stories/action-button.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonStories', stories as unknown as TestsType);\n"],
5
- "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,uBAAuB,OAA+B;",
6
- "names": []
7
- }
@@ -1,244 +0,0 @@
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(html`
26
- <sp-action-button>Button</sp-action-button>
27
- `);
28
- await elementUpdated(el);
29
- expect(el).to.not.be.undefined;
30
- expect(el.textContent).to.include("Button");
31
- await expect(el).to.be.accessible();
32
- });
33
- it('gardens "value" as a property', async () => {
34
- const el = await fixture(html`
35
- <sp-action-button>Button</sp-action-button>
36
- `);
37
- await elementUpdated(el);
38
- expect(el.hasAttribute("value")).to.be.false;
39
- el.value = "Value";
40
- await elementUpdated(el);
41
- expect(el.hasAttribute("value")).to.be.true;
42
- el.value = "";
43
- await elementUpdated(el);
44
- expect(el.hasAttribute("value")).to.be.false;
45
- });
46
- it("loads [hold-affordance]", async () => {
47
- const el = await fixture(html`
48
- <sp-action-button hold-affordance>Button</sp-action-button>
49
- `);
50
- await elementUpdated(el);
51
- expect(el).to.not.be.undefined;
52
- expect(el.textContent).to.include("Button");
53
- await expect(el).to.be.accessible();
54
- });
55
- it("manages a `tabindex`", async () => {
56
- const el = await fixture(html`
57
- <sp-action-button>Button</sp-action-button>
58
- `);
59
- expect(el.tabIndex).to.equal(0);
60
- expect(el.disabled).to.be.false;
61
- el.setAttribute("tabindex", "-1");
62
- await elementUpdated(el);
63
- expect(el.tabIndex).to.equal(-1);
64
- expect(el.disabled).to.be.false;
65
- el.disabled = true;
66
- await elementUpdated(el);
67
- expect(el.tabIndex).to.equal(-1);
68
- expect(el.disabled).to.be.true;
69
- el.disabled = false;
70
- await elementUpdated(el);
71
- expect(el.tabIndex).to.equal(-1);
72
- expect(el.disabled).to.be.false;
73
- });
74
- it("manages a `size` attribute", async () => {
75
- const el = await fixture(html`
76
- <sp-action-button size="xl">Button</sp-action-button>
77
- `);
78
- await elementUpdated(el);
79
- expect(el.size).to.equal("xl");
80
- expect(el.getAttribute("size")).to.equal("xl");
81
- el.removeAttribute("size");
82
- await elementUpdated(el);
83
- expect(el.size).to.equal("m");
84
- expect(el.hasAttribute("size")).to.be.false;
85
- });
86
- it("does not apply a default `size` attribute", async () => {
87
- const el = await fixture(html`
88
- <sp-action-button>Button</sp-action-button>
89
- `);
90
- await elementUpdated(el);
91
- expect(el.size).to.equal("m");
92
- expect(el.hasAttribute("size")).to.be.false;
93
- });
94
- it("dispatches `longpress` events when [hold-affordance]", async () => {
95
- const longpressSpy = spy();
96
- const el = await fixture(html`
97
- <sp-action-button
98
- hold-affordance
99
- @longpress=${() => longpressSpy()}
100
- >
101
- Button
102
- </sp-action-button>
103
- `);
104
- await elementUpdated(el);
105
- el.focus();
106
- await sendKeys({
107
- press: "Space"
108
- });
109
- expect(longpressSpy.callCount).to.equal(1);
110
- await sendKeys({
111
- press: "Alt+ArrowDown"
112
- });
113
- expect(longpressSpy.callCount).to.equal(2);
114
- el.dispatchEvent(new PointerEvent("pointerdown", { button: 0 }));
115
- el.dispatchEvent(new PointerEvent("pointerup"));
116
- el.dispatchEvent(new PointerEvent("pointerdown", { button: 0 }));
117
- await waitUntil(() => longpressSpy.callCount === 3);
118
- });
119
- it('does not dispatch `longpress` events when "right click"ed', async () => {
120
- const longpressSpy = spy();
121
- const el = await fixture(html`
122
- <sp-action-button
123
- hold-affordance
124
- @longpress=${() => longpressSpy()}
125
- >
126
- Button
127
- </sp-action-button>
128
- `);
129
- await elementUpdated(el);
130
- expect(longpressSpy.callCount).to.equal(0);
131
- el.focus();
132
- el.dispatchEvent(new PointerEvent("pointerdown", { button: 1 }));
133
- await aTimeout(2 * LONGPRESS_DURATION);
134
- expect(longpressSpy.callCount).to.equal(0);
135
- });
136
- it(":not([toggles])", async () => {
137
- const el = await fixture(html`
138
- <sp-action-button>Button</sp-action-button>
139
- `);
140
- await elementUpdated(el);
141
- const button = el.focusElement;
142
- expect(el.toggles).to.be.false;
143
- expect(el.selected).to.be.false;
144
- expect(button.hasAttribute("aria-pressed")).to.be.false;
145
- el.click();
146
- await elementUpdated(el);
147
- expect(el.toggles).to.be.false;
148
- expect(el.selected).to.be.false;
149
- expect(button.hasAttribute("aria-pressed")).to.be.false;
150
- });
151
- it("responds to [selected]", async () => {
152
- const el = await fixture(html`
153
- <sp-action-button>Button</sp-action-button>
154
- `);
155
- await elementUpdated(el);
156
- const button = el.focusElement;
157
- expect(el.toggles).to.be.false;
158
- expect(el.selected).to.be.false;
159
- expect(button.hasAttribute("aria-pressed")).to.be.false;
160
- el.selected = true;
161
- await elementUpdated(el);
162
- expect(el.toggles).to.be.false;
163
- expect(el.selected).to.be.true;
164
- expect(button.getAttribute("aria-pressed")).to.equal("true");
165
- el.selected = false;
166
- await elementUpdated(el);
167
- expect(el.toggles).to.be.false;
168
- expect(el.selected).to.be.false;
169
- expect(button.hasAttribute("aria-pressed")).to.be.false;
170
- });
171
- it("toggles", async () => {
172
- const el = await fixture(html`
173
- <sp-action-button toggles>Button</sp-action-button>
174
- `);
175
- await elementUpdated(el);
176
- const button = el.focusElement;
177
- expect(el.toggles).to.be.true;
178
- expect(el.selected).to.be.false;
179
- expect(button.getAttribute("aria-pressed")).to.equal("false");
180
- el.focus();
181
- await sendKeys({
182
- press: "Space"
183
- });
184
- await elementUpdated(el);
185
- expect(el.toggles).to.be.true;
186
- expect(el.selected).to.be.true;
187
- expect(button.getAttribute("aria-pressed")).to.equal("true");
188
- el.addEventListener("change", (event) => event.preventDefault());
189
- el.click();
190
- await elementUpdated(el);
191
- expect(el.toggles).to.be.true;
192
- expect(el.selected).to.be.true;
193
- expect(button.getAttribute("aria-pressed")).to.equal("true");
194
- });
195
- it("toggles [aria-haspopup][aria-expanded]", async () => {
196
- const el = await fixture(html`
197
- <sp-action-button
198
- toggles
199
- aria-haspopup="true"
200
- aria-expanded="false"
201
- >
202
- Button
203
- </sp-action-button>
204
- `);
205
- await elementUpdated(el);
206
- const button = el.focusElement;
207
- expect(el.toggles).to.be.true;
208
- expect(el.selected).to.be.false;
209
- expect(button).not.to.have.attribute("aria-pressed");
210
- expect(button).to.have.attribute("aria-haspopup", "true");
211
- expect(button).to.have.attribute("aria-expanded", "false");
212
- el.focus();
213
- await sendKeys({
214
- press: "Space"
215
- });
216
- await elementUpdated(el);
217
- expect(el.toggles).to.be.true;
218
- expect(el.selected).to.be.true;
219
- expect(button).not.to.have.attribute("aria-pressed");
220
- expect(button).to.have.attribute("aria-haspopup", "true");
221
- expect(button).to.have.attribute("aria-expanded", "true");
222
- el.addEventListener("change", (event) => event.preventDefault());
223
- el.click();
224
- await elementUpdated(el);
225
- expect(el.toggles).to.be.true;
226
- expect(el.selected).to.be.true;
227
- expect(button).not.to.have.attribute("aria-pressed");
228
- expect(button).to.have.attribute("aria-haspopup", "true");
229
- expect(button).to.have.attribute("aria-expanded", "true");
230
- });
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;
242
- });
243
- });
244
- //# sourceMappingURL=action-button.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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 } 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,OAC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M;AACT,UAAM,eAAe,EAAE;AAEvB,WAAO,GAAG,OAAO,EAAE,GAAG,GAAG;AACzB,WAAO,GAAG,QAAQ,EAAE,GAAG,GAAG;AAC1B,WAAO,MAAM,EAAE,IAAI,GAAG,KAAK,UAAU,cAAc;AACnD,WAAO,MAAM,EAAE,GAAG,KAAK,UAAU,iBAAiB,MAAM;AACxD,WAAO,MAAM,EAAE,GAAG,KAAK,UAAU,iBAAiB,MAAM;AAAA,EAC5D,CAAC;AACD,KAAG,sCAAsC,YAAY;AACjD,UAAM,KAAK,MAAM,QAAsB;AAAA;AAAA,SAEtC;AAED,UAAM,eAAe,EAAE;AACvB,WAAO,GAAG,WAAW,EAAE,GAAG,MAAM,OAAO;AACvC,WAAO,GAAG,aAAa,cAAc,CAAC,EAAE,GAAG,MAAM,OAAO;AACxD,OAAG,gBAAgB,cAAc;AACjC,UAAM,eAAe,EAAE;AACvB,WAAO,GAAG,WAAW,EAAE,GAAG,GAAG;AAC7B,WAAO,GAAG,aAAa,cAAc,CAAC,EAAE,GAAG,GAAG;AAAA,EAClD,CAAC;AACL,CAAC;",
6
- "names": []
7
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- import "@spectrum-web-components/action-button/sp-action-button.js";
3
- import "@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js";
4
- import { html } from "lit";
5
- import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
6
- measureFixtureCreation(html`
7
- <sp-action-button>Edit</sp-action-button>
8
- <sp-action-button>
9
- <sp-icon-edit slot="icon"></sp-icon-edit>
10
- Edit
11
- </sp-action-button>
12
- <sp-action-button>
13
- <sp-icon-edit slot="icon"></sp-icon-edit>
14
- </sp-action-button>
15
- <sp-action-button hold-affordance>
16
- <sp-icon-edit slot="icon"></sp-icon-edit>
17
- </sp-action-button>
18
- `);
19
- //# sourceMappingURL=basic-test.js.map