@leitware/dockets 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +86 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +36 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/registry.d.ts +18 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +712 -0
- package/dist/registry.js.map +1 -0
- package/package.json +40 -0
- package/templates/accordion.tsx +77 -0
- package/templates/alert-dialog.tsx +66 -0
- package/templates/alert.tsx +41 -0
- package/templates/aspect-ratio.tsx +15 -0
- package/templates/avatar.tsx +27 -0
- package/templates/badge.tsx +1 -0
- package/templates/block-loader.tsx +1 -0
- package/templates/breadcrumb.tsx +31 -0
- package/templates/button.tsx +1 -0
- package/templates/calendar.tsx +45 -0
- package/templates/card.tsx +35 -0
- package/templates/carousel.tsx +39 -0
- package/templates/checkbox.tsx +50 -0
- package/templates/code-block.tsx +1 -0
- package/templates/collapsible.tsx +35 -0
- package/templates/combobox.tsx +154 -0
- package/templates/command.tsx +50 -0
- package/templates/contact-footer.tsx +193 -0
- package/templates/context-menu.tsx +16 -0
- package/templates/dialog.tsx +67 -0
- package/templates/drawer.tsx +12 -0
- package/templates/dropdown-menu.tsx +95 -0
- package/templates/form-input.tsx +64 -0
- package/templates/form.tsx +10 -0
- package/templates/hover-card.tsx +5 -0
- package/templates/input-otp.tsx +6 -0
- package/templates/label.tsx +1 -0
- package/templates/layout-primitives.tsx +11 -0
- package/templates/layouts.tsx +346 -0
- package/templates/lib/utils.ts +49 -0
- package/templates/list-item.tsx +1 -0
- package/templates/list-items.tsx +41 -0
- package/templates/list.tsx +89 -0
- package/templates/logo.tsx +12 -0
- package/templates/marketing-footer.tsx +33 -0
- package/templates/marketing-header.tsx +46 -0
- package/templates/menubar.tsx +16 -0
- package/templates/navigation-menu.tsx +11 -0
- package/templates/pagination.tsx +86 -0
- package/templates/popover.tsx +8 -0
- package/templates/pricing-receipt.tsx +71 -0
- package/templates/pricing-tabs.tsx +60 -0
- package/templates/progress.tsx +29 -0
- package/templates/radio-group.tsx +58 -0
- package/templates/receipt-card.tsx +1 -0
- package/templates/receipt.tsx +269 -0
- package/templates/resizable.tsx +1 -0
- package/templates/scroll-area.tsx +1 -0
- package/templates/select.tsx +110 -0
- package/templates/separator.tsx +1 -0
- package/templates/sheet.tsx +12 -0
- package/templates/sidebar.tsx +15 -0
- package/templates/simple-footer.tsx +43 -0
- package/templates/simple-header.tsx +77 -0
- package/templates/skeleton.tsx +33 -0
- package/templates/slider.tsx +55 -0
- package/templates/styles/dockets.css +104 -0
- package/templates/switch.tsx +49 -0
- package/templates/table.tsx +73 -0
- package/templates/tabs.tsx +61 -0
- package/templates/theme-toggle.tsx +46 -0
- package/templates/toast.tsx +1 -0
- package/templates/toggle-group.tsx +1 -0
- package/templates/toggle.tsx +1 -0
- package/templates/tooltip.tsx +31 -0
- package/templates/tree-view.tsx +1 -0
- package/templates/ui/accordion.tsx +73 -0
- package/templates/ui/alert-dialog.tsx +128 -0
- package/templates/ui/alert.tsx +56 -0
- package/templates/ui/aspect-ratio.tsx +19 -0
- package/templates/ui/avatar.tsx +74 -0
- package/templates/ui/badge.tsx +48 -0
- package/templates/ui/block-loader.tsx +40 -0
- package/templates/ui/button.tsx +77 -0
- package/templates/ui/calendar.tsx +160 -0
- package/templates/ui/card.tsx +73 -0
- package/templates/ui/carousel.tsx +149 -0
- package/templates/ui/checkbox.tsx +33 -0
- package/templates/ui/code-block.tsx +36 -0
- package/templates/ui/collapsible.tsx +48 -0
- package/templates/ui/combobox.tsx +295 -0
- package/templates/ui/command.tsx +148 -0
- package/templates/ui/context-menu.tsx +212 -0
- package/templates/ui/dialog.tsx +138 -0
- package/templates/ui/drawer.tsx +134 -0
- package/templates/ui/dropdown-menu.tsx +254 -0
- package/templates/ui/form.tsx +122 -0
- package/templates/ui/hover-card.tsx +44 -0
- package/templates/ui/input-group.tsx +148 -0
- package/templates/ui/input-otp.tsx +153 -0
- package/templates/ui/input.tsx +20 -0
- package/templates/ui/label.tsx +17 -0
- package/templates/ui/layout.tsx +252 -0
- package/templates/ui/list-item.tsx +50 -0
- package/templates/ui/menubar.tsx +225 -0
- package/templates/ui/navigation-menu.tsx +117 -0
- package/templates/ui/pagination.tsx +110 -0
- package/templates/ui/popover.tsx +77 -0
- package/templates/ui/progress.tsx +37 -0
- package/templates/ui/radio-group.tsx +41 -0
- package/templates/ui/receipt-card.tsx +70 -0
- package/templates/ui/resizable.tsx +140 -0
- package/templates/ui/scroll-area.tsx +64 -0
- package/templates/ui/select.tsx +186 -0
- package/templates/ui/separator.tsx +21 -0
- package/templates/ui/sheet.tsx +134 -0
- package/templates/ui/sidebar.tsx +222 -0
- package/templates/ui/skeleton.tsx +35 -0
- package/templates/ui/slider.tsx +60 -0
- package/templates/ui/switch.tsx +33 -0
- package/templates/ui/table.tsx +114 -0
- package/templates/ui/tabs.tsx +79 -0
- package/templates/ui/textarea.tsx +18 -0
- package/templates/ui/toast.tsx +139 -0
- package/templates/ui/toggle-group.tsx +68 -0
- package/templates/ui/toggle.tsx +47 -0
- package/templates/ui/tooltip.tsx +53 -0
- package/templates/ui/tree-view.tsx +76 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import { addCommand } from "./commands/add.js";
|
|
7
|
+
import { listCommand } from "./commands/list.js";
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name("leit")
|
|
13
|
+
.description("Leitware design system CLI")
|
|
14
|
+
.version(pkg.version);
|
|
15
|
+
program.addCommand(addCommand);
|
|
16
|
+
program.addCommand(listCommand);
|
|
17
|
+
program.parse();
|
|
18
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAErF,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,MAAM,CAAC;KACZ,WAAW,CAAC,4BAA4B,CAAC;KACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/B,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAEhC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgCpC,eAAO,MAAM,UAAU,SAoFnB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import pc from "picocolors";
|
|
6
|
+
import { registry } from "../registry.js";
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const templatesDir = resolve(__dirname, "..", "..", "templates");
|
|
9
|
+
/** Collect a component and all its transitive internalDeps */
|
|
10
|
+
function collectDeps(name, visited = new Set()) {
|
|
11
|
+
if (visited.has(name))
|
|
12
|
+
return [];
|
|
13
|
+
visited.add(name);
|
|
14
|
+
const entry = registry[name];
|
|
15
|
+
if (!entry)
|
|
16
|
+
return [];
|
|
17
|
+
const result = [];
|
|
18
|
+
// Resolve internal deps first (depth-first)
|
|
19
|
+
for (const dep of entry.internalDeps ?? []) {
|
|
20
|
+
result.push(...collectDeps(dep, visited));
|
|
21
|
+
}
|
|
22
|
+
result.push(entry);
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
export const addCommand = new Command("add")
|
|
26
|
+
.description("Add component(s) to your project")
|
|
27
|
+
.argument("<components...>", "component name(s) to add")
|
|
28
|
+
.option("-d, --dest <path>", "project root (files install relative to this)", ".")
|
|
29
|
+
.option("-y, --yes", "overwrite existing files without prompting", false)
|
|
30
|
+
.action((components, options) => {
|
|
31
|
+
const projectRoot = resolve(process.cwd(), options.dest);
|
|
32
|
+
// Resolve all requested components + their deps
|
|
33
|
+
const visited = new Set();
|
|
34
|
+
const toInstall = [];
|
|
35
|
+
for (const name of components) {
|
|
36
|
+
if (!registry[name]) {
|
|
37
|
+
console.error(pc.red(`✗ Unknown component: ${pc.bold(name)}`));
|
|
38
|
+
console.log(` Run ${pc.cyan("leit list")} to see available components.\n`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
toInstall.push(...collectDeps(name, visited));
|
|
42
|
+
}
|
|
43
|
+
const allDeps = new Set();
|
|
44
|
+
let filesWritten = 0;
|
|
45
|
+
let filesSkipped = 0;
|
|
46
|
+
for (const entry of toInstall) {
|
|
47
|
+
for (const file of entry.files) {
|
|
48
|
+
const src = join(templatesDir, file.src);
|
|
49
|
+
const dest = join(projectRoot, file.dest);
|
|
50
|
+
if (!existsSync(src)) {
|
|
51
|
+
console.error(pc.red(`✗ Template not found: ${file.src}`));
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
// Skip if file exists and --yes not set
|
|
55
|
+
if (existsSync(dest) && !options.yes) {
|
|
56
|
+
console.log(`${pc.yellow("○")} ${pc.dim(file.dest)} ${pc.dim("(exists, use -y to overwrite)")}`);
|
|
57
|
+
filesSkipped++;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const destDir = dirname(dest);
|
|
61
|
+
if (!existsSync(destDir)) {
|
|
62
|
+
mkdirSync(destDir, { recursive: true });
|
|
63
|
+
}
|
|
64
|
+
writeFileSync(dest, readFileSync(src, "utf-8"));
|
|
65
|
+
console.log(`${pc.green("✓")} ${pc.cyan(file.dest)}`);
|
|
66
|
+
filesWritten++;
|
|
67
|
+
}
|
|
68
|
+
for (const dep of entry.deps) {
|
|
69
|
+
allDeps.add(dep);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Summary
|
|
73
|
+
console.log();
|
|
74
|
+
if (filesWritten > 0) {
|
|
75
|
+
console.log(`${pc.green("✓")} ${filesWritten} file${filesWritten === 1 ? "" : "s"} written`);
|
|
76
|
+
}
|
|
77
|
+
if (filesSkipped > 0) {
|
|
78
|
+
console.log(`${pc.yellow("○")} ${filesSkipped} file${filesSkipped === 1 ? "" : "s"} skipped`);
|
|
79
|
+
}
|
|
80
|
+
if (allDeps.size > 0) {
|
|
81
|
+
console.log(`\n${pc.dim("Install dependencies:")}`);
|
|
82
|
+
console.log(` ${pc.dim("npm install")} ${[...allDeps].sort().join(" ")}`);
|
|
83
|
+
}
|
|
84
|
+
console.log();
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAuB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAEjE,8DAA8D;AAC9D,SAAS,WAAW,CAClB,IAAY,EACZ,UAAU,IAAI,GAAG,EAAU;IAE3B,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CA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AAI,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,eAAO,MAAM,WAAW,SAuCpB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import pc from "picocolors";
|
|
3
|
+
import { registry } from "../registry.js";
|
|
4
|
+
export const listCommand = new Command("list")
|
|
5
|
+
.description("List all available components")
|
|
6
|
+
.option("-t, --tag <tag>", "filter by tag (primitive, extended, leitware, foundation)")
|
|
7
|
+
.action((options) => {
|
|
8
|
+
let entries = Object.values(registry);
|
|
9
|
+
if (options.tag) {
|
|
10
|
+
entries = entries.filter((e) => e.tags?.includes(options.tag));
|
|
11
|
+
}
|
|
12
|
+
console.log(`\n${pc.bold("Components")} ${pc.dim(`(${entries.length} available)`)}\n`);
|
|
13
|
+
// Group by primary tag
|
|
14
|
+
const groups = new Map();
|
|
15
|
+
for (const entry of entries) {
|
|
16
|
+
const primaryTag = entry.tags?.[0] ?? "other";
|
|
17
|
+
if (!groups.has(primaryTag))
|
|
18
|
+
groups.set(primaryTag, []);
|
|
19
|
+
groups.get(primaryTag).push(entry);
|
|
20
|
+
}
|
|
21
|
+
const tagOrder = ["foundation", "primitive", "extended", "leitware", "other"];
|
|
22
|
+
for (const tag of tagOrder) {
|
|
23
|
+
const group = groups.get(tag);
|
|
24
|
+
if (!group)
|
|
25
|
+
continue;
|
|
26
|
+
console.log(` ${pc.bold(pc.dim(tag.toUpperCase()))}`);
|
|
27
|
+
for (const entry of group) {
|
|
28
|
+
const deps = entry.internalDeps?.length
|
|
29
|
+
? pc.dim(` → ${entry.internalDeps.join(", ")}`)
|
|
30
|
+
: "";
|
|
31
|
+
console.log(` ${pc.cyan(entry.name.padEnd(20))} ${pc.dim(entry.description)}${deps}`);
|
|
32
|
+
}
|
|
33
|
+
console.log();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC3C,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,iBAAiB,EAAE,2DAA2D,CAAC;KACtF,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;IAClB,IAAI,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAEtC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,CAAC,GAAG,CACT,KAAK,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,aAAa,CAAC,IAAI,CAC1E,CAAC;IAEF,uBAAuB;IACvB,MAAM,MAAM,GAAG,IAAI,GAAG,EAA0B,CAAC;IACjD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,UAAU,GAAG,KAAK,CAA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
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
/** Files relative to templates dir → installed relative to base path */
|
|
5
|
+
files: {
|
|
6
|
+
src: string;
|
|
7
|
+
/** Where to install relative to the project root. e.g. "components/ui/button.tsx" */
|
|
8
|
+
dest: string;
|
|
9
|
+
}[];
|
|
10
|
+
/** npm dependencies to install */
|
|
11
|
+
deps: string[];
|
|
12
|
+
/** Other registry components that must be installed first */
|
|
13
|
+
internalDeps?: string[];
|
|
14
|
+
/** Tags for categorisation */
|
|
15
|
+
tags?: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare const registry: Record<string, ComponentEntry>;
|
|
18
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,qFAAqF;QACrF,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,kCAAkC;IAClC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CA8sBnD,CAAC"}
|