{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tag-group",
  "type": "registry:ui",
  "title": "Tag Group",
  "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/tag-group.tsx",
      "content": "'use client'\n\nimport type * as React from 'react' // base-ui-next/ui tag-group@0.1.1\nimport { TagGroup as TagGroupPrimitive } from '@base-ui-next/react/tag-group'\nimport type { VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\nimport { buttonVariants } from '@/components/ui/button'\n\nconst tagGroupClassName =\n  'group/tag-group flex w-full min-w-0 flex-wrap items-center gap-1.5 text-sm outline-none data-disabled:opacity-50'\n\n/** The focused row: it draws nothing, its chip (the TagContent) draws the ring. */\nconst tagGroupTagClassName =\n  'group/tag-group-tag flex max-w-full min-w-0 rounded-sm outline-none data-dragging:opacity-50 data-moving:opacity-50'\n\n/** The chip: filled; outlined with a check while selected; dashed and unfilled while disabled. */\nconst tagGroupTagContentClassName =\n  'relative flex h-7 max-w-full min-w-0 items-center gap-1 rounded-sm border border-transparent bg-secondary px-2 text-xs font-medium whitespace-nowrap text-secondary-foreground transition-[color,background-color,border-color,box-shadow] has-data-[slot=tag-group-tag-remove]:pe-px [[aria-selected]>&]:cursor-pointer [[aria-selected]>&]:hover:bg-secondary/70 data-selected:border-primary data-selected:bg-primary/10 data-selected:text-foreground [[aria-selected]>&]:data-selected:hover:bg-primary/15 data-disabled:cursor-not-allowed data-disabled:border-dashed data-disabled:border-input data-disabled:bg-transparent data-disabled:text-muted-foreground [[aria-selected]>&]:data-disabled:hover:bg-transparent [[role=row]:focus-visible>&]:border-ring [[role=row]:focus-visible>&]:ring-3 [[role=row]:focus-visible>&]:ring-ring/50 data-drop-target:after:absolute data-drop-target:after:inset-y-0.5 data-drop-target:after:w-0.5 data-drop-target:after:rounded-full data-drop-target:after:bg-primary data-[drop-target=after]:after:-end-[3.5px] data-[drop-target=before]:after:-start-[3.5px] forced-colors:data-selected:outline-1 forced-colors:data-selected:-outline-offset-1 forced-colors:data-selected:outline-solid forced-colors:[[role=row]:focus-visible>&]:outline-2 forced-colors:[[role=row]:focus-visible>&]:outline-solid'\n\n/** lucide's Check before the text, shown while the tag is selected. */\nconst tagGroupTagCheckClassName =\n  'pointer-events-none hidden size-3.5 shrink-0 -ms-0.5 [[data-selected]>&]:block'\n\nconst tagGroupTagTextClassName = 'min-w-0 truncate'\n\n/** `button`'s ghost `icon-xs` at the chip's end, dimmed while it removes nothing. */\nconst tagGroupTagRemoveClassName =\n  'rounded-[min(var(--radius-sm),6px)] text-muted-foreground hover:text-foreground aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent'\n\nconst tagGroupEmptyClassName = 'text-sm text-muted-foreground'\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>\n\n// lucide's icons, inline and hidden from assistive technology (10 · As built, BN-309).\nfunction SvgIcon({ children, ...props }: React.ComponentProps<'svg'>) {\n  return (\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      {...props}\n    >\n      {children}\n    </svg>\n  )\n}\n\n// No shadcn item: one name per Base UI part (docs/design/log/tags-input.md, decision 51).\nfunction TagGroup<Value, Multiple extends boolean | undefined = false>({\n  className,\n  ...props\n}: TagGroupPrimitive.Root.Props<Value, Multiple>) {\n  return (\n    <TagGroupPrimitive.Root\n      data-slot=\"tag-group\"\n      className={cn(tagGroupClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction TagGroupTag({ className, ...props }: TagGroupPrimitive.Tag.Props) {\n  return (\n    <TagGroupPrimitive.Tag\n      data-slot=\"tag-group-tag\"\n      className={cn(tagGroupTagClassName, className)}\n      {...props}\n    />\n  )\n}\n\n/** The chip, with lucide's Check before its content while the tag is selected. */\nfunction TagGroupTagContent({ className, children, ...props }: TagGroupPrimitive.TagContent.Props) {\n  return (\n    <TagGroupPrimitive.TagContent\n      data-slot=\"tag-group-tag-content\"\n      className={cn(tagGroupTagContentClassName, className)}\n      {...props}\n    >\n      <SvgIcon className={tagGroupTagCheckClassName}>\n        <path d=\"M20 6 9 17l-5-5\" />\n      </SvgIcon>\n      {children}\n    </TagGroupPrimitive.TagContent>\n  )\n}\n\nfunction TagGroupTagText({ className, ...props }: TagGroupPrimitive.TagText.Props) {\n  return (\n    <TagGroupPrimitive.TagText\n      data-slot=\"tag-group-tag-text\"\n      className={cn(tagGroupTagTextClassName, className)}\n      {...props}\n    />\n  )\n}\n\nfunction TagGroupTagRemove({\n  className,\n  children,\n  variant = 'ghost',\n  size = 'icon-xs',\n  ...props\n}: TagGroupPrimitive.TagRemove.Props & ButtonVariants) {\n  return (\n    <TagGroupPrimitive.TagRemove\n      data-slot=\"tag-group-tag-remove\"\n      className={cn(buttonVariants({ variant, size }), tagGroupTagRemoveClassName, className)}\n      {...props}\n    >\n      {children ?? (\n        <SvgIcon>\n          <path d=\"M18 6 6 18\" />\n          <path d=\"m6 6 12 12\" />\n        </SvgIcon>\n      )}\n    </TagGroupPrimitive.TagRemove>\n  )\n}\n\nfunction TagGroupEmpty({ className, ...props }: TagGroupPrimitive.Empty.Props) {\n  return (\n    <TagGroupPrimitive.Empty\n      data-slot=\"tag-group-empty\"\n      className={cn(tagGroupEmptyClassName, className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  TagGroup,\n  TagGroupEmpty,\n  TagGroupTag,\n  TagGroupTagContent,\n  TagGroupTagRemove,\n  TagGroupTagText,\n}\n",
      "type": "registry:ui",
      "target": "@ui/tag-group.tsx"
    }
  ],
  "meta": {
    "baseUiNext": {
      "version": "0.1.1",
      "hash": "0cab9ad091f7f5bd2b21ac2164031f46e40a8001da860cb14fe2eb5976bbce6f",
      "files": {
        "@ui/tag-group.tsx": "f64c8ca4d3689f9d3422e7f5c68dd9d5aa4e92d0c857680a21da6aa8784cbcab"
      }
    }
  }
}
