{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tw-switcher",
  "type": "registry:ui",
  "title": "react-tw/switcher.tsx",
  "description": "Carbon `Switcher` + `SwitcherItem` + `SwitcherDivider` as React + Tailwind components, the look of 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/switcher.tsx",
      "type": "registry:ui",
      "target": "components/ui/react-tw/switcher.tsx",
      "content": "import type { ComponentProps, ReactNode } from 'react';\nimport { cn } from './lib/utils.ts';\n\n/**\n * Carbon `Switcher` + `SwitcherItem` + `SwitcherDivider` as React + Tailwind components, the look of\n * `<ui-switcher>`: the app list inside a HeaderPanel; `selected` marks the current app.\n */\nexport function Switcher({ 'aria-label': label, children, ...rest }: Readonly<Omit<ComponentProps<'div'>, 'aria-label' | 'children'> & { 'aria-label'?: string; children: ReactNode }>) {\n    return (\n        <div {...rest} className=\"flex flex-col text-ink-muted\">\n            <ul aria-label={label} className=\"m-0 list-none px-0 pt-4 pb-0\">\n                {children}\n            </ul>\n        </div>\n    );\n}\n\n/** A 1px divider between groups of apps (a plain `<hr>`, as in `<ui-switcher>`). */\n/** A line between groups of the switcher's items (a list item, so the list holds only items; as SideNavDivider). */\nexport function SwitcherDivider({ ...rest }: Readonly<ComponentProps<'li'>>) {\n    return (\n        <li {...rest} className=\"block\">\n            <hr className=\"mx-4 my-2 box-content block h-px w-56 border-0 bg-border-subtle-1\" />\n        </li>\n    );\n}\n\nexport interface SwitcherItemProps extends Omit<ComponentProps<'a'>, 'className'> {\n    /** The current app (`aria-current=\"page\"`). */\n    selected?: boolean;\n    children: ReactNode;\n}\n\nexport function SwitcherItem({ href = '#', selected = false, children, ...rest }: Readonly<SwitcherItemProps>) {\n    return (\n        <li className=\"block h-8 w-full\">\n            <a\n                {...rest}\n                href={href}\n                aria-current={selected ? 'page' : undefined}\n                className={cn(\n                    'box-border block h-8 overflow-hidden px-4 py-1.5 text-ellipsis whitespace-nowrap text-ink-muted no-underline type-body-emphasis leading-[18px]!',\n                    'hover:bg-layer-hover-1 hover:text-ink focus-visible:outline-[length:var(--ui-focus-width,2px)] focus-visible:-outline-offset-2 focus-visible:outline-focus focus-visible:outline-solid active:bg-layer-active-1 active:text-ink',\n                    selected && 'bg-layer-selected-1 text-ink hover:bg-layer-selected-1',\n                )}\n            >\n                {children}\n            </a>\n        </li>\n    );\n}\n"
    }
  ]
}
