@idealyst/theme 1.0.82 → 1.0.84

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.
Files changed (68) hide show
  1. package/package.json +3 -2
  2. package/src/components/CLAUDE.md +468 -0
  3. package/src/components/accordion.ts +34 -0
  4. package/src/components/activity-indicator.ts +28 -0
  5. package/src/components/alert.ts +32 -0
  6. package/src/components/avatar.ts +27 -0
  7. package/src/components/badge.ts +28 -0
  8. package/src/components/breadcrumb.ts +36 -0
  9. package/src/components/button.ts +32 -0
  10. package/src/components/card.ts +31 -0
  11. package/src/components/checkbox.ts +37 -0
  12. package/src/components/chip.ts +34 -0
  13. package/src/components/dialog.ts +31 -0
  14. package/src/components/divider.ts +36 -0
  15. package/src/components/icon.ts +26 -0
  16. package/src/components/image.ts +22 -0
  17. package/src/components/index.ts +37 -0
  18. package/src/components/input.ts +35 -0
  19. package/src/components/list.ts +40 -0
  20. package/src/components/menu-item.ts +29 -0
  21. package/src/components/menu.ts +32 -0
  22. package/src/components/popover.ts +25 -0
  23. package/src/components/pressable.ts +20 -0
  24. package/src/components/progress.ts +35 -0
  25. package/src/components/radio-button.ts +38 -0
  26. package/src/components/screen.ts +25 -0
  27. package/src/components/select.ts +62 -0
  28. package/src/components/skeleton.ts +26 -0
  29. package/src/components/slider.ts +62 -0
  30. package/src/components/svg-image.ts +24 -0
  31. package/src/components/switch.ts +54 -0
  32. package/src/components/tab-bar.ts +54 -0
  33. package/src/components/table.ts +57 -0
  34. package/src/components/text.ts +29 -0
  35. package/src/components/textarea.ts +53 -0
  36. package/src/components/tooltip.ts +29 -0
  37. package/src/components/video.ts +18 -0
  38. package/src/components/view.ts +31 -0
  39. package/src/darkTheme.ts +890 -0
  40. package/src/index.ts +7 -166
  41. package/src/lightTheme.ts +873 -0
  42. package/src/styles.ts +14 -0
  43. package/src/theme/color.ts +15 -0
  44. package/src/theme/index.ts +16 -0
  45. package/src/theme/intent.ts +8 -0
  46. package/src/theme/shadow.ts +18 -0
  47. package/src/theme/size.ts +182 -0
  48. package/src/theme/surface.ts +3 -0
  49. package/src/unistyles.ts +6 -14
  50. package/src/variants/color.ts +9 -0
  51. package/src/variants/index.ts +2 -0
  52. package/src/variants/intent.ts +16 -0
  53. package/src/variants/size.ts +0 -0
  54. package/CLAUDE.md +0 -447
  55. package/LLM-ACCESS-GUIDE.md +0 -208
  56. package/README.md +0 -633
  57. package/src/README.md +0 -138
  58. package/src/breakpoints.ts +0 -8
  59. package/src/colorResolver.ts +0 -218
  60. package/src/colors.md +0 -353
  61. package/src/colors.ts +0 -315
  62. package/src/common.ts +0 -92
  63. package/src/defaultThemes.md +0 -407
  64. package/src/defaultThemes.ts +0 -238
  65. package/src/themeBuilder.md +0 -400
  66. package/src/themeBuilder.ts +0 -602
  67. package/src/variantHelpers.ts +0 -584
  68. package/src/variants.ts +0 -56
package/CLAUDE.md DELETED
@@ -1,447 +0,0 @@
1
- # @idealyst/theme - LLM Documentation
2
-
3
- This file provides comprehensive theming documentation for LLMs working with the @idealyst/theme library.
4
-
5
- ## Library Overview
6
-
7
- @idealyst/theme is a comprehensive theming system with:
8
- - 8 color palettes × 10 shades each (50-900)
9
- - Light and dark theme presets
10
- - High contrast accessibility support
11
- - Intent-based color system (primary, success, error, warning, neutral)
12
- - Complete typography, spacing, and layout systems
13
- - Cross-platform support via react-native-unistyles
14
-
15
- ## Quick Start
16
-
17
- ### Basic Setup
18
- ```tsx
19
- import { StyleSheet } from 'react-native-unistyles';
20
- import { defaultLightTheme, defaultDarkTheme } from '@idealyst/theme';
21
-
22
- // Register themes with Unistyles 3.0
23
- StyleSheet.configure({
24
- themes: {
25
- light: defaultLightTheme,
26
- dark: defaultDarkTheme,
27
- },
28
- settings: {
29
- adaptiveThemes: true,
30
- },
31
- });
32
- ```
33
-
34
- ### Using in Components
35
- ```tsx
36
- import { StyleSheet } from 'react-native-unistyles';
37
-
38
- const styles = StyleSheet.create((theme) => ({
39
- container: {
40
- backgroundColor: theme.colors.surface.primary,
41
- padding: theme.spacing.md,
42
- borderRadius: theme.borderRadius.md,
43
- },
44
- text: {
45
- color: theme.colors.text.primary,
46
- fontSize: theme.typography.fontSize.md,
47
- },
48
- }));
49
- ```
50
-
51
- ## Core Concepts
52
-
53
- ### Color System Structure
54
-
55
- #### Color Palettes (8 palettes × 10 shades)
56
- ```tsx
57
- // Each palette has shades 50-900
58
- blue: {
59
- 50: '#eff6ff', // Lightest
60
- 500: '#3b82f6', // Base color
61
- 900: '#1e3a8a', // Darkest
62
- }
63
-
64
- // Available palettes:
65
- // blue, green, red, amber, gray, cyan, purple, pink
66
- ```
67
-
68
- #### Intent System
69
- Semantic color mappings for consistent UX:
70
- ```tsx
71
- intents: {
72
- primary: { main, on, container, onContainer, light, dark, border },
73
- success: { /* Green palette mapping */ },
74
- error: { /* Red palette mapping */ },
75
- warning: { /* Amber palette mapping */ },
76
- neutral: { /* Gray palette mapping */ },
77
- }
78
- ```
79
-
80
- #### Component Color System
81
- Structured colors for UI components:
82
- ```tsx
83
- colors: {
84
- text: { primary, secondary, disabled, inverse, muted, placeholder },
85
- surface: { primary, secondary, tertiary, elevated, overlay, inverse },
86
- border: { primary, secondary, focus, error, disabled },
87
- interactive: { hover, pressed, focus, disabled },
88
- }
89
- ```
90
-
91
- ### Typography System
92
- ```tsx
93
- typography: {
94
- fontFamily: { sans, mono },
95
- fontSize: { xs: 12, sm: 14, md: 16, lg: 18, xl: 20, xxl: 24 },
96
- fontWeight: { light: '300', regular: '400', medium: '500', semibold: '600', bold: '700' },
97
- lineHeight: { tight: 1.2, normal: 1.5, relaxed: 1.75 },
98
- }
99
- ```
100
-
101
- ### Spacing System
102
- ```tsx
103
- spacing: {
104
- xs: 4, // 0.25rem
105
- sm: 8, // 0.5rem
106
- md: 16, // 1rem
107
- lg: 24, // 1.5rem
108
- xl: 32, // 2rem
109
- xxl: 48, // 3rem
110
- }
111
- ```
112
-
113
- ## Default Themes
114
-
115
- ### Light Theme
116
- - Dark text on light backgrounds
117
- - Subtle shadows for depth
118
- - Warm gray tones
119
- - WCAG AA compliant
120
-
121
- ### Dark Theme
122
- - Light text on dark backgrounds
123
- - Reduced shadows, emphasis on borders
124
- - Cool gray tones
125
- - WCAG AA compliant
126
-
127
- ```tsx
128
- // Switch themes
129
- import { UnistylesRuntime } from 'react-native-unistyles';
130
- UnistylesRuntime.setTheme('dark');
131
- UnistylesRuntime.setTheme('light');
132
- ```
133
-
134
- ## Theme Creation
135
-
136
- ### Extending Existing Themes
137
- ```tsx
138
- import { extendTheme, defaultLightTheme } from '@idealyst/theme';
139
-
140
- const customTheme = extendTheme(defaultLightTheme, {
141
- palettes: {
142
- brand: generateColorPalette('#8b5cf6'), // Add brand color
143
- },
144
- intents: {
145
- primary: 'brand', // Use brand palette for primary
146
- },
147
- typography: {
148
- fontFamily: {
149
- sans: 'Inter, system-ui, sans-serif',
150
- },
151
- },
152
- });
153
- ```
154
-
155
- ### Creating from Scratch
156
- ```tsx
157
- import { createTheme, generateColorPalette } from '@idealyst/theme';
158
-
159
- const brandTheme = createTheme({
160
- palettes: {
161
- brand: generateColorPalette('#ff6b6b'),
162
- neutral: generateColorPalette('#64748b'),
163
- success: generateColorPalette('#22c55e'),
164
- error: generateColorPalette('#ef4444'),
165
- warning: generateColorPalette('#f59e0b'),
166
- },
167
- intents: {
168
- primary: 'brand',
169
- neutral: 'neutral',
170
- success: 'success',
171
- error: 'error',
172
- warning: 'warning',
173
- },
174
- });
175
- ```
176
-
177
- ### Color Palette Generation
178
- ```tsx
179
- import { generateColorPalette } from '@idealyst/theme';
180
-
181
- // Generate complete 10-shade palette from base color
182
- const brandPalette = generateColorPalette('#8b5cf6');
183
- // Returns: { 50: '#f7f3ff', 100: '#ede9fe', ..., 900: '#581c87' }
184
- ```
185
-
186
- ## Common Usage Patterns
187
-
188
- ### Intent-Based Styling
189
- ```tsx
190
- const styles = StyleSheet.create((theme) => ({
191
- primaryButton: {
192
- backgroundColor: theme.intents.primary.main,
193
- color: theme.intents.primary.on,
194
- },
195
- successButton: {
196
- backgroundColor: theme.intents.success.main,
197
- color: theme.intents.success.on,
198
- },
199
- errorText: {
200
- color: theme.intents.error.main,
201
- },
202
- }));
203
- ```
204
-
205
- ### Component Color System
206
- ```tsx
207
- const styles = StyleSheet.create((theme) => ({
208
- card: {
209
- backgroundColor: theme.colors.surface.elevated,
210
- borderColor: theme.colors.border.primary,
211
- borderWidth: 1,
212
- },
213
- title: {
214
- color: theme.colors.text.primary,
215
- fontSize: theme.typography.fontSize.lg,
216
- fontWeight: theme.typography.fontWeight.bold,
217
- },
218
- subtitle: {
219
- color: theme.colors.text.secondary,
220
- fontSize: theme.typography.fontSize.md,
221
- },
222
- }));
223
- ```
224
-
225
- ### Responsive Styling
226
- ```tsx
227
- const styles = StyleSheet.create((theme, rt) => ({
228
- container: {
229
- padding: theme.spacing.md,
230
- [rt.breakpoint]: {
231
- xs: { padding: theme.spacing.sm },
232
- md: { padding: theme.spacing.lg },
233
- xl: { padding: theme.spacing.xl },
234
- },
235
- },
236
- }));
237
- ```
238
-
239
- ### Variants and States
240
- ```tsx
241
- const styles = StyleSheet.create((theme) => ({
242
- button: {
243
- padding: theme.spacing.md,
244
- borderRadius: theme.borderRadius.md,
245
- variants: {
246
- intent: {
247
- primary: {
248
- backgroundColor: theme.intents.primary.main,
249
- color: theme.intents.primary.on,
250
- },
251
- success: {
252
- backgroundColor: theme.intents.success.main,
253
- color: theme.intents.success.on,
254
- },
255
- },
256
- size: {
257
- small: { padding: theme.spacing.sm },
258
- large: { padding: theme.spacing.lg },
259
- },
260
- },
261
- },
262
- }));
263
- ```
264
-
265
- ## Accessibility and High Contrast
266
-
267
- ### High Contrast Themes
268
- ```tsx
269
- const highContrastLight = extendTheme(defaultLightTheme, {
270
- colors: {
271
- text: {
272
- primary: '#000000', // Pure black
273
- secondary: '#1a1a1a', // Near black
274
- },
275
- border: {
276
- primary: '#000000', // Black borders
277
- focus: '#0066cc', // High contrast focus
278
- },
279
- },
280
- });
281
- ```
282
-
283
- ### WCAG Compliance
284
- - All default themes meet WCAG AA standards
285
- - Text contrast ≥ 4.5:1 for normal text
286
- - Text contrast ≥ 3:1 for large text (18pt+)
287
- - UI element contrast ≥ 3:1
288
-
289
- ## Color Utilities
290
-
291
- ### Color Manipulation
292
- ```tsx
293
- import { lighten, darken } from '@idealyst/theme';
294
-
295
- const lightBlue = lighten('#3b82f6', 0.2); // 20% lighter
296
- const darkBlue = darken('#3b82f6', 0.2); // 20% darker
297
- ```
298
-
299
- ### Palette Creation
300
- ```tsx
301
- import {
302
- createStandardPalettes,
303
- createDarkPalettes,
304
- createLightIntentMappings,
305
- createDarkIntentMappings
306
- } from '@idealyst/theme';
307
-
308
- const standardPalettes = createStandardPalettes();
309
- const darkPalettes = createDarkPalettes();
310
- const lightIntents = createLightIntentMappings(standardPalettes);
311
- const darkIntents = createDarkIntentMappings(darkPalettes);
312
- ```
313
-
314
- ## Breakpoint System
315
-
316
- ```tsx
317
- breakpoints: {
318
- xs: 0, // Mobile
319
- sm: 576, // Mobile landscape
320
- md: 768, // Tablet
321
- lg: 992, // Desktop
322
- xl: 1200, // Large desktop
323
- xxl: 1400, // Extra large desktop
324
- }
325
-
326
- // Usage in styles
327
- [miniRuntime.breakpoint]: {
328
- md: { /* tablet and up */ },
329
- lg: { /* desktop and up */ },
330
- }
331
- ```
332
-
333
- ## Theme Structure
334
-
335
- Complete theme object structure:
336
- ```tsx
337
- interface AppTheme {
338
- palettes: Record<string, ThemeColorPalette>; // 8 palettes × 10 shades
339
- intents: Record<string, ResolvedIntent>; // Semantic color mappings
340
- colors: ThemeColorSystem; // Component color system
341
- typography: TypographySystem; // Font system
342
- spacing: SpacingSystem; // Spacing scale
343
- borderRadius: BorderRadiusSystem; // Border radius scale
344
- shadows: ShadowSystem; // Shadow definitions
345
- transitions: TransitionSystem; // Animation timings
346
- breakpoints: BreakpointSystem; // Responsive breakpoints
347
- }
348
- ```
349
-
350
- ## Best Practices for LLMs
351
-
352
- 1. **Use intent colors** - Prefer `theme.intents.primary.main` over direct palette access
353
- 2. **Component color system** - Use `theme.colors.text.primary` for consistent text colors
354
- 3. **Spacing consistency** - Use `theme.spacing.*` for consistent spacing
355
- 4. **Typography scale** - Use `theme.typography.fontSize.*` for consistent text sizes
356
- 5. **Responsive design** - Leverage breakpoints for adaptive layouts
357
- 6. **Accessibility** - Always consider contrast and readability
358
- 7. **Theme extension** - Use `extendTheme()` to customize existing themes
359
- 8. **Color generation** - Use `generateColorPalette()` for brand colors
360
-
361
- ## File-Based Documentation Access
362
-
363
- Complete documentation is available as markdown files:
364
-
365
- ```bash
366
- # Main overview
367
- README.md
368
-
369
- # Component-specific documentation
370
- src/README.md # Theme system overview
371
- src/themeBuilder.md # Core theme creation utilities
372
- src/colors.md # Color palette definitions
373
- src/defaultThemes.md # Default light and dark themes
374
-
375
- # LLM-optimized reference
376
- CLAUDE.md # This file
377
- ```
378
-
379
- ## Import Patterns
380
-
381
- ```tsx
382
- // Core theme functions
383
- import { createTheme, extendTheme, generateColorPalette } from '@idealyst/theme';
384
-
385
- // Default themes
386
- import { defaultLightTheme, defaultDarkTheme } from '@idealyst/theme';
387
-
388
- // Theme presets
389
- import { themePresets } from '@idealyst/theme';
390
-
391
- // Color utilities
392
- import { lighten, darken } from '@idealyst/theme';
393
-
394
- // Breakpoints
395
- import { breakpoints } from '@idealyst/theme';
396
-
397
- // Unistyles integration
398
- import { StyleSheet, UnistylesRuntime } from 'react-native-unistyles';
399
- ```
400
-
401
- ## Quick Reference
402
-
403
- ### Essential Setup
404
- ```tsx
405
- import { StyleSheet } from 'react-native-unistyles';
406
- import { defaultLightTheme, defaultDarkTheme } from '@idealyst/theme';
407
-
408
- StyleSheet.configure({
409
- themes: { light: defaultLightTheme, dark: defaultDarkTheme },
410
- settings: { adaptiveThemes: true },
411
- });
412
- ```
413
-
414
- ### Theme Usage
415
- ```tsx
416
- const styles = StyleSheet.create((theme) => ({
417
- container: {
418
- backgroundColor: theme.colors.surface.primary,
419
- padding: theme.spacing.md,
420
- },
421
- }));
422
- ```
423
-
424
- ### Color Access
425
- ```tsx
426
- // Intent colors (recommended)
427
- theme.intents.primary.main
428
- theme.intents.success.container
429
-
430
- // Component colors
431
- theme.colors.text.primary
432
- theme.colors.surface.elevated
433
- theme.colors.border.focus
434
-
435
- // Direct palette access
436
- theme.palettes.blue[500]
437
- ```
438
-
439
- ### Theme Creation
440
- ```tsx
441
- const customTheme = extendTheme(defaultLightTheme, {
442
- palettes: { brand: generateColorPalette('#8b5cf6') },
443
- intents: { primary: 'brand' },
444
- });
445
- ```
446
-
447
- This provides a complete theming system for building consistent, accessible, and visually appealing user interfaces across React and React Native platforms.
@@ -1,208 +0,0 @@
1
- # LLM Documentation Access Guide - Theme
2
-
3
- This guide explains exactly how LLMs can access @idealyst/theme documentation in real-world scenarios.
4
-
5
- ## Scenario 1: Working in a Project with the Package Installed
6
-
7
- When helping a developer who has `@idealyst/theme` installed in their project:
8
-
9
- ### Quick Overview
10
- ```bash
11
- # Read the main documentation file
12
- cat node_modules/@idealyst/theme/CLAUDE.md
13
- ```
14
- This gives you everything in one file - all theming concepts, color systems, and usage patterns.
15
-
16
- ### Specific Component Details
17
- ```bash
18
- # Theme system overview
19
- cat node_modules/@idealyst/theme/src/README.md
20
-
21
- # Core theme creation utilities
22
- cat node_modules/@idealyst/theme/src/themeBuilder.md
23
-
24
- # Color palette definitions
25
- cat node_modules/@idealyst/theme/src/colors.md
26
-
27
- # Default themes (light and dark)
28
- cat node_modules/@idealyst/theme/src/defaultThemes.md
29
- ```
30
-
31
- ### Component Discovery
32
- ```bash
33
- # See all available documentation
34
- ls node_modules/@idealyst/theme/src/*.md
35
-
36
- # Will show:
37
- # node_modules/@idealyst/theme/src/README.md
38
- # node_modules/@idealyst/theme/src/themeBuilder.md
39
- # node_modules/@idealyst/theme/src/colors.md
40
- # node_modules/@idealyst/theme/src/defaultThemes.md
41
- ```
42
-
43
- ## Scenario 2: Repository/GitHub Access
44
-
45
- When working with the source repository or GitHub:
46
-
47
- ### Main Documentation
48
- - `packages/theme/README.md` - Complete overview with examples
49
- - `packages/theme/CLAUDE.md` - LLM-optimized quick reference
50
-
51
- ### Component Documentation
52
- - `packages/theme/src/README.md` - Theme system overview
53
- - `packages/theme/src/themeBuilder.md` - Core utilities
54
- - `packages/theme/src/colors.md` - Color palette system
55
- - `packages/theme/src/defaultThemes.md` - Default light/dark themes
56
-
57
- ## Scenario 3: Package Manager Info
58
-
59
- ```bash
60
- # View package information
61
- npm info @idealyst/theme
62
-
63
- # View package README
64
- npm docs @idealyst/theme
65
-
66
- # Download and examine (if needed)
67
- npm pack @idealyst/theme
68
- tar -tf idealyst-theme-*.tgz | grep README
69
- ```
70
-
71
- ## Recommended LLM Workflow
72
-
73
- ### Step 1: Quick Reference
74
- Start with `CLAUDE.md` for:
75
- - Complete theming system overview
76
- - Color system structure (palettes, intents, component colors)
77
- - Typography, spacing, and layout systems
78
- - Quick setup and usage patterns
79
-
80
- ### Step 2: Specific Component Help
81
- When user asks about specific theming features:
82
- 1. Read relevant .md file for complete details
83
- 2. Use the detailed API reference, examples, and best practices
84
-
85
- ### Step 3: Theme Creation Discovery
86
- When user asks "how do I create custom themes":
87
- 1. Point to `src/themeBuilder.md` for core creation utilities
88
- 2. Show `src/colors.md` for palette understanding
89
- 3. Explain extension vs creation from scratch
90
-
91
- ## File Locations Summary
92
-
93
- ```
94
- @idealyst/theme/
95
- ├── README.md # Complete overview + examples
96
- ├── CLAUDE.md # LLM quick reference (START HERE)
97
- ├── LLM-ACCESS-GUIDE.md # This access guide
98
- ├── src/
99
- │ ├── README.md # Theme system overview
100
- │ ├── themeBuilder.md # Core theme creation utilities
101
- │ ├── colors.md # Color palette definitions
102
- │ └── defaultThemes.md # Default light and dark themes
103
- ```
104
-
105
- ## Pro Tips for LLMs
106
-
107
- 1. **Always start with `CLAUDE.md`** - it has everything you need for 90% of theming questions
108
- 2. **Color system is key** - Understand palettes → intents → component colors hierarchy
109
- 3. **Default themes first** - Start with `defaultLightTheme`/`defaultDarkTheme`, extend as needed
110
- 4. **Intent-based colors** - Prefer `theme.intents.primary.main` over direct palette access
111
- 5. **Component color system** - Use `theme.colors.text.primary` for consistent styling
112
- 6. **Generation over manual** - Use `generateColorPalette()` for brand colors
113
-
114
- ## Quick Command Reference
115
-
116
- ```bash
117
- # Essential reads for any LLM session
118
- cat CLAUDE.md # Complete theming reference
119
- cat README.md # Overview + comprehensive examples
120
-
121
- # Specific component help
122
- cat src/README.md # Theme system overview
123
- cat src/themeBuilder.md # Theme creation utilities
124
- cat src/colors.md # Color palette system
125
- cat src/defaultThemes.md # Default themes
126
-
127
- # Discovery
128
- ls src/*.md # List all component docs
129
- ```
130
-
131
- ## Theme-Specific Guidance
132
-
133
- ### For "How do I set up theming?" questions:
134
- 1. Start with `CLAUDE.md` quick setup section
135
- 2. Show default theme registration
136
- 3. Explain basic component usage with `createStyleSheet`
137
-
138
- ### For "How do I customize colors?" questions:
139
- 1. Read `src/colors.md` for palette understanding
140
- 2. Read `src/themeBuilder.md` for `generateColorPalette` and `extendTheme`
141
- 3. Show intent system usage
142
-
143
- ### For "What colors are available?" questions:
144
- 1. Reference `src/colors.md` for complete palette overview
145
- 2. Explain shade system (50-900)
146
- 3. Show 8 available palettes: blue, green, red, amber, gray, cyan, purple, pink
147
-
148
- ### For "How do I create dark themes?" questions:
149
- 1. Reference `src/defaultThemes.md` for dark theme patterns
150
- 2. Show color system differences between light and dark
151
- 3. Explain automatic theme switching
152
-
153
- ## Common User Questions and File References
154
-
155
- | User Question | Primary Reference | Secondary References |
156
- |---------------|------------------|---------------------|
157
- | "How do I set up theming?" | `CLAUDE.md` | `README.md` |
158
- | "What colors are available?" | `src/colors.md` | `CLAUDE.md` |
159
- | "How do I create custom themes?" | `src/themeBuilder.md` | `src/colors.md` |
160
- | "How do dark themes work?" | `src/defaultThemes.md` | `CLAUDE.md` |
161
- | "How do I use themes in components?" | `CLAUDE.md` | `README.md` |
162
- | "What's the color system structure?" | `src/README.md` | `src/colors.md` |
163
-
164
- ## Color System Quick Reference
165
-
166
- ### Hierarchy
167
- 1. **Palettes** (8 palettes × 10 shades) → Raw color definitions
168
- 2. **Intents** (semantic mappings) → primary, success, error, warning, neutral
169
- 3. **Component Colors** (UI system) → text, surface, border, interactive
170
-
171
- ### Key Concepts for LLMs
172
- - **Shade 500** = base color in each palette
173
- - **Shades 50-200** = light backgrounds, subtle elements
174
- - **Shades 600-900** = text, high contrast elements
175
- - **Intent system** = semantic meaning (primary = main brand actions)
176
- - **Component colors** = structured system for UI elements
177
-
178
- ## Usage Patterns for LLMs
179
-
180
- ### Basic Theme Usage
181
- ```bash
182
- # Show this pattern for component styling
183
- const styles = createStyleSheet((theme) => ({
184
- container: {
185
- backgroundColor: theme.colors.surface.primary,
186
- padding: theme.spacing.md,
187
- },
188
- }));
189
- ```
190
-
191
- ### Theme Creation
192
- ```bash
193
- # Show this pattern for custom themes
194
- const customTheme = extendTheme(defaultLightTheme, {
195
- palettes: { brand: generateColorPalette('#8b5cf6') },
196
- intents: { primary: 'brand' },
197
- });
198
- ```
199
-
200
- ### Color Access
201
- ```bash
202
- # Recommend this hierarchy:
203
- # 1. Intent colors: theme.intents.primary.main
204
- # 2. Component colors: theme.colors.text.primary
205
- # 3. Direct palette: theme.palettes.blue[500]
206
- ```
207
-
208
- This approach ensures LLMs have clear, practical access to all theming documentation while understanding the color system hierarchy and best practices.