{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-group",
  "title": "Button Group",
  "description": "Button Group from the Get IT Done design system.",
  "dependencies": [
    "@radix-ui/react-slot@^1.5.0"
  ],
  "registryDependencies": [
    "https://zero-design.itdone.de/r/labels-context.json",
    "https://zero-design.itdone.de/r/recipes.json",
    "https://zero-design.itdone.de/r/utils.json",
    "https://zero-design.itdone.de/r/theme.json"
  ],
  "files": [
    {
      "path": "registry/ui/button-group.tsx",
      "content": "'use client';\n\nimport { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\n\nimport { focusRing } from '@/lib/recipes';\nimport { cn } from '@/lib/utils';\nimport { usePreset } from '@/components/ui/labels-context';\n\n// Figma ButtonGroup (Icon False|Leading|Only) and _ButtonGroupBase (Current, Icon False|Leading|Only|Dot, State).\n// Geometry follows the Pagination button group segments: control-md height, input border, surface shadow, control radius.\nexport type ButtonGroupProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(({ className, role = 'group', ...props }, ref) => {\n  const zero = usePreset() === 'zero';\n  return (\n    <div\n      ref={ref}\n      role={role}\n      className={cn(\n        'isolate inline-flex items-stretch overflow-hidden rounded-control border border-solid border-input bg-background shadow-elevation-surface',\n        // Zero: the outer border is part of the control height, so the group is exactly control-md high.\n        zero && 'h-control-md',\n        className,\n      )}\n      {...props}\n    />\n  );\n});\nButtonGroup.displayName = 'ButtonGroup';\n\nexport interface ButtonGroupItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n  asChild?: boolean;\n  // Marks the active segment (Figma Current=True): muted fill and `aria-pressed`.\n  current?: boolean;\n  // Leading icon (Figma Icon=Leading). With no children the segment becomes square (Icon=Only).\n  icon?: React.ReactNode;\n  // Leading status dot (Figma Icon=Dot).\n  dotLeading?: boolean;\n}\n\nconst ButtonGroupItem = React.forwardRef<HTMLButtonElement, ButtonGroupItemProps>(\n  ({ className, asChild = false, current, icon, dotLeading = false, children, type, ...props }, ref) => {\n    const zero = usePreset() === 'zero';\n    const iconOnly = Boolean(icon) && !children;\n    const Comp = asChild ? Slot : 'button';\n    return (\n      <Comp\n        ref={ref}\n        type={asChild ? undefined : (type ?? 'button')}\n        aria-pressed={current === undefined ? undefined : current}\n        data-current={current || undefined}\n        className={cn(\n          'relative inline-flex items-center justify-center gap-2 border-r border-solid border-input bg-background text-text-default transition-colors last:border-r-0',\n          'hover:bg-muted active:bg-muted-strong',\n          'data-[current]:bg-muted',\n          'disabled:pointer-events-none disabled:text-text-disabled aria-disabled:pointer-events-none aria-disabled:text-text-disabled',\n          zero ? 'typography-button-md' : 'typography-label',\n          zero ? 'h-full' : 'h-control-md',\n          iconOnly ? 'w-control-md' : zero ? 'px-control-px-md' : 'px-4',\n          // Focus ring sits inside the segment so the group's overflow clip never cuts it.\n          ...focusRing,\n          'focus-visible:z-10 focus-visible:ring-inset focus-visible:ring-offset-0',\n          className,\n        )}\n        {...props}\n      >\n        {dotLeading && <span aria-hidden=\"true\" className=\"h-2 w-2 shrink-0 rounded-full bg-current\" />}\n        {!dotLeading && icon && (\n          <span aria-hidden=\"true\" className=\"inline-flex h-icon-md w-icon-md shrink-0 items-center justify-center\">\n            {icon}\n          </span>\n        )}\n        {children}\n      </Comp>\n    );\n  },\n);\nButtonGroupItem.displayName = 'ButtonGroupItem';\n\nexport { ButtonGroup, ButtonGroupItem };\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}