@j3m-quantum/ui 1.0.0 → 1.3.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 +248 -39
- package/cursor-rules-for-consumers.md +171 -28
- package/dist/index.cjs +3925 -409
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +671 -3
- package/dist/index.d.ts +671 -3
- package/dist/index.js +3820 -409
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1540 -279
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ J3M Quantum UI - A React component library with J3M design tokens.
|
|
|
13
13
|
- **J3M Design Tokens** - Orange primary, neutral grays, pill-shaped buttons
|
|
14
14
|
- **Dark Mode** - Full dark theme support via `.dark` class
|
|
15
15
|
- **Glass Mode** - Frosted glass effects via `.theme-glass` class
|
|
16
|
-
- **
|
|
16
|
+
- **60+ Components** - Complete UI component library with J3M styling
|
|
17
17
|
- **All-in-One** - Everything bundled, just install and use
|
|
18
18
|
- **Smooth Animations** - Powered by tw-animate-css
|
|
19
19
|
|
|
@@ -67,69 +67,97 @@ import { Button, Card, Input, Dialog, DialogTrigger, DialogContent } from '@j3m-
|
|
|
67
67
|
|
|
68
68
|
function App() {
|
|
69
69
|
return (
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
<div className="j3m-app-bg min-h-screen p-8">
|
|
71
|
+
<Card className="glass-context">
|
|
72
|
+
<Input placeholder="Enter email" />
|
|
73
|
+
<Dialog>
|
|
74
|
+
<DialogTrigger asChild>
|
|
75
|
+
<Button>Open Dialog</Button>
|
|
76
|
+
</DialogTrigger>
|
|
77
|
+
<DialogContent>
|
|
78
|
+
<p>This dialog has smooth animations!</p>
|
|
79
|
+
</DialogContent>
|
|
80
|
+
</Dialog>
|
|
81
|
+
</Card>
|
|
82
|
+
</div>
|
|
81
83
|
)
|
|
82
84
|
}
|
|
83
85
|
```
|
|
84
86
|
|
|
85
87
|
## Theme Modes
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
The design system supports four theme modes. Use the `.j3m-app-bg` utility class for proper backgrounds:
|
|
90
|
+
|
|
91
|
+
### Light Mode (Default)
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<div className="j3m-app-bg">
|
|
95
|
+
{/* Light themed content */}
|
|
96
|
+
</div>
|
|
97
|
+
```
|
|
88
98
|
|
|
89
|
-
|
|
99
|
+
### Dark Mode
|
|
90
100
|
|
|
91
101
|
```tsx
|
|
92
|
-
<div className="dark">
|
|
102
|
+
<div className="dark j3m-app-bg">
|
|
93
103
|
{/* Dark themed content */}
|
|
94
104
|
</div>
|
|
95
105
|
```
|
|
96
106
|
|
|
97
|
-
### Glass Mode
|
|
107
|
+
### Glass Mode (Light)
|
|
98
108
|
|
|
99
|
-
|
|
109
|
+
Frosted glass on colorful gradient or image background:
|
|
100
110
|
|
|
101
111
|
```tsx
|
|
102
|
-
<div className="theme-glass">
|
|
103
|
-
{/*
|
|
112
|
+
<div className="theme-glass j3m-app-bg">
|
|
113
|
+
{/* Light glass themed content */}
|
|
104
114
|
</div>
|
|
105
115
|
```
|
|
106
116
|
|
|
107
|
-
|
|
117
|
+
### Glass Mode (Dark)
|
|
118
|
+
|
|
119
|
+
Dark frosted glass on deep gradient - sophisticated industrial aesthetic:
|
|
108
120
|
|
|
109
121
|
```tsx
|
|
110
|
-
<div className="dark theme-glass">
|
|
122
|
+
<div className="dark theme-glass j3m-app-bg">
|
|
111
123
|
{/* Dark glass themed content */}
|
|
112
124
|
</div>
|
|
113
125
|
```
|
|
114
126
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
### Color System: Radix 12-Step Scale
|
|
127
|
+
### Custom Background Images
|
|
118
128
|
|
|
119
|
-
|
|
129
|
+
In glass mode, you can set a custom background image:
|
|
120
130
|
|
|
121
131
|
```css
|
|
122
|
-
/* Change accent color once, updates everywhere */
|
|
123
132
|
:root {
|
|
124
|
-
--
|
|
133
|
+
--j3m-bg-image: url('/your-background.jpg');
|
|
125
134
|
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Glass Context
|
|
126
138
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
139
|
+
When using glass mode, cards containing interactive components (inputs, buttons, selects) need the `glass-context` class for proper styling:
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
// Correct - inputs and buttons styled properly in glass mode
|
|
143
|
+
<Card className="glass-context">
|
|
144
|
+
<CardHeader>
|
|
145
|
+
<CardTitle>Contact Form</CardTitle>
|
|
146
|
+
</CardHeader>
|
|
147
|
+
<CardContent>
|
|
148
|
+
<Input placeholder="Name" />
|
|
149
|
+
<Button>Submit</Button>
|
|
150
|
+
</CardContent>
|
|
151
|
+
</Card>
|
|
130
152
|
```
|
|
131
153
|
|
|
132
|
-
|
|
154
|
+
**Note:** Portal components (Dialog, Sheet, Popover, Select dropdown) automatically adapt to the current theme mode - no `glass-context` needed.
|
|
155
|
+
|
|
156
|
+
## Design Tokens
|
|
157
|
+
|
|
158
|
+
### Color System: 12-Step Scale
|
|
159
|
+
|
|
160
|
+
Colors use HEX format for simplicity and compatibility:
|
|
133
161
|
|
|
134
162
|
| Scale | Steps | Purpose |
|
|
135
163
|
|-------|-------|---------|
|
|
@@ -150,7 +178,7 @@ background: hsl(var(--primary) / 0.3); /* 30% opacity */
|
|
|
150
178
|
|
|
151
179
|
| Token | Description |
|
|
152
180
|
|-------|-------------|
|
|
153
|
-
| `--primary` | Brand accent (
|
|
181
|
+
| `--primary` | Brand accent (#F58446) |
|
|
154
182
|
| `--background` | Page background |
|
|
155
183
|
| `--foreground` | Main text |
|
|
156
184
|
| `--muted` | Subtle backgrounds |
|
|
@@ -158,6 +186,42 @@ background: hsl(var(--primary) / 0.3); /* 30% opacity */
|
|
|
158
186
|
| `--ring` | Focus rings |
|
|
159
187
|
| `--radius` | Global border radius (12px) |
|
|
160
188
|
|
|
189
|
+
### Background & Surface Tokens
|
|
190
|
+
|
|
191
|
+
A hierarchical system that adapts to all four theme modes automatically:
|
|
192
|
+
|
|
193
|
+
| Token | Purpose |
|
|
194
|
+
|-------|---------|
|
|
195
|
+
| `--j3m-bg-app` | Root app canvas |
|
|
196
|
+
| `--j3m-bg-page` | Content area |
|
|
197
|
+
| `--j3m-bg-surface` | Cards, sections |
|
|
198
|
+
| `--j3m-bg-surface-hover` | Hovered cards |
|
|
199
|
+
| `--j3m-bg-surface-active` | Active/pressed cards |
|
|
200
|
+
| `--j3m-bg-elevated` | Raised elements |
|
|
201
|
+
| `--j3m-bg-overlay` | Popovers, tooltips |
|
|
202
|
+
| `--j3m-bg-muted` | Subtle backgrounds |
|
|
203
|
+
| `--j3m-bg-subtle` | Very subtle backgrounds |
|
|
204
|
+
| `--j3m-bg-element` | Interactive elements |
|
|
205
|
+
| `--j3m-bg-input` | Input backgrounds |
|
|
206
|
+
| `--j3m-bg-sidebar` | Sidebar background |
|
|
207
|
+
|
|
208
|
+
These tokens automatically resolve to the correct values in each theme mode:
|
|
209
|
+
- **Light/Dark solid**: Solid gray colors
|
|
210
|
+
- **Glass Light**: Frosted white glass fills
|
|
211
|
+
- **Glass Dark**: Dark frosted glass with blue tint
|
|
212
|
+
|
|
213
|
+
### Dark Glass Primitives
|
|
214
|
+
|
|
215
|
+
For advanced dark glass customization:
|
|
216
|
+
|
|
217
|
+
| Token | Description |
|
|
218
|
+
|-------|-------------|
|
|
219
|
+
| `--j3m-glass-dark-surface` | Main dark glass surface |
|
|
220
|
+
| `--j3m-glass-dark-elevated` | Elevated dark glass |
|
|
221
|
+
| `--j3m-glass-dark-overlay` | Dark glass overlays |
|
|
222
|
+
| `--j3m-glass-dark-border` | Subtle white border |
|
|
223
|
+
| `--j3m-glass-dark-element` | Interactive element highlight |
|
|
224
|
+
|
|
161
225
|
## Included Dependencies
|
|
162
226
|
|
|
163
227
|
All of these are bundled and ready to use:
|
|
@@ -176,31 +240,163 @@ All of these are bundled and ready to use:
|
|
|
176
240
|
## Exports
|
|
177
241
|
|
|
178
242
|
```typescript
|
|
179
|
-
//
|
|
180
|
-
import {
|
|
243
|
+
// Everything from one package!
|
|
244
|
+
import {
|
|
245
|
+
Button, Card, Dialog, Input,
|
|
246
|
+
SidebarProvider, Sidebar, SidebarContent,
|
|
247
|
+
NavMain, NavUser, SiteHeader,
|
|
248
|
+
EventCalendar, ThemeSwitch
|
|
249
|
+
} from '@j3m-quantum/ui'
|
|
181
250
|
|
|
182
251
|
// Styles (CSS)
|
|
183
252
|
import '@j3m-quantum/ui/styles'
|
|
184
253
|
```
|
|
185
254
|
|
|
255
|
+
## Components
|
|
256
|
+
|
|
257
|
+
### Inputs
|
|
258
|
+
Button, ButtonGroup, Input, InputGroup, Textarea, Checkbox, RadioGroup, Switch, Slider, Select, NativeSelect, Toggle, ToggleGroup, Form, Field, Label, CopyButton
|
|
259
|
+
|
|
260
|
+
### Display
|
|
261
|
+
Card, Table, Badge, Avatar, UserAvatarsDropdown, Separator, Skeleton, Accordion, Tabs, Calendar, EventCalendar, Carousel, Chart, AspectRatio, Empty, Item, Kbd
|
|
262
|
+
|
|
263
|
+
### Feedback
|
|
264
|
+
Alert, AlertDialog, Progress, Tooltip, Sonner (Toast), Spinner
|
|
265
|
+
|
|
266
|
+
### Navigation
|
|
267
|
+
Breadcrumb, Pagination, Command, SearchTrigger, DropdownMenu, Menubar, NavigationMenu, ContextMenu
|
|
268
|
+
|
|
269
|
+
### Overlay
|
|
270
|
+
Dialog, Drawer, Sheet, Popover, HoverCard
|
|
271
|
+
|
|
272
|
+
### Layout
|
|
273
|
+
ScrollArea, Collapsible, Resizable, Sidebar, SidebarProvider, SidebarInset, Section
|
|
274
|
+
|
|
275
|
+
### Utilities
|
|
276
|
+
ThemeSwitch, ToolbarCanvas, PlayerCanvas
|
|
277
|
+
|
|
278
|
+
## Blocks
|
|
279
|
+
|
|
280
|
+
Pre-built, composable sidebar components for enterprise applications.
|
|
281
|
+
|
|
282
|
+
### Sidebar with Header
|
|
283
|
+
|
|
284
|
+
A collapsible sidebar with sticky header, based on shadcn's sidebar-16.
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
import {
|
|
288
|
+
SidebarProvider,
|
|
289
|
+
SidebarInset,
|
|
290
|
+
SidebarTrigger,
|
|
291
|
+
Sidebar,
|
|
292
|
+
SidebarContent,
|
|
293
|
+
SidebarFooter,
|
|
294
|
+
SiteHeader,
|
|
295
|
+
NavMain,
|
|
296
|
+
NavUser,
|
|
297
|
+
} from '@j3m-quantum/ui'
|
|
298
|
+
import { HomeIcon, SettingsIcon } from 'lucide-react'
|
|
299
|
+
|
|
300
|
+
const navItems = [
|
|
301
|
+
{
|
|
302
|
+
title: "Dashboard",
|
|
303
|
+
url: "/dashboard",
|
|
304
|
+
icon: HomeIcon,
|
|
305
|
+
isActive: true,
|
|
306
|
+
items: [
|
|
307
|
+
{ title: "Overview", url: "/dashboard" },
|
|
308
|
+
{ title: "Analytics", url: "/dashboard/analytics" },
|
|
309
|
+
],
|
|
310
|
+
},
|
|
311
|
+
]
|
|
312
|
+
|
|
313
|
+
export default function Dashboard() {
|
|
314
|
+
return (
|
|
315
|
+
<div style={{ "--header-height": "3.5rem" }}>
|
|
316
|
+
<SidebarProvider>
|
|
317
|
+
<SiteHeader
|
|
318
|
+
trigger={<SidebarTrigger />}
|
|
319
|
+
breadcrumbs={[{ label: "Dashboard" }]}
|
|
320
|
+
/>
|
|
321
|
+
<div className="flex flex-1">
|
|
322
|
+
<Sidebar>
|
|
323
|
+
<SidebarContent>
|
|
324
|
+
<NavMain items={navItems} />
|
|
325
|
+
</SidebarContent>
|
|
326
|
+
<SidebarFooter>
|
|
327
|
+
<NavUser user={{ name: "User", email: "user@example.com", avatar: "" }} />
|
|
328
|
+
</SidebarFooter>
|
|
329
|
+
</Sidebar>
|
|
330
|
+
<SidebarInset>
|
|
331
|
+
<main className="p-4">
|
|
332
|
+
{/* Your content */}
|
|
333
|
+
</main>
|
|
334
|
+
</SidebarInset>
|
|
335
|
+
</div>
|
|
336
|
+
</SidebarProvider>
|
|
337
|
+
</div>
|
|
338
|
+
)
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Block Components
|
|
343
|
+
|
|
344
|
+
| Component | Description |
|
|
345
|
+
|-----------|-------------|
|
|
346
|
+
| `SiteHeader` | Sticky header with breadcrumbs and trigger slot |
|
|
347
|
+
| `NavMain` | Collapsible navigation groups with sub-items |
|
|
348
|
+
| `NavProjects` | Projects section with dropdown actions |
|
|
349
|
+
| `NavSecondary` | Secondary links (Support, Feedback) |
|
|
350
|
+
| `NavUser` | User avatar with dropdown menu |
|
|
351
|
+
| `SearchForm` | Search input component |
|
|
352
|
+
|
|
353
|
+
### Custom Navigation
|
|
354
|
+
|
|
355
|
+
```tsx
|
|
356
|
+
import { NavMain, type NavItem } from '@j3m-quantum/ui'
|
|
357
|
+
import { HomeIcon, SettingsIcon } from 'lucide-react'
|
|
358
|
+
|
|
359
|
+
const navItems: NavItem[] = [
|
|
360
|
+
{
|
|
361
|
+
title: "Dashboard",
|
|
362
|
+
url: "/dashboard",
|
|
363
|
+
icon: HomeIcon,
|
|
364
|
+
isActive: true,
|
|
365
|
+
items: [
|
|
366
|
+
{ title: "Overview", url: "/dashboard" },
|
|
367
|
+
{ title: "Analytics", url: "/dashboard/analytics" },
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
title: "Settings",
|
|
372
|
+
url: "/settings",
|
|
373
|
+
icon: SettingsIcon,
|
|
374
|
+
items: [
|
|
375
|
+
{ title: "Profile", url: "/settings/profile" },
|
|
376
|
+
{ title: "Team", url: "/settings/team" },
|
|
377
|
+
],
|
|
378
|
+
},
|
|
379
|
+
]
|
|
380
|
+
|
|
381
|
+
<NavMain items={navItems} />
|
|
382
|
+
```
|
|
383
|
+
|
|
186
384
|
## Customization
|
|
187
385
|
|
|
188
|
-
Override CSS variables after the import
|
|
386
|
+
Override CSS variables after the import:
|
|
189
387
|
|
|
190
388
|
```css
|
|
191
389
|
@import "tailwindcss";
|
|
192
390
|
@import "tw-animate-css";
|
|
193
391
|
@import "@j3m-quantum/ui/styles";
|
|
194
392
|
|
|
195
|
-
/* Custom overrides
|
|
393
|
+
/* Custom overrides */
|
|
196
394
|
:root {
|
|
197
|
-
--primary:
|
|
395
|
+
--primary: #3B82F6; /* Blue accent instead of orange */
|
|
198
396
|
--radius: 8px;
|
|
199
397
|
}
|
|
200
398
|
```
|
|
201
399
|
|
|
202
|
-
The HSL format allows automatic opacity variations throughout the UI.
|
|
203
|
-
|
|
204
400
|
## Troubleshooting
|
|
205
401
|
|
|
206
402
|
### Animations not working (Dialog, Sheet, Select, etc.)
|
|
@@ -222,6 +418,15 @@ export default defineConfig({
|
|
|
222
418
|
})
|
|
223
419
|
```
|
|
224
420
|
|
|
421
|
+
### Components look wrong in glass mode
|
|
422
|
+
Make sure to add `glass-context` class to Cards containing interactive components:
|
|
423
|
+
```tsx
|
|
424
|
+
<Card className="glass-context">
|
|
425
|
+
<Input />
|
|
426
|
+
<Button>Submit</Button>
|
|
427
|
+
</Card>
|
|
428
|
+
```
|
|
429
|
+
|
|
225
430
|
## Cursor Rules (AI Assistant)
|
|
226
431
|
|
|
227
432
|
If your team uses Cursor or AI coding assistants, we provide ready-to-use rules to ensure consistent usage of the design system.
|
|
@@ -253,6 +458,10 @@ npm update @j3m-quantum/ui
|
|
|
253
458
|
npm install @j3m-quantum/ui@latest
|
|
254
459
|
```
|
|
255
460
|
|
|
461
|
+
## Third-Party Licenses
|
|
462
|
+
|
|
463
|
+
- **Event Calendar**: Based on [big-calendar](https://github.com/lramos33/big-calendar) by Leonardo Ramos, MIT License
|
|
464
|
+
|
|
256
465
|
## License
|
|
257
466
|
|
|
258
467
|
MIT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# J3M Quantum UI - Cursor Rules
|
|
2
2
|
|
|
3
|
-
Copy the rules below to `.cursor/rules` in your project to help AI assistants use the J3M Design System correctly.
|
|
3
|
+
Copy the rules below to `.cursor/rules` or `.cursorrules` in your project to help AI assistants use the J3M Design System correctly.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -13,6 +13,7 @@ Copy the rules below to `.cursor/rules` in your project to help AI assistants us
|
|
|
13
13
|
- This project uses @j3m-quantum/ui - a complete React component library with J3M styling
|
|
14
14
|
- Import components directly: `import { Button, Card, Input } from '@j3m-quantum/ui'`
|
|
15
15
|
- Do NOT use shadcn CLI to add components - everything is already bundled
|
|
16
|
+
- Do NOT create local component copies - use the package exports
|
|
16
17
|
|
|
17
18
|
## CSS Import Order (Critical)
|
|
18
19
|
The order in src/index.css must be:
|
|
@@ -22,44 +23,164 @@ The order in src/index.css must be:
|
|
|
22
23
|
@import "@j3m-quantum/ui/styles"; /* J3M theme and tokens */
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
## Theme Modes
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
## Theme Modes (4 Modes)
|
|
27
|
+
The design system supports four theme modes:
|
|
28
|
+
|
|
29
|
+
| Mode | Classes | Description |
|
|
30
|
+
|------|---------|-------------|
|
|
31
|
+
| Light Solid | (default) | Opaque surfaces, gray backgrounds |
|
|
32
|
+
| Dark Solid | `dark` | Dark opaque surfaces |
|
|
33
|
+
| Light Glass | `theme-glass` | Frosted glass on image/gradient |
|
|
34
|
+
| Dark Glass | `dark theme-glass` | Dark frosted glass on image |
|
|
35
|
+
|
|
36
|
+
### Setting Up Theme
|
|
37
|
+
```tsx
|
|
38
|
+
// Root element with theme classes and background utility
|
|
39
|
+
<div className="j3m-app-bg"> {/* Light solid */}
|
|
40
|
+
<div className="dark j3m-app-bg"> {/* Dark solid */}
|
|
41
|
+
<div className="theme-glass j3m-app-bg"> {/* Light glass */}
|
|
42
|
+
<div className="dark theme-glass j3m-app-bg"> {/* Dark glass */}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Background Images (Glass Mode)
|
|
46
|
+
Set a custom background image with CSS variable:
|
|
47
|
+
```css
|
|
48
|
+
:root {
|
|
49
|
+
--j3m-bg-image: url('/your-background.jpg');
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Glass Context (Important!)
|
|
54
|
+
In glass mode, cards containing interactive components need the `glass-context` class:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
// Correct - interactive components styled properly
|
|
58
|
+
<Card className="glass-context">
|
|
59
|
+
<CardContent>
|
|
60
|
+
<Input placeholder="Name" />
|
|
61
|
+
<Select>...</Select>
|
|
62
|
+
<Button>Submit</Button>
|
|
63
|
+
</CardContent>
|
|
64
|
+
</Card>
|
|
65
|
+
|
|
66
|
+
// Also works - variant="glass" includes glass-context
|
|
67
|
+
<Card variant="glass">
|
|
68
|
+
<CardContent>...</CardContent>
|
|
69
|
+
</Card>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Without `glass-context`, inputs/buttons inside cards may have incorrect colors in glass mode.
|
|
73
|
+
|
|
74
|
+
## Portal vs In-App Components
|
|
75
|
+
- **Portal components** (Dialog, Sheet, Drawer, Popover, Select dropdown, Command palette):
|
|
76
|
+
Automatically styled correctly for the current theme mode. No extra classes needed.
|
|
77
|
+
|
|
78
|
+
- **In-app components** (cards with forms, interactive content):
|
|
79
|
+
Add `glass-context` class to the parent Card when in glass mode.
|
|
29
80
|
|
|
30
81
|
## J3M Design Tokens
|
|
31
82
|
- Primary: #F58446 (orange) - use `bg-primary`, `text-primary`
|
|
32
83
|
- Destructive: #FB3748 (red) - use `bg-destructive`
|
|
33
|
-
- Background:
|
|
34
|
-
- Foreground:
|
|
35
|
-
- Muted:
|
|
84
|
+
- Background: adapts to theme mode - use `bg-background`
|
|
85
|
+
- Foreground: adapts to theme mode - use `text-foreground`
|
|
86
|
+
- Muted: subtle backgrounds - use `bg-muted`, `text-muted-foreground`
|
|
36
87
|
- Radius: Components use pill shape (rounded-full) for buttons/inputs
|
|
37
88
|
|
|
38
89
|
## DO
|
|
39
90
|
- Import all components from @j3m-quantum/ui
|
|
40
91
|
- Use Tailwind semantic classes: bg-primary, text-muted-foreground, bg-accent
|
|
41
92
|
- Use CSS variables for custom styling: var(--primary), var(--background)
|
|
93
|
+
- Use `glass-context` class on Cards with interactive components in glass mode
|
|
42
94
|
- Check the component catalogue before building custom components
|
|
95
|
+
- Use the j3m-app-bg class on root element for proper backgrounds
|
|
43
96
|
|
|
44
97
|
## DON'T
|
|
45
98
|
- Don't use shadcn CLI - components are already bundled
|
|
46
|
-
- Don't override CSS
|
|
99
|
+
- Don't override component CSS unless approved by design system maintainer
|
|
47
100
|
- Don't use arbitrary color values like bg-[#F58446] - use bg-primary
|
|
48
101
|
- Don't recreate existing components - use what's in @j3m-quantum/ui
|
|
49
102
|
- Don't modify component border-radius - pill shapes are intentional
|
|
103
|
+
- Don't style portal components manually - they auto-adapt to theme
|
|
104
|
+
|
|
105
|
+
## Available Components (60+)
|
|
106
|
+
|
|
107
|
+
### Inputs
|
|
108
|
+
Button, ButtonGroup, Input, InputGroup, Textarea, Checkbox, RadioGroup, Switch, Slider, Select, NativeSelect, Toggle, ToggleGroup, Form, Field, Label, CopyButton
|
|
109
|
+
|
|
110
|
+
### Display
|
|
111
|
+
Card, Table, Badge, Avatar, UserAvatarsDropdown, Separator, Skeleton, Accordion, Tabs, Calendar, EventCalendar, Carousel, Chart, AspectRatio, Empty, Item, Kbd
|
|
50
112
|
|
|
51
|
-
|
|
52
|
-
|
|
113
|
+
### Feedback
|
|
114
|
+
Alert, AlertDialog, Progress, Tooltip, Sonner (Toast), Spinner
|
|
53
115
|
|
|
54
|
-
|
|
116
|
+
### Navigation
|
|
117
|
+
Breadcrumb, Pagination, Command, SearchTrigger, DropdownMenu, Menubar, NavigationMenu, ContextMenu
|
|
55
118
|
|
|
56
|
-
|
|
119
|
+
### Overlay
|
|
120
|
+
Dialog, Drawer, Sheet, Popover, HoverCard
|
|
57
121
|
|
|
58
|
-
|
|
122
|
+
### Layout
|
|
123
|
+
ScrollArea, Collapsible, Resizable, Sidebar, SidebarProvider, SidebarInset, Section
|
|
59
124
|
|
|
60
|
-
|
|
125
|
+
### Blocks (Pre-built compositions)
|
|
126
|
+
SiteHeader, NavMain, NavProjects, NavSecondary, NavUser, SearchForm
|
|
61
127
|
|
|
62
|
-
|
|
128
|
+
### Utilities
|
|
129
|
+
ThemeSwitch, ToolbarCanvas, PlayerCanvas
|
|
130
|
+
|
|
131
|
+
## Common Patterns
|
|
132
|
+
|
|
133
|
+
### Form in Card (Glass Mode)
|
|
134
|
+
```tsx
|
|
135
|
+
<Card className="glass-context">
|
|
136
|
+
<CardHeader>
|
|
137
|
+
<CardTitle>Contact Form</CardTitle>
|
|
138
|
+
</CardHeader>
|
|
139
|
+
<CardContent className="space-y-4">
|
|
140
|
+
<Input placeholder="Name" />
|
|
141
|
+
<Input placeholder="Email" />
|
|
142
|
+
<Textarea placeholder="Message" />
|
|
143
|
+
<Button>Send</Button>
|
|
144
|
+
</CardContent>
|
|
145
|
+
</Card>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Dashboard Layout
|
|
149
|
+
```tsx
|
|
150
|
+
<SidebarProvider>
|
|
151
|
+
<Sidebar>
|
|
152
|
+
<SidebarContent>
|
|
153
|
+
<NavMain items={navItems} />
|
|
154
|
+
</SidebarContent>
|
|
155
|
+
<SidebarFooter>
|
|
156
|
+
<NavUser user={userData} />
|
|
157
|
+
</SidebarFooter>
|
|
158
|
+
</Sidebar>
|
|
159
|
+
<SidebarInset>
|
|
160
|
+
<SiteHeader breadcrumbs={[{ label: "Dashboard" }]} />
|
|
161
|
+
<main className="p-4">
|
|
162
|
+
{/* Content */}
|
|
163
|
+
</main>
|
|
164
|
+
</SidebarInset>
|
|
165
|
+
</SidebarProvider>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Dialog with Form
|
|
169
|
+
```tsx
|
|
170
|
+
<Dialog>
|
|
171
|
+
<DialogTrigger asChild>
|
|
172
|
+
<Button>Open Form</Button>
|
|
173
|
+
</DialogTrigger>
|
|
174
|
+
<DialogContent>
|
|
175
|
+
<DialogHeader>
|
|
176
|
+
<DialogTitle>Edit Profile</DialogTitle>
|
|
177
|
+
</DialogHeader>
|
|
178
|
+
{/* No glass-context needed - Dialog is a portal */}
|
|
179
|
+
<Input placeholder="Name" />
|
|
180
|
+
<Button>Save</Button>
|
|
181
|
+
</DialogContent>
|
|
182
|
+
</Dialog>
|
|
183
|
+
```
|
|
63
184
|
|
|
64
185
|
## Requesting Changes
|
|
65
186
|
Need a new component or styling change? Don't build it locally.
|
|
@@ -105,23 +226,45 @@ export default defineConfig({
|
|
|
105
226
|
```
|
|
106
227
|
|
|
107
228
|
### 5. Add Cursor Rules
|
|
108
|
-
Create `.cursor/rules` in your project root and paste the rules from above.
|
|
229
|
+
Create `.cursor/rules` or `.cursorrules` in your project root and paste the rules from above.
|
|
230
|
+
|
|
231
|
+
### 6. Setup App Root
|
|
232
|
+
```tsx
|
|
233
|
+
// src/App.tsx
|
|
234
|
+
function App() {
|
|
235
|
+
return (
|
|
236
|
+
<div className="j3m-app-bg min-h-screen">
|
|
237
|
+
{/* Your app content */}
|
|
238
|
+
</div>
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
```
|
|
109
242
|
|
|
110
|
-
###
|
|
243
|
+
### 7. Use Components
|
|
111
244
|
```tsx
|
|
112
|
-
import {
|
|
245
|
+
import {
|
|
246
|
+
Button,
|
|
247
|
+
Card, CardHeader, CardTitle, CardContent,
|
|
248
|
+
Input,
|
|
249
|
+
ThemeSwitch
|
|
250
|
+
} from '@j3m-quantum/ui'
|
|
113
251
|
|
|
114
252
|
function App() {
|
|
115
253
|
return (
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
</
|
|
120
|
-
<
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
254
|
+
<div className="j3m-app-bg min-h-screen p-8">
|
|
255
|
+
<div className="flex justify-end mb-4">
|
|
256
|
+
<ThemeSwitch />
|
|
257
|
+
</div>
|
|
258
|
+
<Card className="glass-context max-w-md">
|
|
259
|
+
<CardHeader>
|
|
260
|
+
<CardTitle>Welcome</CardTitle>
|
|
261
|
+
</CardHeader>
|
|
262
|
+
<CardContent className="space-y-4">
|
|
263
|
+
<Input placeholder="Enter your name" />
|
|
264
|
+
<Button>Submit</Button>
|
|
265
|
+
</CardContent>
|
|
266
|
+
</Card>
|
|
267
|
+
</div>
|
|
125
268
|
)
|
|
126
269
|
}
|
|
127
270
|
```
|