{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chip",
  "title": "Chip",
  "description": "A chip's look, its remove button and its exit: a small piece that stands for one value. The Tag input's tags and the Token input's tokens share it.",
  "dependencies": [],
  "registryDependencies": [
    "https://kinoui.com/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/lib/chip.tsx",
      "content": "import { IconPlaceholder } from '@/registry/icons/icon-placeholder'\n\n/*\n * A chip: a small piece that stands for one value, such as a tag in the Tag\n * input or a token in the Token input's text. Every chip takes its look,\n * its remove button and its exit from here, so they all read as one.\n */\n\n/**\n * Its look. Its side padding is the component's: a remove button at the end\n * takes its place. One that can't be taken as it is (`data-invalid`) turns\n * destructive, and dashed under forced colours; the component says why.\n */\nconst chipClassName =\n  'bg-muted text-foreground flex h-(--control-height-xs) max-w-full min-w-0 shrink-0 cursor-default items-center gap-1 rounded-(--control-radius-xs) text-xs font-medium select-none forced-colors:border [&_svg:not([class*=\"size-\"])]:size-3 data-invalid:bg-destructive/10 data-invalid:text-destructive dark:data-invalid:bg-destructive/20 forced-colors:data-invalid:outline-1 forced-colors:data-invalid:outline-offset-1 forced-colors:data-invalid:outline-dashed'\n\n/**\n * How it arrives once its field has painted (`data-mounted` on the element\n * named in the component's own `group-`/`in-` variant), and how a copy of it\n * leaves (`data-leaving`, from `leaveAsCopy` in the flow lib): it fades and\n * shrinks where it was, on `exit`. The component's own transition names\n * opacity and scale on `enter`.\n */\nconst chipLeavingClassName =\n  'data-leaving:opacity-0 motion-safe:data-leaving:scale-95 data-leaving:[transition:opacity_var(--motion-exit-duration)_var(--motion-exit-easing),scale_var(--motion-exit-duration)_var(--motion-exit-easing),translate_var(--motion-layout-duration)_var(--motion-layout-easing)]'\n\n/**\n * A chip in a list that flows (`useFlowList` in the flow lib, the list\n * `group/flow` and marked `data-mounted`): it scales in on `enter` once the\n * list has painted and glides to a new place on `layout`, and its copy leaves\n * on `chipLeavingClassName`'s exit, which goes beside it.\n */\nconst chipFlowClassName =\n  '[transition:opacity_var(--motion-enter-duration)_var(--motion-enter-easing),scale_var(--motion-enter-duration)_var(--motion-enter-easing),translate_var(--motion-layout-duration)_var(--motion-layout-easing)] group-data-mounted/flow:starting:opacity-0 motion-safe:group-data-mounted/flow:starting:scale-95 data-[flow=start]:[transition:opacity_var(--motion-enter-duration)_var(--motion-enter-easing),scale_var(--motion-enter-duration)_var(--motion-enter-easing)] motion-reduce:[transition:opacity_var(--motion-enter-duration)_var(--motion-enter-easing)] motion-reduce:data-leaving:[transition:opacity_var(--motion-exit-duration)_var(--motion-exit-easing)]'\n\n/** Its remove button: as tall as the chip, square, at its end. */\nconst chipRemoveClassName =\n  'text-muted-foreground hover:text-foreground hover:bg-foreground/10 focus-visible:ring-ring/50 grid size-(--control-height-xs) shrink-0 place-items-center rounded-(--control-radius-xs) transition-[color,background-color,box-shadow] duration-(--motion-press-duration) ease-(--motion-press-fade-easing) focus-visible:ring-3 focus-visible:outline-hidden'\n\n/** The cross on a chip's remove button: an xs icon button's size, larger than the chip's own icons. */\nfunction ChipRemoveIcon() {\n  return (\n    <IconPlaceholder\n      lucide='XIcon'\n      tabler='IconX'\n      hugeicons='Cancel01Icon'\n      phosphor='XIcon'\n      remixicon='RiCloseLine'\n      className='size-3.5'\n      aria-hidden\n    />\n  )\n}\n\nexport {\n  ChipRemoveIcon,\n  chipClassName,\n  chipFlowClassName,\n  chipLeavingClassName,\n  chipRemoveClassName,\n}\n",
      "type": "registry:lib",
      "target": "@lib/chip.tsx"
    }
  ],
  "type": "registry:lib"
}