{
  "$schema": "https://blode.co/ui/schema/registry-item.json",
  "name": "button-group",
  "title": "Button Group",
  "author": "Matthew Blode",
  "description": "A container that groups related buttons together with shared styling.",
  "registryDependencies": ["button", "separator"],
  "files": [
    {
      "path": "ui/button-group.tsx",
      "content": "import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva } from \"class-variance-authority\";\nimport type { VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Separator } from \"@/components/ui/separator\";\n\nconst buttonGroupVariants = cva(\n  \"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1\",\n  {\n    defaultVariants: {\n      orientation: \"horizontal\",\n    },\n    variants: {\n      orientation: {\n        horizontal:\n          \"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0\",\n        vertical:\n          \"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0\",\n      },\n    },\n  },\n);\n\nconst ButtonGroup = ({\n  className,\n  orientation,\n  ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof buttonGroupVariants>) => (\n  /* oxlint-disable jsx-a11y/prefer-tag-over-role -- role=\"group\" is the WAI-ARIA button group pattern; no native element conveys it */\n  <div\n    className={cn(buttonGroupVariants({ orientation }), className)}\n    data-orientation={orientation}\n    data-slot=\"button-group\"\n    role=\"group\"\n    {...props}\n  />\n  /* oxlint-enable jsx-a11y/prefer-tag-over-role */\n);\n\nconst ButtonGroupText = ({ className, render, ...props }: useRender.ComponentProps<\"div\">) =>\n  useRender({\n    defaultTagName: \"div\",\n    props: mergeProps<\"div\">(\n      {\n        className: cn(\n          \"flex items-center gap-2 rounded-lg border bg-muted px-2.5 font-medium text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none\",\n          className,\n        ),\n      },\n      props,\n    ),\n    render,\n    state: {\n      slot: \"button-group-text\",\n    },\n  });\n\nconst ButtonGroupSeparator = ({\n  className,\n  orientation = \"vertical\",\n  ...props\n}: React.ComponentProps<typeof Separator>) => (\n  <Separator\n    className={cn(\n      \"relative self-stretch bg-input data-horizontal:mx-px data-vertical:my-px data-vertical:h-auto data-horizontal:w-auto\",\n      className,\n    )}\n    data-slot=\"button-group-separator\"\n    orientation={orientation}\n    {...props}\n  />\n);\n\nexport { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };\n",
      "type": "registry:ui",
      "target": ""
    }
  ],
  "type": "registry:ui"
}
