@spectrum-web-components/color-wheel 0.4.0 → 0.4.1

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.
@@ -1,41 +1,481 @@
1
- import{elementUpdated as a,expect as o,fixture as s,html as r}from"@open-wc/testing";import{arrowDownEvent as p,arrowDownKeyupEvent as w,arrowLeftEvent as h,arrowLeftKeyupEvent as v,arrowRightEvent as d,arrowRightKeyupEvent as E,arrowUpEvent as m,arrowUpKeyupEvent as b,testForLitDevWarnings as g}from"../../../test/testing-helpers.js";import"@spectrum-web-components/color-wheel/sp-color-wheel.js";import{TinyColor as u}from"@ctrl/tinycolor";import{sendKeys as l}from"@web/test-runner-commands";import{spy as q}from"sinon";describe("ColorWheel",()=>{g(async()=>await s(r`
1
+ "use strict";
2
+ import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
3
+ import {
4
+ arrowDownEvent,
5
+ arrowDownKeyupEvent,
6
+ arrowLeftEvent,
7
+ arrowLeftKeyupEvent,
8
+ arrowRightEvent,
9
+ arrowRightKeyupEvent,
10
+ arrowUpEvent,
11
+ arrowUpKeyupEvent,
12
+ testForLitDevWarnings
13
+ } from "../../../test/testing-helpers.js";
14
+ import "@spectrum-web-components/color-wheel/sp-color-wheel.js";
15
+ import { TinyColor } from "@ctrl/tinycolor";
16
+ import { sendKeys } from "@web/test-runner-commands";
17
+ import { sendMouse } from "../../../test/plugins/browser.js";
18
+ import { spy } from "sinon";
19
+ describe("ColorWheel", () => {
20
+ testForLitDevWarnings(
21
+ async () => await fixture(
22
+ html`
2
23
  <sp-color-wheel></sp-color-wheel>
3
- `)),it("loads default color-wheel accessibly",async()=>{const t=await s(r`
24
+ `
25
+ )
26
+ );
27
+ it("loads default color-wheel accessibly", async () => {
28
+ const el = await fixture(
29
+ html`
4
30
  <sp-color-wheel></sp-color-wheel>
5
- `);await a(t),await o(t).to.be.accessible()}),it("manages a single tab stop",async()=>{const t=await s(r`
31
+ `
32
+ );
33
+ await elementUpdated(el);
34
+ await expect(el).to.be.accessible();
35
+ });
36
+ it("manages a single tab stop", async () => {
37
+ const test = await fixture(
38
+ html`
6
39
  <div>
7
40
  <input type="text" id="test-input-1" />
8
41
  <sp-color-wheel></sp-color-wheel>
9
42
  <input type="text" id="test-input-2" />
10
43
  </div>
11
- `),e=t.querySelector("sp-color-wheel"),n=t.querySelector("input:nth-of-type(1)"),i=t.querySelector("input:nth-of-type(2)");await a(e),n.focus(),o(document.activeElement).to.equal(n),await l({press:"Tab"}),o(document.activeElement).to.equal(e);let c=e.value;await l({press:"ArrowRight"}),o(e.value).to.not.equal(c),await l({press:"Tab"}),o(document.activeElement).to.equal(i),await l({press:"Shift+Tab"}),o(document.activeElement).to.equal(e),c=e.value,await l({press:"ArrowDown"}),o(e.value).to.not.equal(c),await l({press:"Shift+Tab"}),o(document.activeElement).to.equal(n)}),it("manages [focused]",async()=>{const t=await s(r`
44
+ `
45
+ );
46
+ const el = test.querySelector("sp-color-wheel");
47
+ const input1 = test.querySelector(
48
+ "input:nth-of-type(1)"
49
+ );
50
+ const input2 = test.querySelector(
51
+ "input:nth-of-type(2)"
52
+ );
53
+ await elementUpdated(el);
54
+ input1.focus();
55
+ expect(document.activeElement).to.equal(input1);
56
+ await sendKeys({
57
+ press: "Tab"
58
+ });
59
+ expect(document.activeElement).to.equal(el);
60
+ let value = el.value;
61
+ await sendKeys({
62
+ press: "ArrowRight"
63
+ });
64
+ expect(el.value).to.not.equal(value);
65
+ await sendKeys({
66
+ press: "Tab"
67
+ });
68
+ expect(document.activeElement).to.equal(input2);
69
+ await sendKeys({
70
+ press: "Shift+Tab"
71
+ });
72
+ expect(document.activeElement).to.equal(el);
73
+ value = el.value;
74
+ await sendKeys({
75
+ press: "ArrowDown"
76
+ });
77
+ expect(el.value).to.not.equal(value);
78
+ await sendKeys({
79
+ press: "Shift+Tab"
80
+ });
81
+ expect(document.activeElement).to.equal(input1);
82
+ });
83
+ it("manages [focused]", async () => {
84
+ const el = await fixture(
85
+ html`
12
86
  <sp-color-wheel></sp-color-wheel>
13
- `);await a(t),t.dispatchEvent(new FocusEvent("focusin")),await a(t),o(t.focused).to.be.true,t.dispatchEvent(new FocusEvent("focusout")),await a(t),o(t.focused).to.be.false}),it('dispatches input and change events in response to "Arrow*" keypresses',async()=>{const t=q(),e=q(),n=await s(r`
87
+ `
88
+ );
89
+ await elementUpdated(el);
90
+ el.dispatchEvent(new FocusEvent("focusin"));
91
+ await elementUpdated(el);
92
+ expect(el.focused).to.be.true;
93
+ el.dispatchEvent(new FocusEvent("focusout"));
94
+ await elementUpdated(el);
95
+ expect(el.focused).to.be.false;
96
+ });
97
+ it('dispatches input and change events in response to "Arrow*" keypresses', async () => {
98
+ const inputSpy = spy();
99
+ const changeSpy = spy();
100
+ const el = await fixture(
101
+ html`
14
102
  <sp-color-wheel
15
- @change=${()=>e()}
16
- @input=${()=>t()}
103
+ @change=${() => changeSpy()}
104
+ @input=${() => inputSpy()}
17
105
  ></sp-color-wheel>
18
- `);await a(n),n.focus(),await l({press:"ArrowRight"}),o(t.callCount).to.equal(1),o(e.callCount).to.equal(1),await l({press:"ArrowLeft"}),o(t.callCount).to.equal(2),o(e.callCount).to.equal(2),await l({press:"ArrowUp"}),o(t.callCount).to.equal(3),o(e.callCount).to.equal(3),await l({press:"ArrowDown"}),o(t.callCount).to.equal(4),o(e.callCount).to.equal(4)}),it("responds to events on the internal input element",async()=>{const t=q(),e=q(),n=await s(r`
106
+ `
107
+ );
108
+ await elementUpdated(el);
109
+ el.focus();
110
+ await sendKeys({ press: "ArrowRight" });
111
+ expect(inputSpy.callCount).to.equal(1);
112
+ expect(changeSpy.callCount).to.equal(1);
113
+ await sendKeys({ press: "ArrowLeft" });
114
+ expect(inputSpy.callCount).to.equal(2);
115
+ expect(changeSpy.callCount).to.equal(2);
116
+ await sendKeys({ press: "ArrowUp" });
117
+ expect(inputSpy.callCount).to.equal(3);
118
+ expect(changeSpy.callCount).to.equal(3);
119
+ await sendKeys({ press: "ArrowDown" });
120
+ expect(inputSpy.callCount).to.equal(4);
121
+ expect(changeSpy.callCount).to.equal(4);
122
+ });
123
+ it("responds to events on the internal input element", async () => {
124
+ const inputSpy = spy();
125
+ const changeSpy = spy();
126
+ const el = await fixture(
127
+ html`
19
128
  <sp-color-wheel
20
- @change=${()=>e()}
21
- @input=${()=>t()}
129
+ @change=${() => changeSpy()}
130
+ @input=${() => inputSpy()}
22
131
  ></sp-color-wheel>
23
- `);await a(n);const i=n.focusElement;n.focus(),i.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),i.dispatchEvent(new Event("change",{bubbles:!0,composed:!1})),o(t.callCount).to.equal(1),o(e.callCount).to.equal(1)}),it('accepts "Arrow*" keypresses',async()=>{const t=await s(r`
132
+ `
133
+ );
134
+ await elementUpdated(el);
135
+ const input = el.focusElement;
136
+ el.focus();
137
+ input.dispatchEvent(
138
+ new Event("input", {
139
+ bubbles: true,
140
+ composed: true
141
+ })
142
+ );
143
+ input.dispatchEvent(
144
+ new Event("change", {
145
+ bubbles: true,
146
+ composed: false
147
+ })
148
+ );
149
+ expect(inputSpy.callCount).to.equal(1);
150
+ expect(changeSpy.callCount).to.equal(1);
151
+ });
152
+ it('accepts "Arrow*" keypresses', async () => {
153
+ const el = await fixture(
154
+ html`
24
155
  <sp-color-wheel></sp-color-wheel>
25
- `);await a(t),o(t.value).to.equal(0);const e=t.focusElement;e.dispatchEvent(m()),e.dispatchEvent(b()),e.dispatchEvent(m()),e.dispatchEvent(b()),await a(t),o(t.value).to.equal(2),e.dispatchEvent(d()),e.dispatchEvent(E()),e.dispatchEvent(d()),e.dispatchEvent(E()),await a(t),o(t.value).to.equal(4),e.dispatchEvent(p()),e.dispatchEvent(w()),e.dispatchEvent(p()),e.dispatchEvent(w()),await a(t),o(t.value).to.equal(2),e.dispatchEvent(h()),e.dispatchEvent(v()),e.dispatchEvent(h()),e.dispatchEvent(v()),await a(t),o(t.value).to.equal(0)}),it('accepts "Arrow*" keypresses in dir="rtl"',async()=>{const t=await s(r`
156
+ `
157
+ );
158
+ await elementUpdated(el);
159
+ expect(el.value).to.equal(0);
160
+ const input = el.focusElement;
161
+ input.dispatchEvent(arrowUpEvent());
162
+ input.dispatchEvent(arrowUpKeyupEvent());
163
+ input.dispatchEvent(arrowUpEvent());
164
+ input.dispatchEvent(arrowUpKeyupEvent());
165
+ await elementUpdated(el);
166
+ expect(el.value).to.equal(2);
167
+ input.dispatchEvent(arrowRightEvent());
168
+ input.dispatchEvent(arrowRightKeyupEvent());
169
+ input.dispatchEvent(arrowRightEvent());
170
+ input.dispatchEvent(arrowRightKeyupEvent());
171
+ await elementUpdated(el);
172
+ expect(el.value).to.equal(4);
173
+ input.dispatchEvent(arrowDownEvent());
174
+ input.dispatchEvent(arrowDownKeyupEvent());
175
+ input.dispatchEvent(arrowDownEvent());
176
+ input.dispatchEvent(arrowDownKeyupEvent());
177
+ await elementUpdated(el);
178
+ expect(el.value).to.equal(2);
179
+ input.dispatchEvent(arrowLeftEvent());
180
+ input.dispatchEvent(arrowLeftKeyupEvent());
181
+ input.dispatchEvent(arrowLeftEvent());
182
+ input.dispatchEvent(arrowLeftKeyupEvent());
183
+ await elementUpdated(el);
184
+ expect(el.value).to.equal(0);
185
+ });
186
+ it('accepts "Arrow*" keypresses in dir="rtl"', async () => {
187
+ const el = await fixture(
188
+ html`
26
189
  <sp-color-wheel dir="rtl"></sp-color-wheel>
27
- `);await a(t),o(t.value).to.equal(0);const e=t.focusElement;e.dispatchEvent(m()),e.dispatchEvent(b()),e.dispatchEvent(m()),e.dispatchEvent(b()),await a(t),o(t.value).to.equal(2),e.dispatchEvent(d()),e.dispatchEvent(E()),e.dispatchEvent(d()),e.dispatchEvent(E()),await a(t),o(t.value).to.equal(0),e.dispatchEvent(h()),e.dispatchEvent(v()),e.dispatchEvent(h()),e.dispatchEvent(v()),await a(t),o(t.value).to.equal(2),e.dispatchEvent(p()),e.dispatchEvent(w()),e.dispatchEvent(p()),e.dispatchEvent(w()),await a(t),o(t.value).to.equal(0)}),it('accepts "Arrow*" keypresses with alteration',async()=>{const t=await s(r`
190
+ `
191
+ );
192
+ await elementUpdated(el);
193
+ expect(el.value).to.equal(0);
194
+ const input = el.focusElement;
195
+ input.dispatchEvent(arrowUpEvent());
196
+ input.dispatchEvent(arrowUpKeyupEvent());
197
+ input.dispatchEvent(arrowUpEvent());
198
+ input.dispatchEvent(arrowUpKeyupEvent());
199
+ await elementUpdated(el);
200
+ expect(el.value).to.equal(2);
201
+ input.dispatchEvent(arrowRightEvent());
202
+ input.dispatchEvent(arrowRightKeyupEvent());
203
+ input.dispatchEvent(arrowRightEvent());
204
+ input.dispatchEvent(arrowRightKeyupEvent());
205
+ await elementUpdated(el);
206
+ expect(el.value).to.equal(0);
207
+ input.dispatchEvent(arrowLeftEvent());
208
+ input.dispatchEvent(arrowLeftKeyupEvent());
209
+ input.dispatchEvent(arrowLeftEvent());
210
+ input.dispatchEvent(arrowLeftKeyupEvent());
211
+ await elementUpdated(el);
212
+ expect(el.value).to.equal(2);
213
+ input.dispatchEvent(arrowDownEvent());
214
+ input.dispatchEvent(arrowDownKeyupEvent());
215
+ input.dispatchEvent(arrowDownEvent());
216
+ input.dispatchEvent(arrowDownKeyupEvent());
217
+ await elementUpdated(el);
218
+ expect(el.value).to.equal(0);
219
+ });
220
+ it('accepts "Arrow*" keypresses with alteration', async () => {
221
+ const el = await fixture(
222
+ html`
28
223
  <sp-color-wheel></sp-color-wheel>
29
- `);await a(t),t.focus(),o(t.value).to.equal(0),await l({down:"Shift"}),await l({press:"ArrowUp"}),await l({press:"ArrowUp"}),await a(t),o(t.value).to.equal(20),await l({press:"ArrowRight"}),await l({press:"ArrowRight"}),await a(t),o(t.value).to.equal(40),await l({press:"ArrowDown"}),await l({press:"ArrowDown"}),await a(t),o(t.value).to.equal(20),await l({press:"ArrowLeft"}),await l({press:"ArrowLeft"}),await l({up:"Shift"}),await a(t),o(t.value).to.equal(0)}),it("accepts pointer events",async()=>{const t=new u({h:"0",s:"20%",l:"70%"}),e=await s(r`
224
+ `
225
+ );
226
+ await elementUpdated(el);
227
+ el.focus();
228
+ expect(el.value).to.equal(0);
229
+ await sendKeys({
230
+ down: "Shift"
231
+ });
232
+ await sendKeys({
233
+ press: "ArrowUp"
234
+ });
235
+ await sendKeys({
236
+ press: "ArrowUp"
237
+ });
238
+ await elementUpdated(el);
239
+ expect(el.value).to.equal(20);
240
+ await sendKeys({
241
+ press: "ArrowRight"
242
+ });
243
+ await sendKeys({
244
+ press: "ArrowRight"
245
+ });
246
+ await elementUpdated(el);
247
+ expect(el.value).to.equal(40);
248
+ await sendKeys({
249
+ press: "ArrowDown"
250
+ });
251
+ await sendKeys({
252
+ press: "ArrowDown"
253
+ });
254
+ await elementUpdated(el);
255
+ expect(el.value).to.equal(20);
256
+ await sendKeys({
257
+ press: "ArrowLeft"
258
+ });
259
+ await sendKeys({
260
+ press: "ArrowLeft"
261
+ });
262
+ await sendKeys({
263
+ up: "Shift"
264
+ });
265
+ await elementUpdated(el);
266
+ expect(el.value).to.equal(0);
267
+ });
268
+ it("accepts pointer events", async () => {
269
+ const color = new TinyColor({ h: "0", s: "20%", l: "70%" });
270
+ const el = await fixture(
271
+ html`
30
272
  <sp-color-wheel
31
- .color=${t}
273
+ .color=${color}
32
274
  style="--spectrum-global-dimension-size-125: 10px;"
33
275
  ></sp-color-wheel>
34
- `);await a(e);const{handle:n}=e;n.setPointerCapture=()=>{},n.releasePointerCapture=()=>{},o(e.value).to.equal(0),o(e.color.s).to.be.within(.19,.21),o(e.color.l).to.be.within(.69,.71),n.dispatchEvent(new PointerEvent("pointerdown",{button:1,pointerId:1,clientX:80,clientY:15,bubbles:!0,composed:!0,cancelable:!0})),await a(e),o(e.value).to.equal(0),o(e.color.s).to.be.within(.19,.21),o(e.color.l).to.be.within(.69,.71);const c=(e.shadowRoot?e.shadowRoot:e).querySelector('[name="gradient"]');c.dispatchEvent(new PointerEvent("pointerdown",{button:1,pointerId:1,clientX:80,clientY:15,bubbles:!0,composed:!0,cancelable:!0})),await a(e),o(e.value).to.equal(0),o(e.color.s).to.be.within(.19,.21),o(e.color.l).to.be.within(.69,.71),c.dispatchEvent(new PointerEvent("pointerdown",{pointerId:1,clientX:80,clientY:15,bubbles:!0,composed:!0,cancelable:!0})),await a(e),o(e.value).to.equal(263.74596725608353),o(e.color.s).to.be.within(.19,.21),o(e.color.l).to.be.within(.69,.71),n.dispatchEvent(new PointerEvent("pointermove",{pointerId:1,clientX:80,clientY:160,bubbles:!0,composed:!0,cancelable:!0})),n.dispatchEvent(new PointerEvent("pointerup",{pointerId:1,clientX:80,clientY:160,bubbles:!0,composed:!0,cancelable:!0})),await a(e),o(e.value).to.equal(96.34019174590992),o(e.color.s).to.be.within(.19,.21),o(e.color.l).to.be.within(.69,.71)}),[{name:"RGB String",color:"rgb(204, 51, 204)"},{name:"RGB",color:{r:204,g:51,b:204,a:1}},{name:"PRGB String",color:"rgb(80%, 20%, 80%)"},{name:"PRGB",color:{r:"80%",g:"20%",b:"80%",a:1}},{name:"Hex",color:"cc33cc"},{name:"Hex String",color:"#cc33cc"},{name:"Hex8",color:"cc33ccff"},{name:"Hex8 String",color:"#cc33ccff"},{name:"string",color:"red"},{name:"HSL String",color:"hsl(300, 60%, 50%)"},{name:"HSL",color:{h:300,s:.6000000000000001,l:.5,a:1}},{name:"HSV String",color:"hsv(300, 75%, 100%)"},{name:"HSV",color:{h:300,s:.75,v:1,a:1}}].map(t=>{it(`maintains \`color\` format as ${t.name}`,async()=>{const e=await s(r`
276
+ `
277
+ );
278
+ await elementUpdated(el);
279
+ const { handle } = el;
280
+ handle.setPointerCapture = () => {
281
+ return;
282
+ };
283
+ handle.releasePointerCapture = () => {
284
+ return;
285
+ };
286
+ expect(el.value).to.equal(0);
287
+ expect(el.color.s).to.be.within(0.19, 0.21);
288
+ expect(el.color.l).to.be.within(0.69, 0.71);
289
+ handle.dispatchEvent(
290
+ new PointerEvent("pointerdown", {
291
+ button: 1,
292
+ pointerId: 1,
293
+ clientX: 80,
294
+ clientY: 15,
295
+ bubbles: true,
296
+ composed: true,
297
+ cancelable: true
298
+ })
299
+ );
300
+ await elementUpdated(el);
301
+ expect(el.value).to.equal(0);
302
+ expect(el.color.s).to.be.within(0.19, 0.21);
303
+ expect(el.color.l).to.be.within(0.69, 0.71);
304
+ const root = el.shadowRoot ? el.shadowRoot : el;
305
+ const gradient = root.querySelector('[name="gradient"]');
306
+ gradient.dispatchEvent(
307
+ new PointerEvent("pointerdown", {
308
+ button: 1,
309
+ pointerId: 1,
310
+ clientX: 80,
311
+ clientY: 15,
312
+ bubbles: true,
313
+ composed: true,
314
+ cancelable: true
315
+ })
316
+ );
317
+ await elementUpdated(el);
318
+ expect(el.value).to.equal(0);
319
+ expect(el.color.s).to.be.within(0.19, 0.21);
320
+ expect(el.color.l).to.be.within(0.69, 0.71);
321
+ gradient.dispatchEvent(
322
+ new PointerEvent("pointerdown", {
323
+ pointerId: 1,
324
+ clientX: 80,
325
+ clientY: 15,
326
+ bubbles: true,
327
+ composed: true,
328
+ cancelable: true
329
+ })
330
+ );
331
+ await elementUpdated(el);
332
+ expect(el.value).to.equal(263.74596725608353);
333
+ expect(el.color.s).to.be.within(0.19, 0.21);
334
+ expect(el.color.l).to.be.within(0.69, 0.71);
335
+ handle.dispatchEvent(
336
+ new PointerEvent("pointermove", {
337
+ pointerId: 1,
338
+ clientX: 80,
339
+ clientY: 160,
340
+ bubbles: true,
341
+ composed: true,
342
+ cancelable: true
343
+ })
344
+ );
345
+ handle.dispatchEvent(
346
+ new PointerEvent("pointerup", {
347
+ pointerId: 1,
348
+ clientX: 80,
349
+ clientY: 160,
350
+ bubbles: true,
351
+ composed: true,
352
+ cancelable: true
353
+ })
354
+ );
355
+ await elementUpdated(el);
356
+ expect(el.value).to.equal(96.34019174590992);
357
+ expect(el.color.s).to.be.within(0.19, 0.21);
358
+ expect(el.color.l).to.be.within(0.69, 0.71);
359
+ });
360
+ it("can have `change` events prevented", async () => {
361
+ const color = new TinyColor({ h: "0", s: "20%", l: "70%" });
362
+ const el = await fixture(
363
+ html`
364
+ <sp-color-wheel
365
+ .color=${color}
366
+ @change=${(event) => {
367
+ event == null ? void 0 : event.preventDefault();
368
+ }}
369
+ style="--spectrum-global-dimension-size-125: 10px;"
370
+ ></sp-color-wheel>
371
+ `
372
+ );
373
+ await elementUpdated(el);
374
+ expect(el.value).to.equal(0);
375
+ await sendMouse({
376
+ steps: [
377
+ {
378
+ type: "move",
379
+ position: [80, 15]
380
+ },
381
+ {
382
+ type: "down"
383
+ },
384
+ {
385
+ type: "move",
386
+ position: [80, 160]
387
+ }
388
+ ]
389
+ });
390
+ await elementUpdated(el);
391
+ await sendMouse({
392
+ steps: [
393
+ {
394
+ type: "up"
395
+ }
396
+ ]
397
+ });
398
+ await elementUpdated(el);
399
+ expect(el.value).to.equal(0);
400
+ });
401
+ const colorFormats = [
402
+ { name: "RGB String", color: "rgb(204, 51, 204)" },
403
+ { name: "RGB", color: { r: 204, g: 51, b: 204, a: 1 } },
404
+ { name: "PRGB String", color: "rgb(80%, 20%, 80%)" },
405
+ { name: "PRGB", color: { r: "80%", g: "20%", b: "80%", a: 1 } },
406
+ { name: "Hex", color: "cc33cc" },
407
+ { name: "Hex String", color: "#cc33cc" },
408
+ { name: "Hex8", color: "cc33ccff" },
409
+ { name: "Hex8 String", color: "#cc33ccff" },
410
+ { name: "string", color: "red" },
411
+ { name: "HSL String", color: "hsl(300, 60%, 50%)" },
412
+ { name: "HSL", color: { h: 300, s: 0.6000000000000001, l: 0.5, a: 1 } },
413
+ { name: "HSV String", color: "hsv(300, 75%, 100%)" },
414
+ { name: "HSV", color: { h: 300, s: 0.75, v: 1, a: 1 } }
415
+ ];
416
+ colorFormats.map((format) => {
417
+ it(`maintains \`color\` format as ${format.name}`, async () => {
418
+ const el = await fixture(
419
+ html`
35
420
  <sp-color-wheel></sp-color-wheel>
36
- `);e.color=t.color,t.name.startsWith("Hex")?o(e.color).to.equal(t.color):o(e.color).to.deep.equal(t.color)})}),it("maintains `color` format as TinyColor",async()=>{const t=await s(r`
421
+ `
422
+ );
423
+ el.color = format.color;
424
+ if (format.name.startsWith("Hex")) {
425
+ expect(el.color).to.equal(format.color);
426
+ } else
427
+ expect(el.color).to.deep.equal(format.color);
428
+ });
429
+ });
430
+ it(`maintains \`color\` format as TinyColor`, async () => {
431
+ const el = await fixture(
432
+ html`
37
433
  <sp-color-wheel></sp-color-wheel>
38
- `),e=new u("rgb(204, 51, 204)");t.color=e,o(e.equals(t.color))}),it("maintains hue value",async()=>{const t=await s(r`
434
+ `
435
+ );
436
+ const color = new TinyColor("rgb(204, 51, 204)");
437
+ el.color = color;
438
+ expect(color.equals(el.color));
439
+ });
440
+ it(`maintains hue value`, async () => {
441
+ const el = await fixture(
442
+ html`
39
443
  <sp-color-wheel></sp-color-wheel>
40
- `),e=300,n=`hsl(${e}, 60%, 100%)`;t.color=n,o(t.value).to.equal(e),o(t.color).to.equal(n);const i=`hsla(${e}, 60%, 100%, 0.9)`;t.color=i,o(t.value).to.equal(e),o(t.color).to.equal(i);const c=`hsv(${e}, 60%, 100%)`;t.color=c,o(t.value).to.equal(e),o(t.color).to.equal(c);const y=`hsva(${e}, 60%, 100%, 0.9)`;t.color=y,o(t.value).to.equal(e),o(t.color).to.equal(y);const S=new u({h:e,s:60,v:100});t.color=S,o(t.value).to.equal(e),o(S.equals(t.color)).to.be.true;const f=new u({h:e,s:60,v:100,a:1});t.color=f,o(t.value).to.equal(e),o(f.equals(t.color)).to.be.true;const A=new u({h:e,s:60,l:100});t.color=A,o(t.value).to.equal(e),o(A.equals(t.color)).to.be.true;const H=new u({h:e,s:60,l:100,a:1});t.color=H,o(t.value).to.equal(e),o(H.equals(t.color)).to.be.true})});
444
+ `
445
+ );
446
+ const hue = 300;
447
+ const hsl = `hsl(${hue}, 60%, 100%)`;
448
+ el.color = hsl;
449
+ expect(el.value).to.equal(hue);
450
+ expect(el.color).to.equal(hsl);
451
+ const hsla = `hsla(${hue}, 60%, 100%, 0.9)`;
452
+ el.color = hsla;
453
+ expect(el.value).to.equal(hue);
454
+ expect(el.color).to.equal(hsla);
455
+ const hsv = `hsv(${hue}, 60%, 100%)`;
456
+ el.color = hsv;
457
+ expect(el.value).to.equal(hue);
458
+ expect(el.color).to.equal(hsv);
459
+ const hsva = `hsva(${hue}, 60%, 100%, 0.9)`;
460
+ el.color = hsva;
461
+ expect(el.value).to.equal(hue);
462
+ expect(el.color).to.equal(hsva);
463
+ const tinyHSV = new TinyColor({ h: hue, s: 60, v: 100 });
464
+ el.color = tinyHSV;
465
+ expect(el.value).to.equal(hue);
466
+ expect(tinyHSV.equals(el.color)).to.be.true;
467
+ const tinyHSVA = new TinyColor({ h: hue, s: 60, v: 100, a: 1 });
468
+ el.color = tinyHSVA;
469
+ expect(el.value).to.equal(hue);
470
+ expect(tinyHSVA.equals(el.color)).to.be.true;
471
+ const tinyHSL = new TinyColor({ h: hue, s: 60, l: 100 });
472
+ el.color = tinyHSL;
473
+ expect(el.value).to.equal(hue);
474
+ expect(tinyHSL.equals(el.color)).to.be.true;
475
+ const tinyHSLA = new TinyColor({ h: hue, s: 60, l: 100, a: 1 });
476
+ el.color = tinyHSLA;
477
+ expect(el.value).to.equal(hue);
478
+ expect(tinyHSLA.equals(el.color)).to.be.true;
479
+ });
480
+ });
41
481
  //# sourceMappingURL=color-wheel.test.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["color-wheel.test.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\nimport {\n arrowDownEvent,\n arrowDownKeyupEvent,\n arrowLeftEvent,\n arrowLeftKeyupEvent,\n arrowRightEvent,\n arrowRightKeyupEvent,\n arrowUpEvent,\n arrowUpKeyupEvent,\n testForLitDevWarnings,\n} from '../../../test/testing-helpers.js';\n\nimport '@spectrum-web-components/color-wheel/sp-color-wheel.js';\nimport { ColorWheel } from '@spectrum-web-components/color-wheel';\nimport { HSL, HSLA, HSV, HSVA, RGB, RGBA, TinyColor } from '@ctrl/tinycolor';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { spy } from 'sinon';\n\ndescribe('ColorWheel', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n )\n );\n it('loads default color-wheel accessibly', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n\n it('manages a single tab stop', async () => {\n const test = await fixture<HTMLDivElement>(\n html`\n <div>\n <input type=\"text\" id=\"test-input-1\" />\n <sp-color-wheel></sp-color-wheel>\n <input type=\"text\" id=\"test-input-2\" />\n </div>\n `\n );\n const el = test.querySelector('sp-color-wheel') as ColorWheel;\n const input1 = test.querySelector(\n 'input:nth-of-type(1)'\n ) as HTMLInputElement;\n const input2 = test.querySelector(\n 'input:nth-of-type(2)'\n ) as HTMLInputElement;\n\n await elementUpdated(el);\n\n input1.focus();\n\n expect(document.activeElement).to.equal(input1);\n\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(el);\n\n let value = el.value;\n await sendKeys({\n press: 'ArrowRight',\n });\n expect(el.value).to.not.equal(value);\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(input2);\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(el);\n\n value = el.value;\n await sendKeys({\n press: 'ArrowDown',\n });\n expect(el.value).to.not.equal(value);\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(input1);\n });\n it('manages [focused]', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n el.dispatchEvent(new FocusEvent('focusin'));\n await elementUpdated(el);\n\n expect(el.focused).to.be.true;\n\n el.dispatchEvent(new FocusEvent('focusout'));\n await elementUpdated(el);\n\n expect(el.focused).to.be.false;\n });\n it('dispatches input and change events in response to \"Arrow*\" keypresses', async () => {\n const inputSpy = spy();\n const changeSpy = spy();\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n el.focus();\n\n await sendKeys({ press: 'ArrowRight' });\n expect(inputSpy.callCount).to.equal(1);\n expect(changeSpy.callCount).to.equal(1);\n\n await sendKeys({ press: 'ArrowLeft' });\n expect(inputSpy.callCount).to.equal(2);\n expect(changeSpy.callCount).to.equal(2);\n\n await sendKeys({ press: 'ArrowUp' });\n expect(inputSpy.callCount).to.equal(3);\n expect(changeSpy.callCount).to.equal(3);\n\n await sendKeys({ press: 'ArrowDown' });\n expect(inputSpy.callCount).to.equal(4);\n expect(changeSpy.callCount).to.equal(4);\n });\n it('responds to events on the internal input element', async () => {\n // screen reader interactions dispatch events as found in the following test\n const inputSpy = spy();\n const changeSpy = spy();\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n const input = el.focusElement;\n\n el.focus();\n\n input.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n input.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: false, // native change events do not compose themselves by default\n })\n );\n\n expect(inputSpy.callCount).to.equal(1);\n expect(changeSpy.callCount).to.equal(1);\n });\n it('accepts \"Arrow*\" keypresses', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n\n const input = el.focusElement;\n\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(4);\n\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n });\n it('accepts \"Arrow*\" keypresses in dir=\"rtl\"', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel dir=\"rtl\"></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n\n const input = el.focusElement;\n\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n });\n it('accepts \"Arrow*\" keypresses with alteration', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n el.focus();\n expect(el.value).to.equal(0);\n\n await sendKeys({\n down: 'Shift',\n });\n await sendKeys({\n press: 'ArrowUp',\n });\n await sendKeys({\n press: 'ArrowUp',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(20);\n\n await sendKeys({\n press: 'ArrowRight',\n });\n await sendKeys({\n press: 'ArrowRight',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(40);\n\n await sendKeys({\n press: 'ArrowDown',\n });\n await sendKeys({\n press: 'ArrowDown',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(20);\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n await sendKeys({\n press: 'ArrowLeft',\n });\n await sendKeys({\n up: 'Shift',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n });\n it('accepts pointer events', async () => {\n const color = new TinyColor({ h: '0', s: '20%', l: '70%' });\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel\n .color=${color}\n style=\"--spectrum-global-dimension-size-125: 10px;\"\n ></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n const { handle } = el as unknown as { handle: HTMLElement };\n\n handle.setPointerCapture = () => {\n return;\n };\n handle.releasePointerCapture = () => {\n return;\n };\n\n expect(el.value).to.equal(0);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n handle.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 1,\n pointerId: 1,\n clientX: 80,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const gradient = root.querySelector('[name=\"gradient\"]') as HTMLElement;\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 1,\n pointerId: 1,\n clientX: 80,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n pointerId: 1,\n clientX: 80,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(263.74596725608353);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n handle.dispatchEvent(\n new PointerEvent('pointermove', {\n pointerId: 1,\n clientX: 80,\n clientY: 160,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n handle.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n clientX: 80,\n clientY: 160,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(96.34019174590992);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n });\n const colorFormats: {\n name: string;\n color:\n | string\n | number\n | TinyColor\n | HSVA\n | HSV\n | RGB\n | RGBA\n | HSL\n | HSLA;\n }[] = [\n //rgb\n { name: 'RGB String', color: 'rgb(204, 51, 204)' },\n { name: 'RGB', color: { r: 204, g: 51, b: 204, a: 1 } },\n //prgb\n { name: 'PRGB String', color: 'rgb(80%, 20%, 80%)' },\n { name: 'PRGB', color: { r: '80%', g: '20%', b: '80%', a: 1 } },\n // hex\n { name: 'Hex', color: 'cc33cc' },\n { name: 'Hex String', color: '#cc33cc' },\n // hex8\n { name: 'Hex8', color: 'cc33ccff' },\n { name: 'Hex8 String', color: '#cc33ccff' },\n // name\n { name: 'string', color: 'red' },\n // hsl\n { name: 'HSL String', color: 'hsl(300, 60%, 50%)' },\n { name: 'HSL', color: { h: 300, s: 0.6000000000000001, l: 0.5, a: 1 } },\n // hsv\n { name: 'HSV String', color: 'hsv(300, 75%, 100%)' },\n { name: 'HSV', color: { h: 300, s: 0.75, v: 1, a: 1 } },\n ];\n colorFormats.map((format) => {\n it(`maintains \\`color\\` format as ${format.name}`, async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n el.color = format.color;\n if (format.name.startsWith('Hex')) {\n expect(el.color).to.equal(format.color);\n } else expect(el.color).to.deep.equal(format.color);\n });\n });\n it(`maintains \\`color\\` format as TinyColor`, async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n const color = new TinyColor('rgb(204, 51, 204)');\n el.color = color;\n expect(color.equals(el.color));\n });\n it(`maintains hue value`, async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n const hue = 300;\n const hsl = `hsl(${hue}, 60%, 100%)`;\n el.color = hsl;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsl);\n\n const hsla = `hsla(${hue}, 60%, 100%, 0.9)`;\n el.color = hsla;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsla);\n\n const hsv = `hsv(${hue}, 60%, 100%)`;\n el.color = hsv;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsv);\n\n const hsva = `hsva(${hue}, 60%, 100%, 0.9)`;\n el.color = hsva;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsva);\n\n const tinyHSV = new TinyColor({ h: hue, s: 60, v: 100 });\n el.color = tinyHSV;\n expect(el.value).to.equal(hue);\n expect(tinyHSV.equals(el.color)).to.be.true;\n\n const tinyHSVA = new TinyColor({ h: hue, s: 60, v: 100, a: 1 });\n el.color = tinyHSVA;\n expect(el.value).to.equal(hue);\n expect(tinyHSVA.equals(el.color)).to.be.true;\n\n const tinyHSL = new TinyColor({ h: hue, s: 60, l: 100 });\n el.color = tinyHSL;\n expect(el.value).to.equal(hue);\n expect(tinyHSL.equals(el.color)).to.be.true;\n\n const tinyHSLA = new TinyColor({ h: hue, s: 60, l: 100, a: 1 });\n el.color = tinyHSLA;\n expect(el.value).to.equal(hue);\n expect(tinyHSLA.equals(el.color)).to.be.true;\n });\n});\n"],
5
- "mappings": "AAYA,qFACA,2PAYA,+DAEA,4CACA,qDACA,4BAEA,SAAS,aAAc,IAAM,CACzB,EACI,SACI,KAAM,GACF;AAAA;AAAA,iBAGJ,CACR,EACA,GAAG,uCAAwC,SAAY,CACnD,KAAM,GAAK,KAAM,GACb;AAAA;AAAA,aAGJ,EAEA,KAAM,GAAe,CAAE,EAEvB,KAAM,GAAO,CAAE,EAAE,GAAG,GAAG,WAAW,CACtC,CAAC,EAED,GAAG,4BAA6B,SAAY,CACxC,KAAM,GAAO,KAAM,GACf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAOJ,EACM,EAAK,EAAK,cAAc,gBAAgB,EACxC,EAAS,EAAK,cAChB,sBACJ,EACM,EAAS,EAAK,cAChB,sBACJ,EAEA,KAAM,GAAe,CAAE,EAEvB,EAAO,MAAM,EAEb,EAAO,SAAS,aAAa,EAAE,GAAG,MAAM,CAAM,EAE9C,KAAM,GAAS,CACX,MAAO,KACX,CAAC,EAED,EAAO,SAA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,EAAG,KAAK,EAAE,GAAG,MAAM,CAAG,EAC7B,EAAO,EAAG,KAAK,EAAE,GAAG,MAAM,CAAG,EAE7B,KAAM,GAAO,QAAQ,qBACrB,EAAG,MAAQ,EACX,EAAO,EAAG,KAAK,EAAE,GAAG,MAAM,CAAG,EAC7B,EAAO,EAAG,KAAK,EAAE,GAAG,MAAM,CAAI,EAE9B,KAAM,GAAU,GAAI,GAAU,CAAE,EAAG,EAAK,EAAG,GAAI,EAAG,GAAI,CAAC,EACvD,EAAG,MAAQ,EACX,EAAO,EAAG,KAAK,EAAE,GAAG,MAAM,CAAG,EAC7B,EAAO,EAAQ,OAAO,EAAG,KAAK,CAAC,EAAE,GAAG,GAAG,KAEvC,KAAM,GAAW,GAAI,GAAU,CAAE,EAAG,EAAK,EAAG,GAAI,EAAG,IAAK,EAAG,CAAE,CAAC,EAC9D,EAAG,MAAQ,EACX,EAAO,EAAG,KAAK,EAAE,GAAG,MAAM,CAAG,EAC7B,EAAO,EAAS,OAAO,EAAG,KAAK,CAAC,EAAE,GAAG,GAAG,KAExC,KAAM,GAAU,GAAI,GAAU,CAAE,EAAG,EAAK,EAAG,GAAI,EAAG,GAAI,CAAC,EACvD,EAAG,MAAQ,EACX,EAAO,EAAG,KAAK,EAAE,GAAG,MAAM,CAAG,EAC7B,EAAO,EAAQ,OAAO,EAAG,KAAK,CAAC,EAAE,GAAG,GAAG,KAEvC,KAAM,GAAW,GAAI,GAAU,CAAE,EAAG,EAAK,EAAG,GAAI,EAAG,IAAK,EAAG,CAAE,CAAC,EAC9D,EAAG,MAAQ,EACX,EAAO,EAAG,KAAK,EAAE,GAAG,MAAM,CAAG,EAC7B,EAAO,EAAS,OAAO,EAAG,KAAK,CAAC,EAAE,GAAG,GAAG,IAC5C,CAAC,CACL,CAAC",
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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';\nimport {\n arrowDownEvent,\n arrowDownKeyupEvent,\n arrowLeftEvent,\n arrowLeftKeyupEvent,\n arrowRightEvent,\n arrowRightKeyupEvent,\n arrowUpEvent,\n arrowUpKeyupEvent,\n testForLitDevWarnings,\n} from '../../../test/testing-helpers.js';\n\nimport '@spectrum-web-components/color-wheel/sp-color-wheel.js';\nimport { ColorWheel } from '@spectrum-web-components/color-wheel';\nimport { HSL, HSLA, HSV, HSVA, RGB, RGBA, TinyColor } from '@ctrl/tinycolor';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { sendMouse } from '../../../test/plugins/browser.js';\nimport { spy } from 'sinon';\n\ndescribe('ColorWheel', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n )\n );\n it('loads default color-wheel accessibly', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n\n it('manages a single tab stop', async () => {\n const test = await fixture<HTMLDivElement>(\n html`\n <div>\n <input type=\"text\" id=\"test-input-1\" />\n <sp-color-wheel></sp-color-wheel>\n <input type=\"text\" id=\"test-input-2\" />\n </div>\n `\n );\n const el = test.querySelector('sp-color-wheel') as ColorWheel;\n const input1 = test.querySelector(\n 'input:nth-of-type(1)'\n ) as HTMLInputElement;\n const input2 = test.querySelector(\n 'input:nth-of-type(2)'\n ) as HTMLInputElement;\n\n await elementUpdated(el);\n\n input1.focus();\n\n expect(document.activeElement).to.equal(input1);\n\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(el);\n\n let value = el.value;\n await sendKeys({\n press: 'ArrowRight',\n });\n expect(el.value).to.not.equal(value);\n await sendKeys({\n press: 'Tab',\n });\n\n expect(document.activeElement).to.equal(input2);\n\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(el);\n\n value = el.value;\n await sendKeys({\n press: 'ArrowDown',\n });\n expect(el.value).to.not.equal(value);\n await sendKeys({\n press: 'Shift+Tab',\n });\n\n expect(document.activeElement).to.equal(input1);\n });\n it('manages [focused]', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n el.dispatchEvent(new FocusEvent('focusin'));\n await elementUpdated(el);\n\n expect(el.focused).to.be.true;\n\n el.dispatchEvent(new FocusEvent('focusout'));\n await elementUpdated(el);\n\n expect(el.focused).to.be.false;\n });\n it('dispatches input and change events in response to \"Arrow*\" keypresses', async () => {\n const inputSpy = spy();\n const changeSpy = spy();\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n el.focus();\n\n await sendKeys({ press: 'ArrowRight' });\n expect(inputSpy.callCount).to.equal(1);\n expect(changeSpy.callCount).to.equal(1);\n\n await sendKeys({ press: 'ArrowLeft' });\n expect(inputSpy.callCount).to.equal(2);\n expect(changeSpy.callCount).to.equal(2);\n\n await sendKeys({ press: 'ArrowUp' });\n expect(inputSpy.callCount).to.equal(3);\n expect(changeSpy.callCount).to.equal(3);\n\n await sendKeys({ press: 'ArrowDown' });\n expect(inputSpy.callCount).to.equal(4);\n expect(changeSpy.callCount).to.equal(4);\n });\n it('responds to events on the internal input element', async () => {\n // screen reader interactions dispatch events as found in the following test\n const inputSpy = spy();\n const changeSpy = spy();\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n const input = el.focusElement;\n\n el.focus();\n\n input.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n input.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: false, // native change events do not compose themselves by default\n })\n );\n\n expect(inputSpy.callCount).to.equal(1);\n expect(changeSpy.callCount).to.equal(1);\n });\n it('accepts \"Arrow*\" keypresses', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n\n const input = el.focusElement;\n\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(4);\n\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n });\n it('accepts \"Arrow*\" keypresses in dir=\"rtl\"', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel dir=\"rtl\"></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n\n const input = el.focusElement;\n\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n input.dispatchEvent(arrowUpEvent());\n input.dispatchEvent(arrowUpKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n input.dispatchEvent(arrowRightEvent());\n input.dispatchEvent(arrowRightKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n input.dispatchEvent(arrowLeftEvent());\n input.dispatchEvent(arrowLeftKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(2);\n\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n input.dispatchEvent(arrowDownEvent());\n input.dispatchEvent(arrowDownKeyupEvent());\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n });\n it('accepts \"Arrow*\" keypresses with alteration', async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n el.focus();\n expect(el.value).to.equal(0);\n\n await sendKeys({\n down: 'Shift',\n });\n await sendKeys({\n press: 'ArrowUp',\n });\n await sendKeys({\n press: 'ArrowUp',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(20);\n\n await sendKeys({\n press: 'ArrowRight',\n });\n await sendKeys({\n press: 'ArrowRight',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(40);\n\n await sendKeys({\n press: 'ArrowDown',\n });\n await sendKeys({\n press: 'ArrowDown',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(20);\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n await sendKeys({\n press: 'ArrowLeft',\n });\n await sendKeys({\n up: 'Shift',\n });\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n });\n it('accepts pointer events', async () => {\n const color = new TinyColor({ h: '0', s: '20%', l: '70%' });\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel\n .color=${color}\n style=\"--spectrum-global-dimension-size-125: 10px;\"\n ></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n const { handle } = el as unknown as { handle: HTMLElement };\n\n handle.setPointerCapture = () => {\n return;\n };\n handle.releasePointerCapture = () => {\n return;\n };\n\n expect(el.value).to.equal(0);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n handle.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 1,\n pointerId: 1,\n clientX: 80,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const gradient = root.querySelector('[name=\"gradient\"]') as HTMLElement;\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 1,\n pointerId: 1,\n clientX: 80,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n pointerId: 1,\n clientX: 80,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(263.74596725608353);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n\n handle.dispatchEvent(\n new PointerEvent('pointermove', {\n pointerId: 1,\n clientX: 80,\n clientY: 160,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n handle.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n clientX: 80,\n clientY: 160,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(96.34019174590992);\n expect((el.color as HSLA).s).to.be.within(0.19, 0.21);\n expect((el.color as HSLA).l).to.be.within(0.69, 0.71);\n });\n it('can have `change` events prevented', async () => {\n const color = new TinyColor({ h: '0', s: '20%', l: '70%' });\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel\n .color=${color}\n @change=${(event: Event) => {\n event?.preventDefault();\n }}\n style=\"--spectrum-global-dimension-size-125: 10px;\"\n ></sp-color-wheel>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.value).to.equal(0);\n\n await sendMouse({\n steps: [\n {\n type: 'move',\n position: [80, 15],\n },\n {\n type: 'down',\n },\n {\n type: 'move',\n position: [80, 160],\n },\n ],\n });\n\n await elementUpdated(el);\n\n await sendMouse({\n steps: [\n {\n type: 'up',\n },\n ],\n });\n\n await elementUpdated(el);\n expect(el.value).to.equal(0);\n });\n const colorFormats: {\n name: string;\n color:\n | string\n | number\n | TinyColor\n | HSVA\n | HSV\n | RGB\n | RGBA\n | HSL\n | HSLA;\n }[] = [\n //rgb\n { name: 'RGB String', color: 'rgb(204, 51, 204)' },\n { name: 'RGB', color: { r: 204, g: 51, b: 204, a: 1 } },\n //prgb\n { name: 'PRGB String', color: 'rgb(80%, 20%, 80%)' },\n { name: 'PRGB', color: { r: '80%', g: '20%', b: '80%', a: 1 } },\n // hex\n { name: 'Hex', color: 'cc33cc' },\n { name: 'Hex String', color: '#cc33cc' },\n // hex8\n { name: 'Hex8', color: 'cc33ccff' },\n { name: 'Hex8 String', color: '#cc33ccff' },\n // name\n { name: 'string', color: 'red' },\n // hsl\n { name: 'HSL String', color: 'hsl(300, 60%, 50%)' },\n { name: 'HSL', color: { h: 300, s: 0.6000000000000001, l: 0.5, a: 1 } },\n // hsv\n { name: 'HSV String', color: 'hsv(300, 75%, 100%)' },\n { name: 'HSV', color: { h: 300, s: 0.75, v: 1, a: 1 } },\n ];\n colorFormats.map((format) => {\n it(`maintains \\`color\\` format as ${format.name}`, async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n\n el.color = format.color;\n if (format.name.startsWith('Hex')) {\n expect(el.color).to.equal(format.color);\n } else expect(el.color).to.deep.equal(format.color);\n });\n });\n it(`maintains \\`color\\` format as TinyColor`, async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n const color = new TinyColor('rgb(204, 51, 204)');\n el.color = color;\n expect(color.equals(el.color));\n });\n it(`maintains hue value`, async () => {\n const el = await fixture<ColorWheel>(\n html`\n <sp-color-wheel></sp-color-wheel>\n `\n );\n const hue = 300;\n const hsl = `hsl(${hue}, 60%, 100%)`;\n el.color = hsl;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsl);\n\n const hsla = `hsla(${hue}, 60%, 100%, 0.9)`;\n el.color = hsla;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsla);\n\n const hsv = `hsv(${hue}, 60%, 100%)`;\n el.color = hsv;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsv);\n\n const hsva = `hsva(${hue}, 60%, 100%, 0.9)`;\n el.color = hsva;\n expect(el.value).to.equal(hue);\n expect(el.color).to.equal(hsva);\n\n const tinyHSV = new TinyColor({ h: hue, s: 60, v: 100 });\n el.color = tinyHSV;\n expect(el.value).to.equal(hue);\n expect(tinyHSV.equals(el.color)).to.be.true;\n\n const tinyHSVA = new TinyColor({ h: hue, s: 60, v: 100, a: 1 });\n el.color = tinyHSVA;\n expect(el.value).to.equal(hue);\n expect(tinyHSVA.equals(el.color)).to.be.true;\n\n const tinyHSL = new TinyColor({ h: hue, s: 60, l: 100 });\n el.color = tinyHSL;\n expect(el.value).to.equal(hue);\n expect(tinyHSL.equals(el.color)).to.be.true;\n\n const tinyHSLA = new TinyColor({ h: hue, s: 60, l: 100, a: 1 });\n el.color = tinyHSLA;\n expect(el.value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