@spectrum-web-components/color-area 1.12.0-testing.20260223092154 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -351,6 +351,17 @@
351
351
  "privacy": "public",
352
352
  "default": "false"
353
353
  },
354
+ {
355
+ "kind": "method",
356
+ "name": "getContentBoundingRect",
357
+ "privacy": "private",
358
+ "return": {
359
+ "type": {
360
+ "text": "DOMRect"
361
+ }
362
+ },
363
+ "description": "Returns a DOMRect describing the content box of the color area in viewport\ncoordinates, excluding the element's border. Using the content box ensures\nthat pointer calculations and handle rendering are aligned to the visible\ngradient area rather than to the border edge."
364
+ },
354
365
  {
355
366
  "kind": "method",
356
367
  "name": "handlePointerdown",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/color-area",
3
- "version": "1.12.0-testing.20260223092154",
3
+ "version": "1.12.0",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Adobe",
@@ -58,11 +58,11 @@
58
58
  ],
59
59
  "types": "./src/index.d.ts",
60
60
  "dependencies": {
61
- "@spectrum-web-components/base": "1.12.0-testing.20260223092154",
62
- "@spectrum-web-components/color-handle": "1.12.0-testing.20260223092154",
63
- "@spectrum-web-components/opacity-checkerboard": "1.12.0-testing.20260223092154",
64
- "@spectrum-web-components/reactive-controllers": "1.12.0-testing.20260223092154",
65
- "@spectrum-web-components/shared": "1.12.0-testing.20260223092154"
61
+ "@spectrum-web-components/base": "1.12.0",
62
+ "@spectrum-web-components/color-handle": "1.12.0",
63
+ "@spectrum-web-components/opacity-checkerboard": "1.12.0",
64
+ "@spectrum-web-components/reactive-controllers": "1.12.0",
65
+ "@spectrum-web-components/shared": "1.12.0"
66
66
  },
67
67
  "keywords": [
68
68
  "design-system",
@@ -82,6 +82,13 @@ export declare class ColorArea extends SpectrumElement {
82
82
  private handleChange;
83
83
  private boundingClientRect;
84
84
  _pointerDown: boolean;
85
+ /**
86
+ * Returns a DOMRect describing the content box of the color area in viewport
87
+ * coordinates, excluding the element's border. Using the content box ensures
88
+ * that pointer calculations and handle rendering are aligned to the visible
89
+ * gradient area rather than to the border edge.
90
+ */
91
+ private getContentBoundingRect;
85
92
  private handlePointerdown;
86
93
  private handlePointermove;
87
94
  private handlePointerup;
@@ -241,6 +241,26 @@ export class ColorArea extends SpectrumElement {
241
241
  })
242
242
  );
243
243
  }
244
+ /**
245
+ * Returns a DOMRect describing the content box of the color area in viewport
246
+ * coordinates, excluding the element's border. Using the content box ensures
247
+ * that pointer calculations and handle rendering are aligned to the visible
248
+ * gradient area rather than to the border edge.
249
+ */
250
+ getContentBoundingRect() {
251
+ const outer = this.getBoundingClientRect();
252
+ const style = getComputedStyle(this);
253
+ const bl = parseFloat(style.borderLeftWidth);
254
+ const bt = parseFloat(style.borderTopWidth);
255
+ const br = parseFloat(style.borderRightWidth);
256
+ const bb = parseFloat(style.borderBottomWidth);
257
+ return new DOMRect(
258
+ outer.left + bl,
259
+ outer.top + bt,
260
+ outer.width - bl - br,
261
+ outer.height - bt - bb
262
+ );
263
+ }
244
264
  handlePointerdown(event) {
245
265
  if (event.button !== 0) {
246
266
  event.preventDefault();
@@ -248,7 +268,7 @@ export class ColorArea extends SpectrumElement {
248
268
  }
249
269
  this._pointerDown = true;
250
270
  this.colorController.savePreviousColor();
251
- this.boundingClientRect = this.getBoundingClientRect();
271
+ this.boundingClientRect = this.getContentBoundingRect();
252
272
  event.target.setPointerCapture(event.pointerId);
253
273
  if (event.pointerType === "mouse") {
254
274
  this.focused = true;
@@ -408,7 +428,7 @@ export class ColorArea extends SpectrumElement {
408
428
  }
409
429
  firstUpdated(changed) {
410
430
  super.firstUpdated(changed);
411
- this.boundingClientRect = this.getBoundingClientRect();
431
+ this.boundingClientRect = this.getContentBoundingRect();
412
432
  this.addEventListener("focus", this.handleFocus);
413
433
  this.addEventListener("blur", this.handleBlur);
414
434
  this.addEventListener("keyup", this.handleKeyup);
@@ -432,10 +452,7 @@ export class ColorArea extends SpectrumElement {
432
452
  this.colorController.color.set("s", this.inputX.valueAsNumber * 100);
433
453
  }
434
454
  if (this.y !== this.inputY.valueAsNumber) {
435
- this.colorController.color.set(
436
- "v",
437
- (1 - this.inputY.valueAsNumber) * 100
438
- );
455
+ this.colorController.color.set("v", this.inputY.valueAsNumber * 100);
439
456
  }
440
457
  if (changed.has("focused") && this.focused) {
441
458
  const parentX = this.inputX.parentElement;
@@ -453,10 +470,8 @@ export class ColorArea extends SpectrumElement {
453
470
  var _a;
454
471
  super.connectedCallback();
455
472
  if (!this.observer && window.ResizeObserver) {
456
- this.observer = new window.ResizeObserver((entries) => {
457
- for (const entry of entries) {
458
- this.boundingClientRect = entry.contentRect;
459
- }
473
+ this.observer = new window.ResizeObserver((_entries) => {
474
+ this.boundingClientRect = this.getContentBoundingRect();
460
475
  this.requestUpdate();
461
476
  });
462
477
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["ColorArea.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport type { ColorHandle } from '@spectrum-web-components/color-handle';\nimport {\n ColorController,\n ColorTypes,\n} from '@spectrum-web-components/reactive-controllers/src/ColorController.js';\nimport { LanguageResolutionController } from '@spectrum-web-components/reactive-controllers/src/LanguageResolution.js';\nimport {\n isAndroid,\n isIOS,\n} from '@spectrum-web-components/shared/src/platform.js';\n\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\n\nimport styles from './color-area.css.js';\nimport { SWCResizeObserverEntry, WithSWCResizeObserver } from './types.dev.js'\n\n/**\n * @element sp-color-area\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Area has changed.\n * @fires change - An alteration to the value of the Color Area has been committed by the user.\n */\nexport class ColorArea extends SpectrumElement {\n public static override 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 @property({ type: String, attribute: 'label-x' })\n public labelX = 'saturation';\n\n @property({ type: String, attribute: 'label-y' })\n public labelY = 'luminosity';\n\n @query('.handle')\n private handle!: ColorHandle;\n\n private languageResolver = new LanguageResolutionController(this);\n\n /**\n * A controller for managing color interactions within the ColorArea component.\n *\n * The `ColorController` is instantiated with the `manageAs` option set to `hsv`\n * because the ColorArea component is designed to manipulate the saturation (`s`)\n * and value (`v`) components of the HSV color model along the x and y axes,\n * respectively. In the HSV color model:\n *\n * - The `hue` (h) represents the color type and is typically controlled by a separate input.\n * - The `saturation` (s) represents the intensity of the color, ranging from 0% (gray) to 100% (full color).\n * - The `value` (v) represents the brightness of the color, ranging from 0% (black) to 100% (full brightness).\n *\n * In the ColorArea component:\n *\n * - The x-axis controls the saturation (`s`), allowing users to adjust the intensity of the color.\n * - The y-axis controls the value (`v`), allowing users to adjust the brightness of the color.\n *\n * By managing the color as `hsv`, the ColorController can efficiently handle the changes in saturation and value\n * as the user interacts with the ColorArea component.\n *\n * @private\n * @type {ColorController}\n * @memberof ColorArea\n *\n * @property {ColorArea} this - The instance of the ColorArea component.\n * @property {object} options - Configuration options for the ColorController.\n * @property {string} options.manageAs - Specifies the color model to manage, in this case 'hsv'.\n */\n private colorController = new ColorController(this, { manageAs: 'hsv' });\n\n @property({ type: Number })\n public get hue(): number {\n return this.colorController.hue;\n }\n\n public set hue(value: number) {\n this.colorController.hue = value;\n }\n\n @property({ type: String })\n public get value(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n @property({ type: String })\n public get color(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n public set color(color: ColorTypes) {\n this.colorController.color = color;\n }\n\n @property({ attribute: false })\n private activeAxis = 'x';\n\n @property({ type: Number })\n public get x(): number {\n return this.colorController.color.hsv.s / 100;\n }\n\n public set x(x: number) {\n if (x === this.x) {\n return;\n }\n const oldValue = this.x;\n if (this.inputX) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputX.value = x.toString();\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n } else {\n this.colorController.color.set('s', x * 100);\n }\n this.requestUpdate('x', oldValue);\n }\n\n @property({ type: Number })\n public get y(): number {\n return this.colorController.color.hsv.v / 100;\n }\n\n public set y(y: number) {\n if (y === this.y) {\n return;\n }\n const oldValue = this.y;\n if (this.inputY) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputY.value = y.toString();\n this.colorController.color.set('v', this.inputY.valueAsNumber * 100);\n }\n this.requestUpdate('y', oldValue);\n }\n\n @property({ type: Number })\n public step = 0.01;\n\n @query('[name=\"x\"]')\n public inputX!: HTMLInputElement;\n\n @query('[name=\"y\"]')\n public inputY!: HTMLInputElement;\n\n private altered = 0;\n\n private activeKeys = new Set();\n\n private _valueChanged = false;\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n if (this.activeAxis === 'x') {\n this.inputX.focus();\n } else {\n this.inputY.focus();\n }\n }\n\n private handleFocus(): void {\n this.focused = true;\n this._valueChanged = false;\n }\n\n public handleBlur(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n this._valueChanged = false;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n this.focused = true;\n\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n const isArrowKey =\n code.search('Arrow') === 0 ||\n code.search('Page') === 0 ||\n code.search('Home') === 0 ||\n code.search('End') === 0;\n if (isArrowKey) {\n event.preventDefault();\n this.activeKeys.add(code);\n this.handleKeypress();\n }\n }\n\n private handleKeypress(): void {\n let deltaX = 0;\n let deltaY = 0;\n const step = Math.max(this.step, this.altered * 5 * this.step);\n this.activeKeys.forEach((code) => {\n switch (code) {\n case 'ArrowUp':\n deltaY = step;\n break;\n case 'ArrowDown':\n deltaY = step * -1;\n break;\n case 'ArrowLeft':\n deltaX = this.step * (this.dir === 'ltr' ? -1 : 1);\n break;\n case 'ArrowRight':\n deltaX = this.step * (this.dir === 'ltr' ? 1 : -1);\n break;\n case 'PageUp':\n deltaY = step * 10;\n break;\n case 'PageDown':\n deltaY = step * -10;\n break;\n case 'Home':\n deltaX = step * (this.dir === 'ltr' ? -10 : 10);\n break;\n case 'End':\n deltaX = step * (this.dir === 'ltr' ? 10 : -10);\n break;\n /* c8 ignore next 2 */\n default:\n break;\n }\n });\n if (deltaX != 0) {\n this.activeAxis = 'x';\n this.inputX.focus();\n } else if (deltaY != 0) {\n this.activeAxis = 'y';\n this.inputY.focus();\n }\n this.x = Math.min(1, Math.max(this.x + deltaX, 0));\n this.y = Math.min(1, Math.max(this.y + deltaY, 0));\n\n this.colorController.savePreviousColor();\n\n if (deltaX != 0 || deltaY != 0) {\n this._valueChanged = true;\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\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.colorController.restorePreviousColor();\n }\n }\n }\n\n private handleKeyup(event: KeyboardEvent): void {\n event.preventDefault();\n const { code } = event;\n this.activeKeys.delete(code);\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber, name } = event.target;\n\n this[name as 'x' | 'y'] = valueAsNumber;\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 cancelable: true,\n })\n );\n }\n\n private boundingClientRect!: DOMRect;\n public _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.colorController.savePreviousColor();\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 const [x, y] = this.calculateHandlePosition(event);\n\n this._valueChanged = false;\n\n this.x = x;\n this.y = y;\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 event.preventDefault();\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n this.inputX.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n if (!applyDefault) {\n this.colorController.restorePreviousColor();\n }\n }\n\n /**\n * Returns the value under the cursor\n *\n * @param event - PointerEvent on slider\n * @returns Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): [number, number] {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return [this.x, this.y];\n }\n const rect = this.boundingClientRect;\n const minOffsetX = rect.left;\n const minOffsetY = rect.top;\n const offsetX = event.clientX;\n const offsetY = event.clientY;\n const width = rect.width;\n const height = rect.height;\n\n const percentX = Math.max(0, Math.min(1, (offsetX - minOffsetX) / width));\n const percentY = Math.max(0, Math.min(1, (offsetY - minOffsetY) / height));\n\n return [this.dir === 'ltr' ? percentX : 1 - percentX, 1 - percentY];\n }\n\n private handleAreaPointerdown(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 protected override render(): TemplateResult {\n const { width = 0, height = 0 } = this.boundingClientRect || {};\n\n const isMobile = isAndroid() || isIOS();\n const defaultAriaLabel = 'Color Picker';\n const ariaLabel = defaultAriaLabel;\n const ariaRoleDescription = ifDefined(isMobile ? undefined : '2d slider');\n\n const ariaLabelX = this.labelX;\n const ariaLabelY = this.labelY;\n const ariaValueX = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.x);\n const ariaValueY = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.y);\n\n const style = {\n background: `linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`,\n };\n\n return html`\n <div\n @pointerdown=${this.handleAreaPointerdown}\n class=\"gradient\"\n style=\"background: ${style.background};\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=${this.colorController.getHslString()}\n ?disabled=${this.disabled}\n style=${`transform: translate(${\n (this.dir === 'ltr' ? this.x : 1 - this.x) * width\n }px, ${height - this.y * height}px);`}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [\n ['pointerup', 'pointercancel', 'pointerleave'],\n this.handlePointerup,\n ],\n })}\n ></sp-color-handle>\n\n <fieldset\n class=\"fieldset\"\n aria-label=${ifDefined(isMobile ? ariaLabel : undefined)}\n >\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"x\"\n aria-label=${isMobile ? ariaLabelX : `${ariaLabelX} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"horizontal\"\n aria-valuetext=${isMobile\n ? ariaValueX\n : `${ariaValueX}, ${ariaLabelX}${\n this._valueChanged ? '' : `, ${ariaValueY}, ${ariaLabelY}`\n }`}\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.x)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"y\"\n aria-label=${isMobile ? ariaLabelY : `${ariaLabelY} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"vertical\"\n aria-valuetext=${isMobile\n ? ariaValueY\n : `${ariaValueY}, ${ariaLabelY}${\n this._valueChanged ? '' : `, ${ariaValueX}, ${ariaLabelX}`\n }`}\n orient=\"vertical\"\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.y)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n </fieldset>\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n\n this.addEventListener('focus', this.handleFocus);\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('keyup', this.handleKeyup);\n this.addEventListener('keydown', this.handleKeydown);\n }\n\n /**\n * Overrides the `updated` method to handle changes in property values.\n *\n * @param changed - A map of changed properties with their previous values.\n *\n * This method performs the following actions:\n * - Updates the saturation (`s`) of the color if `x` has changed.\n * - Updates the value (`v`) of the color if `y` has changed.\n * - If the `focused` property has changed and is now true, it lazily binds\n * the `input[type=\"range\"]` elements in shadow roots to prevent multiple\n * tab stops within the Color Area for certain browser settings (e.g., Webkit).\n */\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n if (this.x !== this.inputX.valueAsNumber) {\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n }\n if (this.y !== this.inputY.valueAsNumber) {\n this.colorController.color.set(\n 'v',\n (1 - this.inputY.valueAsNumber) * 100\n );\n }\n if (changed.has('focused') && this.focused) {\n // Lazily bind the `input[type=\"range\"]` elements in shadow roots\n // so that browsers with certain settings (Webkit) aren't allowed\n // multiple tab stops within the Color Area.\n const parentX = this.inputX.parentElement as HTMLDivElement;\n const parentY = this.inputY.parentElement as HTMLDivElement;\n if (!parentX.shadowRoot && !parentY.shadowRoot) {\n parentX.attachShadow({ mode: 'open' });\n parentY.attachShadow({ mode: 'open' });\n const slot = '<div tabindex=\"-1\"><slot></slot></div>';\n (parentX.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n (parentY.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n }\n }\n }\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.observer &&\n (window as unknown as WithSWCResizeObserver).ResizeObserver\n ) {\n this.observer = new (\n window as unknown as WithSWCResizeObserver\n ).ResizeObserver((entries: SWCResizeObserverEntry[]) => {\n for (const entry of entries) {\n this.boundingClientRect = entry.contentRect;\n }\n this.requestUpdate();\n });\n }\n this.observer?.observe(this);\n }\n\n public override disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEE;AAAA,EAEA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,OAEK;AACP,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,OAAO;AAEP,OAAO,YAAY;AASZ,aAAM,kBAAkB,gBAAgB;AAAA,EAAxC;AAAA;AAML,S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UAAU,CAAC;AAAA,GAXrC,UAYJ;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,UAAU,CAAC;AAAA,GAdrC,UAeJ;AAGC;AAAA,EADP,MAAM,SAAS;AAAA,GAjBL,UAkBH;AAmCG;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GApDf,UAqDA;AASA;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA7Df,UA8DA;AAKA;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAlEf,UAmEA;AASH;AAAA,EADP,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GA3EnB,UA4EH;AAGG;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA9Ef,UA+EA;AAoBA;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAlGf,UAmGA;AAkBJ;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GApHf,UAqHJ;AAGA;AAAA,EADN,MAAM,YAAY;AAAA,GAvHR,UAwHJ;AAGA;AAAA,EADN,MAAM,YAAY;AAAA,GA1HR,UA2HJ;",
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport type { ColorHandle } from '@spectrum-web-components/color-handle';\nimport {\n ColorController,\n ColorTypes,\n} from '@spectrum-web-components/reactive-controllers/src/ColorController.js';\nimport { LanguageResolutionController } from '@spectrum-web-components/reactive-controllers/src/LanguageResolution.js';\nimport {\n isAndroid,\n isIOS,\n} from '@spectrum-web-components/shared/src/platform.js';\n\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\n\nimport styles from './color-area.css.js';\nimport { SWCResizeObserverEntry, WithSWCResizeObserver } from './types.dev.js'\n\n/**\n * @element sp-color-area\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Area has changed.\n * @fires change - An alteration to the value of the Color Area has been committed by the user.\n */\nexport class ColorArea extends SpectrumElement {\n public static override 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 @property({ type: String, attribute: 'label-x' })\n public labelX = 'saturation';\n\n @property({ type: String, attribute: 'label-y' })\n public labelY = 'luminosity';\n\n @query('.handle')\n private handle!: ColorHandle;\n\n private languageResolver = new LanguageResolutionController(this);\n\n /**\n * A controller for managing color interactions within the ColorArea component.\n *\n * The `ColorController` is instantiated with the `manageAs` option set to `hsv`\n * because the ColorArea component is designed to manipulate the saturation (`s`)\n * and value (`v`) components of the HSV color model along the x and y axes,\n * respectively. In the HSV color model:\n *\n * - The `hue` (h) represents the color type and is typically controlled by a separate input.\n * - The `saturation` (s) represents the intensity of the color, ranging from 0% (gray) to 100% (full color).\n * - The `value` (v) represents the brightness of the color, ranging from 0% (black) to 100% (full brightness).\n *\n * In the ColorArea component:\n *\n * - The x-axis controls the saturation (`s`), allowing users to adjust the intensity of the color.\n * - The y-axis controls the value (`v`), allowing users to adjust the brightness of the color.\n *\n * By managing the color as `hsv`, the ColorController can efficiently handle the changes in saturation and value\n * as the user interacts with the ColorArea component.\n *\n * @private\n * @type {ColorController}\n * @memberof ColorArea\n *\n * @property {ColorArea} this - The instance of the ColorArea component.\n * @property {object} options - Configuration options for the ColorController.\n * @property {string} options.manageAs - Specifies the color model to manage, in this case 'hsv'.\n */\n private colorController = new ColorController(this, { manageAs: 'hsv' });\n\n @property({ type: Number })\n public get hue(): number {\n return this.colorController.hue;\n }\n\n public set hue(value: number) {\n this.colorController.hue = value;\n }\n\n @property({ type: String })\n public get value(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n @property({ type: String })\n public get color(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n public set color(color: ColorTypes) {\n this.colorController.color = color;\n }\n\n @property({ attribute: false })\n private activeAxis = 'x';\n\n @property({ type: Number })\n public get x(): number {\n return this.colorController.color.hsv.s / 100;\n }\n\n public set x(x: number) {\n if (x === this.x) {\n return;\n }\n const oldValue = this.x;\n if (this.inputX) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputX.value = x.toString();\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n } else {\n this.colorController.color.set('s', x * 100);\n }\n this.requestUpdate('x', oldValue);\n }\n\n @property({ type: Number })\n public get y(): number {\n return this.colorController.color.hsv.v / 100;\n }\n\n public set y(y: number) {\n if (y === this.y) {\n return;\n }\n const oldValue = this.y;\n if (this.inputY) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputY.value = y.toString();\n this.colorController.color.set('v', this.inputY.valueAsNumber * 100);\n }\n this.requestUpdate('y', oldValue);\n }\n\n @property({ type: Number })\n public step = 0.01;\n\n @query('[name=\"x\"]')\n public inputX!: HTMLInputElement;\n\n @query('[name=\"y\"]')\n public inputY!: HTMLInputElement;\n\n private altered = 0;\n\n private activeKeys = new Set();\n\n private _valueChanged = false;\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n if (this.activeAxis === 'x') {\n this.inputX.focus();\n } else {\n this.inputY.focus();\n }\n }\n\n private handleFocus(): void {\n this.focused = true;\n this._valueChanged = false;\n }\n\n public handleBlur(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n this._valueChanged = false;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n this.focused = true;\n\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n const isArrowKey =\n code.search('Arrow') === 0 ||\n code.search('Page') === 0 ||\n code.search('Home') === 0 ||\n code.search('End') === 0;\n if (isArrowKey) {\n event.preventDefault();\n this.activeKeys.add(code);\n this.handleKeypress();\n }\n }\n\n private handleKeypress(): void {\n let deltaX = 0;\n let deltaY = 0;\n const step = Math.max(this.step, this.altered * 5 * this.step);\n this.activeKeys.forEach((code) => {\n switch (code) {\n case 'ArrowUp':\n deltaY = step;\n break;\n case 'ArrowDown':\n deltaY = step * -1;\n break;\n case 'ArrowLeft':\n deltaX = this.step * (this.dir === 'ltr' ? -1 : 1);\n break;\n case 'ArrowRight':\n deltaX = this.step * (this.dir === 'ltr' ? 1 : -1);\n break;\n case 'PageUp':\n deltaY = step * 10;\n break;\n case 'PageDown':\n deltaY = step * -10;\n break;\n case 'Home':\n deltaX = step * (this.dir === 'ltr' ? -10 : 10);\n break;\n case 'End':\n deltaX = step * (this.dir === 'ltr' ? 10 : -10);\n break;\n /* c8 ignore next 2 */\n default:\n break;\n }\n });\n if (deltaX != 0) {\n this.activeAxis = 'x';\n this.inputX.focus();\n } else if (deltaY != 0) {\n this.activeAxis = 'y';\n this.inputY.focus();\n }\n this.x = Math.min(1, Math.max(this.x + deltaX, 0));\n this.y = Math.min(1, Math.max(this.y + deltaY, 0));\n\n this.colorController.savePreviousColor();\n\n if (deltaX != 0 || deltaY != 0) {\n this._valueChanged = true;\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\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.colorController.restorePreviousColor();\n }\n }\n }\n\n private handleKeyup(event: KeyboardEvent): void {\n event.preventDefault();\n const { code } = event;\n this.activeKeys.delete(code);\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber, name } = event.target;\n\n this[name as 'x' | 'y'] = valueAsNumber;\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 cancelable: true,\n })\n );\n }\n\n private boundingClientRect!: DOMRect;\n public _pointerDown = false;\n\n /**\n * Returns a DOMRect describing the content box of the color area in viewport\n * coordinates, excluding the element's border. Using the content box ensures\n * that pointer calculations and handle rendering are aligned to the visible\n * gradient area rather than to the border edge.\n */\n private getContentBoundingRect(): DOMRect {\n const outer = this.getBoundingClientRect();\n const style = getComputedStyle(this);\n const bl = parseFloat(style.borderLeftWidth);\n const bt = parseFloat(style.borderTopWidth);\n const br = parseFloat(style.borderRightWidth);\n const bb = parseFloat(style.borderBottomWidth);\n return new DOMRect(\n outer.left + bl,\n outer.top + bt,\n outer.width - bl - br,\n outer.height - bt - bb\n );\n }\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this.colorController.savePreviousColor();\n this.boundingClientRect = this.getContentBoundingRect();\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 const [x, y] = this.calculateHandlePosition(event);\n\n this._valueChanged = false;\n\n this.x = x;\n this.y = y;\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 event.preventDefault();\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n this.inputX.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n if (!applyDefault) {\n this.colorController.restorePreviousColor();\n }\n }\n\n /**\n * Returns the value under the cursor\n *\n * @param event - PointerEvent on slider\n * @returns Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): [number, number] {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return [this.x, this.y];\n }\n const rect = this.boundingClientRect;\n const minOffsetX = rect.left;\n const minOffsetY = rect.top;\n const offsetX = event.clientX;\n const offsetY = event.clientY;\n const width = rect.width;\n const height = rect.height;\n\n const percentX = Math.max(0, Math.min(1, (offsetX - minOffsetX) / width));\n const percentY = Math.max(0, Math.min(1, (offsetY - minOffsetY) / height));\n\n return [this.dir === 'ltr' ? percentX : 1 - percentX, 1 - percentY];\n }\n\n private handleAreaPointerdown(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 protected override render(): TemplateResult {\n const { width = 0, height = 0 } = this.boundingClientRect || {};\n\n const isMobile = isAndroid() || isIOS();\n const defaultAriaLabel = 'Color Picker';\n const ariaLabel = defaultAriaLabel;\n const ariaRoleDescription = ifDefined(isMobile ? undefined : '2d slider');\n\n const ariaLabelX = this.labelX;\n const ariaLabelY = this.labelY;\n const ariaValueX = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.x);\n const ariaValueY = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.y);\n\n const style = {\n background: `linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`,\n };\n\n return html`\n <div\n @pointerdown=${this.handleAreaPointerdown}\n class=\"gradient\"\n style=\"background: ${style.background};\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=${this.colorController.getHslString()}\n ?disabled=${this.disabled}\n style=${`transform: translate(${\n (this.dir === 'ltr' ? this.x : 1 - this.x) * width\n }px, ${height - this.y * height}px);`}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [\n ['pointerup', 'pointercancel', 'pointerleave'],\n this.handlePointerup,\n ],\n })}\n ></sp-color-handle>\n\n <fieldset\n class=\"fieldset\"\n aria-label=${ifDefined(isMobile ? ariaLabel : undefined)}\n >\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"x\"\n aria-label=${isMobile ? ariaLabelX : `${ariaLabelX} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"horizontal\"\n aria-valuetext=${isMobile\n ? ariaValueX\n : `${ariaValueX}, ${ariaLabelX}${\n this._valueChanged ? '' : `, ${ariaValueY}, ${ariaLabelY}`\n }`}\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.x)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"y\"\n aria-label=${isMobile ? ariaLabelY : `${ariaLabelY} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"vertical\"\n aria-valuetext=${isMobile\n ? ariaValueY\n : `${ariaValueY}, ${ariaLabelY}${\n this._valueChanged ? '' : `, ${ariaValueX}, ${ariaLabelX}`\n }`}\n orient=\"vertical\"\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.y)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n </fieldset>\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getContentBoundingRect();\n\n this.addEventListener('focus', this.handleFocus);\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('keyup', this.handleKeyup);\n this.addEventListener('keydown', this.handleKeydown);\n }\n\n /**\n * Overrides the `updated` method to handle changes in property values.\n *\n * @param changed - A map of changed properties with their previous values.\n *\n * This method performs the following actions:\n * - Updates the saturation (`s`) of the color if `x` has changed.\n * - Updates the value (`v`) of the color if `y` has changed.\n * - If the `focused` property has changed and is now true, it lazily binds\n * the `input[type=\"range\"]` elements in shadow roots to prevent multiple\n * tab stops within the Color Area for certain browser settings (e.g., Webkit).\n */\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n if (this.x !== this.inputX.valueAsNumber) {\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n }\n if (this.y !== this.inputY.valueAsNumber) {\n this.colorController.color.set('v', this.inputY.valueAsNumber * 100);\n }\n if (changed.has('focused') && this.focused) {\n // Lazily bind the `input[type=\"range\"]` elements in shadow roots\n // so that browsers with certain settings (Webkit) aren't allowed\n // multiple tab stops within the Color Area.\n const parentX = this.inputX.parentElement as HTMLDivElement;\n const parentY = this.inputY.parentElement as HTMLDivElement;\n if (!parentX.shadowRoot && !parentY.shadowRoot) {\n parentX.attachShadow({ mode: 'open' });\n parentY.attachShadow({ mode: 'open' });\n const slot = '<div tabindex=\"-1\"><slot></slot></div>';\n (parentX.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n (parentY.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n }\n }\n }\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.observer &&\n (window as unknown as WithSWCResizeObserver).ResizeObserver\n ) {\n this.observer = new (\n window as unknown as WithSWCResizeObserver\n ).ResizeObserver((_entries: SWCResizeObserverEntry[]) => {\n this.boundingClientRect = this.getContentBoundingRect();\n this.requestUpdate();\n });\n }\n this.observer?.observe(this);\n }\n\n public override disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA,EAEE;AAAA,EAEA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,OAEK;AACP,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,OAAO;AAEP,OAAO,YAAY;AASZ,aAAM,kBAAkB,gBAAgB;AAAA,EAAxC;AAAA;AAML,SAAO,WAAW;AAGlB,SAAO,UAAU;AAGjB,SAAO,SAAS;AAGhB,SAAO,SAAS;AAKhB,SAAQ,mBAAmB,IAAI,6BAA6B,IAAI;AA8BhE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,kBAAkB,IAAI,gBAAgB,MAAM,EAAE,UAAU,MAAM,CAAC;AA0BvE,SAAQ,aAAa;AAyCrB,SAAO,OAAO;AAQd,SAAQ,UAAU;AAElB,SAAQ,aAAa,oBAAI,IAAI;AAE7B,SAAQ,gBAAgB;AA6IxB,SAAO,eAAe;AAAA;AAAA,EA7QtB,WAA2B,SAAyB;AAClD,WAAO,CAAC,MAAM;AAAA,EAChB;AAAA,EAkDA,IAAW,MAAc;AACvB,WAAO,KAAK,gBAAgB;AAAA,EAC9B;AAAA,EAEA,IAAW,IAAI,OAAe;AAC5B,SAAK,gBAAgB,MAAM;AAAA,EAC7B;AAAA,EAGA,IAAW,QAAoB;AAC7B,WAAO,KAAK,gBAAgB;AAAA,EAC9B;AAAA,EAGA,IAAW,QAAoB;AAC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A,GA3EnB,UA4EH;AAGG;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GA9Ef,UA+EA;AAoBA;AAAA,EADV,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAlGf,UAmGA;AAkBJ;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GApHf,UAqHJ;AAGA;AAAA,EADN,MAAM,YAAY;AAAA,GAvHR,UAwHJ;AAGA;AAAA,EADN,MAAM,YAAY;AAAA,GA1HR,UA2HJ;",
6
6
  "names": []
7
7
  }
package/src/ColorArea.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var r=(p,u,e,t)=>{for(var i=t>1?void 0:t?g(u,e):u,s=p.length-1,n;s>=0;s--)(n=p[s])&&(i=(t?n(u,e,i):n(i))||i);return t&&i&&m(u,e,i),i};import{html as y,SpectrumElement as w}from"@spectrum-web-components/base";import{property as o,query as v}from"@spectrum-web-components/base/src/decorators.js";import{ifDefined as b}from"@spectrum-web-components/base/src/directives.js";import{streamingListener as C}from"@spectrum-web-components/base/src/streaming-listener.js";import{ColorController as $}from"@spectrum-web-components/reactive-controllers/src/ColorController.js";import{LanguageResolutionController as x}from"@spectrum-web-components/reactive-controllers/src/LanguageResolution.js";import{isAndroid as E,isIOS as R}from"@spectrum-web-components/shared/src/platform.js";import"@spectrum-web-components/color-handle/sp-color-handle.js";import P from"./color-area.css.js";export class ColorArea extends w{constructor(){super(...arguments);this.disabled=!1;this.focused=!1;this.labelX="saturation";this.labelY="luminosity";this.languageResolver=new x(this);this.colorController=new $(this,{manageAs:"hsv"});this.activeAxis="x";this.step=.01;this.altered=0;this.activeKeys=new Set;this._valueChanged=!1;this._pointerDown=!1}static get styles(){return[P]}get hue(){return this.colorController.hue}set hue(e){this.colorController.hue=e}get value(){return this.colorController.colorValue}get color(){return this.colorController.colorValue}set color(e){this.colorController.color=e}get x(){return this.colorController.color.hsv.s/100}set x(e){if(e===this.x)return;const t=this.x;this.inputX?(this.inputX.value=e.toString(),this.colorController.color.set("s",this.inputX.valueAsNumber*100)):this.colorController.color.set("s",e*100),this.requestUpdate("x",t)}get y(){return this.colorController.color.hsv.v/100}set y(e){if(e===this.y)return;const t=this.y;this.inputY&&(this.inputY.value=e.toString(),this.colorController.color.set("v",this.inputY.valueAsNumber*100)),this.requestUpdate("y",t)}focus(e={}){super.focus(e),this.forwardFocus()}forwardFocus(){this.focused=this.hasVisibleFocusInTree(),this.activeAxis==="x"?this.inputX.focus():this.inputY.focus()}handleFocus(){this.focused=!0,this._valueChanged=!1}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1,this._valueChanged=!1)}handleKeydown(e){const{code:t}=e;this.focused=!0,this.altered=[e.shiftKey,e.ctrlKey,e.altKey].filter(s=>!!s).length,(t.search("Arrow")===0||t.search("Page")===0||t.search("Home")===0||t.search("End")===0)&&(e.preventDefault(),this.activeKeys.add(t),this.handleKeypress())}handleKeypress(){let e=0,t=0;const i=Math.max(this.step,this.altered*5*this.step);this.activeKeys.forEach(s=>{switch(s){case"ArrowUp":t=i;break;case"ArrowDown":t=i*-1;break;case"ArrowLeft":e=this.step*(this.dir==="ltr"?-1:1);break;case"ArrowRight":e=this.step*(this.dir==="ltr"?1:-1);break;case"PageUp":t=i*10;break;case"PageDown":t=i*-10;break;case"Home":e=i*(this.dir==="ltr"?-10:10);break;case"End":e=i*(this.dir==="ltr"?10:-10);break;default:break}}),e!=0?(this.activeAxis="x",this.inputX.focus()):t!=0&&(this.activeAxis="y",this.inputY.focus()),this.x=Math.min(1,Math.max(this.x+e,0)),this.y=Math.min(1,Math.max(this.y+t,0)),this.colorController.savePreviousColor(),(e!=0||t!=0)&&(this._valueChanged=!0,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor())}handleKeyup(e){e.preventDefault();const{code:t}=e;this.activeKeys.delete(t)}handleInput(e){const{valueAsNumber:t,name:i}=e.target;this[i]=t}handleChange(e){this.handleInput(e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerdown(e){if(e.button!==0){e.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getBoundingClientRect(),e.target.setPointerCapture(e.pointerId),e.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(e){const[t,i]=this.calculateHandlePosition(e);this._valueChanged=!1,this.x=t,this.y=i,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(e){e.preventDefault(),this._pointerDown=!1,e.target.releasePointerCapture(e.pointerId);const t=this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}));this.inputX.focus(),e.pointerType==="mouse"&&(this.focused=!1),t||this.colorController.restorePreviousColor()}calculateHandlePosition(e){if(!this.boundingClientRect)return[this.x,this.y];const t=this.boundingClientRect,i=t.left,s=t.top,n=e.clientX,c=e.clientY,a=t.width,l=t.height,h=Math.max(0,Math.min(1,(n-i)/a)),d=Math.max(0,Math.min(1,(c-s)/l));return[this.dir==="ltr"?h:1-h,1-d]}handleAreaPointerdown(e){e.button===0&&(e.stopPropagation(),e.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",e)),this.handlePointermove(e))}render(){const{width:e=0,height:t=0}=this.boundingClientRect||{},i=E()||R(),n="Color Picker",c=b(i?void 0:"2d slider"),a=this.labelX,l=this.labelY,h=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.x),d=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.y),f={background:`linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`};return y`
1
+ "use strict";var m=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var s=(p,d,e,t)=>{for(var i=t>1?void 0:t?g(d,e):d,r=p.length-1,o;r>=0;r--)(o=p[r])&&(i=(t?o(d,e,i):o(i))||i);return t&&i&&m(d,e,i),i};import{html as y,SpectrumElement as w}from"@spectrum-web-components/base";import{property as n,query as b}from"@spectrum-web-components/base/src/decorators.js";import{ifDefined as v}from"@spectrum-web-components/base/src/directives.js";import{streamingListener as C}from"@spectrum-web-components/base/src/streaming-listener.js";import{ColorController as $}from"@spectrum-web-components/reactive-controllers/src/ColorController.js";import{LanguageResolutionController as x}from"@spectrum-web-components/reactive-controllers/src/LanguageResolution.js";import{isAndroid as E,isIOS as R}from"@spectrum-web-components/shared/src/platform.js";import"@spectrum-web-components/color-handle/sp-color-handle.js";import P from"./color-area.css.js";export class ColorArea extends w{constructor(){super(...arguments);this.disabled=!1;this.focused=!1;this.labelX="saturation";this.labelY="luminosity";this.languageResolver=new x(this);this.colorController=new $(this,{manageAs:"hsv"});this.activeAxis="x";this.step=.01;this.altered=0;this.activeKeys=new Set;this._valueChanged=!1;this._pointerDown=!1}static get styles(){return[P]}get hue(){return this.colorController.hue}set hue(e){this.colorController.hue=e}get value(){return this.colorController.colorValue}get color(){return this.colorController.colorValue}set color(e){this.colorController.color=e}get x(){return this.colorController.color.hsv.s/100}set x(e){if(e===this.x)return;const t=this.x;this.inputX?(this.inputX.value=e.toString(),this.colorController.color.set("s",this.inputX.valueAsNumber*100)):this.colorController.color.set("s",e*100),this.requestUpdate("x",t)}get y(){return this.colorController.color.hsv.v/100}set y(e){if(e===this.y)return;const t=this.y;this.inputY&&(this.inputY.value=e.toString(),this.colorController.color.set("v",this.inputY.valueAsNumber*100)),this.requestUpdate("y",t)}focus(e={}){super.focus(e),this.forwardFocus()}forwardFocus(){this.focused=this.hasVisibleFocusInTree(),this.activeAxis==="x"?this.inputX.focus():this.inputY.focus()}handleFocus(){this.focused=!0,this._valueChanged=!1}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1,this._valueChanged=!1)}handleKeydown(e){const{code:t}=e;this.focused=!0,this.altered=[e.shiftKey,e.ctrlKey,e.altKey].filter(r=>!!r).length,(t.search("Arrow")===0||t.search("Page")===0||t.search("Home")===0||t.search("End")===0)&&(e.preventDefault(),this.activeKeys.add(t),this.handleKeypress())}handleKeypress(){let e=0,t=0;const i=Math.max(this.step,this.altered*5*this.step);this.activeKeys.forEach(r=>{switch(r){case"ArrowUp":t=i;break;case"ArrowDown":t=i*-1;break;case"ArrowLeft":e=this.step*(this.dir==="ltr"?-1:1);break;case"ArrowRight":e=this.step*(this.dir==="ltr"?1:-1);break;case"PageUp":t=i*10;break;case"PageDown":t=i*-10;break;case"Home":e=i*(this.dir==="ltr"?-10:10);break;case"End":e=i*(this.dir==="ltr"?10:-10);break;default:break}}),e!=0?(this.activeAxis="x",this.inputX.focus()):t!=0&&(this.activeAxis="y",this.inputY.focus()),this.x=Math.min(1,Math.max(this.x+e,0)),this.y=Math.min(1,Math.max(this.y+t,0)),this.colorController.savePreviousColor(),(e!=0||t!=0)&&(this._valueChanged=!0,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor())}handleKeyup(e){e.preventDefault();const{code:t}=e;this.activeKeys.delete(t)}handleInput(e){const{valueAsNumber:t,name:i}=e.target;this[i]=t}handleChange(e){this.handleInput(e),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))}getContentBoundingRect(){const e=this.getBoundingClientRect(),t=getComputedStyle(this),i=parseFloat(t.borderLeftWidth),r=parseFloat(t.borderTopWidth),o=parseFloat(t.borderRightWidth),a=parseFloat(t.borderBottomWidth);return new DOMRect(e.left+i,e.top+r,e.width-i-o,e.height-r-a)}handlePointerdown(e){if(e.button!==0){e.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getContentBoundingRect(),e.target.setPointerCapture(e.pointerId),e.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(e){const[t,i]=this.calculateHandlePosition(e);this._valueChanged=!1,this.x=t,this.y=i,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(e){e.preventDefault(),this._pointerDown=!1,e.target.releasePointerCapture(e.pointerId);const t=this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}));this.inputX.focus(),e.pointerType==="mouse"&&(this.focused=!1),t||this.colorController.restorePreviousColor()}calculateHandlePosition(e){if(!this.boundingClientRect)return[this.x,this.y];const t=this.boundingClientRect,i=t.left,r=t.top,o=e.clientX,a=e.clientY,l=t.width,h=t.height,u=Math.max(0,Math.min(1,(o-i)/l)),c=Math.max(0,Math.min(1,(a-r)/h));return[this.dir==="ltr"?u:1-u,1-c]}handleAreaPointerdown(e){e.button===0&&(e.stopPropagation(),e.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",e)),this.handlePointermove(e))}render(){const{width:e=0,height:t=0}=this.boundingClientRect||{},i=E()||R(),o="Color Picker",a=v(i?void 0:"2d slider"),l=this.labelX,h=this.labelY,u=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.x),c=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.y),f={background:`linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`};return y`
2
2
  <div
3
3
  @pointerdown=${this.handleAreaPointerdown}
4
4
  class="gradient"
@@ -8,7 +8,7 @@
8
8
  </div>
9
9
 
10
10
  <sp-color-handle
11
- tabindex=${b(this.focused?void 0:"0")}
11
+ tabindex=${v(this.focused?void 0:"0")}
12
12
  @focus=${this.forwardFocus}
13
13
  ?focused=${this.focused}
14
14
  class="handle"
@@ -20,17 +20,17 @@
20
20
 
21
21
  <fieldset
22
22
  class="fieldset"
23
- aria-label=${b(i?n:void 0)}
23
+ aria-label=${v(i?o:void 0)}
24
24
  >
25
25
  <div role="presentation">
26
26
  <input
27
27
  type="range"
28
28
  class="slider"
29
29
  name="x"
30
- aria-label=${i?a:`${a} ${n}`}
31
- aria-roledescription=${c}
30
+ aria-label=${i?l:`${l} ${o}`}
31
+ aria-roledescription=${a}
32
32
  aria-orientation="horizontal"
33
- aria-valuetext=${i?h:`${h}, ${a}${this._valueChanged?"":`, ${d}, ${l}`}`}
33
+ aria-valuetext=${i?u:`${u}, ${l}${this._valueChanged?"":`, ${c}, ${h}`}`}
34
34
  min="0"
35
35
  max="1"
36
36
  step=${this.step}
@@ -45,10 +45,10 @@
45
45
  type="range"
46
46
  class="slider"
47
47
  name="y"
48
- aria-label=${i?l:`${l} ${n}`}
49
- aria-roledescription=${c}
48
+ aria-label=${i?h:`${h} ${o}`}
49
+ aria-roledescription=${a}
50
50
  aria-orientation="vertical"
51
- aria-valuetext=${i?d:`${d}, ${l}${this._valueChanged?"":`, ${h}, ${a}`}`}
51
+ aria-valuetext=${i?c:`${c}, ${h}${this._valueChanged?"":`, ${u}, ${l}`}`}
52
52
  orient="vertical"
53
53
  min="0"
54
54
  max="1"
@@ -60,5 +60,5 @@
60
60
  />
61
61
  </div>
62
62
  </fieldset>
63
- `}firstUpdated(e){super.firstUpdated(e),this.boundingClientRect=this.getBoundingClientRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur),this.addEventListener("keyup",this.handleKeyup),this.addEventListener("keydown",this.handleKeydown)}updated(e){if(super.updated(e),this.x!==this.inputX.valueAsNumber&&this.colorController.color.set("s",this.inputX.valueAsNumber*100),this.y!==this.inputY.valueAsNumber&&this.colorController.color.set("v",(1-this.inputY.valueAsNumber)*100),e.has("focused")&&this.focused){const t=this.inputX.parentElement,i=this.inputY.parentElement;if(!t.shadowRoot&&!i.shadowRoot){t.attachShadow({mode:"open"}),i.attachShadow({mode:"open"});const s='<div tabindex="-1"><slot></slot></div>';t.shadowRoot.innerHTML=s,i.shadowRoot.innerHTML=s}}}connectedCallback(){var e;super.connectedCallback(),!this.observer&&window.ResizeObserver&&(this.observer=new window.ResizeObserver(t=>{for(const i of t)this.boundingClientRect=i.contentRect;this.requestUpdate()})),(e=this.observer)==null||e.observe(this)}disconnectedCallback(){var e;(e=this.observer)==null||e.unobserve(this),super.disconnectedCallback()}}r([o({type:Boolean,reflect:!0})],ColorArea.prototype,"disabled",2),r([o({type:Boolean,reflect:!0})],ColorArea.prototype,"focused",2),r([o({type:String,attribute:"label-x"})],ColorArea.prototype,"labelX",2),r([o({type:String,attribute:"label-y"})],ColorArea.prototype,"labelY",2),r([v(".handle")],ColorArea.prototype,"handle",2),r([o({type:Number})],ColorArea.prototype,"hue",1),r([o({type:String})],ColorArea.prototype,"value",1),r([o({type:String})],ColorArea.prototype,"color",1),r([o({attribute:!1})],ColorArea.prototype,"activeAxis",2),r([o({type:Number})],ColorArea.prototype,"x",1),r([o({type:Number})],ColorArea.prototype,"y",1),r([o({type:Number})],ColorArea.prototype,"step",2),r([v('[name="x"]')],ColorArea.prototype,"inputX",2),r([v('[name="y"]')],ColorArea.prototype,"inputY",2);
63
+ `}firstUpdated(e){super.firstUpdated(e),this.boundingClientRect=this.getContentBoundingRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur),this.addEventListener("keyup",this.handleKeyup),this.addEventListener("keydown",this.handleKeydown)}updated(e){if(super.updated(e),this.x!==this.inputX.valueAsNumber&&this.colorController.color.set("s",this.inputX.valueAsNumber*100),this.y!==this.inputY.valueAsNumber&&this.colorController.color.set("v",this.inputY.valueAsNumber*100),e.has("focused")&&this.focused){const t=this.inputX.parentElement,i=this.inputY.parentElement;if(!t.shadowRoot&&!i.shadowRoot){t.attachShadow({mode:"open"}),i.attachShadow({mode:"open"});const r='<div tabindex="-1"><slot></slot></div>';t.shadowRoot.innerHTML=r,i.shadowRoot.innerHTML=r}}}connectedCallback(){var e;super.connectedCallback(),!this.observer&&window.ResizeObserver&&(this.observer=new window.ResizeObserver(t=>{this.boundingClientRect=this.getContentBoundingRect(),this.requestUpdate()})),(e=this.observer)==null||e.observe(this)}disconnectedCallback(){var e;(e=this.observer)==null||e.unobserve(this),super.disconnectedCallback()}}s([n({type:Boolean,reflect:!0})],ColorArea.prototype,"disabled",2),s([n({type:Boolean,reflect:!0})],ColorArea.prototype,"focused",2),s([n({type:String,attribute:"label-x"})],ColorArea.prototype,"labelX",2),s([n({type:String,attribute:"label-y"})],ColorArea.prototype,"labelY",2),s([b(".handle")],ColorArea.prototype,"handle",2),s([n({type:Number})],ColorArea.prototype,"hue",1),s([n({type:String})],ColorArea.prototype,"value",1),s([n({type:String})],ColorArea.prototype,"color",1),s([n({attribute:!1})],ColorArea.prototype,"activeAxis",2),s([n({type:Number})],ColorArea.prototype,"x",1),s([n({type:Number})],ColorArea.prototype,"y",1),s([n({type:Number})],ColorArea.prototype,"step",2),s([b('[name="x"]')],ColorArea.prototype,"inputX",2),s([b('[name="y"]')],ColorArea.prototype,"inputY",2);
64
64
  //# sourceMappingURL=ColorArea.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["ColorArea.ts"],
4
- "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport type { ColorHandle } from '@spectrum-web-components/color-handle';\nimport {\n ColorController,\n ColorTypes,\n} from '@spectrum-web-components/reactive-controllers/src/ColorController.js';\nimport { LanguageResolutionController } from '@spectrum-web-components/reactive-controllers/src/LanguageResolution.js';\nimport {\n isAndroid,\n isIOS,\n} from '@spectrum-web-components/shared/src/platform.js';\n\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\n\nimport styles from './color-area.css.js';\nimport { SWCResizeObserverEntry, WithSWCResizeObserver } from './types.js';\n\n/**\n * @element sp-color-area\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Area has changed.\n * @fires change - An alteration to the value of the Color Area has been committed by the user.\n */\nexport class ColorArea extends SpectrumElement {\n public static override 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 @property({ type: String, attribute: 'label-x' })\n public labelX = 'saturation';\n\n @property({ type: String, attribute: 'label-y' })\n public labelY = 'luminosity';\n\n @query('.handle')\n private handle!: ColorHandle;\n\n private languageResolver = new LanguageResolutionController(this);\n\n /**\n * A controller for managing color interactions within the ColorArea component.\n *\n * The `ColorController` is instantiated with the `manageAs` option set to `hsv`\n * because the ColorArea component is designed to manipulate the saturation (`s`)\n * and value (`v`) components of the HSV color model along the x and y axes,\n * respectively. In the HSV color model:\n *\n * - The `hue` (h) represents the color type and is typically controlled by a separate input.\n * - The `saturation` (s) represents the intensity of the color, ranging from 0% (gray) to 100% (full color).\n * - The `value` (v) represents the brightness of the color, ranging from 0% (black) to 100% (full brightness).\n *\n * In the ColorArea component:\n *\n * - The x-axis controls the saturation (`s`), allowing users to adjust the intensity of the color.\n * - The y-axis controls the value (`v`), allowing users to adjust the brightness of the color.\n *\n * By managing the color as `hsv`, the ColorController can efficiently handle the changes in saturation and value\n * as the user interacts with the ColorArea component.\n *\n * @private\n * @type {ColorController}\n * @memberof ColorArea\n *\n * @property {ColorArea} this - The instance of the ColorArea component.\n * @property {object} options - Configuration options for the ColorController.\n * @property {string} options.manageAs - Specifies the color model to manage, in this case 'hsv'.\n */\n private colorController = new ColorController(this, { manageAs: 'hsv' });\n\n @property({ type: Number })\n public get hue(): number {\n return this.colorController.hue;\n }\n\n public set hue(value: number) {\n this.colorController.hue = value;\n }\n\n @property({ type: String })\n public get value(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n @property({ type: String })\n public get color(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n public set color(color: ColorTypes) {\n this.colorController.color = color;\n }\n\n @property({ attribute: false })\n private activeAxis = 'x';\n\n @property({ type: Number })\n public get x(): number {\n return this.colorController.color.hsv.s / 100;\n }\n\n public set x(x: number) {\n if (x === this.x) {\n return;\n }\n const oldValue = this.x;\n if (this.inputX) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputX.value = x.toString();\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n } else {\n this.colorController.color.set('s', x * 100);\n }\n this.requestUpdate('x', oldValue);\n }\n\n @property({ type: Number })\n public get y(): number {\n return this.colorController.color.hsv.v / 100;\n }\n\n public set y(y: number) {\n if (y === this.y) {\n return;\n }\n const oldValue = this.y;\n if (this.inputY) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputY.value = y.toString();\n this.colorController.color.set('v', this.inputY.valueAsNumber * 100);\n }\n this.requestUpdate('y', oldValue);\n }\n\n @property({ type: Number })\n public step = 0.01;\n\n @query('[name=\"x\"]')\n public inputX!: HTMLInputElement;\n\n @query('[name=\"y\"]')\n public inputY!: HTMLInputElement;\n\n private altered = 0;\n\n private activeKeys = new Set();\n\n private _valueChanged = false;\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n if (this.activeAxis === 'x') {\n this.inputX.focus();\n } else {\n this.inputY.focus();\n }\n }\n\n private handleFocus(): void {\n this.focused = true;\n this._valueChanged = false;\n }\n\n public handleBlur(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n this._valueChanged = false;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n this.focused = true;\n\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n const isArrowKey =\n code.search('Arrow') === 0 ||\n code.search('Page') === 0 ||\n code.search('Home') === 0 ||\n code.search('End') === 0;\n if (isArrowKey) {\n event.preventDefault();\n this.activeKeys.add(code);\n this.handleKeypress();\n }\n }\n\n private handleKeypress(): void {\n let deltaX = 0;\n let deltaY = 0;\n const step = Math.max(this.step, this.altered * 5 * this.step);\n this.activeKeys.forEach((code) => {\n switch (code) {\n case 'ArrowUp':\n deltaY = step;\n break;\n case 'ArrowDown':\n deltaY = step * -1;\n break;\n case 'ArrowLeft':\n deltaX = this.step * (this.dir === 'ltr' ? -1 : 1);\n break;\n case 'ArrowRight':\n deltaX = this.step * (this.dir === 'ltr' ? 1 : -1);\n break;\n case 'PageUp':\n deltaY = step * 10;\n break;\n case 'PageDown':\n deltaY = step * -10;\n break;\n case 'Home':\n deltaX = step * (this.dir === 'ltr' ? -10 : 10);\n break;\n case 'End':\n deltaX = step * (this.dir === 'ltr' ? 10 : -10);\n break;\n /* c8 ignore next 2 */\n default:\n break;\n }\n });\n if (deltaX != 0) {\n this.activeAxis = 'x';\n this.inputX.focus();\n } else if (deltaY != 0) {\n this.activeAxis = 'y';\n this.inputY.focus();\n }\n this.x = Math.min(1, Math.max(this.x + deltaX, 0));\n this.y = Math.min(1, Math.max(this.y + deltaY, 0));\n\n this.colorController.savePreviousColor();\n\n if (deltaX != 0 || deltaY != 0) {\n this._valueChanged = true;\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\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.colorController.restorePreviousColor();\n }\n }\n }\n\n private handleKeyup(event: KeyboardEvent): void {\n event.preventDefault();\n const { code } = event;\n this.activeKeys.delete(code);\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber, name } = event.target;\n\n this[name as 'x' | 'y'] = valueAsNumber;\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 cancelable: true,\n })\n );\n }\n\n private boundingClientRect!: DOMRect;\n public _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.colorController.savePreviousColor();\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 const [x, y] = this.calculateHandlePosition(event);\n\n this._valueChanged = false;\n\n this.x = x;\n this.y = y;\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 event.preventDefault();\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n this.inputX.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n if (!applyDefault) {\n this.colorController.restorePreviousColor();\n }\n }\n\n /**\n * Returns the value under the cursor\n *\n * @param event - PointerEvent on slider\n * @returns Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): [number, number] {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return [this.x, this.y];\n }\n const rect = this.boundingClientRect;\n const minOffsetX = rect.left;\n const minOffsetY = rect.top;\n const offsetX = event.clientX;\n const offsetY = event.clientY;\n const width = rect.width;\n const height = rect.height;\n\n const percentX = Math.max(0, Math.min(1, (offsetX - minOffsetX) / width));\n const percentY = Math.max(0, Math.min(1, (offsetY - minOffsetY) / height));\n\n return [this.dir === 'ltr' ? percentX : 1 - percentX, 1 - percentY];\n }\n\n private handleAreaPointerdown(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 protected override render(): TemplateResult {\n const { width = 0, height = 0 } = this.boundingClientRect || {};\n\n const isMobile = isAndroid() || isIOS();\n const defaultAriaLabel = 'Color Picker';\n const ariaLabel = defaultAriaLabel;\n const ariaRoleDescription = ifDefined(isMobile ? undefined : '2d slider');\n\n const ariaLabelX = this.labelX;\n const ariaLabelY = this.labelY;\n const ariaValueX = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.x);\n const ariaValueY = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.y);\n\n const style = {\n background: `linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`,\n };\n\n return html`\n <div\n @pointerdown=${this.handleAreaPointerdown}\n class=\"gradient\"\n style=\"background: ${style.background};\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=${this.colorController.getHslString()}\n ?disabled=${this.disabled}\n style=${`transform: translate(${\n (this.dir === 'ltr' ? this.x : 1 - this.x) * width\n }px, ${height - this.y * height}px);`}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [\n ['pointerup', 'pointercancel', 'pointerleave'],\n this.handlePointerup,\n ],\n })}\n ></sp-color-handle>\n\n <fieldset\n class=\"fieldset\"\n aria-label=${ifDefined(isMobile ? ariaLabel : undefined)}\n >\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"x\"\n aria-label=${isMobile ? ariaLabelX : `${ariaLabelX} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"horizontal\"\n aria-valuetext=${isMobile\n ? ariaValueX\n : `${ariaValueX}, ${ariaLabelX}${\n this._valueChanged ? '' : `, ${ariaValueY}, ${ariaLabelY}`\n }`}\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.x)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"y\"\n aria-label=${isMobile ? ariaLabelY : `${ariaLabelY} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"vertical\"\n aria-valuetext=${isMobile\n ? ariaValueY\n : `${ariaValueY}, ${ariaLabelY}${\n this._valueChanged ? '' : `, ${ariaValueX}, ${ariaLabelX}`\n }`}\n orient=\"vertical\"\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.y)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n </fieldset>\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getBoundingClientRect();\n\n this.addEventListener('focus', this.handleFocus);\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('keyup', this.handleKeyup);\n this.addEventListener('keydown', this.handleKeydown);\n }\n\n /**\n * Overrides the `updated` method to handle changes in property values.\n *\n * @param changed - A map of changed properties with their previous values.\n *\n * This method performs the following actions:\n * - Updates the saturation (`s`) of the color if `x` has changed.\n * - Updates the value (`v`) of the color if `y` has changed.\n * - If the `focused` property has changed and is now true, it lazily binds\n * the `input[type=\"range\"]` elements in shadow roots to prevent multiple\n * tab stops within the Color Area for certain browser settings (e.g., Webkit).\n */\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n if (this.x !== this.inputX.valueAsNumber) {\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n }\n if (this.y !== this.inputY.valueAsNumber) {\n this.colorController.color.set(\n 'v',\n (1 - this.inputY.valueAsNumber) * 100\n );\n }\n if (changed.has('focused') && this.focused) {\n // Lazily bind the `input[type=\"range\"]` elements in shadow roots\n // so that browsers with certain settings (Webkit) aren't allowed\n // multiple tab stops within the Color Area.\n const parentX = this.inputX.parentElement as HTMLDivElement;\n const parentY = this.inputY.parentElement as HTMLDivElement;\n if (!parentX.shadowRoot && !parentY.shadowRoot) {\n parentX.attachShadow({ mode: 'open' });\n parentY.attachShadow({ mode: 'open' });\n const slot = '<div tabindex=\"-1\"><slot></slot></div>';\n (parentX.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n (parentY.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n }\n }\n }\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.observer &&\n (window as unknown as WithSWCResizeObserver).ResizeObserver\n ) {\n this.observer = new (\n window as unknown as WithSWCResizeObserver\n ).ResizeObserver((entries: SWCResizeObserverEntry[]) => {\n for (const entry of entries) {\n this.boundingClientRect = entry.contentRect;\n }\n this.requestUpdate();\n });\n }\n this.observer?.observe(this);\n }\n\n public override disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n}\n"],
5
- "mappings": "qNAYA,OAEE,QAAAA,EAEA,mBAAAC,MAEK,gCACP,OACE,YAAAC,EACA,SAAAC,MACK,kDACP,OAAS,aAAAC,MAAiB,kDAC1B,OAAS,qBAAAC,MAAyB,0DAElC,OACE,mBAAAC,MAEK,uEACP,OAAS,gCAA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GAdrC,UAeJ,sBAGCgD,EAAA,CADP/C,EAAM,SAAS,GAjBL,UAkBH,sBAmCG+C,EAAA,CADVhD,EAAS,CAAE,KAAM,MAAO,CAAC,GApDf,UAqDA,mBASAgD,EAAA,CADVhD,EAAS,CAAE,KAAM,MAAO,CAAC,GA7Df,UA8DA,qBAKAgD,EAAA,CADVhD,EAAS,CAAE,KAAM,MAAO,CAAC,GAlEf,UAmEA,qBASHgD,EAAA,CADPhD,EAAS,CAAE,UAAW,EAAM,CAAC,GA3EnB,UA4EH,0BAGGgD,EAAA,CADVhD,EAAS,CAAE,KAAM,MAAO,CAAC,GA9Ef,UA+EA,iBAoBAgD,EAAA,CADVhD,EAAS,CAAE,KAAM,MAAO,CAAC,GAlGf,UAmGA,iBAkBJgD,EAAA,CADNhD,EAAS,CAAE,KAAM,MAAO,CAAC,GApHf,UAqHJ,oBAGAgD,EAAA,CADN/C,EAAM,YAAY,GAvHR,UAwHJ,sBAGA+C,EAAA,CADN/C,EAAM,YAAY,GA1HR,UA2HJ",
6
- "names": ["html", "SpectrumElement", "property", "query", "ifDefined", "streamingListener", "ColorController", "LanguageResolutionController", "isAndroid", "isIOS", "styles", "value", "color", "x", "oldValue", "y", "focusOptions", "event", "code", "key", "deltaX", "deltaY", "step", "valueAsNumber", "name", "applyDefault", "rect", "minOffsetX", "minOffsetY", "offsetX", "offsetY", "width", "height", "percentX", "percentY", "isMobile", "ariaLabel", "ariaRoleDescription", "ariaLabelX", "ariaLabelY", "ariaValueX", "ariaValueY", "style", "changed", "parentX", "parentY", "slot", "_a", "entries", "entry", "__decorateClass"]
4
+ "sourcesContent": ["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport { streamingListener } from '@spectrum-web-components/base/src/streaming-listener.js';\nimport type { ColorHandle } from '@spectrum-web-components/color-handle';\nimport {\n ColorController,\n ColorTypes,\n} from '@spectrum-web-components/reactive-controllers/src/ColorController.js';\nimport { LanguageResolutionController } from '@spectrum-web-components/reactive-controllers/src/LanguageResolution.js';\nimport {\n isAndroid,\n isIOS,\n} from '@spectrum-web-components/shared/src/platform.js';\n\nimport '@spectrum-web-components/color-handle/sp-color-handle.js';\n\nimport styles from './color-area.css.js';\nimport { SWCResizeObserverEntry, WithSWCResizeObserver } from './types.js';\n\n/**\n * @element sp-color-area\n * @slot gradient - a custom gradient visually outlining the available color values\n * @fires input - The value of the Color Area has changed.\n * @fires change - An alteration to the value of the Color Area has been committed by the user.\n */\nexport class ColorArea extends SpectrumElement {\n public static override 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 @property({ type: String, attribute: 'label-x' })\n public labelX = 'saturation';\n\n @property({ type: String, attribute: 'label-y' })\n public labelY = 'luminosity';\n\n @query('.handle')\n private handle!: ColorHandle;\n\n private languageResolver = new LanguageResolutionController(this);\n\n /**\n * A controller for managing color interactions within the ColorArea component.\n *\n * The `ColorController` is instantiated with the `manageAs` option set to `hsv`\n * because the ColorArea component is designed to manipulate the saturation (`s`)\n * and value (`v`) components of the HSV color model along the x and y axes,\n * respectively. In the HSV color model:\n *\n * - The `hue` (h) represents the color type and is typically controlled by a separate input.\n * - The `saturation` (s) represents the intensity of the color, ranging from 0% (gray) to 100% (full color).\n * - The `value` (v) represents the brightness of the color, ranging from 0% (black) to 100% (full brightness).\n *\n * In the ColorArea component:\n *\n * - The x-axis controls the saturation (`s`), allowing users to adjust the intensity of the color.\n * - The y-axis controls the value (`v`), allowing users to adjust the brightness of the color.\n *\n * By managing the color as `hsv`, the ColorController can efficiently handle the changes in saturation and value\n * as the user interacts with the ColorArea component.\n *\n * @private\n * @type {ColorController}\n * @memberof ColorArea\n *\n * @property {ColorArea} this - The instance of the ColorArea component.\n * @property {object} options - Configuration options for the ColorController.\n * @property {string} options.manageAs - Specifies the color model to manage, in this case 'hsv'.\n */\n private colorController = new ColorController(this, { manageAs: 'hsv' });\n\n @property({ type: Number })\n public get hue(): number {\n return this.colorController.hue;\n }\n\n public set hue(value: number) {\n this.colorController.hue = value;\n }\n\n @property({ type: String })\n public get value(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n @property({ type: String })\n public get color(): ColorTypes {\n return this.colorController.colorValue;\n }\n\n public set color(color: ColorTypes) {\n this.colorController.color = color;\n }\n\n @property({ attribute: false })\n private activeAxis = 'x';\n\n @property({ type: Number })\n public get x(): number {\n return this.colorController.color.hsv.s / 100;\n }\n\n public set x(x: number) {\n if (x === this.x) {\n return;\n }\n const oldValue = this.x;\n if (this.inputX) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputX.value = x.toString();\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n } else {\n this.colorController.color.set('s', x * 100);\n }\n this.requestUpdate('x', oldValue);\n }\n\n @property({ type: Number })\n public get y(): number {\n return this.colorController.color.hsv.v / 100;\n }\n\n public set y(y: number) {\n if (y === this.y) {\n return;\n }\n const oldValue = this.y;\n if (this.inputY) {\n // Use the native `input[type='range']` control to validate this value after `firstUpdate`\n this.inputY.value = y.toString();\n this.colorController.color.set('v', this.inputY.valueAsNumber * 100);\n }\n this.requestUpdate('y', oldValue);\n }\n\n @property({ type: Number })\n public step = 0.01;\n\n @query('[name=\"x\"]')\n public inputX!: HTMLInputElement;\n\n @query('[name=\"y\"]')\n public inputY!: HTMLInputElement;\n\n private altered = 0;\n\n private activeKeys = new Set();\n\n private _valueChanged = false;\n\n public override focus(focusOptions: FocusOptions = {}): void {\n super.focus(focusOptions);\n this.forwardFocus();\n }\n\n private forwardFocus(): void {\n this.focused = this.hasVisibleFocusInTree();\n if (this.activeAxis === 'x') {\n this.inputX.focus();\n } else {\n this.inputY.focus();\n }\n }\n\n private handleFocus(): void {\n this.focused = true;\n this._valueChanged = false;\n }\n\n public handleBlur(): void {\n if (this._pointerDown) {\n return;\n }\n this.altered = 0;\n this.focused = false;\n this._valueChanged = false;\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n this.focused = true;\n\n this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(\n (key) => !!key\n ).length;\n const isArrowKey =\n code.search('Arrow') === 0 ||\n code.search('Page') === 0 ||\n code.search('Home') === 0 ||\n code.search('End') === 0;\n if (isArrowKey) {\n event.preventDefault();\n this.activeKeys.add(code);\n this.handleKeypress();\n }\n }\n\n private handleKeypress(): void {\n let deltaX = 0;\n let deltaY = 0;\n const step = Math.max(this.step, this.altered * 5 * this.step);\n this.activeKeys.forEach((code) => {\n switch (code) {\n case 'ArrowUp':\n deltaY = step;\n break;\n case 'ArrowDown':\n deltaY = step * -1;\n break;\n case 'ArrowLeft':\n deltaX = this.step * (this.dir === 'ltr' ? -1 : 1);\n break;\n case 'ArrowRight':\n deltaX = this.step * (this.dir === 'ltr' ? 1 : -1);\n break;\n case 'PageUp':\n deltaY = step * 10;\n break;\n case 'PageDown':\n deltaY = step * -10;\n break;\n case 'Home':\n deltaX = step * (this.dir === 'ltr' ? -10 : 10);\n break;\n case 'End':\n deltaX = step * (this.dir === 'ltr' ? 10 : -10);\n break;\n /* c8 ignore next 2 */\n default:\n break;\n }\n });\n if (deltaX != 0) {\n this.activeAxis = 'x';\n this.inputX.focus();\n } else if (deltaY != 0) {\n this.activeAxis = 'y';\n this.inputY.focus();\n }\n this.x = Math.min(1, Math.max(this.x + deltaX, 0));\n this.y = Math.min(1, Math.max(this.y + deltaY, 0));\n\n this.colorController.savePreviousColor();\n\n if (deltaX != 0 || deltaY != 0) {\n this._valueChanged = true;\n this.dispatchEvent(\n new Event('input', {\n bubbles: true,\n composed: true,\n })\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.colorController.restorePreviousColor();\n }\n }\n }\n\n private handleKeyup(event: KeyboardEvent): void {\n event.preventDefault();\n const { code } = event;\n this.activeKeys.delete(code);\n }\n\n private handleInput(event: Event & { target: HTMLInputElement }): void {\n const { valueAsNumber, name } = event.target;\n\n this[name as 'x' | 'y'] = valueAsNumber;\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 cancelable: true,\n })\n );\n }\n\n private boundingClientRect!: DOMRect;\n public _pointerDown = false;\n\n /**\n * Returns a DOMRect describing the content box of the color area in viewport\n * coordinates, excluding the element's border. Using the content box ensures\n * that pointer calculations and handle rendering are aligned to the visible\n * gradient area rather than to the border edge.\n */\n private getContentBoundingRect(): DOMRect {\n const outer = this.getBoundingClientRect();\n const style = getComputedStyle(this);\n const bl = parseFloat(style.borderLeftWidth);\n const bt = parseFloat(style.borderTopWidth);\n const br = parseFloat(style.borderRightWidth);\n const bb = parseFloat(style.borderBottomWidth);\n return new DOMRect(\n outer.left + bl,\n outer.top + bt,\n outer.width - bl - br,\n outer.height - bt - bb\n );\n }\n\n private handlePointerdown(event: PointerEvent): void {\n if (event.button !== 0) {\n event.preventDefault();\n return;\n }\n this._pointerDown = true;\n this.colorController.savePreviousColor();\n this.boundingClientRect = this.getContentBoundingRect();\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 const [x, y] = this.calculateHandlePosition(event);\n\n this._valueChanged = false;\n\n this.x = x;\n this.y = y;\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 event.preventDefault();\n this._pointerDown = false;\n (event.target as HTMLElement).releasePointerCapture(event.pointerId);\n const applyDefault = this.dispatchEvent(\n new Event('change', {\n bubbles: true,\n composed: true,\n cancelable: true,\n })\n );\n this.inputX.focus();\n if (event.pointerType === 'mouse') {\n this.focused = false;\n }\n if (!applyDefault) {\n this.colorController.restorePreviousColor();\n }\n }\n\n /**\n * Returns the value under the cursor\n *\n * @param event - PointerEvent on slider\n * @returns Slider value that correlates to the position under the pointer\n */\n private calculateHandlePosition(event: PointerEvent): [number, number] {\n /* c8 ignore next 3 */\n if (!this.boundingClientRect) {\n return [this.x, this.y];\n }\n const rect = this.boundingClientRect;\n const minOffsetX = rect.left;\n const minOffsetY = rect.top;\n const offsetX = event.clientX;\n const offsetY = event.clientY;\n const width = rect.width;\n const height = rect.height;\n\n const percentX = Math.max(0, Math.min(1, (offsetX - minOffsetX) / width));\n const percentY = Math.max(0, Math.min(1, (offsetY - minOffsetY) / height));\n\n return [this.dir === 'ltr' ? percentX : 1 - percentX, 1 - percentY];\n }\n\n private handleAreaPointerdown(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 protected override render(): TemplateResult {\n const { width = 0, height = 0 } = this.boundingClientRect || {};\n\n const isMobile = isAndroid() || isIOS();\n const defaultAriaLabel = 'Color Picker';\n const ariaLabel = defaultAriaLabel;\n const ariaRoleDescription = ifDefined(isMobile ? undefined : '2d slider');\n\n const ariaLabelX = this.labelX;\n const ariaLabelY = this.labelY;\n const ariaValueX = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.x);\n const ariaValueY = new Intl.NumberFormat(this.languageResolver.language, {\n style: 'percent',\n unitDisplay: 'narrow',\n }).format(this.y);\n\n const style = {\n background: `linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`,\n };\n\n return html`\n <div\n @pointerdown=${this.handleAreaPointerdown}\n class=\"gradient\"\n style=\"background: ${style.background};\"\n >\n <slot name=\"gradient\"></slot>\n </div>\n\n <sp-color-handle\n tabindex=${ifDefined(this.focused ? undefined : '0')}\n @focus=${this.forwardFocus}\n ?focused=${this.focused}\n class=\"handle\"\n color=${this.colorController.getHslString()}\n ?disabled=${this.disabled}\n style=${`transform: translate(${\n (this.dir === 'ltr' ? this.x : 1 - this.x) * width\n }px, ${height - this.y * height}px);`}\n ${streamingListener({\n start: ['pointerdown', this.handlePointerdown],\n streamInside: ['pointermove', this.handlePointermove],\n end: [\n ['pointerup', 'pointercancel', 'pointerleave'],\n this.handlePointerup,\n ],\n })}\n ></sp-color-handle>\n\n <fieldset\n class=\"fieldset\"\n aria-label=${ifDefined(isMobile ? ariaLabel : undefined)}\n >\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"x\"\n aria-label=${isMobile ? ariaLabelX : `${ariaLabelX} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"horizontal\"\n aria-valuetext=${isMobile\n ? ariaValueX\n : `${ariaValueX}, ${ariaLabelX}${\n this._valueChanged ? '' : `, ${ariaValueY}, ${ariaLabelY}`\n }`}\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.x)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n <div role=\"presentation\">\n <input\n type=\"range\"\n class=\"slider\"\n name=\"y\"\n aria-label=${isMobile ? ariaLabelY : `${ariaLabelY} ${ariaLabel}`}\n aria-roledescription=${ariaRoleDescription}\n aria-orientation=\"vertical\"\n aria-valuetext=${isMobile\n ? ariaValueY\n : `${ariaValueY}, ${ariaLabelY}${\n this._valueChanged ? '' : `, ${ariaValueX}, ${ariaLabelX}`\n }`}\n orient=\"vertical\"\n min=\"0\"\n max=\"1\"\n step=${this.step}\n tabindex=\"-1\"\n .value=${String(this.y)}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n </div>\n </fieldset>\n `;\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n this.boundingClientRect = this.getContentBoundingRect();\n\n this.addEventListener('focus', this.handleFocus);\n this.addEventListener('blur', this.handleBlur);\n this.addEventListener('keyup', this.handleKeyup);\n this.addEventListener('keydown', this.handleKeydown);\n }\n\n /**\n * Overrides the `updated` method to handle changes in property values.\n *\n * @param changed - A map of changed properties with their previous values.\n *\n * This method performs the following actions:\n * - Updates the saturation (`s`) of the color if `x` has changed.\n * - Updates the value (`v`) of the color if `y` has changed.\n * - If the `focused` property has changed and is now true, it lazily binds\n * the `input[type=\"range\"]` elements in shadow roots to prevent multiple\n * tab stops within the Color Area for certain browser settings (e.g., Webkit).\n */\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n if (this.x !== this.inputX.valueAsNumber) {\n this.colorController.color.set('s', this.inputX.valueAsNumber * 100);\n }\n if (this.y !== this.inputY.valueAsNumber) {\n this.colorController.color.set('v', this.inputY.valueAsNumber * 100);\n }\n if (changed.has('focused') && this.focused) {\n // Lazily bind the `input[type=\"range\"]` elements in shadow roots\n // so that browsers with certain settings (Webkit) aren't allowed\n // multiple tab stops within the Color Area.\n const parentX = this.inputX.parentElement as HTMLDivElement;\n const parentY = this.inputY.parentElement as HTMLDivElement;\n if (!parentX.shadowRoot && !parentY.shadowRoot) {\n parentX.attachShadow({ mode: 'open' });\n parentY.attachShadow({ mode: 'open' });\n const slot = '<div tabindex=\"-1\"><slot></slot></div>';\n (parentX.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n (parentY.shadowRoot as unknown as ShadowRoot).innerHTML = slot;\n }\n }\n }\n\n private observer?: WithSWCResizeObserver['ResizeObserver'];\n\n public override connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.observer &&\n (window as unknown as WithSWCResizeObserver).ResizeObserver\n ) {\n this.observer = new (\n window as unknown as WithSWCResizeObserver\n ).ResizeObserver((_entries: SWCResizeObserverEntry[]) => {\n this.boundingClientRect = this.getContentBoundingRect();\n this.requestUpdate();\n });\n }\n this.observer?.observe(this);\n }\n\n public override disconnectedCallback(): void {\n this.observer?.unobserve(this);\n super.disconnectedCallback();\n }\n}\n"],
5
+ "mappings": "qNAYA,OAEE,QAAAA,EAEA,mBAAAC,MAEK,gCACP,OACE,YAAAC,EACA,SAAAC,MACK,kDACP,OAAS,aAAAC,MAAiB,kDAC1B,OAAS,qBAAAC,MAAyB,0DAElC,OACE,mBAAAC,MAEK,uEACP,OAAS,gCAAAC,MAAoC,0EAC7C,OACE,aAAAC,EACA,SAAAC,MACK,kDAEP,MAAO,2DAEP,OAAOC,MAAY,sBASZ,aAAM,kBAAkBT,CAAgB,CAAxC,kCAML,KAAO,SAAW,GAGlB,KAAO,QAAU,GAGjB,KAAO,OAAS,aAGhB,KAAO,OAAS,aAKhB,KAAQ,iBAAmB,IAAIM,EAA6B,IAAI,EA8BhE,KAAQ,gBAAkB,IAAID,EAAgB,KAAM,CAAE,SAAU,KAAM,CAAC,EA0BvE,KAAQ,WAAa,IAyCrB,KAAO,KAAO,IAQd,KAAQ,QAAU,EAElB,KAAQ,WAAa,IAAI,IAEzB,KAAQ,cAAgB,GA6IxB,KAAO,aAAe,GA7QtB,WAA2B,QAAyB,CAClD,MAAO,CAACI,CAAM,CAChB,CAkDA,IAAW,KAAc,CACvB,OAAO,KAAK,gBAAgB,GAC9B,CAEA,IAAW,IAAIC,EAAe,CAC5B,KAAK,gBAAgB,IAAMA,CAC7B,CAGA,IAAW,OAAoB,CAC7B,OAAO,KAAK,gBAAgB,UAC9B,CAGA,IAAW,OAAo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A,CADVpD,EAAS,CAAE,KAAM,MAAO,CAAC,GA9Ef,UA+EA,iBAoBAoD,EAAA,CADVpD,EAAS,CAAE,KAAM,MAAO,CAAC,GAlGf,UAmGA,iBAkBJoD,EAAA,CADNpD,EAAS,CAAE,KAAM,MAAO,CAAC,GApHf,UAqHJ,oBAGAoD,EAAA,CADNnD,EAAM,YAAY,GAvHR,UAwHJ,sBAGAmD,EAAA,CADNnD,EAAM,YAAY,GA1HR,UA2HJ",
6
+ "names": ["html", "SpectrumElement", "property", "query", "ifDefined", "streamingListener", "ColorController", "LanguageResolutionController", "isAndroid", "isIOS", "styles", "value", "color", "x", "oldValue", "y", "focusOptions", "event", "code", "key", "deltaX", "deltaY", "step", "valueAsNumber", "name", "outer", "style", "bl", "bt", "br", "bb", "applyDefault", "rect", "minOffsetX", "minOffsetY", "offsetX", "offsetY", "width", "height", "percentX", "percentY", "isMobile", "ariaLabel", "ariaRoleDescription", "ariaLabelX", "ariaLabelY", "ariaValueX", "ariaValueY", "changed", "parentX", "parentY", "slot", "_a", "_entries", "__decorateClass"]
7
7
  }