@j3m-quantum/ui 0.8.3 → 0.9.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/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  J3M Quantum UI - A React component library with J3M design tokens.
4
4
 
5
+ ## Requirements
6
+
7
+ - **React** >= 18
8
+ - **Tailwind CSS v4** (required - not compatible with v3)
9
+ - **tw-animate-css** >= 1.0.0
10
+
5
11
  ## Features
6
12
 
7
13
  - **J3M Design Tokens** - Orange primary, neutral grays, pill-shaped buttons
@@ -179,6 +185,17 @@ export default defineConfig({
179
185
  })
180
186
  ```
181
187
 
188
+ ## Cursor Rules (AI Assistant)
189
+
190
+ If your team uses Cursor or AI coding assistants, we provide ready-to-use rules to ensure consistent usage of the design system.
191
+
192
+ See [`cursor-rules-for-consumers.md`](./cursor-rules-for-consumers.md) for:
193
+ - Rules to copy into your project's `.cursor/rules` file
194
+ - Quick setup guide for new projects
195
+ - Complete component list
196
+
197
+ This helps AI assistants understand how to use @j3m-quantum/ui correctly and avoid common mistakes.
198
+
182
199
  ## Version Strategy
183
200
 
184
201
  We follow semantic versioning (semver):
@@ -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
+ ```