@umituz/atomic-next 1.8.0 β†’ 1.8.1

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
@@ -1,19 +1,24 @@
1
1
  # @umituz/atomic-next
2
2
 
3
- A comprehensive atomic design system for Next.js applications with modern React patterns and TypeScript support.
3
+ > **πŸ“± React Native Users**: The React Native atomic design components have been moved to a dedicated template system. For React Native projects, please use the templates in the [app_factory](https://github.com/umituz/app_factory) repository under `generator/tech-stack/react-native/templates/atomics/`.
4
+
5
+ A comprehensive atomic design system specifically built for **Web/Next.js** applications with Server/Client Component separation, modern React patterns, and complete TypeScript support.
4
6
 
5
7
  ## πŸš€ Features
6
8
 
7
- - 🎨 **Atomic Design System**: Built following atomic design principles (Atoms β†’ Molecules β†’ Organisms)
8
- - ⚑ **Modern React**: React 18+ with TypeScript and modern patterns
9
- - 🎯 **Next.js Optimized**: Built specifically for Next.js applications
10
- - 🧩 **Radix UI Foundation**: Built on top of Radix UI primitives
11
- - 🎨 **Tailwind CSS**: Styling with Tailwind CSS utilities
12
- - πŸ“± **Responsive**: Mobile-first design with responsive utilities
13
- - πŸŒ™ **Theme Support**: Light/dark mode ready
14
- - β™Ώ **Accessible**: WCAG 2.1 AA compliant components
15
- - πŸ“¦ **Tree Shakeable**: Import only what you need
16
- - πŸ”§ **TypeScript**: Full TypeScript support with excellent DX
9
+ - 🎨 **Atomic Design System**: Built following atomic design principles with true component hierarchy
10
+ - ⚑ **Next.js Optimized**: Server/Client Component patterns with built-in optimizations
11
+ - 🧩 **Radix UI Foundation**: Built on top of industry-standard accessible primitives
12
+ - 🎯 **Modern React**: React 18+ with forwardRef, Slot patterns, and advanced composition
13
+ - πŸ”§ **TypeScript First**: Complete type safety with excellent developer experience
14
+ - 🎨 **Sophisticated Variants**: Class Variance Authority for powerful component variants
15
+ - πŸ“± **Responsive Design**: Mobile-first approach with responsive utilities
16
+ - πŸŒ™ **Theme System**: Light/dark mode with CSS custom properties
17
+ - β™Ώ **Accessibility**: WCAG 2.1 AA compliant components out of the box
18
+ - πŸ“¦ **Tree Shakeable**: Import only what you need with optimized bundles
19
+ - πŸš€ **Performance**: Optimized for production with minimal runtime overhead
20
+ - πŸŽͺ **Polymorphic**: Components that can render as different elements seamlessly
21
+ - 🌐 **Web Focus**: Optimized specifically for web/browser environments
17
22
 
18
23
  ## πŸ“¦ Installation
19
24
 
@@ -25,40 +30,73 @@ yarn add @umituz/atomic-next
25
30
  pnpm add @umituz/atomic-next
26
31
  ```
27
32
 
33
+ ### Peer Dependencies
34
+
35
+ ```json
36
+ {
37
+ "react": ">=18.0.0",
38
+ "react-dom": ">=18.0.0",
39
+ "next": ">=13.0.0"
40
+ }
41
+ ```
42
+
28
43
  ## 🎨 Design System Architecture
29
44
 
30
45
  ### Design Tokens
31
- - **Colors**: Primary, semantic, and utility colors
32
- - **Typography**: Font families, sizes, weights, and line heights
46
+
47
+ Complete design token system with semantic naming and consistent values:
48
+
49
+ #### Colors
50
+ - **Brand Colors**: Primary (#9333EA), Secondary (#EC4899), Accent (#F59E0B)
51
+ - **Semantic Colors**: Success, Warning, Error, Info with light/dark variants
52
+ - **Gray Scale**: 50-900 scale for neutral colors
53
+ - **Utility Functions**: Color manipulation utilities (alpha, hex to RGB/HSL)
54
+
55
+ #### Typography
56
+ - **Semantic Variants**: h1-h6, body, large, small, xs, lead, muted, caption, label
57
+ - **Font Weights**: Complete range from thin to black
58
+ - **Text Alignment**: Left, center, right, justify
59
+ - **Color Variants**: Primary, secondary, semantic colors
60
+
61
+ #### Design Tokens
33
62
  - **Spacing**: Consistent spacing scale
34
- - **Shadows**: Box shadow utilities
63
+ - **Shadows**: Professional shadow system
35
64
  - **Borders**: Border radius and border utilities
36
- - **Animations**: Transition and animation presets
37
-
38
- ### Component Hierarchy
39
-
40
- #### Atoms (Basic Components)
41
- - `AtomicButton` - Button variants with loading states
42
- - `AtomicInput` - Form inputs with validation
43
- - `AtomicText` - Typography components
44
- - `AtomicIcon` - Icon wrapper with size variants
45
- - `AtomicAvatar` - User avatars with fallbacks
46
- - `AtomicBadge` - Status and count badges
47
- - `AtomicSpinner` - Loading spinners
48
-
49
- #### Molecules (Combined Components)
50
- - `AtomicFormField` - Input with label and validation
51
- - `AtomicDropdown` - Select and dropdown menus
52
- - `AtomicNavigation` - Navigation components
53
- - `AtomicCard` - Content cards with variants
54
-
55
- #### Organisms (Complex Components)
56
- - `AtomicForm` - Complete form layouts
57
- - `AtomicHeader` - Application headers
58
- - `AtomicLayout` - Page layout components
65
+ - **Animations**: Smooth transitions and animations
66
+
67
+ ### Component Architecture
68
+
69
+ #### Atoms (Foundation Components)
70
+
71
+ **Layout & Structure**
72
+ - `AtomicDiv` - Semantic div wrapper with design system integration
73
+ - `AtomicCard` - Content cards with header, title, description, content, footer
74
+ - `AtomicText` - Complete typography system with semantic HTML
75
+
76
+ **Interactive Elements**
77
+ - `AtomicButton` - Comprehensive button system with variants and states
78
+ - `AtomicInput` - Form inputs with validation states
79
+ - `AtomicCheckbox` - Accessible checkbox component
80
+ - `AtomicSwitch` - Toggle switch component
81
+ - `AtomicLink` - Navigation links with Next.js optimization
82
+
83
+ **Display Components**
84
+ - `AtomicAvatar` - User avatars with image and fallback support
85
+ - `AtomicImage` - Optimized image component with variants
86
+ - `AtomicIcon` - Icon wrapper with consistent sizing
87
+ - `AtomicBadge` - Status and count badges with variants
88
+ - `AtomicTag` - Content tags and labels
89
+
90
+ **Feedback Components**
91
+ - `AtomicSpinner` - Loading spinners (Button, Page, Inline variants)
92
+
93
+ **System Components**
94
+ - `AtomicThemeProvider` - Theme context and CSS custom properties
59
95
 
60
96
  ## πŸš€ Quick Start
61
97
 
98
+ ### Basic Setup
99
+
62
100
  ```tsx
63
101
  import {
64
102
  AtomicButton,
@@ -67,17 +105,20 @@ import {
67
105
  AtomicThemeProvider
68
106
  } from '@umituz/atomic-next'
69
107
 
70
- function App() {
108
+ export default function App() {
71
109
  return (
72
110
  <AtomicThemeProvider>
73
111
  <AtomicCard>
74
- <AtomicText variant="heading">
112
+ <AtomicText variant="h2">
75
113
  Welcome to Atomic Next
76
114
  </AtomicText>
115
+ <AtomicText variant="body" color="muted">
116
+ A comprehensive design system for Next.js applications.
117
+ </AtomicText>
77
118
  <AtomicButton
78
119
  variant="primary"
79
120
  size="lg"
80
- onClick={() => console.log('Clicked!')}
121
+ onClick={() => console.log('Getting started!')}
81
122
  >
82
123
  Get Started
83
124
  </AtomicButton>
@@ -87,18 +128,372 @@ function App() {
87
128
  }
88
129
  ```
89
130
 
131
+ ### Advanced Component Examples
132
+
133
+ #### Button Variants and States
134
+
135
+ ```tsx
136
+ import { AtomicButton } from '@umituz/atomic-next'
137
+ import { Download, ArrowRight } from 'lucide-react'
138
+
139
+ export function ButtonExamples() {
140
+ return (
141
+ <div className="space-y-4">
142
+ {/* Variants */}
143
+ <AtomicButton variant="primary">Primary</AtomicButton>
144
+ <AtomicButton variant="secondary">Secondary</AtomicButton>
145
+ <AtomicButton variant="brand">Brand Gradient</AtomicButton>
146
+ <AtomicButton variant="outline">Outline</AtomicButton>
147
+ <AtomicButton variant="ghost">Ghost</AtomicButton>
148
+
149
+ {/* With Icons */}
150
+ <AtomicButton leftIcon={<Download />}>
151
+ Download
152
+ </AtomicButton>
153
+ <AtomicButton rightIcon={<ArrowRight />}>
154
+ Continue
155
+ </AtomicButton>
156
+
157
+ {/* Loading State */}
158
+ <AtomicButton loading variant="primary">
159
+ Processing...
160
+ </AtomicButton>
161
+
162
+ {/* Sizes */}
163
+ <AtomicButton size="sm">Small</AtomicButton>
164
+ <AtomicButton size="lg">Large</AtomicButton>
165
+ <AtomicButton fullWidth>Full Width</AtomicButton>
166
+ </div>
167
+ )
168
+ }
169
+ ```
170
+
171
+ #### Typography System
172
+
173
+ ```tsx
174
+ import { AtomicText } from '@umituz/atomic-next'
175
+
176
+ export function TypographyExamples() {
177
+ return (
178
+ <div className="space-y-4">
179
+ {/* Headings - Automatically render as semantic HTML */}
180
+ <AtomicText variant="h1">Main Heading</AtomicText>
181
+ <AtomicText variant="h2">Section Heading</AtomicText>
182
+ <AtomicText variant="h3">Subsection</AtomicText>
183
+
184
+ {/* Body Text */}
185
+ <AtomicText variant="lead">
186
+ This is lead text for introductions
187
+ </AtomicText>
188
+ <AtomicText variant="body">
189
+ Regular body text with proper line height
190
+ </AtomicText>
191
+ <AtomicText variant="small" color="muted">
192
+ Small muted text for captions
193
+ </AtomicText>
194
+
195
+ {/* Colors */}
196
+ <AtomicText color="primary">Primary color text</AtomicText>
197
+ <AtomicText color="success">Success message</AtomicText>
198
+ <AtomicText color="error">Error message</AtomicText>
199
+
200
+ {/* Utilities */}
201
+ <AtomicText truncate weight="semibold" align="center">
202
+ Centered, bold, truncated text
203
+ </AtomicText>
204
+ </div>
205
+ )
206
+ }
207
+ ```
208
+
209
+ #### Card Composition
210
+
211
+ ```tsx
212
+ import {
213
+ AtomicCard,
214
+ AtomicCardHeader,
215
+ AtomicCardTitle,
216
+ AtomicCardDescription,
217
+ AtomicCardContent,
218
+ AtomicCardFooter,
219
+ AtomicButton,
220
+ AtomicText
221
+ } from '@umituz/atomic-next'
222
+
223
+ export function CardExample() {
224
+ return (
225
+ <AtomicCard className="w-96">
226
+ <AtomicCardHeader>
227
+ <AtomicCardTitle>Project Card</AtomicCardTitle>
228
+ <AtomicCardDescription>
229
+ A comprehensive project management solution
230
+ </AtomicCardDescription>
231
+ </AtomicCardHeader>
232
+
233
+ <AtomicCardContent>
234
+ <AtomicText variant="body">
235
+ This card demonstrates the composition pattern with
236
+ multiple atomic components working together.
237
+ </AtomicText>
238
+ </AtomicCardContent>
239
+
240
+ <AtomicCardFooter className="flex justify-between">
241
+ <AtomicButton variant="outline">Cancel</AtomicButton>
242
+ <AtomicButton variant="primary">Save</AtomicButton>
243
+ </AtomicCardFooter>
244
+ </AtomicCard>
245
+ )
246
+ }
247
+ ```
248
+
249
+ ## 🎯 Component API
250
+
251
+ ### AtomicButton
252
+
253
+ ```tsx
254
+ interface AtomicButtonProps {
255
+ variant?: 'default' | 'primary' | 'brand' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'
256
+ size?: 'default' | 'sm' | 'lg' | 'icon'
257
+ asChild?: boolean
258
+ loading?: boolean
259
+ leftIcon?: React.ReactNode
260
+ rightIcon?: React.ReactNode
261
+ fullWidth?: boolean
262
+ }
263
+ ```
264
+
265
+ ### AtomicText
266
+
267
+ ```tsx
268
+ interface AtomicTextProps {
269
+ variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'large' | 'small' | 'xs' | 'lead' | 'muted' | 'caption' | 'label'
270
+ color?: 'default' | 'primary' | 'secondary' | 'muted' | 'success' | 'warning' | 'error' | 'info'
271
+ align?: 'left' | 'center' | 'right' | 'justify'
272
+ weight?: 'thin' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black'
273
+ as?: 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label'
274
+ asChild?: boolean
275
+ truncate?: boolean
276
+ selectable?: boolean
277
+ }
278
+ ```
279
+
280
+ ### AtomicCard
281
+
282
+ ```tsx
283
+ interface AtomicCardProps {
284
+ variant?: 'default' | 'outlined' | 'elevated'
285
+ padding?: 'none' | 'sm' | 'md' | 'lg'
286
+ }
287
+
288
+ // Subcomponents: AtomicCardHeader, AtomicCardTitle, AtomicCardDescription,
289
+ // AtomicCardContent, AtomicCardFooter
290
+ ```
291
+
292
+ ## 🎨 Customization
293
+
294
+ ### CSS Custom Properties
295
+
296
+ The design system uses CSS custom properties for theming:
297
+
298
+ ```css
299
+ :root {
300
+ --atomic-primary: #9333EA;
301
+ --atomic-primary-dark: #7C3AED;
302
+ --atomic-secondary: #EC4899;
303
+ --atomic-accent: #F59E0B;
304
+
305
+ /* Complete color system available */
306
+ }
307
+ ```
308
+
309
+ ### Theme Provider
310
+
311
+ ```tsx
312
+ import { AtomicThemeProvider } from '@umituz/atomic-next'
313
+
314
+ export default function App() {
315
+ return (
316
+ <AtomicThemeProvider
317
+ theme="dark" // or "light"
318
+ customColors={{
319
+ primary: '#your-color',
320
+ secondary: '#your-color'
321
+ }}
322
+ >
323
+ {/* Your app */}
324
+ </AtomicThemeProvider>
325
+ )
326
+ }
327
+ ```
328
+
329
+ ### Extending Components
330
+
331
+ ```tsx
332
+ import { AtomicButton, buttonVariants } from '@umituz/atomic-next'
333
+ import { cn } from '@umituz/atomic-next'
334
+
335
+ // Create custom variants
336
+ const customButtonVariants = {
337
+ ...buttonVariants,
338
+ variant: {
339
+ ...buttonVariants.variants.variant,
340
+ gradient: 'bg-gradient-to-r from-purple-500 to-pink-500'
341
+ }
342
+ }
343
+
344
+ // Or extend existing components
345
+ const CustomButton = ({ className, ...props }) => (
346
+ <AtomicButton
347
+ className={cn('custom-styles', className)}
348
+ {...props}
349
+ />
350
+ )
351
+ ```
352
+
353
+ ## πŸ“± Responsive Design
354
+
355
+ All components include responsive variants and mobile-first design:
356
+
357
+ ```tsx
358
+ <AtomicText
359
+ variant="h1"
360
+ className="text-2xl md:text-4xl lg:text-6xl"
361
+ >
362
+ Responsive Heading
363
+ </AtomicText>
364
+
365
+ <AtomicButton
366
+ size="sm"
367
+ className="md:size-default lg:size-lg"
368
+ >
369
+ Responsive Button
370
+ </AtomicButton>
371
+ ```
372
+
373
+ ## β™Ώ Accessibility
374
+
375
+ - **WCAG 2.1 AA Compliant**: All components meet accessibility standards
376
+ - **Keyboard Navigation**: Full keyboard support with proper focus management
377
+ - **Screen Reader Support**: Semantic HTML and ARIA attributes
378
+ - **Color Contrast**: Tested color combinations meet contrast requirements
379
+ - **Focus Management**: Visible focus indicators and logical tab order
380
+
381
+ ## πŸ› οΈ Development
382
+
383
+ ### Building from Source
384
+
385
+ ```bash
386
+ # Clone the repository
387
+ git clone https://github.com/umituz/atomic-next.git
388
+ cd atomic-next
389
+
390
+ # Install dependencies
391
+ npm install
392
+
393
+ # Start development mode
394
+ npm run dev
395
+
396
+ # Build for production
397
+ npm run build
398
+
399
+ # Run linting
400
+ npm run lint
401
+ npm run lint:fix
402
+
403
+ # Format code
404
+ npm run format
405
+ npm run format:check
406
+
407
+ # Type checking
408
+ npm run type-check
409
+ ```
410
+
411
+ ### Project Structure
412
+
413
+ ```
414
+ src/
415
+ β”œβ”€β”€ atoms/ # Atomic components
416
+ β”‚ β”œβ”€β”€ buttons/ # Button components
417
+ β”‚ β”œβ”€β”€ display/ # Display components
418
+ β”‚ β”œβ”€β”€ inputs/ # Input components
419
+ β”‚ β”œβ”€β”€ feedback/ # Feedback components
420
+ β”‚ β”œβ”€β”€ layout/ # Layout components
421
+ β”‚ β”œβ”€β”€ navigation/ # Navigation components
422
+ β”‚ └── providers/ # Context providers
423
+ β”œβ”€β”€ tokens/ # Design tokens
424
+ β”‚ β”œβ”€β”€ colors/ # Color system
425
+ β”‚ β”œβ”€β”€ typography/ # Typography tokens
426
+ β”‚ β”œβ”€β”€ spacing/ # Spacing scale
427
+ β”‚ β”œβ”€β”€ shadows/ # Shadow system
428
+ β”‚ β”œβ”€β”€ borders/ # Border utilities
429
+ β”‚ └── animations/ # Animation presets
430
+ └── utils/ # Utility functions
431
+ ```
432
+
433
+ ### Testing
434
+
435
+ ```bash
436
+ # Run tests
437
+ npm test
438
+
439
+ # Run tests with coverage
440
+ npm run test:coverage
441
+
442
+ # Run tests in watch mode
443
+ npm run test:watch
444
+ ```
445
+
90
446
  ## πŸ“š Documentation
91
447
 
92
- Visit our [documentation site](https://atomic-next.umituz.com) for detailed guides and API references.
448
+ Visit our [documentation site](https://atomic-next.umituz.com) for:
449
+
450
+ - **Interactive Component Playground**
451
+ - **Complete API Documentation**
452
+ - **Design Guidelines**
453
+ - **Migration Guides**
454
+ - **Advanced Patterns**
455
+ - **Customization Examples**
93
456
 
94
457
  ## 🀝 Contributing
95
458
 
96
- Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md) first.
459
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
460
+
461
+ ### Development Workflow
462
+
463
+ 1. Fork the repository
464
+ 2. Create a feature branch: `git checkout -b feature/amazing-feature`
465
+ 3. Make your changes and add tests
466
+ 4. Run the test suite: `npm test`
467
+ 5. Commit your changes: `git commit -m 'Add amazing feature'`
468
+ 6. Push to the branch: `git push origin feature/amazing-feature`
469
+ 7. Open a Pull Request
97
470
 
98
471
  ## πŸ“„ License
99
472
 
100
- MIT License - see [LICENSE](LICENSE) for details.
473
+ MIT License - see the [LICENSE](LICENSE) file for details.
101
474
 
102
475
  ## πŸ‘¨β€πŸ’» Author
103
476
 
104
- **Ümit UZ** - [umituz.com](https://umituz.com)
477
+ **Ümit UZ**
478
+ - Website: [umituz.com](https://umituz.com)
479
+ - Email: [umit@umituz.com](mailto:umit@umituz.com)
480
+ - GitHub: [@umituz](https://github.com/umituz)
481
+ - LinkedIn: [ΓΌmit-uz](https://linkedin.com/in/ΓΌmit-uz)
482
+
483
+ ## πŸ™ Acknowledgments
484
+
485
+ - Built with [Radix UI](https://radix-ui.com) primitives
486
+ - Styled with [Tailwind CSS](https://tailwindcss.com)
487
+ - Component variants powered by [Class Variance Authority](https://cva.style)
488
+ - Icons by [Lucide React](https://lucide.dev)
489
+
490
+ ---
491
+
492
+ <div align="center">
493
+ <p>Made with ❀️ for the Next.js community</p>
494
+ <p>
495
+ <a href="https://github.com/umituz/atomic-next">⭐ Star on GitHub</a> β€’
496
+ <a href="https://github.com/umituz/atomic-next/issues">πŸ› Report Bug</a> β€’
497
+ <a href="https://github.com/umituz/atomic-next/discussions">πŸ’¬ Discussions</a>
498
+ </p>
499
+ </div>