2025-05-05 17:11:44 +00:00
|
|
|
import * as React from "react"
|
2026-03-17 17:49:54 +00:00
|
|
|
import { Slot } from "radix-ui"
|
2025-05-05 17:11:44 +00:00
|
|
|
|
|
|
|
|
import { cn } from "@repo/shadcn-ui/lib/utils"
|
2026-03-17 17:49:54 +00:00
|
|
|
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
|
2025-05-05 17:11:44 +00:00
|
|
|
|
2026-03-17 17:49:54 +00:00
|
|
|
function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
|
|
|
|
|
return (
|
|
|
|
|
<nav
|
|
|
|
|
aria-label="breadcrumb"
|
|
|
|
|
data-slot="breadcrumb"
|
|
|
|
|
className={cn(className)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
)
|
2025-05-05 17:11:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
|
|
|
return (
|
|
|
|
|
<ol
|
|
|
|
|
data-slot="breadcrumb-list"
|
|
|
|
|
className={cn(
|
2026-03-17 17:49:54 +00:00
|
|
|
"flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
|
2025-05-05 17:11:44 +00:00
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
|
|
|
return (
|
|
|
|
|
<li
|
|
|
|
|
data-slot="breadcrumb-item"
|
2026-03-17 17:49:54 +00:00
|
|
|
className={cn("inline-flex items-center gap-1", className)}
|
2025-05-05 17:11:44 +00:00
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function BreadcrumbLink({
|
|
|
|
|
asChild,
|
|
|
|
|
className,
|
|
|
|
|
...props
|
|
|
|
|
}: React.ComponentProps<"a"> & {
|
|
|
|
|
asChild?: boolean
|
|
|
|
|
}) {
|
2026-03-17 17:49:54 +00:00
|
|
|
const Comp = asChild ? Slot.Root : "a"
|
2025-05-05 17:11:44 +00:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Comp
|
|
|
|
|
data-slot="breadcrumb-link"
|
2026-03-17 17:49:54 +00:00
|
|
|
className={cn("transition-colors hover:text-foreground", className)}
|
2025-05-05 17:11:44 +00:00
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
|
|
|
return (
|
|
|
|
|
<span
|
|
|
|
|
data-slot="breadcrumb-page"
|
|
|
|
|
role="link"
|
|
|
|
|
aria-disabled="true"
|
|
|
|
|
aria-current="page"
|
2026-03-17 17:49:54 +00:00
|
|
|
className={cn("font-normal text-foreground", className)}
|
2025-05-05 17:11:44 +00:00
|
|
|
{...props}
|
|
|
|
|
/>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function BreadcrumbSeparator({
|
|
|
|
|
children,
|
|
|
|
|
className,
|
|
|
|
|
...props
|
|
|
|
|
}: React.ComponentProps<"li">) {
|
|
|
|
|
return (
|
|
|
|
|
<li
|
|
|
|
|
data-slot="breadcrumb-separator"
|
|
|
|
|
role="presentation"
|
|
|
|
|
aria-hidden="true"
|
|
|
|
|
className={cn("[&>svg]:size-3.5", className)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
2026-03-17 17:49:54 +00:00
|
|
|
{children ?? (
|
|
|
|
|
<ChevronRightIcon />
|
|
|
|
|
)}
|
2025-05-05 17:11:44 +00:00
|
|
|
</li>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function BreadcrumbEllipsis({
|
|
|
|
|
className,
|
|
|
|
|
...props
|
|
|
|
|
}: React.ComponentProps<"span">) {
|
|
|
|
|
return (
|
|
|
|
|
<span
|
|
|
|
|
data-slot="breadcrumb-ellipsis"
|
|
|
|
|
role="presentation"
|
|
|
|
|
aria-hidden="true"
|
2026-03-17 17:49:54 +00:00
|
|
|
className={cn(
|
|
|
|
|
"flex size-5 items-center justify-center [&>svg]:size-4",
|
|
|
|
|
className
|
|
|
|
|
)}
|
2025-05-05 17:11:44 +00:00
|
|
|
{...props}
|
|
|
|
|
>
|
2026-03-17 17:49:54 +00:00
|
|
|
<MoreHorizontalIcon
|
|
|
|
|
/>
|
2025-05-05 17:11:44 +00:00
|
|
|
<span className="sr-only">More</span>
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
Breadcrumb,
|
|
|
|
|
BreadcrumbList,
|
|
|
|
|
BreadcrumbItem,
|
|
|
|
|
BreadcrumbLink,
|
|
|
|
|
BreadcrumbPage,
|
|
|
|
|
BreadcrumbSeparator,
|
|
|
|
|
BreadcrumbEllipsis,
|
|
|
|
|
}
|