{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toggle-group",
  "title": "Toggle Group",
  "description": "A compact group of single- or multi-select toggle buttons with complete keyboard navigation.",
  "dependencies": [
    "@base-ui/react",
    "class-variance-authority"
  ],
  "files": [
    {
      "path": "registry/rivetui/components/toggle-group/toggle-group.tsx",
      "content": "\"use client\";\n\nimport { Toggle as TogglePrimitive } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as ToggleGroupPrimitive } from \"@base-ui/react/toggle-group\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst toggleGroupVariants = cva(\n  \"group/toggle-group inline-flex w-fit max-w-full items-stretch bg-background data-[orientation=vertical]:flex-col\",\n  {\n    variants: {\n      variant: {\n        outline: \"border border-border\",\n        ghost: \"gap-1 bg-transparent\",\n      },\n    },\n    defaultVariants: {\n      variant: \"outline\",\n    },\n  },\n);\n\nconst toggleGroupItemVariants = cva(\n  \"relative inline-flex shrink-0 cursor-pointer select-none items-center justify-center whitespace-nowrap font-medium text-muted-foreground outline-none transition-[background-color,border-color,color,opacity] duration-100 hover:not-data-disabled:bg-muted hover:not-data-disabled:text-foreground focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-ring/40 data-disabled:pointer-events-none data-disabled:opacity-40 motion-reduce:transition-none [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n  {\n    variants: {\n      variant: {\n        outline:\n          \"border-0 border-border border-l data-pressed:bg-muted data-pressed:text-foreground first:border-l-0 group-data-[orientation=vertical]/toggle-group:border-t group-data-[orientation=vertical]/toggle-group:border-l-0 group-data-[orientation=vertical]/toggle-group:first:border-t-0\",\n        ghost:\n          \"border border-transparent data-pressed:border-foreground/40 data-pressed:bg-muted data-pressed:text-foreground\",\n      },\n      size: {\n        sm: \"h-8 min-w-8 gap-1.5 px-2.5 text-xs [&_svg]:size-3.5\",\n        md: \"h-10 min-w-10 gap-2 px-3.5 text-sm [&_svg]:size-4\",\n        lg: \"h-12 min-w-12 gap-2.5 px-5 text-sm [&_svg]:size-4.5\",\n      },\n    },\n    defaultVariants: {\n      variant: \"outline\",\n      size: \"md\",\n    },\n  },\n);\n\ntype ToggleGroupStyle = {\n  variant: NonNullable<VariantProps<typeof toggleGroupItemVariants>[\"variant\"]>;\n  size: NonNullable<VariantProps<typeof toggleGroupItemVariants>[\"size\"]>;\n};\n\nconst ToggleGroupStyleContext = React.createContext<ToggleGroupStyle>({\n  variant: \"outline\",\n  size: \"md\",\n});\n\ntype ToggleGroupProps<Value extends string = string> = ToggleGroupPrimitive.Props<Value> &\n  VariantProps<typeof toggleGroupVariants> & {\n    size?: ToggleGroupStyle[\"size\"];\n  };\n\nfunction ToggleGroup<Value extends string = string>({\n  className,\n  children,\n  variant = \"outline\",\n  size = \"md\",\n  ...props\n}: ToggleGroupProps<Value>) {\n  const style: ToggleGroupStyle = { variant: variant ?? \"outline\", size };\n\n  return (\n    <ToggleGroupStyleContext.Provider value={style}>\n      <ToggleGroupPrimitive\n        data-slot=\"toggle-group\"\n        className={cn(toggleGroupVariants({ variant, className }))}\n        {...props}\n      >\n        {children}\n      </ToggleGroupPrimitive>\n    </ToggleGroupStyleContext.Provider>\n  );\n}\n\ntype ToggleGroupItemProps<Value extends string = string> = TogglePrimitive.Props<Value>;\n\nfunction ToggleGroupItem<Value extends string = string>({\n  className,\n  ...props\n}: ToggleGroupItemProps<Value>) {\n  const { variant, size } = React.useContext(ToggleGroupStyleContext);\n\n  return (\n    <TogglePrimitive\n      data-slot=\"toggle-group-item\"\n      className={cn(toggleGroupItemVariants({ variant, size, className }))}\n      {...props}\n    />\n  );\n}\n\nexport type { ToggleGroupItemProps, ToggleGroupProps };\nexport { ToggleGroup, ToggleGroupItem, toggleGroupItemVariants, toggleGroupVariants };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}