) {\n return parts.filter(Boolean).join(" ");\n}\n`;
+
+/** The `import { cn } from "…/lib/utils"` line a module emits when it references `cn(`.
+ * `depth` is how many directory levels the consuming file sits BELOW `src` (page.tsx in
+ * `src/app` → 1; a component in `src/app/components` → 2), so the relative path always
+ * resolves to the single `src/lib/utils`. */
+export function cnImportLine(depth: number): string {
+ return `import { cn } from "${"../".repeat(Math.max(1, depth))}lib/utils";`;
+}
/** Split a className value SOURCE (a JSON string literal as emitted by propsList) into its
* whitespace-separated tokens. Returns [] for a non-string / unparseable source. */
@@ -852,6 +876,15 @@ function canonicalViewportFor(n: IRNode): number {
return keys[0] ?? 1280;
}
+/** Whether a node's `white-space` preserves captured whitespace verbatim (pre/pre-wrap/pre-line/
+ * break-spaces) — in which case emission must NOT collapse its text runs. ``/`