{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tw-button-set",
  "type": "registry:ui",
  "title": "react-tw/button-set.tsx",
  "description": "Carbon `ButtonSet` as a React + Tailwind component, the look of `<ui-button-set>`: its `Button`s side by Copied from @purpurabog/ui 2.3.0; the package is the maintained source, this copy is yours to change. Icons from the Carbon Design System (Apache-2.0, © IBM Corp.; see THIRD-PARTY-NOTICES.md in the package).",
  "dependencies": [],
  "registryDependencies": [
    "@kanok-ui/tw-theme",
    "@kanok-ui/tw-utils"
  ],
  "files": [
    {
      "path": "src/react-tw/button-set.tsx",
      "type": "registry:ui",
      "target": "components/ui/react-tw/button-set.tsx",
      "content": "import type { ComponentProps, ReactNode } from 'react';\nimport { cn } from './lib/utils.ts';\n\nexport interface ButtonSetProps extends Omit<ComponentProps<'div'>, 'stacked' | 'className' | 'children'> {\n    /** One button per row (Carbon `stacked`), e.g. in a narrow side panel. */\n    stacked?: boolean;\n    className?: string;\n    /** The `Button`s, the secondary one first. */\n    children?: ReactNode;\n}\n\n/**\n * Carbon `ButtonSet` as a React + Tailwind component, the look of `<ui-button-set>`: its `Button`s side by\n * side (or `stacked`), each up to 196px wide, with a 1px button-separator line between neighbours (not\n * next to the focused one) — the footer of a form, side panel or tearsheet. Put the secondary button first.\n */\nexport function ButtonSet({ stacked = false, className, children, ...rest }: Readonly<ButtonSetProps>) {\n    return (\n        <div {...rest}\n            className={cn(\n                // Carbon: the buttons touch; --ui-button-set-* let a design space them, keep their own width and drop the separator\n                'flex gap-[var(--ui-button-set-gap,normal)]',\n                stacked && 'flex-col',\n                // Carbon .btn-set .btn: full width up to 196px (design kit); the buttons only, not a Button's live-region siblings\n                '[&>:is(button,a)]:w-[var(--ui-button-set-item-size,100%)] [&>:is(button,a)]:max-w-[196px]',\n                stacked\n                    ? '[&>:is(button,a):not(:first-child):not(:focus-within)]:shadow-[0_-1px_0_0_var(--ui-button-set-separator,var(--ui-button-separator))]'\n                    : '[&>:is(button,a):not(:first-child):not(:focus-within)]:shadow-[-1px_0_0_0_var(--ui-button-set-separator,var(--ui-button-separator))]',\n                className,\n            )}\n        >\n            {children}\n        </div>\n    );\n}\n"
    }
  ]
}
