soluid 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/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/commands/add.js +31 -0
- package/dist/commands/init.js +56 -0
- package/dist/commands/install.js +110 -0
- package/dist/commands/list.js +54 -0
- package/dist/commands/remove.js +25 -0
- package/dist/components/data/Card.d.ts +22 -0
- package/dist/components/data/DescriptionList.d.ts +11 -0
- package/dist/components/data/EmptyState.d.ts +10 -0
- package/dist/components/data/Skeleton.d.ts +8 -0
- package/dist/components/data/Table.d.ts +23 -0
- package/dist/components/data/index.d.ts +10 -0
- package/dist/components/feedback/Alert.d.ts +9 -0
- package/dist/components/feedback/Dialog.d.ts +25 -0
- package/dist/components/feedback/Drawer.d.ts +11 -0
- package/dist/components/feedback/Progress.d.ts +8 -0
- package/dist/components/feedback/Spinner.d.ts +7 -0
- package/dist/components/feedback/Toast.d.ts +10 -0
- package/dist/components/feedback/index.d.ts +12 -0
- package/dist/components/form/Checkbox.d.ts +14 -0
- package/dist/components/form/CheckboxGroup.d.ts +10 -0
- package/dist/components/form/CheckboxGroupContext.d.ts +6 -0
- package/dist/components/form/FormField.d.ts +11 -0
- package/dist/components/form/FormFieldContext.d.ts +8 -0
- package/dist/components/form/NumberInput.d.ts +15 -0
- package/dist/components/form/RadioButton.d.ts +10 -0
- package/dist/components/form/RadioGroup.d.ts +11 -0
- package/dist/components/form/RadioGroupContext.d.ts +7 -0
- package/dist/components/form/Select.d.ts +19 -0
- package/dist/components/form/Switch.d.ts +12 -0
- package/dist/components/form/TextArea.d.ts +15 -0
- package/dist/components/form/TextField.d.ts +14 -0
- package/dist/components/form/index.d.ts +26 -0
- package/dist/components/general/Badge.d.ts +9 -0
- package/dist/components/general/Button.d.ts +10 -0
- package/dist/components/general/IconButton.d.ts +8 -0
- package/dist/components/general/Tag.d.ts +10 -0
- package/dist/components/general/Tooltip.d.ts +6 -0
- package/dist/components/general/index.d.ts +10 -0
- package/dist/components/layout/Divider.d.ts +7 -0
- package/dist/components/layout/HStack.d.ts +10 -0
- package/dist/components/layout/Spacer.d.ts +3 -0
- package/dist/components/layout/Stack.d.ts +9 -0
- package/dist/components/layout/index.d.ts +7 -0
- package/dist/components/navigation/Breadcrumb.d.ts +14 -0
- package/dist/components/navigation/Menu.d.ts +7 -0
- package/dist/components/navigation/Pagination.d.ts +9 -0
- package/dist/components/navigation/Tabs.d.ts +27 -0
- package/dist/components/navigation/index.d.ts +8 -0
- package/dist/components/utility/Popover.d.ts +7 -0
- package/dist/components/utility/VisuallyHidden.d.ts +6 -0
- package/dist/components/utility/index.d.ts +4 -0
- package/dist/config.js +26 -0
- package/dist/core/SouiProvider.d.ts +7 -0
- package/dist/core/context.d.ts +6 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/theme.d.ts +7 -0
- package/dist/core/types.d.ts +35 -0
- package/dist/core/utils.d.ts +2 -0
- package/dist/dev/App.d.ts +3 -0
- package/dist/dev/index.d.ts +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +53 -0
- package/dist/primitives/createDisclosure.d.ts +27 -0
- package/dist/primitives/createFocusTrap.d.ts +10 -0
- package/dist/primitives/createPagination.d.ts +23 -0
- package/dist/primitives/createToast.d.ts +23 -0
- package/dist/primitives/createToggle.d.ts +19 -0
- package/dist/primitives/index.d.ts +10 -0
- package/dist/registry.js +410 -0
- package/dist/rewrite-imports.js +42 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 misebox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# soluid
|
|
2
|
+
|
|
3
|
+
SolidJS component toolkit. Copy components into your project and own the code directly.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install -D soluid
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## CLI
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npx soluid init # creates soluid.config.json
|
|
15
|
+
npx soluid add # copies components into your project
|
|
16
|
+
npx soluid list # shows available components
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Config
|
|
20
|
+
|
|
21
|
+
`soluid.config.json`
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"componentDir": "src/components/ui",
|
|
26
|
+
"alias": "@",
|
|
27
|
+
"aliasBase": "src",
|
|
28
|
+
"components": ["Button", "TextField", "Dialog"]
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Setup
|
|
33
|
+
|
|
34
|
+
Import soluid.css in your app's entry point:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
// src/index.tsx
|
|
38
|
+
import "./components/ui/core/soluid.css";
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Theme/density switching:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
document.documentElement.setAttribute("data-theme", "dark");
|
|
45
|
+
document.documentElement.setAttribute("data-density", "dense");
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Components (32)
|
|
49
|
+
|
|
50
|
+
| Category | Components |
|
|
51
|
+
|---|---|
|
|
52
|
+
| Layout | Stack, HStack, Divider, Spacer |
|
|
53
|
+
| General | Button, IconButton, Badge, Tag, Tooltip |
|
|
54
|
+
| Form | FormField, TextField, TextArea, NumberInput, Select, Checkbox, CheckboxGroup, RadioGroup, Switch |
|
|
55
|
+
| Data | Table, Card, DescriptionList, Skeleton, EmptyState |
|
|
56
|
+
| Feedback | Dialog, Drawer, Alert, Toast, Progress, Spinner |
|
|
57
|
+
| Navigation | Tabs, Breadcrumb, Pagination, Menu |
|
|
58
|
+
| Utility | VisuallyHidden, Popover |
|
|
59
|
+
|
|
60
|
+
## Primitives (5)
|
|
61
|
+
|
|
62
|
+
`createDisclosure`, `createFocusTrap`, `createToggle`, `createToast`, `createPagination`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CONFIG_FILENAME, PROJECT_NAME, loadConfig, saveConfig } from "../config.js";
|
|
2
|
+
import { registry } from "../registry.js";
|
|
3
|
+
export function add(cwd, names) {
|
|
4
|
+
const config = loadConfig(cwd);
|
|
5
|
+
if (config === null) {
|
|
6
|
+
console.error(`${CONFIG_FILENAME} not found. Run: npx ${PROJECT_NAME} init`);
|
|
7
|
+
process.exit(1);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const invalid = names.filter((name) => !registry[name]);
|
|
11
|
+
if (invalid.length > 0) {
|
|
12
|
+
console.error(`Unknown components: ${invalid.join(", ")}`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const existing = new Set(config.components);
|
|
17
|
+
const added = [];
|
|
18
|
+
for (const name of names) {
|
|
19
|
+
if (!existing.has(name)) {
|
|
20
|
+
config.components.push(name);
|
|
21
|
+
added.push(name);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (added.length === 0) {
|
|
25
|
+
console.log("All specified components are already in config.");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
saveConfig(cwd, config);
|
|
29
|
+
console.log(`Added: ${added.join(", ")}`);
|
|
30
|
+
console.log(`\nRun: npx ${PROJECT_NAME} install`);
|
|
31
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import * as readline from "node:readline";
|
|
4
|
+
import { CONFIG_FILENAME, DEFAULT_CSS_FILENAME, PROJECT_NAME, findConfigPath, saveConfig } from "../config.js";
|
|
5
|
+
import { allComponentNames } from "../registry.js";
|
|
6
|
+
function prompt(question, defaultValue) {
|
|
7
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
rl.question(`${question} (${defaultValue}) `, (answer) => {
|
|
10
|
+
rl.close();
|
|
11
|
+
resolve(answer.trim() || defaultValue);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function confirm(question) {
|
|
16
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
17
|
+
return new Promise((resolve) => {
|
|
18
|
+
rl.question(question, (answer) => {
|
|
19
|
+
rl.close();
|
|
20
|
+
resolve(answer.trim().toLowerCase() === "y");
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export async function init(cwd) {
|
|
25
|
+
const configPath = findConfigPath(cwd);
|
|
26
|
+
if (fs.existsSync(configPath)) {
|
|
27
|
+
console.error(`${CONFIG_FILENAME} already exists. Delete it first to re-initialize.`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const pkgPath = path.join(cwd, "package.json");
|
|
32
|
+
if (!fs.existsSync(pkgPath)) {
|
|
33
|
+
const ok = await confirm("package.json not found. Continue anyway? (y/n) ");
|
|
34
|
+
if (!ok) {
|
|
35
|
+
console.log("Aborted.");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const componentDir = await prompt("Component directory?", "src/components/ui");
|
|
40
|
+
const cssPath = await prompt("CSS path?", `src/styles/${DEFAULT_CSS_FILENAME}`);
|
|
41
|
+
const allNames = allComponentNames();
|
|
42
|
+
const config = {
|
|
43
|
+
componentDir,
|
|
44
|
+
alias: "",
|
|
45
|
+
aliasBase: "src",
|
|
46
|
+
cssPath,
|
|
47
|
+
components: allNames,
|
|
48
|
+
};
|
|
49
|
+
saveConfig(cwd, config);
|
|
50
|
+
console.log(`\nCreated ${CONFIG_FILENAME} with ${allNames.length} components.`);
|
|
51
|
+
console.log("");
|
|
52
|
+
console.log("Next steps:");
|
|
53
|
+
console.log(` 1. Run: npx ${PROJECT_NAME} install`);
|
|
54
|
+
console.log(" 2. Import CSS in your entry point:");
|
|
55
|
+
console.log(` import "./${cssPath.replace(/^src\//, "")}";`);
|
|
56
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { Readable } from "node:stream";
|
|
5
|
+
import { pipeline } from "node:stream/promises";
|
|
6
|
+
import { createGunzip } from "node:zlib";
|
|
7
|
+
import { Parser } from "tar";
|
|
8
|
+
import { CONFIG_FILENAME, DEFAULT_CSS_FILENAME, PROJECT_NAME, loadConfig } from "../config.js";
|
|
9
|
+
import { collectNpmDeps, registry, resolveDependencies } from "../registry.js";
|
|
10
|
+
import { rewriteImports } from "../rewrite-imports.js";
|
|
11
|
+
const RELEASE_URL = "https://github.com/misebox/soluid/releases/download";
|
|
12
|
+
function getVersion() {
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
return require("../../package.json").componentsVersion;
|
|
15
|
+
}
|
|
16
|
+
function checkRateLimit(res) {
|
|
17
|
+
const remaining = res.headers.get("X-RateLimit-Remaining");
|
|
18
|
+
if (remaining !== null && parseInt(remaining, 10) <= 5) {
|
|
19
|
+
console.warn(`Warning: GitHub API rate limit low (${remaining} remaining)`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function fetchAndExtract(version) {
|
|
23
|
+
const url = `${RELEASE_URL}/components-v${version}/components.tar.gz`;
|
|
24
|
+
const res = await fetch(url);
|
|
25
|
+
if (!res.ok) {
|
|
26
|
+
throw new Error(`Failed to fetch components: ${res.status} ${res.statusText}\n URL: ${url}`);
|
|
27
|
+
}
|
|
28
|
+
checkRateLimit(res);
|
|
29
|
+
const body = res.body;
|
|
30
|
+
if (!body)
|
|
31
|
+
throw new Error("Empty response body");
|
|
32
|
+
const files = new Map();
|
|
33
|
+
const nodeStream = Readable.fromWeb(body);
|
|
34
|
+
const gunzip = createGunzip();
|
|
35
|
+
const parser = new Parser({
|
|
36
|
+
onReadEntry(entry) {
|
|
37
|
+
if (entry.type === "File") {
|
|
38
|
+
const chunks = [];
|
|
39
|
+
entry.on("data", (chunk) => chunks.push(chunk));
|
|
40
|
+
entry.on("end", () => {
|
|
41
|
+
let filePath = entry.path;
|
|
42
|
+
if (filePath.startsWith("./"))
|
|
43
|
+
filePath = filePath.slice(2);
|
|
44
|
+
files.set(filePath, Buffer.concat(chunks).toString("utf-8"));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
entry.resume();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
await pipeline(nodeStream, gunzip, parser);
|
|
53
|
+
return files;
|
|
54
|
+
}
|
|
55
|
+
export async function install(cwd) {
|
|
56
|
+
const config = loadConfig(cwd);
|
|
57
|
+
if (config === null) {
|
|
58
|
+
console.error(`${CONFIG_FILENAME} not found. Run: npx ${PROJECT_NAME} init\n`);
|
|
59
|
+
process.exit(1);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (config.components.length === 0) {
|
|
63
|
+
console.error("No components specified in config.");
|
|
64
|
+
process.exit(1);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const invalid = config.components.filter((name) => !registry[name]);
|
|
68
|
+
if (invalid.length > 0) {
|
|
69
|
+
console.error(`Unknown components: ${invalid.join(", ")}`);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const resolved = resolveDependencies(["core", ...config.components]);
|
|
74
|
+
const npmDeps = collectNpmDeps(resolved);
|
|
75
|
+
console.log(`Installing ${resolved.length} items (including dependencies):`);
|
|
76
|
+
const version = getVersion();
|
|
77
|
+
const archive = await fetchAndExtract(version);
|
|
78
|
+
const targetRoot = path.resolve(cwd, config.componentDir);
|
|
79
|
+
let copiedCount = 0;
|
|
80
|
+
for (const name of resolved) {
|
|
81
|
+
const entry = registry[name];
|
|
82
|
+
if (!entry)
|
|
83
|
+
continue;
|
|
84
|
+
for (const file of entry.files) {
|
|
85
|
+
const content = archive.get(file);
|
|
86
|
+
if (content === undefined) {
|
|
87
|
+
console.warn(` SKIP (not in archive): ${file}`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const destPath = file === `core/${DEFAULT_CSS_FILENAME}`
|
|
91
|
+
? path.resolve(cwd, config.cssPath)
|
|
92
|
+
: path.join(targetRoot, file);
|
|
93
|
+
const destDir = path.dirname(destPath);
|
|
94
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
95
|
+
let output = content;
|
|
96
|
+
if (file.endsWith(".ts") || file.endsWith(".tsx")) {
|
|
97
|
+
output = rewriteImports(content, file, config);
|
|
98
|
+
}
|
|
99
|
+
fs.writeFileSync(destPath, output, "utf-8");
|
|
100
|
+
copiedCount++;
|
|
101
|
+
}
|
|
102
|
+
console.log(` + ${name}`);
|
|
103
|
+
}
|
|
104
|
+
console.log(`\nCopied ${copiedCount} files to ${config.componentDir}/`);
|
|
105
|
+
if (npmDeps.length > 0) {
|
|
106
|
+
console.log("\nRequired npm packages:");
|
|
107
|
+
console.log(` npm install ${npmDeps.join(" ")}`);
|
|
108
|
+
}
|
|
109
|
+
console.log("\nDone. Components are now in your project — edit freely.");
|
|
110
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { loadConfig } from "../config.js";
|
|
4
|
+
import { allComponentNames, registry } from "../registry.js";
|
|
5
|
+
export function list(cwd, filter) {
|
|
6
|
+
const config = loadConfig(cwd);
|
|
7
|
+
const allNames = allComponentNames();
|
|
8
|
+
// Determine which components are installed (files exist on disk)
|
|
9
|
+
const installed = new Set();
|
|
10
|
+
if (config) {
|
|
11
|
+
const targetRoot = path.resolve(cwd, config.componentDir);
|
|
12
|
+
for (const name of allNames) {
|
|
13
|
+
const entry = registry[name];
|
|
14
|
+
if (!entry)
|
|
15
|
+
continue;
|
|
16
|
+
const allExist = entry.files.every((file) => fs.existsSync(path.join(targetRoot, file)));
|
|
17
|
+
if (allExist)
|
|
18
|
+
installed.add(name);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// Group by category
|
|
22
|
+
const categories = new Map();
|
|
23
|
+
for (const name of allNames) {
|
|
24
|
+
const entry = registry[name];
|
|
25
|
+
if (!entry)
|
|
26
|
+
continue;
|
|
27
|
+
if (filter === "installed" && !installed.has(name))
|
|
28
|
+
continue;
|
|
29
|
+
if (filter === "not-installed" && installed.has(name))
|
|
30
|
+
continue;
|
|
31
|
+
const cat = entry.category === "primitives" ? "Primitives" : capitalize(entry.category);
|
|
32
|
+
if (!categories.has(cat))
|
|
33
|
+
categories.set(cat, []);
|
|
34
|
+
const list = categories.get(cat);
|
|
35
|
+
const status = installed.has(name) ? " [installed]" : "";
|
|
36
|
+
if (list)
|
|
37
|
+
list.push(` ${name.padEnd(20)} ${entry.description}${status}`);
|
|
38
|
+
}
|
|
39
|
+
let count = 0;
|
|
40
|
+
for (const [cat, items] of categories) {
|
|
41
|
+
console.log(`\n [${cat}]`);
|
|
42
|
+
for (const item of items) {
|
|
43
|
+
console.log(item);
|
|
44
|
+
}
|
|
45
|
+
count += items.length;
|
|
46
|
+
}
|
|
47
|
+
if (count === 0) {
|
|
48
|
+
console.log(" (none)");
|
|
49
|
+
}
|
|
50
|
+
console.log(`\n${count} component(s)`);
|
|
51
|
+
}
|
|
52
|
+
function capitalize(s) {
|
|
53
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
54
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CONFIG_FILENAME, PROJECT_NAME, loadConfig, saveConfig } from "../config.js";
|
|
2
|
+
export function remove(cwd, names) {
|
|
3
|
+
const config = loadConfig(cwd);
|
|
4
|
+
if (config === null) {
|
|
5
|
+
console.error(`${CONFIG_FILENAME} not found. Run: npx ${PROJECT_NAME} init`);
|
|
6
|
+
process.exit(1);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const existing = new Set(config.components);
|
|
10
|
+
const removed = [];
|
|
11
|
+
for (const name of names) {
|
|
12
|
+
if (existing.has(name)) {
|
|
13
|
+
removed.push(name);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if (removed.length === 0) {
|
|
17
|
+
console.log("None of the specified components are in config.");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const toRemove = new Set(removed);
|
|
21
|
+
config.components = config.components.filter((c) => !toRemove.has(c));
|
|
22
|
+
saveConfig(cwd, config);
|
|
23
|
+
console.log(`Removed: ${removed.join(", ")}`);
|
|
24
|
+
console.log(`\nRun: npx ${PROJECT_NAME} install`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./Card.css";
|
|
4
|
+
export interface CardProps extends CommonProps {
|
|
5
|
+
children: JSX.Element;
|
|
6
|
+
}
|
|
7
|
+
export interface CardHeaderProps {
|
|
8
|
+
class?: string;
|
|
9
|
+
children: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export interface CardBodyProps {
|
|
12
|
+
class?: string;
|
|
13
|
+
children: JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
export interface CardFooterProps {
|
|
16
|
+
class?: string;
|
|
17
|
+
children: JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
export declare function Card(props: CardProps): JSX.Element;
|
|
20
|
+
export declare function CardHeader(props: CardHeaderProps): JSX.Element;
|
|
21
|
+
export declare function CardBody(props: CardBodyProps): JSX.Element;
|
|
22
|
+
export declare function CardFooter(props: CardFooterProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./DescriptionList.css";
|
|
4
|
+
export interface DescriptionListProps extends CommonProps {
|
|
5
|
+
items: Array<{
|
|
6
|
+
term: string;
|
|
7
|
+
description: JSX.Element;
|
|
8
|
+
}>;
|
|
9
|
+
columns?: 1 | 2;
|
|
10
|
+
}
|
|
11
|
+
export declare function DescriptionList(props: DescriptionListProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./EmptyState.css";
|
|
4
|
+
export interface EmptyStateProps extends CommonProps {
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: JSX.Element;
|
|
8
|
+
action?: JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export declare function EmptyState(props: EmptyStateProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommonProps } from "../../core/types";
|
|
2
|
+
import "./Skeleton.css";
|
|
3
|
+
export interface SkeletonProps extends CommonProps {
|
|
4
|
+
variant?: "text" | "circle" | "rect";
|
|
5
|
+
width?: string;
|
|
6
|
+
height?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Skeleton(props: SkeletonProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./Table.css";
|
|
4
|
+
export interface Column<T> {
|
|
5
|
+
key: string;
|
|
6
|
+
header: string;
|
|
7
|
+
width?: string;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
align?: "start" | "center" | "end";
|
|
10
|
+
render?: (value: unknown, row: T) => JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
export interface TableProps<T> extends CommonProps {
|
|
13
|
+
columns: Column<T>[];
|
|
14
|
+
data: T[];
|
|
15
|
+
sortKey?: string;
|
|
16
|
+
sortDirection?: "asc" | "desc";
|
|
17
|
+
onSort?: (key: string, direction: "asc" | "desc") => void;
|
|
18
|
+
selectable?: boolean;
|
|
19
|
+
selectedKeys?: Set<string>;
|
|
20
|
+
onSelect?: (keys: Set<string>) => void;
|
|
21
|
+
rowKey?: (row: T) => string;
|
|
22
|
+
}
|
|
23
|
+
export declare function Table<T extends Record<string, unknown>>(props: TableProps<T>): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Card, CardHeader, CardBody, CardFooter } from "./Card";
|
|
2
|
+
export type { CardProps, CardHeaderProps, CardBodyProps, CardFooterProps } from "./Card";
|
|
3
|
+
export { DescriptionList } from "./DescriptionList";
|
|
4
|
+
export type { DescriptionListProps } from "./DescriptionList";
|
|
5
|
+
export { Skeleton } from "./Skeleton";
|
|
6
|
+
export type { SkeletonProps } from "./Skeleton";
|
|
7
|
+
export { EmptyState } from "./EmptyState";
|
|
8
|
+
export type { EmptyStateProps } from "./EmptyState";
|
|
9
|
+
export { Table } from "./Table";
|
|
10
|
+
export type { TableProps, Column } from "./Table";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps, FeedbackVariant } from "../../core/types";
|
|
3
|
+
import "./Alert.css";
|
|
4
|
+
export interface AlertProps extends CommonProps {
|
|
5
|
+
variant?: FeedbackVariant;
|
|
6
|
+
children: JSX.Element;
|
|
7
|
+
onDismiss?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function Alert(props: AlertProps): JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./Dialog.css";
|
|
4
|
+
export interface DialogProps extends CommonProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
children: JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export interface DialogHeaderProps {
|
|
11
|
+
class?: string;
|
|
12
|
+
children: JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export interface DialogBodyProps {
|
|
15
|
+
class?: string;
|
|
16
|
+
children: JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export interface DialogFooterProps {
|
|
19
|
+
class?: string;
|
|
20
|
+
children: JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export declare function Dialog(props: DialogProps): JSX.Element;
|
|
23
|
+
export declare function DialogHeader(props: DialogHeaderProps): JSX.Element;
|
|
24
|
+
export declare function DialogBody(props: DialogBodyProps): JSX.Element;
|
|
25
|
+
export declare function DialogFooter(props: DialogFooterProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./Drawer.css";
|
|
4
|
+
export interface DrawerProps extends CommonProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
side?: "left" | "right";
|
|
8
|
+
size?: "sm" | "md" | "lg";
|
|
9
|
+
children: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export declare function Drawer(props: DrawerProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommonProps, FeedbackVariant } from "../../core/types";
|
|
2
|
+
import "./Progress.css";
|
|
3
|
+
export interface ProgressProps extends CommonProps {
|
|
4
|
+
value: number;
|
|
5
|
+
variant?: FeedbackVariant;
|
|
6
|
+
size?: "sm" | "md";
|
|
7
|
+
}
|
|
8
|
+
export declare function Progress(props: ProgressProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommonProps } from "../../core/types";
|
|
2
|
+
import "./Spinner.css";
|
|
3
|
+
export interface SpinnerProps extends CommonProps {
|
|
4
|
+
size?: "sm" | "md" | "lg";
|
|
5
|
+
variant?: "primary" | "neutral";
|
|
6
|
+
}
|
|
7
|
+
export declare function Spinner(props: SpinnerProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToastInput } from "../../primitives/createToast";
|
|
2
|
+
import "./Toast.css";
|
|
3
|
+
export interface ToastContainerProps {
|
|
4
|
+
position?: "top-right" | "top-center" | "bottom-right" | "bottom-center";
|
|
5
|
+
}
|
|
6
|
+
export declare function useToast(): {
|
|
7
|
+
add: (input: ToastInput) => string;
|
|
8
|
+
dismiss: (id: string) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function ToastContainer(props: ToastContainerProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Dialog, DialogHeader, DialogBody, DialogFooter } from "./Dialog";
|
|
2
|
+
export type { DialogProps, DialogHeaderProps, DialogBodyProps, DialogFooterProps } from "./Dialog";
|
|
3
|
+
export { Drawer } from "./Drawer";
|
|
4
|
+
export type { DrawerProps } from "./Drawer";
|
|
5
|
+
export { Alert } from "./Alert";
|
|
6
|
+
export type { AlertProps } from "./Alert";
|
|
7
|
+
export { ToastContainer, useToast } from "./Toast";
|
|
8
|
+
export type { ToastContainerProps } from "./Toast";
|
|
9
|
+
export { Progress } from "./Progress";
|
|
10
|
+
export type { ProgressProps } from "./Progress";
|
|
11
|
+
export { Spinner } from "./Spinner";
|
|
12
|
+
export type { SpinnerProps } from "./Spinner";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./Checkbox.css";
|
|
4
|
+
export interface CheckboxProps extends CommonProps {
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
onChange?: (checked: boolean) => void;
|
|
7
|
+
indeterminate?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
size?: "sm" | "md";
|
|
10
|
+
label?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
children?: JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./CheckboxGroup.css";
|
|
4
|
+
export interface CheckboxGroupProps extends CommonProps {
|
|
5
|
+
value?: string[];
|
|
6
|
+
onChange?: (value: string[]) => void;
|
|
7
|
+
label?: string;
|
|
8
|
+
children: JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export declare function CheckboxGroup(props: CheckboxGroupProps): JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface CheckboxGroupContextValue {
|
|
2
|
+
value: () => string[];
|
|
3
|
+
onChange: (itemValue: string, checked: boolean) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const CheckboxGroupContext: import("solid-js").Context<CheckboxGroupContextValue | undefined>;
|
|
6
|
+
export declare function useCheckboxGroup(): CheckboxGroupContextValue | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./FormField.css";
|
|
4
|
+
export interface FormFieldProps extends CommonProps {
|
|
5
|
+
label: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
children: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export declare function FormField(props: FormFieldProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface FormFieldContextValue {
|
|
2
|
+
id: string;
|
|
3
|
+
errorId: string;
|
|
4
|
+
hintId: string;
|
|
5
|
+
hasError: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const FormFieldContext: import("solid-js").Context<FormFieldContextValue | undefined>;
|
|
8
|
+
export declare function useFormField(): FormFieldContextValue | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { InteractiveProps } from "../../core/types";
|
|
3
|
+
import "./NumberInput.css";
|
|
4
|
+
export interface NumberInputProps extends InteractiveProps {
|
|
5
|
+
value?: number;
|
|
6
|
+
onInput?: (value: number) => void;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
label: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function NumberInput(props: NumberInputProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./RadioButton.css";
|
|
4
|
+
export interface RadioButtonProps extends CommonProps {
|
|
5
|
+
value: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
children?: JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export declare function RadioButton(props: RadioButtonProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { CommonProps } from "../../core/types";
|
|
3
|
+
import "./RadioGroup.css";
|
|
4
|
+
export interface RadioGroupProps extends CommonProps {
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
name?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
children: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export declare function RadioGroup(props: RadioGroupProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface RadioGroupContextValue {
|
|
2
|
+
name: string;
|
|
3
|
+
value: () => string | undefined;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const RadioGroupContext: import("solid-js").Context<RadioGroupContextValue | undefined>;
|
|
7
|
+
export declare function useRadioGroup(): RadioGroupContextValue | undefined;
|