@spectrum-web-components/swatch 0.1.2 → 0.1.4-devmode.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 (56) hide show
  1. package/custom-elements.json +6 -6
  2. package/package.json +37 -16
  3. package/sp-swatch-group.dev.js +3 -0
  4. package/sp-swatch-group.dev.js.map +7 -0
  5. package/sp-swatch-group.js +3 -14
  6. package/sp-swatch-group.js.map +7 -1
  7. package/sp-swatch.dev.js +3 -0
  8. package/sp-swatch.dev.js.map +7 -0
  9. package/sp-swatch.js +3 -14
  10. package/sp-swatch.js.map +7 -1
  11. package/src/Swatch.dev.js +219 -0
  12. package/src/Swatch.dev.js.map +7 -0
  13. package/src/Swatch.js +165 -170
  14. package/src/Swatch.js.map +7 -1
  15. package/src/SwatchGroup.dev.js +220 -0
  16. package/src/SwatchGroup.dev.js.map +7 -0
  17. package/src/SwatchGroup.js +201 -216
  18. package/src/SwatchGroup.js.map +7 -1
  19. package/src/index.dev.js +3 -0
  20. package/src/index.dev.js.map +7 -0
  21. package/src/index.js +3 -14
  22. package/src/index.js.map +7 -1
  23. package/src/spectrum-swatch-group.css.dev.js +10 -0
  24. package/src/spectrum-swatch-group.css.dev.js.map +7 -0
  25. package/src/spectrum-swatch-group.css.js +3 -14
  26. package/src/spectrum-swatch-group.css.js.map +7 -1
  27. package/src/spectrum-swatch.css.dev.js +66 -0
  28. package/src/spectrum-swatch.css.dev.js.map +7 -0
  29. package/src/spectrum-swatch.css.js +4 -15
  30. package/src/spectrum-swatch.css.js.map +7 -1
  31. package/src/swatch-group.css.dev.js +10 -0
  32. package/src/swatch-group.css.dev.js.map +7 -0
  33. package/src/swatch-group.css.js +3 -14
  34. package/src/swatch-group.css.js.map +7 -1
  35. package/src/swatch.css.dev.js +66 -0
  36. package/src/swatch.css.dev.js.map +7 -0
  37. package/src/swatch.css.js +4 -15
  38. package/src/swatch.css.js.map +7 -1
  39. package/stories/swatch-group.stories.js +124 -133
  40. package/stories/swatch-group.stories.js.map +7 -1
  41. package/stories/swatch-sizes.stories.js +15 -21
  42. package/stories/swatch-sizes.stories.js.map +7 -1
  43. package/stories/swatch.stories.js +69 -73
  44. package/stories/swatch.stories.js.map +7 -1
  45. package/test/benchmark/basic-test.js +5 -16
  46. package/test/benchmark/basic-test.js.map +7 -1
  47. package/test/swatch-group.test-vrt.js +4 -15
  48. package/test/swatch-group.test-vrt.js.map +7 -1
  49. package/test/swatch-group.test.js +231 -240
  50. package/test/swatch-group.test.js.map +7 -1
  51. package/test/swatch-sizes.test-vrt.js +4 -15
  52. package/test/swatch-sizes.test-vrt.js.map +7 -1
  53. package/test/swatch.test-vrt.js +4 -15
  54. package/test/swatch.test-vrt.js.map +7 -1
  55. package/test/swatch.test.js +128 -135
  56. package/test/swatch.test.js.map +7 -1
@@ -1 +1,7 @@
1
- {"version":3,"file":"swatch.stories.js","sourceRoot":"","sources":["swatch.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAE5E,OAAO,iBAAiB,CAAC;AAgBzB,eAAe;IACX,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE;QACF,KAAK,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE;QACN,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;QAC3B,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;YACzC,WAAW,EAAE,6CAA6C;YAC1D,KAAK,EAAE;gBACH,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;aAChC;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,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EAAE,WAAW;CACrB,CAAC","sourcesContent":["/*\nCopyright 2022 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 { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '../sp-swatch.js';\nimport type {\n SwatchBorder,\n SwatchRounding,\n SwatchShape,\n} from '../src/Swatch.js';\n\ntype Properties = {\n color: string;\n border: SwatchBorder | 'normal';\n rounding: SwatchRounding | 'normal';\n shape: SwatchShape | 'normal';\n mixedValue?: boolean;\n nothing?: boolean;\n};\n\nexport default {\n title: 'Swatch',\n component: 'sp-swatch',\n args: {\n color: '#ff0000',\n },\n argTypes: {\n color: { control: 'color' },\n border: {\n name: 'border',\n type: { name: 'string', required: false },\n description: 'The border to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'light', 'none'],\n },\n },\n rounding: {\n name: 'rounding',\n type: { name: 'string', required: false },\n description: 'The rounding to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'none', 'full'],\n },\n },\n shape: {\n name: 'shape',\n type: { name: 'string', required: false },\n description: 'The shape to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'rectangle'],\n },\n },\n },\n};\n\nconst template = ({\n color,\n border,\n rounding,\n shape,\n mixedValue,\n nothing,\n}: Properties): TemplateResult => {\n return html`\n <sp-swatch\n border=${ifDefined(border === 'normal' ? undefined : border)}\n rounding=${ifDefined(rounding === 'normal' ? undefined : rounding)}\n shape=${ifDefined(shape === 'normal' ? undefined : shape)}\n color=${color}\n ?mixed-value=${mixedValue}\n ?nothing=${nothing}\n ></sp-swatch>\n `;\n};\n\nexport const Default = (args: Properties): TemplateResult => template(args);\nexport const mixedValue = (args: Properties): TemplateResult => template(args);\nmixedValue.args = {\n mixedValue: true,\n color: '',\n};\nexport const nothing = (args: Properties): TemplateResult => template(args);\nnothing.args = {\n nothing: true,\n color: '',\n};\nexport const borderLight = (args: Properties): TemplateResult => template(args);\nborderLight.args = {\n border: 'light',\n};\nexport const borderNone = (args: Properties): TemplateResult => template(args);\nborderNone.args = {\n border: 'none',\n};\nexport const roundingNone = (args: Properties): TemplateResult =>\n template(args);\nroundingNone.args = {\n rounding: 'none',\n};\nexport const roundingFull = (args: Properties): TemplateResult =>\n template(args);\nroundingFull.args = {\n rounding: 'full',\n};\nexport const shapeRectangle = (args: Properties): TemplateResult =>\n template(args);\nshapeRectangle.args = {\n shape: 'rectangle',\n};\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["swatch.stories.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 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 { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '../sp-swatch.js';\nimport type {\n SwatchBorder,\n SwatchRounding,\n SwatchShape,\n} from '../src/Swatch.js';\n\ntype Properties = {\n color: string;\n border: SwatchBorder | 'normal';\n rounding: SwatchRounding | 'normal';\n shape: SwatchShape | 'normal';\n mixedValue?: boolean;\n nothing?: boolean;\n};\n\nexport default {\n title: 'Swatch',\n component: 'sp-swatch',\n args: {\n color: '#ff0000',\n },\n argTypes: {\n color: { control: 'color' },\n border: {\n name: 'border',\n type: { name: 'string', required: false },\n description: 'The border to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'light', 'none'],\n },\n },\n rounding: {\n name: 'rounding',\n type: { name: 'string', required: false },\n description: 'The rounding to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'none', 'full'],\n },\n },\n shape: {\n name: 'shape',\n type: { name: 'string', required: false },\n description: 'The shape to apply to the Swatch children.',\n table: {\n defaultValue: { summary: '' },\n },\n control: {\n type: 'inline-radio',\n options: ['normal', 'rectangle'],\n },\n },\n },\n};\n\nconst template = ({\n color,\n border,\n rounding,\n shape,\n mixedValue,\n nothing,\n}: Properties): TemplateResult => {\n return html`\n <sp-swatch\n border=${ifDefined(border === 'normal' ? undefined : border)}\n rounding=${ifDefined(rounding === 'normal' ? undefined : rounding)}\n shape=${ifDefined(shape === 'normal' ? undefined : shape)}\n color=${color}\n ?mixed-value=${mixedValue}\n ?nothing=${nothing}\n ></sp-swatch>\n `;\n};\n\nexport const Default = (args: Properties): TemplateResult => template(args);\nexport const mixedValue = (args: Properties): TemplateResult => template(args);\nmixedValue.args = {\n mixedValue: true,\n color: '',\n};\nexport const nothing = (args: Properties): TemplateResult => template(args);\nnothing.args = {\n nothing: true,\n color: '',\n};\nexport const borderLight = (args: Properties): TemplateResult => template(args);\nborderLight.args = {\n border: 'light',\n};\nexport const borderNone = (args: Properties): TemplateResult => template(args);\nborderNone.args = {\n border: 'none',\n};\nexport const roundingNone = (args: Properties): TemplateResult =>\n template(args);\nroundingNone.args = {\n rounding: 'none',\n};\nexport const roundingFull = (args: Properties): TemplateResult =>\n template(args);\nroundingFull.args = {\n rounding: 'full',\n};\nexport const shapeRectangle = (args: Properties): TemplateResult =>\n template(args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BACzD,UAAU,UAAU,WAAW,SAAY,KAAK;AAAA,oBAChD;AAAA,2BACO;AAAA,uBACJ;AAAA;AAAA;AAGvB;AAEO,aAAM,UAAU,CAAC,SAAqC,SAAS,IAAI;AACnE,aAAM,aAAa,CAAC,SAAqC,SAAS,IAAI;AAC7E,WAAW,OAAO;AAAA,EACd,YAAY;AAAA,EACZ,OAAO;AACX;AACO,aAAM,UAAU,CAAC,SAAqC,SAAS,IAAI;AAC1E,QAAQ,OAAO;AAAA,EACX,SAAS;AAAA,EACT,OAAO;AACX;AACO,aAAM,cAAc,CAAC,SAAqC,SAAS,IAAI;AAC9E,YAAY,OAAO;AAAA,EACf,QAAQ;AACZ;AACO,aAAM,aAAa,CAAC,SAAqC,SAAS,IAAI;AAC7E,WAAW,OAAO;AAAA,EACd,QAAQ;AACZ;AACO,aAAM,eAAe,CAAC,SACzB,SAAS,IAAI;AACjB,aAAa,OAAO;AAAA,EAChB,UAAU;AACd;AACO,aAAM,eAAe,CAAC,SACzB,SAAS,IAAI;AACjB,aAAa,OAAO;AAAA,EAChB,UAAU;AACd;AACO,aAAM,iBAAiB,CAAC,SAC3B,SAAS,IAAI;AACjB,eAAe,OAAO;AAAA,EAClB,OAAO;AACX;",
6
+ "names": []
7
+ }
@@ -1,18 +1,7 @@
1
- /*
2
- Copyright 2022 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 '@spectrum-web-components/swatch/sp-swatch.js';
13
- import { html } from '@spectrum-web-components/base';
14
- import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
15
- measureFixtureCreation(html `
1
+ import "@spectrum-web-components/swatch/sp-swatch.js";
2
+ import { html } from "@spectrum-web-components/base";
3
+ import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
4
+ measureFixtureCreation(html`
16
5
  <sp-swatch></sp-swatch>
17
6
  `);
18
- //# sourceMappingURL=basic-test.js.map
7
+ //# sourceMappingURL=basic-test.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"basic-test.js","sourceRoot":"","sources":["basic-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,8CAA8C,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,sBAAsB,CAAC,IAAI,CAAA;;CAE1B,CAAC,CAAC","sourcesContent":["/*\nCopyright 2022 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 '@spectrum-web-components/swatch/sp-swatch.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-swatch></sp-swatch>\n`);\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["basic-test.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 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 '@spectrum-web-components/swatch/sp-swatch.js';\nimport { html } from '@spectrum-web-components/base';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-swatch></sp-swatch>\n`);\n"],
5
+ "mappings": "AAWA;AACA;AACA;AAEA,uBAAuB;AAAA;AAAA,CAEtB;",
6
+ "names": []
7
+ }
@@ -1,15 +1,4 @@
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/swatch-group.stories.js';
13
- import { regressVisuals } from '../../../test/visual/test.js';
14
- regressVisuals('SwatchGroupStories', stories);
15
- //# sourceMappingURL=swatch-group.test-vrt.js.map
1
+ import * as stories from "../stories/swatch-group.stories.js";
2
+ import { regressVisuals } from "../../../test/visual/test.js";
3
+ regressVisuals("SwatchGroupStories", stories);
4
+ //# sourceMappingURL=swatch-group.test-vrt.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"swatch-group.test-vrt.js","sourceRoot":"","sources":["swatch-group.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,oCAAoC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,oBAAoB,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/swatch-group.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SwatchGroupStories', stories);\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["swatch-group.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/swatch-group.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('SwatchGroupStories', stories);\n"],
5
+ "mappings": "AAYA;AACA;AAEA,eAAe,sBAAsB,OAAO;",
6
+ "names": []
7
+ }
@@ -1,225 +1,216 @@
1
- /*
2
- Copyright 2022 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 { elementUpdated, expect, fixture, nextFrame } from '@open-wc/testing';
13
- import { sendKeys } from '@web/test-runner-commands';
14
- import '../sp-swatch.js';
15
- import { Default } from '../stories/swatch-group.stories.js';
16
- import { spy } from 'sinon';
17
- import { html } from '@spectrum-web-components/base';
18
- describe('Swatch Group', () => {
19
- let el;
20
- beforeEach(async () => {
21
- el = await fixture(Default(Default.args));
22
- await elementUpdated(el);
23
- });
24
- it('loads default swatch accessibly', async () => {
25
- await expect(el).to.be.accessible();
26
- });
27
- it('forwards `border` to children', async () => {
28
- el.border = 'light';
29
- await elementUpdated(el);
30
- [...el.children].forEach((child) => {
31
- expect(child.border).to.equal('light');
32
- });
33
- });
34
- it('forwards `rounding` to children', async () => {
35
- el.rounding = 'full';
36
- await elementUpdated(el);
37
- [...el.children].forEach((child) => {
38
- expect(child.rounding).to.equal('full');
39
- });
40
- });
41
- it('forwards `size` to children', async () => {
42
- el.size = 'xs';
43
- await elementUpdated(el);
44
- [...el.children].forEach((child) => {
45
- expect(child.size).to.equal('xs');
46
- });
47
- });
48
- it('forwards `shape` to children', async () => {
49
- el.shape = 'rectangle';
50
- await elementUpdated(el);
51
- [...el.children].forEach((child) => {
52
- expect(child.shape).to.equal('rectangle');
53
- });
54
- });
55
- it('unsets forwarding', async () => {
56
- el.border = 'light';
57
- el.rounding = 'full';
58
- el.size = 'xs';
59
- el.shape = 'rectangle';
60
- await elementUpdated(el);
61
- [...el.children].forEach((child) => {
62
- expect(child.border).to.not.be.undefined;
63
- expect(child.rounding).to.not.be.undefined;
64
- expect(child.size).to.not.equal('m');
65
- expect(child.shape).to.not.be.undefined;
66
- });
67
- el.border = undefined;
68
- el.rounding = undefined;
69
- el.removeAttribute('size');
70
- el.shape = undefined;
71
- await elementUpdated(el);
72
- [...el.children].forEach((child) => {
73
- expect(child.border).to.equal(undefined);
74
- expect(child.rounding).to.equal(undefined);
75
- expect(child.size).to.equal('m');
76
- expect(child.shape).to.equal(undefined);
77
- });
78
- });
79
- it('does not dispatch `change` events without `selects` attribute', async () => {
80
- const selectedChild = el.querySelector(':scope > sp-swatch:nth-child(4)');
81
- const changeSpy = spy();
82
- el.addEventListener('change', () => changeSpy());
83
- expect(el.selected).to.deep.equal([]);
84
- selectedChild.click();
85
- expect(changeSpy.called).to.be.false;
86
- expect(el.selected).to.deep.equal([]);
87
- });
88
- it('dispatches `change` events as [selects="single"]', async () => {
89
- el.selects = 'single';
90
- const selectedChild = el.querySelector(':scope > sp-swatch:nth-child(4)');
91
- const changeSpy = spy();
92
- el.addEventListener('change', () => changeSpy());
93
- expect(el.selected).to.deep.equal([]);
94
- expect(selectedChild.selected).to.be.false;
95
- selectedChild.click();
96
- expect(changeSpy.calledOnce).to.be.true;
97
- expect(el.selected).to.deep.equal([selectedChild.value]);
98
- expect(selectedChild.selected).to.be.true;
99
- });
100
- it('can have `change` events prevented', async () => {
101
- el.selects = 'single';
102
- const selectedChild = el.querySelector(':scope > sp-swatch:nth-child(4)');
103
- el.addEventListener('change', (event) => event.preventDefault());
104
- expect(el.selected).to.deep.equal([]);
105
- expect(selectedChild.selected).to.be.false;
106
- selectedChild.click();
107
- expect(el.selected).to.deep.equal([]);
108
- expect(selectedChild.selected).to.be.false;
109
- });
110
- it('dispatches `change` events as [selects="multiple"]', async () => {
111
- el.selects = 'multiple';
112
- const selectedChild0 = el.querySelector(':scope > sp-swatch:nth-child(1)');
113
- const selectedChild1 = el.querySelector(':scope > sp-swatch:nth-child(4)');
114
- const selectedChild2 = el.querySelector(':scope > sp-swatch:nth-child(6)');
115
- await elementUpdated(selectedChild0);
116
- const changeSpy = spy();
117
- el.addEventListener('change', () => changeSpy());
118
- expect(el.selected).to.deep.equal([]);
119
- selectedChild0.click();
120
- selectedChild1.click();
121
- selectedChild2.click();
122
- expect(changeSpy.callCount).to.equal(3);
123
- expect(el.selected).to.deep.equal([
124
- selectedChild0.value,
125
- selectedChild1.value,
126
- selectedChild2.value,
127
- ]);
128
- });
129
- it('filters `selected` when a selected Swatch is removed from the DOM', async () => {
130
- el.selects = 'multiple';
131
- const selectedChild0 = el.querySelector(':scope > sp-swatch:nth-child(1)');
132
- const selectedChild1 = el.querySelector(':scope > sp-swatch:nth-child(4)');
133
- const selectedChild2 = el.querySelector(':scope > sp-swatch:nth-child(6)');
134
- await elementUpdated(selectedChild0);
135
- expect(el.selected).to.deep.equal([]);
136
- selectedChild0.click();
137
- selectedChild1.click();
138
- selectedChild2.click();
139
- expect(el.selected).to.deep.equal([
140
- selectedChild0.value,
141
- selectedChild1.value,
142
- selectedChild2.value,
143
- ]);
144
- selectedChild0.remove();
145
- await elementUpdated(el);
146
- expect(el.selected).to.deep.equal([
147
- selectedChild1.value,
148
- selectedChild2.value,
149
- ]);
150
- selectedChild2.remove();
151
- await elementUpdated(el);
152
- expect(el.selected).to.deep.equal([selectedChild1.value]);
153
- selectedChild1.remove();
154
- await elementUpdated(el);
155
- expect(el.selected).to.deep.equal([]);
156
- });
157
- it('maintains a single tab stop', async () => {
158
- const inputBefore = document.createElement('input');
159
- const inputAfter = document.createElement('input');
160
- el.insertAdjacentElement('beforebegin', inputBefore);
161
- el.insertAdjacentElement('afterend', inputAfter);
162
- inputBefore.focus();
163
- expect(document.activeElement === el.children[0]).to.be.false;
164
- await sendKeys({
165
- press: 'Tab',
166
- });
167
- expect(document.activeElement === el.children[0]).to.be.true;
168
- await sendKeys({
169
- press: 'Tab',
170
- });
171
- expect(document.activeElement === el.children[0]).to.be.false;
172
- await sendKeys({
173
- press: 'Shift+Tab',
174
- });
175
- expect(document.activeElement === el.children[0]).to.be.true;
176
- });
177
- it('makes the first selected child the single tab stop', async () => {
178
- const selectedChild = el.querySelector(':scope > sp-swatch:nth-child(4)');
179
- expect(selectedChild.selected).to.be.false;
180
- const inputBefore = document.createElement('input');
181
- const inputAfter = document.createElement('input');
182
- el.insertAdjacentElement('beforebegin', inputBefore);
183
- el.insertAdjacentElement('afterend', inputAfter);
184
- inputBefore.focus();
185
- el.selects = 'single';
186
- el.selected = [selectedChild.value];
187
- await elementUpdated(el);
188
- await nextFrame();
189
- expect(selectedChild.selected).to.be.true;
190
- expect(document.activeElement === selectedChild).to.be.false;
191
- await sendKeys({
192
- press: 'Tab',
193
- });
194
- expect(document.activeElement === selectedChild).to.be.true;
195
- await sendKeys({
196
- press: 'Tab',
197
- });
198
- expect(document.activeElement === selectedChild).to.be.false;
199
- await sendKeys({
200
- press: 'Shift+Tab',
201
- });
202
- expect(document.activeElement === selectedChild).to.be.true;
203
- });
204
- it('focus()es to the first Swatch', async () => {
205
- el.focus();
206
- expect(document.activeElement === el.children[0]).to.be.true;
207
- });
208
- it('focus()es to the first selected Swatch', async () => {
209
- const selectedChild = el.querySelector(':scope > sp-swatch:nth-child(4)');
210
- expect(selectedChild.selected).to.be.false;
211
- el.selects = 'single';
212
- el.selected = [selectedChild.value];
213
- await elementUpdated(el);
214
- await nextFrame();
215
- expect(selectedChild.selected).to.be.true;
216
- el.focus();
217
- expect(document.activeElement === selectedChild).to.be.true;
218
- });
1
+ import { elementUpdated, expect, fixture, nextFrame } from "@open-wc/testing";
2
+ import { sendKeys } from "@web/test-runner-commands";
3
+ import "../sp-swatch.js";
4
+ import { Default } from "../stories/swatch-group.stories.js";
5
+ import { spy } from "sinon";
6
+ import { html } from "@spectrum-web-components/base";
7
+ import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
8
+ describe("Swatch Group", () => {
9
+ let el;
10
+ beforeEach(async () => {
11
+ el = await fixture(Default(Default.args));
12
+ await elementUpdated(el);
13
+ });
14
+ testForLitDevWarnings(async () => await fixture(Default(Default.args)));
15
+ it("loads default swatch accessibly", async () => {
16
+ await expect(el).to.be.accessible();
17
+ });
18
+ it("forwards `border` to children", async () => {
19
+ el.border = "light";
20
+ await elementUpdated(el);
21
+ [...el.children].forEach((child) => {
22
+ expect(child.border).to.equal("light");
23
+ });
24
+ });
25
+ it("forwards `rounding` to children", async () => {
26
+ el.rounding = "full";
27
+ await elementUpdated(el);
28
+ [...el.children].forEach((child) => {
29
+ expect(child.rounding).to.equal("full");
30
+ });
31
+ });
32
+ it("forwards `size` to children", async () => {
33
+ el.size = "xs";
34
+ await elementUpdated(el);
35
+ [...el.children].forEach((child) => {
36
+ expect(child.size).to.equal("xs");
37
+ });
38
+ });
39
+ it("forwards `shape` to children", async () => {
40
+ el.shape = "rectangle";
41
+ await elementUpdated(el);
42
+ [...el.children].forEach((child) => {
43
+ expect(child.shape).to.equal("rectangle");
44
+ });
45
+ });
46
+ it("unsets forwarding", async () => {
47
+ el.border = "light";
48
+ el.rounding = "full";
49
+ el.size = "xs";
50
+ el.shape = "rectangle";
51
+ await elementUpdated(el);
52
+ [...el.children].forEach((child) => {
53
+ expect(child.border).to.not.be.undefined;
54
+ expect(child.rounding).to.not.be.undefined;
55
+ expect(child.size).to.not.equal("m");
56
+ expect(child.shape).to.not.be.undefined;
57
+ });
58
+ el.border = void 0;
59
+ el.rounding = void 0;
60
+ el.removeAttribute("size");
61
+ el.shape = void 0;
62
+ await elementUpdated(el);
63
+ [...el.children].forEach((child) => {
64
+ expect(child.border).to.equal(void 0);
65
+ expect(child.rounding).to.equal(void 0);
66
+ expect(child.size).to.equal("m");
67
+ expect(child.shape).to.equal(void 0);
68
+ });
69
+ });
70
+ it("does not dispatch `change` events without `selects` attribute", async () => {
71
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
72
+ const changeSpy = spy();
73
+ el.addEventListener("change", () => changeSpy());
74
+ expect(el.selected).to.deep.equal([]);
75
+ selectedChild.click();
76
+ expect(changeSpy.called).to.be.false;
77
+ expect(el.selected).to.deep.equal([]);
78
+ });
79
+ it('dispatches `change` events as [selects="single"]', async () => {
80
+ el.selects = "single";
81
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
82
+ const changeSpy = spy();
83
+ el.addEventListener("change", () => changeSpy());
84
+ expect(el.selected).to.deep.equal([]);
85
+ expect(selectedChild.selected).to.be.false;
86
+ selectedChild.click();
87
+ expect(changeSpy.calledOnce).to.be.true;
88
+ expect(el.selected).to.deep.equal([selectedChild.value]);
89
+ expect(selectedChild.selected).to.be.true;
90
+ });
91
+ it("can have `change` events prevented", async () => {
92
+ el.selects = "single";
93
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
94
+ el.addEventListener("change", (event) => event.preventDefault());
95
+ expect(el.selected).to.deep.equal([]);
96
+ expect(selectedChild.selected).to.be.false;
97
+ selectedChild.click();
98
+ expect(el.selected).to.deep.equal([]);
99
+ expect(selectedChild.selected).to.be.false;
100
+ });
101
+ it('dispatches `change` events as [selects="multiple"]', async () => {
102
+ el.selects = "multiple";
103
+ const selectedChild0 = el.querySelector(":scope > sp-swatch:nth-child(1)");
104
+ const selectedChild1 = el.querySelector(":scope > sp-swatch:nth-child(4)");
105
+ const selectedChild2 = el.querySelector(":scope > sp-swatch:nth-child(6)");
106
+ await elementUpdated(selectedChild0);
107
+ const changeSpy = spy();
108
+ el.addEventListener("change", () => changeSpy());
109
+ expect(el.selected).to.deep.equal([]);
110
+ selectedChild0.click();
111
+ selectedChild1.click();
112
+ selectedChild2.click();
113
+ expect(changeSpy.callCount).to.equal(3);
114
+ expect(el.selected).to.deep.equal([
115
+ selectedChild0.value,
116
+ selectedChild1.value,
117
+ selectedChild2.value
118
+ ]);
119
+ });
120
+ it("filters `selected` when a selected Swatch is removed from the DOM", async () => {
121
+ el.selects = "multiple";
122
+ const selectedChild0 = el.querySelector(":scope > sp-swatch:nth-child(1)");
123
+ const selectedChild1 = el.querySelector(":scope > sp-swatch:nth-child(4)");
124
+ const selectedChild2 = el.querySelector(":scope > sp-swatch:nth-child(6)");
125
+ await elementUpdated(selectedChild0);
126
+ expect(el.selected).to.deep.equal([]);
127
+ selectedChild0.click();
128
+ selectedChild1.click();
129
+ selectedChild2.click();
130
+ expect(el.selected).to.deep.equal([
131
+ selectedChild0.value,
132
+ selectedChild1.value,
133
+ selectedChild2.value
134
+ ]);
135
+ selectedChild0.remove();
136
+ await elementUpdated(el);
137
+ expect(el.selected).to.deep.equal([
138
+ selectedChild1.value,
139
+ selectedChild2.value
140
+ ]);
141
+ selectedChild2.remove();
142
+ await elementUpdated(el);
143
+ expect(el.selected).to.deep.equal([selectedChild1.value]);
144
+ selectedChild1.remove();
145
+ await elementUpdated(el);
146
+ expect(el.selected).to.deep.equal([]);
147
+ });
148
+ it("maintains a single tab stop", async () => {
149
+ const inputBefore = document.createElement("input");
150
+ const inputAfter = document.createElement("input");
151
+ el.insertAdjacentElement("beforebegin", inputBefore);
152
+ el.insertAdjacentElement("afterend", inputAfter);
153
+ inputBefore.focus();
154
+ expect(document.activeElement === el.children[0]).to.be.false;
155
+ await sendKeys({
156
+ press: "Tab"
157
+ });
158
+ expect(document.activeElement === el.children[0]).to.be.true;
159
+ await sendKeys({
160
+ press: "Tab"
161
+ });
162
+ expect(document.activeElement === el.children[0]).to.be.false;
163
+ await sendKeys({
164
+ press: "Shift+Tab"
165
+ });
166
+ expect(document.activeElement === el.children[0]).to.be.true;
167
+ });
168
+ it("makes the first selected child the single tab stop", async () => {
169
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
170
+ expect(selectedChild.selected).to.be.false;
171
+ const inputBefore = document.createElement("input");
172
+ const inputAfter = document.createElement("input");
173
+ el.insertAdjacentElement("beforebegin", inputBefore);
174
+ el.insertAdjacentElement("afterend", inputAfter);
175
+ inputBefore.focus();
176
+ el.selects = "single";
177
+ el.selected = [selectedChild.value];
178
+ await elementUpdated(el);
179
+ await nextFrame();
180
+ expect(selectedChild.selected).to.be.true;
181
+ expect(document.activeElement === selectedChild).to.be.false;
182
+ await sendKeys({
183
+ press: "Tab"
184
+ });
185
+ expect(document.activeElement === selectedChild).to.be.true;
186
+ await sendKeys({
187
+ press: "Tab"
188
+ });
189
+ expect(document.activeElement === selectedChild).to.be.false;
190
+ await sendKeys({
191
+ press: "Shift+Tab"
192
+ });
193
+ expect(document.activeElement === selectedChild).to.be.true;
194
+ });
195
+ it("focus()es to the first Swatch", async () => {
196
+ el.focus();
197
+ expect(document.activeElement === el.children[0]).to.be.true;
198
+ });
199
+ it("focus()es to the first selected Swatch", async () => {
200
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
201
+ expect(selectedChild.selected).to.be.false;
202
+ el.selects = "single";
203
+ el.selected = [selectedChild.value];
204
+ await elementUpdated(el);
205
+ await nextFrame();
206
+ expect(selectedChild.selected).to.be.true;
207
+ el.focus();
208
+ expect(document.activeElement === selectedChild).to.be.true;
209
+ });
219
210
  });
220
- describe('Swatch Group - DOM selected', () => {
221
- it('accepts selection from DOM', async () => {
222
- const el = await fixture(html `
211
+ describe("Swatch Group - DOM selected", () => {
212
+ it("accepts selection from DOM", async () => {
213
+ const el = await fixture(html`
223
214
  <sp-swatch-group selects="multiple">
224
215
  <sp-swatch value="color-0" color="red"></sp-swatch>
225
216
  <sp-swatch value="color-1" color="green" selected></sp-swatch>
@@ -227,23 +218,23 @@ describe('Swatch Group - DOM selected', () => {
227
218
  <sp-swatch value="color-3" color="yellow" selected></sp-swatch>
228
219
  </sp-swatch-group>
229
220
  `);
230
- await elementUpdated(el);
231
- expect(el.selected).to.deep.equal(['color-1', 'color-3']);
232
- });
233
- it('merges `selected` and selection from DOM', async () => {
234
- const el = await fixture(html `
235
- <sp-swatch-group selects="multiple" .selected=${['color-1']}>
221
+ await elementUpdated(el);
222
+ expect(el.selected).to.deep.equal(["color-1", "color-3"]);
223
+ });
224
+ it("merges `selected` and selection from DOM", async () => {
225
+ const el = await fixture(html`
226
+ <sp-swatch-group selects="multiple" .selected=${["color-1"]}>
236
227
  <sp-swatch value="color-0" color="red"></sp-swatch>
237
228
  <sp-swatch value="color-1" color="green"></sp-swatch>
238
229
  <sp-swatch value="color-2" color="blue"></sp-swatch>
239
230
  <sp-swatch value="color-3" color="yellow" selected></sp-swatch>
240
231
  </sp-swatch-group>
241
232
  `);
242
- await elementUpdated(el);
243
- expect(el.selected).to.deep.equal(['color-1', 'color-3']);
244
- });
245
- it('lazily accepts selection from DOM', async () => {
246
- const el = await fixture(html `
233
+ await elementUpdated(el);
234
+ expect(el.selected).to.deep.equal(["color-1", "color-3"]);
235
+ });
236
+ it("lazily accepts selection from DOM", async () => {
237
+ const el = await fixture(html`
247
238
  <sp-swatch-group selects="multiple">
248
239
  <sp-swatch value="color-0" color="red"></sp-swatch>
249
240
  <sp-swatch value="color-1" color="green"></sp-swatch>
@@ -251,12 +242,12 @@ describe('Swatch Group - DOM selected', () => {
251
242
  <sp-swatch value="color-3" color="yellow" selected></sp-swatch>
252
243
  </sp-swatch-group>
253
244
  `);
254
- await elementUpdated(el);
255
- const color1 = el.querySelector('[value="color-1"]');
256
- expect(el.selected).to.deep.equal(['color-3']);
257
- color1.selected = true;
258
- await elementUpdated(el);
259
- expect(el.selected).to.deep.equal(['color-3', 'color-1']);
260
- });
245
+ await elementUpdated(el);
246
+ const color1 = el.querySelector('[value="color-1"]');
247
+ expect(el.selected).to.deep.equal(["color-3"]);
248
+ color1.selected = true;
249
+ await elementUpdated(el);
250
+ expect(el.selected).to.deep.equal(["color-3", "color-1"]);
251
+ });
261
252
  });
262
- //# sourceMappingURL=swatch-group.test.js.map
253
+ //# sourceMappingURL=swatch-group.test.js.map