@spectrum-web-components/checkbox 0.12.4 → 0.12.5-express.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/checkbox",
3
- "version": "0.12.4",
3
+ "version": "0.12.5-express.9+abfee7409",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,18 +45,18 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@spectrum-web-components/base": "^0.5.2",
48
- "@spectrum-web-components/icon": "^0.11.3",
49
- "@spectrum-web-components/icons-ui": "^0.8.3",
48
+ "@spectrum-web-components/icon": "^0.11.4-express.9+abfee7409",
49
+ "@spectrum-web-components/icons-ui": "^0.8.4-express.9+abfee7409",
50
50
  "@spectrum-web-components/shared": "^0.13.4",
51
51
  "tslib": "^2.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@spectrum-css/checkbox": "^3.0.12"
54
+ "@spectrum-css/checkbox": "^3.0.14"
55
55
  },
56
56
  "types": "./src/index.d.ts",
57
57
  "customElements": "custom-elements.json",
58
58
  "sideEffects": [
59
59
  "./sp-*.js"
60
60
  ],
61
- "gitHead": "bb5308b9be01cc7c5bbab289312042256bdcc740"
61
+ "gitHead": "abfee740957976448a3e4cf90df17d6165f857d6"
62
62
  }
@@ -0,0 +1,15 @@
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/checkbox-sizes.stories.js';
13
+ import { regressVisuals } from '../../../test/visual/test.js';
14
+ regressVisuals('CheckboxSizesStories', stories);
15
+ //# sourceMappingURL=checkbox-sizes.test-vrt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox-sizes.test-vrt.js","sourceRoot":"","sources":["checkbox-sizes.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,sBAAsB,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/checkbox-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('CheckboxSizesStories', stories);\n"]}
@@ -0,0 +1,15 @@
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/checkbox.stories.js';
13
+ import { regressVisuals } from '../../../test/visual/test.js';
14
+ regressVisuals('CheckboxStories', stories);
15
+ //# sourceMappingURL=checkbox.test-vrt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.test-vrt.js","sourceRoot":"","sources":["checkbox.test-vrt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,cAAc,CAAC,iBAAiB,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/checkbox.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('CheckboxStories', stories);\n"]}
@@ -0,0 +1,130 @@
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-checkbox.js';
13
+ import { elementUpdated, expect, fixture, html, triggerBlurFor, waitUntil, } from '@open-wc/testing';
14
+ import { waitForPredicate } from '../../../test/testing-helpers.js';
15
+ import '@spectrum-web-components/shared/src/focus-visible.js';
16
+ function inputForCheckbox(checkbox) {
17
+ if (!checkbox.shadowRoot)
18
+ throw new Error('No shadowRoot');
19
+ return checkbox.shadowRoot.querySelector('#input');
20
+ }
21
+ function labelNodeForCheckbox(checkbox) {
22
+ if (!checkbox.shadowRoot)
23
+ throw new Error('No shadowRoot');
24
+ const slotEl = checkbox.shadowRoot.querySelector('slot');
25
+ if (!slotEl) {
26
+ throw new Error('Failed to find slot in shadowRoot');
27
+ }
28
+ return slotEl.assignedNodes()[0];
29
+ }
30
+ describe('Checkbox', () => {
31
+ let testFixture;
32
+ beforeEach(async () => {
33
+ testFixture = await fixture(html `
34
+ <div>
35
+ <div id="test-checkbox">
36
+ <sp-checkbox id="checkbox0" tabindex="5">
37
+ Component
38
+ </sp-checkbox>
39
+ <sp-checkbox id="checkbox1" tabindex="2" checked>
40
+ Check 1
41
+ </sp-checkbox>
42
+ <sp-checkbox id="checkbox2" tabindex="3" disabled>
43
+ Check 2
44
+ </sp-checkbox>
45
+ <sp-checkbox id="checkbox3" tabindex="1" autofocus>
46
+ Check 3
47
+ </sp-checkbox>
48
+ <sp-checkbox id="checkbox4" tabindex="0">
49
+ Check 4
50
+ </sp-checkbox>
51
+ <sp-checkbox id="checkbox5" tabindex="-1">
52
+ Check 5
53
+ </sp-checkbox>
54
+ </div>
55
+ </div>
56
+ `);
57
+ });
58
+ it('loads', async () => {
59
+ const el = testFixture.querySelector('sp-checkbox');
60
+ await waitForPredicate(() => !!window.applyFocusVisiblePolyfill);
61
+ expect(el).to.not.equal(undefined);
62
+ const textNode = labelNodeForCheckbox(el);
63
+ const content = (textNode.textContent || '').trim();
64
+ expect(content).to.equal('Component');
65
+ });
66
+ it('loads default checkbox accessibly', async () => {
67
+ const el = await fixture(html `
68
+ <sp-checkbox>Not Checked</sp-checkbox>
69
+ `);
70
+ await elementUpdated(el);
71
+ await expect(el).to.be.accessible();
72
+ });
73
+ it('loads `checked` checkbox accessibly', async () => {
74
+ const el = await fixture(html `
75
+ <sp-checkbox checked>Checked</sp-checkbox>
76
+ `);
77
+ await elementUpdated(el);
78
+ await expect(el).to.be.accessible();
79
+ });
80
+ it('is `invalid` checkbox accessibly', async () => {
81
+ const el = await fixture(html `
82
+ <sp-checkbox invalid>Invalid Checked</sp-checkbox>
83
+ `);
84
+ await elementUpdated(el);
85
+ await expect(el).to.be.accessible();
86
+ });
87
+ it('autofocuses', async () => {
88
+ const autoElement = testFixture.querySelector('sp-checkbox[autofocus]');
89
+ expect(autoElement).to.exist;
90
+ await waitUntil(() => document.activeElement === autoElement, 'Autofocused');
91
+ await triggerBlurFor(autoElement);
92
+ expect(document.activeElement).to.not.equal(autoElement);
93
+ });
94
+ it('`click()`ing host clicks `focusElement`', async () => {
95
+ const el = await fixture(html `
96
+ <sp-checkbox checked autofocus>Checked</sp-checkbox>
97
+ `);
98
+ await elementUpdated(el);
99
+ expect(el.checked, 'checked initially').to.be.true;
100
+ el.click();
101
+ await elementUpdated(el);
102
+ expect(el.checked, 'unchecked').to.be.false;
103
+ el.click();
104
+ await elementUpdated(el);
105
+ expect(el.checked, 'checked again').to.be.true;
106
+ });
107
+ it('respects checked attribute', () => {
108
+ let el = testFixture.querySelector('#checkbox0');
109
+ expect(el.checked).to.be.false;
110
+ el = testFixture.querySelector('#checkbox1');
111
+ expect(el.checked).to.be.true;
112
+ });
113
+ it('handles click events', async () => {
114
+ const el = testFixture.querySelector('#checkbox1');
115
+ expect(el.checked).to.be.true;
116
+ inputForCheckbox(el).click();
117
+ await elementUpdated(el);
118
+ expect(el.checked).to.be.false;
119
+ });
120
+ it('maintains its value when [readonly]', async () => {
121
+ const el = await fixture(html `
122
+ <sp-checkbox id="checkbox0" checked readonly>Component</sp-checkbox>
123
+ `);
124
+ expect(el.checked).to.be.true;
125
+ inputForCheckbox(el).click();
126
+ await elementUpdated(el);
127
+ expect(el.checked).to.be.true;
128
+ });
129
+ });
130
+ //# sourceMappingURL=checkbox.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.test.js","sourceRoot":"","sources":["checkbox.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,mBAAmB,CAAC;AAE3B,OAAO,EACH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E,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,EAAE,GAAG,WAAW,CAAC,aAAa,CAAC,YAAY,CAAa,CAAC;QAC/D,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAE9B,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAW,IAAI,CAAA;;SAEtC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAE9B,gBAAgB,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IAClC,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-checkbox.js';\nimport { Checkbox } from '../';\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n triggerBlurFor,\n waitUntil,\n} from '@open-wc/testing';\nimport { waitForPredicate } from '../../../test/testing-helpers.js';\nimport '@spectrum-web-components/shared/src/focus-visible.js';\n\nfunction inputForCheckbox(checkbox: Checkbox): HTMLInputElement {\n if (!checkbox.shadowRoot) throw new Error('No shadowRoot');\n return checkbox.shadowRoot.querySelector('#input') as HTMLInputElement;\n}\n\nfunction labelNodeForCheckbox(checkbox: Checkbox): Node {\n if (!checkbox.shadowRoot) throw new Error('No shadowRoot');\n const slotEl = checkbox.shadowRoot.querySelector('slot');\n if (!slotEl) {\n throw new Error('Failed to find slot in shadowRoot');\n }\n return slotEl.assignedNodes()[0];\n}\ndescribe('Checkbox', () => {\n let testFixture: HTMLDivElement;\n\n beforeEach(async () => {\n testFixture = await fixture<HTMLDivElement>(\n html`\n <div>\n <div id=\"test-checkbox\">\n <sp-checkbox id=\"checkbox0\" tabindex=\"5\">\n Component\n </sp-checkbox>\n <sp-checkbox id=\"checkbox1\" tabindex=\"2\" checked>\n Check 1\n </sp-checkbox>\n <sp-checkbox id=\"checkbox2\" tabindex=\"3\" disabled>\n Check 2\n </sp-checkbox>\n <sp-checkbox id=\"checkbox3\" tabindex=\"1\" autofocus>\n Check 3\n </sp-checkbox>\n <sp-checkbox id=\"checkbox4\" tabindex=\"0\">\n Check 4\n </sp-checkbox>\n <sp-checkbox id=\"checkbox5\" tabindex=\"-1\">\n Check 5\n </sp-checkbox>\n </div>\n </div>\n `\n );\n });\n\n it('loads', async () => {\n const el = testFixture.querySelector('sp-checkbox') as Checkbox;\n\n await waitForPredicate(() => !!window.applyFocusVisiblePolyfill);\n\n expect(el).to.not.equal(undefined);\n const textNode = labelNodeForCheckbox(el);\n const content = (textNode.textContent || '').trim();\n expect(content).to.equal('Component');\n });\n\n it('loads default checkbox accessibly', async () => {\n const el = await fixture<Checkbox>(\n html`\n <sp-checkbox>Not Checked</sp-checkbox>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n\n it('loads `checked` checkbox accessibly', async () => {\n const el = await fixture<Checkbox>(\n html`\n <sp-checkbox checked>Checked</sp-checkbox>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n\n it('is `invalid` checkbox accessibly', async () => {\n const el = await fixture<Checkbox>(\n html`\n <sp-checkbox invalid>Invalid Checked</sp-checkbox>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n\n it('autofocuses', async () => {\n const autoElement = testFixture.querySelector(\n 'sp-checkbox[autofocus]'\n ) as Checkbox;\n\n expect(autoElement).to.exist;\n await waitUntil(\n () => document.activeElement === autoElement,\n 'Autofocused'\n );\n\n await triggerBlurFor(autoElement);\n\n expect(document.activeElement).to.not.equal(autoElement);\n });\n\n it('`click()`ing host clicks `focusElement`', async () => {\n const el = await fixture<Checkbox>(\n html`\n <sp-checkbox checked autofocus>Checked</sp-checkbox>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.checked, 'checked initially').to.be.true;\n\n el.click();\n await elementUpdated(el);\n\n expect(el.checked, 'unchecked').to.be.false;\n\n el.click();\n await elementUpdated(el);\n\n expect(el.checked, 'checked again').to.be.true;\n });\n\n it('respects checked attribute', () => {\n let el = testFixture.querySelector('#checkbox0') as Checkbox;\n expect(el.checked).to.be.false;\n\n el = testFixture.querySelector('#checkbox1') as Checkbox;\n expect(el.checked).to.be.true;\n });\n\n it('handles click events', async () => {\n const el = testFixture.querySelector('#checkbox1') as Checkbox;\n expect(el.checked).to.be.true;\n\n inputForCheckbox(el).click();\n await elementUpdated(el);\n\n expect(el.checked).to.be.false;\n });\n\n it('maintains its value when [readonly]', async () => {\n const el = await fixture<Checkbox>(html`\n <sp-checkbox id=\"checkbox0\" checked readonly>Component</sp-checkbox>\n `);\n expect(el.checked).to.be.true;\n\n inputForCheckbox(el).click();\n await elementUpdated(el);\n\n expect(el.checked).to.be.true;\n });\n});\n"]}