@g3nomaly/ui 0.3.0 → 0.3.1

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.
Files changed (92) hide show
  1. package/LICENSE +95 -0
  2. package/dist/cli/adapter.d.ts +48 -0
  3. package/dist/cli/adapter.d.ts.map +1 -0
  4. package/dist/cli/adapter.js +87 -0
  5. package/dist/cli/adapter.js.map +1 -0
  6. package/dist/cli/commands/add.d.ts +16 -0
  7. package/dist/cli/commands/add.d.ts.map +1 -0
  8. package/dist/cli/commands/add.js +20 -0
  9. package/dist/cli/commands/add.js.map +1 -0
  10. package/dist/cli/commands/index.d.ts +15 -0
  11. package/dist/cli/commands/index.d.ts.map +1 -0
  12. package/dist/cli/commands/index.js +9 -0
  13. package/dist/cli/commands/index.js.map +1 -0
  14. package/dist/cli/commands/init.d.ts +25 -0
  15. package/dist/cli/commands/init.d.ts.map +1 -0
  16. package/dist/cli/commands/init.js +148 -0
  17. package/dist/cli/commands/init.js.map +1 -0
  18. package/dist/cli/commands/ls.d.ts +11 -0
  19. package/dist/cli/commands/ls.d.ts.map +1 -0
  20. package/dist/cli/commands/ls.js +20 -0
  21. package/dist/cli/commands/ls.js.map +1 -0
  22. package/dist/cli/commands/manifest.d.ts +12 -0
  23. package/dist/cli/commands/manifest.d.ts.map +1 -0
  24. package/dist/cli/commands/manifest.js +83 -0
  25. package/dist/cli/commands/manifest.js.map +1 -0
  26. package/dist/cli/commands/remove.d.ts +10 -0
  27. package/dist/cli/commands/remove.d.ts.map +1 -0
  28. package/dist/cli/commands/remove.js +12 -0
  29. package/dist/cli/commands/remove.js.map +1 -0
  30. package/dist/cli/commands/source.d.ts +22 -0
  31. package/dist/cli/commands/source.d.ts.map +1 -0
  32. package/dist/cli/commands/source.js +23 -0
  33. package/dist/cli/commands/source.js.map +1 -0
  34. package/dist/cli/commands/update.d.ts +11 -0
  35. package/dist/cli/commands/update.d.ts.map +1 -0
  36. package/dist/cli/commands/update.js +13 -0
  37. package/dist/cli/commands/update.js.map +1 -0
  38. package/dist/cli/index.d.ts +3 -0
  39. package/dist/cli/index.d.ts.map +1 -0
  40. package/dist/cli/index.js +90 -0
  41. package/dist/cli/index.js.map +1 -0
  42. package/dist/components/basic/Card.css +32 -0
  43. package/dist/components/basic/Card.debug.ts +5 -0
  44. package/dist/components/basic/Card.tsx +26 -0
  45. package/dist/components/basic/CardFooter.css +16 -0
  46. package/dist/components/basic/CardFooter.debug.ts +5 -0
  47. package/dist/components/basic/CardFooter.tsx +25 -0
  48. package/dist/components/basic/CardHeader.css +14 -0
  49. package/dist/components/basic/CardHeader.debug.ts +5 -0
  50. package/dist/components/basic/CardHeader.tsx +25 -0
  51. package/dist/components/basic/card.meta.ts +13 -0
  52. package/dist/components/basic/cardfooter.meta.ts +13 -0
  53. package/dist/components/basic/cardheader.meta.ts +13 -0
  54. package/dist/components/input/Button.css +34 -0
  55. package/dist/components/input/Button.debug.ts +5 -0
  56. package/dist/components/input/Button.tsx +25 -0
  57. package/dist/components/input/button.meta.ts +13 -0
  58. package/dist/components.json +138 -0
  59. package/dist/index.d.ts +2 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.js +3 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/registry/adapters/shadcn.adapter.d.ts +35 -0
  64. package/dist/registry/adapters/shadcn.adapter.d.ts.map +1 -0
  65. package/dist/registry/adapters/shadcn.adapter.js +107 -0
  66. package/dist/registry/adapters/shadcn.adapter.js.map +1 -0
  67. package/dist/registry/componentsJson.d.ts +23 -0
  68. package/dist/registry/componentsJson.d.ts.map +1 -0
  69. package/dist/registry/componentsJson.js +55 -0
  70. package/dist/registry/componentsJson.js.map +1 -0
  71. package/dist/registry/index.d.ts +6 -0
  72. package/dist/registry/index.d.ts.map +1 -0
  73. package/dist/registry/index.js +6 -0
  74. package/dist/registry/index.js.map +1 -0
  75. package/dist/registry/manifest.d.ts +19 -0
  76. package/dist/registry/manifest.d.ts.map +1 -0
  77. package/dist/registry/manifest.js +76 -0
  78. package/dist/registry/manifest.js.map +1 -0
  79. package/dist/registry/readSource.d.ts +20 -0
  80. package/dist/registry/readSource.d.ts.map +1 -0
  81. package/dist/registry/readSource.js +44 -0
  82. package/dist/registry/readSource.js.map +1 -0
  83. package/dist/registry/types.d.ts +88 -0
  84. package/dist/registry/types.d.ts.map +1 -0
  85. package/dist/registry/types.js +44 -0
  86. package/dist/registry/types.js.map +1 -0
  87. package/dist/sources/builtins.d.ts +8 -0
  88. package/dist/sources/builtins.d.ts.map +1 -0
  89. package/dist/sources/builtins.js +10 -0
  90. package/dist/sources/builtins.js.map +1 -0
  91. package/package.json +84 -3
  92. package/README.md +0 -3
@@ -0,0 +1,83 @@
1
+ // packages/ui/src/cli/commands/manifest.ts
2
+ import chalk from "chalk";
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { glob as _glob } from "glob";
6
+ import { register } from "@g3nomaly/core/registry";
7
+ import { offers, saveInstallManifest } from "@g3nomaly/core/installer";
8
+ import { hashFile } from "@g3nomaly/core/hash";
9
+ import { c, sym, lineError } from "@g3nomaly/core/cli";
10
+ import { ComponentMetaSchema } from "../../registry/types";
11
+ import { fileFlags, openComponentRegistry, openUiProject } from "../adapter";
12
+ /** A path with forward slashes only. */
13
+ function normalisePath(p) {
14
+ return p.replace(/\\/g, "/");
15
+ }
16
+ /** Whether a file found on disk is the registry file, compared by path ending. */
17
+ function matchesRegistryPath(diskPath, registryPath) {
18
+ return normalisePath(diskPath).endsWith(normalisePath(registryPath));
19
+ }
20
+ /**
21
+ * Scans the install directory and rebuilds the manifest from what is on
22
+ * disk: every component the sources offer with at least one file present is
23
+ * recorded, the first source offering a key winning.
24
+ */
25
+ export async function manifestCommand(deps = {}) {
26
+ const { glob = _glob } = deps;
27
+ const project = await openUiProject(deps);
28
+ const { projectRoot, config, target } = project;
29
+ if (!fs.existsSync(target.installDir)) {
30
+ console.error(lineError(`Install directory not found: ${c.dir(target.installDir)}`));
31
+ process.exit(1);
32
+ }
33
+ console.log();
34
+ console.log(`${sym.search} Scanning ${c.dir(config.g3nui.settings.componentsDir)}...`);
35
+ console.log();
36
+ const diskFiles = await glob("**/*", { cwd: target.installDir, nodir: true, absolute: false });
37
+ const registry = await openComponentRegistry(project, fileFlags(project));
38
+ const available = {};
39
+ for (const { key, entry } of offers(registry))
40
+ available[key] ??= entry;
41
+ registry.dispose();
42
+ const results = [];
43
+ for (const [key, meta] of Object.entries(available)) {
44
+ const presentFiles = [];
45
+ const missingFiles = [];
46
+ for (const file of meta.files) {
47
+ const matched = diskFiles.find((df) => matchesRegistryPath(df, file.path));
48
+ if (matched) {
49
+ const hash = await hashFile(path.join(target.installDir, matched));
50
+ presentFiles.push({ ...file, hash });
51
+ }
52
+ else {
53
+ missingFiles.push(file);
54
+ }
55
+ }
56
+ if (presentFiles.length > 0) {
57
+ results.push({ key, meta, presentFiles, missingFiles });
58
+ }
59
+ }
60
+ if (results.length === 0) {
61
+ console.log(chalk.dim("No registered components found on disk."));
62
+ return;
63
+ }
64
+ console.log(chalk.bold(`Found ${chalk.white(results.length)} component${results.length !== 1 ? "s" : ""} matching registry:\n`));
65
+ for (const { key, meta, presentFiles, missingFiles } of results) {
66
+ const total = meta.files.length;
67
+ const found = presentFiles.length;
68
+ const keyLabel = c.key(key.padEnd(16));
69
+ if (missingFiles.length === 0) {
70
+ console.log(` ${sym.success} ${keyLabel} ${chalk.dim(`(${found}/${total} files present)`)}`);
71
+ }
72
+ else {
73
+ const missingNames = missingFiles.map((f) => c.file(path.basename(f.path))).join(", ");
74
+ console.log(` ${sym.warn} ${keyLabel} ${chalk.yellow(`(${found}/${total} files present`)} — ${missingNames} ${chalk.yellow("missing)")}`);
75
+ }
76
+ register(target.store, key, { ...meta, files: presentFiles });
77
+ }
78
+ saveInstallManifest(target.manifest, ComponentMetaSchema);
79
+ console.log();
80
+ console.log(chalk.green("Manifest written to ") + c.file(path.relative(projectRoot, target.manifest.filePath)));
81
+ console.log();
82
+ }
83
+ //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Options } from "@g3nomaly/core/cli";
2
+ import type { ProjectDeps } from "../adapter";
3
+ export interface RemoveOptions extends InstallOptions {
4
+ }
5
+ /**
6
+ * Removes installed components and drops them from the manifest. Works from
7
+ * the manifest alone; installed dependents are offered for removal too.
8
+ */
9
+ export declare function removeCommand(names: string[], options?: RemoveOptions, deps?: ProjectDeps): Promise<void>;
10
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,aAAc,SAAQ,cAAc;CAAG;AAExD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvH"}
@@ -0,0 +1,12 @@
1
+ // packages/ui/src/cli/commands/remove.ts
2
+ import { removeFromTargets } from "@g3nomaly/core/cli";
3
+ import { UI_CONTEXT, openUiProject } from "../adapter";
4
+ /**
5
+ * Removes installed components and drops them from the manifest. Works from
6
+ * the manifest alone; installed dependents are offered for removal too.
7
+ */
8
+ export async function removeCommand(names, options = {}, deps = {}) {
9
+ const project = await openUiProject(deps);
10
+ await removeFromTargets([project.target], names, options, UI_CONTEXT);
11
+ }
12
+ //# sourceMappingURL=remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../src/cli/commands/remove.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKvD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAe,EAAE,OAAO,GAAkB,EAAE,EAAE,IAAI,GAAgB,EAAE;IACtG,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,iBAAiB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { ProjectDeps } from "../adapter";
2
+ export interface SourceAddOptions {
3
+ /** Name to register under; derived from the source when absent */
4
+ name?: string;
5
+ /** Branch or tag a git source is pinned to */
6
+ ref?: string;
7
+ }
8
+ /**
9
+ * Registers a git repository, npm package or local folder holding a built
10
+ * `dist/components.json` as a component source, after checking it offers at
11
+ * least one component.
12
+ */
13
+ export declare function sourceAddCommand(input: string, options?: SourceAddOptions, deps?: ProjectDeps): Promise<void>;
14
+ /** Lists the built-in and registered sources, with how many installed components came from each. */
15
+ export declare function sourceLsCommand(options?: {
16
+ json?: boolean;
17
+ }, deps?: ProjectDeps): Promise<void>;
18
+ /** Unregisters a source; refused for built-in sources and, unless forced, while components came from it. */
19
+ export declare function sourceRemoveCommand(name: string, options?: {
20
+ force?: boolean;
21
+ }, deps?: ProjectDeps): Promise<void>;
22
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,GAAG,CAAC,EAAG,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3H;AAED,oGAAoG;AACpG,wBAAsB,eAAe,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7G;AAED,4GAA4G;AAC5G,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhI"}
@@ -0,0 +1,23 @@
1
+ // packages/ui/src/cli/commands/source.ts
2
+ import { addSourceEntries, lsSources, removeSourceEntries } from "@g3nomaly/core/cli";
3
+ import { openUiProject, uiSourceContext } from "../adapter";
4
+ /**
5
+ * Registers a git repository, npm package or local folder holding a built
6
+ * `dist/components.json` as a component source, after checking it offers at
7
+ * least one component.
8
+ */
9
+ export async function sourceAddCommand(input, options = {}, deps = {}) {
10
+ const project = await openUiProject(deps);
11
+ await addSourceEntries([project.target], input, options, uiSourceContext(project));
12
+ }
13
+ /** Lists the built-in and registered sources, with how many installed components came from each. */
14
+ export async function sourceLsCommand(options = {}, deps = {}) {
15
+ const project = await openUiProject(deps);
16
+ lsSources([project.target], options, uiSourceContext(project));
17
+ }
18
+ /** Unregisters a source; refused for built-in sources and, unless forced, while components came from it. */
19
+ export async function sourceRemoveCommand(name, options = {}, deps = {}) {
20
+ const project = await openUiProject(deps);
21
+ removeSourceEntries([project.target], name, options, uiSourceContext(project));
22
+ }
23
+ //# sourceMappingURL=source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAU5D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,KAAa,EAAE,OAAO,GAAqB,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC1G,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,oGAAoG;AACpG,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAO,GAAuB,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC5F,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,4GAA4G;AAC5G,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,OAAO,GAAwB,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC/G,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,mBAAmB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;AACjF,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { InstallOptions } from "@g3nomaly/core/cli";
2
+ import type { ProjectDeps } from "../adapter";
3
+ export interface UpdateOptions extends InstallOptions {
4
+ }
5
+ /**
6
+ * Re-installs installed components from the source each one was installed
7
+ * from; with no names, everything installed. Files the user changed since
8
+ * install are kept unless overwritten.
9
+ */
10
+ export declare function updateCommand(names: string[], options?: UpdateOptions, deps?: ProjectDeps): Promise<void>;
11
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,aAAc,SAAQ,cAAc;CAAG;AAExD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvH"}
@@ -0,0 +1,13 @@
1
+ // packages/ui/src/cli/commands/update.ts
2
+ import { updateFromSources } from "@g3nomaly/core/cli";
3
+ import { UI_CONTEXT, fileFlags, openComponentRegistry, openUiProject } from "../adapter";
4
+ /**
5
+ * Re-installs installed components from the source each one was installed
6
+ * from; with no names, everything installed. Files the user changed since
7
+ * install are kept unless overwritten.
8
+ */
9
+ export async function updateCommand(names, options = {}, deps = {}) {
10
+ const project = await openUiProject(deps);
11
+ await updateFromSources([project.target], names, () => openComponentRegistry(project, fileFlags(project)), options, UI_CONTEXT);
12
+ }
13
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKzF;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAe,EAAE,OAAO,GAAkB,EAAE,EAAE,IAAI,GAAgB,EAAE;IACtG,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,iBAAiB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAClI,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env bun
2
+ // packages/ui/src/cli/index.ts
3
+ import { Command } from "commander";
4
+ import { readPackageMeta, warnIfOutdated } from "@g3nomaly/core/utils";
5
+ import { initCommand } from "./commands/init";
6
+ import { addCommand } from "./commands/add";
7
+ import { removeCommand } from "./commands/remove";
8
+ import { updateCommand } from "./commands/update";
9
+ import { lsCommand } from "./commands/ls";
10
+ import { manifestCommand } from "./commands/manifest";
11
+ import { sourceAddCommand, sourceLsCommand, sourceRemoveCommand } from "./commands/source";
12
+ const program = new Command()
13
+ .name("g3nui")
14
+ .description("Install components from any registered source into a project");
15
+ program
16
+ .command("init")
17
+ .description("Initialize g3nui config in this project")
18
+ .option("-f, --force", "Overwrite existing config without prompting")
19
+ .option("--install-dir <path>", "Components install directory (skips interactive prompt)")
20
+ .action(async (opts) => {
21
+ await initCommand({ force: opts.force, installDir: opts.installDir });
22
+ });
23
+ const source = program
24
+ .command("source")
25
+ .description("Register, list and unregister the sources components are installed from");
26
+ source
27
+ .command("add <source>")
28
+ .description("Register a git repository, npm package or local folder holding a built dist/components.json")
29
+ .option("--name <name>", "Name to register it under (default: derived from the source)")
30
+ .option("--ref <ref>", "Branch or tag to pin a git source to (default: its default branch)")
31
+ .action(async (input, opts) => {
32
+ await sourceAddCommand(input, { name: opts.name, ref: opts.ref });
33
+ });
34
+ source
35
+ .command("ls")
36
+ .description("List the registered sources, built-in ones first")
37
+ .option("--json", "Output as JSON")
38
+ .action(async (opts) => {
39
+ await sourceLsCommand({ json: opts.json });
40
+ });
41
+ source
42
+ .command("remove <name>")
43
+ .description("Unregister a source; built-in sources cannot be removed")
44
+ .option("-f, --force", "Unregister even when installed components came from it")
45
+ .action(async (name, opts) => {
46
+ await sourceRemoveCommand(name, { force: opts.force });
47
+ });
48
+ program
49
+ .command("add [components...]")
50
+ .description("Add components or whole groups with their dependencies; name one source with <component>@<source>")
51
+ .option("-f, --force", "Overwrite locally modified files")
52
+ .option("--debug", "Include .debug.ts files")
53
+ .option("--meta", "Include .meta.ts files")
54
+ .action(async (components, opts) => {
55
+ await addCommand(components, { force: opts.force, debug: opts.debug, meta: opts.meta });
56
+ });
57
+ program
58
+ .command("remove [components...]")
59
+ .description("Remove components from your project")
60
+ .option("-f, --force", "Remove even if files have been modified")
61
+ .action(async (components, opts) => {
62
+ await removeCommand(components, { force: opts.force });
63
+ });
64
+ program
65
+ .command("update [components...]")
66
+ .description("Re-install installed components from the source each came from")
67
+ .option("-f, --force", "Overwrite conflicting files without prompting")
68
+ .option("--dry-run", "Preview changes without writing files")
69
+ .action(async (components, opts) => {
70
+ await updateCommand(components, { force: opts.force, dryRun: opts.dryRun });
71
+ });
72
+ program
73
+ .command("ls")
74
+ .description("List the components the sources offer")
75
+ .option("--json", "Output as JSON")
76
+ .option("--source <name>", "Only this source")
77
+ .option("--installed", "List what the manifest records instead of what the sources offer")
78
+ .action(async (opts) => {
79
+ await lsCommand({ json: opts.json, source: opts.source, installed: opts.installed });
80
+ });
81
+ program
82
+ .command("manifest")
83
+ .description("Scan install directory and rebuild the manifest")
84
+ .action(async () => {
85
+ await manifestCommand();
86
+ });
87
+ const self = readPackageMeta(import.meta.url);
88
+ await warnIfOutdated(self.name, self.version, import.meta.url);
89
+ program.parseAsync();
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,+BAA+B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AAI,EAAE;IACjB,MAAM,eAAe,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEL,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9C,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/D,OAAO,CAAC,UAAU,EAAE,CAAC"}
@@ -0,0 +1,32 @@
1
+ .g3nui {
2
+ &.card {
3
+ border-radius: 0.5rem;
4
+ background-color: white;
5
+ overflow: hidden;
6
+ transition: all 0.2s ease;
7
+
8
+ /* Variants */
9
+ &--default {
10
+ border: 1px solid #e5e7eb;
11
+ }
12
+
13
+ &--outlined {
14
+ border: 2px solid #d1d5db;
15
+ }
16
+
17
+ &--elevated {
18
+ border: 1px solid #e5e7eb;
19
+ box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
20
+
21
+ &:hover {
22
+ box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
23
+ }
24
+ }
25
+
26
+ /* Dark mode support */
27
+ @media (prefers-color-scheme: dark) {
28
+ background-color: #1f2937;
29
+ border-color: #374151;
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,5 @@
1
+ // Debug utilities for Card component — development only
2
+ export const __debug = {
3
+ componentName: "Card",
4
+ version: "0.1.0",
5
+ };
@@ -0,0 +1,26 @@
1
+ // ============================================
2
+ // Card.tsx
3
+ // ============================================
4
+ import React from 'react';
5
+ import './Card.css';
6
+
7
+ export interface CardProps {
8
+ children?: React.ReactNode;
9
+ className?: string;
10
+ variant?: 'default' | 'outlined' | 'elevated';
11
+ }
12
+
13
+ export const Card = React.forwardRef<HTMLDivElement, CardProps>(
14
+ ({ children, className = '', variant = 'default' }, ref) => {
15
+ return (
16
+ <div
17
+ ref={ref}
18
+ className={`g3nui card card--${variant} ${className}`}
19
+ >
20
+ {children}
21
+ </div>
22
+ );
23
+ }
24
+ );
25
+
26
+ Card.displayName = 'Card';
@@ -0,0 +1,16 @@
1
+ .g3nui {
2
+ &.card__footer {
3
+ padding: 1rem 1.5rem;
4
+ border-top: 1px solid #e5e7eb;
5
+ background-color: #f9fafb;
6
+
7
+ &:first-child {
8
+ border-top: none;
9
+ }
10
+
11
+ @media (prefers-color-scheme: dark) {
12
+ border-color: #374151;
13
+ background-color: #111827;
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,5 @@
1
+ // Debug utilities for CardFooter component — development only
2
+ export const __debug = {
3
+ componentName: "CardFooter",
4
+ version: "0.1.0",
5
+ };
@@ -0,0 +1,25 @@
1
+ // ============================================
2
+ // CardFooter.tsx
3
+ // ============================================
4
+ import React from 'react';
5
+ import './CardFooter.css';
6
+
7
+ export interface CardFooterProps {
8
+ children?: React.ReactNode;
9
+ className?: string;
10
+ }
11
+
12
+ export const CardFooter = React.forwardRef<HTMLDivElement, CardFooterProps>(
13
+ ({ children, className = '' }, ref) => {
14
+ return (
15
+ <div
16
+ ref={ref}
17
+ className={`g3nui card__footer ${className}`}
18
+ >
19
+ {children}
20
+ </div>
21
+ );
22
+ }
23
+ );
24
+
25
+ CardFooter.displayName = 'CardFooter';
@@ -0,0 +1,14 @@
1
+ .g3nui {
2
+ &.card__header {
3
+ padding: 1.5rem;
4
+ border-bottom: 1px solid #e5e7eb;
5
+
6
+ &:last-child {
7
+ border-bottom: none;
8
+ }
9
+
10
+ @media (prefers-color-scheme: dark) {
11
+ border-color: #374151;
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ // Debug utilities for CardHeader component — development only
2
+ export const __debug = {
3
+ componentName: "CardHeader",
4
+ version: "0.1.0",
5
+ };
@@ -0,0 +1,25 @@
1
+ // ============================================
2
+ // CardHeader.tsx
3
+ // ============================================
4
+ import React from 'react';
5
+ import './CardHeader.css';
6
+
7
+ export interface CardHeaderProps {
8
+ children?: React.ReactNode;
9
+ className?: string;
10
+ }
11
+
12
+ export const CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(
13
+ ({ children, className = '' }, ref) => {
14
+ return (
15
+ <div
16
+ ref={ref}
17
+ className={`g3nui card__header ${className}`}
18
+ >
19
+ {children}
20
+ </div>
21
+ );
22
+ }
23
+ );
24
+
25
+ CardHeader.displayName = 'CardHeader';
@@ -0,0 +1,13 @@
1
+ import type { PackagedComponent } from "@g3nomaly/ui/types";
2
+
3
+ export default {
4
+ name: "Card",
5
+ description: "A flexible card component.",
6
+ category: "basic",
7
+ files: [
8
+ { path: "basic/Card.tsx", type: "component" },
9
+ { path: "basic/Card.css", type: "style" },
10
+ { path: "basic/Card.debug.ts", type: "util" },
11
+ ],
12
+ registryDependencies: [],
13
+ } satisfies PackagedComponent;
@@ -0,0 +1,13 @@
1
+ import type { PackagedComponent } from "@g3nomaly/ui/types";
2
+
3
+ export default {
4
+ name: "CardFooter",
5
+ description: "Footer section for Card component.",
6
+ category: "basic",
7
+ files: [
8
+ { path: "basic/CardFooter.tsx", type: "component" },
9
+ { path: "basic/CardFooter.css", type: "style" },
10
+ { path: "basic/CardFooter.debug.ts", type: "util" },
11
+ ],
12
+ registryDependencies: ["card"],
13
+ } satisfies PackagedComponent;
@@ -0,0 +1,13 @@
1
+ import type { PackagedComponent } from "@g3nomaly/ui/types";
2
+
3
+ export default {
4
+ name: "CardHeader",
5
+ description: "Header section for Card component.",
6
+ category: "basic",
7
+ files: [
8
+ { path: "basic/CardHeader.tsx", type: "component" },
9
+ { path: "basic/CardHeader.css", type: "style" },
10
+ { path: "basic/CardHeader.debug.ts", type: "util" },
11
+ ],
12
+ registryDependencies: ["card"],
13
+ } satisfies PackagedComponent;
@@ -0,0 +1,34 @@
1
+ .g3nui {
2
+ &.button {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ padding: 0.5rem 1rem;
7
+ border-radius: 0.375rem;
8
+ font-weight: 500;
9
+ cursor: pointer;
10
+ transition: all 0.15s ease;
11
+ border: none;
12
+
13
+ &--primary {
14
+ background-color: #2563eb;
15
+ color: white;
16
+
17
+ &:hover { background-color: #1d4ed8; }
18
+ }
19
+
20
+ &--secondary {
21
+ background-color: #e5e7eb;
22
+ color: #111827;
23
+
24
+ &:hover { background-color: #d1d5db; }
25
+ }
26
+
27
+ &--ghost {
28
+ background-color: transparent;
29
+ color: #374151;
30
+
31
+ &:hover { background-color: #f3f4f6; }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,5 @@
1
+ // Debug utilities for Button component — development only
2
+ export const __debug = {
3
+ componentName: "Button",
4
+ version: "0.1.0",
5
+ };
@@ -0,0 +1,25 @@
1
+ // ============================================
2
+ // Button.tsx
3
+ // ============================================
4
+ import React from 'react';
5
+ import './Button.css';
6
+
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
8
+ variant?: 'primary' | 'secondary' | 'ghost';
9
+ }
10
+
11
+ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
12
+ ({ children, className = '', variant = 'primary', ...props }, ref) => {
13
+ return (
14
+ <button
15
+ ref={ref}
16
+ className={`g3nui button button--${variant} ${className}`}
17
+ {...props}
18
+ >
19
+ {children}
20
+ </button>
21
+ );
22
+ }
23
+ );
24
+
25
+ Button.displayName = 'Button';
@@ -0,0 +1,13 @@
1
+ import type { PackagedComponent } from "@g3nomaly/ui/types";
2
+
3
+ export default {
4
+ name: "Button",
5
+ description: "A flexible button component.",
6
+ category: "input",
7
+ files: [
8
+ { path: "input/Button.tsx", type: "component" },
9
+ { path: "input/Button.css", type: "style" },
10
+ { path: "input/Button.debug.ts", type: "util" },
11
+ ],
12
+ registryDependencies: [],
13
+ } satisfies PackagedComponent;