@spectrum-web-components/color-slider 0.3.6 → 0.3.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/color-slider",
3
- "version": "0.3.6",
3
+ "version": "0.3.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -45,18 +45,18 @@
45
45
  ],
46
46
  "dependencies": {
47
47
  "@ctrl/tinycolor": "^3.3.3",
48
- "@spectrum-web-components/base": "^0.5.4",
49
- "@spectrum-web-components/color-handle": "^0.3.5",
50
- "@spectrum-web-components/shared": "^0.13.6",
48
+ "@spectrum-web-components/base": "^0.5.6",
49
+ "@spectrum-web-components/color-handle": "^0.3.7",
50
+ "@spectrum-web-components/shared": "^0.14.1",
51
51
  "tslib": "^2.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@spectrum-css/colorslider": "^2.0.0"
54
+ "@spectrum-css/colorslider": "^2.0.6"
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": "caf12727e7f91dcf961e1fadacc727eea9ece27b"
61
+ "gitHead": "32e049a0da090ffc1a54cfe3234be4d5efc73339"
62
62
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020 Adobe. All rights reserved.
2
+ Copyright 2022 Adobe. All rights reserved.
3
3
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License. You may obtain a copy
5
5
  of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"color-slider.css.js","sourceRoot":"","sources":["color-slider.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-colorslider-handle-hitarea-border-radius:0%;--spectrum-colorslider-handle-hitarea-width:var(\n--spectrum-global-dimension-size-300\n);--spectrum-colorslider-handle-hitarea-height:var(\n--spectrum-global-dimension-size-300\n)}:host([focused]) .handle{height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}.slider{height:100%;left:0;margin:0;opacity:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:0}:host{cursor:default;display:block;height:var(\n--spectrum-colorslider-height,var(--spectrum-global-dimension-size-300)\n);position:relative;-webkit-user-select:none;user-select:none;width:var(\n--spectrum-colorslider-default-length,var(--spectrum-global-dimension-size-2400)\n)}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([vertical]){display:inline-block;height:var(\n--spectrum-colorslider-vertical-default-length,var(--spectrum-global-dimension-size-2400)\n);width:var(\n--spectrum-colorslider-vertical-width,var(--spectrum-global-dimension-size-300)\n)}:host([vertical]) .handle{left:50%;top:0}.handle{left:0;top:50%}.handle:after{border-radius:var(\n--spectrum-colorslider-handle-hitarea-border-radius\n);height:var(--spectrum-colorslider-handle-hitarea-height);width:var(--spectrum-colorslider-handle-hitarea-width)}.checkerboard{background-position:0 0,0 var(--spectrum-global-dimension-static-size-100,8px),var(--spectrum-global-dimension-static-size-100,8px) calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1),calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(\n--spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)\n)}.checkerboard{background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%)}.checkerboard:before{box-shadow:inset 0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color,var(--spectrum-alias-border-color-translucent)\n)}:host([disabled]) .checkerboard{background:var(\n--spectrum-colorslider-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .checkerboard:before{box-shadow:0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .gradient{display:none}@media (forced-colors:active){:host{--spectrum-colorslider-border-color-disabled:GrayText;--spectrum-colorslider-fill-color-disabled:Canvas}:host{forced-color-adjust:none}}:host{--sp-color-slider-gradient-fallback:red 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%;touch-action:none}:host(:focus){outline:none}.gradient{overflow:hidden}::slotted(*){height:100%;width:100%}\n`;\nexport default styles;"]}
1
+ {"version":3,"file":"color-slider.css.js","sourceRoot":"","sources":["color-slider.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDjB,CAAC;AACF,eAAe,MAAM,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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-colorslider-handle-hitarea-border-radius:0%;--spectrum-colorslider-handle-hitarea-width:var(\n--spectrum-global-dimension-size-300\n);--spectrum-colorslider-handle-hitarea-height:var(\n--spectrum-global-dimension-size-300\n)}:host([focused]) .handle{height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}.slider{height:100%;left:0;margin:0;opacity:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:0}:host{cursor:default;display:block;height:var(\n--spectrum-colorslider-height,var(--spectrum-global-dimension-size-300)\n);position:relative;-webkit-user-select:none;user-select:none;width:var(\n--spectrum-colorslider-default-length,var(--spectrum-global-dimension-size-2400)\n)}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([vertical]){display:inline-block;height:var(\n--spectrum-colorslider-vertical-default-length,var(--spectrum-global-dimension-size-2400)\n);width:var(\n--spectrum-colorslider-vertical-width,var(--spectrum-global-dimension-size-300)\n)}:host([vertical]) .handle{left:50%;top:0}.handle{left:0;top:50%}.handle:after{border-radius:var(\n--spectrum-colorslider-handle-hitarea-border-radius\n);height:var(--spectrum-colorslider-handle-hitarea-height);width:var(--spectrum-colorslider-handle-hitarea-width)}.checkerboard{background-position:0 0,0 var(--spectrum-global-dimension-static-size-100,8px),var(--spectrum-global-dimension-static-size-100,8px) calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1),calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(\n--spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)\n)}.checkerboard{background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%)}.checkerboard:before{box-shadow:inset 0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color,var(--spectrum-alias-border-color-translucent)\n)}:host([disabled]) .checkerboard{background:var(\n--spectrum-colorslider-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .checkerboard:before{box-shadow:0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .gradient{display:none}@media (forced-colors:active){:host{--spectrum-colorslider-border-color-disabled:GrayText;--spectrum-colorslider-fill-color-disabled:Canvas}:host{forced-color-adjust:none}}:host{--sp-color-slider-gradient-fallback:red 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%;touch-action:none}:host(:focus){outline:none}.gradient{overflow:hidden}::slotted(*){height:100%;width:100%}\n`;\nexport default styles;"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020 Adobe. All rights reserved.
2
+ Copyright 2022 Adobe. All rights reserved.
3
3
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License. You may obtain a copy
5
5
  of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -1 +1 @@
1
- {"version":3,"file":"spectrum-color-slider.css.js","sourceRoot":"","sources":["spectrum-color-slider.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-colorslider-handle-hitarea-border-radius:0%;--spectrum-colorslider-handle-hitarea-width:var(\n--spectrum-global-dimension-size-300\n);--spectrum-colorslider-handle-hitarea-height:var(\n--spectrum-global-dimension-size-300\n)}:host([focused]) .handle{height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}.slider{height:100%;left:0;margin:0;opacity:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:0}:host{cursor:default;display:block;height:var(\n--spectrum-colorslider-height,var(--spectrum-global-dimension-size-300)\n);position:relative;-webkit-user-select:none;user-select:none;width:var(\n--spectrum-colorslider-default-length,var(--spectrum-global-dimension-size-2400)\n)}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([vertical]){display:inline-block;height:var(\n--spectrum-colorslider-vertical-default-length,var(--spectrum-global-dimension-size-2400)\n);width:var(\n--spectrum-colorslider-vertical-width,var(--spectrum-global-dimension-size-300)\n)}:host([vertical]) .handle{left:50%;top:0}.handle{left:0;top:50%}.handle:after{border-radius:var(\n--spectrum-colorslider-handle-hitarea-border-radius\n);height:var(--spectrum-colorslider-handle-hitarea-height);width:var(--spectrum-colorslider-handle-hitarea-width)}.checkerboard{background-position:0 0,0 var(--spectrum-global-dimension-static-size-100,8px),var(--spectrum-global-dimension-static-size-100,8px) calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1),calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(\n--spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)\n)}.checkerboard{background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%)}.checkerboard:before{box-shadow:inset 0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color,var(--spectrum-alias-border-color-translucent)\n)}:host([disabled]) .checkerboard{background:var(\n--spectrum-colorslider-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .checkerboard:before{box-shadow:0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .gradient{display:none}@media (forced-colors:active){:host{--spectrum-colorslider-border-color-disabled:GrayText;--spectrum-colorslider-fill-color-disabled:Canvas}:host{forced-color-adjust:none}}\n`;\nexport default styles;"]}
1
+ {"version":3,"file":"spectrum-color-slider.css.js","sourceRoot":"","sources":["spectrum-color-slider.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDjB,CAAC;AACF,eAAe,MAAM,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 { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{--spectrum-colorslider-handle-hitarea-border-radius:0%;--spectrum-colorslider-handle-hitarea-width:var(\n--spectrum-global-dimension-size-300\n);--spectrum-colorslider-handle-hitarea-height:var(\n--spectrum-global-dimension-size-300\n)}:host([focused]) .handle{height:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2);margin-left:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);margin-top:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*-1);width:calc(var(\n--spectrum-colorhandle-size,\nvar(--spectrum-global-dimension-size-200)\n)*2)}.slider{height:100%;left:0;margin:0;opacity:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:0}:host{cursor:default;display:block;height:var(\n--spectrum-colorslider-height,var(--spectrum-global-dimension-size-300)\n);position:relative;-webkit-user-select:none;user-select:none;width:var(\n--spectrum-colorslider-default-length,var(--spectrum-global-dimension-size-2400)\n)}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([vertical]){display:inline-block;height:var(\n--spectrum-colorslider-vertical-default-length,var(--spectrum-global-dimension-size-2400)\n);width:var(\n--spectrum-colorslider-vertical-width,var(--spectrum-global-dimension-size-300)\n)}:host([vertical]) .handle{left:50%;top:0}.handle{left:0;top:50%}.handle:after{border-radius:var(\n--spectrum-colorslider-handle-hitarea-border-radius\n);height:var(--spectrum-colorslider-handle-hitarea-height);width:var(--spectrum-colorslider-handle-hitarea-width)}.checkerboard{background-position:0 0,0 var(--spectrum-global-dimension-static-size-100,8px),var(--spectrum-global-dimension-static-size-100,8px) calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1),calc(var(--spectrum-global-dimension-static-size-100, 8px)*-1) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n);height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(\n--spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)\n)}.checkerboard{background-color:var(\n--spectrum-colorcontrol-checkerboard-light-color,var(--spectrum-global-color-static-white)\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(45deg,transparent 75.5%,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 75.5%),linear-gradient(-45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%),linear-gradient(45deg,var(\n--spectrum-colorcontrol-checkerboard-dark-color,var(--spectrum-global-color-static-gray-300)\n) 25.5%,transparent 25.5%)}.checkerboard:before{box-shadow:inset 0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color,var(--spectrum-alias-border-color-translucent)\n)}:host([disabled]) .checkerboard{background:var(\n--spectrum-colorslider-fill-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .checkerboard:before{box-shadow:0 0 0 var(\n--spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)\n) var(\n--spectrum-colorslider-border-color-disabled,var(--spectrum-alias-track-color-disabled)\n)}:host([disabled]) .gradient{display:none}@media (forced-colors:active){:host{--spectrum-colorslider-border-color-disabled:GrayText;--spectrum-colorslider-fill-color-disabled:Canvas}:host{forced-color-adjust:none}}\n`;\nexport default styles;"]}
@@ -0,0 +1,18 @@
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 '@spectrum-web-components/color-slider/sp-color-slider.js';
13
+ import { html } from 'lit';
14
+ import { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';
15
+ measureFixtureCreation(html `
16
+ <sp-color-slider></sp-color-slider>
17
+ `);
18
+ //# sourceMappingURL=basic-test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basic-test.js","sourceRoot":"","sources":["basic-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,0DAA0D,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,sBAAsB,CAAC,IAAI,CAAA;;CAE1B,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 '@spectrum-web-components/color-slider/sp-color-slider.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-color-slider></sp-color-slider>\n`);\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/color-slider.stories.js';
13
+ import { regressVisuals } from '../../../test/visual/test.js';
14
+ regressVisuals('ColorSliderStories', stories);
15
+ //# sourceMappingURL=color-slider.test-vrt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-slider.test-vrt.js","sourceRoot":"","sources":["color-slider.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/color-slider.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\n\nregressVisuals('ColorSliderStories', stories);\n"]}
@@ -0,0 +1,513 @@
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 { elementUpdated, expect, fixture, html } from '@open-wc/testing';
13
+ import { arrowDownEvent, arrowDownKeyupEvent, arrowLeftEvent, arrowLeftKeyupEvent, arrowRightEvent, arrowRightKeyupEvent, arrowUpEvent, arrowUpKeyupEvent, } from '../../../test/testing-helpers.js';
14
+ import '../sp-color-slider.js';
15
+ import { TinyColor } from '@ctrl/tinycolor';
16
+ import { sendKeys } from '@web/test-runner-commands';
17
+ import { spy } from 'sinon';
18
+ describe('ColorSlider', () => {
19
+ it('loads default color-slider accessibly', async () => {
20
+ const el = await fixture(html `
21
+ <sp-color-slider></sp-color-slider>
22
+ `);
23
+ await elementUpdated(el);
24
+ await expect(el).to.be.accessible();
25
+ });
26
+ it('manages a single tab stop', async () => {
27
+ const test = await fixture(html `
28
+ <div>
29
+ <input type="text" id="test-input-1" />
30
+ <sp-color-slider></sp-color-slider>
31
+ <input type="text" id="test-input-2" />
32
+ </div>
33
+ `);
34
+ const el = test.querySelector('sp-color-slider');
35
+ const input1 = test.querySelector('input:nth-of-type(1)');
36
+ const input2 = test.querySelector('input:nth-of-type(2)');
37
+ await elementUpdated(el);
38
+ input1.focus();
39
+ expect(document.activeElement).to.equal(input1);
40
+ await sendKeys({
41
+ press: 'Tab',
42
+ });
43
+ expect(document.activeElement).to.equal(el);
44
+ let value = el.value;
45
+ await sendKeys({
46
+ press: 'ArrowRight',
47
+ });
48
+ expect(el.value).to.not.equal(value);
49
+ await sendKeys({
50
+ press: 'Tab',
51
+ });
52
+ expect(document.activeElement).to.equal(input2);
53
+ await sendKeys({
54
+ press: 'Shift+Tab',
55
+ });
56
+ expect(document.activeElement).to.equal(el);
57
+ value = el.value;
58
+ await sendKeys({
59
+ press: 'ArrowDown',
60
+ });
61
+ expect(el.value).to.not.equal(value);
62
+ await sendKeys({
63
+ press: 'Shift+Tab',
64
+ });
65
+ expect(document.activeElement).to.equal(input1);
66
+ });
67
+ it('manages [focused]', async () => {
68
+ const el = await fixture(html `
69
+ <sp-color-slider></sp-color-slider>
70
+ `);
71
+ await elementUpdated(el);
72
+ el.dispatchEvent(new FocusEvent('focusin'));
73
+ await elementUpdated(el);
74
+ expect(el.focused).to.be.true;
75
+ el.dispatchEvent(new FocusEvent('focusout'));
76
+ await elementUpdated(el);
77
+ expect(el.focused).to.be.false;
78
+ });
79
+ it('dispatches input and change events in response to "Arrow*" keypresses', async () => {
80
+ const inputSpy = spy();
81
+ const changeSpy = spy();
82
+ const el = await fixture(html `
83
+ <sp-color-slider
84
+ @change=${() => changeSpy()}
85
+ @input=${() => inputSpy()}
86
+ ></sp-color-slider>
87
+ `);
88
+ await elementUpdated(el);
89
+ el.focus();
90
+ await sendKeys({ press: 'ArrowRight' });
91
+ expect(inputSpy.callCount).to.equal(1);
92
+ expect(changeSpy.callCount).to.equal(1);
93
+ await sendKeys({ press: 'ArrowLeft' });
94
+ expect(inputSpy.callCount).to.equal(2);
95
+ expect(changeSpy.callCount).to.equal(2);
96
+ await sendKeys({ press: 'ArrowUp' });
97
+ expect(inputSpy.callCount).to.equal(3);
98
+ expect(changeSpy.callCount).to.equal(3);
99
+ await sendKeys({ press: 'ArrowDown' });
100
+ expect(inputSpy.callCount).to.equal(4);
101
+ expect(changeSpy.callCount).to.equal(4);
102
+ });
103
+ it('responds to events on the internal input element', async () => {
104
+ // screen reader interactions dispatch events as found in the following test
105
+ const inputSpy = spy();
106
+ const changeSpy = spy();
107
+ const el = await fixture(html `
108
+ <sp-color-slider
109
+ @change=${() => changeSpy()}
110
+ @input=${() => inputSpy()}
111
+ ></sp-color-slider>
112
+ `);
113
+ await elementUpdated(el);
114
+ el.focus();
115
+ el.focusElement.dispatchEvent(new Event('input', {
116
+ bubbles: true,
117
+ composed: true,
118
+ }));
119
+ el.focusElement.dispatchEvent(new Event('change', {
120
+ bubbles: true,
121
+ composed: false, // native change events do not compose themselves by default
122
+ }));
123
+ expect(inputSpy.callCount).to.equal(1);
124
+ expect(changeSpy.callCount).to.equal(1);
125
+ });
126
+ it('manages value on "Arrow*" keypresses', async () => {
127
+ const el = await fixture(html `
128
+ <sp-color-slider
129
+ style="--spectrum-colorslider-default-length: 192px; --spectrum-colorslider-default-height: 24px; --spectrum-colorslider-default-height: 24px;"
130
+ ></sp-color-slider>
131
+ `);
132
+ await elementUpdated(el);
133
+ expect(el.sliderHandlePosition).to.equal(0);
134
+ const input = el.focusElement;
135
+ input.dispatchEvent(arrowUpEvent());
136
+ input.dispatchEvent(arrowUpKeyupEvent());
137
+ input.dispatchEvent(arrowUpEvent());
138
+ input.dispatchEvent(arrowUpKeyupEvent());
139
+ await elementUpdated(el);
140
+ expect(el.sliderHandlePosition).to.equal(2);
141
+ input.dispatchEvent(arrowRightEvent());
142
+ input.dispatchEvent(arrowRightKeyupEvent());
143
+ input.dispatchEvent(arrowRightEvent());
144
+ input.dispatchEvent(arrowRightKeyupEvent());
145
+ await elementUpdated(el);
146
+ expect(el.sliderHandlePosition).to.equal(3.9999999999999996);
147
+ input.dispatchEvent(arrowDownEvent());
148
+ input.dispatchEvent(arrowDownKeyupEvent());
149
+ input.dispatchEvent(arrowDownEvent());
150
+ input.dispatchEvent(arrowDownKeyupEvent());
151
+ await elementUpdated(el);
152
+ expect(el.sliderHandlePosition).to.equal(1.9999999999999998);
153
+ input.dispatchEvent(arrowLeftEvent());
154
+ input.dispatchEvent(arrowLeftKeyupEvent());
155
+ input.dispatchEvent(arrowLeftEvent());
156
+ input.dispatchEvent(arrowLeftKeyupEvent());
157
+ await elementUpdated(el);
158
+ expect(el.sliderHandlePosition).to.equal(0);
159
+ });
160
+ it('accepts "Arrow*" keypresses in dir="rtl"', async () => {
161
+ const el = await fixture(html `
162
+ <sp-color-slider dir="rtl"></sp-color-slider>
163
+ `);
164
+ await elementUpdated(el);
165
+ expect(el.sliderHandlePosition).to.equal(0);
166
+ const input = el.focusElement;
167
+ input.dispatchEvent(arrowUpEvent());
168
+ input.dispatchEvent(arrowUpKeyupEvent());
169
+ input.dispatchEvent(arrowUpEvent());
170
+ input.dispatchEvent(arrowUpKeyupEvent());
171
+ await elementUpdated(el);
172
+ expect(el.sliderHandlePosition).to.equal(2);
173
+ input.dispatchEvent(arrowRightEvent());
174
+ input.dispatchEvent(arrowRightKeyupEvent());
175
+ input.dispatchEvent(arrowRightEvent());
176
+ input.dispatchEvent(arrowRightKeyupEvent());
177
+ await elementUpdated(el);
178
+ expect(el.sliderHandlePosition).to.equal(0);
179
+ input.dispatchEvent(arrowLeftEvent());
180
+ input.dispatchEvent(arrowLeftKeyupEvent());
181
+ input.dispatchEvent(arrowLeftEvent());
182
+ input.dispatchEvent(arrowLeftKeyupEvent());
183
+ await elementUpdated(el);
184
+ expect(el.sliderHandlePosition).to.equal(2);
185
+ input.dispatchEvent(arrowDownEvent());
186
+ input.dispatchEvent(arrowDownKeyupEvent());
187
+ input.dispatchEvent(arrowDownEvent());
188
+ input.dispatchEvent(arrowDownKeyupEvent());
189
+ await elementUpdated(el);
190
+ expect(el.sliderHandlePosition).to.equal(0);
191
+ });
192
+ it('accepts "Arrow*" keypresses with alteration', async () => {
193
+ const el = await fixture(html `
194
+ <sp-color-slider></sp-color-slider>
195
+ `);
196
+ await elementUpdated(el);
197
+ el.focus();
198
+ expect(el.sliderHandlePosition).to.equal(0);
199
+ await sendKeys({
200
+ down: 'Shift',
201
+ });
202
+ await sendKeys({
203
+ press: 'ArrowUp',
204
+ });
205
+ await sendKeys({
206
+ press: 'ArrowUp',
207
+ });
208
+ await elementUpdated(el);
209
+ expect(el.sliderHandlePosition).to.equal(20);
210
+ await sendKeys({
211
+ press: 'ArrowRight',
212
+ });
213
+ await sendKeys({
214
+ press: 'ArrowRight',
215
+ });
216
+ await elementUpdated(el);
217
+ expect(el.sliderHandlePosition).to.equal(40);
218
+ await sendKeys({
219
+ press: 'ArrowDown',
220
+ });
221
+ await sendKeys({
222
+ press: 'ArrowDown',
223
+ });
224
+ await elementUpdated(el);
225
+ expect(el.sliderHandlePosition).to.equal(20);
226
+ await sendKeys({
227
+ press: 'ArrowLeft',
228
+ });
229
+ await sendKeys({
230
+ press: 'ArrowLeft',
231
+ });
232
+ await sendKeys({
233
+ up: 'Shift',
234
+ });
235
+ await elementUpdated(el);
236
+ expect(el.sliderHandlePosition).to.equal(0);
237
+ });
238
+ it('accepts pointer events', async () => {
239
+ const color = new TinyColor({ h: '0', s: '20%', l: '70%' });
240
+ const el = await fixture(html `
241
+ <sp-color-slider
242
+ .color=${color}
243
+ style="--spectrum-colorslider-default-length: 192px; --spectrum-colorslider-default-height: 24px; --spectrum-colorslider-default-height: 24px;"
244
+ ></sp-color-slider>
245
+ `);
246
+ await elementUpdated(el);
247
+ const { handle } = el;
248
+ handle.setPointerCapture = () => {
249
+ return;
250
+ };
251
+ handle.releasePointerCapture = () => {
252
+ return;
253
+ };
254
+ expect(el.sliderHandlePosition).to.equal(0);
255
+ expect(el.color.s).to.be.within(0.19, 0.21);
256
+ expect(el.color.l).to.be.within(0.69, 0.71);
257
+ handle.dispatchEvent(new PointerEvent('pointerdown', {
258
+ button: 1,
259
+ pointerId: 1,
260
+ clientX: 100,
261
+ clientY: 15,
262
+ bubbles: true,
263
+ composed: true,
264
+ cancelable: true,
265
+ }));
266
+ await elementUpdated(el);
267
+ expect(el.sliderHandlePosition).to.equal(0);
268
+ expect(el.color.s).to.be.within(0.19, 0.21);
269
+ expect(el.color.l).to.be.within(0.69, 0.71);
270
+ const root = el.shadowRoot ? el.shadowRoot : el;
271
+ const gradient = root.querySelector('.gradient');
272
+ gradient.dispatchEvent(new PointerEvent('pointerdown', {
273
+ button: 1,
274
+ pointerId: 1,
275
+ clientX: 100,
276
+ clientY: 15,
277
+ bubbles: true,
278
+ composed: true,
279
+ cancelable: true,
280
+ }));
281
+ await elementUpdated(el);
282
+ expect(el.sliderHandlePosition).to.equal(0);
283
+ expect(el.color.s).to.be.within(0.19, 0.21);
284
+ expect(el.color.l).to.be.within(0.69, 0.71);
285
+ gradient.dispatchEvent(new PointerEvent('pointerdown', {
286
+ pointerId: 1,
287
+ clientX: 100,
288
+ clientY: 15,
289
+ bubbles: true,
290
+ composed: true,
291
+ cancelable: true,
292
+ }));
293
+ await elementUpdated(el);
294
+ expect(el.sliderHandlePosition).to.equal(47.91666666666667);
295
+ expect(el.color.s).to.be.within(0.19, 0.21);
296
+ expect(el.color.l).to.be.within(0.69, 0.71);
297
+ handle.dispatchEvent(new PointerEvent('pointermove', {
298
+ pointerId: 1,
299
+ clientX: 110,
300
+ clientY: 15,
301
+ bubbles: true,
302
+ composed: true,
303
+ cancelable: true,
304
+ }));
305
+ handle.dispatchEvent(new PointerEvent('pointerup', {
306
+ pointerId: 1,
307
+ clientX: 110,
308
+ clientY: 15,
309
+ bubbles: true,
310
+ composed: true,
311
+ cancelable: true,
312
+ }));
313
+ await elementUpdated(el);
314
+ expect(el.sliderHandlePosition).to.equal(53.125);
315
+ expect(el.color.s).to.be.within(0.19, 0.21);
316
+ expect(el.color.l).to.be.within(0.69, 0.71);
317
+ });
318
+ it('accepts pointer events while [vertical]', async () => {
319
+ const el = await fixture(html `
320
+ <sp-color-slider
321
+ vertical
322
+ style="--spectrum-colorslider-vertical-default-length: 192px; --spectrum-colorslider-vertical-width: 24px;"
323
+ ></sp-color-slider>
324
+ `);
325
+ await elementUpdated(el);
326
+ const { handle } = el;
327
+ handle.setPointerCapture = () => {
328
+ return;
329
+ };
330
+ handle.releasePointerCapture = () => {
331
+ return;
332
+ };
333
+ expect(el.sliderHandlePosition).to.equal(0);
334
+ const root = el.shadowRoot ? el.shadowRoot : el;
335
+ const gradient = root.querySelector('.gradient');
336
+ gradient.dispatchEvent(new PointerEvent('pointerdown', {
337
+ pointerId: 1,
338
+ clientX: 15,
339
+ clientY: 100,
340
+ bubbles: true,
341
+ composed: true,
342
+ cancelable: true,
343
+ }));
344
+ await elementUpdated(el);
345
+ expect(el.sliderHandlePosition).to.equal(47.91666666666667);
346
+ handle.dispatchEvent(new PointerEvent('pointermove', {
347
+ pointerId: 1,
348
+ clientX: 15,
349
+ clientY: 110,
350
+ bubbles: true,
351
+ composed: true,
352
+ cancelable: true,
353
+ }));
354
+ handle.dispatchEvent(new PointerEvent('pointerup', {
355
+ pointerId: 1,
356
+ clientX: 15,
357
+ clientY: 110,
358
+ bubbles: true,
359
+ composed: true,
360
+ cancelable: true,
361
+ }));
362
+ await elementUpdated(el);
363
+ expect(el.sliderHandlePosition).to.equal(53.125);
364
+ });
365
+ it('accepts pointer events in dir="rtl"', async () => {
366
+ document.documentElement.dir = 'rtl';
367
+ const el = await fixture(html `
368
+ <sp-color-slider
369
+ dir="rtl"
370
+ style="--spectrum-colorslider-default-length: 192px; --spectrum-colorslider-default-height: 24px; --spectrum-colorslider-height: 24px;"
371
+ ></sp-color-slider>
372
+ `);
373
+ await elementUpdated(el);
374
+ const { handle } = el;
375
+ const clientWidth = document.documentElement.offsetWidth;
376
+ handle.setPointerCapture = () => {
377
+ return;
378
+ };
379
+ handle.releasePointerCapture = () => {
380
+ return;
381
+ };
382
+ expect(el.sliderHandlePosition).to.equal(0);
383
+ const gradient = el.shadowRoot.querySelector('.gradient');
384
+ gradient.dispatchEvent(new PointerEvent('pointerdown', {
385
+ pointerId: 1,
386
+ clientX: 700,
387
+ clientY: 15,
388
+ bubbles: true,
389
+ composed: true,
390
+ cancelable: true,
391
+ }));
392
+ await elementUpdated(el);
393
+ expect(el.sliderHandlePosition).to.equal(52.083333333333336);
394
+ handle.dispatchEvent(new PointerEvent('pointermove', {
395
+ pointerId: 1,
396
+ clientX: clientWidth - 110,
397
+ clientY: 15,
398
+ bubbles: true,
399
+ composed: true,
400
+ cancelable: true,
401
+ }));
402
+ handle.dispatchEvent(new PointerEvent('pointerup', {
403
+ pointerId: 1,
404
+ clientX: clientWidth - 110,
405
+ clientY: 15,
406
+ bubbles: true,
407
+ composed: true,
408
+ cancelable: true,
409
+ }));
410
+ await elementUpdated(el);
411
+ expect(el.sliderHandlePosition).to.equal(46.875);
412
+ });
413
+ const colorFormats = [
414
+ //rgb
415
+ { name: 'RGB String', color: 'rgb(204, 51, 204)' },
416
+ { name: 'RGB', color: { r: 204, g: 51, b: 204, a: 1 } },
417
+ //prgb
418
+ { name: 'PRGB String', color: 'rgb(80%, 20%, 80%)' },
419
+ { name: 'PRGB', color: { r: '80%', g: '20%', b: '80%', a: 1 } },
420
+ // hex
421
+ { name: 'Hex', color: 'cc33cc' },
422
+ { name: 'Hex String', color: '#cc33cc' },
423
+ // hex8
424
+ { name: 'Hex8', color: 'cc33ccff' },
425
+ { name: 'Hex8 String', color: '#cc33ccff' },
426
+ // name
427
+ { name: 'string', color: 'red' },
428
+ // hsl
429
+ { name: 'HSL String', color: 'hsl(300, 60%, 50%)' },
430
+ { name: 'HSL', color: { h: 300, s: 0.6000000000000001, l: 0.5, a: 1 } },
431
+ // hsv
432
+ { name: 'HSV String', color: 'hsv(300, 75%, 100%)' },
433
+ { name: 'HSV', color: { h: 300, s: 0.75, v: 1, a: 1 } },
434
+ ];
435
+ colorFormats.map((format) => {
436
+ it(`maintains \`color\` format as ${format.name}`, async () => {
437
+ const el = await fixture(html `
438
+ <sp-color-slider></sp-color-slider>
439
+ `);
440
+ el.color = format.color;
441
+ if (format.name.startsWith('Hex')) {
442
+ expect(el.color).to.equal(format.color);
443
+ }
444
+ else
445
+ expect(el.color).to.deep.equal(format.color);
446
+ });
447
+ });
448
+ it(`maintains \`color\` format as TinyColor`, async () => {
449
+ const el = await fixture(html `
450
+ <sp-color-slider></sp-color-slider>
451
+ `);
452
+ const color = new TinyColor('rgb(204, 51, 204)');
453
+ el.color = color;
454
+ expect(color.equals(el.color));
455
+ });
456
+ it(`resolves Hex3 format to Hex6 format`, async () => {
457
+ const el = await fixture(html `
458
+ <sp-color-slider></sp-color-slider>
459
+ `);
460
+ el.color = '0f0';
461
+ expect(el.color).to.equal('00ff00');
462
+ el.color = '#1e0';
463
+ expect(el.color).to.equal('#11ee00');
464
+ });
465
+ it(`resolves Hex4 format to Hex8 format`, async () => {
466
+ const el = await fixture(html `
467
+ <sp-color-slider></sp-color-slider>
468
+ `);
469
+ el.color = 'f3af';
470
+ expect(el.color).to.equal('ff33aaff');
471
+ el.color = '#f3af';
472
+ expect(el.color).to.equal('#ff33aaff');
473
+ });
474
+ it(`maintains hue value`, async () => {
475
+ const el = await fixture(html `
476
+ <sp-color-slider></sp-color-slider>
477
+ `);
478
+ const hue = 300;
479
+ const hsl = `hsl(${hue}, 60%, 100%)`;
480
+ el.color = hsl;
481
+ expect(el.value).to.equal(hue);
482
+ expect(el.color).to.equal(hsl);
483
+ const hsla = `hsla(${hue}, 60%, 100%, 0.9)`;
484
+ el.color = hsla;
485
+ expect(el.value).to.equal(hue);
486
+ expect(el.color).to.equal(hsla);
487
+ const hsv = `hsv(${hue}, 60%, 100%)`;
488
+ el.color = hsv;
489
+ expect(el.value).to.equal(hue);
490
+ expect(el.color).to.equal(hsv);
491
+ const hsva = `hsva(${hue}, 60%, 100%, 0.9)`;
492
+ el.color = hsva;
493
+ expect(el.value).to.equal(hue);
494
+ expect(el.color).to.equal(hsva);
495
+ const tinyHSV = new TinyColor({ h: hue, s: 60, v: 100 });
496
+ el.color = tinyHSV;
497
+ expect(el.value).to.equal(hue);
498
+ expect(tinyHSV.equals(el.color)).to.be.true;
499
+ const tinyHSVA = new TinyColor({ h: hue, s: 60, v: 100, a: 1 });
500
+ el.color = tinyHSVA;
501
+ expect(el.value).to.equal(hue);
502
+ expect(tinyHSVA.equals(el.color)).to.be.true;
503
+ const tinyHSL = new TinyColor({ h: hue, s: 60, l: 100 });
504
+ el.color = tinyHSL;
505
+ expect(el.value).to.equal(hue);
506
+ expect(tinyHSL.equals(el.color)).to.be.true;
507
+ const tinyHSLA = new TinyColor({ h: hue, s: 60, l: 100, a: 1 });
508
+ el.color = tinyHSLA;
509
+ expect(el.value).to.equal(hue);
510
+ expect(tinyHSLA.equals(el.color)).to.be.true;
511
+ });
512
+ });
513
+ //# sourceMappingURL=color-slider.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-slider.test.js","sourceRoot":"","sources":["color-slider.test.ts"],"names":[],"mappings":"AAAA;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CAAC,EAAE,CAAC,CAAC;QAChE,EAAE,CAAC,KAAK,GAAG,QAAQ,CAAC;QACpB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAE7C,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACzD,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC;QACnB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAE5C,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAChE,EAAE,CAAC,KAAK,GAAG,QAAQ,CAAC;QACpB,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACjD,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 { 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} from '../../../test/testing-helpers.js';\n\nimport '../sp-color-slider.js';\nimport { ColorSlider } from '../';\nimport { HSL, HSLA, HSV, HSVA, RGB, RGBA, TinyColor } from '@ctrl/tinycolor';\nimport { sendKeys } from '@web/test-runner-commands';\nimport { spy } from 'sinon';\n\ndescribe('ColorSlider', () => {\n it('loads default color-slider accessibly', async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\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-slider></sp-color-slider>\n <input type=\"text\" id=\"test-input-2\" />\n </div>\n `\n );\n const el = test.querySelector('sp-color-slider') as ColorSlider;\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<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\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<ColorSlider>(\n html`\n <sp-color-slider\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-slider>\n `\n );\n\n await elementUpdated(el);\n\n el.focus();\n\n await sendKeys({ press: 'ArrowRight' });\n\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<ColorSlider>(\n html`\n <sp-color-slider\n @change=${() => changeSpy()}\n @input=${() => inputSpy()}\n ></sp-color-slider>\n `\n );\n await elementUpdated(el);\n\n el.focus();\n el.focusElement.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n el.focusElement.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('manages value on \"Arrow*\" keypresses', async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider\n style=\"--spectrum-colorslider-default-length: 192px; --spectrum-colorslider-default-height: 24px; --spectrum-colorslider-default-height: 24px;\"\n ></sp-color-slider>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).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.sliderHandlePosition).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.sliderHandlePosition).to.equal(3.9999999999999996);\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.sliderHandlePosition).to.equal(1.9999999999999998);\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.sliderHandlePosition).to.equal(0);\n });\n it('accepts \"Arrow*\" keypresses in dir=\"rtl\"', async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider dir=\"rtl\"></sp-color-slider>\n `\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).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.sliderHandlePosition).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.sliderHandlePosition).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.sliderHandlePosition).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.sliderHandlePosition).to.equal(0);\n });\n it('accepts \"Arrow*\" keypresses with alteration', async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\n `\n );\n\n await elementUpdated(el);\n el.focus();\n expect(el.sliderHandlePosition).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.sliderHandlePosition).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.sliderHandlePosition).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.sliderHandlePosition).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.sliderHandlePosition).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<ColorSlider>(\n html`\n <sp-color-slider\n .color=${color}\n style=\"--spectrum-colorslider-default-length: 192px; --spectrum-colorslider-default-height: 24px; --spectrum-colorslider-default-height: 24px;\"\n ></sp-color-slider>\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.sliderHandlePosition).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: 100,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n expect(el.sliderHandlePosition).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('.gradient') as HTMLElement;\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n button: 1,\n pointerId: 1,\n clientX: 100,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n expect(el.sliderHandlePosition).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: 100,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).to.equal(47.91666666666667);\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: 110,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n handle.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n clientX: 110,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).to.equal(53.125);\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('accepts pointer events while [vertical]', async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider\n vertical\n style=\"--spectrum-colorslider-vertical-default-length: 192px; --spectrum-colorslider-vertical-width: 24px;\"\n ></sp-color-slider>\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.sliderHandlePosition).to.equal(0);\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const gradient = root.querySelector('.gradient') as HTMLElement;\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n pointerId: 1,\n clientX: 15,\n clientY: 100,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).to.equal(47.91666666666667);\n\n handle.dispatchEvent(\n new PointerEvent('pointermove', {\n pointerId: 1,\n clientX: 15,\n clientY: 110,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n handle.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n clientX: 15,\n clientY: 110,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).to.equal(53.125);\n });\n it('accepts pointer events in dir=\"rtl\"', async () => {\n document.documentElement.dir = 'rtl';\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider\n dir=\"rtl\"\n style=\"--spectrum-colorslider-default-length: 192px; --spectrum-colorslider-default-height: 24px; --spectrum-colorslider-height: 24px;\"\n ></sp-color-slider>\n `\n );\n await elementUpdated(el);\n\n const { handle } = el as unknown as { handle: HTMLElement };\n const clientWidth = document.documentElement.offsetWidth;\n\n handle.setPointerCapture = () => {\n return;\n };\n handle.releasePointerCapture = () => {\n return;\n };\n\n expect(el.sliderHandlePosition).to.equal(0);\n\n const gradient = el.shadowRoot.querySelector(\n '.gradient'\n ) as HTMLElement;\n gradient.dispatchEvent(\n new PointerEvent('pointerdown', {\n pointerId: 1,\n clientX: 700,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).to.equal(52.083333333333336);\n\n handle.dispatchEvent(\n new PointerEvent('pointermove', {\n pointerId: 1,\n clientX: clientWidth - 110,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n handle.dispatchEvent(\n new PointerEvent('pointerup', {\n pointerId: 1,\n clientX: clientWidth - 110,\n clientY: 15,\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n\n await elementUpdated(el);\n\n expect(el.sliderHandlePosition).to.equal(46.875);\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<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\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<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\n `\n );\n const color = new TinyColor('rgb(204, 51, 204)');\n el.color = color;\n expect(color.equals(el.color));\n });\n it(`resolves Hex3 format to Hex6 format`, async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\n `\n );\n el.color = '0f0';\n expect(el.color).to.equal('00ff00');\n\n el.color = '#1e0';\n expect(el.color).to.equal('#11ee00');\n });\n it(`resolves Hex4 format to Hex8 format`, async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\n `\n );\n el.color = 'f3af';\n expect(el.color).to.equal('ff33aaff');\n\n el.color = '#f3af';\n expect(el.color).to.equal('#ff33aaff');\n });\n it(`maintains hue value`, async () => {\n const el = await fixture<ColorSlider>(\n html`\n <sp-color-slider></sp-color-slider>\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"]}