{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-button-group",
  "title": "RetroButtonGroup",
  "description": "Joins RetroButtons, inputs and text into one Mac OS 9 control strip with shared borders. Horizontal or vertical, with RetroButtonGroupSeparator and RetroButtonGroupText.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.1",
    "@ui-sdk/react@0.1.0-beta.1",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/retro-button-group.tsx",
      "content": "import * as React from \"react\"\nimport { renderElement, type RenderProp } from \"@ui-sdk/react/primitive\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* ------------------------------------------------------------------ */\n/*  RetroButtonGroup                                                   */\n/*                                                                     */\n/*  Joins adjacent controls (RetroButton, RetroInput, RetroSelect…)    */\n/*  into one strip. Neighbours overlap by 1px so each pair shares a    */\n/*  single black border, exactly like an OS9 segmented control.        */\n/* ------------------------------------------------------------------ */\n\nconst retroButtonGroupVariants = cva(\n  [\n    \"flex w-fit items-stretch\",\n    // Focused / pressed children rise above neighbours so their ring and\n    // borders are never clipped by the overlap.\n    \"[&>*]:relative [&>*:focus-visible]:z-10 [&>*:active]:z-10\",\n    // Nested groups sit apart rather than fusing.\n    \"has-[>[data-slot=button-group]]:gap-[8px] [&>[data-slot=button-group]]:m-0\",\n  ],\n  {\n    variants: {\n      orientation: {\n        horizontal: [\n          \"flex-row\",\n          \"[&>*:not(:first-child)]:-ml-px\",\n          \"[&>[data-slot=button-group]:not(:first-child)]:ml-0!\",\n          \"[&>[data-slot=button-group-separator]]:ml-0! [&>[data-slot=button-group-separator]+*]:ml-0!\",\n        ],\n        vertical: [\n          \"flex-col\",\n          \"[&>*:not(:first-child)]:-mt-px\",\n          \"[&>[data-slot=button-group]:not(:first-child)]:mt-0!\",\n          \"[&>[data-slot=button-group-separator]]:mt-0! [&>[data-slot=button-group-separator]+*]:mt-0!\",\n        ],\n      },\n    },\n    defaultVariants: {\n      orientation: \"horizontal\",\n    },\n  }\n)\n\ntype RetroButtonGroupProps = React.ComponentProps<\"div\"> &\n  VariantProps<typeof retroButtonGroupVariants>\n\nconst RetroButtonGroup = React.forwardRef<HTMLDivElement, RetroButtonGroupProps>(\n  function RetroButtonGroup(\n    { className, orientation = \"horizontal\", ...props },\n    ref\n  ) {\n    return (\n      <div\n        ref={ref}\n        role=\"group\"\n        data-slot=\"button-group\"\n        data-orientation={orientation}\n        className={cn(retroButtonGroupVariants({ orientation }), className)}\n        {...props}\n      />\n    )\n  }\n)\nRetroButtonGroup.displayName = \"RetroButtonGroup\"\n\n/* ------------------------------------------------------------------ */\n/*  RetroButtonGroupText                                               */\n/* ------------------------------------------------------------------ */\n\ntype RetroButtonGroupTextProps = React.ComponentProps<\"div\"> & {\n  /** Render a different element (e.g. a `<label />`) with the text look. */\n  render?: RenderProp\n}\n\nfunction RetroButtonGroupText({\n  className,\n  render,\n  ...props\n}: RetroButtonGroupTextProps) {\n  return renderElement(\n    \"div\",\n    {\n      \"data-slot\": \"button-group-text\",\n      className: cn(\n        \"flex items-center gap-[6px] whitespace-nowrap px-[8px]\",\n        \"border border-os9-black bg-os9-gray-200 text-os9-black\",\n        \"shadow-[inset_1px_1px_0_var(--os9-white),inset_-1px_-1px_0_var(--os9-gray-500)]\",\n        \"font-[family-name:var(--os9-font-sans)] text-[10px] leading-none\",\n        \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n        className\n      ),\n      ...props,\n    },\n    render\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  RetroButtonGroupSeparator                                          */\n/* ------------------------------------------------------------------ */\n\ntype RetroButtonGroupSeparatorProps = React.ComponentProps<\"div\"> & {\n  orientation?: \"horizontal\" | \"vertical\"\n}\n\nconst RetroButtonGroupSeparator = React.forwardRef<\n  HTMLDivElement,\n  RetroButtonGroupSeparatorProps\n>(function RetroButtonGroupSeparator(\n  { className, orientation = \"vertical\", ...props },\n  ref\n) {\n  return (\n    <div\n      ref={ref}\n      role=\"separator\"\n      aria-orientation={orientation}\n      data-slot=\"button-group-separator\"\n      data-orientation={orientation}\n      className={cn(\n        \"relative z-[1] shrink-0 self-stretch\",\n        // Etched groove: dark line + light line, drawn over the shared border.\n        orientation === \"vertical\"\n          ? \"w-[2px] border-l border-os9-gray-700 border-r border-r-os9-white\"\n          : \"h-[2px] border-t border-os9-gray-700 border-b border-b-os9-white\",\n        className\n      )}\n      {...props}\n    />\n  )\n})\nRetroButtonGroupSeparator.displayName = \"RetroButtonGroupSeparator\"\n\nexport {\n  RetroButtonGroup,\n  RetroButtonGroupSeparator,\n  RetroButtonGroupText,\n  retroButtonGroupVariants,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}