@spectrum-web-components/color-slider 0.3.0 → 0.3.3

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.
@@ -422,13 +422,15 @@
422
422
  "name": "input",
423
423
  "type": {
424
424
  "text": "Event"
425
- }
425
+ },
426
+ "description": "The value of the Color Slider has changed."
426
427
  },
427
428
  {
428
429
  "name": "change",
429
430
  "type": {
430
431
  "text": "Event"
431
- }
432
+ },
433
+ "description": "An alteration to the value of the Color Slider has been committed by the user."
432
434
  }
433
435
  ],
434
436
  "attributes": [
@@ -521,7 +523,7 @@
521
523
  {
522
524
  "kind": "variable",
523
525
  "name": "styles",
524
- "default": "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(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));margin-top:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));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(-1*var(--spectrum-global-dimension-static-size-100, 8px)),calc(-1*var(--spectrum-global-dimension-static-size-100, 8px)) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.checkerboard:before,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n)}.checkerboard,.gradient{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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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}:host(:not([vertical])){touch-action:pan-y}:host([vertical]){touch-action:pan-x}.gradient{overflow:hidden}::slotted(*){height:100%;width:100%}\n`"
526
+ "default": "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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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`"
525
527
  }
526
528
  ],
527
529
  "exports": [
@@ -557,7 +559,7 @@
557
559
  {
558
560
  "kind": "variable",
559
561
  "name": "styles",
560
- "default": "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(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));margin-top:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));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(-1*var(--spectrum-global-dimension-static-size-100, 8px)),calc(-1*var(--spectrum-global-dimension-static-size-100, 8px)) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.checkerboard:before,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n)}.checkerboard,.gradient{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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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`"
562
+ "default": "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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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`"
561
563
  }
562
564
  ],
563
565
  "exports": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/color-slider",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
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.0",
49
- "@spectrum-web-components/color-handle": "^0.3.0",
50
- "@spectrum-web-components/shared": "^0.13.0",
48
+ "@spectrum-web-components/base": "^0.5.1",
49
+ "@spectrum-web-components/color-handle": "^0.3.2",
50
+ "@spectrum-web-components/shared": "^0.13.3",
51
51
  "tslib": "^2.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@spectrum-css/colorslider": "^1.0.4"
54
+ "@spectrum-css/colorslider": "^1.0.11"
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": "7ce77352f6894043bceac9ef92b21e5f85420969"
61
+ "gitHead": "279380c6d72c0819fe224b405844af9ddcb87f8a"
62
62
  }
@@ -5,6 +5,8 @@ import { ColorValue } from '@spectrum-web-components/color-handle';
5
5
  /**
6
6
  * @element sp-color-slider
7
7
  * @slot gradient - a custom gradient visually outlining the available color values
8
+ * @fires input - The value of the Color Slider has changed.
9
+ * @fires change - An alteration to the value of the Color Slider has been committed by the user.
8
10
  */
9
11
  export declare class ColorSlider extends Focusable {
10
12
  static get styles(): CSSResultArray;
@@ -22,6 +22,8 @@ import { TinyColor } from '@ctrl/tinycolor';
22
22
  /**
23
23
  * @element sp-color-slider
24
24
  * @slot gradient - a custom gradient visually outlining the available color values
25
+ * @fires input - The value of the Color Slider has changed.
26
+ * @fires change - An alteration to the value of the Color Slider has been committed by the user.
25
27
  */
26
28
  export class ColorSlider extends Focusable {
27
29
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"ColorSlider.js","sourceRoot":"","sources":["ColorSlider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAC5E,OAAO,EACH,QAAQ,EACR,KAAK,GACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,SAAS,EA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QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACpB;AAGvB;IADC,KAAK,CAAC,SAAS,CAAC;2CACY;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CACN;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAG1B;AAsBD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDACV;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAiD1B;AAoDD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACX;AAchB;IADC,KAAK,CAAC,OAAO,CAAC;0CACiB","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 {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport styles from './color-slider.css.js';\nimport {\n ColorHandle,\n ColorValue,\n extractHueAndSaturationRegExp,\n replaceHueAndSaturationRegExp,\n} from '@spectrum-web-components/color-handle';\nimport { TinyColor } from '@ctrl/tinycolor';\n\n/**\n * @element sp-color-slider\n * @slot gradient - a custom gradient visually outlining the available color values\n */\nexport class ColorSlider extends Focusable {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @query('.handle')\n private handle!: ColorHandle;\n\n @property({ type: String })\n public label = 'hue';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @property({ type: Number })\n public get value(): number {\n return this._value;\n }\n\n public set value(hue: number) {\n const value = Math.min(360, Math.max(0, hue));\n if (value === this.value) {\n return;\n }\n const oldValue = this.value;\n const { s, v } = this._color.toHsv();\n this._color = new TinyColor({ h: value, s, v });\n this._value = value;\n\n if (value !== this.sliderHandlePosition) {\n this.sliderHandlePosition = 100 * (value / 360);\n }\n\n this.requestUpdate('value', oldValue);\n }\n\n private _value = 0;\n\n @property({ type: Number, reflect: true })\n public sliderHandlePosition = 0;\n\n @property({ type: String })\n public get color(): ColorValue {\n switch (this._format.format) {\n case 'rgb':\n return this._format.isString\n ? this._color.toRgbString()\n : this._color.toRgb();\n case 'prgb':\n return this._format.isString\n ? this._color.toPercentageRgbString()\n : this._color.toPercentageRgb();\n case 'hex':\n case 'hex3':\n case 'hex4':\n case 'hex6':\n return this._format.isString\n ? this._color.toHexString()\n : this._color.toHex();\n case 'hex8':\n return this._format.isString\n ? this._color.toHex8String()\n : this._color.toHex8();\n case 'name':\n return this._color.toName() || this._color.toRgbString();\n case 'hsl':\n if (this._format.isString) {\n const hslString = this._color.toHslString();\n return hslString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, l, a } = this._color.toHsl();\n return { h: this.value, s, l, a };\n }\n case 'hsv':\n if (this._format.isString) {\n const hsvString = this._color.toHsvString();\n return hsvString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, v, a } = this._color.toHsv();\n return { h: this.value, s, v, a };\n }\n default:\n return 'No color format applied.';\n }\n }\n\n public set color(color: ColorValue) {\n if (color === this.color) {\n return;\n }\n const oldValue = this._color;\n this._color = new TinyColor(color);\n const format = this._color.format;\n let isString = typeof color === 'string' || color instanceof String;\n\n if (format.startsWith('hex')) {\n isString = (color as string).startsWith('#');\n }\n\n this._format = {\n format,\n isString,\n };\n\n if (isString && format.startsWith('hs')) {\n const values = extractHueAndSaturationRegExp.exec(color as string);\n if (values !== null) {\n const [, h, s] = values;\n this.value = Number(h);\n this._saturation = Number(s);\n }\n } else if (!isString && format.startsWith('hs')) {\n const colorInput = this._color.originalInput;\n const colorValues = Object.values(colorInput);\n this.value = colorValues[0];\n this._saturation = colorValues[1];\n } else {\n const { h } = this._color.toHsv();\n this.value = h;\n }\n this._previousColor = oldValue;\n this.requestUpdate('color', oldValue);\n }\n\n private _color = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _previousColor = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _saturation!: number;\n\n private _format: { format: string; isString: boolean } = {\n format: '',\n isString: false,\n };\n\n @property({ type: Number })\n public step = 1;\n\n private get altered(): number {\n return this._altered;\n }\n\n private set altered(altered: number) {\n this._altered = altered;\n this.step = Math.max(1, this.altered * 10);\n }\n\n private _altered = 0;\n\n @query('input')\n public input!: HTMLInputElement;\n\n public get focusElement(): HTMLInputElement {\n return this.input;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { key } = event;\n this.focused = true;\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n let delta = 0;\n switch (key) {\n case 'ArrowUp':\n delta = this.step;\n break;\n case 'ArrowDown':\n delta = -this.step;\n break;\n case 'ArrowLeft':\n delta = this.step * (this.isLTR ? -1 : 1);\n break;\n case 'ArrowRight':\n delta = this.step * (this.isLTR ? 1 : -1);\n break;\n default:\n return;\n }\n event.preventDefault();\n\n this.sliderHandlePosition = Math.min(\n 100,\n Math.max(0, this.sliderHandlePosition + delta)\n );\n this.value = 360 * (this.sliderHandlePosition / 100);\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n\n if (delta != 0) {\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber } = event.target;\n\n this.value = valueAsNumber;\n this.sliderHandlePosition = 100 * (this.value / 360);\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n }\n\n private handleChange(event: Event & { target: HTMLInputElement }): void {\n this.handleInput(event);\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n public focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n this.input.focus();\n }\n\n private handleFocusin(): void {\n this.focused = true;\n }\n\n private handleFocusout(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n }\n\n private boundingClientRect!: DOMRect;\n private _pointerDown = false;\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this._previousColor = this._color.clone();\n this.boundingClientRect = this.getBoundingClientRect();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if (event.pointerType === 'mouse') {\n this.focused = true;\n }\n }\n\n private handlePointermove(event: PointerEvent): void {\n this.sliderHandlePosition = this.calculateHandlePosition(event);\n this.value = 360 * (this.sliderHandlePosition / 100);\n\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n private handlePointerup(event: PointerEvent): void {\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this._color = this._previousColor;\n }\n // Retain focus on input element after mouse up to enable keyboard interactions\n this.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): number {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return this.sliderHandlePosition;\n }\n const rect = this.boundingClientRect;\n const minOffset = this.vertical ? rect.top : rect.left;\n const offset = this.vertical ? event.clientY : event.clientX;\n const size = this.vertical ? rect.height : rect.width;\n\n const percent = Math.max(0, Math.min(1, (offset - minOffset) / size));\n const sliderHandlePosition = 100 * percent;\n\n return sliderHandlePosition;\n }\n\n private handleGradientPointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.handle.dispatchEvent(new PointerEvent('pointerdown', event));\n this.handlePointermove(event);\n }\n\n private get handlePositionStyles(): string {\n return `${this.vertical ? 'top' : 'left'}: ${\n this.sliderHandlePosition\n }%`;\n }\n\n protected render(): TemplateResult {\n return html`\n <div\n class=\"checkerboard\"\n role=\"presentation\"\n @pointerdown=${this.handleGradientPointerdown}\n >\n <div\n class=\"gradient\"\n role=\"presentation\"\n style=\"background: linear-gradient(to ${this.vertical\n ? 'bottom'\n : 'right'}, var(--sp-color-slider-gradient, var(--sp-color-slider-gradient-fallback)));\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n </div>\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=\"hsl(${this.value}, 100%, 50%)\"\n ?disabled=${this.disabled}\n style=${this.handlePositionStyles}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [['pointerup', 'pointercancel'], this.handlePointerup],\n })}\n ></sp-color-handle>\n <input\n type=\"range\"\n class=\"slider\"\n min=\"0\"\n max=\"360\"\n step=${this.step}\n aria-label=${this.label}\n .value=${String(this.value)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n />\n `;\n }\n\n protected firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('focusout', this.handleFocusout);\n }\n}\n"]}
1
+ {"version":3,"file":"ColorSlider.js","sourceRoot":"","sources":["ColorSlider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,GAGP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAC5E,OAAO,EACH,QAAQ,EACR,KAAK,GACR,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,kDAAkD,CAAC;AAC7E,OAAO,0DAA0D,CAAC;AAClE,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAGH,6BAA6B,EAC7B,6BAA6B,GAChC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,SAAS;IAA1C;;QAMW,aAAQ,GAAG,KAAK,CAAC;QAGjB,YAAO,GAAG,KAAK,CAAC;QAMhB,UAAK,GAAG,KAAK,CAAC;QAGd,aAAQ,GAAG,KAAK,CAAC;QAwBhB,WAAM,GAAG,CAAC,CAAC;QAGZ,yBAAoB,GAAG,CAAC,CAAC;QA2FxB,W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E,IAAI,EAAE,MAAM,EAAE,CAAC;wCAiD1B;AAoDD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACX;AAchB;IADC,KAAK,CAAC,OAAO,CAAC;0CACiB","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 {\n CSSResultArray,\n html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\nimport styles from './color-slider.css.js';\nimport {\n ColorHandle,\n ColorValue,\n extractHueAndSaturationRegExp,\n replaceHueAndSaturationRegExp,\n} from '@spectrum-web-components/color-handle';\nimport { TinyColor } from '@ctrl/tinycolor';\n\n/**\n * @element sp-color-slider\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Slider has changed.\n * @fires change - An alteration to the value of the Color Slider has been committed by the user.\n */\nexport class ColorSlider extends Focusable {\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n @property({ type: Boolean, reflect: true })\n public focused = false;\n\n @query('.handle')\n private handle!: ColorHandle;\n\n @property({ type: String })\n public label = 'hue';\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @property({ type: Number })\n public get value(): number {\n return this._value;\n }\n\n public set value(hue: number) {\n const value = Math.min(360, Math.max(0, hue));\n if (value === this.value) {\n return;\n }\n const oldValue = this.value;\n const { s, v } = this._color.toHsv();\n this._color = new TinyColor({ h: value, s, v });\n this._value = value;\n\n if (value !== this.sliderHandlePosition) {\n this.sliderHandlePosition = 100 * (value / 360);\n }\n\n this.requestUpdate('value', oldValue);\n }\n\n private _value = 0;\n\n @property({ type: Number, reflect: true })\n public sliderHandlePosition = 0;\n\n @property({ type: String })\n public get color(): ColorValue {\n switch (this._format.format) {\n case 'rgb':\n return this._format.isString\n ? this._color.toRgbString()\n : this._color.toRgb();\n case 'prgb':\n return this._format.isString\n ? this._color.toPercentageRgbString()\n : this._color.toPercentageRgb();\n case 'hex':\n case 'hex3':\n case 'hex4':\n case 'hex6':\n return this._format.isString\n ? this._color.toHexString()\n : this._color.toHex();\n case 'hex8':\n return this._format.isString\n ? this._color.toHex8String()\n : this._color.toHex8();\n case 'name':\n return this._color.toName() || this._color.toRgbString();\n case 'hsl':\n if (this._format.isString) {\n const hslString = this._color.toHslString();\n return hslString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, l, a } = this._color.toHsl();\n return { h: this.value, s, l, a };\n }\n case 'hsv':\n if (this._format.isString) {\n const hsvString = this._color.toHsvString();\n return hsvString.replace(\n replaceHueAndSaturationRegExp,\n `$1${this.value}$2${this._saturation}`\n );\n } else {\n const { s, v, a } = this._color.toHsv();\n return { h: this.value, s, v, a };\n }\n default:\n return 'No color format applied.';\n }\n }\n\n public set color(color: ColorValue) {\n if (color === this.color) {\n return;\n }\n const oldValue = this._color;\n this._color = new TinyColor(color);\n const format = this._color.format;\n let isString = typeof color === 'string' || color instanceof String;\n\n if (format.startsWith('hex')) {\n isString = (color as string).startsWith('#');\n }\n\n this._format = {\n format,\n isString,\n };\n\n if (isString && format.startsWith('hs')) {\n const values = extractHueAndSaturationRegExp.exec(color as string);\n if (values !== null) {\n const [, h, s] = values;\n this.value = Number(h);\n this._saturation = Number(s);\n }\n } else if (!isString && format.startsWith('hs')) {\n const colorInput = this._color.originalInput;\n const colorValues = Object.values(colorInput);\n this.value = colorValues[0];\n this._saturation = colorValues[1];\n } else {\n const { h } = this._color.toHsv();\n this.value = h;\n }\n this._previousColor = oldValue;\n this.requestUpdate('color', oldValue);\n }\n\n private _color = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _previousColor = new TinyColor({ h: 0, s: 1, v: 1 });\n\n private _saturation!: number;\n\n private _format: { format: string; isString: boolean } = {\n format: '',\n isString: false,\n };\n\n @property({ type: Number })\n public step = 1;\n\n private get altered(): number {\n return this._altered;\n }\n\n private set altered(altered: number) {\n this._altered = altered;\n this.step = Math.max(1, this.altered * 10);\n }\n\n private _altered = 0;\n\n @query('input')\n public input!: HTMLInputElement;\n\n public get focusElement(): HTMLInputElement {\n return this.input;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { key } = event;\n this.focused = true;\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n let delta = 0;\n switch (key) {\n case 'ArrowUp':\n delta = this.step;\n break;\n case 'ArrowDown':\n delta = -this.step;\n break;\n case 'ArrowLeft':\n delta = this.step * (this.isLTR ? -1 : 1);\n break;\n case 'ArrowRight':\n delta = this.step * (this.isLTR ? 1 : -1);\n break;\n default:\n return;\n }\n event.preventDefault();\n\n this.sliderHandlePosition = Math.min(\n 100,\n Math.max(0, this.sliderHandlePosition + delta)\n );\n this.value = 360 * (this.sliderHandlePosition / 100);\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n\n if (delta != 0) {\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\n );\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber } = event.target;\n\n this.value = valueAsNumber;\n this.sliderHandlePosition = 100 * (this.value / 360);\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n }\n\n private handleChange(event: Event & { target: HTMLInputElement }): void {\n this.handleInput(event);\n this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n public focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n this.input.focus();\n }\n\n private handleFocusin(): void {\n this.focused = true;\n }\n\n private handleFocusout(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n }\n\n private boundingClientRect!: DOMRect;\n private _pointerDown = false;\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this._previousColor = this._color.clone();\n this.boundingClientRect = this.getBoundingClientRect();\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if (event.pointerType === 'mouse') {\n this.focused = true;\n }\n }\n\n private handlePointermove(event: PointerEvent): void {\n this.sliderHandlePosition = this.calculateHandlePosition(event);\n this.value = 360 * (this.sliderHandlePosition / 100);\n\n this._color = new TinyColor({ ...this._color.toHsl(), h: this.value });\n\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n }\n\n private handlePointerup(event: PointerEvent): void {\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n if (!applyDefault) {\n this._color = this._previousColor;\n }\n // Retain focus on input element after mouse up to enable keyboard interactions\n this.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n }\n\n /**\n * Returns the value under the cursor\n * @param: PointerEvent on slider\n * @return: Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): number {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return this.sliderHandlePosition;\n }\n const rect = this.boundingClientRect;\n const minOffset = this.vertical ? rect.top : rect.left;\n const offset = this.vertical ? event.clientY : event.clientX;\n const size = this.vertical ? rect.height : rect.width;\n\n const percent = Math.max(0, Math.min(1, (offset - minOffset) / size));\n const sliderHandlePosition = 100 * percent;\n\n return sliderHandlePosition;\n }\n\n private handleGradientPointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n this.handle.dispatchEvent(new PointerEvent('pointerdown', event));\n this.handlePointermove(event);\n }\n\n private get handlePositionStyles(): string {\n return `${this.vertical ? 'top' : 'left'}: ${\n this.sliderHandlePosition\n }%`;\n }\n\n protected render(): TemplateResult {\n return html`\n <div\n class=\"checkerboard\"\n role=\"presentation\"\n @pointerdown=${this.handleGradientPointerdown}\n >\n <div\n class=\"gradient\"\n role=\"presentation\"\n style=\"background: linear-gradient(to ${this.vertical\n ? 'bottom'\n : 'right'}, var(--sp-color-slider-gradient, var(--sp-color-slider-gradient-fallback)));\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n </div>\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=\"hsl(${this.value}, 100%, 50%)\"\n ?disabled=${this.disabled}\n style=${this.handlePositionStyles}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [['pointerup', 'pointercancel'], this.handlePointerup],\n })}\n ></sp-color-handle>\n <input\n type=\"range\"\n class=\"slider\"\n min=\"0\"\n max=\"360\"\n step=${this.step}\n aria-label=${this.label}\n .value=${String(this.value)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n @keydown=${this.handleKeydown}\n />\n `;\n }\n\n protected firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n this.addEventListener('focusin', this.handleFocusin);\n this.addEventListener('focusout', this.handleFocusout);\n }\n}\n"]}
@@ -18,7 +18,13 @@ const styles = css `
18
18
  )}:host([focused]) .handle{height:calc(var(
19
19
  --spectrum-colorhandle-size,
20
20
  var(--spectrum-global-dimension-size-200)
21
- )*2);margin-left:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));margin-top:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));width:calc(var(
21
+ )*2);margin-left:calc(var(
22
+ --spectrum-colorhandle-size,
23
+ var(--spectrum-global-dimension-size-200)
24
+ )*-1);margin-top:calc(var(
25
+ --spectrum-colorhandle-size,
26
+ var(--spectrum-global-dimension-size-200)
27
+ )*-1);width:calc(var(
22
28
  --spectrum-colorhandle-size,
23
29
  var(--spectrum-global-dimension-size-200)
24
30
  )*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(
@@ -31,9 +37,11 @@ var(--spectrum-global-dimension-size-200)
31
37
  --spectrum-colorslider-vertical-width,var(--spectrum-global-dimension-size-300)
32
38
  )}:host([vertical]) .handle{left:50%;top:0}.handle{left:0;top:50%}.handle:after{border-radius:var(
33
39
  --spectrum-colorslider-handle-hitarea-border-radius
34
- );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(-1*var(--spectrum-global-dimension-static-size-100, 8px)),calc(-1*var(--spectrum-global-dimension-static-size-100, 8px)) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.checkerboard:before,.gradient{border-radius:var(
40
+ );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(
41
+ --spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)
42
+ );bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.gradient{border-radius:var(
35
43
  --spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)
36
- )}.checkerboard,.gradient{height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(
44
+ );height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(
37
45
  --spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)
38
46
  )}.checkerboard{background-color:var(
39
47
  --spectrum-global-color-static-white,#fff
@@ -47,7 +55,7 @@ var(--spectrum-global-dimension-size-200)
47
55
  --spectrum-colorslider-border-size,var(--spectrum-alias-border-size-thin)
48
56
  ) var(
49
57
  --spectrum-colorslider-border-color-disabled,var(--spectrum-alias-track-color-disabled)
50
- )}: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}:host(:not([vertical])){touch-action:pan-y}:host([vertical]){touch-action:pan-x}.gradient{overflow:hidden}::slotted(*){height:100%;width:100%}
58
+ )}: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%}
51
59
  `;
52
60
  export default styles;
53
61
  //# sourceMappingURL=color-slider.css.js.map
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCjB,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(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));margin-top:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));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(-1*var(--spectrum-global-dimension-static-size-100, 8px)),calc(-1*var(--spectrum-global-dimension-static-size-100, 8px)) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.checkerboard:before,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n)}.checkerboard,.gradient{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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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}:host(:not([vertical])){touch-action:pan-y}:host([vertical]){touch-action:pan-x}.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CjB,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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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;"]}
@@ -18,7 +18,13 @@ const styles = css `
18
18
  )}:host([focused]) .handle{height:calc(var(
19
19
  --spectrum-colorhandle-size,
20
20
  var(--spectrum-global-dimension-size-200)
21
- )*2);margin-left:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));margin-top:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));width:calc(var(
21
+ )*2);margin-left:calc(var(
22
+ --spectrum-colorhandle-size,
23
+ var(--spectrum-global-dimension-size-200)
24
+ )*-1);margin-top:calc(var(
25
+ --spectrum-colorhandle-size,
26
+ var(--spectrum-global-dimension-size-200)
27
+ )*-1);width:calc(var(
22
28
  --spectrum-colorhandle-size,
23
29
  var(--spectrum-global-dimension-size-200)
24
30
  )*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(
@@ -31,9 +37,11 @@ var(--spectrum-global-dimension-size-200)
31
37
  --spectrum-colorslider-vertical-width,var(--spectrum-global-dimension-size-300)
32
38
  )}:host([vertical]) .handle{left:50%;top:0}.handle{left:0;top:50%}.handle:after{border-radius:var(
33
39
  --spectrum-colorslider-handle-hitarea-border-radius
34
- );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(-1*var(--spectrum-global-dimension-static-size-100, 8px)),calc(-1*var(--spectrum-global-dimension-static-size-100, 8px)) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.checkerboard:before,.gradient{border-radius:var(
40
+ );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(
41
+ --spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)
42
+ );bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.gradient{border-radius:var(
35
43
  --spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)
36
- )}.checkerboard,.gradient{height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(
44
+ );height:100%;width:100%}:host{--spectrum-colorslider-border-color:var(
37
45
  --spectrum-colorarea-border-color,var(--spectrum-alias-border-color-translucent)
38
46
  )}.checkerboard{background-color:var(
39
47
  --spectrum-global-color-static-white,#fff
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCjB,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(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));margin-top:calc(-1*var(--spectrum-colorhandle-size, var(--spectrum-global-dimension-size-200)));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(-1*var(--spectrum-global-dimension-static-size-100, 8px)),calc(-1*var(--spectrum-global-dimension-static-size-100, 8px)) 0;background-size:var(--spectrum-global-dimension-static-size-200,16px) var(--spectrum-global-dimension-static-size-200,16px)}.checkerboard:before{bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;z-index:1}.checkerboard,.checkerboard:before,.gradient{border-radius:var(\n--spectrum-colorslider-border-radius,var(--spectrum-alias-border-radius-regular)\n)}.checkerboard,.gradient{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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CjB,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-global-color-static-white,#fff\n);background-image:linear-gradient(-45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(45deg,transparent 75.5%,var(--spectrum-global-color-static-gray-500,#bcbcbc) 75.5%),linear-gradient(-45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 25.5%,transparent 25.5%),linear-gradient(45deg,var(--spectrum-global-color-static-gray-500,#bcbcbc) 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,15 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,513 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"color-slider.test.js","sourceRoot":"","sources":["color-slider.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EACH,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,GACpB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAmC,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACnD,MAAM,EAAE,GAAG,MAAM,OAAO,CACpB,IAAI,CAAA;;aAEH,CACJ,CAAC;QAEF,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC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,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"]}