{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "color-picker",
  "title": "color-picker",
  "description": "color-picker",
  "dependencies": [
    "@heroicons/react",
    "@react-stately/color",
    "react-aria-components",
    "cn"
  ],
  "registryDependencies": [
    "https://intentui.com/r/button",
    "https://intentui.com/r/field"
  ],
  "files": [
    {
      "path": "src/components/ui/color-picker.tsx",
      "content": "\"use client\"\n\nimport { EyeDropperIcon } from \"@heroicons/react/24/solid\"\nimport { parseColor } from \"@react-stately/color\"\nimport { use } from \"react\"\nimport {\n  ColorPicker as ColorPickerPrimitive,\n  type ColorPickerProps as ColorPickerPrimitiveProps,\n  ColorPickerStateContext,\n} from \"react-aria-components/ColorPicker\"\nimport { cn } from \"cn\"\nimport { Button } from \"./button\"\nimport { fieldStyles } from \"./field\"\n\nexport interface ColorPickerProps extends ColorPickerPrimitiveProps {\n  className?: string\n}\n\nexport function ColorPicker({ className, ...props }: ColorPickerProps) {\n  return (\n    <div data-slot=\"control\" className={cn(fieldStyles({ className: \"w-fit\" }), className)}>\n      <ColorPickerPrimitive {...props} />\n    </div>\n  )\n}\n\ndeclare global {\n  interface Window {\n    EyeDropper?: new () => { open: () => Promise<{ sRGBHex: string }> }\n  }\n}\n\nexport function EyeDropper() {\n  const state = use(ColorPickerStateContext)!\n\n  if (!window.EyeDropper) {\n    return \"EyeDropper is not supported in your browser.\"\n  }\n\n  return (\n    <Button\n      className=\"shrink-0\"\n      aria-label=\"Eye dropper\"\n      size=\"sq-md\"\n      intent=\"outline\"\n      onPress={() => {\n        const eyeDropper = window.EyeDropper ? new window.EyeDropper() : null\n        eyeDropper?.open().then((result) => state.setColor(parseColor(result.sRGBHex)))\n      }}\n    >\n      <EyeDropperIcon />\n    </Button>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}