omnidesign 1.0.1 → 1.1.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.
@@ -0,0 +1,450 @@
1
+ ---
2
+ name: omnidesign
3
+ description: Universal design system with Tailwind integration - Use when building UI components, choosing themes, selecting fonts, or configuring Tailwind themes with semantic tokens
4
+ ---
5
+
6
+ # OmniDesign - Tailwind-First Design System
7
+
8
+ ## Quick Reference for Agents
9
+
10
+ When user asks for UI work, follow this workflow:
11
+ 1. **Check the request type** - Component, theme, or font selection
12
+ 2. **Use semantic tokens** - Reference the token-to-Tailwind mapping below
13
+ 3. **Apply proper classes** - Use the provided Tailwind utility classes
14
+ 4. **Consider dark mode** - All examples work in both light and dark modes
15
+
16
+ ## Token to Tailwind Mapping
17
+
18
+ ### Semantic Colors → Tailwind Classes
19
+
20
+ | Design Token | Tailwind Utility | CSS Variable | Usage |
21
+ |--------------|------------------|--------------|-------|
22
+ | `color.text-default` | `text-text` | `--color-text-default` | Primary body text |
23
+ | `color.text-muted` | `text-text-muted` | `--color-text-muted` | Secondary/helper text |
24
+ | `color.text-inverted` | `text-text-inverted` | `--color-text-inverted` | Text on dark/colored backgrounds |
25
+ | `color.surface-default` | `bg-surface` | `--color-surface-default` | Page background |
26
+ | `color.surface-raised` | `bg-surface-raised` | `--color-surface-raised` | Cards, elevated surfaces |
27
+ | `color.surface-sunken` | `bg-surface-sunken` | `--color-surface-sunken` | Inputs, depressed areas |
28
+ | `color.border-default` | `border-border` | `--color-border-default` | Default borders |
29
+ | `color.border-subtle` | `border-border-subtle` | `--color-border-subtle` | Subtle dividers |
30
+ | `color.interactive-primary` | `bg-primary` | `--color-interactive-primary` | Primary buttons, CTAs |
31
+ | `color.interactive-primary-hover` | `hover:bg-primary-hover` | `--color-interactive-primary-hover` | Primary hover state |
32
+ | `color.interactive-secondary` | `bg-secondary` | `--color-interactive-secondary` | Secondary buttons |
33
+ | `color.status-success` | `text-green-600 bg-green-50` | `--color-status-success` | Success states |
34
+ | `color.status-warning` | `text-amber-600 bg-amber-50` | `--color-status-warning` | Warning states |
35
+ | `color.status-error` | `text-red-600 bg-red-50` | `--color-status-error` | Error states |
36
+
37
+ ### Primitive Colors → Tailwind Classes
38
+
39
+ Use primitive colors for specific shade needs:
40
+
41
+ | Color Family | Example Usage | Tailwind Class |
42
+ |--------------|---------------|----------------|
43
+ | `color.neutral.50` | Lightest background | `bg-neutral-50` |
44
+ | `color.neutral.500` | Neutral base | `text-neutral-500` |
45
+ | `color.neutral.950` | Darkest text | `text-neutral-950` |
46
+ | `color.blue.500` | Brand color | `bg-blue-500` |
47
+ | `color.blue.600` | Primary action | `bg-blue-600` |
48
+ | `color.slate.900` | Dark text | `text-slate-900` |
49
+
50
+ ### Spacing → Tailwind Classes
51
+
52
+ | Token | Tailwind | Value | Usage |
53
+ |-------|----------|-------|-------|
54
+ | `spacing.4` | `p-1 m-1` | 4px | Tight spacing |
55
+ | `spacing.8` | `p-2 m-2 gap-2` | 8px | Default spacing |
56
+ | `spacing.16` | `p-4 m-4 gap-4` | 16px | Standard spacing |
57
+ | `spacing.24` | `p-6 m-6 gap-6` | 24px | Section spacing |
58
+ | `spacing.32` | `p-8 m-8 gap-8` | 32px | Large spacing |
59
+ | `spacing.48` | `p-12 m-12` | 48px | Extra large |
60
+
61
+ ### Typography → Tailwind Classes
62
+
63
+ | Token | Tailwind | Font Stack |
64
+ |-------|----------|------------|
65
+ | `font.sans` | `font-sans` | Geist Sans, system-ui |
66
+ | `font.mono` | `font-mono` | JetBrains Mono, monospace |
67
+ | `font.display` | `font-display` | Clash Display |
68
+ | `font.nerd` | `font-mono` | JetBrainsMono Nerd Font |
69
+
70
+ ### Shadows → Tailwind Classes
71
+
72
+ | Token | Tailwind | Usage |
73
+ |-------|----------|-------|
74
+ | `shadow.card` | `shadow-md` | Cards, buttons |
75
+ | `shadow.dropdown` | `shadow-lg` | Dropdowns, popovers |
76
+ | `shadow.modal` | `shadow-xl` | Modals, dialogs |
77
+
78
+ ## Component Recipes
79
+
80
+ ### Button Component
81
+
82
+ **Primary Button**
83
+ ```tsx
84
+ <button className="
85
+ bg-primary hover:bg-primary-hover
86
+ text-text-inverted
87
+ px-4 py-2
88
+ rounded-md
89
+ font-medium
90
+ shadow-md
91
+ transition-colors
92
+ focus:outline-none focus:ring-2 focus:ring-primary
93
+ ">
94
+ Primary Action
95
+ </button>
96
+ ```
97
+
98
+ **Secondary Button**
99
+ ```tsx
100
+ <button className="
101
+ bg-surface-raised hover:bg-surface
102
+ text-text
103
+ border border-border
104
+ px-4 py-2
105
+ rounded-md
106
+ font-medium
107
+ transition-colors
108
+ focus:outline-none focus:ring-2 focus:ring-border
109
+ ">
110
+ Cancel
111
+ </button>
112
+ ```
113
+
114
+ **Destructive Button**
115
+ ```tsx
116
+ <button className="
117
+ bg-red-600 hover:bg-red-700
118
+ text-white
119
+ px-4 py-2
120
+ rounded-md
121
+ font-medium
122
+ transition-colors
123
+ focus:outline-none focus:ring-2 focus:ring-red-500
124
+ ">
125
+ Delete
126
+ </button>
127
+ ```
128
+
129
+ ### Card Component
130
+
131
+ ```tsx
132
+ <div className="
133
+ bg-surface-raised
134
+ rounded-lg
135
+ shadow-md
136
+ p-6
137
+ border border-border-subtle
138
+ ">
139
+ <h3 className="text-xl font-semibold text-text mb-2">
140
+ Card Title
141
+ </h3>
142
+ <p className="text-text-muted">
143
+ Card content with semantic colors.
144
+ </p>
145
+ </div>
146
+ ```
147
+
148
+ ### Input Component
149
+
150
+ ```tsx
151
+ <input
152
+ className="
153
+ bg-surface-sunken
154
+ text-text
155
+ border border-border
156
+ rounded-md
157
+ px-3 py-2
158
+ placeholder:text-text-muted
159
+ focus:outline-none
160
+ focus:ring-2
161
+ focus:ring-primary
162
+ focus:border-transparent
163
+ "
164
+ placeholder="Enter text..."
165
+ />
166
+ ```
167
+
168
+ ### Alert Component
169
+
170
+ **Success Alert**
171
+ ```tsx
172
+ <div className="
173
+ bg-green-50
174
+ border border-green-200
175
+ text-green-800
176
+ px-4 py-3
177
+ rounded-md
178
+ ">
179
+ <p className="font-medium">Success!</p>
180
+ <p className="text-sm">Operation completed.</p>
181
+ </div>
182
+ ```
183
+
184
+ **Warning Alert**
185
+ ```tsx
186
+ <div className="
187
+ bg-amber-50
188
+ border border-amber-200
189
+ text-amber-800
190
+ px-4 py-3
191
+ rounded-md
192
+ ">
193
+ <p className="font-medium">Warning!</p>
194
+ <p className="text-sm">Please review your input.</p>
195
+ </div>
196
+ ```
197
+
198
+ **Error Alert**
199
+ ```tsx
200
+ <div className="
201
+ bg-red-50
202
+ border border-red-200
203
+ text-red-800
204
+ px-4 py-3
205
+ rounded-md
206
+ ">
207
+ <p className="font-medium">Error!</p>
208
+ <p className="text-sm">Something went wrong.</p>
209
+ </div>
210
+ ```
211
+
212
+ ## Tailwind Configuration
213
+
214
+ ### Setup with OmniDesign Tokens
215
+
216
+ ```javascript
217
+ // tailwind.config.js
218
+ module.exports = {
219
+ theme: {
220
+ extend: {
221
+ colors: {
222
+ // Semantic tokens
223
+ text: {
224
+ DEFAULT: '#1F2937',
225
+ muted: '#6B7280',
226
+ inverted: '#FFFFFF',
227
+ },
228
+ surface: {
229
+ DEFAULT: '#FFFFFF',
230
+ raised: '#F9FAFB',
231
+ sunken: '#F3F4F6',
232
+ },
233
+ border: {
234
+ DEFAULT: '#E5E7EB',
235
+ subtle: '#F3F4F6',
236
+ },
237
+ primary: {
238
+ DEFAULT: '#0052CC',
239
+ hover: '#003E8F',
240
+ },
241
+ // Color families
242
+ neutral: {
243
+ 50: '#FAFAFA',
244
+ 100: '#F5F5F5',
245
+ // ... all 11 shades
246
+ 950: '#0A0A0A',
247
+ },
248
+ blue: {
249
+ 50: '#EFF6FF',
250
+ 100: '#DBEAFE',
251
+ // ... all 11 shades
252
+ 950: '#0F172A',
253
+ },
254
+ // ... other color families
255
+ },
256
+ fontFamily: {
257
+ sans: ['var(--font-geist-sans)', 'system-ui', 'sans-serif'],
258
+ mono: ['var(--font-geist-mono)', 'JetBrains Mono', 'monospace'],
259
+ display: ['Clash Display', 'sans-serif'],
260
+ },
261
+ },
262
+ },
263
+ }
264
+ ```
265
+
266
+ ### CSS Variables Setup
267
+
268
+ ```css
269
+ /* globals.css */
270
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=JetBrains+Mono:wght@100..800&display=swap');
271
+
272
+ :root {
273
+ /* Semantic tokens - Light mode */
274
+ --color-text-default: #1F2937;
275
+ --color-text-muted: #6B7280;
276
+ --color-text-inverted: #FFFFFF;
277
+ --color-surface-default: #FFFFFF;
278
+ --color-surface-raised: #F9FAFB;
279
+ --color-surface-sunken: #F3F4F6;
280
+ --color-border-default: #E5E7EB;
281
+ --color-border-subtle: #F3F4F6;
282
+ --color-interactive-primary: #0052CC;
283
+ --color-interactive-primary-hover: #003E8F;
284
+ }
285
+
286
+ .dark {
287
+ /* Semantic tokens - Dark mode */
288
+ --color-text-default: #F9FAFB;
289
+ --color-text-muted: #9CA3AF;
290
+ --color-text-inverted: #111827;
291
+ --color-surface-default: #0A0A0A;
292
+ --color-surface-raised: #171717;
293
+ --color-surface-sunken: #0A0A0A;
294
+ --color-border-default: #262626;
295
+ --color-border-subtle: #171717;
296
+ --color-interactive-primary: #3B82F6;
297
+ --color-interactive-primary-hover: #60A5FA;
298
+ }
299
+ ```
300
+
301
+ ## Available Themes
302
+
303
+ Apply themes by setting `data-theme` attribute on the HTML element:
304
+
305
+ ```html
306
+ <html data-theme="corporate">
307
+ ```
308
+
309
+ ### Professional Themes
310
+ - `corporate` - Classic blue enterprise theme
311
+ - `navy` - Deep professional navy
312
+ - `slate` - Cool gray professionalism
313
+ - `forest` - Natural, trustworthy green
314
+ - `ruby` - Bold, confident red
315
+ - `graphite` - Modern minimal gray
316
+
317
+ ### Creative Themes
318
+ - `sunset` - Warm orange and amber
319
+ - `ocean` - Calm teal and cyan
320
+ - `berry` - Playful pink and purple
321
+ - `mint` - Fresh green
322
+ - `coral` - Friendly warm orange
323
+ - `lavender` - Soft purple
324
+
325
+ ### Dark Themes
326
+ - `midnight` - Classic dark blue
327
+ - `noir` - High contrast black
328
+ - `cyberpunk` - Neon accents
329
+ - `obsidian` - Deep purple dark
330
+ - `deep-space` - Blue-tinted dark
331
+ - `brutalist` - Raw, stark
332
+
333
+ ## Font Collections
334
+
335
+ ### Nerd Fonts (Programming with Glyphs)
336
+
337
+ | Font | Import | Tailwind Config |
338
+ |------|--------|-----------------|
339
+ | **JetBrainsMono Nerd** | Google Fonts: `https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@100..800&display=swap` | `'JetBrains Mono', 'JetBrainsMono Nerd Font', monospace` |
340
+ | **FiraCode Nerd** | Google Fonts: `https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap` | `'Fira Code', 'FiraCode Nerd Font', monospace` |
341
+ | **Hack Nerd** | Download: `https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Hack.zip` | `'Hack', 'Hack Nerd Font', monospace` |
342
+ | **CaskaydiaCove** | Download: `https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/CascadiaCode.zip` | `'CaskaydiaCove Nerd Font', 'Cascadia Code', monospace` |
343
+ | **Iosevka** | Download: `https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Iosevka.zip` | `'Iosevka', 'Iosevka Nerd Font', monospace` |
344
+ | **MesloLG** | Download: `https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Meslo.zip` | `'MesloLG NF', 'Meslo LGS Nerd Font', monospace` |
345
+
346
+ ### UI Fonts
347
+
348
+ | Font | Import | Usage |
349
+ |------|--------|-------|
350
+ | **Geist Sans** | NPM: `geist` package | Modern Vercel font |
351
+ | **Inter** | Google Fonts | Highly readable UI |
352
+ | **Space Grotesk** | Google Fonts | Quirky headlines |
353
+
354
+ ### Font Pairings
355
+
356
+ **Modern Dev Stack**
357
+ ```css
358
+ font-sans: 'Geist Sans', system-ui;
359
+ font-mono: 'JetBrains Mono', monospace;
360
+ ```
361
+
362
+ **Professional Terminal**
363
+ ```css
364
+ font-sans: 'Inter', system-ui;
365
+ font-mono: 'JetBrains Mono', monospace;
366
+ ```
367
+
368
+ **Hacker Aesthetic**
369
+ ```css
370
+ font-sans: 'Space Grotesk', sans-serif;
371
+ font-mono: 'Hack Nerd Font', monospace;
372
+ ```
373
+
374
+ ## Color Palette Reference
375
+
376
+ ### Extended Color Families (All with 11 shades: 50-950)
377
+
378
+ | Color | Vibe | Best For |
379
+ |-------|------|----------|
380
+ | Neutral | Pure grayscale | UI structure, backgrounds |
381
+ | Slate | Cool gray | Modern tech, professional |
382
+ | Zinc | True neutral | Minimal, Swiss design |
383
+ | Stone | Warm gray | Editorial, organic |
384
+ | Red | Error, danger | Destructive actions |
385
+ | Orange | Energy | CTAs, highlights |
386
+ | Amber | Caution, gold | Warnings, ratings |
387
+ | Yellow | Brightness | Attention, notifications |
388
+ | Lime | Fresh | Eco, spring themes |
389
+ | Green | Success | Confirmations, growth |
390
+ | Emerald | Natural | Premium organic |
391
+ | Teal | Calm, trust | Medical, finance |
392
+ | Cyan | Fresh, modern | Tech startups |
393
+ | Sky | Light, open | Weather, air |
394
+ | Blue | Primary | Corporate brand color |
395
+ | Indigo | Rich, deep | Premium luxury |
396
+ | Violet | Creative | Imagination, art |
397
+ | Purple | Royal | Luxury, mystery |
398
+ | Fuchsia | Bold, playful | Fun, youth |
399
+ | Pink | Warm, friendly | Healthcare, care |
400
+ | Rose | Soft, elegant | Romance, beauty |
401
+
402
+ ## Best Practices
403
+
404
+ 1. **Always use semantic tokens** - Never hardcode colors directly
405
+ 2. **Test both themes** - Components should work in light and dark modes
406
+ 3. **Follow accessibility** - WCAG 2.1 AA minimum (4.5:1 contrast for text)
407
+ 4. **Use Nerd Fonts for code** - Better developer experience with icons
408
+ 5. **Match tokens to context** - Use `text-muted` for secondary text, not a specific gray
409
+
410
+ ## Quick Decision Tree
411
+
412
+ **What color should I use for...?**
413
+
414
+ - Primary button? → `bg-primary` (semantic)
415
+ - Card background? → `bg-surface-raised`
416
+ - Error message? → `text-red-600` + `bg-red-50`
417
+ - Secondary text? → `text-text-muted`
418
+ - Border? → `border-border` or `border-border-subtle`
419
+ - Hover state? → `hover:bg-primary-hover`
420
+
421
+ **What font should I use for...?**
422
+
423
+ - Body text? → `font-sans` (Geist or Inter)
424
+ - Code blocks? → `font-mono` (JetBrains Mono Nerd)
425
+ - Headlines? → `font-display` (Clash Display) or `font-sans`
426
+ - Terminal UI? → `font-mono` with Nerd Font
427
+
428
+ ## Resources
429
+
430
+ - Full token docs: `packages/tokens-tailwind/dist/utility-mapping.json`
431
+ - Tailwind config: `packages/tokens-tailwind/dist/tailwind.config.js`
432
+ - Color palettes: `tokens/primitives/colors-extended.json`
433
+ - Nerd Fonts catalog: `tokens/typography/nerd-fonts-complete.json`
434
+ - Component recipes: See examples above
435
+
436
+ ## Installation
437
+
438
+ ```bash
439
+ # Install tokens package
440
+ npm install @omnidesign/tokens-tailwind
441
+
442
+ # Or use the full design system
443
+ npm install omnidesign
444
+ ```
445
+
446
+ ```javascript
447
+ // Import in your project
448
+ import { tailwindConfig } from '@omnidesign/tokens-tailwind';
449
+ import utilityMapping from '@omnidesign/tokens-tailwind/mapping';
450
+ ```