{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "toolbar",
  "type": "registry:ui",
  "title": "Toolbar",
  "description": "Related controls with shared keyboard navigation.",
  "dependencies": [
    "@base-ui/react@1.8.0"
  ],
  "registryDependencies": [
    "https://ghost-ui.com/r/ghost-tokens.json",
    "https://ghost-ui.com/r/foundation.json",
    "https://ghost-ui.com/r/base-styled.json",
    "https://ghost-ui.com/r/button.json",
    "https://ghost-ui.com/r/input.json",
    "https://ghost-ui.com/r/link.json",
    "https://ghost-ui.com/r/separator.json"
  ],
  "files": [
    {
      "path": "src/components/ui/toolbar.tsx",
      "type": "registry:component",
      "target": "@ui/toolbar.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\n\nimport { styled } from \"./base-styled\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { linkPart } from \"./link-part\";\nimport { Separator } from \"./separator\";\nimport \"./toolbar.css\";\n\nconst ToolbarOrientationContext = React.createContext<\"horizontal\" | \"vertical\">(\"horizontal\");\n\ntype ToolbarRootProps = React.ComponentProps<typeof BaseToolbar.Root> & { variant?: \"ghost\" | \"outline\" };\nconst ToolbarRoot = React.forwardRef<HTMLDivElement, ToolbarRootProps>(function ToolbarRoot(\n  { orientation = \"horizontal\", variant = \"ghost\", className, ...props }, ref,\n) {\n  return <ToolbarOrientationContext.Provider value={orientation}>\n    <BaseToolbar.Root {...props} ref={ref} orientation={orientation} data-variant={variant} className={typeof className === \"function\"\n      ? (state) => [\"ui-toolbar\", className(state)].filter(Boolean).join(\" \")\n      : [\"ui-toolbar\", className].filter(Boolean).join(\" \")} />\n  </ToolbarOrientationContext.Provider>;\n});\n\nconst ToolbarButton = React.forwardRef<HTMLButtonElement, React.ComponentProps<typeof BaseToolbar.Button>>(\n  function ToolbarButton({ render, ...props }, ref) {\n    return <BaseToolbar.Button ref={ref} render={render ?? <Button variant=\"ghost\" size=\"base\" shape=\"square\" />} {...props} />;\n  },\n);\n\nconst ToolbarInput = React.forwardRef<HTMLInputElement, React.ComponentProps<typeof BaseToolbar.Input>>(\n  function ToolbarInput({ render, ...props }, ref) {\n    return <BaseToolbar.Input ref={ref} render={render ?? <Input />} {...props} />;\n  },\n);\n\nconst ToolbarSeparator = React.forwardRef<HTMLDivElement, React.ComponentProps<typeof BaseToolbar.Separator>>(\n  function ToolbarSeparator({ render, orientation, ...props }, ref) {\n    const toolbarOrientation = React.useContext(ToolbarOrientationContext);\n    const resolved = orientation ?? (toolbarOrientation === \"horizontal\" ? \"vertical\" : \"horizontal\");\n    return <BaseToolbar.Separator ref={ref} orientation={resolved} render={render ?? <Separator orientation={resolved} />} {...props} />;\n  },\n);\n\nconst ToolbarLink = /* @__PURE__ */ linkPart(BaseToolbar.Link);\n\nexport const Toolbar = {\n  ...BaseToolbar,\n  Root: ToolbarRoot,\n  Group: /* @__PURE__ */ styled(BaseToolbar.Group, \"ui-toolbar-group\"),\n  Button: ToolbarButton,\n  Input: ToolbarInput,\n  Link: ToolbarLink,\n  Separator: ToolbarSeparator,\n};\n"
    },
    {
      "path": "src/components/ui/toolbar.css",
      "type": "registry:file",
      "target": "@ui/toolbar.css",
      "content": "/* Toolbar owns the navigation row; children keep their canonical visuals. */\n.ui-toolbar {\n  display: flex;\n  align-items: center;\n  gap: var(--space-1);\n  flex-wrap: wrap;\n  width: fit-content;\n  max-width: 100%;\n  box-sizing: border-box;\n  padding: 0;\n  border-radius: var(--radius-lg);\n  background: transparent;\n}\n.ui-toolbar[data-variant=\"outline\"] { padding: var(--space-1); box-shadow: inset 0 0 0 1px var(--outline-border); }\n.ui-toolbar[data-orientation=\"vertical\"] { flex-direction: column; flex-wrap: nowrap; align-items: center; }\n.ui-toolbar-group { display: flex; align-items: center; gap: var(--space-1); max-width: 100%; flex-wrap: wrap; }\n.ui-toolbar-group[data-orientation=\"vertical\"] { flex-direction: column; flex-wrap: nowrap; }\n\n/* Toolbar owns child placement: every direct item keeps its size and centers on the row. */\n:is(.ui-toolbar, .ui-toolbar-group) > * {\n  flex-shrink: 0;\n}\n:is(.ui-toolbar, .ui-toolbar-group) > .ui-button {\n  align-self: center;\n}\n.ui-toolbar > .ui-separator[data-orientation=\"vertical\"], .ui-toolbar-group > .ui-separator[data-orientation=\"vertical\"] { align-self: center; height: var(--space-5); min-height: var(--space-5); }\n.ui-toolbar > .ui-separator[data-orientation=\"horizontal\"], .ui-toolbar-group > .ui-separator[data-orientation=\"horizontal\"] { align-self: center; width: var(--space-5); }\n"
    },
    {
      "path": "src/components/ui/link-part.tsx",
      "type": "registry:component",
      "target": "@ui/link-part.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Link, type LinkUnderline, type LinkVariant } from \"./link\";\n\n/** Internal composition adapter; Base UI keeps each part's roles and state. */\nexport function linkPart<C extends React.ElementType>(\n  Component: C,\n  underline: LinkUnderline = \"none\",\n  variant?: LinkVariant,\n  inferIcon = false,\n): C {\n  const resolvedVariant = variant ?? (underline === \"auto\" ? \"default\" : \"plain\");\n  const Part = React.forwardRef<unknown, Record<string, unknown>>(function LinkPart({ render, ...props }, ref) {\n    const renderProps = React.isValidElement(render)\n      ? render.props as React.AnchorHTMLAttributes<HTMLAnchorElement> & { to?: unknown }\n      : undefined;\n    const rendererHref = React.isValidElement(render)\n      ? renderProps?.href\n      : undefined;\n    return React.createElement(Component as React.ElementType, {\n      ...props,\n      ref,\n      render: (anchorProps: React.AnchorHTMLAttributes<HTMLAnchorElement>, state: unknown) => {\n        const className = typeof (anchorProps.className as unknown) === \"function\"\n          ? (anchorProps.className as unknown as (state: unknown) => string)(state)\n          : anchorProps.className;\n        if (renderProps?.to !== undefined && (anchorProps.href == null || anchorProps.href === \"\")) {\n          return React.cloneElement(render as React.ReactElement<Record<string, unknown>>, {\n            ...anchorProps,\n            className: [renderProps.className, className].filter(Boolean).join(\" \"),\n            children: anchorProps.children ?? renderProps.children,\n          });\n        }\n        if (React.isValidElement(render) && render.type !== \"a\" && !rendererHref && !anchorProps.href) {\n          const { href: _href, ...buttonProps } = anchorProps;\n          return React.cloneElement(render as React.ReactElement<Record<string, unknown>>, {\n            ...buttonProps,\n            className: [renderProps?.className, className].filter(Boolean).join(\" \"),\n            children: renderProps?.children ?? anchorProps.children,\n          });\n        }\n        return <Link\n          {...anchorProps}\n          href={anchorProps.href ?? rendererHref}\n          className={className}\n          underline={underline}\n          variant={resolvedVariant}\n          icon={inferIcon ? undefined : false}\n          render={typeof render === \"function\"\n            ? (linkProps) => render(linkProps, state)\n            : React.isValidElement(render) ? render : undefined}\n        />;\n      },\n    });\n  });\n  return Part as unknown as C;\n}\n"
    }
  ]
}
