Two more > 400 LOC modules split along responsibility seams. Zero
behavior change — public APIs re-export from the original file paths,
so every consumer import stays working.
| Original | Split into | LOC each |
|---------------------------------------|-------------------------------|----------|
| src/main/skills/import.ts (458) | import (orchestrator) / | 132 |
| | discovery (findSkillMdFiles, | 153 |
| | buildLocalInventory) | |
| | materialize | 24 |
| | import-local | 147 |
| | import-url | 85 |
| src/renderer/components/ui/ | primitives (barrel re-export) | 11 |
| primitives.tsx (419) | Card / Eyebrow / Badge / | 9–59 |
| | Spinner / Panel / Field / | each |
| | Input / Select / TextArea / | |
| | ActionButton / SectionButton | |
`createSkillImporter` still returns `{ importFromSource, importFromGitHub,
importFromLocal, importFromUrl, cleanupSkillFiles, parseGitHubUrl,
findSkillMdFiles, buildLocalInventory }` — every existing consumer
resolves unchanged.
`primitives.tsx` is now a pure barrel re-exporting the 11 primitives.
Consumers can migrate to direct imports (`../ui/Card`) opportunistically
but the barrel path keeps working.
28 lines
671 B
TypeScript
28 lines
671 B
TypeScript
import { type ReactNode } from "react";
|
|
|
|
export function Eyebrow({
|
|
children,
|
|
tone = "muted",
|
|
className = "",
|
|
}: {
|
|
children: ReactNode;
|
|
tone?: "muted" | "primary" | "warning" | "destructive" | "success";
|
|
className?: string;
|
|
}) {
|
|
const toneClass =
|
|
tone === "primary"
|
|
? "text-primary"
|
|
: tone === "warning"
|
|
? "text-warning"
|
|
: tone === "destructive"
|
|
? "text-destructive"
|
|
: tone === "success"
|
|
? "text-success"
|
|
: "text-muted-foreground";
|
|
return (
|
|
<div className={`text-[11px] font-semibold uppercase tracking-[0.08em] ${toneClass} ${className}`}>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|