@g3nomaly/ui 0.3.1 → 0.3.3
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/README.md +123 -0
- package/dist/cli/adapter.d.ts +48 -10
- package/dist/cli/adapter.d.ts.map +1 -1
- package/dist/cli/adapter.js +34 -7
- package/dist/cli/adapter.js.map +1 -1
- package/dist/cli/commands/add.d.ts +11 -3
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +5 -1
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/init.d.ts +25 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +23 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/ls.d.ts +12 -3
- package/dist/cli/commands/ls.d.ts.map +1 -1
- package/dist/cli/commands/ls.js +6 -1
- package/dist/cli/commands/ls.js.map +1 -1
- package/dist/cli/commands/manifest.d.ts +8 -1
- package/dist/cli/commands/manifest.d.ts.map +1 -1
- package/dist/cli/commands/manifest.js +15 -3
- package/dist/cli/commands/manifest.js.map +1 -1
- package/dist/cli/commands/remove.d.ts +6 -1
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/remove.js +5 -1
- package/dist/cli/commands/remove.js.map +1 -1
- package/dist/cli/commands/source.d.ts +24 -5
- package/dist/cli/commands/source.d.ts.map +1 -1
- package/dist/cli/commands/source.js +18 -3
- package/dist/cli/commands/source.js.map +1 -1
- package/dist/cli/commands/update.d.ts +6 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +5 -1
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/components/basic/Card.debug.ts +1 -1
- package/dist/components/basic/Card.tsx +8 -3
- package/dist/components/basic/CardFooter.debug.ts +1 -1
- package/dist/components/basic/CardFooter.tsx +7 -3
- package/dist/components/basic/CardHeader.debug.ts +1 -1
- package/dist/components/basic/CardHeader.tsx +7 -3
- package/dist/components/basic/card.meta.ts +1 -0
- package/dist/components/basic/cardfooter.meta.ts +1 -0
- package/dist/components/basic/cardheader.meta.ts +1 -0
- package/dist/components/input/Button.debug.ts +1 -1
- package/dist/components/input/Button.tsx +6 -3
- package/dist/components/input/button.meta.ts +1 -0
- package/dist/components.json +32 -32
- package/dist/registry/adapters/shadcn.adapter.d.ts +14 -8
- package/dist/registry/adapters/shadcn.adapter.d.ts.map +1 -1
- package/dist/registry/adapters/shadcn.adapter.js +23 -7
- package/dist/registry/adapters/shadcn.adapter.js.map +1 -1
- package/dist/registry/componentsJson.d.ts +6 -5
- package/dist/registry/componentsJson.d.ts.map +1 -1
- package/dist/registry/componentsJson.js +6 -5
- package/dist/registry/componentsJson.js.map +1 -1
- package/dist/registry/manifest.d.ts +5 -3
- package/dist/registry/manifest.d.ts.map +1 -1
- package/dist/registry/manifest.js +17 -5
- package/dist/registry/manifest.js.map +1 -1
- package/dist/registry/readSource.d.ts +23 -6
- package/dist/registry/readSource.d.ts.map +1 -1
- package/dist/registry/readSource.js +17 -3
- package/dist/registry/readSource.js.map +1 -1
- package/dist/registry/types.d.ts +16 -4
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js +10 -6
- package/dist/registry/types.js.map +1 -1
- package/dist/sources/builtins.d.ts +1 -1
- package/dist/sources/builtins.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/cli/commands/manifest.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAA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GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAChH,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { InstallOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps } from "../adapter";
|
|
3
|
+
/** Options of `removeCommand`: the core install options, unchanged. */
|
|
3
4
|
export interface RemoveOptions extends InstallOptions {
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
|
-
* Removes installed components and drops them from the manifest. Works from
|
|
7
|
+
* @brief Removes installed components and drops them from the manifest. Works from
|
|
7
8
|
* the manifest alone; installed dependents are offered for removal too.
|
|
9
|
+
*
|
|
10
|
+
* @param names - Installed component keys to remove.
|
|
11
|
+
* @param options - Force flag.
|
|
12
|
+
* @param deps - Test injection.
|
|
8
13
|
*/
|
|
9
14
|
export declare function removeCommand(names: string[], options?: RemoveOptions, deps?: ProjectDeps): Promise<void>;
|
|
10
15
|
//# sourceMappingURL=remove.d.ts.map
|
|
@@ -1 +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
|
|
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,uEAAuE;AACvE,MAAM,WAAW,aAAc,SAAQ,cAAc;CAAG;AAExD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvH"}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
import { removeFromTargets } from "@g3nomaly/core/cli";
|
|
3
3
|
import { UI_CONTEXT, openUiProject } from "../adapter";
|
|
4
4
|
/**
|
|
5
|
-
* Removes installed components and drops them from the manifest. Works from
|
|
5
|
+
* @brief Removes installed components and drops them from the manifest. Works from
|
|
6
6
|
* the manifest alone; installed dependents are offered for removal too.
|
|
7
|
+
*
|
|
8
|
+
* @param names - Installed component keys to remove.
|
|
9
|
+
* @param options - Force flag.
|
|
10
|
+
* @param deps - Test injection.
|
|
7
11
|
*/
|
|
8
12
|
export async function removeCommand(names, options = {}, deps = {}) {
|
|
9
13
|
const project = await openUiProject(deps);
|
|
@@ -1 +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;
|
|
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;AAMvD;;;;;;;GAOG;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"}
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
import type { ProjectDeps } from "../adapter";
|
|
2
|
+
/**
|
|
3
|
+
* @brief Options of `sourceAddCommand`.
|
|
4
|
+
*
|
|
5
|
+
* @property name - Name to register under; derived from the source when absent.
|
|
6
|
+
* @property ref - Branch or tag a git source is pinned to.
|
|
7
|
+
*/
|
|
2
8
|
export interface SourceAddOptions {
|
|
3
|
-
/** Name to register under; derived from the source when absent */
|
|
4
9
|
name?: string;
|
|
5
|
-
/** Branch or tag a git source is pinned to */
|
|
6
10
|
ref?: string;
|
|
7
11
|
}
|
|
8
12
|
/**
|
|
9
|
-
* Registers a git repository, npm package or local folder holding a built
|
|
13
|
+
* @brief Registers a git repository, npm package or local folder holding a built
|
|
10
14
|
* `dist/components.json` as a component source, after checking it offers at
|
|
11
15
|
* least one component.
|
|
16
|
+
*
|
|
17
|
+
* @param input - The source as typed, e.g. `owner/repo`, `npm:@scope/ui` or `./dist`.
|
|
18
|
+
* @param options - Name and ref of the source.
|
|
19
|
+
* @param deps - Test injection.
|
|
12
20
|
*/
|
|
13
21
|
export declare function sourceAddCommand(input: string, options?: SourceAddOptions, deps?: ProjectDeps): Promise<void>;
|
|
14
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @brief Lists the built-in and registered sources, with how many installed components came from each.
|
|
24
|
+
*
|
|
25
|
+
* @param options - Output format.
|
|
26
|
+
* @param deps - Test injection.
|
|
27
|
+
*/
|
|
15
28
|
export declare function sourceLsCommand(options?: {
|
|
16
29
|
json?: boolean;
|
|
17
30
|
}, deps?: ProjectDeps): Promise<void>;
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @brief Unregisters a source; refused for built-in sources and, unless forced, while components came from it.
|
|
33
|
+
*
|
|
34
|
+
* @param name - Name of the source to unregister, as `source ls` prints it.
|
|
35
|
+
* @param options - Force flag.
|
|
36
|
+
* @param deps - Test injection.
|
|
37
|
+
*/
|
|
19
38
|
export declare function sourceRemoveCommand(name: string, options?: {
|
|
20
39
|
force?: boolean;
|
|
21
40
|
}, deps?: ProjectDeps): Promise<void>;
|
|
@@ -1 +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,
|
|
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;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAG,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3H;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7G;AAED;;;;;;GAMG;AACH,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"}
|
|
@@ -2,20 +2,35 @@
|
|
|
2
2
|
import { addSourceEntries, lsSources, removeSourceEntries } from "@g3nomaly/core/cli";
|
|
3
3
|
import { openUiProject, uiSourceContext } from "../adapter";
|
|
4
4
|
/**
|
|
5
|
-
* Registers a git repository, npm package or local folder holding a built
|
|
5
|
+
* @brief Registers a git repository, npm package or local folder holding a built
|
|
6
6
|
* `dist/components.json` as a component source, after checking it offers at
|
|
7
7
|
* least one component.
|
|
8
|
+
*
|
|
9
|
+
* @param input - The source as typed, e.g. `owner/repo`, `npm:@scope/ui` or `./dist`.
|
|
10
|
+
* @param options - Name and ref of the source.
|
|
11
|
+
* @param deps - Test injection.
|
|
8
12
|
*/
|
|
9
13
|
export async function sourceAddCommand(input, options = {}, deps = {}) {
|
|
10
14
|
const project = await openUiProject(deps);
|
|
11
15
|
await addSourceEntries([project.target], input, options, uiSourceContext(project));
|
|
12
16
|
}
|
|
13
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @brief Lists the built-in and registered sources, with how many installed components came from each.
|
|
19
|
+
*
|
|
20
|
+
* @param options - Output format.
|
|
21
|
+
* @param deps - Test injection.
|
|
22
|
+
*/
|
|
14
23
|
export async function sourceLsCommand(options = {}, deps = {}) {
|
|
15
24
|
const project = await openUiProject(deps);
|
|
16
25
|
lsSources([project.target], options, uiSourceContext(project));
|
|
17
26
|
}
|
|
18
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @brief Unregisters a source; refused for built-in sources and, unless forced, while components came from it.
|
|
29
|
+
*
|
|
30
|
+
* @param name - Name of the source to unregister, as `source ls` prints it.
|
|
31
|
+
* @param options - Force flag.
|
|
32
|
+
* @param deps - Test injection.
|
|
33
|
+
*/
|
|
19
34
|
export async function sourceRemoveCommand(name, options = {}, deps = {}) {
|
|
20
35
|
const project = await openUiProject(deps);
|
|
21
36
|
removeSourceEntries([project.target], name, options, uiSourceContext(project));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/cli/commands/source.ts"],"names":[],"mappings":"AAAA,yCAAyC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AAe,CAAC,OAAO,CAAC,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { InstallOptions } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ProjectDeps } from "../adapter";
|
|
3
|
+
/** Options of `updateCommand`: the core install options, unchanged. */
|
|
3
4
|
export interface UpdateOptions extends InstallOptions {
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
|
-
* Re-installs installed components from the source each one was installed
|
|
7
|
+
* @brief Re-installs installed components from the source each one was installed
|
|
7
8
|
* from; with no names, everything installed. Files the user changed since
|
|
8
9
|
* install are kept unless overwritten.
|
|
10
|
+
*
|
|
11
|
+
* @param names - Installed component keys to update; empty for everything installed.
|
|
12
|
+
* @param options - Force and dry-run flags.
|
|
13
|
+
* @param deps - Test injection.
|
|
9
14
|
*/
|
|
10
15
|
export declare function updateCommand(names: string[], options?: UpdateOptions, deps?: ProjectDeps): Promise<void>;
|
|
11
16
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +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
|
|
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,uEAAuE;AACvE,MAAM,WAAW,aAAc,SAAQ,cAAc;CAAG;AAExD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,aAAkB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvH"}
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
import { updateFromSources } from "@g3nomaly/core/cli";
|
|
3
3
|
import { UI_CONTEXT, fileFlags, openComponentRegistry, openUiProject } from "../adapter";
|
|
4
4
|
/**
|
|
5
|
-
* Re-installs installed components from the source each one was installed
|
|
5
|
+
* @brief Re-installs installed components from the source each one was installed
|
|
6
6
|
* from; with no names, everything installed. Files the user changed since
|
|
7
7
|
* install are kept unless overwritten.
|
|
8
|
+
*
|
|
9
|
+
* @param names - Installed component keys to update; empty for everything installed.
|
|
10
|
+
* @param options - Force and dry-run flags.
|
|
11
|
+
* @param deps - Test injection.
|
|
8
12
|
*/
|
|
9
13
|
export async function updateCommand(names, options = {}, deps = {}) {
|
|
10
14
|
const project = await openUiProject(deps);
|
|
@@ -1 +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;
|
|
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;AAMzF;;;;;;;;GAQG;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"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Card.tsx
|
|
3
|
-
// ============================================
|
|
1
|
+
// packages/ui/src/components/basic/Card.tsx
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import './Card.css';
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @brief Props of Card: the content, the extra classes and the look.
|
|
7
|
+
*
|
|
8
|
+
* @property children - Content rendered inside the card.
|
|
9
|
+
* @property className - Extra classes appended to the root element.
|
|
10
|
+
* @property variant - Look of the card: `default`, `outlined` or `elevated`, set as the `card--<variant>` class.
|
|
11
|
+
*/
|
|
7
12
|
export interface CardProps {
|
|
8
13
|
children?: React.ReactNode;
|
|
9
14
|
className?: string;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CardFooter.tsx
|
|
3
|
-
// ============================================
|
|
1
|
+
// packages/ui/src/components/basic/CardFooter.tsx
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import './CardFooter.css';
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @brief Props of CardFooter: the content and the extra classes.
|
|
7
|
+
*
|
|
8
|
+
* @property children - Content rendered inside the footer.
|
|
9
|
+
* @property className - Extra classes appended to the root element.
|
|
10
|
+
*/
|
|
7
11
|
export interface CardFooterProps {
|
|
8
12
|
children?: React.ReactNode;
|
|
9
13
|
className?: string;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
//
|
|
2
|
-
// CardHeader.tsx
|
|
3
|
-
// ============================================
|
|
1
|
+
// packages/ui/src/components/basic/CardHeader.tsx
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import './CardHeader.css';
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @brief Props of CardHeader: the content and the extra classes.
|
|
7
|
+
*
|
|
8
|
+
* @property children - Content rendered inside the header.
|
|
9
|
+
* @property className - Extra classes appended to the root element.
|
|
10
|
+
*/
|
|
7
11
|
export interface CardHeaderProps {
|
|
8
12
|
children?: React.ReactNode;
|
|
9
13
|
className?: string;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Button.tsx
|
|
3
|
-
// ============================================
|
|
1
|
+
// packages/ui/src/components/input/Button.tsx
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import './Button.css';
|
|
6
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @brief Props of Button: the native button attributes plus its look.
|
|
7
|
+
*
|
|
8
|
+
* @property variant - Look of the button: `primary` (default), `secondary` or `ghost`, set as the `button--<variant>` class.
|
|
9
|
+
*/
|
|
7
10
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
11
|
variant?: 'primary' | 'secondary' | 'ghost';
|
|
9
12
|
}
|
package/dist/components.json
CHANGED
|
@@ -8,29 +8,29 @@
|
|
|
8
8
|
{
|
|
9
9
|
"path": "input/Button.tsx",
|
|
10
10
|
"type": "component",
|
|
11
|
-
"version": "0.3.
|
|
12
|
-
"hash": "
|
|
11
|
+
"version": "0.3.3",
|
|
12
|
+
"hash": "4911cf7ade40890c2bc1ee9eba65b9297f33cc0c1287c550701780295ed16086"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "input/Button.css",
|
|
16
16
|
"type": "style",
|
|
17
|
-
"version": "0.3.
|
|
17
|
+
"version": "0.3.3",
|
|
18
18
|
"hash": "eaff21a3e7afa0e48210f146e6558df6997ff31fa8d239031ea110914d5ff208"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"path": "input/Button.debug.ts",
|
|
22
22
|
"type": "util",
|
|
23
|
-
"version": "0.3.
|
|
24
|
-
"hash": "
|
|
23
|
+
"version": "0.3.3",
|
|
24
|
+
"hash": "f7be8d51584045a3dd712741922c9009fd1879db06915fcf1f11b9b4152d1441"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"path": "input/button.meta.ts",
|
|
28
28
|
"type": "meta",
|
|
29
|
-
"version": "0.3.
|
|
30
|
-
"hash": "
|
|
29
|
+
"version": "0.3.3",
|
|
30
|
+
"hash": "51294b1c334186be2378259245c3a444b509328785f7ceee6d555ccc99ad05c6"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
|
-
"version": "0.3.
|
|
33
|
+
"version": "0.3.3"
|
|
34
34
|
},
|
|
35
35
|
"card": {
|
|
36
36
|
"name": "Card",
|
|
@@ -41,29 +41,29 @@
|
|
|
41
41
|
{
|
|
42
42
|
"path": "basic/Card.tsx",
|
|
43
43
|
"type": "component",
|
|
44
|
-
"version": "0.3.
|
|
45
|
-
"hash": "
|
|
44
|
+
"version": "0.3.3",
|
|
45
|
+
"hash": "2602d00902b38c45d4a6409febe47bdb9e79657d83d7da3bc4dff3c7a3ebea6d"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"path": "basic/Card.css",
|
|
49
49
|
"type": "style",
|
|
50
|
-
"version": "0.3.
|
|
50
|
+
"version": "0.3.3",
|
|
51
51
|
"hash": "5315468962112167dd37b4893e7d38404c19a7f2ba76bf51372bc30d67d5dc42"
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"path": "basic/Card.debug.ts",
|
|
55
55
|
"type": "util",
|
|
56
|
-
"version": "0.3.
|
|
57
|
-
"hash": "
|
|
56
|
+
"version": "0.3.3",
|
|
57
|
+
"hash": "acecf600200a49337f65714f0b2b4efc5325446b11fa49d5360f1aee88f1023f"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"path": "basic/card.meta.ts",
|
|
61
61
|
"type": "meta",
|
|
62
|
-
"version": "0.3.
|
|
63
|
-
"hash": "
|
|
62
|
+
"version": "0.3.3",
|
|
63
|
+
"hash": "4ffcfd020601e222f26961ac595f478d6e8907ad894cdba992ea2b34a8ba6b92"
|
|
64
64
|
}
|
|
65
65
|
],
|
|
66
|
-
"version": "0.3.
|
|
66
|
+
"version": "0.3.3"
|
|
67
67
|
},
|
|
68
68
|
"cardfooter": {
|
|
69
69
|
"name": "CardFooter",
|
|
@@ -76,29 +76,29 @@
|
|
|
76
76
|
{
|
|
77
77
|
"path": "basic/CardFooter.tsx",
|
|
78
78
|
"type": "component",
|
|
79
|
-
"version": "0.3.
|
|
80
|
-
"hash": "
|
|
79
|
+
"version": "0.3.3",
|
|
80
|
+
"hash": "bfd4e73de6b16b529c22ca69e4661c30bd4be1237a5972eefce45cd6deb7dff5"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"path": "basic/CardFooter.css",
|
|
84
84
|
"type": "style",
|
|
85
|
-
"version": "0.3.
|
|
85
|
+
"version": "0.3.3",
|
|
86
86
|
"hash": "751573c89dc46e83c9f240e58895f42652399f0519907c058568b14aaa52cb4d"
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"path": "basic/CardFooter.debug.ts",
|
|
90
90
|
"type": "util",
|
|
91
|
-
"version": "0.3.
|
|
92
|
-
"hash": "
|
|
91
|
+
"version": "0.3.3",
|
|
92
|
+
"hash": "3226f24e154a19daf4f0d9828245ff0cdf7b2e8bb75f10d785a33c1234578484"
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"path": "basic/cardfooter.meta.ts",
|
|
96
96
|
"type": "meta",
|
|
97
|
-
"version": "0.3.
|
|
98
|
-
"hash": "
|
|
97
|
+
"version": "0.3.3",
|
|
98
|
+
"hash": "1e9d82552826862ca25f13e71f80301b61fa8b9c3c8d0dc3ed51038db5b0f94c"
|
|
99
99
|
}
|
|
100
100
|
],
|
|
101
|
-
"version": "0.3.
|
|
101
|
+
"version": "0.3.3"
|
|
102
102
|
},
|
|
103
103
|
"cardheader": {
|
|
104
104
|
"name": "CardHeader",
|
|
@@ -111,28 +111,28 @@
|
|
|
111
111
|
{
|
|
112
112
|
"path": "basic/CardHeader.tsx",
|
|
113
113
|
"type": "component",
|
|
114
|
-
"version": "0.3.
|
|
115
|
-
"hash": "
|
|
114
|
+
"version": "0.3.3",
|
|
115
|
+
"hash": "fac021c0f55b4c115b0b9fcc3e6f452aea7403e99b4b7a1287861de5653c9eb5"
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
"path": "basic/CardHeader.css",
|
|
119
119
|
"type": "style",
|
|
120
|
-
"version": "0.3.
|
|
120
|
+
"version": "0.3.3",
|
|
121
121
|
"hash": "e36cf86636d2e7619dd69725faaedac9604a9605be11c0e2a6aa3663db8c3b53"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
"path": "basic/CardHeader.debug.ts",
|
|
125
125
|
"type": "util",
|
|
126
|
-
"version": "0.3.
|
|
127
|
-
"hash": "
|
|
126
|
+
"version": "0.3.3",
|
|
127
|
+
"hash": "e5879c6caebc2d14ffaf49b8d630a32a23c1c5a1c3877288d7ea4333e333c9e7"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"path": "basic/cardheader.meta.ts",
|
|
131
131
|
"type": "meta",
|
|
132
|
-
"version": "0.3.
|
|
133
|
-
"hash": "
|
|
132
|
+
"version": "0.3.3",
|
|
133
|
+
"hash": "46d85bb6e00d8fa518548b89a89deb53c2e27304fc5f808f7e4cd5472a51871a"
|
|
134
134
|
}
|
|
135
135
|
],
|
|
136
|
-
"version": "0.3.
|
|
136
|
+
"version": "0.3.3"
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { EntrySource } from "@g3nomaly/core/cli";
|
|
2
2
|
import type { ComponentFileType, ComponentMeta } from "../types";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @brief A single file returned by fetchShadcnComponentFiles().
|
|
5
|
+
*
|
|
6
|
+
* @property path - File path relative to the user's installDir, e.g. "shadcn/button.tsx".
|
|
7
|
+
* @property type - g3nui `ComponentFileType` the shadcn file type maps to.
|
|
8
|
+
*/
|
|
4
9
|
export interface ShadcnFileContent {
|
|
5
|
-
/** File path relative to the user's installDir, e.g. "shadcn/button.tsx" */
|
|
6
10
|
path: string;
|
|
7
|
-
/** Full source code content */
|
|
8
11
|
content: string;
|
|
9
|
-
/** Mapped to g3nui ComponentFileType */
|
|
10
12
|
type: ComponentFileType;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
|
-
* Fetches the shadcn component index as entries keyed `@shadcn/<name>`,
|
|
15
|
+
* @brief Fetches the shadcn component index as entries keyed `@shadcn/<name>`,
|
|
14
16
|
* recorded under the `shadcn` source. Hashes are absent until install.
|
|
15
17
|
*
|
|
16
18
|
* @returns no entries and a warning when shadcn is not installed or the index cannot be fetched
|
|
@@ -20,16 +22,20 @@ export declare function readShadcnEntries(): Promise<{
|
|
|
20
22
|
warnings: string[];
|
|
21
23
|
}>;
|
|
22
24
|
/**
|
|
23
|
-
* Fetches the file contents of one shadcn component through the installed
|
|
25
|
+
* @brief Fetches the file contents of one shadcn component through the installed
|
|
24
26
|
* shadcn package.
|
|
25
27
|
*
|
|
26
|
-
* @param name - Component name without the `@shadcn/` prefix, e.g. `button
|
|
28
|
+
* @param name - Component name without the `@shadcn/` prefix, e.g. `button`.
|
|
29
|
+
* @returns Files with their contents; empty when the component is unknown or lists no files.
|
|
27
30
|
*/
|
|
28
31
|
export declare function fetchShadcnComponentFiles(name: string): Promise<ShadcnFileContent[]>;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
33
|
+
* @brief Entry source that fetches shadcn components, one request per component,
|
|
31
34
|
* and writes each file from its content; entries of any other source go to
|
|
32
35
|
* `fallback`.
|
|
36
|
+
*
|
|
37
|
+
* @param fallback - Entry source for every entry of another source.
|
|
38
|
+
* @returns Entry source that serves shadcn entries and delegates the rest to `fallback`.
|
|
33
39
|
*/
|
|
34
40
|
export declare function shadcnFileSource(fallback: EntrySource): EntrySource;
|
|
35
41
|
//# sourceMappingURL=shadcn.adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadcn.adapter.d.ts","sourceRoot":"","sources":["../../../src/registry/adapters/shadcn.adapter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAMjE
|
|
1
|
+
{"version":3,"file":"shadcn.adapter.d.ts","sourceRoot":"","sources":["../../../src/registry/adapters/shadcn.adapter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAMjE;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAK,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAK,iBAAiB,CAAC;CAC5B;AAgED;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA6B7G;AAED;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAW1F;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,WAAW,GAAG,WAAW,CAanE"}
|
|
@@ -5,11 +5,21 @@ import { OriginEntrySchema } from "@g3nomaly/core/installer";
|
|
|
5
5
|
import { SHADCN_SOURCE } from "../manifest";
|
|
6
6
|
const require = createRequire(import.meta.url);
|
|
7
7
|
const SHADCN_INDEX_URL = "https://ui.shadcn.com/r/index.json";
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @brief Root of the installed shadcn package.
|
|
10
|
+
*
|
|
11
|
+
* @returns Absolute folder of the package.
|
|
12
|
+
* @throws {Error} When shadcn is not installed.
|
|
13
|
+
*/
|
|
9
14
|
function resolveShadcnRoot() {
|
|
10
15
|
return path.dirname(require.resolve("shadcn/package.json"));
|
|
11
16
|
}
|
|
12
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @brief The g3nui file type for a shadcn registry file type.
|
|
19
|
+
*
|
|
20
|
+
* @param shadcnType - shadcn registry file type, e.g. `registry:ui`.
|
|
21
|
+
* @returns The g3nui `ComponentFileType`; `component` for any type not listed.
|
|
22
|
+
*/
|
|
13
23
|
function mapShadcnType(shadcnType) {
|
|
14
24
|
if (shadcnType === "registry:ui")
|
|
15
25
|
return "component";
|
|
@@ -22,16 +32,18 @@ function mapShadcnType(shadcnType) {
|
|
|
22
32
|
return "component";
|
|
23
33
|
}
|
|
24
34
|
/**
|
|
25
|
-
* Every shadcn file lands in `shadcn/<filename>`, whatever folder shadcn
|
|
35
|
+
* @brief Every shadcn file lands in `shadcn/<filename>`, whatever folder shadcn
|
|
26
36
|
* keeps it in: `ui/button.tsx` and `registry/new-york-v4/ui/button.tsx` both
|
|
27
37
|
* become `shadcn/button.tsx`.
|
|
38
|
+
*
|
|
39
|
+
* @param fullPath - Path as shadcn lists it, e.g. `registry/new-york-v4/ui/button.tsx`.
|
|
28
40
|
*/
|
|
29
41
|
function normalizeFilePath(fullPath) {
|
|
30
42
|
const parts = fullPath.split("/");
|
|
31
43
|
return `shadcn/${parts[parts.length - 1]}`;
|
|
32
44
|
}
|
|
33
45
|
/**
|
|
34
|
-
* Fetches the shadcn component index as entries keyed `@shadcn/<name>`,
|
|
46
|
+
* @brief Fetches the shadcn component index as entries keyed `@shadcn/<name>`,
|
|
35
47
|
* recorded under the `shadcn` source. Hashes are absent until install.
|
|
36
48
|
*
|
|
37
49
|
* @returns no entries and a warning when shadcn is not installed or the index cannot be fetched
|
|
@@ -69,10 +81,11 @@ export async function readShadcnEntries() {
|
|
|
69
81
|
return { entries, warnings: [] };
|
|
70
82
|
}
|
|
71
83
|
/**
|
|
72
|
-
* Fetches the file contents of one shadcn component through the installed
|
|
84
|
+
* @brief Fetches the file contents of one shadcn component through the installed
|
|
73
85
|
* shadcn package.
|
|
74
86
|
*
|
|
75
|
-
* @param name - Component name without the `@shadcn/` prefix, e.g. `button
|
|
87
|
+
* @param name - Component name without the `@shadcn/` prefix, e.g. `button`.
|
|
88
|
+
* @returns Files with their contents; empty when the component is unknown or lists no files.
|
|
76
89
|
*/
|
|
77
90
|
export async function fetchShadcnComponentFiles(name) {
|
|
78
91
|
// Imported on use, so only commands that install shadcn components need the package.
|
|
@@ -86,9 +99,12 @@ export async function fetchShadcnComponentFiles(name) {
|
|
|
86
99
|
.map((f) => ({ path: normalizeFilePath(f.path), content: f.content, type: mapShadcnType(f.type) }));
|
|
87
100
|
}
|
|
88
101
|
/**
|
|
89
|
-
*
|
|
102
|
+
* @brief Entry source that fetches shadcn components, one request per component,
|
|
90
103
|
* and writes each file from its content; entries of any other source go to
|
|
91
104
|
* `fallback`.
|
|
105
|
+
*
|
|
106
|
+
* @param fallback - Entry source for every entry of another source.
|
|
107
|
+
* @returns Entry source that serves shadcn entries and delegates the rest to `fallback`.
|
|
92
108
|
*/
|
|
93
109
|
export function shadcnFileSource(fallback) {
|
|
94
110
|
return async (entry) => {
|