{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "color-picker",
  "title": "Color Picker",
  "description": "The picker unfolds from its swatch, the thumb grows while you drag and the colour cross-fades.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.2",
    "@ui-sdk/react@0.1.0-beta.2"
  ],
  "registryDependencies": [
    "@keyframery/motion"
  ],
  "files": [
    {
      "path": "registry/components/keyframery/primitives/color-picker.tsx",
      "content": "\"use client\"\n\n/* Animated drop-in for `@ui-sdk/react/color-picker`: same parts, same props. Swap the import and keep your code.\n   This file adds motion only. Colours, radii, shadows and spacing stay yours.\n\n   - Area and slider thumbs: grow with a pop while grabbed, whether you press the thumb or the track.\n   - Swatch items: the chosen one pops (scale 0.7 to 1 on `ease-pop`), so its ring opens with a bounce.\n   - Extra helpers for a picker in a popup: ColorPickerPopover, ColorPickerTrigger (Press) and\n     ColorPickerContent (Unfold), built on `@ui-sdk/react/popover`. */\n\nimport {\n  ColorPickerArea as ColorPickerAreaPart,\n  ColorPickerAreaThumb as ColorPickerAreaThumbPart,\n  ColorPickerEyeDropper as ColorPickerEyeDropperPart,\n  ColorPickerSlider as ColorPickerSliderPart,\n  ColorPickerSliderThumb as ColorPickerSliderThumbPart,\n  ColorPickerSwatchItem as ColorPickerSwatchItemPart,\n} from \"@ui-sdk/react/color-picker\"\nimport {\n  Popover as PopoverRoot,\n  PopoverContent as PopoverContentPart,\n  PopoverTrigger as PopoverTriggerPart,\n} from \"@ui-sdk/react/popover\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport * from \"@ui-sdk/react/color-picker\"\n\nconst popKeyframes = \"@keyframes kf-pop{from{scale:.7}to{scale:1}}\"\n\nconst thumb =\n  \"transition-[scale,box-shadow] duration-[calc(320ms*var(--kf-speed,1))] ease-pop hover:scale-110 active:scale-[1.35] motion-reduce:transition-none!\"\n\nfunction ColorPickerArea({ className, ...props }: React.ComponentProps<typeof ColorPickerAreaPart>) {\n  return <ColorPickerAreaPart className={cn(\"group/kf-track\", className)} {...props} />\n}\n\nfunction ColorPickerSlider({ className, ...props }: React.ComponentProps<typeof ColorPickerSliderPart>) {\n  return <ColorPickerSliderPart className={cn(\"group/kf-track\", className)} {...props} />\n}\n\nfunction ColorPickerAreaThumb({ className, ...props }: React.ComponentProps<typeof ColorPickerAreaThumbPart>) {\n  return (\n    <ColorPickerAreaThumbPart\n      className={cn(thumb, \"group-active/kf-track:scale-[1.35]\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerSliderThumb({ className, ...props }: React.ComponentProps<typeof ColorPickerSliderThumbPart>) {\n  return (\n    <ColorPickerSliderThumbPart\n      className={cn(thumb, \"group-active/kf-track:scale-[1.35]\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerSwatchItem({ className, ...props }: React.ComponentProps<typeof ColorPickerSwatchItemPart>) {\n  return (\n    <>\n      <style href=\"kf-pop\" precedence=\"default\">\n        {popKeyframes}\n      </style>\n      <ColorPickerSwatchItemPart\n        className={cn(\n          \"transition-[scale,box-shadow] duration-[calc(260ms*var(--kf-speed,1))] ease-pop hover:scale-110 active:scale-90\",\n          \"data-selected:animate-[kf-pop_calc(460ms*var(--kf-speed,1))_var(--ease-pop)] data-selected:hover:scale-100\",\n          \"motion-reduce:transition-none! motion-reduce:animate-none!\",\n          className,\n        )}\n        {...props}\n      />\n    </>\n  )\n}\n\nfunction ColorPickerEyeDropper({ className, ...props }: React.ComponentProps<typeof ColorPickerEyeDropperPart>) {\n  return (\n    <ColorPickerEyeDropperPart\n      className={cn(\n        \"transition-[scale,background-color] duration-[calc(200ms*var(--kf-speed,1))] ease-pop active:scale-[0.96] motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Helpers for a picker that opens from a swatch. Put the popover inside the ColorPicker. */\nfunction ColorPickerPopover(props: React.ComponentProps<typeof PopoverRoot>) {\n  return <PopoverRoot {...props} />\n}\n\nfunction ColorPickerTrigger({ className, ...props }: React.ComponentProps<typeof PopoverTriggerPart>) {\n  return (\n    <PopoverTriggerPart\n      className={cn(\n        \"transition-[scale,background-color] duration-[calc(200ms*var(--kf-speed,1))] ease-pop active:scale-[0.96] motion-reduce:transition-none!\",\n        \"[&>svg]:transition-[rotate] [&>svg]:duration-[calc(420ms*var(--kf-speed,1))] [&>svg]:ease-spring data-open:[&>svg]:rotate-180 motion-reduce:[&>svg]:transition-none\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* Unfold: from the swatch, scale 0.86 with a 6px blur and 8px toward it, on a spring. */\nfunction ColorPickerContent({ className, ...props }: React.ComponentProps<typeof PopoverContentPart>) {\n  return (\n    <PopoverContentPart\n      className={cn(\n        \"origin-(--transform-origin) transition-[opacity,scale,translate,filter] duration-[calc(380ms*var(--kf-speed,1))] ease-spring\",\n        \"data-starting-style:scale-[0.86] data-starting-style:opacity-0 data-starting-style:blur-[6px]\",\n        \"data-[side=bottom]:data-starting-style:-translate-y-2 data-[side=top]:data-starting-style:translate-y-2\",\n        \"data-[side=left]:data-starting-style:translate-x-2 data-[side=right]:data-starting-style:-translate-x-2\",\n        \"data-ending-style:scale-[0.96] data-ending-style:opacity-0 data-ending-style:blur-[2px] data-ending-style:duration-[calc(150ms*var(--kf-speed,1))] data-ending-style:ease-house\",\n        \"motion-reduce:transition-none!\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  ColorPickerArea,\n  ColorPickerAreaThumb,\n  ColorPickerContent,\n  ColorPickerEyeDropper,\n  ColorPickerPopover,\n  ColorPickerSlider,\n  ColorPickerSliderThumb,\n  ColorPickerSwatchItem,\n  ColorPickerTrigger,\n}\n",
      "type": "registry:component",
      "target": "components/keyframery/primitives/color-picker.tsx"
    },
    {
      "path": "registry/components/keyframery/color-picker.tsx",
      "content": "\"use client\"\n\n/* Styled color picker: the animated primitive plus the Keyframery look. */\n\nimport {\n  ColorPicker as ColorPickerRoot,\n  ColorPickerArea as ColorPickerAreaPart,\n  ColorPickerAreaCanvas as ColorPickerAreaCanvasPart,\n  ColorPickerAreaThumb as ColorPickerAreaThumbPart,\n  ColorPickerChannelInput as ColorPickerChannelInputPart,\n  ColorPickerContent as ColorPickerContentPart,\n  ColorPickerEyeDropper as ColorPickerEyeDropperPart,\n  ColorPickerInput as ColorPickerInputPart,\n  ColorPickerPopover as ColorPickerPopoverPart,\n  ColorPickerSlider as ColorPickerSliderPart,\n  ColorPickerSliderThumb as ColorPickerSliderThumbPart,\n  ColorPickerSwatch as ColorPickerSwatchPart,\n  ColorPickerSwatches as ColorPickerSwatchesPart,\n  ColorPickerSwatchItem as ColorPickerSwatchItemPart,\n  ColorPickerTrigger as ColorPickerTriggerPart,\n  createColorPickerController,\n} from \"@/components/keyframery/primitives/color-picker\"\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* A hairline inside anything filled with the colour, so white and black still have an edge. */\nconst colorEdge =\n  \"shadow-[inset_0_0_0_1px_rgb(0_0_0/0.1)] dark:shadow-[inset_0_0_0_1px_rgb(255_255_255/0.12)]\"\n\n/* Transparent colours sit on a quiet checkerboard. */\nconst checker =\n  \"[background:linear-gradient(var(--color-picker-color),var(--color-picker-color)),repeating-conic-gradient(var(--muted)_0_25%,var(--background)_0_50%)_0_0/8px_8px]\"\n\n/* Thumbs are small keys filled with the colour: a white collar, a hairline and a soft drop. */\nconst thumb = cn(\n  \"absolute size-[18px] -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full bg-(--color-picker-color) outline-none\",\n  \"shadow-[0_0_0_2.5px_rgb(255_255_255),0_0_0_3.5px_rgb(0_0_0/0.12),0_2px_6px_rgb(0_0_0/0.3)]\",\n  \"dark:shadow-[0_0_0_2.5px_rgb(255_255_255),0_0_0_3.5px_rgb(0_0_0/0.5),0_2px_8px_rgb(0_0_0/0.6)]\",\n  \"active:cursor-grabbing\",\n  \"focus-visible:shadow-[0_0_0_2.5px_rgb(255_255_255),0_0_0_4.5px_var(--ring),0_2px_6px_rgb(0_0_0/0.3)]\",\n  \"data-disabled:cursor-not-allowed data-readonly:cursor-default\",\n)\n\nconst fieldLook =\n  \"rounded-[9px] bg-background text-[13px] text-foreground outline-none \" +\n  \"[--field-line:rgb(0_0_0/0.09)] dark:[--field-line:rgb(255_255_255/0.1)] \" +\n  \"shadow-[0_0_0_1px_var(--field-line),0_1px_2px_rgb(0_0_0/0.05)] dark:shadow-[0_0_0_1px_var(--field-line)] \" +\n  \"transition-[box-shadow] duration-[calc(150ms*var(--kf-speed,1))] ease-house motion-reduce:transition-none! \" +\n  \"hover:[--field-line:rgb(0_0_0/0.16)] dark:hover:[--field-line:rgb(255_255_255/0.18)] \" +\n  \"focus-visible:ring-[3px] focus-visible:ring-ring/25 focus-visible:[--field-line:var(--ring)] dark:focus-visible:[--field-line:var(--ring)] \" +\n  \"aria-invalid:ring-destructive/25 aria-invalid:[--field-line:var(--destructive)] \" +\n  \"data-disabled:cursor-not-allowed data-disabled:bg-muted data-disabled:text-muted-foreground data-readonly:bg-muted/50\"\n\nfunction ColorPicker({ className, ...props }: React.ComponentProps<typeof ColorPickerRoot>) {\n  return (\n    <ColorPickerRoot\n      className={cn(\"flex flex-col gap-3 data-disabled:opacity-60\", className)}\n      {...props}\n    />\n  )\n}\n\n/* The area is a well painted with the colour's two channels. */\nfunction ColorPickerArea({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerAreaPart>) {\n  return (\n    <ColorPickerAreaPart\n      className={cn(\n        \"relative isolate h-36 w-full shrink-0 touch-none rounded-[10px] [background:var(--color-area-background)] select-none\",\n        \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_0_1px_2px_rgb(0_0_0/0.12),inset_0_0_0_1px_rgb(0_0_0/0.08)] dark:after:shadow-[inset_0_1px_2px_rgb(0_0_0/0.5),inset_0_0_0_1px_rgb(255_255_255/0.06)]\",\n        \"data-disabled:cursor-not-allowed\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerAreaCanvas({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerAreaCanvasPart>) {\n  return (\n    <ColorPickerAreaCanvasPart\n      className={cn(\"absolute inset-0 -z-10 size-full rounded-[inherit]\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerAreaThumb({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerAreaThumbPart>) {\n  return <ColorPickerAreaThumbPart className={cn(thumb, \"z-10\", className)} {...props} />\n}\n\n/* A slider is a pill-shaped well drawn with its channel's gradient. */\nfunction ColorPickerSlider({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerSliderPart>) {\n  return (\n    <ColorPickerSliderPart\n      className={cn(\n        \"relative isolate shrink-0 touch-none rounded-full select-none\",\n        \"data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-36 data-[orientation=vertical]:w-3\",\n        \"[background:var(--color-slider-background)]\",\n        \"data-[channel=alpha]:[background:var(--color-slider-background),repeating-conic-gradient(var(--muted)_0_25%,var(--background)_0_50%)_0_0/8px_8px]\",\n        \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:shadow-[inset_0_1px_2px_rgb(0_0_0/0.12),inset_0_0_0_1px_rgb(0_0_0/0.08)] dark:after:shadow-[inset_0_1px_2px_rgb(0_0_0/0.5),inset_0_0_0_1px_rgb(255_255_255/0.06)]\",\n        \"data-disabled:cursor-not-allowed\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerSliderThumb({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerSliderThumbPart>) {\n  return (\n    <ColorPickerSliderThumbPart\n      className={cn(\n        thumb,\n        \"z-10 data-[orientation=horizontal]:top-1/2 data-[orientation=vertical]:left-1/2\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* The current colour, on a checkerboard so transparency reads. */\nfunction ColorPickerSwatch({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerSwatchPart>) {\n  return (\n    <ColorPickerSwatchPart\n      className={cn(\"relative size-8 shrink-0 rounded-[8px]\", checker, colorEdge, className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerInput({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerInputPart>) {\n  return (\n    <ColorPickerInputPart\n      className={cn(fieldLook, \"h-8 w-full min-w-0 px-2.5 tabular-nums\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerChannelInput({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerChannelInputPart>) {\n  return (\n    <ColorPickerChannelInputPart\n      className={cn(fieldLook, \"h-8 w-full min-w-0 px-2 text-center tabular-nums\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerEyeDropper({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof ColorPickerEyeDropperPart>) {\n  return (\n    <ColorPickerEyeDropperPart\n      className={cn(\n        \"grid size-8 shrink-0 cursor-pointer place-items-center rounded-[9px] bg-background text-foreground outline-none\",\n        \"shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_1px_rgb(0_0_0/0.05),0_3px_6px_-2px_rgb(0_0_0/0.1)]\",\n        \"dark:bg-accent dark:shadow-[0_0_0_1px_rgb(255_255_255/0.07),inset_0_1px_0_rgb(255_255_255/0.08),0_2px_6px_-1px_rgb(0_0_0/0.6)]\",\n        \"hover:bg-accent\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover\",\n        \"data-disabled:pointer-events-none data-disabled:opacity-40 data-unsupported:hidden\",\n        \"[&_svg]:size-4\",\n        className,\n      )}\n      {...props}\n    >\n      {children ?? (\n        <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n          <path d=\"m9.5 4.5 2 2M3 13l1-3 6.25-6.25a1.4 1.4 0 0 1 2 2L6 12z\" />\n        </svg>\n      )}\n    </ColorPickerEyeDropperPart>\n  )\n}\n\nfunction ColorPickerSwatches({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerSwatchesPart>) {\n  return (\n    <ColorPickerSwatchesPart\n      className={cn(\"flex flex-wrap items-center gap-2 p-0.5\", className)}\n      {...props}\n    />\n  )\n}\n\n/* A preset. When it is the value, a ring in its own colour opens around it. */\nfunction ColorPickerSwatchItem({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerSwatchItemPart>) {\n  return (\n    <ColorPickerSwatchItemPart\n      className={cn(\n        \"relative size-6 shrink-0 cursor-pointer rounded-full bg-(--color-picker-color) outline-none\",\n        \"shadow-[inset_0_0_0_1px_rgb(0_0_0/0.1),0_0_0_0_var(--popover),0_0_0_0_var(--color-picker-color)]\",\n        \"dark:shadow-[inset_0_0_0_1px_rgb(255_255_255/0.12),0_0_0_0_var(--popover),0_0_0_0_var(--color-picker-color)]\",\n        \"data-selected:shadow-[inset_0_0_0_1px_rgb(0_0_0/0.1),0_0_0_2px_var(--popover),0_0_0_3.5px_var(--color-picker-color)]\",\n        \"dark:data-selected:shadow-[inset_0_0_0_1px_rgb(255_255_255/0.12),0_0_0_2px_var(--popover),0_0_0_3.5px_var(--color-picker-color)]\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-[5px] focus-visible:ring-offset-popover\",\n        \"data-disabled:pointer-events-none data-disabled:opacity-40 data-readonly:cursor-default\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\n/* With a popover inside the picker, a swatch button opens the parts in a sheet. */\nfunction ColorPickerPopover(props: React.ComponentProps<typeof ColorPickerPopoverPart>) {\n  return <ColorPickerPopoverPart {...props} />\n}\n\nfunction ColorPickerTrigger({\n  className,\n  ...props\n}: React.ComponentProps<typeof ColorPickerTriggerPart>) {\n  return (\n    <ColorPickerTriggerPart\n      className={cn(\n        \"inline-flex h-9 cursor-pointer items-center gap-2 rounded-[10px] bg-background pr-3 pl-1.5 text-[13px] leading-none font-medium text-foreground outline-none\",\n        \"shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_1px_rgb(0_0_0/0.05),0_3px_6px_-2px_rgb(0_0_0/0.1)]\",\n        \"dark:bg-accent dark:shadow-[0_0_0_1px_rgb(255_255_255/0.07),inset_0_1px_0_rgb(255_255_255/0.08),0_2px_6px_-1px_rgb(0_0_0/0.6)]\",\n        \"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n        \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n        \"*:data-[slot=color-picker-swatch]:size-6 *:data-[slot=color-picker-swatch]:rounded-[6px]\",\n        \"[&>svg]:size-4 [&>svg]:text-muted-foreground\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction ColorPickerContent({\n  className,\n  sideOffset = 8,\n  ...props\n}: React.ComponentProps<typeof ColorPickerContentPart>) {\n  return (\n    <ColorPickerContentPart\n      sideOffset={sideOffset}\n      className={cn(\n        \"flex w-64 flex-col gap-3 rounded-[14px] bg-popover p-3 text-popover-foreground outline-none\",\n        \"shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_2px_6px_-2px_rgb(0_0_0/0.08),0_12px_32px_-8px_rgb(0_0_0/0.18)]\",\n        \"dark:shadow-[0_0_0_1px_rgb(255_255_255/0.08),0_12px_32px_-8px_rgb(0_0_0/0.7)]\",\n        className,\n      )}\n      {...props}\n    />\n  )\n}\n\nexport {\n  ColorPicker,\n  ColorPickerArea,\n  ColorPickerAreaCanvas,\n  ColorPickerAreaThumb,\n  ColorPickerChannelInput,\n  ColorPickerContent,\n  ColorPickerEyeDropper,\n  ColorPickerInput,\n  ColorPickerPopover,\n  ColorPickerSlider,\n  ColorPickerSliderThumb,\n  ColorPickerSwatch,\n  ColorPickerSwatches,\n  ColorPickerSwatchItem,\n  ColorPickerTrigger,\n  createColorPickerController,\n}\n",
      "type": "registry:component",
      "target": "components/keyframery/color-picker.tsx"
    }
  ],
  "type": "registry:component"
}