Files
ASOwnerYTandClaude Opus 5 3970cf9a00
Docker / build (push) Failing after 1m43s
Add design-sync inputs for claude.ai/design
Import this repo's components into a Claude Design project so the design
agent builds with the real Cloudrite library instead of generic components.

The repo is a Next.js app, not a component library: no dist/, no exports
map, no .d.ts tree, and Tailwind exists only as build directives. So
.design-sync/ carries a small build that manufactures a consumable package
from source (staged to the gitignored .ds-pkg/):

- tsconfig.dts.json  declaration emit, for real <Name>Props contracts
- build-css.mjs      Tailwind v4 -> a static stylesheet via @tailwindcss/postcss
- make-pkg.mjs       stages the package; index.js exports all 292 symbols
                     while index.d.ts exports only the 61 roots, so shadcn's
                     flat compound parts don't each become a preview card.
                     Also generates the per-root parts tables in docs/
- shims/next-link    router-free anchor; the real next/link needs
                     AppRouterContext and drags in the App Router runtime
- fonts/             Space Grotesk + Inter woff2 (SIL OFL). next/font supplies
                     these at runtime in the app, so the bundle has none

previews/ holds 40 authored preview stories, conventions.md is prepended to
the generated README as the design agent's usage guide, and NOTES.md records
the gotchas a future sync would otherwise rediscover.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-05 17:04:10 +12:00

38 lines
1.3 KiB
TypeScript

// `next/link` stand-in for the design-system bundle.
//
// Header, Hero and Footer navigate with next/link. The real one reads Next's
// AppRouterContext, which doesn't exist outside a Next app — pulling it into the
// bundle would drag the router runtime in and throw on mount in every preview
// and every design the agent builds.
//
// Routed here by compilerOptions.paths in .design-sync/tsconfig.ds.json, which
// the converter feeds to esbuild. Renders the plain anchor Next renders anyway,
// and drops the router-only props so React doesn't warn about unknown DOM
// attributes.
import * as React from 'react';
type UrlObject = { pathname?: string; query?: unknown; hash?: string };
export type LinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & {
href: string | UrlObject;
prefetch?: boolean | null;
replace?: boolean;
scroll?: boolean;
shallow?: boolean;
passHref?: boolean;
legacyBehavior?: boolean;
locale?: string | false;
};
const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(
{ href, prefetch, replace, scroll, shallow, passHref, legacyBehavior, locale, ...rest },
ref,
) {
const resolved =
typeof href === 'string' ? href : `${href?.pathname ?? ''}${href?.hash ?? ''}` || '#';
return <a ref={ref} href={resolved} {...rest} />;
});
export default Link;