@j3m-quantum/ui 0.8.2 → 0.8.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.
- package/README.md +33 -2
- package/cursor-rules-for-consumers.md +139 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @j3m-quantum/ui
|
|
2
2
|
|
|
3
|
-
J3M Quantum UI - A
|
|
3
|
+
J3M Quantum UI - A React component library with J3M design tokens.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **J3M Design Tokens** - Orange primary, neutral grays, pill-shaped buttons
|
|
8
8
|
- **Dark Mode** - Full dark theme support via `.dark` class
|
|
9
9
|
- **Glass Mode** - Frosted glass effects via `.theme-glass` class
|
|
10
|
-
- **55+ Components** -
|
|
10
|
+
- **55+ Components** - Complete UI component library with J3M styling
|
|
11
11
|
- **All-in-One** - Everything bundled, just install and use
|
|
12
12
|
- **Smooth Animations** - Powered by tw-animate-css
|
|
13
13
|
|
|
@@ -179,6 +179,37 @@ export default defineConfig({
|
|
|
179
179
|
})
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
+
## Cursor Rules (AI Assistant)
|
|
183
|
+
|
|
184
|
+
If your team uses Cursor or AI coding assistants, we provide ready-to-use rules to ensure consistent usage of the design system.
|
|
185
|
+
|
|
186
|
+
See [`cursor-rules-for-consumers.md`](./cursor-rules-for-consumers.md) for:
|
|
187
|
+
- Rules to copy into your project's `.cursor/rules` file
|
|
188
|
+
- Quick setup guide for new projects
|
|
189
|
+
- Complete component list
|
|
190
|
+
|
|
191
|
+
This helps AI assistants understand how to use @j3m-quantum/ui correctly and avoid common mistakes.
|
|
192
|
+
|
|
193
|
+
## Version Strategy
|
|
194
|
+
|
|
195
|
+
We follow semantic versioning (semver):
|
|
196
|
+
|
|
197
|
+
| Version Change | When to Use | Example |
|
|
198
|
+
|----------------|-------------|---------|
|
|
199
|
+
| **Patch** (0.8.1 → 0.8.2) | Bug fixes, small styling tweaks | Fix button hover color |
|
|
200
|
+
| **Minor** (0.8.x → 0.9.0) | New components, new features (backward compatible) | Add new PlayerCanvas component |
|
|
201
|
+
| **Major** (0.x.x → 1.0.0) | Breaking changes, API changes, removed components | Rename component props |
|
|
202
|
+
|
|
203
|
+
### Updating
|
|
204
|
+
|
|
205
|
+
To get the latest version:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
npm update @j3m-quantum/ui
|
|
209
|
+
# or
|
|
210
|
+
npm install @j3m-quantum/ui@latest
|
|
211
|
+
```
|
|
212
|
+
|
|
182
213
|
## License
|
|
183
214
|
|
|
184
215
|
MIT
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# J3M Quantum UI - Cursor Rules
|
|
2
|
+
|
|
3
|
+
Copy the rules below to `.cursor/rules` in your project to help AI assistants use the J3M Design System correctly.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Rules to Copy
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
# J3M Design System Rules
|
|
11
|
+
|
|
12
|
+
## Package Usage
|
|
13
|
+
- This project uses @j3m-quantum/ui - a complete React component library with J3M styling
|
|
14
|
+
- Import components directly: `import { Button, Card, Input } from '@j3m-quantum/ui'`
|
|
15
|
+
- Do NOT use shadcn CLI to add components - everything is already bundled
|
|
16
|
+
|
|
17
|
+
## CSS Import Order (Critical)
|
|
18
|
+
The order in src/index.css must be:
|
|
19
|
+
```css
|
|
20
|
+
@import "tailwindcss";
|
|
21
|
+
@import "tw-animate-css"; /* Required for animations */
|
|
22
|
+
@import "@j3m-quantum/ui/styles"; /* J3M theme and tokens */
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Theme Modes
|
|
26
|
+
- Dark mode: Add `dark` class to root element
|
|
27
|
+
- Glass mode: Add `theme-glass` class to root element
|
|
28
|
+
- Combined: `<div className="dark theme-glass">`
|
|
29
|
+
|
|
30
|
+
## J3M Design Tokens
|
|
31
|
+
- Primary: #F58446 (orange) - use `bg-primary`, `text-primary`
|
|
32
|
+
- Destructive: #FB3748 (red) - use `bg-destructive`
|
|
33
|
+
- Background: #FFFFFF - use `bg-background`
|
|
34
|
+
- Foreground: #333333 - use `text-foreground`
|
|
35
|
+
- Muted: #E8E8E8 - use `bg-muted`, `text-muted-foreground`
|
|
36
|
+
- Radius: Components use pill shape (rounded-full) for buttons/inputs
|
|
37
|
+
|
|
38
|
+
## DO
|
|
39
|
+
- Import all components from @j3m-quantum/ui
|
|
40
|
+
- Use Tailwind semantic classes: bg-primary, text-muted-foreground, bg-accent
|
|
41
|
+
- Use CSS variables for custom styling: var(--primary), var(--background)
|
|
42
|
+
- Check the component catalogue before building custom components
|
|
43
|
+
|
|
44
|
+
## DON'T
|
|
45
|
+
- Don't use shadcn CLI - components are already bundled
|
|
46
|
+
- Don't override CSS variables unless approved by design system maintainer
|
|
47
|
+
- Don't use arbitrary color values like bg-[#F58446] - use bg-primary
|
|
48
|
+
- Don't recreate existing components - use what's in @j3m-quantum/ui
|
|
49
|
+
- Don't modify component border-radius - pill shapes are intentional
|
|
50
|
+
|
|
51
|
+
## Available Components (55+)
|
|
52
|
+
Inputs: Button, ButtonGroup, Input, Textarea, Checkbox, RadioGroup, Switch, Slider, Select, NativeSelect, Toggle, ToggleGroup, ToolBarCanvas, PlayerCanvas, Form, Label
|
|
53
|
+
|
|
54
|
+
Display: Card, Table, Badge, Avatar, Separator, Skeleton, Accordion, Tabs, Calendar, Carousel, Chart, AspectRatio, Empty, Item, Kbd
|
|
55
|
+
|
|
56
|
+
Feedback: Alert, AlertDialog, Progress, Tooltip, Sonner (Toast), Spinner
|
|
57
|
+
|
|
58
|
+
Navigation: Breadcrumb, Pagination, Command, DropdownMenu, Menubar, NavigationMenu, ContextMenu
|
|
59
|
+
|
|
60
|
+
Overlay: Dialog, Drawer, Sheet, Popover, HoverCard
|
|
61
|
+
|
|
62
|
+
Layout: ScrollArea, Collapsible, Resizable, Sidebar, Section
|
|
63
|
+
|
|
64
|
+
## Requesting Changes
|
|
65
|
+
Need a new component or styling change? Don't build it locally.
|
|
66
|
+
Contact the design system maintainer to request additions or modifications.
|
|
67
|
+
This ensures consistency across all J3M applications.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Quick Setup for New Projects
|
|
73
|
+
|
|
74
|
+
### 1. Create Project
|
|
75
|
+
```bash
|
|
76
|
+
npm create vite@latest my-app -- --template react-ts
|
|
77
|
+
cd my-app
|
|
78
|
+
npm install
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 2. Add Dependencies
|
|
82
|
+
```bash
|
|
83
|
+
npm add -D tailwindcss @tailwindcss/vite
|
|
84
|
+
npm install @j3m-quantum/ui tw-animate-css
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 3. Configure Vite
|
|
88
|
+
```typescript
|
|
89
|
+
// vite.config.ts
|
|
90
|
+
import { defineConfig } from 'vite'
|
|
91
|
+
import react from '@vitejs/plugin-react'
|
|
92
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
plugins: [react(), tailwindcss()],
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 4. Setup CSS
|
|
100
|
+
```css
|
|
101
|
+
/* src/index.css */
|
|
102
|
+
@import "tailwindcss";
|
|
103
|
+
@import "tw-animate-css";
|
|
104
|
+
@import "@j3m-quantum/ui/styles";
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 5. Add Cursor Rules
|
|
108
|
+
Create `.cursor/rules` in your project root and paste the rules from above.
|
|
109
|
+
|
|
110
|
+
### 6. Use Components
|
|
111
|
+
```tsx
|
|
112
|
+
import { Button, Card, CardHeader, CardTitle, CardContent, Input } from '@j3m-quantum/ui'
|
|
113
|
+
|
|
114
|
+
function App() {
|
|
115
|
+
return (
|
|
116
|
+
<Card>
|
|
117
|
+
<CardHeader>
|
|
118
|
+
<CardTitle>Welcome</CardTitle>
|
|
119
|
+
</CardHeader>
|
|
120
|
+
<CardContent>
|
|
121
|
+
<Input placeholder="Enter your name" />
|
|
122
|
+
<Button>Submit</Button>
|
|
123
|
+
</CardContent>
|
|
124
|
+
</Card>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Updating the Package
|
|
132
|
+
|
|
133
|
+
To get the latest components and styling:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm update @j3m-quantum/ui
|
|
137
|
+
# or
|
|
138
|
+
npm install @j3m-quantum/ui@latest
|
|
139
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@j3m-quantum/ui",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "J3M UI Component Library -
|
|
3
|
+
"version": "0.8.4",
|
|
4
|
+
"description": "J3M UI Component Library - React components with J3M design tokens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"./styles/*": "./dist/styles/*"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"cursor-rules-for-consumers.md"
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "tsup && npm run copy-styles",
|