{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "color-picker",
  "type": "registry:ui",
  "title": "Color Picker",
  "dependencies": [
    "@base-ui-next/react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://hamur.dev/r/react/utils.json",
    "https://hamur.dev/r/react/button.json"
  ],
  "files": [
    {
      "path": "react/color-picker.tsx",
      "content": "'use client'\n\nimport { ColorPicker as ColorPickerPrimitive } from '@base-ui-next/react/color-picker' // base-ui-next/ui color-picker@0.1.1\nimport type { VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\n\nconst colorPickerClassName = 'flex w-fit flex-col gap-3'\n\n/** The color in the Trigger, before its text. */\nconst colorPickerTriggerSwatchClassName =\n  'inline-block size-5 shrink-0 rounded-sm border border-foreground/20 [background:linear-gradient(var(--color),var(--color)),conic-gradient(color-mix(in_oklch,var(--muted-foreground)_25%,var(--background))_25%,var(--background)_0_50%,color-mix(in_oklch,var(--muted-foreground)_25%,var(--background))_0_75%,var(--background)_0)_0_0/8px_8px]'\n\nconst colorPickerPositionerClassName = 'isolate z-50'\n\nconst colorPickerPopupClassName =\n  'z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95'\n\nconst colorPickerCloseClassName = 'self-end'\n\nconst colorPickerAreaClassName =\n  'relative h-40 w-full cursor-crosshair rounded-md [background:var(--area-background)] data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default'\n\nconst colorPickerAreaThumbClassName =\n  'z-10 box-border size-5 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.6),inset_0_0_0_1px_rgb(0_0_0/0.6)] outline-none data-focused:ring-3 data-focused:ring-ring/50'\n\nconst colorPickerChannelSliderClassName =\n  'relative h-4 w-full cursor-pointer rounded-full [background:var(--channel-gradient),conic-gradient(color-mix(in_oklch,var(--muted-foreground)_25%,var(--background))_25%,var(--background)_0_50%,color-mix(in_oklch,var(--muted-foreground)_25%,var(--background))_0_75%,var(--background)_0)_0_0/8px_8px] data-[orientation=vertical]:h-40 data-[orientation=vertical]:w-4 data-disabled:cursor-not-allowed data-disabled:opacity-50'\n\nconst colorPickerChannelSliderThumbClassName =\n  'z-10 box-border size-5 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.6),inset_0_0_0_1px_rgb(0_0_0/0.6)] outline-none data-focused:ring-3 data-focused:ring-ring/50'\n\n/**\n * The ring is drawn by `::before`, 0.5rem past the Wheel's box on every side: the thumb sits on the\n * circle that touches the box, so its middle is the middle of the ring.\n */\nconst colorPickerWheelClassName =\n  'relative m-2 size-40 cursor-pointer self-center before:absolute before:-inset-2 before:rounded-full before:[background:var(--wheel-gradient)] before:[mask:radial-gradient(farthest-side,transparent_calc(100%_-_1rem),#000_calc(100%_-_1rem))] data-disabled:cursor-not-allowed data-disabled:opacity-50'\n\nconst colorPickerWheelThumbClassName =\n  'z-10 box-border size-5 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.6),inset_0_0_0_1px_rgb(0_0_0/0.6)] outline-none data-focused:ring-3 data-focused:ring-ring/50'\n\nconst colorPickerInputClassName =\n  'h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 font-mono text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40'\n\nconst colorPickerChannelInputClassName =\n  'h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 font-mono text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 w-16 text-center tabular-nums'\n\nconst colorPickerSwatchClassName =\n  'inline-block size-6 shrink-0 rounded-md border border-foreground/20 [background:linear-gradient(var(--color),var(--color)),conic-gradient(color-mix(in_oklch,var(--muted-foreground)_25%,var(--background))_25%,var(--background)_0_50%,color-mix(in_oklch,var(--muted-foreground)_25%,var(--background))_0_75%,var(--background)_0)_0_0/8px_8px] data-empty:border-dashed'\n\nconst colorPickerValueClassName = 'font-mono text-sm text-muted-foreground tabular-nums'\n\nconst colorPickerEyeDropperClassName =\n  'aria-disabled:pointer-events-none aria-disabled:opacity-50'\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>\n\n// No shadcn item: one name per Base UI part (BN-331, question 10). The app writes the popup as\n// `Portal` > `Positioner` > `Popup`, as the headless anatomy has it.\nfunction ColorPicker({ className, ...props }: ColorPickerPrimitive.Root.Props) {\n  return (\n    <ColorPickerPrimitive.Root\n      data-slot=\"color-picker\"\n      className={cn(colorPickerClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerTrigger({\n  className,\n  variant = 'outline',\n  children,\n  ...props\n}: ColorPickerPrimitive.Trigger.Props & Pick<ButtonVariants, 'variant'>) {\n  return (\n    <ColorPickerPrimitive.Trigger\n      data-slot=\"color-picker-trigger\"\n      className={cn(buttonVariants({ variant, className }))}\n      {...props}\n    >\n      <span aria-hidden=\"true\" className={colorPickerTriggerSwatchClassName} />\n      {children}\n    </ColorPickerPrimitive.Trigger>\n  )\n}\n\nfunction ColorPickerPortal({ ...props }: ColorPickerPrimitive.Portal.Props) {\n  return <ColorPickerPrimitive.Portal data-slot=\"color-picker-portal\" {...props} />\n}\n\nfunction ColorPickerPositioner({\n  className,\n  sideOffset = 4,\n  ...props\n}: ColorPickerPrimitive.Positioner.Props) {\n  return (\n    <ColorPickerPrimitive.Positioner\n      data-slot=\"color-picker-positioner\"\n      sideOffset={sideOffset}\n      className={cn(colorPickerPositionerClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerPopup({ className, ...props }: ColorPickerPrimitive.Popup.Props) {\n  return (\n    <ColorPickerPrimitive.Popup\n      data-slot=\"color-picker-popup\"\n      className={cn(colorPickerPopupClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerClose({\n  className,\n  variant = 'outline',\n  size = 'sm',\n  children,\n  ...props\n}: ColorPickerPrimitive.Close.Props & ButtonVariants) {\n  return (\n    <ColorPickerPrimitive.Close\n      data-slot=\"color-picker-close\"\n      className={cn(buttonVariants({ variant, size }), colorPickerCloseClassName, className)}\n      {...props}\n    >\n      {children ?? 'Done'}\n    </ColorPickerPrimitive.Close>\n  )\n}\n\nfunction ColorPickerArea({ className, ...props }: ColorPickerPrimitive.Area.Props) {\n  return (\n    <ColorPickerPrimitive.Area\n      data-slot=\"color-picker-area\"\n      className={cn(colorPickerAreaClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerAreaThumb({ className, ...props }: ColorPickerPrimitive.AreaThumb.Props) {\n  return (\n    <ColorPickerPrimitive.AreaThumb\n      data-slot=\"color-picker-area-thumb\"\n      className={cn(colorPickerAreaThumbClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerChannelSlider({\n  className,\n  ...props\n}: ColorPickerPrimitive.ChannelSlider.Props) {\n  return (\n    <ColorPickerPrimitive.ChannelSlider\n      data-slot=\"color-picker-channel-slider\"\n      className={cn(colorPickerChannelSliderClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerChannelSliderThumb({\n  className,\n  ...props\n}: ColorPickerPrimitive.ChannelSliderThumb.Props) {\n  return (\n    <ColorPickerPrimitive.ChannelSliderThumb\n      data-slot=\"color-picker-channel-slider-thumb\"\n      className={cn(colorPickerChannelSliderThumbClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerWheel({ className, ...props }: ColorPickerPrimitive.Wheel.Props) {\n  return (\n    <ColorPickerPrimitive.Wheel\n      data-slot=\"color-picker-wheel\"\n      className={cn(colorPickerWheelClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerWheelThumb({ className, ...props }: ColorPickerPrimitive.WheelThumb.Props) {\n  return (\n    <ColorPickerPrimitive.WheelThumb\n      data-slot=\"color-picker-wheel-thumb\"\n      className={cn(colorPickerWheelThumbClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerInput({ className, ...props }: ColorPickerPrimitive.Input.Props) {\n  return (\n    <ColorPickerPrimitive.Input\n      data-slot=\"color-picker-input\"\n      className={cn(colorPickerInputClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerChannelInput({ className, ...props }: ColorPickerPrimitive.ChannelInput.Props) {\n  return (\n    <ColorPickerPrimitive.ChannelInput\n      data-slot=\"color-picker-channel-input\"\n      className={cn(colorPickerChannelInputClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerSwatch({ className, ...props }: ColorPickerPrimitive.Swatch.Props) {\n  return (\n    <ColorPickerPrimitive.Swatch\n      data-slot=\"color-picker-swatch\"\n      className={cn(colorPickerSwatchClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerValue({ className, ...props }: ColorPickerPrimitive.Value.Props) {\n  return (\n    <ColorPickerPrimitive.Value\n      data-slot=\"color-picker-value\"\n      className={cn(colorPickerValueClassName, className)}\n      {...props}\n    />\n  )\n}\n\n// lucide's Pipette, inline and hidden from assistive technology (10 · As built, BN-309); the\n// button keeps Base UI's `labels.eyeDropper` as its name.\nfunction ColorPickerEyeDropper({\n  className,\n  variant = 'outline',\n  size = 'icon',\n  children,\n  ...props\n}: ColorPickerPrimitive.EyeDropper.Props & ButtonVariants) {\n  return (\n    <ColorPickerPrimitive.EyeDropper\n      data-slot=\"color-picker-eye-dropper\"\n      className={cn(buttonVariants({ variant, size }), colorPickerEyeDropperClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"2\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          aria-hidden=\"true\"\n        >\n          <path d=\"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12\" />\n          <path d=\"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z\" />\n          <path d=\"m2 22 .414-.414\" />\n        </svg>\n      )}\n    </ColorPickerPrimitive.EyeDropper>\n  )\n}\n\nexport {\n  ColorPicker,\n  ColorPickerArea,\n  ColorPickerAreaThumb,\n  ColorPickerChannelInput,\n  ColorPickerChannelSlider,\n  ColorPickerChannelSliderThumb,\n  ColorPickerClose,\n  ColorPickerEyeDropper,\n  ColorPickerInput,\n  ColorPickerPopup,\n  ColorPickerPortal,\n  ColorPickerPositioner,\n  ColorPickerSwatch,\n  ColorPickerTrigger,\n  ColorPickerValue,\n  ColorPickerWheel,\n  ColorPickerWheelThumb,\n}\n",
      "type": "registry:ui",
      "target": "@ui/color-picker.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.1",
      "hash": "f780db654b0103f740dc4b069c7d2b1766a9af5be2e85069467970b1b5de2660",
      "files": {
        "@ui/color-picker.tsx": "ec748c437cb90cbedc03c7aa3479d9d60766e71f1efdf2bfebdcc8eb7a63a38b"
      }
    }
  }
}
