@spectrum-web-components/action-button 0.7.5-express.9 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/package.json +7 -7
  2. package/sp-action-button.d.ts +0 -6
  3. package/sp-action-button.js +0 -14
  4. package/sp-action-button.js.map +0 -1
  5. package/src/ActionButton.d.ts +0 -63
  6. package/src/ActionButton.js +0 -202
  7. package/src/ActionButton.js.map +0 -1
  8. package/src/action-button.css.d.ts +0 -2
  9. package/src/action-button.css.js +0 -691
  10. package/src/action-button.css.js.map +0 -1
  11. package/src/index.d.ts +0 -1
  12. package/src/index.js +0 -13
  13. package/src/index.js.map +0 -1
  14. package/src/spectrum-action-button.css.d.ts +0 -2
  15. package/src/spectrum-action-button.css.js +0 -655
  16. package/src/spectrum-action-button.css.js.map +0 -1
  17. package/stories/action-button-black-quiet.stories.js +0 -34
  18. package/stories/action-button-black-quiet.stories.js.map +0 -1
  19. package/stories/action-button-black.stories.js +0 -29
  20. package/stories/action-button-black.stories.js.map +0 -1
  21. package/stories/action-button-emphasized-quiet.stories.js +0 -32
  22. package/stories/action-button-emphasized-quiet.stories.js.map +0 -1
  23. package/stories/action-button-emphasized.stories.js +0 -27
  24. package/stories/action-button-emphasized.stories.js.map +0 -1
  25. package/stories/action-button-quiet.stories.js +0 -27
  26. package/stories/action-button-quiet.stories.js.map +0 -1
  27. package/stories/action-button-sizes.stories.js +0 -89
  28. package/stories/action-button-sizes.stories.js.map +0 -1
  29. package/stories/action-button-standard.stories.js +0 -22
  30. package/stories/action-button-standard.stories.js.map +0 -1
  31. package/stories/action-button-white-quiet.stories.js +0 -34
  32. package/stories/action-button-white-quiet.stories.js.map +0 -1
  33. package/stories/action-button-white.stories.js +0 -29
  34. package/stories/action-button-white.stories.js.map +0 -1
  35. package/stories/action-button.stories.js +0 -60
  36. package/stories/action-button.stories.js.map +0 -1
  37. package/stories/index.js +0 -71
  38. package/stories/index.js.map +0 -1
  39. package/test/action-button-black-quiet.test-vrt.js +0 -15
  40. package/test/action-button-black-quiet.test-vrt.js.map +0 -1
  41. package/test/action-button-black.test-vrt.js +0 -15
  42. package/test/action-button-black.test-vrt.js.map +0 -1
  43. package/test/action-button-emphasized-quiet.test-vrt.js +0 -15
  44. package/test/action-button-emphasized-quiet.test-vrt.js.map +0 -1
  45. package/test/action-button-emphasized.test-vrt.js +0 -15
  46. package/test/action-button-emphasized.test-vrt.js.map +0 -1
  47. package/test/action-button-quiet.test-vrt.js +0 -15
  48. package/test/action-button-quiet.test-vrt.js.map +0 -1
  49. package/test/action-button-standard.test-vrt.js +0 -15
  50. package/test/action-button-standard.test-vrt.js.map +0 -1
  51. package/test/action-button-white-quiet.test-vrt.js +0 -15
  52. package/test/action-button-white-quiet.test-vrt.js.map +0 -1
  53. package/test/action-button-white.test-vrt.js +0 -15
  54. package/test/action-button-white.test-vrt.js.map +0 -1
  55. package/test/action-button.test-vrt.js +0 -15
  56. package/test/action-button.test-vrt.js.map +0 -1
  57. package/test/action-button.test.js +0 -132
  58. package/test/action-button.test.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button.stories.js","sourceRoot":"","sources":["action-button.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,0DAA0D,CAAC;AAClE,OAAO,+DAA+D,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,QAAQ,CAAC;AAChB,OAAO,wBAAwB,CAAC;AAEhC,eAAe;IACX,SAAS,EAAE,kBAAkB;IAC7B,KAAK,EAAE,eAAe;CACzB,CAAC;AAEF,SAAS,qBAAqB,CAAC,IAAgB;IAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAA;;2BAEY,CAAC,CAAC,IAAI,CAAC,UAAU;sBACtB,CAAC,CAAC,IAAI,CAAC,KAAK;;cAEpB,YAAY,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC;cAC5C,YAAY,CAAC,QAAQ,CAAC;;KAE/B,CAAC;AACN,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAkB,EAAE,CACxD,qBAAqB,CAAC,IAAI,CAAC,CAAC;AAChC,OAAO,CAAC,IAAI,GAAG;IACX,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI,CAAA;;KAET;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAgB,EAAkB,EAAE;IACnE,OAAO,IAAI,CAAA;UACL,YAAY,CAAC,IAAI,CAAC;;;;;;;KAOvB,CAAC;AACN,CAAC,CAAC;AACF,kBAAkB,CAAC,IAAI,GAAG;IACtB,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI,CAAA;;KAET;CACJ,CAAC","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 '../src';\nimport '../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"]}
package/stories/index.js DELETED
@@ -1,71 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { html } from '@spectrum-web-components/base';
13
- import { ifDefined } from '@spectrum-web-components/base/src/directives.js';
14
- import '@spectrum-web-components/action-group/sp-action-group.js';
15
- import '@spectrum-web-components/icon/sp-icon.js';
16
- import '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';
17
- import '../src';
18
- import '../sp-action-button.js';
19
- export function renderButton(properties) {
20
- return html `
21
- <sp-action-button
22
- ?quiet="${!!properties.quiet}"
23
- ?emphasized="${!!properties.emphasized}"
24
- variant="${ifDefined(properties.variant)}"
25
- ?disabled=${!!properties.disabled}
26
- ?selected=${!!properties.selected}
27
- ?toggles=${!!properties.toggles}
28
- size=${properties.size || 'm'}
29
- ?hold-affordance=${!!properties.holdAffordance}
30
- ?active=${!!properties.active}
31
- >
32
- ${properties.icon}${properties.label}
33
- </sp-action-button>
34
- `;
35
- }
36
- function renderGroup(properties) {
37
- const label = 'Edit';
38
- const holdAffordance = true;
39
- const icon = html `
40
- <sp-icon-edit hidden slot="icon"></sp-icon-edit>
41
- `;
42
- return html `
43
- <sp-action-group
44
- ?quiet="${!!properties.quiet}"
45
- ?emphasized="${!!properties.emphasized}"
46
- >
47
- ${renderButton(Object.assign(Object.assign({}, properties), { label }))}
48
- ${renderButton(Object.assign(Object.assign({}, properties), { label,
49
- icon }))}
50
- ${renderButton(Object.assign(Object.assign({}, properties), { icon }))}
51
- ${renderButton(Object.assign(Object.assign({}, properties), { icon,
52
- holdAffordance }))}
53
- </sp-action-group>
54
- `;
55
- }
56
- export function renderButtons(properties) {
57
- const selected = true;
58
- const disabled = true;
59
- return html `
60
- <div
61
- style="display: flex; flex-direction: column; gap: var(--spectrum-global-dimension-size-100);"
62
- >
63
- ${renderGroup(Object.assign({}, properties))}
64
- ${renderGroup(Object.assign(Object.assign({}, properties), { selected }))}
65
- ${renderGroup(Object.assign(Object.assign({}, properties), { disabled }))}
66
- ${renderGroup(Object.assign(Object.assign({}, properties), { disabled,
67
- selected }))}
68
- </div>
69
- `;
70
- }
71
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE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IACtB,OAAO,IAAI,CAAA;;;;cAID,WAAW,mBACN,UAAU,EACf;cACA,WAAW,iCACN,UAAU,KACb,QAAQ,IACV;cACA,WAAW,iCACN,UAAU,KACb,QAAQ,IACV;cACA,WAAW,iCACN,UAAU,KACb,QAAQ;QACR,QAAQ,IACV;;KAET,CAAC;AACN,CAAC","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 '../src';\nimport '../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 hidden 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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-black-quiet.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonBlackQuietStories', stories);
15
- //# sourceMappingURL=action-button-black-quiet.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-black-quiet.test-vrt.js","sourceRoot":"","sources":["action-button-black-quiet.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-black.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonBlackStories', stories);
15
- //# sourceMappingURL=action-button-black.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-black.test-vrt.js","sourceRoot":"","sources":["action-button-black.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-emphasized-quiet.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonEmphasizedQuietStories', stories);
15
- //# sourceMappingURL=action-button-emphasized-quiet.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-emphasized-quiet.test-vrt.js","sourceRoot":"","sources":["action-button-emphasized-quiet.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,sDAAsD,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-emphasized.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonEmphasizedStories', stories);
15
- //# sourceMappingURL=action-button-emphasized.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-emphasized.test-vrt.js","sourceRoot":"","sources":["action-button-emphasized.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,gDAAgD,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-quiet.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonQuietStories', stories);
15
- //# sourceMappingURL=action-button-quiet.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-quiet.test-vrt.js","sourceRoot":"","sources":["action-button-quiet.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-standard.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonStandardStories', stories);
15
- //# sourceMappingURL=action-button-standard.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-standard.test-vrt.js","sourceRoot":"","sources":["action-button-standard.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,8CAA8C,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-white-quiet.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonWhiteQuietStories', stories);
15
- //# sourceMappingURL=action-button-white-quiet.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-white-quiet.test-vrt.js","sourceRoot":"","sources":["action-button-white-quiet.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button-white.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonWhiteStories', stories);
15
- //# sourceMappingURL=action-button-white.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button-white.test-vrt.js","sourceRoot":"","sources":["action-button-white.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import * as stories from '../stories/action-button.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('ActionButtonStories', stories);
15
- //# sourceMappingURL=action-button.test-vrt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button.test-vrt.js","sourceRoot":"","sources":["action-button.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC","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"]}
@@ -1,132 +0,0 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import '../sp-action-button.js';
13
- import { elementUpdated, expect, fixture, html, waitUntil, } from '@open-wc/testing';
14
- import { sendKeys } from '@web/test-runner-commands';
15
- import { spy } from 'sinon';
16
- describe('ActionButton', () => {
17
- it('loads default', async () => {
18
- const el = await fixture(html `
19
- <sp-action-button>Button</sp-action-button>
20
- `);
21
- await elementUpdated(el);
22
- expect(el).to.not.be.undefined;
23
- expect(el.textContent).to.include('Button');
24
- await expect(el).to.be.accessible();
25
- });
26
- it('loads [hold-affordance]', async () => {
27
- const el = await fixture(html `
28
- <sp-action-button hold-affordance>Button</sp-action-button>
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('maintains a `size` attribute', async () => {
36
- const el = await fixture(html `
37
- <sp-action-button>Button</sp-action-button>
38
- `);
39
- await elementUpdated(el);
40
- expect(el.size).to.equal('m');
41
- expect(el.getAttribute('size')).to.equal('m');
42
- el.removeAttribute('size');
43
- await elementUpdated(el);
44
- expect(el.size).to.equal('m');
45
- expect(el.getAttribute('size')).to.equal('m');
46
- });
47
- it('dispatches `longpress` events when [hold-affordance]', async () => {
48
- const longpressSpy = spy();
49
- const el = await fixture(html `
50
- <sp-action-button
51
- hold-affordance
52
- @longpress=${() => longpressSpy()}
53
- >
54
- Button
55
- </sp-action-button>
56
- `);
57
- await elementUpdated(el);
58
- el.focus();
59
- await sendKeys({
60
- press: 'Space',
61
- });
62
- expect(longpressSpy.callCount).to.equal(1);
63
- await sendKeys({
64
- press: 'Alt+ArrowDown',
65
- });
66
- expect(longpressSpy.callCount).to.equal(2);
67
- el.dispatchEvent(new Event('pointerdown'));
68
- el.dispatchEvent(new Event('pointerup'));
69
- el.dispatchEvent(new Event('pointerdown'));
70
- await waitUntil(() => longpressSpy.callCount === 3);
71
- });
72
- it(':not([toggles])', async () => {
73
- const el = await fixture(html `
74
- <sp-action-button>Button</sp-action-button>
75
- `);
76
- await elementUpdated(el);
77
- const button = el.focusElement;
78
- expect(el.toggles).to.be.false;
79
- expect(el.selected).to.be.false;
80
- expect(button.hasAttribute('aria-pressed')).to.be.false;
81
- el.click();
82
- await elementUpdated(el);
83
- expect(el.toggles).to.be.false;
84
- expect(el.selected).to.be.false;
85
- expect(button.hasAttribute('aria-pressed')).to.be.false;
86
- });
87
- it('responds to [selected]', async () => {
88
- const el = await fixture(html `
89
- <sp-action-button>Button</sp-action-button>
90
- `);
91
- await elementUpdated(el);
92
- const button = el.focusElement;
93
- expect(el.toggles).to.be.false;
94
- expect(el.selected).to.be.false;
95
- expect(button.hasAttribute('aria-pressed')).to.be.false;
96
- el.selected = true;
97
- await elementUpdated(el);
98
- expect(el.toggles).to.be.false;
99
- expect(el.selected).to.be.true;
100
- expect(button.getAttribute('aria-pressed')).to.equal('true');
101
- el.selected = false;
102
- await elementUpdated(el);
103
- expect(el.toggles).to.be.false;
104
- expect(el.selected).to.be.false;
105
- expect(button.hasAttribute('aria-pressed')).to.be.false;
106
- });
107
- it('toggles', async () => {
108
- const el = await fixture(html `
109
- <sp-action-button toggles>Button</sp-action-button>
110
- `);
111
- await elementUpdated(el);
112
- const button = el.focusElement;
113
- expect(el.toggles).to.be.true;
114
- expect(el.selected).to.be.false;
115
- expect(button.getAttribute('aria-pressed')).to.equal('false');
116
- el.focus();
117
- await sendKeys({
118
- press: 'Space',
119
- });
120
- await elementUpdated(el);
121
- expect(el.toggles).to.be.true;
122
- expect(el.selected).to.be.true;
123
- expect(button.getAttribute('aria-pressed')).to.equal('true');
124
- el.addEventListener('change', (event) => event.preventDefault());
125
- el.click();
126
- await elementUpdated(el);
127
- expect(el.toggles).to.be.true;
128
- expect(el.selected).to.be.true;
129
- expect(button.getAttribute('aria-pressed')).to.equal('true');
130
- });
131
- });
132
- //# sourceMappingURL=action-button.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action-button.test.js","sourceRoot":"","sources":["action-button.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EACH,cAAc,EACd,MAAM,EACN,OAAO,EACP,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AE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","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 '../sp-action-button.js';\nimport { ActionButton } from '../';\nimport {\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';\n\ndescribe('ActionButton', () => {\n it('loads default', async () => {\n const el = await fixture<ActionButton>(\n html`\n <sp-action-button>Button</sp-action-button>\n `\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('loads [hold-affordance]', async () => {\n const el = await fixture<ActionButton>(\n html`\n <sp-action-button hold-affordance>Button</sp-action-button>\n `\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('maintains a `size` attribute', async () => {\n const el = await fixture<ActionButton>(\n html`\n <sp-action-button>Button</sp-action-button>\n `\n );\n\n await elementUpdated(el);\n expect(el.size).to.equal('m');\n expect(el.getAttribute('size')).to.equal('m');\n el.removeAttribute('size');\n await elementUpdated(el);\n expect(el.size).to.equal('m');\n expect(el.getAttribute('size')).to.equal('m');\n });\n it('dispatches `longpress` events when [hold-affordance]', async () => {\n const longpressSpy = spy();\n const el = await fixture<ActionButton>(\n html`\n <sp-action-button\n hold-affordance\n @longpress=${() => longpressSpy()}\n >\n Button\n </sp-action-button>\n `\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 Event('pointerdown'));\n el.dispatchEvent(new Event('pointerup'));\n el.dispatchEvent(new Event('pointerdown'));\n await waitUntil(() => longpressSpy.callCount === 3);\n });\n it(':not([toggles])', async () => {\n const el = await fixture<ActionButton>(\n html`\n <sp-action-button>Button</sp-action-button>\n `\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>(\n html`\n <sp-action-button>Button</sp-action-button>\n `\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>(\n html`\n <sp-action-button toggles>Button</sp-action-button>\n `\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});\n"]}