@j3m-quantum/ui 0.9.1 → 1.3.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 +212 -20
- package/dist/index.cjs +3702 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +654 -3
- package/dist/index.d.ts +654 -3
- package/dist/index.js +3596 -304
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1273 -317
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -84,44 +84,122 @@ function App() {
|
|
|
84
84
|
|
|
85
85
|
## Theme Modes
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
The design system supports four theme modes. Use the `.j3m-app-bg` utility class for proper backgrounds:
|
|
88
|
+
|
|
89
|
+
### Light Mode (Default)
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
<div className="j3m-app-bg">
|
|
93
|
+
{/* Light themed content */}
|
|
94
|
+
</div>
|
|
95
|
+
```
|
|
88
96
|
|
|
89
|
-
|
|
97
|
+
### Dark Mode
|
|
90
98
|
|
|
91
99
|
```tsx
|
|
92
|
-
<div className="dark">
|
|
100
|
+
<div className="dark j3m-app-bg">
|
|
93
101
|
{/* Dark themed content */}
|
|
94
102
|
</div>
|
|
95
103
|
```
|
|
96
104
|
|
|
97
|
-
### Glass Mode
|
|
105
|
+
### Glass Mode (Light)
|
|
98
106
|
|
|
99
|
-
|
|
107
|
+
Frosted glass on colorful gradient background:
|
|
100
108
|
|
|
101
109
|
```tsx
|
|
102
|
-
<div className="theme-glass">
|
|
103
|
-
{/*
|
|
110
|
+
<div className="theme-glass j3m-app-bg">
|
|
111
|
+
{/* Light glass themed content */}
|
|
104
112
|
</div>
|
|
105
113
|
```
|
|
106
114
|
|
|
107
|
-
|
|
115
|
+
### Glass Mode (Dark)
|
|
116
|
+
|
|
117
|
+
Dark frosted glass on deep gradient - sophisticated industrial aesthetic:
|
|
108
118
|
|
|
109
119
|
```tsx
|
|
110
|
-
<div className="dark theme-glass">
|
|
120
|
+
<div className="dark theme-glass j3m-app-bg">
|
|
111
121
|
{/* Dark glass themed content */}
|
|
112
122
|
</div>
|
|
113
123
|
```
|
|
114
124
|
|
|
125
|
+
### Mesh Variant
|
|
126
|
+
|
|
127
|
+
For a more complex gradient background, add the `.mesh` class:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
<div className="theme-glass j3m-app-bg mesh">
|
|
131
|
+
{/* Glass with mesh gradient */}
|
|
132
|
+
</div>
|
|
133
|
+
```
|
|
134
|
+
|
|
115
135
|
## Design Tokens
|
|
116
136
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
|
122
|
-
|
|
123
|
-
| `--
|
|
124
|
-
| `--
|
|
137
|
+
### Color System: 12-Step Scale
|
|
138
|
+
|
|
139
|
+
Colors use HEX format for simplicity and compatibility:
|
|
140
|
+
|
|
141
|
+
| Scale | Steps | Purpose |
|
|
142
|
+
|-------|-------|---------|
|
|
143
|
+
| `--j3m-orange-1` to `--j3m-orange-12` | 12 | Primary/accent colors |
|
|
144
|
+
| `--j3m-gray-1` to `--j3m-gray-12` | 12 | Neutral colors |
|
|
145
|
+
|
|
146
|
+
### Scale Step Usage
|
|
147
|
+
|
|
148
|
+
| Step | Purpose | Example |
|
|
149
|
+
|------|---------|---------|
|
|
150
|
+
| 1-2 | Backgrounds | Page bg, subtle areas |
|
|
151
|
+
| 3-5 | Interactive | Button bg, hover states |
|
|
152
|
+
| 6-8 | Borders | Input borders, dividers |
|
|
153
|
+
| 9-10 | Solid colors | Primary buttons |
|
|
154
|
+
| 11-12 | Text | Body text, headings |
|
|
155
|
+
|
|
156
|
+
### Semantic Tokens
|
|
157
|
+
|
|
158
|
+
| Token | Description |
|
|
159
|
+
|-------|-------------|
|
|
160
|
+
| `--primary` | Brand accent (#F58446) |
|
|
161
|
+
| `--background` | Page background |
|
|
162
|
+
| `--foreground` | Main text |
|
|
163
|
+
| `--muted` | Subtle backgrounds |
|
|
164
|
+
| `--border` | Default borders |
|
|
165
|
+
| `--ring` | Focus rings |
|
|
166
|
+
| `--radius` | Global border radius (12px) |
|
|
167
|
+
|
|
168
|
+
### Background & Surface Tokens
|
|
169
|
+
|
|
170
|
+
A hierarchical system that adapts to all four theme modes automatically:
|
|
171
|
+
|
|
172
|
+
| Token | Purpose |
|
|
173
|
+
|-------|---------|
|
|
174
|
+
| `--j3m-bg-app` | Root app canvas |
|
|
175
|
+
| `--j3m-bg-page` | Content area |
|
|
176
|
+
| `--j3m-bg-surface` | Cards, sections |
|
|
177
|
+
| `--j3m-bg-surface-hover` | Hovered cards |
|
|
178
|
+
| `--j3m-bg-surface-active` | Active/pressed cards |
|
|
179
|
+
| `--j3m-bg-elevated` | Raised elements |
|
|
180
|
+
| `--j3m-bg-overlay` | Popovers, tooltips |
|
|
181
|
+
| `--j3m-bg-muted` | Subtle backgrounds |
|
|
182
|
+
| `--j3m-bg-subtle` | Very subtle backgrounds |
|
|
183
|
+
| `--j3m-bg-element` | Interactive elements |
|
|
184
|
+
| `--j3m-bg-input` | Input backgrounds |
|
|
185
|
+
| `--j3m-bg-sidebar` | Sidebar background |
|
|
186
|
+
|
|
187
|
+
These tokens automatically resolve to the correct values in each theme mode:
|
|
188
|
+
- **Light/Dark solid**: Solid gray colors
|
|
189
|
+
- **Glass Light**: Frosted white glass fills
|
|
190
|
+
- **Glass Dark**: Dark frosted glass with blue tint
|
|
191
|
+
|
|
192
|
+
### Dark Glass Primitives
|
|
193
|
+
|
|
194
|
+
For advanced dark glass customization:
|
|
195
|
+
|
|
196
|
+
| Token | Description |
|
|
197
|
+
|-------|-------------|
|
|
198
|
+
| `--j3m-glass-dark-surface` | Main dark glass surface |
|
|
199
|
+
| `--j3m-glass-dark-elevated` | Elevated dark glass |
|
|
200
|
+
| `--j3m-glass-dark-overlay` | Dark glass overlays |
|
|
201
|
+
| `--j3m-glass-dark-border` | Subtle white border |
|
|
202
|
+
| `--j3m-glass-dark-element` | Interactive element highlight |
|
|
125
203
|
|
|
126
204
|
## Included Dependencies
|
|
127
205
|
|
|
@@ -141,13 +219,123 @@ All of these are bundled and ready to use:
|
|
|
141
219
|
## Exports
|
|
142
220
|
|
|
143
221
|
```typescript
|
|
144
|
-
//
|
|
145
|
-
import {
|
|
222
|
+
// Everything from one package!
|
|
223
|
+
import {
|
|
224
|
+
Button, Card, Dialog,
|
|
225
|
+
SidebarProvider, Sidebar, SidebarContent,
|
|
226
|
+
NavMain, NavUser, SiteHeader
|
|
227
|
+
} from '@j3m-quantum/ui'
|
|
146
228
|
|
|
147
229
|
// Styles (CSS)
|
|
148
230
|
import '@j3m-quantum/ui/styles'
|
|
149
231
|
```
|
|
150
232
|
|
|
233
|
+
## Blocks
|
|
234
|
+
|
|
235
|
+
Pre-built, composable sidebar components for enterprise applications.
|
|
236
|
+
|
|
237
|
+
### Sidebar with Header
|
|
238
|
+
|
|
239
|
+
A collapsible sidebar with sticky header, based on shadcn's sidebar-16.
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
import {
|
|
243
|
+
SidebarProvider,
|
|
244
|
+
SidebarInset,
|
|
245
|
+
SidebarTrigger,
|
|
246
|
+
Sidebar,
|
|
247
|
+
SidebarContent,
|
|
248
|
+
SidebarFooter,
|
|
249
|
+
SiteHeader,
|
|
250
|
+
NavMain,
|
|
251
|
+
NavUser,
|
|
252
|
+
} from '@j3m-quantum/ui'
|
|
253
|
+
import { HomeIcon, SettingsIcon } from 'lucide-react'
|
|
254
|
+
|
|
255
|
+
const navItems = [
|
|
256
|
+
{
|
|
257
|
+
title: "Dashboard",
|
|
258
|
+
url: "/dashboard",
|
|
259
|
+
icon: HomeIcon,
|
|
260
|
+
isActive: true,
|
|
261
|
+
items: [
|
|
262
|
+
{ title: "Overview", url: "/dashboard" },
|
|
263
|
+
{ title: "Analytics", url: "/dashboard/analytics" },
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
]
|
|
267
|
+
|
|
268
|
+
export default function Dashboard() {
|
|
269
|
+
return (
|
|
270
|
+
<div style={{ "--header-height": "3.5rem" }}>
|
|
271
|
+
<SidebarProvider>
|
|
272
|
+
<SiteHeader
|
|
273
|
+
trigger={<SidebarTrigger />}
|
|
274
|
+
breadcrumbs={[{ label: "Dashboard" }]}
|
|
275
|
+
/>
|
|
276
|
+
<div className="flex flex-1">
|
|
277
|
+
<Sidebar>
|
|
278
|
+
<SidebarContent>
|
|
279
|
+
<NavMain items={navItems} />
|
|
280
|
+
</SidebarContent>
|
|
281
|
+
<SidebarFooter>
|
|
282
|
+
<NavUser user={{ name: "User", email: "user@example.com", avatar: "" }} />
|
|
283
|
+
</SidebarFooter>
|
|
284
|
+
</Sidebar>
|
|
285
|
+
<SidebarInset>
|
|
286
|
+
<main className="p-4">
|
|
287
|
+
{/* Your content */}
|
|
288
|
+
</main>
|
|
289
|
+
</SidebarInset>
|
|
290
|
+
</div>
|
|
291
|
+
</SidebarProvider>
|
|
292
|
+
</div>
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Block Components
|
|
298
|
+
|
|
299
|
+
| Component | Description |
|
|
300
|
+
|-----------|-------------|
|
|
301
|
+
| `SiteHeader` | Sticky header with breadcrumbs and trigger slot |
|
|
302
|
+
| `NavMain` | Collapsible navigation groups with sub-items |
|
|
303
|
+
| `NavProjects` | Projects section with dropdown actions |
|
|
304
|
+
| `NavSecondary` | Secondary links (Support, Feedback) |
|
|
305
|
+
| `NavUser` | User avatar with dropdown menu |
|
|
306
|
+
| `SearchForm` | Search input component |
|
|
307
|
+
|
|
308
|
+
### Custom Navigation
|
|
309
|
+
|
|
310
|
+
```tsx
|
|
311
|
+
import { NavMain, type NavItem } from '@j3m-quantum/ui'
|
|
312
|
+
import { HomeIcon, SettingsIcon } from 'lucide-react'
|
|
313
|
+
|
|
314
|
+
const navItems: NavItem[] = [
|
|
315
|
+
{
|
|
316
|
+
title: "Dashboard",
|
|
317
|
+
url: "/dashboard",
|
|
318
|
+
icon: HomeIcon,
|
|
319
|
+
isActive: true,
|
|
320
|
+
items: [
|
|
321
|
+
{ title: "Overview", url: "/dashboard" },
|
|
322
|
+
{ title: "Analytics", url: "/dashboard/analytics" },
|
|
323
|
+
],
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
title: "Settings",
|
|
327
|
+
url: "/settings",
|
|
328
|
+
icon: SettingsIcon,
|
|
329
|
+
items: [
|
|
330
|
+
{ title: "Profile", url: "/settings/profile" },
|
|
331
|
+
{ title: "Team", url: "/settings/team" },
|
|
332
|
+
],
|
|
333
|
+
},
|
|
334
|
+
]
|
|
335
|
+
|
|
336
|
+
<NavMain items={navItems} />
|
|
337
|
+
```
|
|
338
|
+
|
|
151
339
|
## Customization
|
|
152
340
|
|
|
153
341
|
Override CSS variables after the import:
|
|
@@ -159,7 +347,7 @@ Override CSS variables after the import:
|
|
|
159
347
|
|
|
160
348
|
/* Custom overrides */
|
|
161
349
|
:root {
|
|
162
|
-
--primary: #
|
|
350
|
+
--primary: #3B82F6; /* Blue accent instead of orange */
|
|
163
351
|
--radius: 8px;
|
|
164
352
|
}
|
|
165
353
|
```
|
|
@@ -216,6 +404,10 @@ npm update @j3m-quantum/ui
|
|
|
216
404
|
npm install @j3m-quantum/ui@latest
|
|
217
405
|
```
|
|
218
406
|
|
|
407
|
+
## Third-Party Licenses
|
|
408
|
+
|
|
409
|
+
- **Event Calendar**: Based on [big-calendar](https://github.com/lramos33/big-calendar) by Leonardo Ramos, MIT License
|
|
410
|
+
|
|
219
411
|
## License
|
|
220
412
|
|
|
221
413
|
MIT
|