feat(site): Add custom color picker (#5290)

* feat(docs): add custom color picker built on vue-color

Replace the native color input in the icon customizers with a dropdown
built on vue-color's ChromePicker: a saturation area, hue and alpha
sliders, and an eyedropper button where the browser supports it.

- Knobs use the same 20px size, shadow and hover/active rings as the
  customizer's range slider thumbs
- The panel is teleported to the body and positioned with floating-ui,
  so the sidebar's scroll container doesn't clip it
- vue-color is loaded lazily when the picker is about to open
- Keyboard: Tab moves through the panel and on to the hex field,
  Shift+Tab goes back, Escape closes and returns focus to the swatch.
  vue-color's sliders prevent the default of every key, so Tab is
  handled by hand
- Colors are emitted as hex, with 8 digits when alpha is below 100%

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9u8FhybXR7xuDECHDUz2n

* feat(docs): remove opacity slider from color picker

The picker now only produces opaque colors, always emitted as 6-digit
hex. The hue slider sits alone next to the eyedropper button, and the
popover no longer reserves height for the second slider.

Also binds aria-expanded as a boolean again, which fixes the vue-tsc
error from the previous commit. Vue renders false as "false".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G9u8FhybXR7xuDECHDUz2n

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Eric Fennis
2026-11-24 17:01:00 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 586bf5cf9b
commit 9e7b1ce5a9
4 changed files with 472 additions and 25 deletions
+1
View File
@@ -81,6 +81,7 @@
"resend": "^6.34.1",
"sandpack-vue3": "3.1.12",
"vue": "^3.5.45",
"vue-color": "^3.3.3",
"vue-sonner": "^2.0.9"
}
}