@helixui/library 3.3.1-next.115 → 3.3.1-next.118

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.
Files changed (129) hide show
  1. package/custom-elements.json +445 -276
  2. package/dist/components/hx-accordion/hx-accordion-item.d.ts +35 -0
  3. package/dist/components/hx-accordion/hx-accordion-item.d.ts.map +1 -1
  4. package/dist/components/hx-checkbox/hx-checkbox.d.ts +153 -1
  5. package/dist/components/hx-checkbox/hx-checkbox.d.ts.map +1 -1
  6. package/dist/components/hx-checkbox/hx-checkbox.styles.d.ts.map +1 -1
  7. package/dist/components/hx-checkbox/index.js +1 -1
  8. package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts +151 -2
  9. package/dist/components/hx-checkbox-group/hx-checkbox-group.d.ts.map +1 -1
  10. package/dist/components/hx-checkbox-group/index.js +1 -1
  11. package/dist/components/hx-color-picker/hx-color-picker.d.ts +163 -1
  12. package/dist/components/hx-color-picker/hx-color-picker.d.ts.map +1 -1
  13. package/dist/components/hx-color-picker/hx-color-picker.styles.d.ts.map +1 -1
  14. package/dist/components/hx-color-picker/index.js +1 -1
  15. package/dist/components/hx-combobox/hx-combobox.d.ts +311 -2
  16. package/dist/components/hx-combobox/hx-combobox.d.ts.map +1 -1
  17. package/dist/components/hx-combobox/index.js +1 -1
  18. package/dist/components/hx-date-picker/hx-date-picker.d.ts +182 -56
  19. package/dist/components/hx-date-picker/hx-date-picker.d.ts.map +1 -1
  20. package/dist/components/hx-date-picker/hx-date-picker.styles.d.ts.map +1 -1
  21. package/dist/components/hx-date-picker/index.js +1 -1
  22. package/dist/components/hx-dialog/hx-dialog.d.ts +240 -0
  23. package/dist/components/hx-dialog/hx-dialog.d.ts.map +1 -1
  24. package/dist/components/hx-dialog/index.js +1 -1
  25. package/dist/components/hx-dropdown/hx-dropdown.d.ts +80 -0
  26. package/dist/components/hx-dropdown/hx-dropdown.d.ts.map +1 -1
  27. package/dist/components/hx-dropdown/index.js +1 -1
  28. package/dist/components/hx-field/hx-field.d.ts +109 -0
  29. package/dist/components/hx-field/hx-field.d.ts.map +1 -1
  30. package/dist/components/hx-field/index.js +1 -1
  31. package/dist/components/hx-popover/hx-popover.d.ts +91 -0
  32. package/dist/components/hx-popover/hx-popover.d.ts.map +1 -1
  33. package/dist/components/hx-popover/index.js +1 -1
  34. package/dist/components/hx-radio-group/hx-radio-group.d.ts +152 -1
  35. package/dist/components/hx-radio-group/hx-radio-group.d.ts.map +1 -1
  36. package/dist/components/hx-radio-group/hx-radio.d.ts +14 -0
  37. package/dist/components/hx-radio-group/hx-radio.d.ts.map +1 -1
  38. package/dist/components/hx-radio-group/index.js +1 -1
  39. package/dist/components/hx-select/hx-select.d.ts +303 -2
  40. package/dist/components/hx-select/hx-select.d.ts.map +1 -1
  41. package/dist/components/hx-select/hx-select.styles.d.ts.map +1 -1
  42. package/dist/components/hx-select/index.js +1 -1
  43. package/dist/components/hx-side-nav/hx-nav-item.styles.d.ts.map +1 -1
  44. package/dist/components/hx-side-nav/index.js +1 -1
  45. package/dist/components/hx-switch/hx-switch.d.ts +78 -1
  46. package/dist/components/hx-switch/hx-switch.d.ts.map +1 -1
  47. package/dist/components/hx-switch/hx-switch.styles.d.ts.map +1 -1
  48. package/dist/components/hx-switch/index.js +1 -1
  49. package/dist/components/hx-toggle-button/hx-toggle-button.d.ts +110 -0
  50. package/dist/components/hx-toggle-button/hx-toggle-button.d.ts.map +1 -1
  51. package/dist/components/hx-toggle-button/hx-toggle-button.styles.d.ts.map +1 -1
  52. package/dist/components/hx-toggle-button/index.js +1 -1
  53. package/dist/components/hx-tooltip/hx-tooltip.d.ts +52 -0
  54. package/dist/components/hx-tooltip/hx-tooltip.d.ts.map +1 -1
  55. package/dist/components/hx-tooltip/index.js +1 -1
  56. package/dist/css/helix-all.css +98 -1
  57. package/dist/css/helix-forms.css +98 -1
  58. package/dist/css/hx-checkbox.css +18 -0
  59. package/dist/css/hx-color-picker.css +25 -0
  60. package/dist/css/hx-date-picker.css +2 -1
  61. package/dist/css/hx-select.css +19 -0
  62. package/dist/css/hx-switch.css +17 -0
  63. package/dist/css/hx-toggle-button.css +17 -0
  64. package/dist/css/index.css +1 -1
  65. package/dist/css/manifest.json +2 -1
  66. package/dist/index.js +15 -15
  67. package/dist/shared/aria-flatten-DY6v2vah.js +22 -0
  68. package/dist/shared/aria-flatten-DY6v2vah.js.map +1 -0
  69. package/dist/shared/aria-idref-Q0yiSR3p.js +104 -0
  70. package/dist/shared/aria-idref-Q0yiSR3p.js.map +1 -0
  71. package/dist/shared/hx-accordion-ZVzgDzTG.js.map +1 -1
  72. package/dist/shared/hx-checkbox-BdgoUeWi.js +696 -0
  73. package/dist/shared/hx-checkbox-BdgoUeWi.js.map +1 -0
  74. package/dist/shared/hx-checkbox-group-LWezHrvS.js +496 -0
  75. package/dist/shared/hx-checkbox-group-LWezHrvS.js.map +1 -0
  76. package/dist/shared/hx-color-picker-DVhZl88b.js +1221 -0
  77. package/dist/shared/hx-color-picker-DVhZl88b.js.map +1 -0
  78. package/dist/shared/hx-combobox-DvlezcDV.js +1359 -0
  79. package/dist/shared/hx-combobox-DvlezcDV.js.map +1 -0
  80. package/dist/shared/{hx-date-picker-2iRG1p74.js → hx-date-picker-N-0aG5XL.js} +542 -206
  81. package/dist/shared/hx-date-picker-N-0aG5XL.js.map +1 -0
  82. package/dist/shared/hx-dialog-DzB7VytW.js +717 -0
  83. package/dist/shared/hx-dialog-DzB7VytW.js.map +1 -0
  84. package/dist/shared/{hx-dropdown-LyaRc8Rf.js → hx-dropdown-DJWlF94E.js} +130 -77
  85. package/dist/shared/hx-dropdown-DJWlF94E.js.map +1 -0
  86. package/dist/shared/{hx-field-B3Qo8OLS.js → hx-field-zw0U1KVi.js} +99 -38
  87. package/dist/shared/hx-field-zw0U1KVi.js.map +1 -0
  88. package/dist/shared/{hx-nav-item-xqRPOCWX.js → hx-nav-item-CODtUlew.js} +13 -9
  89. package/dist/shared/{hx-nav-item-xqRPOCWX.js.map → hx-nav-item-CODtUlew.js.map} +1 -1
  90. package/dist/shared/{hx-popover-B-FP3-wW.js → hx-popover-CHxWY_cd.js} +123 -66
  91. package/dist/shared/hx-popover-CHxWY_cd.js.map +1 -0
  92. package/dist/shared/hx-radio-CeGzARNk.js +822 -0
  93. package/dist/shared/hx-radio-CeGzARNk.js.map +1 -0
  94. package/dist/shared/hx-select-DrcS-YRJ.js +1089 -0
  95. package/dist/shared/hx-select-DrcS-YRJ.js.map +1 -0
  96. package/dist/shared/hx-switch-BX_8uNUs.js +540 -0
  97. package/dist/shared/hx-switch-BX_8uNUs.js.map +1 -0
  98. package/dist/shared/{hx-toggle-button-iLiYrMbD.js → hx-toggle-button-Dcz9IlUm.js} +226 -65
  99. package/dist/shared/hx-toggle-button-Dcz9IlUm.js.map +1 -0
  100. package/dist/shared/{hx-tooltip-nYOv9OLu.js → hx-tooltip-DVqtKPCD.js} +68 -46
  101. package/dist/shared/hx-tooltip-DVqtKPCD.js.map +1 -0
  102. package/dist/utils/aria-flatten.d.ts +56 -0
  103. package/dist/utils/aria-flatten.d.ts.map +1 -0
  104. package/dist/utils/aria-idref.d.ts +127 -0
  105. package/dist/utils/aria-idref.d.ts.map +1 -0
  106. package/figma-inventory.json +64 -1
  107. package/package.json +2 -2
  108. package/dist/shared/hx-checkbox-D7xma9YH.js +0 -524
  109. package/dist/shared/hx-checkbox-D7xma9YH.js.map +0 -1
  110. package/dist/shared/hx-checkbox-group-C9n315Ju.js +0 -323
  111. package/dist/shared/hx-checkbox-group-C9n315Ju.js.map +0 -1
  112. package/dist/shared/hx-color-picker-uRc865FJ.js +0 -882
  113. package/dist/shared/hx-color-picker-uRc865FJ.js.map +0 -1
  114. package/dist/shared/hx-combobox-DDzqNKEW.js +0 -924
  115. package/dist/shared/hx-combobox-DDzqNKEW.js.map +0 -1
  116. package/dist/shared/hx-date-picker-2iRG1p74.js.map +0 -1
  117. package/dist/shared/hx-dialog-DRN_1-Y-.js +0 -514
  118. package/dist/shared/hx-dialog-DRN_1-Y-.js.map +0 -1
  119. package/dist/shared/hx-dropdown-LyaRc8Rf.js.map +0 -1
  120. package/dist/shared/hx-field-B3Qo8OLS.js.map +0 -1
  121. package/dist/shared/hx-popover-B-FP3-wW.js.map +0 -1
  122. package/dist/shared/hx-radio-CJvNU2yP.js +0 -621
  123. package/dist/shared/hx-radio-CJvNU2yP.js.map +0 -1
  124. package/dist/shared/hx-select-C8fEHQhC.js +0 -807
  125. package/dist/shared/hx-select-C8fEHQhC.js.map +0 -1
  126. package/dist/shared/hx-switch-BrZFaRue.js +0 -420
  127. package/dist/shared/hx-switch-BrZFaRue.js.map +0 -1
  128. package/dist/shared/hx-toggle-button-iLiYrMbD.js.map +0 -1
  129. package/dist/shared/hx-tooltip-nYOv9OLu.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hx-color-picker-DVhZl88b.js","sources":["../../src/components/hx-color-picker/hx-color-picker.styles.ts","../../src/components/hx-color-picker/color-utils.ts","../../src/components/hx-color-picker/hx-color-picker.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const helixColorPickerStyles = css`\n :host {\n display: inline-block;\n position: relative;\n font-family: var(--hx-font-family-sans, sans-serif);\n font-size: var(--hx-font-size-sm, 0.875rem);\n }\n :host([disabled]) {\n pointer-events: none;\n opacity: var(--hx-opacity-disabled, 0.5);\n }\n /* Slotted label / help / error blocks for cross-shadow naming. */\n .hx-color-picker__label {\n display: block;\n margin-bottom: var(--hx-space-1, 0.25rem);\n font-weight: var(--hx-font-weight-semibold, 600);\n color: var(--hx-color-neutral-900, #1a1a1a);\n }\n .hx-color-picker__label:empty {\n display: none;\n }\n .hx-color-picker__help {\n display: block;\n margin-top: var(--hx-space-1, 0.25rem);\n font-size: var(--hx-font-size-xs, 0.75rem);\n color: var(--hx-color-neutral-600, #525252);\n }\n .hx-color-picker__error {\n display: block;\n margin-top: var(--hx-space-1, 0.25rem);\n font-size: var(--hx-font-size-xs, 0.75rem);\n color: var(--hx-color-danger-700, #c43e3e);\n }\n [hidden] {\n display: none !important;\n }\n .trigger {\n display: inline-flex;\n align-items: center;\n gap: var(--hx-space-2, 0.5rem);\n padding: var(--hx-space-1, 0.25rem);\n border: var(--hx-border-width-thin, 1px) solid var(--hx-color-neutral-300, #b6bfb9);\n border-radius: var(--hx-border-radius-md, 0.375rem);\n background: var(--hx-color-neutral-0, #ffffff);\n cursor: pointer;\n transition: border-color var(--hx-transition-fast, 150ms ease);\n }\n .trigger:hover:not([disabled]) {\n border-color: var(\n --hx-color-picker-trigger-hover-border-color,\n var(--hx-color-primary-500, #429797)\n );\n }\n :is(.trigger, .gradient-grid, .slider-track, .swatch-btn, .format-btn):focus-visible {\n outline: var(--hx-focus-ring-width, 2px) solid\n var(--hx-color-picker-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n outline-offset: var(--hx-focus-ring-offset, 2px);\n }\n .trigger-swatch {\n width: 1.5rem;\n height: 1.5rem;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n border: var(--hx-border-width-thin, 1px) solid\n var(--hx-color-picker-swatch-border, var(--hx-overlay-black-10, rgba(0, 0, 0, 0.1)));\n background: var(--_preview-color, #000);\n display: block;\n flex-shrink: 0;\n }\n .trigger-label {\n font-size: var(--hx-font-size-sm, 0.875rem);\n color: var(--hx-color-neutral-700, #313e4b);\n font-family: var(--hx-font-family-mono, monospace);\n white-space: nowrap;\n }\n .panel {\n position: absolute;\n z-index: var(--hx-color-picker-z-index, 1000);\n top: calc(100% + 4px);\n left: 0;\n background: var(--hx-color-neutral-0, #ffffff);\n border: var(--hx-border-width-thin, 1px) solid var(--hx-color-neutral-200, #d6dbd5);\n border-radius: var(--hx-border-radius-lg, 0.5rem);\n box-shadow: 0 8px 24px\n var(--hx-color-picker-panel-shadow, var(--hx-overlay-black-15, rgba(0, 0, 0, 0.15)));\n padding: var(--hx-space-4, 1rem);\n width: var(--hx-color-picker-width, 260px);\n display: flex;\n flex-direction: column;\n gap: var(--hx-space-3, 0.75rem);\n outline: none;\n }\n :host([inline]) .panel {\n position: static;\n box-shadow: none;\n border: var(--hx-border-width-thin, 1px) solid var(--hx-color-neutral-200, #d6dbd5);\n border-radius: var(--hx-border-radius-lg, 0.5rem);\n }\n .gradient-grid {\n position: relative;\n width: 100%;\n height: var(--hx-color-picker-grid-height, 160px);\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n cursor: crosshair;\n overflow: hidden;\n touch-action: none;\n flex-shrink: 0;\n }\n .gradient-grid-bg {\n position: absolute;\n inset: 0;\n background:\n linear-gradient(to bottom, transparent, #000),\n linear-gradient(to right, #fff, var(--_hue-color, hsl(0, 100%, 50%)));\n pointer-events: none;\n }\n .gradient-thumb {\n position: absolute;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n border: none;\n box-shadow:\n 0 0 0 2px var(--hx-color-picker-thumb-border, var(--hx-color-neutral-0, #ffffff)),\n 0 0 0 3px var(--hx-color-picker-thumb-shadow, var(--hx-overlay-black-30, rgba(0, 0, 0, 0.3)));\n transform: translate(-50%, -50%);\n pointer-events: none;\n top: var(--_thumb-y, 0%);\n left: var(--_thumb-x, 100%);\n }\n .slider-track {\n position: relative;\n width: 100%;\n height: 12px;\n border-radius: 6px;\n cursor: pointer;\n touch-action: none;\n flex-shrink: 0;\n }\n .hue-track {\n background: linear-gradient(\n to right,\n red,\n #ff8000,\n #ff0,\n #80ff00,\n #0f0,\n #00ff80,\n #0ff,\n #0080ff,\n #00f,\n #7f00ff,\n #f0f,\n #ff0080,\n red\n );\n }\n .opacity-track {\n background-image:\n linear-gradient(to right, transparent, var(--_hue-color, hsl(0, 100%, 50%))),\n repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%) 0 0 / 12px 12px;\n }\n .slider-thumb {\n position: absolute;\n top: 50%;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n border: none;\n box-shadow:\n 0 0 0 2px var(--hx-color-picker-thumb-border, var(--hx-color-neutral-0, #ffffff)),\n 0 0 0 3px var(--hx-color-picker-thumb-shadow, var(--hx-overlay-black-30, rgba(0, 0, 0, 0.3)));\n transform: translate(-50%, -50%);\n pointer-events: none;\n left: var(--_slider-pct, 0%);\n background: var(--_thumb-color, hsl(0, 100%, 50%));\n }\n .swatches {\n display: flex;\n flex-wrap: wrap;\n gap: var(--hx-space-1, 0.25rem);\n }\n .swatch-btn {\n width: 20px;\n height: 20px;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n border: var(--hx-border-width-thin, 1px) solid\n var(--hx-color-picker-swatch-border, var(--hx-overlay-black-10, rgba(0, 0, 0, 0.1)));\n cursor: pointer;\n padding: 0;\n flex-shrink: 0;\n transition: transform var(--hx-transition-fast, 150ms ease);\n }\n .swatch-btn:hover {\n transform: scale(1.15);\n border-color: var(\n --hx-color-picker-swatch-border-hover,\n var(--hx-overlay-black-30, rgba(0, 0, 0, 0.3))\n );\n }\n .input-area {\n display: flex;\n align-items: center;\n gap: var(--hx-space-2, 0.5rem);\n }\n .format-btn {\n flex-shrink: 0;\n padding: var(--hx-space-1, 0.25rem) var(--hx-space-2, 0.5rem);\n background: var(--hx-color-neutral-100, #ebeee9);\n border: var(--hx-border-width-thin, 1px) solid var(--hx-color-neutral-300, #b6bfb9);\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n cursor: pointer;\n font-size: var(--hx-font-size-xs, 0.75rem);\n color: var(--hx-color-neutral-600, #4a5362);\n text-transform: uppercase;\n font-weight: var(--hx-font-weight-semibold, 600);\n letter-spacing: 0.05em;\n }\n .color-input {\n flex: 1;\n min-width: 0;\n padding: var(--hx-space-1, 0.25rem) var(--hx-space-2, 0.5rem);\n border: var(--hx-border-width-thin, 1px) solid var(--hx-color-neutral-300, #b6bfb9);\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n font-family: var(--hx-font-family-mono, monospace);\n font-size: var(--hx-font-size-sm, 0.875rem);\n color: var(--hx-color-neutral-900, #0d1825);\n background: var(--hx-color-neutral-0, #ffffff);\n outline: none;\n }\n .color-input:focus-visible {\n border-color: var(--hx-color-picker-focus-ring-color, var(--hx-focus-ring-color, #0f7078));\n box-shadow: 0 0 0 2px\n color-mix(\n in srgb,\n var(--hx-color-picker-focus-ring-color, var(--hx-focus-ring-color, #0f7078)) 20%,\n transparent\n );\n }\n .input-preview {\n width: 24px;\n height: 24px;\n border-radius: var(--hx-border-radius-sm, 0.25rem);\n border: var(--hx-border-width-thin, 1px) solid\n var(--hx-color-picker-swatch-border, var(--hx-overlay-black-10, rgba(0, 0, 0, 0.1)));\n background: var(--_preview-color, #000);\n flex-shrink: 0;\n }\n @media (prefers-reduced-motion: reduce) {\n .trigger,\n .swatch-btn {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .trigger {\n forced-color-adjust: none;\n background-color: Field;\n color: FieldText;\n border: 2px solid ButtonText;\n }\n .trigger:hover:not([disabled]) {\n border-color: Highlight;\n }\n :is(.trigger, .gradient-grid, .slider-track, .swatch-btn, .format-btn):focus-visible {\n outline-color: Highlight;\n }\n .panel {\n forced-color-adjust: none;\n background-color: Canvas;\n border: 2px solid CanvasText;\n box-shadow: none;\n }\n .gradient-thumb,\n .slider-thumb {\n box-shadow: 0 0 0 2px CanvasText;\n }\n .swatch-btn {\n border: 2px solid ButtonText;\n }\n .swatch-btn:hover {\n border-color: Highlight;\n }\n .color-input {\n forced-color-adjust: none;\n background-color: Field;\n color: FieldText;\n border: 2px solid ButtonText;\n }\n .color-input:focus-visible {\n border-color: Highlight;\n box-shadow: none;\n }\n .format-btn {\n forced-color-adjust: none;\n background-color: ButtonFace;\n color: ButtonText;\n border: 2px solid ButtonText;\n }\n .trigger-label {\n color: FieldText;\n }\n :host([disabled]) {\n opacity: 1;\n }\n :host([disabled]) .trigger {\n border-color: GrayText;\n color: GrayText;\n }\n }\n`;\n","// ─── Color utility types ──────────────────────────────────────────────────────\n\nexport interface HSV {\n h: number; // 0-360\n s: number; // 0-100\n v: number; // 0-100\n a: number; // 0-1\n}\n\nexport interface RGB {\n r: number; // 0-255\n g: number; // 0-255\n b: number; // 0-255\n a: number; // 0-1\n}\n\nexport type ColorFormat = 'hex' | 'rgb' | 'hsl' | 'hsv';\n\n// ─── Color utilities ──────────────────────────────────────────────────────────\n\nexport function clamp(n: number, min: number, max: number): number {\n return Math.max(min, Math.min(max, n));\n}\n\nexport function hexToRgb(hex: string): RGB | null {\n let h = hex.trim().replace(/^#/, '');\n if (h.length === 3) h = h.replace(/(.)/g, '$1$1');\n if (h.length === 4) h = h.replace(/(.)/g, '$1$1');\n if (h.length === 6) h += 'ff';\n if (h.length !== 8) return null;\n const n = parseInt(h, 16);\n if (isNaN(n)) return null;\n return {\n r: (n >>> 24) & 0xff,\n g: (n >>> 16) & 0xff,\n b: (n >>> 8) & 0xff,\n a: (n & 0xff) / 255,\n };\n}\n\nfunction toHex2(n: number): string {\n return Math.round(clamp(n, 0, 255))\n .toString(16)\n .padStart(2, '0');\n}\n\nexport function rgbToHex(rgb: RGB, includeAlpha: boolean): string {\n const base = `#${toHex2(rgb.r)}${toHex2(rgb.g)}${toHex2(rgb.b)}`;\n if (includeAlpha && rgb.a < 1) return base + toHex2(rgb.a * 255);\n return base;\n}\n\nexport function rgbToHsv(rgb: RGB): HSV {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const s = max === 0 ? 0 : d / max;\n const v = max;\n let h = 0;\n if (d !== 0) {\n if (max === r) h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n else if (max === g) h = ((b - r) / d + 2) / 6;\n else h = ((r - g) / d + 4) / 6;\n }\n return { h: h * 360, s: s * 100, v: v * 100, a: rgb.a };\n}\n\nexport function hsvToRgb(hsv: HSV): RGB {\n const h = hsv.h / 360;\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const i = Math.floor(h * 6);\n const f = h * 6 - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n let r = 0;\n let g = 0;\n let b = 0;\n switch (i % 6) {\n case 0:\n r = v;\n g = t;\n b = p;\n break;\n case 1:\n r = q;\n g = v;\n b = p;\n break;\n case 2:\n r = p;\n g = v;\n b = t;\n break;\n case 3:\n r = p;\n g = q;\n b = v;\n break;\n case 4:\n r = t;\n g = p;\n b = v;\n break;\n case 5:\n r = v;\n g = p;\n b = q;\n break;\n }\n return { r: Math.round(r * 255), g: Math.round(g * 255), b: Math.round(b * 255), a: hsv.a };\n}\n\nexport function rgbToHsl(rgb: RGB): { h: number; s: number; l: number; a: number } {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const l = (max + min) / 2;\n let h = 0;\n let s = 0;\n if (max !== min) {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n if (max === r) h = ((g - b) / d + (g < b ? 6 : 0)) / 6;\n else if (max === g) h = ((b - r) / d + 2) / 6;\n else h = ((r - g) / d + 4) / 6;\n }\n return { h: h * 360, s: s * 100, l: l * 100, a: rgb.a };\n}\n\n// P2-1: parseColor handles HSV/HSVA input strings for round-trip correctness\nexport function parseColor(value: string): HSV | null {\n if (!value) return null;\n\n if (value.startsWith('#')) {\n const rgb = hexToRgb(value);\n return rgb ? rgbToHsv(rgb) : null;\n }\n\n const rgbMatch = value.match(\n /rgba?\\(\\s*(\\d+)(?:\\s*,\\s*|\\s+)(\\d+)(?:\\s*,\\s*|\\s+)(\\d+)(?:\\s*(?:\\/|,)\\s*([\\d.]+))?\\s*\\)/,\n );\n if (rgbMatch) {\n const [, rm1, rm2, rm3, rm4] = rgbMatch;\n return rgbToHsv({\n r: parseInt(rm1 ?? '0', 10),\n g: parseInt(rm2 ?? '0', 10),\n b: parseInt(rm3 ?? '0', 10),\n a: rm4 !== undefined ? parseFloat(rm4) : 1,\n });\n }\n\n const hslMatch = value.match(\n /hsla?\\(\\s*([\\d.]+)(?:\\s*,\\s*|\\s+)([\\d.]+)%(?:\\s*,\\s*|\\s+)([\\d.]+)%(?:\\s*(?:\\/|,)\\s*([\\d.]+))?\\s*\\)/,\n );\n if (hslMatch) {\n const [, hm1, hm2, hm3, hm4] = hslMatch;\n const h = parseFloat(hm1 ?? '0');\n const s = parseFloat(hm2 ?? '0') / 100;\n const l = parseFloat(hm3 ?? '0') / 100;\n const a = hm4 !== undefined ? parseFloat(hm4) : 1;\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = l - c / 2;\n let r = 0;\n let g = 0;\n let b = 0;\n if (h < 60) {\n r = c;\n g = x;\n } else if (h < 120) {\n r = x;\n g = c;\n } else if (h < 180) {\n g = c;\n b = x;\n } else if (h < 240) {\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n b = c;\n } else {\n r = c;\n b = x;\n }\n return rgbToHsv({\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n a,\n });\n }\n\n // P2-1: Support HSV/HSVA input strings (component's own output format)\n const hsvMatch = value.match(\n /hsva?\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)%(?:\\s*,\\s*([\\d.]+))?\\s*\\)/,\n );\n if (hsvMatch) {\n const [, hm1, hm2, hm3, hm4] = hsvMatch;\n return {\n h: parseFloat(hm1 ?? '0'),\n s: parseFloat(hm2 ?? '0'),\n v: parseFloat(hm3 ?? '0'),\n a: hm4 !== undefined ? parseFloat(hm4) : 1,\n };\n }\n\n return null;\n}\n\nexport function formatColor(hsv: HSV, format: ColorFormat, includeAlpha: boolean): string {\n const rgb = hsvToRgb(hsv);\n switch (format) {\n case 'hex':\n return rgbToHex(rgb, includeAlpha);\n case 'rgb': {\n if (includeAlpha && hsv.a < 1) {\n return `rgb(${rgb.r} ${rgb.g} ${rgb.b} / ${Math.round(hsv.a * 100) / 100})`;\n }\n return `rgb(${rgb.r} ${rgb.g} ${rgb.b})`;\n }\n case 'hsl': {\n const hsl = rgbToHsl(rgb);\n if (includeAlpha && hsv.a < 1) {\n return `hsl(${Math.round(hsl.h)} ${Math.round(hsl.s)}% ${Math.round(hsl.l)}% / ${Math.round(hsv.a * 100) / 100})`;\n }\n return `hsl(${Math.round(hsl.h)} ${Math.round(hsl.s)}% ${Math.round(hsl.l)}%)`;\n }\n case 'hsv': {\n if (includeAlpha && hsv.a < 1) {\n return `hsva(${Math.round(hsv.h)}, ${Math.round(hsv.s)}%, ${Math.round(hsv.v)}%, ${Math.round(hsv.a * 100) / 100})`;\n }\n return `hsv(${Math.round(hsv.h)}, ${Math.round(hsv.s)}%, ${Math.round(hsv.v)}%)`;\n }\n }\n}\n","import { html, nothing, type PropertyValues } from 'lit';\nimport '../../utilities/document-token-adoption.js';\nimport { HelixElement } from '../../base/index.js';\nimport { FormMixin } from '../../mixins/FormMixin.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { helixColorPickerStyles } from './hx-color-picker.styles.js';\nimport { forcedColorsField } from '../../styles/forced-colors.js';\nimport {\n installAriaIdrefMirror,\n resolveIdrefTokens,\n supportsIdrefElementReferences,\n type AriaIdrefMirrorHandle,\n} from '../../utils/aria-idref.js';\nimport { flattenAccName } from '../../utils/aria-flatten.js';\nimport {\n type ColorFormat,\n type HSV,\n clamp,\n hsvToRgb,\n parseColor,\n formatColor,\n} from './color-utils.js';\n\n/** Internal counter used to mint stable IDs for inner aria-related elements. */\nlet _hxColorPickerCounter = 0;\n\n// Re-export ColorFormat so existing consumers using this module path still work\nexport type { ColorFormat };\n\n// ─── Component ────────────────────────────────────────────────────────────────\n\n/** Detail for hx-input and hx-change events dispatched by hx-color-picker. */\nexport interface HxColorPickerDetail {\n value: string;\n}\n\n/**\n * A color picker control with gradient picker, hue/opacity sliders, swatches,\n * and formatted text input. Supports hex, rgb, hsl, and hsv output formats.\n *\n * @summary Color selection control with swatches, gradient picker, and formatted input.\n *\n * @tag hx-color-picker\n *\n * @slot trigger - Custom trigger element. Default: a color swatch button.\n * @slot label - Visible label projected above the trigger; aggregated text contributes to the host's accessible name when no stronger naming source (aria-labelledby/aria-label/accessible-label/label) is supplied.\n * @slot help-text - Help text rendered below the trigger and joined into the host's announced description channel.\n * @slot error - Error message rendered below help text. When present, marks the trigger as aria-invalid and is announced via a polite live region.\n *\n * @fires {CustomEvent<{value: string}>} hx-input - Dispatched while dragging sliders or grid.\n * @fires {CustomEvent<{value: string}>} hx-change - Dispatched when a color is committed.\n *\n * @csspart trigger - The trigger button element.\n * @csspart swatches - The swatch color buttons container.\n * @csspart grid - The 2D saturation/value gradient picker area.\n * @csspart slider - Shared slider container (also on hue-slider and opacity-slider).\n * @csspart hue-slider - The hue slider track.\n * @csspart opacity-slider - The alpha/opacity slider track.\n * @csspart input - The text input area.\n * @csspart label - The visible label container above the trigger.\n * @csspart help-text - The help-text container rendered below the trigger.\n * @csspart error - The error-message container rendered below help text.\n *\n * @cssprop [--hx-color-picker-z-index=1000] - z-index of the popover panel.\n * @cssprop [--hx-color-picker-width=260px] - Width of the picker panel.\n * @cssprop [--hx-color-picker-grid-height=160px] - Height of the gradient grid.\n * @cssprop [--hx-color-picker-thumb-border=#fff] - Border color of slider/grid thumbs.\n * @cssprop [--hx-color-picker-thumb-shadow=rgba(0,0,0,0.3)] - Shadow color of slider/grid thumbs.\n * @cssprop [--hx-color-picker-panel-shadow=rgba(0,0,0,0.15)] - Panel drop-shadow color.\n * @cssprop [--hx-color-picker-swatch-border=rgba(0,0,0,0.1)] - Swatch button border color.\n * @cssprop [--hx-color-picker-swatch-border-hover=rgba(0,0,0,0.3)] - Swatch button border on hover.\n *\n * @example\n * ```html\n * <hx-color-picker value=\"#3b82f6\" format=\"hex\"></hx-color-picker>\n * ```\n *\n * @example Drupal / Twig usage\n * The `swatches` property must be set via JavaScript (Drupal behavior) because arrays\n * cannot be serialized as HTML attributes:\n * ```js\n * // my-theme/js/color-picker-behavior.js\n * Drupal.behaviors.helixColorPicker = {\n * attach(context) {\n * context.querySelectorAll('hx-color-picker[data-swatches]').forEach((el) => {\n * el.swatches = JSON.parse(el.dataset.swatches);\n * });\n * },\n * };\n * ```\n * ```twig\n * <hx-color-picker\n * value=\"{{ color }}\"\n * data-swatches='{{ swatches | json_encode }}'\n * ></hx-color-picker>\n * ```\n * @cssprop [--hx-font-family-sans] - Font family.\n * @cssprop [--hx-font-size-sm] - Font size.\n * @cssprop [--hx-opacity-disabled] - Opacity.\n * @cssprop [--hx-space-2] - Spacing token.\n * @cssprop [--hx-space-1] - Spacing token.\n * @cssprop [--hx-border-width-thin] - Width.\n * @cssprop [--hx-color-neutral-300] - Color.\n * @cssprop [--hx-border-radius-md] - CSS custom property.\n * @cssprop [--hx-color-neutral-0] - Color.\n * @cssprop [--hx-transition-fast] - Transition timing.\n * @cssprop [--hx-color-primary-500] - Color.\n * @cssprop [--hx-focus-ring-width] - Width.\n * @cssprop [--hx-focus-ring-color] - Color.\n * @cssprop [--hx-focus-ring-offset] - CSS custom property.\n * @cssprop [--hx-border-radius-sm] - CSS custom property.\n * @cssprop [--hx-overlay-black-10] - Overlay color.\n * @cssprop [--hx-color-neutral-700] - Color.\n * @cssprop [--hx-font-family-mono] - Font family.\n * @cssprop [--hx-color-neutral-200] - Color.\n * @cssprop [--hx-border-radius-lg] - CSS custom property.\n * @cssprop [--hx-overlay-black-15] - Overlay color.\n * @cssprop [--hx-space-4] - Spacing token.\n * @cssprop [--hx-space-3] - Spacing token.\n * @cssprop [--hx-overlay-black-30] - Overlay color.\n * @cssprop [--hx-color-neutral-100] - Color.\n * @cssprop [--hx-font-size-xs] - Font size.\n * @cssprop [--hx-color-neutral-600] - Color.\n * @cssprop [--hx-font-weight-semibold] - Font weight.\n * @cssprop [--hx-color-neutral-900] - Color.\n */\n@customElement('hx-color-picker')\nexport class HelixColorPicker extends FormMixin(HelixElement) {\n static override styles = [helixColorPickerStyles, forcedColorsField];\n\n /**\n * Declares this element as form-associated so it participates in native form submission.\n * @internal\n */\n static override formAssociated = true;\n\n constructor() {\n super();\n // P1-1: Store bound references so connectedCallback/disconnectedCallback use the same object\n /** @internal */\n this._boundPointerMove = this._handlePointerMove.bind(this);\n /** @internal */\n this._boundPointerUp = this._handlePointerUp.bind(this);\n /** @internal */\n this._boundDocumentClick = this._handleDocumentClick.bind(this);\n }\n\n // ─── Public Properties ───────────────────────────────────────────────────\n\n /**\n * Current color value as a CSS color string.\n * @attr value\n */\n @property({ type: String, reflect: true })\n value = '#000000';\n\n /**\n * Output format for the color value.\n * @attr format\n */\n @property({ type: String, reflect: true })\n format: ColorFormat = 'hex';\n\n /**\n * Whether to show the alpha/opacity channel slider and include alpha in the output.\n * @attr opacity\n */\n @property({ type: Boolean, reflect: true })\n opacity = false;\n\n /**\n * Array of preset swatch color strings.\n * Set via JS property only — arrays cannot be serialized as HTML attributes.\n * In Drupal/Twig, use a behavior to read `data-swatches` and set this property.\n * See JSDoc example above.\n */\n @property({ attribute: false })\n swatches: string[] = [];\n\n /**\n * When true, hides the gradient grid and sliders, showing only swatches and the input.\n * Useful for compact preset-only color selection UIs.\n * @attr swatches-only\n */\n @property({ type: Boolean, reflect: true, attribute: 'swatches-only' })\n swatchesOnly = false;\n\n /**\n * Whether the control is disabled.\n * @attr disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Form field name for form participation.\n * @attr name\n */\n @property({ type: String, reflect: true })\n name = '';\n\n /**\n * When true the picker is shown inline instead of in a popover.\n * @attr inline\n */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /**\n * When true, the picker requires a non-empty value for form submission.\n * @attr required\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /** Accessible label for the color gradient canvas. */\n @property({ type: String, attribute: 'label-gradient' })\n labelGradient = 'Color gradient';\n\n /** Accessible label for the hue slider. */\n @property({ type: String, attribute: 'label-hue' })\n labelHue = 'Hue';\n\n /** Accessible label for the opacity slider. */\n @property({ type: String, attribute: 'label-opacity' })\n labelOpacity = 'Opacity';\n\n /** Accessible label for the preset color swatches section. */\n @property({ type: String, attribute: 'label-swatches' })\n labelSwatches = 'Preset colors';\n\n /** Accessible label for the format-switch button. */\n @property({ type: String, attribute: 'label-switch-format' })\n labelSwitchFormat = 'Switch color format';\n\n /** Accessible label for the color value input. */\n @property({ type: String, attribute: 'label-color-value' })\n labelColorValue = 'Color value';\n\n /** Accessible label for the color picker dialog/panel. */\n @property({ type: String, attribute: 'label-picker' })\n labelPicker = 'Color picker';\n\n /**\n * Visible label rendered above the trigger. When set this becomes the\n * announced name of the trigger surface unless a stronger source\n * (`aria-labelledby`, `aria-label`, or `accessible-label`) is supplied.\n * @attr label\n */\n @property({ type: String, reflect: true })\n label: string | undefined = undefined;\n\n /**\n * Visually-hidden accessible name. Highest-priority self-naming source —\n * outranks `label`, slotted label content, and the generated trigger label,\n * but defers to consumer `aria-labelledby` (effective) and `aria-label`.\n * @attr accessible-label\n */\n @property({ type: String, attribute: 'accessible-label' })\n accessibleLabel: string | undefined = undefined;\n\n /**\n * Help text rendered below the trigger and joined into the host's\n * announced description channel.\n * @attr help-text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText: string | undefined = undefined;\n\n /**\n * Error message. When non-empty, marks the trigger surface as `aria-invalid`\n * and joins the host's announced description channel via a live alert.\n * @attr error\n */\n @property({ type: String, reflect: true })\n error: string | undefined = undefined;\n\n /**\n * Generates the accessible label for the trigger button when no other\n * naming source is provided.\n * @param color - current color value string\n */\n @property({ attribute: false })\n labelTrigger: (color: string) => string = (color) => `Choose color: ${color}`;\n\n // ─── Internal State ──────────────────────────────────────────────────────\n\n /**\n * Internal HSV representation of the current color, used to drive all picker UI elements.\n * @internal\n */\n @state() private _hsv: HSV = { h: 0, s: 0, v: 0, a: 1 };\n /**\n * Whether the color picker popover panel is currently open.\n * @internal\n */\n @state() private _open = false;\n /**\n * The formatted color string displayed in the text input, kept in sync with `_hsv` and `format`.\n * @internal\n */\n @state() private _inputValue = '#000000';\n\n // ─── Cross-shadow ARIA-delegation infrastructure ─────────────────────────\n\n /**\n * Whether the platform supports the IDL element-references API on\n * `ElementInternals` (`ariaLabelledByElements` / `ariaDescribedByElements`).\n * Drives the modern (host-canonical) vs. fallback (mirror onto trigger)\n * branches in `_syncHostAriaSemantics()`.\n * @internal\n */\n @state() private _supportsIdrefRefs = true;\n\n /**\n * Test seam for forcing the no-IDL-ref path in synthetic environments.\n * Production code MUST NOT touch this. `null` = use platform detection;\n * `true`/`false` = force the corresponding branch on connect.\n * @internal\n */\n static __testSupportsIdrefRefsOverride: boolean | null = null;\n\n /** Slotted label elements (multi-node aggregation). @internal */\n @state() private _slottedLabelEls: Element[] = [];\n /** Aggregated text from slotted label, AccName-flattened. @internal */\n @state() private _labelSlotText: string = '';\n /** True when the label slot carries useful text. @internal */\n @state() private _hasLabelSlot = false;\n /** Aggregated text from slotted help-text, AccName-flattened. @internal */\n @state() private _helpSlotText: string = '';\n /** Aggregated text from slotted error, AccName-flattened. @internal */\n @state() private _errorSlotText: string = '';\n\n /** Effective error text exposed in the live region. @internal */\n @state() private _announcedError: string = '';\n\n /** Stable IDs for inner help / error elements. @internal */\n private readonly _instanceId = ++_hxColorPickerCounter;\n /** @internal */ private readonly _helpId = `hx-color-picker-help-${this._instanceId}`;\n /** @internal */ private readonly _errorId = `hx-color-picker-error-${this._instanceId}`;\n /** Hidden host-level description span ID (synthesized aria-description channel). @internal */\n private readonly _hostDescId = `hx-color-picker-host-desc-${this._instanceId}`;\n\n /** Fallback aria-* for the trigger button when IDL refs are unsupported. @internal */\n @state() private _fallbackTriggerAriaLabelledBy: string | null = null;\n /** @internal */ @state() private _fallbackTriggerAriaDescribedBy: string | null = null;\n /** @internal */ @state() private _fallbackTriggerAriaLabel: string | null = null;\n\n /** Cached resolved external description text for the synthesized host span. @internal */\n @state() private _externalDescText: string = '';\n\n /** Handle for the shared IDREF observer. @internal */\n private _ariaMirror: AriaIdrefMirrorHandle | null = null;\n /** Mutation observer over the label-slot assigned-node text. @internal */\n private _labelSlotTextObserver: MutationObserver | null = null;\n /** Mutation observer over the help-slot assigned-node text. @internal */\n private _helpSlotTextObserver: MutationObserver | null = null;\n /** Mutation observer over the error-slot assigned-node text. @internal */\n private _errorSlotTextObserver: MutationObserver | null = null;\n /** Mutation observer over external aria-labelledby / aria-describedby targets. @internal */\n private _externalRefsObserver: MutationObserver | null = null;\n\n // ─── Cached element references ───────────────────────────────────────────\n\n /** Cached reference to the gradient grid element. @internal */\n @query('[part=\"grid\"]') private _gridEl!: HTMLElement | null;\n /** Cached reference to the hue slider element. @internal */\n @query('[part=\"hue-slider\"]') private _hueSliderEl!: HTMLElement | null;\n /** Cached reference to the opacity slider element. @internal */\n @query('[part=\"opacity-slider\"]') private _opacitySliderEl!: HTMLElement | null;\n\n // ─── Dragging state (not reactive, managed manually) ─────────────────────\n\n /**\n * Whether the user is actively dragging within the gradient grid.\n * @internal\n */\n private _draggingGrid = false;\n /**\n * Whether the user is actively dragging the hue slider thumb.\n * @internal\n */\n private _draggingHue = false;\n /**\n * Whether the user is actively dragging the opacity slider thumb.\n * @internal\n */\n private _draggingOpacity = false;\n\n /**\n * Cached bounding rect from pointerdown; avoids repeated getBoundingClientRect on every pointermove.\n * @internal\n */\n private _dragRect: DOMRect | null = null;\n\n // P1-1: Stored bound references to prevent memory leaks\n /**\n * Stable bound reference to the pointermove handler, stored to allow correct listener removal.\n * @internal\n */\n private _boundPointerMove: (e: PointerEvent) => void;\n /**\n * Stable bound reference to the pointerup handler, stored to allow correct listener removal.\n * @internal\n */\n private _boundPointerUp: () => void;\n /**\n * Stable bound reference to the document click handler, stored to allow correct listener removal.\n * @internal\n */\n private _boundDocumentClick: (e: MouseEvent) => void;\n\n // ─── Lifecycle ───────────────────────────────────────────────────────────\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._syncFromValue();\n\n // Honour the static test override so synthetic environments choose the\n // path BEFORE connect-time syncs run.\n const ctor = this.constructor as typeof HelixColorPicker;\n this._supportsIdrefRefs =\n ctor.__testSupportsIdrefRefsOverride !== null\n ? ctor.__testSupportsIdrefRefsOverride\n : supportsIdrefElementReferences(this._internals);\n\n // Seed root-independent semantics from connect so consumer-supplied\n // aria-labelledby / aria-describedby on the host resolves to live\n // light-DOM elements before first paint.\n this._syncHostAriaSemantics();\n this._ariaMirror = installAriaIdrefMirror(this, () => {\n this._syncHostAriaSemantics();\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n // P1-1: Remove using the same stored references added in connectedCallback\n // Guard for SSR — document is unavailable server-side\n if (typeof document !== 'undefined') {\n document.removeEventListener('click', this._boundDocumentClick, true);\n document.removeEventListener('pointermove', this._boundPointerMove);\n document.removeEventListener('pointerup', this._boundPointerUp);\n }\n this._ariaMirror?.disconnect();\n this._ariaMirror = null;\n this._labelSlotTextObserver?.disconnect();\n this._labelSlotTextObserver = null;\n this._helpSlotTextObserver?.disconnect();\n this._helpSlotTextObserver = null;\n this._errorSlotTextObserver?.disconnect();\n this._errorSlotTextObserver = null;\n this._externalRefsObserver?.disconnect();\n this._externalRefsObserver = null;\n }\n\n override willUpdate(changedProperties: PropertyValues<this>): void {\n if (changedProperties.has('value')) {\n this._syncFromValue();\n }\n // Seed `_announcedError` BEFORE render so the persistent live region\n // renders with the error text in the SAME frame that removes `hidden`\n // from the alert container. Covers first paint AND runtime transitions\n // from \"\" to \"Server rejected\" via async/server-side validation.\n if (changedProperties.has('error') || !this.hasUpdated) {\n this._announcedError = this.error ?? '';\n }\n }\n\n override firstUpdated(changedProperties: PropertyValues<this>): void {\n super.firstUpdated(changedProperties);\n // `slotchange` fires as a microtask after the initial synchronous render.\n // Seed slot-derived state synchronously so `_syncHostAriaSemantics()` —\n // driven by `updated()` in this same cycle — observes a populated state.\n this._seedSlotStateSync();\n this._syncHostAriaSemantics();\n }\n\n override updated(changedProperties: PropertyValues<this>): void {\n super.updated(changedProperties);\n // Drive re-announcement on error→error transitions (rAF clear-and-re-set\n // forces AT to re-read `role=\"alert\"` content).\n if (changedProperties.has('error')) {\n const previousError = changedProperties.get('error') as string | undefined;\n if (previousError && this.error) {\n this._announcedError = '';\n requestAnimationFrame(() => {\n this._announcedError = this.error ?? '';\n });\n } else {\n this._announcedError = this.error ?? '';\n }\n }\n this._syncHostAriaSemantics();\n }\n\n // ─── Sync ────────────────────────────────────────────────────────────────\n\n /** @internal */\n private _syncFromValue(): void {\n const parsed = parseColor(this.value);\n if (parsed) {\n this._hsv = parsed;\n }\n this._inputValue = formatColor(this._hsv, this.format, this.opacity);\n this._internals.setFormValue(this.value);\n }\n\n // ─── Slot state seeding ──────────────────────────────────────────────────\n\n /**\n * Synchronous slot-state seed. Mirrors the side effects of the slotchange\n * handlers but is driven by direct `slot.assignedNodes()` reads so we can\n * populate state BEFORE the microtask `slotchange` events fire after the\n * first render.\n * @internal\n */\n private _seedSlotStateSync(): void {\n const root = this.shadowRoot;\n if (!root) return;\n const labelSlot = root.querySelector<HTMLSlotElement>('slot[name=\"label\"]');\n if (labelSlot) this._captureLabelSlot(labelSlot);\n const helpSlot = root.querySelector<HTMLSlotElement>('slot[name=\"help-text\"]');\n if (helpSlot) this._captureHelpSlot(helpSlot);\n const errorSlot = root.querySelector<HTMLSlotElement>('slot[name=\"error\"]');\n if (errorSlot) this._captureErrorSlot(errorSlot);\n }\n\n /** @internal */\n private _captureLabelSlot(slot: HTMLSlotElement): void {\n const assigned = slot\n .assignedNodes({ flatten: true })\n .filter((n): n is Element => n.nodeType === Node.ELEMENT_NODE);\n const elements = assigned.length > 0 ? assigned : [];\n const text = elements\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n this._slottedLabelEls = elements;\n this._labelSlotText = text;\n this._hasLabelSlot = text.length > 0;\n this._installLabelSlotTextObserver(elements);\n }\n\n /** @internal */\n private _captureHelpSlot(slot: HTMLSlotElement): void {\n const text = slot\n .assignedNodes({ flatten: true })\n .filter((n): n is Element => n.nodeType === Node.ELEMENT_NODE)\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n this._helpSlotText = text;\n this._installHelpSlotTextObserver(slot);\n }\n\n /** @internal */\n private _captureErrorSlot(slot: HTMLSlotElement): void {\n const text = slot\n .assignedNodes({ flatten: true })\n .filter((n): n is Element => n.nodeType === Node.ELEMENT_NODE)\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n this._errorSlotText = text;\n this._installErrorSlotTextObserver(slot);\n }\n\n /** @internal */\n private _handleLabelSlotChange(e: Event): void {\n this._captureLabelSlot(e.target as HTMLSlotElement);\n this._syncHostAriaSemantics();\n }\n\n /** @internal */\n private _handleHelpSlotChange(e: Event): void {\n this._captureHelpSlot(e.target as HTMLSlotElement);\n this._syncHostAriaSemantics();\n }\n\n /** @internal */\n private _handleErrorSlotChange(e: Event): void {\n this._captureErrorSlot(e.target as HTMLSlotElement);\n this._syncHostAriaSemantics();\n }\n\n /** @internal */\n private _installLabelSlotTextObserver(nodes: Element[]): void {\n this._labelSlotTextObserver?.disconnect();\n if (nodes.length === 0) {\n this._labelSlotTextObserver = null;\n return;\n }\n const observer = new MutationObserver(() => {\n const text = this._slottedLabelEls\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n this._labelSlotText = text;\n this._hasLabelSlot = text.length > 0;\n this._syncHostAriaSemantics();\n });\n nodes.forEach((node) => {\n observer.observe(node, {\n characterData: true,\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-hidden', 'hidden'],\n });\n });\n this._labelSlotTextObserver = observer;\n }\n\n /** @internal */\n private _installHelpSlotTextObserver(slot: HTMLSlotElement): void {\n this._helpSlotTextObserver?.disconnect();\n const observer = new MutationObserver(() => {\n const text = slot\n .assignedNodes({ flatten: true })\n .filter((n): n is Element => n.nodeType === Node.ELEMENT_NODE)\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n this._helpSlotText = text;\n this._syncHostAriaSemantics();\n });\n slot.assignedNodes({ flatten: true }).forEach((node) => {\n if (node.nodeType !== Node.ELEMENT_NODE) return;\n observer.observe(node, {\n characterData: true,\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-hidden', 'hidden'],\n });\n });\n this._helpSlotTextObserver = observer;\n }\n\n /** @internal */\n private _installErrorSlotTextObserver(slot: HTMLSlotElement): void {\n this._errorSlotTextObserver?.disconnect();\n const observer = new MutationObserver(() => {\n const text = slot\n .assignedNodes({ flatten: true })\n .filter((n): n is Element => n.nodeType === Node.ELEMENT_NODE)\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim();\n this._errorSlotText = text;\n this._syncHostAriaSemantics();\n });\n slot.assignedNodes({ flatten: true }).forEach((node) => {\n if (node.nodeType !== Node.ELEMENT_NODE) return;\n observer.observe(node, {\n characterData: true,\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-hidden', 'hidden'],\n });\n });\n this._errorSlotTextObserver = observer;\n }\n\n /**\n * Watches the elements referenced by `aria-labelledby` / `aria-describedby`\n * for in-place text mutations so the announced name/description stays\n * accurate when consumers rewrite external label text without swapping the\n * referenced node.\n * @internal\n */\n private _installExternalRefsObserver(targets: Element[]): void {\n this._externalRefsObserver?.disconnect();\n if (targets.length === 0) {\n this._externalRefsObserver = null;\n return;\n }\n const observer = new MutationObserver(() => {\n this._syncHostAriaSemantics();\n });\n targets.forEach((target) => {\n observer.observe(target, {\n characterData: true,\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-hidden', 'hidden'],\n });\n });\n this._externalRefsObserver = observer;\n }\n\n // ─── Host-canonical ARIA-delegation sync ─────────────────────────────────\n\n /**\n * Compute and apply the cross-shadow ARIA contract for the trigger surface.\n *\n * Naming precedence (highest first):\n * 1. consumer `aria-labelledby` (when at least one IDREF resolves)\n * 2. consumer `aria-label`\n * 3. `accessible-label` property\n * 4. `label` property\n * 5. slotted `<slot name=\"label\">` text\n * 6. `labelTrigger(value)` (default)\n *\n * Description channel (joined, deduped):\n * - consumer `aria-describedby` resolved text\n * - `help-text` property + slotted help-text\n * - `error` property + slotted error (when present)\n *\n * Modern path (`_supportsIdrefRefs === true`): host owns the announced\n * surface via `internals.aria*` + IDL refs. Trigger button mirrors only.\n *\n * Fallback path (`_supportsIdrefRefs === false`): trigger button carries\n * the full aria contract via attribute mirrors.\n * @internal\n */\n private _syncHostAriaSemantics(): void {\n const internals = this._internals;\n\n const hostAriaLabel = this.getAttribute('aria-label')?.trim() || '';\n const externalLabelTokens = this.getAttribute('aria-labelledby');\n const externalDescTokens = this.getAttribute('aria-describedby');\n const labelEls = resolveIdrefTokens(this, externalLabelTokens);\n const descEls = resolveIdrefTokens(this, externalDescTokens);\n const hasEffectiveLabelledBy = labelEls.length > 0;\n\n // Resolve the announced name.\n let resolvedLabel: string | null;\n if (hasEffectiveLabelledBy) {\n // Will be set via IDL refs (modern) or token mirror (fallback). Compute\n // a flattened text fallback for the IDL-ref-unsupported branch.\n resolvedLabel =\n labelEls\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim() || null;\n } else if (hostAriaLabel) {\n resolvedLabel = hostAriaLabel;\n } else if (this.accessibleLabel) {\n resolvedLabel = this.accessibleLabel;\n } else if (this.label) {\n resolvedLabel = this.label;\n } else if (this._hasLabelSlot && this._labelSlotText) {\n resolvedLabel = this._labelSlotText;\n } else {\n resolvedLabel = this.labelTrigger(this._inputValue);\n }\n\n // External description text (flattened from consumer-resolved IDREFs).\n const externalDescText =\n descEls.length > 0\n ? descEls\n .map((el) => flattenAccName(el))\n .filter((t) => t.length > 0)\n .join(' ')\n .replace(/\\s+/g, ' ')\n .trim()\n : '';\n this._externalDescText = externalDescText;\n\n // Re-tune the external-refs observer to the union of resolved targets.\n this._installExternalRefsObserver([...labelEls, ...descEls]);\n\n // Validity surface — union: internals.validity ∪ this.error ∪ slotted error.\n const hasError = !!(this.error || this._errorSlotText);\n const validityInvalid = !internals.validity.valid;\n const isInvalid = validityInvalid || hasError;\n\n if (this._supportsIdrefRefs) {\n // ─── Modern path: host is canonical ───\n // Use `null` (not `''`) when no override — `''` removes the attribute\n // but stamps a stale empty string on `internals.ariaLabel` that some\n // engines still expose to AT.\n internals.ariaLabel = resolvedLabel ?? null;\n internals.ariaInvalid = isInvalid ? 'true' : 'false';\n internals.ariaDisabled = this.disabled ? 'true' : 'false';\n internals.ariaRequired = this.required ? 'true' : 'false';\n\n type InternalsWithRefs = ElementInternals & {\n ariaLabelledByElements: Element[] | null;\n ariaDescribedByElements: Element[] | null;\n };\n const refsInternals = internals as InternalsWithRefs;\n refsInternals.ariaLabelledByElements = hasEffectiveLabelledBy ? labelEls : null;\n refsInternals.ariaDescribedByElements = descEls.length > 0 ? descEls : null;\n\n // Clear fallbacks so the trigger doesn't double-announce.\n this._fallbackTriggerAriaLabelledBy = null;\n this._fallbackTriggerAriaDescribedBy = null;\n this._fallbackTriggerAriaLabel = null;\n } else {\n // ─── Fallback path: trigger carries the full contract ───\n internals.ariaLabel = null;\n internals.ariaInvalid = null;\n internals.ariaDisabled = null;\n internals.ariaRequired = null;\n type InternalsWithRefs = ElementInternals & {\n ariaLabelledByElements: Element[] | null;\n ariaDescribedByElements: Element[] | null;\n };\n const refsInternals = internals as InternalsWithRefs;\n refsInternals.ariaLabelledByElements = null;\n refsInternals.ariaDescribedByElements = null;\n\n this._fallbackTriggerAriaLabelledBy = hasEffectiveLabelledBy ? externalLabelTokens : null;\n this._fallbackTriggerAriaDescribedBy = externalDescTokens || null;\n this._fallbackTriggerAriaLabel = resolvedLabel;\n }\n }\n\n // ─── Effective text helpers (rendered into hidden host-desc span) ────────\n\n /** @internal */\n private _effectiveHelpText(): string {\n return (this.helpText?.trim() || this._helpSlotText || '').trim();\n }\n\n /** @internal */\n private _effectiveErrorText(): string {\n return (this._announcedError?.trim() || this._errorSlotText || '').trim();\n }\n\n /** @internal */\n protected override _onFormDisabled(disabled: boolean): void {\n this.disabled = disabled;\n }\n\n /** @internal */\n protected override _onFormReset(): void {\n this.value = '#000000';\n this._internals.setFormValue(null);\n this._resetInteractionState();\n }\n\n /** @internal */\n protected override _onFormStateRestore(\n state: string | File | FormData | null,\n _mode: 'restore' | 'autocomplete',\n ): void {\n if (typeof state === 'string') {\n this.value = state;\n }\n }\n\n /** @internal */\n override _updateValidity(): void {\n // Anchor validity UI to the announced surface — the trigger button on\n // the popover path, or the grid in inline mode.\n const anchor: HTMLElement | undefined =\n this.shadowRoot?.querySelector<HTMLElement>('[part=\"trigger\"]') ??\n this.shadowRoot?.querySelector<HTMLElement>('[part=\"grid\"]') ??\n undefined;\n\n // Union of constraint failures: required + consumer-supplied `error` /\n // slotted error. The consumer error projects through `customError` so\n // `validity.valid` reflects the announced state.\n const consumerError = (this.error || this._errorSlotText || '').trim();\n if (this.required && !this.value) {\n this._internals.setValidity(\n { valueMissing: true, customError: !!consumerError },\n consumerError || 'Please select a color.',\n anchor,\n );\n } else if (consumerError) {\n this._internals.setValidity({ customError: true }, consumerError, anchor);\n } else {\n this._internals.setValidity({});\n }\n // Re-sync host aria semantics so `internals.ariaInvalid` reflects the\n // newly-computed `ValidityState`.\n this._syncHostAriaSemantics();\n }\n\n /** @internal */\n private _commit(source: 'drag' | 'change'): void {\n const formatted = formatColor(this._hsv, this.format, this.opacity);\n this.value = formatted;\n this._inputValue = formatted;\n this._internals.setFormValue(formatted);\n this._handleInteractionInput();\n const detail = { value: formatted };\n const opts: CustomEventInit<{ value: string }> = {\n bubbles: true,\n composed: true,\n detail,\n };\n if (source === 'drag') {\n this.dispatchEvent(new CustomEvent<{ value: string }>('hx-input', opts));\n } else {\n this.dispatchEvent(new CustomEvent<{ value: string }>('hx-change', opts));\n }\n }\n\n // ─── Panel open/close ────────────────────────────────────────────────────\n\n /** @internal */\n private _show(): void {\n if (this._open || this.inline) return;\n this._open = true;\n // Guard for SSR — document is unavailable server-side\n if (typeof document !== 'undefined') {\n document.addEventListener('click', this._boundDocumentClick, true);\n }\n // WCAG 2.4.3: move focus into the panel after it renders so keyboard/AT\n // users land on the first interactive element rather than staying on the trigger.\n void this.updateComplete.then(() => {\n const panel = this.shadowRoot?.querySelector<HTMLElement>('.panel');\n // Prefer the color value input; fall back to the panel itself (tabindex=\"-1\").\n const firstFocusable = panel?.querySelector<HTMLElement>('input, button') ?? panel;\n firstFocusable?.focus();\n });\n }\n\n /** @internal */\n private _hide(): void {\n if (!this._open) return;\n this._open = false;\n // Guard for SSR — document is unavailable server-side\n if (typeof document !== 'undefined') {\n document.removeEventListener('click', this._boundDocumentClick, true);\n }\n }\n\n /** @internal */\n private _handleDocumentClick(e: MouseEvent): void {\n if (!this._open) return;\n if (!e.composedPath().includes(this)) {\n this._hide();\n }\n }\n\n /** @internal */\n private _handleTriggerClick(e: MouseEvent): void {\n e.stopPropagation();\n if (this._open) {\n this._hide();\n } else {\n this._show();\n }\n }\n\n /** @internal */\n private _handlePanelKeydown(e: KeyboardEvent): void {\n if (e.key === 'Escape') {\n e.stopPropagation();\n this._hide();\n this.shadowRoot?.querySelector<HTMLElement>('[part=\"trigger\"]')?.focus();\n }\n }\n\n // ─── Gradient grid dragging ───────────────────────────────────────────────\n\n /** @internal */\n private _handleGridPointerDown(e: PointerEvent): void {\n if (this.disabled) return;\n e.preventDefault();\n this._draggingGrid = true;\n // Cache rect at pointerdown — element doesn't move during drag\n this._dragRect = this._gridEl?.getBoundingClientRect() ?? null;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n // Guard for SSR — document is unavailable server-side\n if (typeof document !== 'undefined') {\n document.addEventListener('pointermove', this._boundPointerMove);\n document.addEventListener('pointerup', this._boundPointerUp);\n }\n this._updateGridFromPointer(e);\n }\n\n /** @internal */\n private _updateGridFromPointer(e: PointerEvent): void {\n const rect = this._dragRect ?? this._gridEl?.getBoundingClientRect();\n if (!rect) return;\n const x = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n const y = clamp((e.clientY - rect.top) / rect.height, 0, 1);\n this._hsv = { ...this._hsv, s: x * 100, v: (1 - y) * 100 };\n this._commit('drag');\n this.requestUpdate();\n }\n\n // P0-1: Keyboard support for gradient grid — fixes WCAG 2.1 SC 2.1.1 failure\n /** @internal */\n private _handleGridKeydown(e: KeyboardEvent): void {\n let sDelta = 0;\n let vDelta = 0;\n if (e.key === 'ArrowLeft') sDelta = -1;\n else if (e.key === 'ArrowRight') sDelta = 1;\n else if (e.key === 'ArrowUp') vDelta = 1;\n else if (e.key === 'ArrowDown') vDelta = -1;\n else if (e.key === 'PageUp') vDelta = 10;\n else if (e.key === 'PageDown') vDelta = -10;\n else if (e.key === 'Home') {\n this._hsv = { ...this._hsv, s: 0, v: 100 };\n this._commit('change');\n return;\n } else if (e.key === 'End') {\n this._hsv = { ...this._hsv, s: 100, v: 0 };\n this._commit('change');\n return;\n }\n if (sDelta !== 0 || vDelta !== 0) {\n e.preventDefault();\n this._hsv = {\n ...this._hsv,\n s: clamp(this._hsv.s + sDelta, 0, 100),\n v: clamp(this._hsv.v + vDelta, 0, 100),\n };\n this._commit('change');\n }\n }\n\n // ─── Hue slider dragging ─────────────────────────────────────────────────\n\n /** @internal */\n private _handleHuePointerDown(e: PointerEvent): void {\n if (this.disabled) return;\n e.preventDefault();\n this._draggingHue = true;\n // Cache rect at pointerdown — element doesn't move during drag\n this._dragRect = this._hueSliderEl?.getBoundingClientRect() ?? null;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n // Guard for SSR — document is unavailable server-side\n if (typeof document !== 'undefined') {\n document.addEventListener('pointermove', this._boundPointerMove);\n document.addEventListener('pointerup', this._boundPointerUp);\n }\n this._updateHueFromPointer(e);\n }\n\n /** @internal */\n private _updateHueFromPointer(e: PointerEvent): void {\n const rect = this._dragRect ?? this._hueSliderEl?.getBoundingClientRect();\n if (!rect) return;\n const pct = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n this._hsv = { ...this._hsv, h: pct * 360 };\n this._commit('drag');\n this.requestUpdate();\n }\n\n // ─── Opacity slider dragging ──────────────────────────────────────────────\n\n /** @internal */\n private _handleOpacityPointerDown(e: PointerEvent): void {\n if (this.disabled) return;\n e.preventDefault();\n this._draggingOpacity = true;\n // Cache rect at pointerdown — element doesn't move during drag\n this._dragRect = this._opacitySliderEl?.getBoundingClientRect() ?? null;\n (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n // Guard for SSR — document is unavailable server-side\n if (typeof document !== 'undefined') {\n document.addEventListener('pointermove', this._boundPointerMove);\n document.addEventListener('pointerup', this._boundPointerUp);\n }\n this._updateOpacityFromPointer(e);\n }\n\n /** @internal */\n private _updateOpacityFromPointer(e: PointerEvent): void {\n const rect = this._dragRect ?? this._opacitySliderEl?.getBoundingClientRect();\n if (!rect) return;\n const pct = clamp((e.clientX - rect.left) / rect.width, 0, 1);\n this._hsv = { ...this._hsv, a: pct };\n this._commit('drag');\n this.requestUpdate();\n }\n\n // ─── Document-level pointer handlers ─────────────────────────────────────\n\n /** @internal */\n private _handlePointerMove(e: PointerEvent): void {\n if (this._draggingGrid) this._updateGridFromPointer(e);\n else if (this._draggingHue) this._updateHueFromPointer(e);\n else if (this._draggingOpacity) this._updateOpacityFromPointer(e);\n }\n\n /** @internal */\n private _handlePointerUp(): void {\n if (this._draggingGrid || this._draggingHue || this._draggingOpacity) {\n this._draggingGrid = false;\n this._draggingHue = false;\n this._draggingOpacity = false;\n this._dragRect = null;\n // Guard for SSR — document is unavailable server-side\n if (typeof document !== 'undefined') {\n document.removeEventListener('pointermove', this._boundPointerMove);\n document.removeEventListener('pointerup', this._boundPointerUp);\n }\n this._commit('change');\n }\n }\n\n // ─── Keyboard handling for sliders ───────────────────────────────────────\n\n /** @internal */\n private _handleHueKeydown(e: KeyboardEvent): void {\n let delta = 0;\n if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') delta = -1;\n else if (e.key === 'ArrowRight' || e.key === 'ArrowUp') delta = 1;\n else if (e.key === 'PageDown') delta = -10;\n else if (e.key === 'PageUp') delta = 10;\n else if (e.key === 'Home') {\n this._hsv = { ...this._hsv, h: 0 };\n this._commit('change');\n return;\n } else if (e.key === 'End') {\n this._hsv = { ...this._hsv, h: 360 };\n this._commit('change');\n return;\n }\n if (delta !== 0) {\n e.preventDefault();\n this._hsv = { ...this._hsv, h: clamp(this._hsv.h + delta, 0, 360) };\n this._commit('change');\n }\n }\n\n /** @internal */\n private _handleOpacityKeydown(e: KeyboardEvent): void {\n let delta = 0;\n if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') delta = -0.01;\n else if (e.key === 'ArrowRight' || e.key === 'ArrowUp') delta = 0.01;\n else if (e.key === 'PageDown') delta = -0.1;\n else if (e.key === 'PageUp') delta = 0.1;\n else if (e.key === 'Home') {\n this._hsv = { ...this._hsv, a: 0 };\n this._commit('change');\n return;\n } else if (e.key === 'End') {\n this._hsv = { ...this._hsv, a: 1 };\n this._commit('change');\n return;\n }\n if (delta !== 0) {\n e.preventDefault();\n this._hsv = { ...this._hsv, a: clamp(this._hsv.a + delta, 0, 1) };\n this._commit('change');\n }\n }\n\n // ─── Input ───────────────────────────────────────────────────────────────\n\n // P1-7: Bound to @input (was @change) for real-time color preview while typing\n /** @internal */\n private _handleInputChange(e: Event): void {\n const input = e.target as HTMLInputElement;\n const parsed = parseColor(input.value.trim());\n if (parsed) {\n this._hsv = parsed;\n this._commit('change');\n }\n this._inputValue = input.value;\n }\n\n /** @internal */\n private _handleInputBlur(e: FocusEvent): void {\n const input = e.target as HTMLInputElement;\n const parsed = parseColor(input.value.trim());\n if (parsed) {\n this._hsv = parsed;\n this._commit('change');\n } else {\n // Revert to current valid value\n this._inputValue = formatColor(this._hsv, this.format, this.opacity);\n }\n }\n\n /** @internal */\n private _handleFormatCycle(): void {\n const formats: ColorFormat[] = ['hex', 'rgb', 'hsl', 'hsv'];\n const idx = formats.indexOf(this.format);\n const next = formats[(idx + 1) % formats.length];\n if (next !== undefined) this.format = next;\n this._inputValue = formatColor(this._hsv, this.format, this.opacity);\n }\n\n // ─── Swatches ────────────────────────────────────────────────────────────\n\n /** @internal */\n private _handleSwatchClick(color: string): void {\n const parsed = parseColor(color);\n if (parsed) {\n this._hsv = parsed;\n this._commit('change');\n }\n }\n\n // ─── Computed values ──────────────────────────────────────────────────────\n\n /** @internal */\n private _hueColor(): string {\n return `hsl(${Math.round(this._hsv.h)}, 100%, 50%)`;\n }\n\n /** @internal */\n private _previewColor(): string {\n const rgb = hsvToRgb(this._hsv);\n if (this.opacity && this._hsv.a < 1) {\n return `rgb(${rgb.r} ${rgb.g} ${rgb.b} / ${Math.round(this._hsv.a * 100) / 100})`;\n }\n return `rgb(${rgb.r} ${rgb.g} ${rgb.b})`;\n }\n\n // ─── Render helpers ───────────────────────────────────────────────────────\n\n /** @internal */\n private _renderGrid() {\n const thumbX = `${this._hsv.s}%`;\n const thumbY = `${100 - this._hsv.v}%`;\n const hueColor = this._hueColor();\n\n // P0-1: Grid is now keyboard-operable — WCAG 2.1 SC 2.1.1 compliance\n // Arrow keys adjust saturation (left/right) and value (up/down)\n //\n // A11y note (WCAG 4.1.2 — 2D slider aria-valuenow limitation): The ARIA slider role\n // requires a single numeric aria-valuenow. This 2D control has two axes (saturation and\n // value), so aria-valuenow reports only saturation (the primary/horizontal axis) per\n // the ARIA 1.2 \"slider\" pattern. aria-valuetext compensates by announcing both axes\n // (\"Saturation X%, Value Y%\") for all assistive technologies that support it.\n return html`\n <div\n part=\"grid\"\n class=\"gradient-grid\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label=${this.labelGradient}\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n aria-valuenow=${Math.round(this._hsv.s)}\n aria-valuetext=\"Saturation ${Math.round(this._hsv.s)}%, Value ${Math.round(this._hsv.v)}%\"\n @pointerdown=${this._handleGridPointerDown}\n @keydown=${this._handleGridKeydown}\n >\n <div class=\"gradient-grid-bg\" style=${styleMap({ '--_hue-color': hueColor })}></div>\n <div\n class=\"gradient-thumb\"\n style=${styleMap({ '--_thumb-x': thumbX, '--_thumb-y': thumbY })}\n aria-hidden=\"true\"\n ></div>\n </div>\n `;\n }\n\n /** @internal */\n private _renderHueSlider() {\n const pct = `${(this._hsv.h / 360) * 100}%`;\n const hueColor = this._hueColor();\n\n // P1-8: part=\"slider hue-slider\" — exposes the documented shared \"slider\" CSS part\n // P1-4: aria-valuetext announces the hue angle with degree symbol\n return html`\n <div\n part=\"slider hue-slider\"\n class=\"slider-track hue-track\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label=${this.labelHue}\n aria-valuemin=\"0\"\n aria-valuemax=\"360\"\n aria-valuenow=${Math.round(this._hsv.h)}\n aria-valuetext=\"${Math.round(this._hsv.h)}°\"\n @pointerdown=${this._handleHuePointerDown}\n @keydown=${this._handleHueKeydown}\n >\n <div\n class=\"slider-thumb\"\n style=${styleMap({ '--_slider-pct': pct, '--_thumb-color': hueColor })}\n aria-hidden=\"true\"\n ></div>\n </div>\n `;\n }\n\n /** @internal */\n private _renderOpacitySlider() {\n if (!this.opacity) return nothing;\n const pct = `${this._hsv.a * 100}%`;\n const rgb = hsvToRgb(this._hsv);\n const thumbColor = `rgb(${rgb.r} ${rgb.g} ${rgb.b} / ${Math.round(this._hsv.a * 100) / 100})`;\n const hueColor = this._hueColor();\n\n // P1-8: part=\"slider opacity-slider\" — exposes the documented shared \"slider\" CSS part\n // P1-4: aria-valuetext announces the opacity as a percentage\n return html`\n <div\n part=\"slider opacity-slider\"\n class=\"slider-track opacity-track\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label=${this.labelOpacity}\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n aria-valuenow=${Math.round(this._hsv.a * 100)}\n aria-valuetext=\"${Math.round(this._hsv.a * 100)}%\"\n style=${styleMap({ '--_hue-color': hueColor })}\n @pointerdown=${this._handleOpacityPointerDown}\n @keydown=${this._handleOpacityKeydown}\n >\n <div\n class=\"slider-thumb\"\n style=${styleMap({ '--_slider-pct': pct, '--_thumb-color': thumbColor })}\n aria-hidden=\"true\"\n ></div>\n </div>\n `;\n }\n\n /** @internal */\n private _renderSwatches() {\n if (!this.swatches?.length) return nothing;\n return html`\n <div part=\"swatches\" class=\"swatches\" role=\"group\" aria-label=${this.labelSwatches}>\n ${this.swatches.map(\n (color) => html`\n <button\n type=\"button\"\n class=\"swatch-btn\"\n style=${styleMap({ background: color })}\n aria-label=${color}\n title=${color}\n @click=${() => this._handleSwatchClick(color)}\n ></button>\n `,\n )}\n </div>\n `;\n }\n\n /** @internal */\n private _renderInput() {\n return html`\n <div part=\"input\" class=\"input-area\">\n <div\n class=\"input-preview\"\n style=${styleMap({ '--_preview-color': this._previewColor() })}\n aria-hidden=\"true\"\n ></div>\n <button\n type=\"button\"\n class=\"format-btn\"\n aria-label=${this.labelSwitchFormat}\n title=\"Switch format\"\n @click=${this._handleFormatCycle}\n >\n ${this.format}\n </button>\n <input\n type=\"text\"\n class=\"color-input\"\n .value=${this._inputValue}\n aria-label=${this.labelColorValue}\n autocomplete=\"off\"\n spellcheck=\"false\"\n @input=${this._handleInputChange}\n @blur=${this._handleInputBlur}\n />\n </div>\n `;\n }\n\n /** @internal */\n private _renderPanel() {\n // A11y fix (WCAG 4.1.2): use role=\"group\" instead of role=\"dialog\" + aria-modal=\"true\".\n // aria-modal=\"true\" requires a programmatic focus trap so screen readers restrict virtual\n // cursor navigation to the dialog. Without Tab-key trapping, aria-modal causes JAWS/NVDA\n // to hide all content outside the panel, stranding keyboard users who Tab out. role=\"group\"\n // with aria-label provides the same grouping semantics without the false modal contract.\n return html`\n <div\n class=\"panel\"\n role=\"group\"\n aria-label=${this.labelPicker}\n tabindex=\"-1\"\n @keydown=${this._handlePanelKeydown}\n >\n ${this.swatchesOnly\n ? nothing\n : html`${this._renderGrid()} ${this._renderHueSlider()} ${this._renderOpacitySlider()}`}\n ${this._renderSwatches()} ${this._renderInput()}\n </div>\n `;\n }\n\n // ─── Description-channel helpers ─────────────────────────────────────────\n\n /**\n * Builds the synthesized host-level description span text by joining the\n * external (consumer-resolved) description text with help and error text.\n * The hidden span lives in the shadow root so AT can resolve a single\n * `aria-describedby` token to it without leaving the host's name surface.\n * @internal\n */\n private _hostDescriptionText(): string {\n const parts = [\n this._externalDescText,\n this._effectiveHelpText(),\n this._effectiveErrorText(),\n ].filter((p) => p.length > 0);\n return parts.join(' ').replace(/\\s+/g, ' ').trim();\n }\n\n /** @internal */\n private _renderHostDescriptionSpan() {\n const text = this._hostDescriptionText();\n if (!text) return nothing;\n return html`<span\n id=${this._hostDescId}\n class=\"hx-visually-hidden\"\n aria-hidden=\"true\"\n data-hx-host-desc\n style=\"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;\"\n >${text}</span\n >`;\n }\n\n /** @internal */\n private _renderLabelSlot() {\n // The label slot is rendered visually so consumers projecting a `<span\n // slot=\"label\">` see it above the trigger. AT consumes the same nodes via\n // aggregated text → `internals.ariaLabel` (modern path). When the consumer\n // supplies `aria-label` / `aria-labelledby` / `accessible-label` the slot\n // still renders visibly but is excluded from the announced name by the\n // precedence in `_syncHostAriaSemantics`.\n return html`<span class=\"hx-color-picker__label\" part=\"label\">\n <slot name=\"label\" @slotchange=${this._handleLabelSlotChange}>${this.label ?? ''}</slot>\n </span>`;\n }\n\n /** @internal */\n private _renderHelpSlot() {\n const helpText = this._effectiveHelpText();\n return html`<span\n id=${this._helpId}\n class=\"hx-color-picker__help\"\n part=\"help-text\"\n ?hidden=${!helpText}\n >\n <slot name=\"help-text\" @slotchange=${this._handleHelpSlotChange}>${this.helpText ?? ''}</slot>\n </span>`;\n }\n\n /** @internal */\n private _renderErrorSlot() {\n const errorText = this._effectiveErrorText();\n return html`<span\n id=${this._errorId}\n class=\"hx-color-picker__error\"\n part=\"error\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n ?hidden=${!errorText}\n >\n <slot name=\"error\" @slotchange=${this._handleErrorSlotChange}\n >${this._announcedError ?? ''}</slot\n >\n </span>`;\n }\n\n // ─── Main render ─────────────────────────────────────────────────────────\n\n override render() {\n const previewColor = this._previewColor();\n const hostDescText = this._hostDescriptionText();\n const triggerDescribedBy = hostDescText ? this._hostDescId : undefined;\n\n // Modern path: host owns the aria contract via `internals.*` — the\n // trigger button just mirrors a stable visible label for non-AT consumers\n // (testing, devtools).\n // Fallback path: trigger carries the full contract via attributes.\n const innerAriaLabel = this._supportsIdrefRefs\n ? this.labelTrigger(this._inputValue)\n : (this._fallbackTriggerAriaLabel ?? this.labelTrigger(this._inputValue));\n const innerAriaLabelledBy = this._supportsIdrefRefs\n ? undefined\n : (this._fallbackTriggerAriaLabelledBy ?? undefined);\n const innerAriaDescribedBy = this._supportsIdrefRefs\n ? triggerDescribedBy\n : [this._fallbackTriggerAriaDescribedBy, triggerDescribedBy]\n .filter((t): t is string => !!t && t.length > 0)\n .join(' ') || undefined;\n\n const isInvalid = !this._internals.validity.valid || !!this._effectiveErrorText();\n\n if (this.inline) {\n return html`\n <div style=${styleMap({ '--_preview-color': previewColor })}>\n ${this._renderLabelSlot()} ${this._renderHostDescriptionSpan()} ${this._renderPanel()}\n ${this._renderHelpSlot()} ${this._renderErrorSlot()}\n </div>\n `;\n }\n\n // P1-3: trigger aria-label includes current color value (preserved for\n // AT on legacy engines and as a backup name for testing).\n return html`\n ${this._renderLabelSlot()} ${this._renderHostDescriptionSpan()}\n <button\n part=\"trigger\"\n type=\"button\"\n class=\"trigger\"\n aria-label=${innerAriaLabel}\n aria-labelledby=${ifDefined(innerAriaLabelledBy)}\n aria-describedby=${ifDefined(innerAriaDescribedBy)}\n aria-expanded=${this._open ? 'true' : 'false'}\n aria-invalid=${isInvalid ? 'true' : 'false'}\n ?disabled=${this.disabled}\n style=${styleMap({ '--_preview-color': previewColor })}\n @click=${this._handleTriggerClick}\n >\n <slot name=\"trigger\">\n <span class=\"trigger-swatch\" aria-hidden=\"true\"></span>\n <span class=\"trigger-label\">${this._inputValue}</span>\n </slot>\n </button>\n ${this._renderHelpSlot()} ${this._renderErrorSlot()}\n ${this._open ? this._renderPanel() : nothing}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hx-color-picker': HelixColorPicker;\n }\n}\n"],"names":["helixColorPickerStyles","css","clamp","n","min","max","hexToRgb","hex","h","toHex2","rgbToHex","rgb","includeAlpha","base","rgbToHsv","r","g","b","d","s","v","hsvToRgb","hsv","i","f","p","q","t","rgbToHsl","parseColor","value","rgbMatch","rm1","rm2","rm3","rm4","hslMatch","hm1","hm2","hm3","hm4","l","a","c","x","m","hsvMatch","formatColor","format","hsl","_hxColorPickerCounter","HelixColorPicker","FormMixin","HelixElement","color","ctor","supportsIdrefElementReferences","installAriaIdrefMirror","_a","_b","_c","_d","_e","changedProperties","parsed","root","labelSlot","helpSlot","errorSlot","slot","assigned","elements","text","el","flattenAccName","nodes","observer","node","targets","target","internals","hostAriaLabel","externalLabelTokens","externalDescTokens","labelEls","resolveIdrefTokens","descEls","hasEffectiveLabelledBy","resolvedLabel","externalDescText","hasError","isInvalid","refsInternals","disabled","state","_mode","anchor","consumerError","source","formatted","opts","panel","firstFocusable","rect","y","sDelta","vDelta","pct","delta","input","formats","idx","next","thumbX","thumbY","hueColor","html","styleMap","nothing","thumbColor","helpText","errorText","previewColor","triggerDescribedBy","innerAriaLabel","innerAriaLabelledBy","innerAriaDescribedBy","ifDefined","forcedColorsField","__decorateClass","property","query","customElement"],"mappings":";;;;;;;;;AAEO,MAAMA,IAAyBC;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;AA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