{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "button-group", "type": "registry:ui", "dependencies": [ "@radix-ui/react-slot" ], "files": [ { "path": "components/ui/button-group.tsx", "content": "import { Slot } from \"@radix-ui/react-slot\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\nimport { Separator } from \"@/components/ui/separator\"\r\n\r\nconst buttonGroupVariants = cva(\r\n \"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2\",\r\n {\r\n variants: {\r\n orientation: {\r\n horizontal:\r\n \"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none\",\r\n vertical:\r\n \"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none\",\r\n },\r\n },\r\n defaultVariants: {\r\n orientation: \"horizontal\",\r\n },\r\n }\r\n)\r\n\r\nfunction ButtonGroup({\r\n className,\r\n orientation,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & VariantProps) {\r\n return (\r\n \r\n )\r\n}\r\n\r\nfunction ButtonGroupText({\r\n className,\r\n asChild = false,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n asChild?: boolean\r\n}) {\r\n const Comp = asChild ? Slot : \"div\"\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nfunction ButtonGroupSeparator({\r\n className,\r\n orientation = \"vertical\",\r\n ...props\r\n}: React.ComponentProps) {\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport {\r\n ButtonGroup,\r\n ButtonGroupSeparator,\r\n ButtonGroupText,\r\n buttonGroupVariants,\r\n}\r\n", "type": "registry:ui", "target": "components/ui/button-group.tsx" } ] }