@g3nomaly/ui 0.3.2 → 0.3.4

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 (125) hide show
  1. package/README.md +145 -0
  2. package/dist/cli/adapter.d.ts +14 -6
  3. package/dist/cli/adapter.d.ts.map +1 -1
  4. package/dist/cli/adapter.js +23 -18
  5. package/dist/cli/adapter.js.map +1 -1
  6. package/dist/cli/afterInstall.d.ts +26 -0
  7. package/dist/cli/afterInstall.d.ts.map +1 -0
  8. package/dist/cli/afterInstall.js +54 -0
  9. package/dist/cli/afterInstall.js.map +1 -0
  10. package/dist/cli/commands/add.d.ts +8 -2
  11. package/dist/cli/commands/add.d.ts.map +1 -1
  12. package/dist/cli/commands/add.js +9 -4
  13. package/dist/cli/commands/add.js.map +1 -1
  14. package/dist/cli/commands/index.d.ts +1 -0
  15. package/dist/cli/commands/index.d.ts.map +1 -1
  16. package/dist/cli/commands/index.js +1 -0
  17. package/dist/cli/commands/index.js.map +1 -1
  18. package/dist/cli/commands/init.d.ts +16 -5
  19. package/dist/cli/commands/init.d.ts.map +1 -1
  20. package/dist/cli/commands/init.js +59 -13
  21. package/dist/cli/commands/init.js.map +1 -1
  22. package/dist/cli/commands/ls.d.ts +1 -1
  23. package/dist/cli/commands/manifest.js +1 -1
  24. package/dist/cli/commands/manifest.js.map +1 -1
  25. package/dist/cli/commands/source.d.ts +2 -1
  26. package/dist/cli/commands/source.d.ts.map +1 -1
  27. package/dist/cli/commands/source.js +29 -2
  28. package/dist/cli/commands/source.js.map +1 -1
  29. package/dist/cli/commands/sourceInit.d.ts +9 -0
  30. package/dist/cli/commands/sourceInit.d.ts.map +1 -0
  31. package/dist/cli/commands/sourceInit.js +77 -0
  32. package/dist/cli/commands/sourceInit.js.map +1 -0
  33. package/dist/cli/commands/update.d.ts +10 -3
  34. package/dist/cli/commands/update.d.ts.map +1 -1
  35. package/dist/cli/commands/update.js +9 -4
  36. package/dist/cli/commands/update.js.map +1 -1
  37. package/dist/cli/index.js +15 -5
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/cli/npmDependencies.d.ts +11 -0
  40. package/dist/cli/npmDependencies.d.ts.map +1 -0
  41. package/dist/cli/npmDependencies.js +67 -0
  42. package/dist/cli/npmDependencies.js.map +1 -0
  43. package/dist/cli/packageFiles.d.ts +15 -0
  44. package/dist/cli/packageFiles.d.ts.map +1 -0
  45. package/dist/cli/packageFiles.js +54 -0
  46. package/dist/cli/packageFiles.js.map +1 -0
  47. package/dist/cli/themeTokens.d.ts +12 -0
  48. package/dist/cli/themeTokens.d.ts.map +1 -0
  49. package/dist/cli/themeTokens.js +52 -0
  50. package/dist/cli/themeTokens.js.map +1 -0
  51. package/dist/packages/dependencies.d.ts +44 -0
  52. package/dist/packages/dependencies.d.ts.map +1 -0
  53. package/dist/packages/dependencies.js +60 -0
  54. package/dist/packages/dependencies.js.map +1 -0
  55. package/dist/packages/install.d.ts +10 -0
  56. package/dist/packages/install.d.ts.map +1 -0
  57. package/dist/packages/install.js +21 -0
  58. package/dist/packages/install.js.map +1 -0
  59. package/dist/registry/adapters/shadcn.adapter.d.ts +32 -7
  60. package/dist/registry/adapters/shadcn.adapter.d.ts.map +1 -1
  61. package/dist/registry/adapters/shadcn.adapter.js +75 -20
  62. package/dist/registry/adapters/shadcn.adapter.js.map +1 -1
  63. package/dist/registry/adapters/shadcnImports.d.ts +10 -0
  64. package/dist/registry/adapters/shadcnImports.d.ts.map +1 -0
  65. package/dist/registry/adapters/shadcnImports.js +18 -0
  66. package/dist/registry/adapters/shadcnImports.js.map +1 -0
  67. package/dist/registry/componentsJson.d.ts +3 -1
  68. package/dist/registry/componentsJson.d.ts.map +1 -1
  69. package/dist/registry/componentsJson.js +15 -1
  70. package/dist/registry/componentsJson.js.map +1 -1
  71. package/dist/registry/index.d.ts +1 -1
  72. package/dist/registry/index.d.ts.map +1 -1
  73. package/dist/registry/index.js +1 -1
  74. package/dist/registry/index.js.map +1 -1
  75. package/dist/registry/manifest.d.ts +2 -13
  76. package/dist/registry/manifest.d.ts.map +1 -1
  77. package/dist/registry/manifest.js +4 -76
  78. package/dist/registry/manifest.js.map +1 -1
  79. package/dist/registry/packageExports.d.ts +9 -0
  80. package/dist/registry/packageExports.d.ts.map +1 -0
  81. package/dist/registry/packageExports.js +50 -0
  82. package/dist/registry/packageExports.js.map +1 -0
  83. package/dist/registry/readSource.d.ts +4 -2
  84. package/dist/registry/readSource.d.ts.map +1 -1
  85. package/dist/registry/readSource.js +27 -3
  86. package/dist/registry/readSource.js.map +1 -1
  87. package/dist/registry/types.d.ts +86 -3
  88. package/dist/registry/types.d.ts.map +1 -1
  89. package/dist/registry/types.js +46 -3
  90. package/dist/registry/types.js.map +1 -1
  91. package/dist/sources/builtins.d.ts +1 -5
  92. package/dist/sources/builtins.d.ts.map +1 -1
  93. package/dist/sources/builtins.js +2 -7
  94. package/dist/sources/builtins.js.map +1 -1
  95. package/dist/theme/cssVars.d.ts +30 -0
  96. package/dist/theme/cssVars.d.ts.map +1 -0
  97. package/dist/theme/cssVars.js +92 -0
  98. package/dist/theme/cssVars.js.map +1 -0
  99. package/dist/theme/detectCssFile.d.ts +9 -0
  100. package/dist/theme/detectCssFile.d.ts.map +1 -0
  101. package/dist/theme/detectCssFile.js +41 -0
  102. package/dist/theme/detectCssFile.js.map +1 -0
  103. package/package.json +8 -21
  104. package/template/build.ts +25 -0
  105. package/template/package.json +18 -0
  106. package/template/src/components/example/Example.css +20 -0
  107. package/template/src/components/example/Example.tsx +26 -0
  108. package/template/src/components/example/example.meta.ts +61 -0
  109. package/dist/components/basic/Card.css +0 -32
  110. package/dist/components/basic/Card.debug.ts +0 -5
  111. package/dist/components/basic/Card.tsx +0 -31
  112. package/dist/components/basic/CardFooter.css +0 -16
  113. package/dist/components/basic/CardFooter.debug.ts +0 -5
  114. package/dist/components/basic/CardFooter.tsx +0 -29
  115. package/dist/components/basic/CardHeader.css +0 -14
  116. package/dist/components/basic/CardHeader.debug.ts +0 -5
  117. package/dist/components/basic/CardHeader.tsx +0 -29
  118. package/dist/components/basic/card.meta.ts +0 -14
  119. package/dist/components/basic/cardfooter.meta.ts +0 -14
  120. package/dist/components/basic/cardheader.meta.ts +0 -14
  121. package/dist/components/input/Button.css +0 -34
  122. package/dist/components/input/Button.debug.ts +0 -5
  123. package/dist/components/input/Button.tsx +0 -28
  124. package/dist/components/input/button.meta.ts +0 -14
  125. package/dist/components.json +0 -138
@@ -0,0 +1,25 @@
1
+ // Builds the source: copies src/components to dist/components and writes dist/components.json, which
2
+ // lists every component with a hash per file. Run it with `bun run build`. It runs on Bun only, because
3
+ // it imports each `.meta.ts` file directly.
4
+ //
5
+ // The installer compares those hashes with the files in an app, so `update` installs any change you
6
+ // build, even under the same version. Raise the version in package.json for every release anyway:
7
+ // it is stamped on every component, and `update` shows it as `0.1.0 → 0.2.0`.
8
+ //
9
+ // How apps get the source:
10
+ // - npm: `bun publish`. Apps run `bun add -d <name>`, then `bunx @g3nomaly/ui source add npm:<name>`.
11
+ // - git: commit dist/, since the installer reads a git source as it is and never builds it. Apps can
12
+ // install it as `bun add -d github:<owner>/<repo>#<tag>` and register it as an npm source.
13
+ // - a folder: apps run `bun add -d file:<path>`, or `bunx @g3nomaly/ui source add <path>`.
14
+ import fs from "node:fs";
15
+ import path from "node:path";
16
+ import { COMPONENTS_DIR, COMPONENTS_JSON, writeComponentsJson } from "@g3nomaly/ui/registry";
17
+
18
+ const root = import.meta.dir;
19
+ const { version } = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8")) as { version: string };
20
+ const builtDir = path.join(root, COMPONENTS_DIR);
21
+
22
+ fs.rmSync(path.join(root, "dist"), { recursive: true, force: true });
23
+ fs.cpSync(path.join(root, "src", "components"), builtDir, { recursive: true });
24
+ const count = await writeComponentsJson(builtDir, path.join(root, COMPONENTS_JSON), version);
25
+ console.log(`wrote ${COMPONENTS_JSON} with ${count} component${count === 1 ? "" : "s"}`);
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "my-components",
3
+ "version": "0.1.0",
4
+ "description": "React components for @g3nomaly/ui.",
5
+ "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "exports": {
10
+ "./*": "./dist/components/*.ts"
11
+ },
12
+ "scripts": {
13
+ "build": "bun build.ts"
14
+ },
15
+ "devDependencies": {
16
+ "@g3nomaly/ui": "*"
17
+ }
18
+ }
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Colours come from the app's theme: the tokens shadcn and tweakcn define in the app's one globals.css,
3
+ * such as --background, --foreground, --primary, --muted and --border. They switch with dark mode,
4
+ * so a component never needs its own dark styles. Avoid fixed colours. A token of your own goes in
5
+ * `cssVars` in the meta file, which adds it to the app's stylesheet.
6
+ */
7
+ .my-components {
8
+ &.example {
9
+ padding: 1rem;
10
+ border: 1px solid var(--border);
11
+ border-radius: var(--radius);
12
+ background-color: var(--card);
13
+ color: var(--card-foreground);
14
+
15
+ &--muted {
16
+ background-color: var(--muted);
17
+ color: var(--muted-foreground);
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,26 @@
1
+ // The app gets this file as source and owns it from then on. `update` replaces it only while the app
2
+ // has not changed it, so keep components small and let apps edit them.
3
+ import React from "react";
4
+ // A relative import: Example.css is installed next to this file.
5
+ import "./Example.css";
6
+
7
+ /**
8
+ * @brief Props of Example: the native div attributes plus its look.
9
+ *
10
+ * @property tone - Look of the box: `default` or `muted`, set as the `example--<tone>` class.
11
+ */
12
+ export interface ExampleProps extends React.HTMLAttributes<HTMLDivElement> {
13
+ tone?: "default" | "muted";
14
+ }
15
+
16
+ export const Example = React.forwardRef<HTMLDivElement, ExampleProps>(
17
+ ({ children, className = "", tone = "default", ...props }, ref) => (
18
+ // `my-components` scopes the CSS of this source, so it does not leak into the app. Use one class
19
+ // per source, named after it.
20
+ <div ref={ref} className={`my-components example example--${tone} ${className}`} {...props}>
21
+ {children}
22
+ </div>
23
+ ),
24
+ );
25
+
26
+ Example.displayName = "Example";
@@ -0,0 +1,61 @@
1
+ // The meta file of one component. The build reads every `*.meta.ts` under src/components and writes
2
+ // dist/components.json from them, which is what @g3nomaly/ui reads when it lists and installs components.
3
+ //
4
+ // Rename this file and the component together: `<name>.meta.ts` next to `<Name>.tsx`. One meta file
5
+ // describes one component, and every file in this folder belongs to exactly one meta file.
6
+ import type { PackagedComponent } from "@g3nomaly/ui/types";
7
+
8
+ export default {
9
+ // The component's name. Its key is this name in lowercase, so people install it with
10
+ // `bunx @g3nomaly/ui add example`. Keys must be unique within this source.
11
+ name: "Example",
12
+
13
+ description: "A starting point for your own component. Replace it.",
14
+
15
+ // The group the component is listed under, and the folder it sits in. Keep the two equal:
16
+ // `add example-group` installs every component in the group. Two sources may use the same group
17
+ // name, in which case the installer asks which one to take, so pick names that say what they hold.
18
+ category: "example",
19
+
20
+ // Every file the component installs. A path is relative to src/components, and the app gets the
21
+ // file at the same path below its own components folder: `example/Example.tsx` lands in
22
+ // `src/components/ui/example/Example.tsx`. Files are copied byte for byte, so any import between
23
+ // files must be relative and must match this layout. Path aliases such as `@/` do not resolve in
24
+ // the app.
25
+ //
26
+ // Types: `component`, `style`, `util`, `hook`, `type`. The meta file itself is added by the build.
27
+ //
28
+ // Logic the app should not edit, such as a store that manages the component's data, stays in this
29
+ // package: mark it `install: "package"` and keep it in the component's folder. The installer never
30
+ // copies it. The component imports it by package path, `import { exampleStore } from
31
+ // "my-components/example/exampleStore"`, which the `exports` field in package.json resolves to
32
+ // dist/components/example/exampleStore.ts. The build fails when no export reaches the file.
33
+ // Apps then need this package installed with `bun add`, and update the store with `bun install`.
34
+ // `add --include-unsafe` gives an app a copy anyway, which its components do not import.
35
+ files: [
36
+ { path: "example/Example.tsx", type: "component" },
37
+ { path: "example/Example.css", type: "style" },
38
+ // { path: "example/exampleStore.ts", type: "util", install: "package" },
39
+ ],
40
+
41
+ // Other components this one needs, installed alongside it:
42
+ // - `card`, a component of this source,
43
+ // - `button@g3n-ui`, a component of another source,
44
+ // - `@shadcn/tooltip`, a shadcn component. shadcn files land in `<components folder>/shadcn/`,
45
+ // so import them as `../shadcn/tooltip` from a group folder.
46
+ registryDependencies: [],
47
+
48
+ // npm packages the files import, as `name` or `name@range`, e.g. `radix-ui` or `recharts@^3`.
49
+ // After `add` and `update`, the installer lists the ones the app's package.json lacks, and adds
50
+ // them with `--install`. Use `devDependencies` for packages needed at build time only.
51
+ dependencies: [],
52
+
53
+ // Theme tokens the CSS uses that a shadcn / tweakcn globals.css does not define, in shadcn's format:
54
+ // names without `--`. After `add` and `update`, the installer adds the ones the app's stylesheet
55
+ // lacks: `light` to `:root`, `dark` to `.dark`, `theme` to `@theme inline`, plus a `--color-<name>`
56
+ // mapping per colour so Tailwind classes such as `bg-example-accent` work. The app's own values win.
57
+ // cssVars: {
58
+ // light: { "example-accent": "oklch(0.7 0.15 250)" },
59
+ // dark: { "example-accent": "oklch(0.5 0.15 250)" },
60
+ // },
61
+ } satisfies PackagedComponent;
@@ -1,32 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- // packages/ui/src/components/basic/Card.debug.ts
2
- export const __debug = {
3
- componentName: "Card",
4
- version: "0.1.0",
5
- };
@@ -1,31 +0,0 @@
1
- // packages/ui/src/components/basic/Card.tsx
2
- import React from 'react';
3
- import './Card.css';
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
- */
12
- export interface CardProps {
13
- children?: React.ReactNode;
14
- className?: string;
15
- variant?: 'default' | 'outlined' | 'elevated';
16
- }
17
-
18
- export const Card = React.forwardRef<HTMLDivElement, CardProps>(
19
- ({ children, className = '', variant = 'default' }, ref) => {
20
- return (
21
- <div
22
- ref={ref}
23
- className={`g3nui card card--${variant} ${className}`}
24
- >
25
- {children}
26
- </div>
27
- );
28
- }
29
- );
30
-
31
- Card.displayName = 'Card';
@@ -1,16 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- // packages/ui/src/components/basic/CardFooter.debug.ts
2
- export const __debug = {
3
- componentName: "CardFooter",
4
- version: "0.1.0",
5
- };
@@ -1,29 +0,0 @@
1
- // packages/ui/src/components/basic/CardFooter.tsx
2
- import React from 'react';
3
- import './CardFooter.css';
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
- */
11
- export interface CardFooterProps {
12
- children?: React.ReactNode;
13
- className?: string;
14
- }
15
-
16
- export const CardFooter = React.forwardRef<HTMLDivElement, CardFooterProps>(
17
- ({ children, className = '' }, ref) => {
18
- return (
19
- <div
20
- ref={ref}
21
- className={`g3nui card__footer ${className}`}
22
- >
23
- {children}
24
- </div>
25
- );
26
- }
27
- );
28
-
29
- CardFooter.displayName = 'CardFooter';
@@ -1,14 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- // packages/ui/src/components/basic/CardHeader.debug.ts
2
- export const __debug = {
3
- componentName: "CardHeader",
4
- version: "0.1.0",
5
- };
@@ -1,29 +0,0 @@
1
- // packages/ui/src/components/basic/CardHeader.tsx
2
- import React from 'react';
3
- import './CardHeader.css';
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
- */
11
- export interface CardHeaderProps {
12
- children?: React.ReactNode;
13
- className?: string;
14
- }
15
-
16
- export const CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(
17
- ({ children, className = '' }, ref) => {
18
- return (
19
- <div
20
- ref={ref}
21
- className={`g3nui card__header ${className}`}
22
- >
23
- {children}
24
- </div>
25
- );
26
- }
27
- );
28
-
29
- CardHeader.displayName = 'CardHeader';
@@ -1,14 +0,0 @@
1
- // packages/ui/src/components/basic/card.meta.ts
2
- import type { PackagedComponent } from "@g3nomaly/ui/types";
3
-
4
- export default {
5
- name: "Card",
6
- description: "A flexible card component.",
7
- category: "basic",
8
- files: [
9
- { path: "basic/Card.tsx", type: "component" },
10
- { path: "basic/Card.css", type: "style" },
11
- { path: "basic/Card.debug.ts", type: "util" },
12
- ],
13
- registryDependencies: [],
14
- } satisfies PackagedComponent;
@@ -1,14 +0,0 @@
1
- // packages/ui/src/components/basic/cardfooter.meta.ts
2
- import type { PackagedComponent } from "@g3nomaly/ui/types";
3
-
4
- export default {
5
- name: "CardFooter",
6
- description: "Footer section for Card component.",
7
- category: "basic",
8
- files: [
9
- { path: "basic/CardFooter.tsx", type: "component" },
10
- { path: "basic/CardFooter.css", type: "style" },
11
- { path: "basic/CardFooter.debug.ts", type: "util" },
12
- ],
13
- registryDependencies: ["card"],
14
- } satisfies PackagedComponent;
@@ -1,14 +0,0 @@
1
- // packages/ui/src/components/basic/cardheader.meta.ts
2
- import type { PackagedComponent } from "@g3nomaly/ui/types";
3
-
4
- export default {
5
- name: "CardHeader",
6
- description: "Header section for Card component.",
7
- category: "basic",
8
- files: [
9
- { path: "basic/CardHeader.tsx", type: "component" },
10
- { path: "basic/CardHeader.css", type: "style" },
11
- { path: "basic/CardHeader.debug.ts", type: "util" },
12
- ],
13
- registryDependencies: ["card"],
14
- } satisfies PackagedComponent;
@@ -1,34 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- // packages/ui/src/components/input/Button.debug.ts
2
- export const __debug = {
3
- componentName: "Button",
4
- version: "0.1.0",
5
- };
@@ -1,28 +0,0 @@
1
- // packages/ui/src/components/input/Button.tsx
2
- import React from 'react';
3
- import './Button.css';
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
- */
10
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
11
- variant?: 'primary' | 'secondary' | 'ghost';
12
- }
13
-
14
- export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
15
- ({ children, className = '', variant = 'primary', ...props }, ref) => {
16
- return (
17
- <button
18
- ref={ref}
19
- className={`g3nui button button--${variant} ${className}`}
20
- {...props}
21
- >
22
- {children}
23
- </button>
24
- );
25
- }
26
- );
27
-
28
- Button.displayName = 'Button';
@@ -1,14 +0,0 @@
1
- // packages/ui/src/components/input/button.meta.ts
2
- import type { PackagedComponent } from "@g3nomaly/ui/types";
3
-
4
- export default {
5
- name: "Button",
6
- description: "A flexible button component.",
7
- category: "input",
8
- files: [
9
- { path: "input/Button.tsx", type: "component" },
10
- { path: "input/Button.css", type: "style" },
11
- { path: "input/Button.debug.ts", type: "util" },
12
- ],
13
- registryDependencies: [],
14
- } satisfies PackagedComponent;
@@ -1,138 +0,0 @@
1
- {
2
- "button": {
3
- "name": "Button",
4
- "description": "A flexible button component.",
5
- "category": "input",
6
- "registryDependencies": [],
7
- "files": [
8
- {
9
- "path": "input/Button.tsx",
10
- "type": "component",
11
- "version": "0.3.2",
12
- "hash": "4911cf7ade40890c2bc1ee9eba65b9297f33cc0c1287c550701780295ed16086"
13
- },
14
- {
15
- "path": "input/Button.css",
16
- "type": "style",
17
- "version": "0.3.2",
18
- "hash": "eaff21a3e7afa0e48210f146e6558df6997ff31fa8d239031ea110914d5ff208"
19
- },
20
- {
21
- "path": "input/Button.debug.ts",
22
- "type": "util",
23
- "version": "0.3.2",
24
- "hash": "f7be8d51584045a3dd712741922c9009fd1879db06915fcf1f11b9b4152d1441"
25
- },
26
- {
27
- "path": "input/button.meta.ts",
28
- "type": "meta",
29
- "version": "0.3.2",
30
- "hash": "51294b1c334186be2378259245c3a444b509328785f7ceee6d555ccc99ad05c6"
31
- }
32
- ],
33
- "version": "0.3.2"
34
- },
35
- "card": {
36
- "name": "Card",
37
- "description": "A flexible card component.",
38
- "category": "basic",
39
- "registryDependencies": [],
40
- "files": [
41
- {
42
- "path": "basic/Card.tsx",
43
- "type": "component",
44
- "version": "0.3.2",
45
- "hash": "2602d00902b38c45d4a6409febe47bdb9e79657d83d7da3bc4dff3c7a3ebea6d"
46
- },
47
- {
48
- "path": "basic/Card.css",
49
- "type": "style",
50
- "version": "0.3.2",
51
- "hash": "5315468962112167dd37b4893e7d38404c19a7f2ba76bf51372bc30d67d5dc42"
52
- },
53
- {
54
- "path": "basic/Card.debug.ts",
55
- "type": "util",
56
- "version": "0.3.2",
57
- "hash": "acecf600200a49337f65714f0b2b4efc5325446b11fa49d5360f1aee88f1023f"
58
- },
59
- {
60
- "path": "basic/card.meta.ts",
61
- "type": "meta",
62
- "version": "0.3.2",
63
- "hash": "4ffcfd020601e222f26961ac595f478d6e8907ad894cdba992ea2b34a8ba6b92"
64
- }
65
- ],
66
- "version": "0.3.2"
67
- },
68
- "cardfooter": {
69
- "name": "CardFooter",
70
- "description": "Footer section for Card component.",
71
- "category": "basic",
72
- "registryDependencies": [
73
- "card"
74
- ],
75
- "files": [
76
- {
77
- "path": "basic/CardFooter.tsx",
78
- "type": "component",
79
- "version": "0.3.2",
80
- "hash": "bfd4e73de6b16b529c22ca69e4661c30bd4be1237a5972eefce45cd6deb7dff5"
81
- },
82
- {
83
- "path": "basic/CardFooter.css",
84
- "type": "style",
85
- "version": "0.3.2",
86
- "hash": "751573c89dc46e83c9f240e58895f42652399f0519907c058568b14aaa52cb4d"
87
- },
88
- {
89
- "path": "basic/CardFooter.debug.ts",
90
- "type": "util",
91
- "version": "0.3.2",
92
- "hash": "3226f24e154a19daf4f0d9828245ff0cdf7b2e8bb75f10d785a33c1234578484"
93
- },
94
- {
95
- "path": "basic/cardfooter.meta.ts",
96
- "type": "meta",
97
- "version": "0.3.2",
98
- "hash": "1e9d82552826862ca25f13e71f80301b61fa8b9c3c8d0dc3ed51038db5b0f94c"
99
- }
100
- ],
101
- "version": "0.3.2"
102
- },
103
- "cardheader": {
104
- "name": "CardHeader",
105
- "description": "Header section for Card component.",
106
- "category": "basic",
107
- "registryDependencies": [
108
- "card"
109
- ],
110
- "files": [
111
- {
112
- "path": "basic/CardHeader.tsx",
113
- "type": "component",
114
- "version": "0.3.2",
115
- "hash": "fac021c0f55b4c115b0b9fcc3e6f452aea7403e99b4b7a1287861de5653c9eb5"
116
- },
117
- {
118
- "path": "basic/CardHeader.css",
119
- "type": "style",
120
- "version": "0.3.2",
121
- "hash": "e36cf86636d2e7619dd69725faaedac9604a9605be11c0e2a6aa3663db8c3b53"
122
- },
123
- {
124
- "path": "basic/CardHeader.debug.ts",
125
- "type": "util",
126
- "version": "0.3.2",
127
- "hash": "e5879c6caebc2d14ffaf49b8d630a32a23c1c5a1c3877288d7ea4333e333c9e7"
128
- },
129
- {
130
- "path": "basic/cardheader.meta.ts",
131
- "type": "meta",
132
- "version": "0.3.2",
133
- "hash": "46d85bb6e00d8fa518548b89a89deb53c2e27304fc5f808f7e4cd5472a51871a"
134
- }
135
- ],
136
- "version": "0.3.2"
137
- }
138
- }