@spectrum-web-components/swatch 0.1.2 → 0.1.3-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 (55) hide show
  1. package/package.json +33 -13
  2. package/sp-swatch-group.dev.js +3 -0
  3. package/sp-swatch-group.dev.js.map +7 -0
  4. package/sp-swatch-group.js +3 -14
  5. package/sp-swatch-group.js.map +7 -1
  6. package/sp-swatch.dev.js +3 -0
  7. package/sp-swatch.dev.js.map +7 -0
  8. package/sp-swatch.js +3 -14
  9. package/sp-swatch.js.map +7 -1
  10. package/src/Swatch.dev.js +219 -0
  11. package/src/Swatch.dev.js.map +7 -0
  12. package/src/Swatch.js +165 -170
  13. package/src/Swatch.js.map +7 -1
  14. package/src/SwatchGroup.dev.js +220 -0
  15. package/src/SwatchGroup.dev.js.map +7 -0
  16. package/src/SwatchGroup.js +201 -216
  17. package/src/SwatchGroup.js.map +7 -1
  18. package/src/index.dev.js +3 -0
  19. package/src/index.dev.js.map +7 -0
  20. package/src/index.js +3 -14
  21. package/src/index.js.map +7 -1
  22. package/src/spectrum-swatch-group.css.dev.js +10 -0
  23. package/src/spectrum-swatch-group.css.dev.js.map +7 -0
  24. package/src/spectrum-swatch-group.css.js +3 -14
  25. package/src/spectrum-swatch-group.css.js.map +7 -1
  26. package/src/spectrum-swatch.css.dev.js +66 -0
  27. package/src/spectrum-swatch.css.dev.js.map +7 -0
  28. package/src/spectrum-swatch.css.js +3 -14
  29. package/src/spectrum-swatch.css.js.map +7 -1
  30. package/src/swatch-group.css.dev.js +10 -0
  31. package/src/swatch-group.css.dev.js.map +7 -0
  32. package/src/swatch-group.css.js +3 -14
  33. package/src/swatch-group.css.js.map +7 -1
  34. package/src/swatch.css.dev.js +66 -0
  35. package/src/swatch.css.dev.js.map +7 -0
  36. package/src/swatch.css.js +3 -14
  37. package/src/swatch.css.js.map +7 -1
  38. package/stories/swatch-group.stories.js +124 -133
  39. package/stories/swatch-group.stories.js.map +7 -1
  40. package/stories/swatch-sizes.stories.js +15 -21
  41. package/stories/swatch-sizes.stories.js.map +7 -1
  42. package/stories/swatch.stories.js +69 -73
  43. package/stories/swatch.stories.js.map +7 -1
  44. package/test/benchmark/basic-test.js +5 -16
  45. package/test/benchmark/basic-test.js.map +7 -1
  46. package/test/swatch-group.test-vrt.js +4 -15
  47. package/test/swatch-group.test-vrt.js.map +7 -1
  48. package/test/swatch-group.test.js +229 -240
  49. package/test/swatch-group.test.js.map +7 -1
  50. package/test/swatch-sizes.test-vrt.js +4 -15
  51. package/test/swatch-sizes.test-vrt.js.map +7 -1
  52. package/test/swatch.test-vrt.js +4 -15
  53. package/test/swatch.test-vrt.js.map +7 -1
  54. package/test/swatch.test.js +124 -135
  55. 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,MAAM,CAAC;aACvC;SACJ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C","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);\nshapeRectangle.args = {\n shape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W,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,214 @@
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
+ describe("Swatch Group", () => {
8
+ let el;
9
+ beforeEach(async () => {
10
+ el = await fixture(Default(Default.args));
11
+ await elementUpdated(el);
12
+ });
13
+ it("loads default swatch accessibly", async () => {
14
+ await expect(el).to.be.accessible();
15
+ });
16
+ it("forwards `border` to children", async () => {
17
+ el.border = "light";
18
+ await elementUpdated(el);
19
+ [...el.children].forEach((child) => {
20
+ expect(child.border).to.equal("light");
21
+ });
22
+ });
23
+ it("forwards `rounding` to children", async () => {
24
+ el.rounding = "full";
25
+ await elementUpdated(el);
26
+ [...el.children].forEach((child) => {
27
+ expect(child.rounding).to.equal("full");
28
+ });
29
+ });
30
+ it("forwards `size` to children", async () => {
31
+ el.size = "xs";
32
+ await elementUpdated(el);
33
+ [...el.children].forEach((child) => {
34
+ expect(child.size).to.equal("xs");
35
+ });
36
+ });
37
+ it("forwards `shape` to children", async () => {
38
+ el.shape = "rectangle";
39
+ await elementUpdated(el);
40
+ [...el.children].forEach((child) => {
41
+ expect(child.shape).to.equal("rectangle");
42
+ });
43
+ });
44
+ it("unsets forwarding", async () => {
45
+ el.border = "light";
46
+ el.rounding = "full";
47
+ el.size = "xs";
48
+ el.shape = "rectangle";
49
+ await elementUpdated(el);
50
+ [...el.children].forEach((child) => {
51
+ expect(child.border).to.not.be.undefined;
52
+ expect(child.rounding).to.not.be.undefined;
53
+ expect(child.size).to.not.equal("m");
54
+ expect(child.shape).to.not.be.undefined;
55
+ });
56
+ el.border = void 0;
57
+ el.rounding = void 0;
58
+ el.removeAttribute("size");
59
+ el.shape = void 0;
60
+ await elementUpdated(el);
61
+ [...el.children].forEach((child) => {
62
+ expect(child.border).to.equal(void 0);
63
+ expect(child.rounding).to.equal(void 0);
64
+ expect(child.size).to.equal("m");
65
+ expect(child.shape).to.equal(void 0);
66
+ });
67
+ });
68
+ it("does not dispatch `change` events without `selects` attribute", async () => {
69
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
70
+ const changeSpy = spy();
71
+ el.addEventListener("change", () => changeSpy());
72
+ expect(el.selected).to.deep.equal([]);
73
+ selectedChild.click();
74
+ expect(changeSpy.called).to.be.false;
75
+ expect(el.selected).to.deep.equal([]);
76
+ });
77
+ it('dispatches `change` events as [selects="single"]', async () => {
78
+ el.selects = "single";
79
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
80
+ const changeSpy = spy();
81
+ el.addEventListener("change", () => changeSpy());
82
+ expect(el.selected).to.deep.equal([]);
83
+ expect(selectedChild.selected).to.be.false;
84
+ selectedChild.click();
85
+ expect(changeSpy.calledOnce).to.be.true;
86
+ expect(el.selected).to.deep.equal([selectedChild.value]);
87
+ expect(selectedChild.selected).to.be.true;
88
+ });
89
+ it("can have `change` events prevented", async () => {
90
+ el.selects = "single";
91
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
92
+ el.addEventListener("change", (event) => event.preventDefault());
93
+ expect(el.selected).to.deep.equal([]);
94
+ expect(selectedChild.selected).to.be.false;
95
+ selectedChild.click();
96
+ expect(el.selected).to.deep.equal([]);
97
+ expect(selectedChild.selected).to.be.false;
98
+ });
99
+ it('dispatches `change` events as [selects="multiple"]', async () => {
100
+ el.selects = "multiple";
101
+ const selectedChild0 = el.querySelector(":scope > sp-swatch:nth-child(1)");
102
+ const selectedChild1 = el.querySelector(":scope > sp-swatch:nth-child(4)");
103
+ const selectedChild2 = el.querySelector(":scope > sp-swatch:nth-child(6)");
104
+ await elementUpdated(selectedChild0);
105
+ const changeSpy = spy();
106
+ el.addEventListener("change", () => changeSpy());
107
+ expect(el.selected).to.deep.equal([]);
108
+ selectedChild0.click();
109
+ selectedChild1.click();
110
+ selectedChild2.click();
111
+ expect(changeSpy.callCount).to.equal(3);
112
+ expect(el.selected).to.deep.equal([
113
+ selectedChild0.value,
114
+ selectedChild1.value,
115
+ selectedChild2.value
116
+ ]);
117
+ });
118
+ it("filters `selected` when a selected Swatch is removed from the DOM", async () => {
119
+ el.selects = "multiple";
120
+ const selectedChild0 = el.querySelector(":scope > sp-swatch:nth-child(1)");
121
+ const selectedChild1 = el.querySelector(":scope > sp-swatch:nth-child(4)");
122
+ const selectedChild2 = el.querySelector(":scope > sp-swatch:nth-child(6)");
123
+ await elementUpdated(selectedChild0);
124
+ expect(el.selected).to.deep.equal([]);
125
+ selectedChild0.click();
126
+ selectedChild1.click();
127
+ selectedChild2.click();
128
+ expect(el.selected).to.deep.equal([
129
+ selectedChild0.value,
130
+ selectedChild1.value,
131
+ selectedChild2.value
132
+ ]);
133
+ selectedChild0.remove();
134
+ await elementUpdated(el);
135
+ expect(el.selected).to.deep.equal([
136
+ selectedChild1.value,
137
+ selectedChild2.value
138
+ ]);
139
+ selectedChild2.remove();
140
+ await elementUpdated(el);
141
+ expect(el.selected).to.deep.equal([selectedChild1.value]);
142
+ selectedChild1.remove();
143
+ await elementUpdated(el);
144
+ expect(el.selected).to.deep.equal([]);
145
+ });
146
+ it("maintains a single tab stop", async () => {
147
+ const inputBefore = document.createElement("input");
148
+ const inputAfter = document.createElement("input");
149
+ el.insertAdjacentElement("beforebegin", inputBefore);
150
+ el.insertAdjacentElement("afterend", inputAfter);
151
+ inputBefore.focus();
152
+ expect(document.activeElement === el.children[0]).to.be.false;
153
+ await sendKeys({
154
+ press: "Tab"
155
+ });
156
+ expect(document.activeElement === el.children[0]).to.be.true;
157
+ await sendKeys({
158
+ press: "Tab"
159
+ });
160
+ expect(document.activeElement === el.children[0]).to.be.false;
161
+ await sendKeys({
162
+ press: "Shift+Tab"
163
+ });
164
+ expect(document.activeElement === el.children[0]).to.be.true;
165
+ });
166
+ it("makes the first selected child the single tab stop", async () => {
167
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
168
+ expect(selectedChild.selected).to.be.false;
169
+ const inputBefore = document.createElement("input");
170
+ const inputAfter = document.createElement("input");
171
+ el.insertAdjacentElement("beforebegin", inputBefore);
172
+ el.insertAdjacentElement("afterend", inputAfter);
173
+ inputBefore.focus();
174
+ el.selects = "single";
175
+ el.selected = [selectedChild.value];
176
+ await elementUpdated(el);
177
+ await nextFrame();
178
+ expect(selectedChild.selected).to.be.true;
179
+ expect(document.activeElement === selectedChild).to.be.false;
180
+ await sendKeys({
181
+ press: "Tab"
182
+ });
183
+ expect(document.activeElement === selectedChild).to.be.true;
184
+ await sendKeys({
185
+ press: "Tab"
186
+ });
187
+ expect(document.activeElement === selectedChild).to.be.false;
188
+ await sendKeys({
189
+ press: "Shift+Tab"
190
+ });
191
+ expect(document.activeElement === selectedChild).to.be.true;
192
+ });
193
+ it("focus()es to the first Swatch", async () => {
194
+ el.focus();
195
+ expect(document.activeElement === el.children[0]).to.be.true;
196
+ });
197
+ it("focus()es to the first selected Swatch", async () => {
198
+ const selectedChild = el.querySelector(":scope > sp-swatch:nth-child(4)");
199
+ expect(selectedChild.selected).to.be.false;
200
+ el.selects = "single";
201
+ el.selected = [selectedChild.value];
202
+ await elementUpdated(el);
203
+ await nextFrame();
204
+ expect(selectedChild.selected).to.be.true;
205
+ el.focus();
206
+ expect(document.activeElement === selectedChild).to.be.true;
207
+ });
219
208
  });
220
- describe('Swatch Group - DOM selected', () => {
221
- it('accepts selection from DOM', async () => {
222
- const el = await fixture(html `
209
+ describe("Swatch Group - DOM selected", () => {
210
+ it("accepts selection from DOM", async () => {
211
+ const el = await fixture(html`
223
212
  <sp-swatch-group selects="multiple">
224
213
  <sp-swatch value="color-0" color="red"></sp-swatch>
225
214
  <sp-swatch value="color-1" color="green" selected></sp-swatch>
@@ -227,23 +216,23 @@ describe('Swatch Group - DOM selected', () => {
227
216
  <sp-swatch value="color-3" color="yellow" selected></sp-swatch>
228
217
  </sp-swatch-group>
229
218
  `);
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']}>
219
+ await elementUpdated(el);
220
+ expect(el.selected).to.deep.equal(["color-1", "color-3"]);
221
+ });
222
+ it("merges `selected` and selection from DOM", async () => {
223
+ const el = await fixture(html`
224
+ <sp-swatch-group selects="multiple" .selected=${["color-1"]}>
236
225
  <sp-swatch value="color-0" color="red"></sp-swatch>
237
226
  <sp-swatch value="color-1" color="green"></sp-swatch>
238
227
  <sp-swatch value="color-2" color="blue"></sp-swatch>
239
228
  <sp-swatch value="color-3" color="yellow" selected></sp-swatch>
240
229
  </sp-swatch-group>
241
230
  `);
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 `
231
+ await elementUpdated(el);
232
+ expect(el.selected).to.deep.equal(["color-1", "color-3"]);
233
+ });
234
+ it("lazily accepts selection from DOM", async () => {
235
+ const el = await fixture(html`
247
236
  <sp-swatch-group selects="multiple">
248
237
  <sp-swatch value="color-0" color="red"></sp-swatch>
249
238
  <sp-swatch value="color-1" color="green"></sp-swatch>
@@ -251,12 +240,12 @@ describe('Swatch Group - DOM selected', () => {
251
240
  <sp-swatch value="color-3" color="yellow" selected></sp-swatch>
252
241
  </sp-swatch-group>
253
242
  `);
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
- });
243
+ await elementUpdated(el);
244
+ const color1 = el.querySelector('[value="color-1"]');
245
+ expect(el.selected).to.deep.equal(["color-3"]);
246
+ color1.selected = true;
247
+ await elementUpdated(el);
248
+ expect(el.selected).to.deep.equal(["color-3", "color-1"]);
249
+ });
261
250
  });
262
- //# sourceMappingURL=swatch-group.test.js.map
251
+ //# sourceMappingURL=swatch-group.test.js.map