- root deno.json workspace (nodeModulesDir auto), npm versions registered once in imports, deno.lock; remove pnpm-lock/pnpm-workspace/root package.json; members keep minimal package.json (name/type/exports) - tasks: dev, typecheck (tsc 7.0.2 per member + deno check), lint/fmt (biome, useImportExtensions), test (vitest via deno), check:tokens, build (web + deno compile), ci, db:migrate/reset, gen:types - tsconfig base moved to config/ (no root tsconfig.json); deno types -> types/deno.d.ts; web drops baseUrl - server: Deno.serve entry with graceful shutdown, --role migrate|preflight|probe, WEB_ROOT static SPA hosting; drop @hono/node-server, tsx, esbuild build.mjs - logger: redact child() bindings and serialize err by message/stack; sync stdout destination; tests - relative imports get explicit extensions (sites/mp-sync paths left for follow-up) - crash-recovery tests spawn `deno run -A`; tasks tests use unique per-file schemas - single-container Dockerfile + entrypoint (migrate -> preflight -> api+worker watchdog), docker-compose.yml - docs: README, runbook, ADR-001 superseded, plan §1 validation row Co-Authored-By: Claude Fable 5.1 <[email protected]>
93 lines
2.3 KiB
TypeScript
93 lines
2.3 KiB
TypeScript
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
import { Slot } from "radix-ui";
|
|
import type * as React from "react";
|
|
|
|
import { cn } from "~/lib/utils.ts";
|
|
|
|
function Breadcrumb({ ...props }: React.ComponentProps<"nav">) {
|
|
return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />;
|
|
}
|
|
|
|
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
return (
|
|
<ol
|
|
data-slot="breadcrumb-list"
|
|
className={cn(
|
|
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
return <li data-slot="breadcrumb-item" className={cn("inline-flex items-center gap-1.5", className)} {...props} />;
|
|
}
|
|
|
|
function BreadcrumbLink({
|
|
asChild,
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"a"> & {
|
|
asChild?: boolean;
|
|
}) {
|
|
const Comp = asChild ? Slot.Root : "a";
|
|
|
|
return (
|
|
<Comp data-slot="breadcrumb-link" className={cn("hover:text-foreground transition-colors", className)} {...props} />
|
|
);
|
|
}
|
|
|
|
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
return (
|
|
<span
|
|
data-slot="breadcrumb-page"
|
|
role="link"
|
|
aria-disabled="true"
|
|
aria-current="page"
|
|
className={cn("text-foreground font-normal", className)}
|
|
{...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}
|
|
>
|
|
{children ?? <ChevronRight />}
|
|
</li>
|
|
);
|
|
}
|
|
|
|
function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">) {
|
|
return (
|
|
<span
|
|
data-slot="breadcrumb-ellipsis"
|
|
role="presentation"
|
|
aria-hidden="true"
|
|
className={cn("flex size-9 items-center justify-center", className)}
|
|
{...props}
|
|
>
|
|
<MoreHorizontal className="size-4" />
|
|
<span className="sr-only">More</span>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
export {
|
|
Breadcrumb,
|
|
BreadcrumbEllipsis,
|
|
BreadcrumbItem,
|
|
BreadcrumbLink,
|
|
BreadcrumbList,
|
|
BreadcrumbPage,
|
|
BreadcrumbSeparator,
|
|
};
|