mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
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.
138 lines
2.9 KiB
TypeScript
138 lines
2.9 KiB
TypeScript
import * as React from "react"
|
|
import { mergeProps } from "@base-ui/react/merge-props"
|
|
import { useRender } from "@base-ui/react/use-render"
|
|
|
|
import { cn } from "@/registry/bases/base/lib/utils"
|
|
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"
|
|
|
|
function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
|
|
return (
|
|
<nav
|
|
aria-label="breadcrumb"
|
|
data-slot="breadcrumb"
|
|
className={cn("cn-breadcrumb", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
return (
|
|
<ol
|
|
data-slot="breadcrumb-list"
|
|
className={cn(
|
|
"cn-breadcrumb-list flex flex-wrap items-center wrap-break-word",
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
return (
|
|
<li
|
|
data-slot="breadcrumb-item"
|
|
className={cn("cn-breadcrumb-item inline-flex items-center", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function BreadcrumbLink({
|
|
className,
|
|
render,
|
|
...props
|
|
}: useRender.ComponentProps<"a">) {
|
|
return useRender({
|
|
defaultTagName: "a",
|
|
props: mergeProps<"a">(
|
|
{
|
|
className: cn("cn-breadcrumb-link", className),
|
|
},
|
|
props
|
|
),
|
|
render,
|
|
state: {
|
|
slot: "breadcrumb-link",
|
|
},
|
|
})
|
|
}
|
|
|
|
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
return (
|
|
<span
|
|
data-slot="breadcrumb-page"
|
|
role="link"
|
|
aria-disabled="true"
|
|
aria-current="page"
|
|
className={cn("cn-breadcrumb-page", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function BreadcrumbSeparator({
|
|
children,
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"li">) {
|
|
return (
|
|
<li
|
|
data-slot="breadcrumb-separator"
|
|
role="presentation"
|
|
aria-hidden="true"
|
|
className={cn("cn-breadcrumb-separator", className)}
|
|
{...props}
|
|
>
|
|
{children ?? (
|
|
<IconPlaceholder
|
|
lucide="ChevronRightIcon"
|
|
tabler="IconChevronRight"
|
|
hugeicons="ArrowRight01Icon"
|
|
phosphor="CaretRightIcon"
|
|
remixicon="RiArrowRightSLine"
|
|
className="cn-rtl-flip"
|
|
/>
|
|
)}
|
|
</li>
|
|
)
|
|
}
|
|
|
|
function BreadcrumbEllipsis({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"span">) {
|
|
return (
|
|
<span
|
|
data-slot="breadcrumb-ellipsis"
|
|
role="presentation"
|
|
aria-hidden="true"
|
|
className={cn(
|
|
"cn-breadcrumb-ellipsis flex items-center justify-center",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
<IconPlaceholder
|
|
lucide="MoreHorizontalIcon"
|
|
tabler="IconDots"
|
|
hugeicons="MoreHorizontalCircle01Icon"
|
|
phosphor="DotsThreeIcon"
|
|
remixicon="RiMoreLine"
|
|
/>
|
|
<span className="sr-only">More</span>
|
|
</span>
|
|
)
|
|
}
|
|
|
|
export {
|
|
Breadcrumb,
|
|
BreadcrumbList,
|
|
BreadcrumbItem,
|
|
BreadcrumbLink,
|
|
BreadcrumbPage,
|
|
BreadcrumbSeparator,
|
|
BreadcrumbEllipsis,
|
|
}
|