{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-group",
  "type": "registry:ui",
  "title": "Button Group",
  "description": "Joins related buttons, text cells, and separators into one control.",
  "categories": [
    "actions"
  ],
  "dependencies": [
    "@base-ui/react@1.9.0"
  ],
  "registryDependencies": [
    "https://sprout.tulipfarm.ai/r/sprout-base.json",
    "https://sprout.tulipfarm.ai/r/separator.json"
  ],
  "files": [
    {
      "path": "registry/sprout/components/ui/button-group.tsx",
      "type": "registry:ui",
      "target": "components/ui/button-group.tsx",
      "content": "'use client';\n\nimport type { ComponentProps } from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cn } from '@/lib/sprout/classes';\nimport { Separator, type SeparatorLineProps } from '@/components/ui/separator';\n\nexport const buttonGroupOrientationNames = ['horizontal', 'vertical'] as const;\n\nexport type ButtonGroupOrientation = (typeof buttonGroupOrientationNames)[number];\n\nexport interface ButtonGroupVariantOptions {\n  orientation?: ButtonGroupOrientation | null;\n  className?: string;\n}\n\nexport function buttonGroupVariants({ orientation, className }: ButtonGroupVariantOptions = {}) {\n  return cn('sprout-button-group', `sprout-button-group-${orientation ?? 'horizontal'}`, className);\n}\n\nexport interface ButtonGroupProps extends ComponentProps<'div'> {\n  orientation?: ButtonGroupOrientation | null;\n}\n\nexport function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps) {\n  return (\n    <div\n      role=\"group\"\n      data-slot=\"button-group\"\n      data-orientation={orientation ?? 'horizontal'}\n      className={buttonGroupVariants({ orientation, className })}\n      {...props}\n    />\n  );\n}\n\nexport type ButtonGroupTextProps = useRender.ComponentProps<'div'>;\n\nexport function ButtonGroupText({ className, render, ref, ...props }: ButtonGroupTextProps) {\n  return useRender({\n    defaultTagName: 'div',\n    ref,\n    render,\n    props: mergeProps<'div'>(\n      {\n        'data-slot': 'button-group-text',\n        className: cn('sprout-button-group-text', className),\n      } as ComponentProps<'div'>,\n      props,\n    ),\n  });\n}\n\nexport type ButtonGroupSeparatorProps = SeparatorLineProps;\n\nexport function ButtonGroupSeparator({\n  className,\n  orientation = 'vertical',\n  tone = 'input',\n  ...props\n}: ButtonGroupSeparatorProps) {\n  return (\n    <Separator\n      data-slot=\"button-group-separator\"\n      orientation={orientation}\n      tone={tone}\n      className={state =>\n        cn('sprout-button-group-separator', typeof className === 'function' ? className(state) : className)\n      }\n      {...props}\n    />\n  );\n}\n"
    }
  ],
  "css": {
    "@layer components": {
      ".sprout-button-group": {
        "align-items": "stretch",
        "width": "fit-content",
        "max-width": "100%",
        "display": "flex"
      },
      ".sprout-button-group > :focus-visible": {
        "z-index": "1",
        "position": "relative"
      },
      ".sprout-button-group:has( > [data-slot=\"button-group\"])": {
        "gap": "8px"
      },
      ".sprout-button-group > input": {
        "flex": "1 1 0",
        "min-width": "0"
      },
      ".sprout-button-group.sprout-button-group-vertical": {
        "flex-direction": "column"
      },
      ".sprout-button-group.sprout-button-group-horizontal > [data-slot]": {
        "border-start-end-radius": "0",
        "border-end-end-radius": "0"
      },
      ".sprout-button-group.sprout-button-group-horizontal > [data-slot]:not(:has( ~ [data-slot]))": {
        "border-start-end-radius": "var(--sprout-radius-control)",
        "border-end-end-radius": "var(--sprout-radius-control)"
      },
      ".sprout-button-group.sprout-button-group-horizontal > [data-slot] ~ [data-slot]": {
        "border-inline-start-width": "0",
        "border-start-start-radius": "0",
        "border-end-start-radius": "0"
      },
      ".sprout-button-group.sprout-button-group-vertical > [data-slot]": {
        "border-end-end-radius": "0",
        "border-end-start-radius": "0"
      },
      ".sprout-button-group.sprout-button-group-vertical > [data-slot]:not(:has( ~ [data-slot]))": {
        "border-end-end-radius": "var(--sprout-radius-control)",
        "border-end-start-radius": "var(--sprout-radius-control)"
      },
      ".sprout-button-group.sprout-button-group-vertical > [data-slot] ~ [data-slot]": {
        "border-block-start-width": "0",
        "border-start-start-radius": "0",
        "border-start-end-radius": "0"
      },
      ".sprout-button-group-text": {
        "box-sizing": "border-box",
        "min-height": "var(--sprout-control-height)",
        "border": "1px solid var(--sprout-input)",
        "border-radius": "var(--sprout-radius-control)",
        "background": "var(--sprout-secondary)",
        "color": "var(--sprout-text)",
        "font-family": "inherit",
        "font-size": "var(--sprout-text-sm)",
        "white-space": "nowrap",
        "align-items": "center",
        "gap": "8px",
        "padding-inline": "10px",
        "font-weight": "500",
        "line-height": "20px",
        "display": "flex"
      },
      ".sprout-button-group-text svg": {
        "pointer-events": "none",
        "flex-shrink": "0"
      },
      ".sprout-button-group-text svg:not([class*=\"size-\"])": {
        "width": "1rem",
        "height": "1rem"
      },
      ".sprout-button-group-separator": {
        "align-self": "stretch",
        "position": "relative"
      },
      ".sprout-separator.sprout-button-group-separator[data-orientation=\"horizontal\"]": {
        "width": "auto",
        "margin-inline": "1px"
      },
      ".sprout-separator.sprout-button-group-separator[data-orientation=\"vertical\"]": {
        "height": "auto",
        "min-height": "0",
        "margin-block": "1px"
      },
      "@media (forced-colors: active)": {
        ".sprout-button-group-text": {
          "border-color": "canvastext"
        }
      },
      "@media (prefers-reduced-motion: no-preference)": {
        ".sprout-button-group-text": {
          "transition": "background-color var(--sprout-motion-fast) var(--sprout-motion-ease),\n        border-color var(--sprout-motion-fast) var(--sprout-motion-ease),\n        color var(--sprout-motion-fast) var(--sprout-motion-ease)"
        }
      }
    }
  },
  "docs": "Docs and examples: https://sprout.tulipfarm.ai/components/button-group/",
  "meta": {
    "source": "packages/sprout/src/components/button-group.tsx"
  }
}
