Files
ui/apps/v4/components/colors-nav.tsx
zeekay 11b02e8dcb feat: sync with upstream shadcn/ui (through [email protected])
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in:
- [email protected] through [email protected] releases
- New apps/v4 directory structure
- Registry system improvements and MCP server
- Framework support (Vue, Svelte, React Native)
- New templates (vite-app, monorepo-next, laravel)
- Zod 4 compatibility (scoped override for zod@>4)
- Test fixture corrections for alias resolution

All 867 merge conflicts resolved preserving Hanzo customizations.
1020/1020 shadcn tests pass.
2026-02-09 10:44:26 -08:00

42 lines
1.3 KiB
TypeScript

"use client"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { getColors } from "@/lib/colors"
import { cn } from "@/lib/utils"
import { ScrollArea, ScrollBar } from "@/registry/new-york-v4/ui/scroll-area"
export function ColorsNav({
className,
...props
}: React.ComponentProps<"div">) {
const pathname = usePathname()
const colors = getColors()
return (
<div className={cn("flex items-center", className)} {...props}>
<ScrollArea className="max-w-full">
<div className="flex items-center">
{colors.map((colorPalette, index) => (
<Link
href={`/colors#${colorPalette.name}`}
key={colorPalette.name}
data-active={
pathname?.startsWith(colorPalette.name) ||
(index === 0 && pathname === "/colors")
}
className={cn(
"text-muted-foreground hover:text-primary data-[active=true]:text-primary flex h-7 items-center justify-center px-4 text-center text-base font-medium capitalize transition-colors"
)}
>
{colorPalette.name}
</Link>
))}
</div>
<ScrollBar orientation="horizontal" className="invisible" />
</ScrollArea>
</div>
)
}