{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "swatch",
  "title": "Swatch",
  "description": "A swatch's press, its focus and the ring the picked one takes: the Color picker's presets and a product's colours share it.",
  "dependencies": [],
  "registryDependencies": [
    "https://kinoui.com/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/lib/swatch.ts",
      "content": "import { cn } from '@/lib/utils'\n\n/*\n * A swatch: a colour to pick. Every one, the Color picker's presets and a\n * product's colours alike, presses, shows focus and rings the picked one the\n * same way, so they read as one control.\n */\n\n/**\n * Its press, its focus outline, drawn outside the picked ring so a swatch\n * picked and focused still shows it, and the ring 2px out from it, 2px thick,\n * while it is picked: ui-sdk's `data-selected` or `data-checked`, or\n * `aria-pressed`. Its shape is the swatch's: give it a `rounded-*`, and the\n * ring an `after:rounded-*` 4px larger to follow it.\n */\nconst swatchClassName = cn(\n  'group/swatch relative inline-grid shrink-0 place-items-center *:col-start-1 *:row-start-1',\n  'transition-[scale] duration-(--motion-press-duration) ease-(--motion-press-easing) active:duration-[calc(var(--motion-press-duration)*0.4)] data-pressing:duration-[calc(var(--motion-press-duration)*0.4)] motion-safe:active:scale-(--motion-press-scale) motion-safe:data-pressing:scale-(--motion-press-scale)',\n  'focus-visible:outline-ring focus-visible:outline-2 focus-visible:outline-offset-4 forced-colors:focus-visible:outline-[Highlight]',\n  'after:border-foreground after:pointer-events-none after:absolute after:-inset-1 after:border-2 after:opacity-0 after:transition-[opacity,scale] after:duration-(--motion-press-duration) after:ease-(--motion-press-easing) motion-safe:after:scale-95 data-[selected]:after:opacity-100 motion-safe:data-[selected]:after:scale-100 data-checked:after:opacity-100 motion-safe:data-checked:after:scale-100 aria-pressed:after:opacity-100 motion-safe:aria-pressed:after:scale-100 forced-colors:after:border-[CanvasText]',\n  'data-disabled:pointer-events-none data-disabled:opacity-50',\n)\n\nexport { swatchClassName }\n",
      "type": "registry:lib",
      "target": "@lib/swatch.ts"
    }
  ],
  "type": "registry:lib"
}