lucent-ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,30 +1,37 @@
1
1
  # Lucent UI
2
2
 
3
- > An AI-first React component library. Every component ships with a machine-readable manifest so AI coding assistants generate correct, on-brand UI the first time.
3
+ [![CI](https://github.com/rozinashopify/lucent-ui/actions/workflows/ci.yml/badge.svg)](https://github.com/rozinashopify/lucent-ui/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/lucent-ui)](https://www.npmjs.com/package/lucent-ui)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
6
+
7
+ > **The React component library built for AI coding assistants.**
8
+ > Every component ships with a machine-readable manifest — so Claude, Cursor, and Copilot generate correct, on-brand UI the first time, every time.
4
9
 
5
10
  ---
6
11
 
7
- ## Status
12
+ ## Why Lucent UI?
13
+
14
+ AI tools generate UI from natural language. Without structure, they guess at prop names, invent variants that don't exist, and ignore design intent.
8
15
 
9
- 🚧 Under active developmentsee the [project board](https://github.com/users/rozinashopify/projects/3) for progress.
16
+ Lucent UI solves this with `COMPONENT_MANIFEST` a structured descriptor attached to every component and exposed via an **MCP server**. Your AI assistant calls `get_component_manifest("Button")` and gets back the full prop API, usage examples, and design intent. No more hallucinated props.
10
17
 
11
18
  ---
12
19
 
13
20
  ## Quick start
14
21
 
15
22
  ```bash
16
- # Install
17
23
  pnpm add lucent-ui
18
24
  ```
19
25
 
20
26
  ```tsx
21
- import { LucentProvider } from 'lucent-ui';
27
+ import { LucentProvider, Button, Badge } from 'lucent-ui';
22
28
  import 'lucent-ui/styles';
23
29
 
24
- function App() {
30
+ export default function App() {
25
31
  return (
26
32
  <LucentProvider>
27
- {/* your app */}
33
+ <Button variant="primary">Get started</Button>
34
+ <Badge variant="success">Live</Badge>
28
35
  </LucentProvider>
29
36
  );
30
37
  }
@@ -32,33 +39,77 @@ function App() {
32
39
 
33
40
  ---
34
41
 
42
+ ## Components
43
+
44
+ ### Atoms
45
+ | Component | Description |
46
+ |-----------|-------------|
47
+ | `Button` | Clickable control with `primary`, `secondary`, `ghost`, `danger` variants |
48
+ | `Badge` | Inline status label |
49
+ | `Avatar` | User avatar with image, initials, and icon fallback |
50
+ | `Input` | Text input with label, helper text, and error state |
51
+ | `Textarea` | Multi-line text input |
52
+ | `Checkbox` | Controlled checkbox with spring animation |
53
+ | `Radio` / `RadioGroup` | Radio button with group context |
54
+ | `Toggle` | On/off switch |
55
+ | `Select` | Native select with styled appearance |
56
+ | `Tag` | Removable or static tag/chip |
57
+ | `Tooltip` | Hover tooltip with placement options |
58
+ | `Icon` | SVG icon wrapper (Lucide-compatible) |
59
+ | `Text` | Polymorphic typography primitive (`p`, `h1`–`h6`, `span`, `code`, …) |
60
+ | `Spinner` | Loading indicator |
61
+ | `Divider` | Horizontal or vertical rule |
62
+
63
+ ### Molecules
64
+ | Component | Description |
65
+ |-----------|-------------|
66
+ | `FormField` | Label + input + helper/error text composition |
67
+ | `SearchInput` | Input with built-in search icon and clear button |
68
+ | `Card` | Surface container with header, body, and footer slots |
69
+ | `Alert` | Inline feedback banner (`info`, `success`, `warning`, `danger`) |
70
+ | `EmptyState` | Zero-data placeholder with icon, title, and action |
71
+ | `Skeleton` | Loading placeholder for content areas |
72
+
73
+ ---
74
+
35
75
  ## What is a COMPONENT_MANIFEST?
36
76
 
37
- Every component exports a machine-readable manifest describing its props, usage examples, composition graph, and design intent. This lets AI tools like Claude and Cursor generate correct, on-brand code without guessing.
77
+ Every component exports a typed manifest describing its full API:
38
78
 
39
79
  ```ts
40
- import { Button, ButtonManifest } from 'lucent-ui';
80
+ import { ButtonManifest } from 'lucent-ui';
41
81
 
42
82
  console.log(ButtonManifest);
43
83
  // {
44
84
  // id: 'button',
45
85
  // name: 'Button',
46
86
  // tier: 'atom',
47
- // props: [...],
87
+ // description: 'A clickable control that triggers an action.',
88
+ // props: [
89
+ // { name: 'variant', type: 'enum', enumValues: ['primary','secondary','ghost','danger'], ... },
90
+ // { name: 'size', type: 'enum', enumValues: ['sm','md','lg'], ... },
91
+ // ...
92
+ // ],
48
93
  // usageExamples: [...],
49
- // designIntent: '...',
94
+ // designIntent: 'Use "primary" for the single most important action...',
95
+ // compositionGraph: [],
96
+ // specVersion: '0.1',
50
97
  // }
51
98
  ```
52
99
 
100
+ See [`docs/COMPONENT_MANIFEST_SPEC.md`](docs/COMPONENT_MANIFEST_SPEC.md) for the full specification.
101
+
53
102
  ---
54
103
 
55
104
  ## MCP Server
56
105
 
57
106
  Connect Lucent UI's manifest layer to your AI coding tool. The server exposes three tools:
58
107
 
59
- - **`list_components`** all component names + tiers
60
- - **`get_component_manifest(componentName)`** — full manifest JSON for a component
61
- - **`search_components(query)`** components matching a description
108
+ | Tool | Description |
109
+ |------|-------------|
110
+ | `list_components` | All component names and tiers |
111
+ | `get_component_manifest(name)` | Full manifest JSON for a component |
112
+ | `search_components(query)` | Components matching a natural-language description |
62
113
 
63
114
  ### Cursor
64
115
 
@@ -68,8 +119,7 @@ Connect Lucent UI's manifest layer to your AI coding tool. The server exposes th
68
119
  "mcpServers": {
69
120
  "lucent-ui": {
70
121
  "command": "npx",
71
- "args": ["lucent-mcp"],
72
- "env": { "LUCENT_API_KEY": "your-key" }
122
+ "args": ["lucent-mcp"]
73
123
  }
74
124
  }
75
125
  }
@@ -83,14 +133,13 @@ Connect Lucent UI's manifest layer to your AI coding tool. The server exposes th
83
133
  "mcpServers": {
84
134
  "lucent-ui": {
85
135
  "command": "npx",
86
- "args": ["lucent-mcp"],
87
- "env": { "LUCENT_API_KEY": "your-key" }
136
+ "args": ["lucent-mcp"]
88
137
  }
89
138
  }
90
139
  }
91
140
  ```
92
141
 
93
- ### Run locally
142
+ ### Run locally (dev)
94
143
 
95
144
  ```bash
96
145
  node dist-server/server/index.js
@@ -98,6 +147,33 @@ node dist-server/server/index.js
98
147
 
99
148
  ---
100
149
 
150
+ ## Theming
151
+
152
+ Lucent UI uses CSS custom properties — no CSS-in-JS, no runtime overhead.
153
+
154
+ ```tsx
155
+ import { LucentProvider, brandTokens } from 'lucent-ui';
156
+
157
+ // Default neutral theme
158
+ <LucentProvider>...</LucentProvider>
159
+
160
+ // Built-in gold accent preset
161
+ <LucentProvider tokens={brandTokens}>...</LucentProvider>
162
+
163
+ // Fully custom
164
+ <LucentProvider tokens={{ accentDefault: '#6366f1', accentHover: '#4f46e5' }}>
165
+ ...
166
+ </LucentProvider>
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Contributing
172
+
173
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
174
+
175
+ ---
176
+
101
177
  ## License
102
178
 
103
179
  MIT