{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button-group",
  "title": "ButtonGroup",
  "description": "Related buttons joined into one control, such as Previous, a page number and Next, or a split button.",
  "registryDependencies": [
    "@ouro/lib-class-name-check",
    "@ouro/lib-cn",
    "@ouro/lib-env",
    "@ouro/lib-use-dev-messages"
  ],
  "files": [
    {
      "path": "registry/ouro/components/ouro/button-group/button-group.tsx",
      "content": "\"use client\";\n\nimport type { JSX, ReactNode, Ref } from \"react\";\nimport { useAppearanceClassNameCheck } from \"@/registry/ouro/lib/ouro/class-name-check\";\nimport { cn } from \"@/registry/ouro/lib/ouro/cn\";\nimport { useDevWarnings } from \"@/registry/ouro/lib/ouro/use-dev-messages\";\n\n/** Props for {@link ButtonGroup}. */\nexport interface ButtonGroupProps {\n  /** Names the group for screen readers (\"Pagination\", \"Text alignment\"). It is not shown. */\n  label: string;\n  /**\n   * The buttons, in order: `Button`s or `Toggle`s, each with its own `variant`, `tone` and `size`.\n   *\n   * @claim \"The buttons, in order: `Button`s or\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup > draws no separator between outline buttons, whose borders already meet)\n   * @claim \"The buttons, in order: `Button`s or\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup > draws a separator between buttons that have no border of their own)\n   */\n  children: ReactNode;\n  /** Stretches the group to the width of its container, with the buttons sharing it equally. */\n  fullWidth?: boolean | undefined;\n  /** Layout only: margins, width, grid placement (`mt-4`). Appearance classes warn in development. */\n  className?: string | undefined;\n  /** The group element (`role=\"group\"`). */\n  ref?: Ref<HTMLDivElement> | undefined;\n\n  /**\n   * Not a prop. Each Button keeps its own: `<Button variant=\"outline\">`.\n   *\n   * @claim \"Each Button keeps its own: `<Button\" registry/ouro/components/ouro/button-group/button-group.test-d.ts verify:fileLine(registry/ouro/components/ouro/button-group/button-group.test-d.ts, /\\{\\slabel:\\s\"Pagination\";\\schildren:\\s\"x\";\\svariant:\\s\"outline\"\\s\\}>\\(\\)\\.not\\.toExtend/)\n   */\n  variant?: { 'Set it on each Button: <Button variant=\"outline\">': never };\n  /**\n   * Not a prop. Each Button keeps its own: `<Button tone=\"secondary\">`.\n   *\n   * @claim \"Each Button keeps its own: `<Button\" registry/ouro/components/ouro/button-group/button-group.test-d.ts verify:fileLine(registry/ouro/components/ouro/button-group/button-group.test-d.ts, /\\{\\slabel:\\s\"Pagination\";\\schildren:\\s\"x\";\\stone:\\s\"secondary\"\\s\\}>\\(\\)\\.not\\.toExtend/)\n   */\n  tone?: { 'Set it on each Button: <Button tone=\"secondary\">': never };\n  /**\n   * Not a prop. Each Button keeps its own: `<Button size=\"sm\">`.\n   *\n   * @claim \"Each Button keeps its own: `<Button\" registry/ouro/components/ouro/button-group/button-group.test-d.ts verify:fileLine(registry/ouro/components/ouro/button-group/button-group.test-d.ts, /\\{\\slabel:\\s\"Pagination\";\\schildren:\\s\"x\";\\ssize:\\s\"sm\"\\s\\}>\\(\\)\\.not\\.toExtend/)\n   */\n  size?: { 'Set it on each Button: <Button size=\"sm\">': never };\n  /** Not a prop. A ButtonGroup is a row; stack buttons in a grid: `<div className=\"grid gap-2\">`. */\n  orientation?: { 'A ButtonGroup is a row; stack buttons in <div className=\"grid gap-2\">': never };\n  /**\n   * Not a prop. A ButtonGroup always joins its buttons.\n   *\n   * @claim \"A ButtonGroup always joins its buttons\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup > joins the buttons: only the outer corners are round, and the buttons touch)\n   */\n  isAttached?: { 'A ButtonGroup always joins its buttons': never };\n}\n\n/**\n * The group's row. Its children join: only the outer corners stay round, neighbors overlap by\n * their 1px border so outline buttons share one line, and two neighbors that name a look\n * without a border (`data-variant` other than `outline`, which Button and Toggle set) get a\n * 1px separator in their text color at 25%. The focused child is raised so its outline shows.\n * @claim \"Its children join: only the outer\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup > joins the buttons: only the outer corners are round, and the buttons touch)\n * @claim \"Its children join: only the outer\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup > draws no separator between outline buttons, whose borders already meet)\n * @claim \"Its children join: only the outer\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup > draws a separator between buttons that have no border of their own)\n */\nconst groupClass =\n  \"relative isolate box-border inline-flex max-w-full items-stretch \" +\n  \"[&>*]:m-0 [&>*]:rounded-none [&>*:first-child]:rounded-s-ouro-lg [&>*:last-child]:rounded-e-ouro-lg \" +\n  \"[&>*:not(:first-child)]:-ms-px [&>*:focus-visible]:z-10 \" +\n  \"[&>[data-variant]:not([data-variant=outline])+[data-variant]:not([data-variant=outline])]:after:pointer-events-none \" +\n  \"[&>[data-variant]:not([data-variant=outline])+[data-variant]:not([data-variant=outline])]:after:absolute \" +\n  \"[&>[data-variant]:not([data-variant=outline])+[data-variant]:not([data-variant=outline])]:after:inset-y-0 \" +\n  \"[&>[data-variant]:not([data-variant=outline])+[data-variant]:not([data-variant=outline])]:after:-start-px \" +\n  \"[&>[data-variant]:not([data-variant=outline])+[data-variant]:not([data-variant=outline])]:after:w-px \" +\n  \"[&>[data-variant]:not([data-variant=outline])+[data-variant]:not([data-variant=outline])]:after:bg-current \" +\n  \"[&>[data-variant]:not([data-variant=outline])+[data-variant]:not([data-variant=outline])]:after:opacity-25\";\n\n/**\n * Related buttons joined into one control, such as Previous, a page number and Next, or a\n * split button. Only the outer corners are round, borders are shared, and buttons without\n * a border get a separator. Each child keeps its own `variant`, `tone` and `size`, and the\n * group has a name for screen readers.\n *\n * Use `ToggleGroup` instead when the buttons stay pressed and share one value, and a plain\n * row (`<div className=\"flex gap-2\">`) for buttons that are not one control.\n *\n * @group Actions\n * @see https://ui.ouroboros.bot/docs/button-group\n *\n * @example\n * <ButtonGroup label=\"Pagination\">\n *   <Button variant=\"outline\" tone=\"secondary\">Previous</Button>\n *   <Button variant=\"outline\" tone=\"secondary\">Next</Button>\n * </ButtonGroup>\n * @claim \"Each child keeps its own `variant`\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup server rendering > renders the group and its name on the server and hydrates with no warning)\n * @claim \"Each child keeps its own `variant`\" registry/ouro/components/ouro/button-group/button-group.test.tsx verify:testExists(registry/ouro/components/ouro/button-group/button-group.test.tsx::ButtonGroup > is a labeled group)\n */\nexport function ButtonGroup(props: ButtonGroupProps): JSX.Element {\n  const {\n    label,\n    children,\n    fullWidth,\n    className,\n    ref,\n    // Guard props (hint types), dropped here so they never reach the DOM.\n    variant,\n    tone,\n    size,\n    orientation,\n    isAttached,\n  } = props;\n  useAppearanceClassNameCheck(\n    \"ButtonGroup\",\n    className,\n    process.env.NODE_ENV !== \"production\" ? \"set variant and tone on each Button\" : /* istanbul ignore next @preserve -- production only */ \"\",\n  );\n  useDevWarnings(\n    \"ButtonGroup\",\n    process.env.NODE_ENV !== \"production\"\n      ? () => [\n          !label && [\"label is empty, so the group has no name\", '<ButtonGroup label=\"Pagination\">'],\n          variant !== undefined && [\"variant is not a prop; each Button keeps its own\", `<Button variant=\"${String(variant)}\">`],\n          tone !== undefined && [\"tone is not a prop; each Button keeps its own\", `<Button tone=\"${String(tone)}\">`],\n          size !== undefined && [\"size is not a prop; each Button keeps its own\", `<Button size=\"${String(size)}\">`],\n          orientation !== undefined && [\"orientation is not a prop; a ButtonGroup is a row\", '<div className=\"grid gap-2\">…</div>'],\n          isAttached !== undefined && [\"isAttached is not a prop; a ButtonGroup always joins its buttons\", `<ButtonGroup label=\"${label}\">`],\n        ]\n      : /* istanbul ignore next @preserve -- production only */ undefined,\n  );\n  return (\n    <div\n      ref={ref}\n      role=\"group\"\n      aria-label={label}\n      data-ouro=\"button-group\"\n      className={cn(groupClass, fullWidth && \"flex w-full [&>*]:flex-1 [&>*]:basis-0\", className)}\n    >\n      {children}\n    </div>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@components/ouro/button-group/button-group.tsx"
    }
  ],
  "docs": "Related buttons joined into one control, such as Previous, a page number and Next, or a split button. Import: import { ButtonGroup } from \"@/components/ouro/button-group/button-group\", with @/components replaced by your components alias (aliases.components in components.json, such as ~/components). Also installed: the helpers it imports in lib/ouro. Needs ouro-base in your stylesheet: add that item once per app, from the same place as this one, if you have not. Docs: https://ui.ouroboros.bot/docs/button-group.md Ouro UI v1.3.257.",
  "type": "registry:ui"
}