lucent-ui 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +37 -37
- package/dist/index.d.ts +19 -0
- package/dist/index.js +826 -715
- package/dist-cli/cli/entry.js +0 -0
- package/dist-cli/cli/index.js +0 -0
- package/dist-server/server/index.js +0 -0
- package/dist-server/src/components/atoms/Progress/Progress.manifest.js +33 -0
- package/dist-server/src/manifest/validate.test.js +28 -0
- package/package.json +15 -13
package/dist-cli/cli/entry.js
CHANGED
|
File without changes
|
package/dist-cli/cli/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const COMPONENT_MANIFEST = {
|
|
2
|
+
id: 'progress',
|
|
3
|
+
name: 'Progress',
|
|
4
|
+
tier: 'atom',
|
|
5
|
+
domain: 'neutral',
|
|
6
|
+
specVersion: '0.1',
|
|
7
|
+
description: 'A horizontal bar indicating completion, progress, or resource usage.',
|
|
8
|
+
designIntent: 'Use Progress to visualise a bounded numeric value — task completion, disk usage, health bars, etc. ' +
|
|
9
|
+
'Set warnAt/dangerAt thresholds for automatic colour shifts instead of hardcoding variants. ' +
|
|
10
|
+
'Ascending thresholds (warnAt < dangerAt) suit "high is bad" metrics like CPU; ' +
|
|
11
|
+
'descending thresholds (warnAt > dangerAt) suit "low is bad" metrics like battery.',
|
|
12
|
+
props: [
|
|
13
|
+
{ name: 'value', type: 'number', required: true, description: 'Current progress value.' },
|
|
14
|
+
{ name: 'max', type: 'number', required: false, default: '100', description: 'Maximum value.' },
|
|
15
|
+
{ name: 'variant', type: 'enum', required: false, default: 'accent', description: 'Colour variant. Overridden when thresholds are set.', enumValues: ['accent', 'success', 'warning', 'danger'] },
|
|
16
|
+
{ name: 'size', type: 'enum', required: false, default: 'md', description: 'Bar height.', enumValues: ['sm', 'md', 'lg'] },
|
|
17
|
+
{ name: 'warnAt', type: 'number', required: false, description: 'Value at which variant auto-switches to warning.' },
|
|
18
|
+
{ name: 'dangerAt', type: 'number', required: false, description: 'Value at which variant auto-switches to danger.' },
|
|
19
|
+
{ name: 'label', type: 'union', required: false, description: 'true shows percentage; ReactNode shows custom label.' },
|
|
20
|
+
],
|
|
21
|
+
usageExamples: [
|
|
22
|
+
{ title: 'Basic', code: `<Progress value={60} />` },
|
|
23
|
+
{ title: 'With label', code: `<Progress value={42} label />` },
|
|
24
|
+
{ title: 'Thresholds', code: `<Progress value={85} warnAt={70} dangerAt={90} label />` },
|
|
25
|
+
{ title: 'Danger variant', code: `<Progress value={95} variant="danger" size="lg" label />` },
|
|
26
|
+
],
|
|
27
|
+
compositionGraph: [],
|
|
28
|
+
accessibility: {
|
|
29
|
+
role: 'progressbar',
|
|
30
|
+
ariaAttributes: ['aria-valuenow', 'aria-valuemin', 'aria-valuemax'],
|
|
31
|
+
notes: 'Uses native progressbar role. Add aria-label on the wrapping element for screen-reader context.',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
2
|
+
import { validateManifest } from './validate.js';
|
|
3
|
+
// Auto-discover all component manifests
|
|
4
|
+
const manifestModules = import.meta.glob('../components/**/*.manifest.ts', { eager: true });
|
|
5
|
+
const manifests = Object.entries(manifestModules).map(([path, mod]) => {
|
|
6
|
+
const m = mod;
|
|
7
|
+
const manifest = m['COMPONENT_MANIFEST'];
|
|
8
|
+
return { path, manifest };
|
|
9
|
+
});
|
|
10
|
+
describe('Component manifests', () => {
|
|
11
|
+
test('at least one manifest was discovered', () => {
|
|
12
|
+
expect(manifests.length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
for (const { path, manifest } of manifests) {
|
|
15
|
+
const label = path.replace('../components/', '').replace('.manifest.ts', '');
|
|
16
|
+
test(`${label} — exports COMPONENT_MANIFEST`, () => {
|
|
17
|
+
expect(manifest).toBeDefined();
|
|
18
|
+
});
|
|
19
|
+
test(`${label} — passes schema validation`, () => {
|
|
20
|
+
const result = validateManifest(manifest);
|
|
21
|
+
if (!result.valid) {
|
|
22
|
+
const messages = result.errors.map(e => ` ${e.field}: ${e.message}`).join('\n');
|
|
23
|
+
throw new Error(`Invalid manifest:\n${messages}`);
|
|
24
|
+
}
|
|
25
|
+
expect(result.valid).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lucent-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "An AI-first React component library with machine-readable manifests.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -25,6 +25,18 @@
|
|
|
25
25
|
"dist-server",
|
|
26
26
|
"dist-cli"
|
|
27
27
|
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "vite --config vite.dev.config.ts",
|
|
30
|
+
"build": "vite build",
|
|
31
|
+
"build:server": "tsc -p server/tsconfig.json",
|
|
32
|
+
"build:cli": "tsc -p cli/tsconfig.json && cp cli/template.manifest.json dist-cli/cli/template.manifest.json",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"prepublishOnly": "tsc --noEmit && pnpm build && pnpm build:server && pnpm build:cli",
|
|
36
|
+
"changeset": "changeset",
|
|
37
|
+
"version-packages": "changeset version",
|
|
38
|
+
"release": "pnpm prepublishOnly && changeset publish"
|
|
39
|
+
},
|
|
28
40
|
"keywords": [
|
|
29
41
|
"react",
|
|
30
42
|
"component-library",
|
|
@@ -39,6 +51,7 @@
|
|
|
39
51
|
},
|
|
40
52
|
"author": "Rozina Szogyenyi",
|
|
41
53
|
"license": "MIT",
|
|
54
|
+
"packageManager": "pnpm@10.30.3",
|
|
42
55
|
"peerDependencies": {
|
|
43
56
|
"react": "^18.0.0 || ^19.0.0",
|
|
44
57
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -60,16 +73,5 @@
|
|
|
60
73
|
"dependencies": {
|
|
61
74
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
62
75
|
"zod": "^4.3.6"
|
|
63
|
-
},
|
|
64
|
-
"scripts": {
|
|
65
|
-
"dev": "vite --config vite.dev.config.ts",
|
|
66
|
-
"build": "vite build",
|
|
67
|
-
"build:server": "tsc -p server/tsconfig.json",
|
|
68
|
-
"build:cli": "tsc -p cli/tsconfig.json && cp cli/template.manifest.json dist-cli/cli/template.manifest.json",
|
|
69
|
-
"test": "vitest run",
|
|
70
|
-
"test:watch": "vitest",
|
|
71
|
-
"changeset": "changeset",
|
|
72
|
-
"version-packages": "changeset version",
|
|
73
|
-
"release": "pnpm prepublishOnly && changeset publish"
|
|
74
76
|
}
|
|
75
|
-
}
|
|
77
|
+
}
|