eidos-ui 2.1.0 → 3.0.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.
- package/README.md +66 -16
- package/dist/ThemeProvider.types-DgXN0gEH.d.cts +88 -0
- package/dist/ThemeProvider.types-DgXN0gEH.d.ts +88 -0
- package/dist/chunk-2ZY7M72Q.js +521 -0
- package/dist/chunk-2ZY7M72Q.js.map +1 -0
- package/dist/{chunk-W6IKHJ76.cjs → chunk-5BX4Q76D.cjs} +134 -126
- package/dist/chunk-5BX4Q76D.cjs.map +1 -0
- package/dist/chunk-H5HWFOWZ.js +390 -0
- package/dist/chunk-H5HWFOWZ.js.map +1 -0
- package/dist/{chunk-JV7Z3D3U.js → chunk-LEMCJW57.js} +134 -126
- package/dist/chunk-LEMCJW57.js.map +1 -0
- package/dist/chunk-SE7MWOC7.cjs +390 -0
- package/dist/chunk-SE7MWOC7.cjs.map +1 -0
- package/dist/chunk-U5FHQ73U.cjs +521 -0
- package/dist/chunk-U5FHQ73U.cjs.map +1 -0
- package/dist/color-picker/index.cjs +2 -2
- package/dist/color-picker/index.js +1 -1
- package/dist/fonts/JetBrains-Mono-OFL.txt +93 -0
- package/dist/fonts/Plus-Jakarta-Sans-OFL.txt +93 -0
- package/dist/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/plus-jakarta-sans-latin-wght-normal.woff2 +0 -0
- package/dist/fonts.css +32 -0
- package/dist/fonts.css.d.ts +2 -0
- package/dist/index.cjs +31 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +308 -102
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +34 -8
- package/dist/theme-editor/index.cjs +22 -0
- package/dist/theme-editor/index.cjs.map +1 -0
- package/dist/theme-editor/index.d.cts +65 -0
- package/dist/theme-editor/index.d.ts +65 -0
- package/dist/theme-editor/index.js +22 -0
- package/dist/theme-editor/index.js.map +1 -0
- package/dist/theme-provider/index.cjs +27 -0
- package/dist/theme-provider/index.cjs.map +1 -0
- package/dist/theme-provider/index.d.cts +123 -0
- package/dist/theme-provider/index.d.ts +123 -0
- package/dist/theme-provider/index.js +27 -0
- package/dist/theme-provider/index.js.map +1 -0
- package/package.json +13 -3
- package/dist/chunk-JV7Z3D3U.js.map +0 -1
- package/dist/chunk-W6IKHJ76.cjs.map +0 -1
|
@@ -73,7 +73,7 @@ function rgbToHsv(r, g, b) {
|
|
|
73
73
|
h = h * 60;
|
|
74
74
|
if (h < 0) h += 360;
|
|
75
75
|
}
|
|
76
|
-
return { h
|
|
76
|
+
return { h, s, v };
|
|
77
77
|
}
|
|
78
78
|
function rgbToHex(r, g, b) {
|
|
79
79
|
const ch = (n) => Math.round(Math.max(0, Math.min(255, n))).toString(16).padStart(2, "0");
|
|
@@ -342,137 +342,145 @@ var ColorPicker = ({
|
|
|
342
342
|
backgroundSize: "100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",
|
|
343
343
|
backgroundPosition: "0 0, 0 0, 0 4px, 4px -4px, -4px 0"
|
|
344
344
|
};
|
|
345
|
-
const panel = /* @__PURE__ */ jsxs(
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
{
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
style: {
|
|
352
|
-
background: [
|
|
353
|
-
"linear-gradient(to top, #000, transparent)",
|
|
354
|
-
`linear-gradient(to right, #fff, hsl(${hsv.h}, 100%, 50%))`
|
|
355
|
-
].join(", ")
|
|
356
|
-
},
|
|
357
|
-
onMouseDown: handleCanvasMouseDown,
|
|
358
|
-
role: "presentation",
|
|
359
|
-
children: /* @__PURE__ */ jsx(
|
|
345
|
+
const panel = /* @__PURE__ */ jsxs(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
className: `eidos-color-picker-panel eidos-color-picker-panel--${size}${inline ? " eidos-color-picker-panel--inline" : ""}`,
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ jsx(
|
|
360
351
|
"div",
|
|
361
352
|
{
|
|
362
|
-
|
|
353
|
+
ref: canvasRef,
|
|
354
|
+
className: "eidos-color-picker-canvas",
|
|
363
355
|
style: {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
356
|
+
background: [
|
|
357
|
+
"linear-gradient(to top, #000, transparent)",
|
|
358
|
+
`linear-gradient(to right, #fff, hsl(${hsv.h}, 100%, 50%))`
|
|
359
|
+
].join(", ")
|
|
360
|
+
},
|
|
361
|
+
onMouseDown: handleCanvasMouseDown,
|
|
362
|
+
role: "presentation",
|
|
363
|
+
children: /* @__PURE__ */ jsx(
|
|
364
|
+
"div",
|
|
365
|
+
{
|
|
366
|
+
className: "eidos-color-picker-thumb",
|
|
367
|
+
style: {
|
|
368
|
+
// Rounded for display only - hsv.s/v are unrounded floats so the
|
|
369
|
+
// hex round trip stays lossless (see rgbToHsv).
|
|
370
|
+
left: `${hsv.s.toFixed(2)}%`,
|
|
371
|
+
top: `${(100 - hsv.v).toFixed(2)}%`,
|
|
372
|
+
background: currentHex
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
)
|
|
368
376
|
}
|
|
369
|
-
)
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
377
|
+
),
|
|
378
|
+
/* @__PURE__ */ jsxs("div", { className: "eidos-color-picker-sliders", children: [
|
|
379
|
+
/* @__PURE__ */ jsx(
|
|
380
|
+
"input",
|
|
381
|
+
{
|
|
382
|
+
type: "range",
|
|
383
|
+
className: "eidos-color-picker-hue",
|
|
384
|
+
min: 0,
|
|
385
|
+
max: 360,
|
|
386
|
+
step: 1,
|
|
387
|
+
value: hsv.h,
|
|
388
|
+
disabled,
|
|
389
|
+
onChange: handleHueChange,
|
|
390
|
+
"aria-label": "Hue"
|
|
391
|
+
}
|
|
392
|
+
),
|
|
393
|
+
showAlpha && /* @__PURE__ */ jsxs("div", { className: "eidos-color-picker-alpha-wrapper", children: [
|
|
394
|
+
/* @__PURE__ */ jsx("div", { className: "eidos-color-picker-alpha-bg", style: alphaTrackBg }),
|
|
395
|
+
/* @__PURE__ */ jsx(
|
|
396
|
+
"input",
|
|
397
|
+
{
|
|
398
|
+
type: "range",
|
|
399
|
+
className: "eidos-color-picker-alpha",
|
|
400
|
+
min: 0,
|
|
401
|
+
max: 100,
|
|
402
|
+
step: 1,
|
|
403
|
+
value: Math.round(alpha * 100),
|
|
404
|
+
disabled,
|
|
405
|
+
onChange: handleAlphaChange,
|
|
406
|
+
"aria-label": "Opacity"
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
] })
|
|
410
|
+
] }),
|
|
411
|
+
/* @__PURE__ */ jsxs("div", { className: "eidos-color-picker-inputs", children: [
|
|
412
|
+
/* @__PURE__ */ jsx("div", { className: "eidos-color-picker-format-btns", role: "group", "aria-label": "Colour format", children: ["hex", "rgb", "hsl"].map((fmt) => /* @__PURE__ */ jsx(
|
|
413
|
+
"button",
|
|
414
|
+
{
|
|
415
|
+
type: "button",
|
|
416
|
+
className: [
|
|
417
|
+
"eidos-color-picker-format-btn",
|
|
418
|
+
activeFormat === fmt && "eidos-color-picker-format-btn--active"
|
|
419
|
+
].filter(Boolean).join(" "),
|
|
420
|
+
onClick: () => handleFormatChange(fmt),
|
|
421
|
+
disabled,
|
|
422
|
+
"aria-pressed": activeFormat === fmt,
|
|
423
|
+
children: fmt.toUpperCase()
|
|
424
|
+
},
|
|
425
|
+
fmt
|
|
426
|
+
)) }),
|
|
427
|
+
/* @__PURE__ */ jsx(
|
|
428
|
+
"input",
|
|
429
|
+
{
|
|
430
|
+
type: "text",
|
|
431
|
+
className: "eidos-color-picker-input",
|
|
432
|
+
value: inputText,
|
|
433
|
+
disabled,
|
|
434
|
+
spellCheck: false,
|
|
435
|
+
"aria-label": "Colour value",
|
|
436
|
+
onChange: (e) => setInputText(e.target.value),
|
|
437
|
+
onFocus: () => {
|
|
438
|
+
inputFocusedRef.current = true;
|
|
439
|
+
},
|
|
440
|
+
onBlur: () => {
|
|
441
|
+
inputFocusedRef.current = false;
|
|
442
|
+
handleInputCommit();
|
|
443
|
+
},
|
|
444
|
+
onKeyDown: (e) => {
|
|
445
|
+
if (e.key === "Enter") handleInputCommit();
|
|
446
|
+
if (e.key === "Escape") {
|
|
447
|
+
setInputText(colorToText(hsvRef.current, alphaRef.current, activeFormatRef.current));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
),
|
|
452
|
+
/* @__PURE__ */ jsx(
|
|
453
|
+
"button",
|
|
454
|
+
{
|
|
455
|
+
type: "button",
|
|
456
|
+
className: ["eidos-color-picker-copy", copied && "eidos-color-picker-copy--copied"].filter(Boolean).join(" "),
|
|
457
|
+
onClick: handleCopy,
|
|
458
|
+
disabled,
|
|
459
|
+
"aria-label": "Copy colour value",
|
|
460
|
+
title: "Copy colour value",
|
|
461
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { size: 14 }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
|
|
462
|
+
}
|
|
463
|
+
)
|
|
464
|
+
] }),
|
|
465
|
+
showSwatches && /* @__PURE__ */ jsx("div", { className: "eidos-color-picker-swatches", role: "group", "aria-label": "Colour presets", children: swatches.map((swatchHex) => /* @__PURE__ */ jsx(
|
|
466
|
+
"button",
|
|
391
467
|
{
|
|
392
|
-
type: "
|
|
393
|
-
className:
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
468
|
+
type: "button",
|
|
469
|
+
className: [
|
|
470
|
+
"eidos-color-picker-swatch",
|
|
471
|
+
currentHex === swatchHex && "eidos-color-picker-swatch--active"
|
|
472
|
+
].filter(Boolean).join(" "),
|
|
473
|
+
style: { background: swatchHex },
|
|
474
|
+
onClick: () => handleSwatchClick(swatchHex),
|
|
398
475
|
disabled,
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
)
|
|
403
|
-
] })
|
|
404
|
-
] }),
|
|
405
|
-
/* @__PURE__ */ jsxs("div", { className: "eidos-color-picker-inputs", children: [
|
|
406
|
-
/* @__PURE__ */ jsx("div", { className: "eidos-color-picker-format-btns", role: "group", "aria-label": "Colour format", children: ["hex", "rgb", "hsl"].map((fmt) => /* @__PURE__ */ jsx(
|
|
407
|
-
"button",
|
|
408
|
-
{
|
|
409
|
-
type: "button",
|
|
410
|
-
className: [
|
|
411
|
-
"eidos-color-picker-format-btn",
|
|
412
|
-
activeFormat === fmt && "eidos-color-picker-format-btn--active"
|
|
413
|
-
].filter(Boolean).join(" "),
|
|
414
|
-
onClick: () => handleFormatChange(fmt),
|
|
415
|
-
disabled,
|
|
416
|
-
"aria-pressed": activeFormat === fmt,
|
|
417
|
-
children: fmt.toUpperCase()
|
|
418
|
-
},
|
|
419
|
-
fmt
|
|
420
|
-
)) }),
|
|
421
|
-
/* @__PURE__ */ jsx(
|
|
422
|
-
"input",
|
|
423
|
-
{
|
|
424
|
-
type: "text",
|
|
425
|
-
className: "eidos-color-picker-input",
|
|
426
|
-
value: inputText,
|
|
427
|
-
disabled,
|
|
428
|
-
spellCheck: false,
|
|
429
|
-
"aria-label": "Colour value",
|
|
430
|
-
onChange: (e) => setInputText(e.target.value),
|
|
431
|
-
onFocus: () => {
|
|
432
|
-
inputFocusedRef.current = true;
|
|
433
|
-
},
|
|
434
|
-
onBlur: () => {
|
|
435
|
-
inputFocusedRef.current = false;
|
|
436
|
-
handleInputCommit();
|
|
476
|
+
"aria-label": `Select ${swatchHex}`,
|
|
477
|
+
title: swatchHex
|
|
437
478
|
},
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
),
|
|
446
|
-
/* @__PURE__ */ jsx(
|
|
447
|
-
"button",
|
|
448
|
-
{
|
|
449
|
-
type: "button",
|
|
450
|
-
className: ["eidos-color-picker-copy", copied && "eidos-color-picker-copy--copied"].filter(Boolean).join(" "),
|
|
451
|
-
onClick: handleCopy,
|
|
452
|
-
disabled,
|
|
453
|
-
"aria-label": "Copy colour value",
|
|
454
|
-
title: "Copy colour value",
|
|
455
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { size: 14 }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
|
|
456
|
-
}
|
|
457
|
-
)
|
|
458
|
-
] }),
|
|
459
|
-
showSwatches && /* @__PURE__ */ jsx("div", { className: "eidos-color-picker-swatches", role: "group", "aria-label": "Colour presets", children: swatches.map((swatchHex) => /* @__PURE__ */ jsx(
|
|
460
|
-
"button",
|
|
461
|
-
{
|
|
462
|
-
type: "button",
|
|
463
|
-
className: [
|
|
464
|
-
"eidos-color-picker-swatch",
|
|
465
|
-
currentHex === swatchHex && "eidos-color-picker-swatch--active"
|
|
466
|
-
].filter(Boolean).join(" "),
|
|
467
|
-
style: { background: swatchHex },
|
|
468
|
-
onClick: () => handleSwatchClick(swatchHex),
|
|
469
|
-
disabled,
|
|
470
|
-
"aria-label": `Select ${swatchHex}`,
|
|
471
|
-
title: swatchHex
|
|
472
|
-
},
|
|
473
|
-
swatchHex
|
|
474
|
-
)) })
|
|
475
|
-
] });
|
|
479
|
+
swatchHex
|
|
480
|
+
)) })
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
);
|
|
476
484
|
const rootClasses = [
|
|
477
485
|
"eidos-color-picker",
|
|
478
486
|
`eidos-color-picker--${size}`,
|
|
@@ -523,4 +531,4 @@ ColorPicker.displayName = "ColorPicker";
|
|
|
523
531
|
export {
|
|
524
532
|
ColorPicker
|
|
525
533
|
};
|
|
526
|
-
//# sourceMappingURL=chunk-
|
|
534
|
+
//# sourceMappingURL=chunk-LEMCJW57.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ColorPicker/ColorPicker.component.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback } from 'react';\nimport { Copy, Check } from 'lucide-react';\nimport { Dropdown } from '../Dropdown/Dropdown.component';\nimport type {\n ColorPickerProps,\n HSVColor,\n RGBColor,\n HSLColor,\n ColorFormat,\n} from './ColorPicker.types';\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nconst DEFAULT_SWATCHES: string[] = [\n '#ef4444',\n '#f97316',\n '#f59e0b',\n '#10b981',\n '#06b6d4',\n '#6366f1',\n '#8b5cf6',\n '#ec4899',\n '#64748b',\n '#1e293b',\n];\n\n// ============================================================================\n// Pure colour-utility functions\n// ============================================================================\n\nfunction hsvToRgb(h: number, s: number, v: number): RGBColor {\n // h: 0–360, s: 0–100, v: 0–100 → r,g,b: 0–255\n const sn = s / 100;\n const vn = v / 100;\n const c = vn * sn;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = vn - c;\n\n let r: number, g: number, b: number;\n if (h < 60) {\n r = c;\n g = x;\n b = 0;\n } else if (h < 120) {\n r = x;\n g = c;\n b = 0;\n } else if (h < 180) {\n r = 0;\n g = c;\n b = x;\n } else if (h < 240) {\n r = 0;\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n g = 0;\n b = c;\n } else {\n r = c;\n g = 0;\n b = x;\n }\n\n return {\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n };\n}\n\nfunction rgbToHsv(r: number, g: number, b: number): HSVColor {\n // r,g,b: 0–255 → h: 0–360, s: 0–100, v: 0–100\n const rn = r / 255;\n const gn = g / 255;\n const bn = b / 255;\n\n const max = Math.max(rn, gn, bn);\n const min = Math.min(rn, gn, bn);\n const delta = max - min;\n\n const v = max * 100;\n const s = max === 0 ? 0 : (delta / max) * 100;\n\n let h = 0;\n if (delta !== 0) {\n if (max === rn) h = ((gn - bn) / delta) % 6;\n else if (max === gn) h = (bn - rn) / delta + 2;\n else h = (rn - gn) / delta + 4;\n h = h * 60;\n if (h < 0) h += 360;\n }\n\n // Deliberately NOT rounded. HSV is this component's internal state, and\n // rounding s/v to whole percent makes the hex -> HSV -> hex round trip lossy:\n // `#5c5de8` came back as `#5d5de8`, so a controlled `value` displayed a\n // different colour than the one passed in, and any interaction committed the\n // drifted value. `hsvToRgb` already rounds to whole channels at the end, so\n // precision is only needed in between. Every consumer of these floats (the\n // hue gradient, the thumb offsets, the hue slider) accepts them.\n return { h, s, v };\n}\n\nfunction rgbToHex(r: number, g: number, b: number): string {\n const ch = (n: number) =>\n Math.round(Math.max(0, Math.min(255, n)))\n .toString(16)\n .padStart(2, '0');\n return `#${ch(r)}${ch(g)}${ch(b)}`;\n}\n\nfunction hexToRgb(hex: string): RGBColor | null {\n const c = hex.trim().replace(/^#/, '');\n let r: number, g: number, b: number;\n\n if (c.length === 3) {\n r = parseInt(c[0] + c[0], 16);\n g = parseInt(c[1] + c[1], 16);\n b = parseInt(c[2] + c[2], 16);\n } else if (c.length === 6) {\n r = parseInt(c.slice(0, 2), 16);\n g = parseInt(c.slice(2, 4), 16);\n b = parseInt(c.slice(4, 6), 16);\n } else {\n return null;\n }\n\n if (isNaN(r) || isNaN(g) || isNaN(b)) return null;\n return { r, g, b };\n}\n\nfunction rgbToHsl(r: number, g: number, b: number): HSLColor {\n // r,g,b: 0–255 → h: 0–360, s: 0–100, l: 0–100\n const rn = r / 255;\n const gn = g / 255;\n const bn = b / 255;\n\n const max = Math.max(rn, gn, bn);\n const min = Math.min(rn, gn, bn);\n const delta = max - min;\n const l = (max + min) / 2;\n\n let h = 0;\n let s = 0;\n\n if (delta !== 0) {\n s = delta / (1 - Math.abs(2 * l - 1));\n if (max === rn) h = ((gn - bn) / delta) % 6;\n else if (max === gn) h = (bn - rn) / delta + 2;\n else h = (rn - gn) / delta + 4;\n h = h * 60;\n if (h < 0) h += 360;\n }\n\n return { h: Math.round(h), s: Math.round(s * 100), l: Math.round(l * 100) };\n}\n\nfunction hslToRgb(h: number, s: number, l: number): RGBColor {\n // h: 0–360, s: 0–100, l: 0–100 → r,g,b: 0–255\n const sn = s / 100;\n const ln = l / 100;\n const c = (1 - Math.abs(2 * ln - 1)) * sn;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m = ln - c / 2;\n\n let r: number, g: number, b: number;\n if (h < 60) {\n r = c;\n g = x;\n b = 0;\n } else if (h < 120) {\n r = x;\n g = c;\n b = 0;\n } else if (h < 180) {\n r = 0;\n g = c;\n b = x;\n } else if (h < 240) {\n r = 0;\n g = x;\n b = c;\n } else if (h < 300) {\n r = x;\n g = 0;\n b = c;\n } else {\n r = c;\n g = 0;\n b = x;\n }\n\n return {\n r: Math.round((r + m) * 255),\n g: Math.round((g + m) * 255),\n b: Math.round((b + m) * 255),\n };\n}\n\n// ============================================================================\n// Format helpers\n// ============================================================================\n\nfunction colorToText(hsv: HSVColor, alpha: number, fmt: ColorFormat): string {\n const rgb = hsvToRgb(hsv.h, hsv.s, hsv.v);\n\n switch (fmt) {\n case 'hex':\n return rgbToHex(rgb.r, rgb.g, rgb.b);\n case 'rgb':\n return alpha < 1\n ? `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha.toFixed(2)})`\n : `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n case 'hsl': {\n const hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);\n return alpha < 1\n ? `hsla(${hsl.h}, ${hsl.s}%, ${hsl.l}%, ${alpha.toFixed(2)})`\n : `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n }\n}\n\nfunction parseColorText(text: string): RGBColor | null {\n const t = text.trim();\n\n // Try hex (with or without leading #)\n const hexCandidate = t.startsWith('#') ? t : /^[0-9a-f]{3,6}$/i.test(t) ? `#${t}` : null;\n if (hexCandidate) return hexToRgb(hexCandidate);\n\n // Try rgb() / rgba()\n const rgbMatch = t.match(/rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)/i);\n if (rgbMatch) {\n return {\n r: parseInt(rgbMatch[1], 10),\n g: parseInt(rgbMatch[2], 10),\n b: parseInt(rgbMatch[3], 10),\n };\n }\n\n // Try hsl() / hsla()\n const hslMatch = t.match(/hsla?\\(\\s*(\\d+)\\s*,\\s*(\\d+)%?\\s*,\\s*(\\d+)%?/i);\n if (hslMatch) {\n return hslToRgb(\n parseInt(hslMatch[1], 10),\n parseInt(hslMatch[2], 10),\n parseInt(hslMatch[3], 10),\n );\n }\n\n return null;\n}\n\n/** Parse a hex string to HSVColor, falling back to red on failure. */\nfunction hexToHsv(hex: string): HSVColor {\n const rgb = hexToRgb(hex);\n return rgb ? rgbToHsv(rgb.r, rgb.g, rgb.b) : { h: 0, s: 100, v: 100 };\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport const ColorPicker: React.FC<ColorPickerProps> = ({\n value,\n defaultValue,\n onChange,\n format = 'hex',\n showAlpha = false,\n showSwatches = true,\n swatches = DEFAULT_SWATCHES,\n disabled = false,\n size = 'md',\n inline = false,\n label,\n className = '',\n}) => {\n // ── Initial hex (only used on first render by useState) ──────────────────\n const initialHex = value ?? defaultValue ?? '#6366f1';\n\n // ── State ─────────────────────────────────────────────────────────────────\n const [hsv, setHsv] = useState<HSVColor>(() => hexToHsv(initialHex));\n const [alpha, setAlpha] = useState<number>(1);\n const [activeFormat, setActiveFormat] = useState<ColorFormat>(format);\n const [inputText, setInputText] = useState<string>(() =>\n colorToText(hexToHsv(initialHex), 1, format),\n );\n const [copied, setCopied] = useState(false);\n\n // ── Refs - give event handlers always-fresh values without stale closures ──\n const hsvRef = useRef<HSVColor>(hsv);\n hsvRef.current = hsv;\n\n const alphaRef = useRef<number>(alpha);\n alphaRef.current = alpha;\n\n const activeFormatRef = useRef<ColorFormat>(activeFormat);\n activeFormatRef.current = activeFormat;\n\n // onChange is stored in a ref so applyColor never becomes stale\n const onChangeRef = useRef<ColorPickerProps['onChange']>(onChange);\n onChangeRef.current = onChange;\n\n const inputFocusedRef = useRef(false);\n const canvasRef = useRef<HTMLDivElement>(null);\n\n // Refs for in-flight drag listeners - cleaned up on mouseup and on unmount\n const dragHandlersRef = useRef<{\n move: (e: MouseEvent) => void;\n up: () => void;\n } | null>(null);\n\n const copiedTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // ── Derived ───────────────────────────────────────────────────────────────\n const currentRgb = hsvToRgb(hsv.h, hsv.s, hsv.v);\n const currentHex = rgbToHex(currentRgb.r, currentRgb.g, currentRgb.b);\n\n // ── Sync from controlled `value` prop ─────────────────────────────────────\n // Runs only when `value` changes. We normalize both sides to the same\n // hex format before comparing so that round-trip conversions don't trigger\n // spurious updates (which would overwrite the preserved hue when s/v = 0).\n useEffect(() => {\n if (value === undefined) return;\n const rgb = hexToRgb(value);\n if (!rgb) return;\n const newHsv = rgbToHsv(rgb.r, rgb.g, rgb.b);\n const newNormalised = rgbToHex(\n ...(Object.values(hsvToRgb(newHsv.h, newHsv.s, newHsv.v)) as [number, number, number]),\n );\n // currentHex is captured from this render - guards against echo loops\n // when the parent echoes back our own onChange emission\n if (newNormalised === currentHex) return;\n setHsv(newHsv);\n if (!inputFocusedRef.current) {\n setInputText(colorToText(newHsv, alphaRef.current, activeFormatRef.current));\n }\n }, [value, currentHex]);\n\n // ── Cleanup drag listeners and timers on unmount ──────────────────────────\n useEffect(() => {\n return () => {\n if (dragHandlersRef.current) {\n document.removeEventListener('mousemove', dragHandlersRef.current.move);\n document.removeEventListener('mouseup', dragHandlersRef.current.up);\n }\n if (copiedTimerRef.current) clearTimeout(copiedTimerRef.current);\n };\n }, []);\n\n // ── Core: apply a new HSV + alpha, emit onChange ───────────────────────────\n // Stable (empty dep array) - reads live values exclusively via refs.\n const applyColor = useCallback((newHsv: HSVColor, newAlpha: number) => {\n setHsv(newHsv);\n setAlpha(newAlpha);\n\n if (!inputFocusedRef.current) {\n setInputText(colorToText(newHsv, newAlpha, activeFormatRef.current));\n }\n\n const rgb = hsvToRgb(newHsv.h, newHsv.s, newHsv.v);\n const hex = rgbToHex(rgb.r, rgb.g, rgb.b);\n onChangeRef.current?.(hex);\n }, []);\n\n // ── 2-D saturation / brightness canvas ────────────────────────────────────\n const handleCanvasMouseDown = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) return;\n e.preventDefault();\n\n const pick = (clientX: number, clientY: number) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n const s = Math.max(0, Math.min(100, ((clientX - rect.left) / rect.width) * 100));\n const v = Math.max(0, Math.min(100, 100 - ((clientY - rect.top) / rect.height) * 100));\n applyColor({ h: hsvRef.current.h, s, v }, alphaRef.current);\n };\n\n pick(e.clientX, e.clientY);\n\n const handleMouseMove = (me: MouseEvent) => pick(me.clientX, me.clientY);\n const handleMouseUp = () => {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n dragHandlersRef.current = null;\n };\n\n dragHandlersRef.current = { move: handleMouseMove, up: handleMouseUp };\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n },\n [disabled, applyColor],\n );\n\n // ── Hue slider ────────────────────────────────────────────────────────────\n const handleHueChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n applyColor({ ...hsvRef.current, h: Number(e.target.value) }, alphaRef.current);\n },\n [applyColor],\n );\n\n // ── Alpha slider ──────────────────────────────────────────────────────────\n const handleAlphaChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n applyColor(hsvRef.current, Number(e.target.value) / 100);\n },\n [applyColor],\n );\n\n // ── Format toggle ─────────────────────────────────────────────────────────\n const handleFormatChange = useCallback((fmt: ColorFormat) => {\n setActiveFormat(fmt);\n setInputText(colorToText(hsvRef.current, alphaRef.current, fmt));\n }, []);\n\n // ── Text-input commit (Enter / blur) ──────────────────────────────────────\n const handleInputCommit = useCallback(() => {\n const rgb = parseColorText(inputText);\n if (!rgb) {\n // Invalid - reset to the current valid colour\n setInputText(colorToText(hsvRef.current, alphaRef.current, activeFormatRef.current));\n return;\n }\n const newHsv = rgbToHsv(rgb.r, rgb.g, rgb.b);\n applyColor(newHsv, alphaRef.current);\n // Always normalise the text after a commit (even if the input still has focus)\n setInputText(colorToText(newHsv, alphaRef.current, activeFormatRef.current));\n }, [inputText, applyColor]);\n\n // ── Swatch click ──────────────────────────────────────────────────────────\n const handleSwatchClick = useCallback(\n (hex: string) => {\n const rgb = hexToRgb(hex);\n if (!rgb) return;\n applyColor(rgbToHsv(rgb.r, rgb.g, rgb.b), alphaRef.current);\n },\n [applyColor],\n );\n\n // ── Copy to clipboard ─────────────────────────────────────────────────────\n const handleCopy = useCallback(() => {\n const text = colorToText(hsvRef.current, alphaRef.current, activeFormatRef.current);\n navigator.clipboard\n .writeText(text)\n .then(() => {\n setCopied(true);\n if (copiedTimerRef.current) clearTimeout(copiedTimerRef.current);\n copiedTimerRef.current = setTimeout(() => setCopied(false), 2000);\n })\n .catch(() => {\n // Clipboard access denied - silently ignore\n });\n }, []);\n\n // ── Alpha-slider background gradient ─────────────────────────────────────\n // We use a transparent-to-current-colour gradient layered over a checkerboard\n // so the alpha slider always shows the correct colour transition.\n const transparentColor = `rgba(${currentRgb.r}, ${currentRgb.g}, ${currentRgb.b}, 0)`;\n\n const alphaTrackBg = {\n backgroundImage: [\n `linear-gradient(to right, ${transparentColor}, ${currentHex})`,\n 'linear-gradient(45deg, #e2e8f0 25%, transparent 25%)',\n 'linear-gradient(-45deg, #e2e8f0 25%, transparent 25%)',\n 'linear-gradient(45deg, transparent 75%, #e2e8f0 75%)',\n 'linear-gradient(-45deg, transparent 75%, #e2e8f0 75%)',\n ].join(', '),\n backgroundSize: '100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px',\n backgroundPosition: '0 0, 0 0, 0 4px, 4px -4px, -4px 0',\n };\n\n // ── Picker panel (shared between inline and popover modes) ────────────────\n //\n // The size modifier has to live on the panel itself, not only on the root:\n // in popover mode the panel is portaled to document.body by Dropdown, so\n // anything inside it that sized itself off a `.eidos-color-picker--{size}`\n // ancestor matched nothing and collapsed. That is what removed the\n // saturation/brightness canvas entirely from every non-inline picker.\n const panel = (\n <div\n className={`eidos-color-picker-panel eidos-color-picker-panel--${size}${\n inline ? ' eidos-color-picker-panel--inline' : ''\n }`}\n >\n {/* 2-D sat / brightness canvas */}\n <div\n ref={canvasRef}\n className=\"eidos-color-picker-canvas\"\n style={{\n background: [\n 'linear-gradient(to top, #000, transparent)',\n `linear-gradient(to right, #fff, hsl(${hsv.h}, 100%, 50%))`,\n ].join(', '),\n }}\n onMouseDown={handleCanvasMouseDown}\n role=\"presentation\"\n >\n <div\n className=\"eidos-color-picker-thumb\"\n style={{\n // Rounded for display only - hsv.s/v are unrounded floats so the\n // hex round trip stays lossless (see rgbToHsv).\n left: `${hsv.s.toFixed(2)}%`,\n top: `${(100 - hsv.v).toFixed(2)}%`,\n background: currentHex,\n }}\n />\n </div>\n\n {/* Sliders */}\n <div className=\"eidos-color-picker-sliders\">\n {/* Hue */}\n <input\n type=\"range\"\n className=\"eidos-color-picker-hue\"\n min={0}\n max={360}\n step={1}\n value={hsv.h}\n disabled={disabled}\n onChange={handleHueChange}\n aria-label=\"Hue\"\n />\n\n {/* Alpha */}\n {showAlpha && (\n <div className=\"eidos-color-picker-alpha-wrapper\">\n <div className=\"eidos-color-picker-alpha-bg\" style={alphaTrackBg} />\n <input\n type=\"range\"\n className=\"eidos-color-picker-alpha\"\n min={0}\n max={100}\n step={1}\n value={Math.round(alpha * 100)}\n disabled={disabled}\n onChange={handleAlphaChange}\n aria-label=\"Opacity\"\n />\n </div>\n )}\n </div>\n\n {/* Text input + format toggles + copy */}\n <div className=\"eidos-color-picker-inputs\">\n <div className=\"eidos-color-picker-format-btns\" role=\"group\" aria-label=\"Colour format\">\n {(['hex', 'rgb', 'hsl'] as ColorFormat[]).map((fmt) => (\n <button\n key={fmt}\n type=\"button\"\n className={[\n 'eidos-color-picker-format-btn',\n activeFormat === fmt && 'eidos-color-picker-format-btn--active',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => handleFormatChange(fmt)}\n disabled={disabled}\n aria-pressed={activeFormat === fmt}\n >\n {fmt.toUpperCase()}\n </button>\n ))}\n </div>\n\n <input\n type=\"text\"\n className=\"eidos-color-picker-input\"\n value={inputText}\n disabled={disabled}\n spellCheck={false}\n aria-label=\"Colour value\"\n onChange={(e) => setInputText(e.target.value)}\n onFocus={() => {\n inputFocusedRef.current = true;\n }}\n onBlur={() => {\n inputFocusedRef.current = false;\n handleInputCommit();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleInputCommit();\n if (e.key === 'Escape') {\n setInputText(colorToText(hsvRef.current, alphaRef.current, activeFormatRef.current));\n }\n }}\n />\n\n <button\n type=\"button\"\n className={['eidos-color-picker-copy', copied && 'eidos-color-picker-copy--copied']\n .filter(Boolean)\n .join(' ')}\n onClick={handleCopy}\n disabled={disabled}\n aria-label=\"Copy colour value\"\n title=\"Copy colour value\"\n >\n {copied ? <Check size={14} /> : <Copy size={14} />}\n </button>\n </div>\n\n {/* Swatches */}\n {showSwatches && (\n <div className=\"eidos-color-picker-swatches\" role=\"group\" aria-label=\"Colour presets\">\n {swatches.map((swatchHex) => (\n <button\n key={swatchHex}\n type=\"button\"\n className={[\n 'eidos-color-picker-swatch',\n currentHex === swatchHex && 'eidos-color-picker-swatch--active',\n ]\n .filter(Boolean)\n .join(' ')}\n style={{ background: swatchHex }}\n onClick={() => handleSwatchClick(swatchHex)}\n disabled={disabled}\n aria-label={`Select ${swatchHex}`}\n title={swatchHex}\n />\n ))}\n </div>\n )}\n </div>\n );\n\n // ── Root element classes ───────────────────────────────────────────────────\n const rootClasses = [\n 'eidos-color-picker',\n `eidos-color-picker--${size}`,\n disabled && 'eidos-color-picker--disabled',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // ── Inline mode ───────────────────────────────────────────────────────────\n if (inline) {\n return (\n <div className={rootClasses}>\n {label && <span className=\"eidos-color-picker-label\">{label}</span>}\n {panel}\n </div>\n );\n }\n\n // ── Popover (trigger + Dropdown) ──────────────────────────────────────────\n return (\n <div className={rootClasses}>\n {label && <span className=\"eidos-color-picker-label\">{label}</span>}\n <Dropdown\n trigger={\n <button\n type=\"button\"\n className=\"eidos-color-picker-trigger\"\n disabled={disabled}\n aria-label={label ?? 'Open colour picker'}\n >\n <span\n className=\"eidos-color-picker-trigger-swatch\"\n style={{ background: currentHex }}\n />\n <span className=\"eidos-color-picker-trigger-value\">{currentHex}</span>\n </button>\n }\n content={panel}\n placement=\"bottom\"\n autoWidth={false}\n minWidth={260}\n disabled={disabled}\n />\n </div>\n );\n};\n\nColorPicker.displayName = 'ColorPicker';\n"],"mappings":";;;;;AAAA,SAAgB,UAAU,QAAQ,WAAW,mBAAmB;AAChE,SAAS,MAAM,aAAa;AAqfpB,cA6BE,YA7BF;AAveR,IAAM,mBAA6B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMA,SAAS,SAAS,GAAW,GAAW,GAAqB;AAE3D,QAAM,KAAK,IAAI;AACf,QAAM,KAAK,IAAI;AACf,QAAM,IAAI,KAAK;AACf,QAAM,IAAI,KAAK,IAAI,KAAK,IAAM,IAAI,KAAM,IAAK,CAAC;AAC9C,QAAM,IAAI,KAAK;AAEf,MAAI,GAAW,GAAW;AAC1B,MAAI,IAAI,IAAI;AACV,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN,WAAW,IAAI,KAAK;AAClB,QAAI;AACJ,QAAI;AACJ,QAAI;AAAA,EACN,WAAW,IAAI,KAAK;AA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