@shohojdhara/atomix 0.5.2 → 0.5.4

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 (39) hide show
  1. package/atomix.config.ts +33 -33
  2. package/dist/config.d.ts +187 -112
  3. package/dist/config.js +7 -49
  4. package/dist/config.js.map +1 -1
  5. package/dist/index.d.ts +1958 -900
  6. package/dist/index.esm.js +2275 -383
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.js +2327 -417
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.min.js +1 -1
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/theme.d.ts +1390 -276
  13. package/dist/theme.js +2129 -621
  14. package/dist/theme.js.map +1 -1
  15. package/package.json +1 -1
  16. package/scripts/cli/internal/config-loader.js +30 -20
  17. package/src/lib/config/index.ts +38 -362
  18. package/src/lib/config/loader.ts +419 -0
  19. package/src/lib/config/public-api.ts +43 -0
  20. package/src/lib/config/types.ts +389 -0
  21. package/src/lib/config/validator.ts +305 -0
  22. package/src/lib/theme/adapters/index.ts +1 -1
  23. package/src/lib/theme/adapters/themeAdapter.ts +358 -229
  24. package/src/lib/theme/components/ThemeToggle.tsx +276 -0
  25. package/src/lib/theme/config/configLoader.ts +351 -0
  26. package/src/lib/theme/config/loader.ts +221 -0
  27. package/src/lib/theme/core/createTheme.ts +126 -50
  28. package/src/lib/theme/core/createThemeObject.ts +7 -4
  29. package/src/lib/theme/hooks/useThemeSwitcher.ts +164 -0
  30. package/src/lib/theme/index.ts +322 -38
  31. package/src/lib/theme/runtime/ThemeProvider.tsx +44 -10
  32. package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +44 -393
  33. package/src/lib/theme/runtime/useTheme.ts +1 -0
  34. package/src/lib/theme/tokens/tokens.ts +101 -1
  35. package/src/lib/theme/types.ts +91 -0
  36. package/src/lib/theme/utils/performanceMonitor.ts +315 -0
  37. package/src/lib/theme/utils/responsive.ts +280 -0
  38. package/src/lib/theme/utils/themeUtils.ts +531 -117
  39. package/src/styles/05-objects/_objects.masonry-grid.scss +3 -3
package/atomix.config.ts CHANGED
@@ -39,7 +39,7 @@
39
39
 
40
40
  // For library development, use local import
41
41
  // For external developers, use: import { defineConfig } from '@shohojdhara/atomix/config';
42
- import { defineConfig } from './src/lib/config/index.ts';
42
+ import { defineConfig } from './src/lib/config';
43
43
 
44
44
  export default defineConfig({
45
45
  /**
@@ -162,11 +162,11 @@ export default defineConfig({
162
162
  // 3: '#bfdbfe',
163
163
  // 4: '#93c5fd',
164
164
  // 5: '#60a5fa',
165
- // 6: '#3b82f6', // main (default)
165
+ // 6: '#3b82f6', # main (default)
166
166
  // 7: '#2563eb',
167
167
  // 8: '#1d4ed8',
168
168
  // 9: '#1e40af',
169
- // 10: '#1e3a8a', // darkest
169
+ // 10: '#1e3a8a', # darkest
170
170
  },
171
171
  // Customize other semantic colors
172
172
  // secondary: { main: '#10b981' },
@@ -183,17 +183,17 @@ export default defineConfig({
183
183
  * These map to tokens like 'spacing-4', 'spacing-8', etc.
184
184
  */
185
185
  // spacing: {
186
- // '1': '0.25rem', // 4px
187
- // '2': '0.5rem', // 8px
188
- // '3': '0.75rem', // 12px
189
- // '4': '1rem', // 16px
190
- // '5': '1.25rem', // 20px
191
- // '6': '1.5rem', // 24px
192
- // '8': '2rem', // 32px
193
- // '10': '2.5rem', // 40px
194
- // '12': '3rem', // 48px
195
- // '16': '4rem', // 64px
196
- // '20': '5rem', // 80px
186
+ // '1': '0.25rem', # 4px
187
+ // '2': '0.5rem', # 8px
188
+ // '3': '0.75rem', # 12px
189
+ // '4': '1rem', # 16px
190
+ // '5': '1.25rem', # 20px
191
+ // '6': '1.5rem', # 24px
192
+ // '8': '2rem', # 32px
193
+ // '10': '2.5rem', # 40px
194
+ // '12': '3rem', # 48px
195
+ // '16': '4rem', # 64px
196
+ // '20': '5rem', # 80px
197
197
  // },
198
198
 
199
199
  /**
@@ -202,24 +202,24 @@ export default defineConfig({
202
202
  * Customize fonts, sizes, weights, and line heights.
203
203
  */
204
204
  // typography: {
205
- // // Font families
205
+ // # Font families
206
206
  // fontFamilies: {
207
207
  // sans: ['Inter', 'system-ui', 'sans-serif'],
208
208
  // serif: ['Georgia', 'serif'],
209
209
  // mono: ['Fira Code', 'monospace'],
210
210
  // },
211
- // // Font sizes
211
+ // # Font sizes
212
212
  // fontSizes: {
213
- // 'xs': '0.75rem', // 12px
214
- // 'sm': '0.875rem', // 14px
215
- // 'base': '1rem', // 16px
216
- // 'lg': '1.125rem', // 18px
217
- // 'xl': '1.25rem', // 20px
218
- // '2xl': '1.5rem', // 24px
219
- // '3xl': '1.875rem', // 30px
220
- // '4xl': '2.25rem', // 36px
213
+ // 'xs': '0.75rem', # 12px
214
+ // 'sm': '0.875rem', # 14px
215
+ // 'base': '1rem', # 16px
216
+ // 'lg': '1.125rem', # 18px
217
+ // 'xl': '1.25rem', # 20px
218
+ // '2xl': '1.5rem', # 24px
219
+ // '3xl': '1.875rem', # 30px
220
+ // '4xl': '2.25rem', # 36px
221
221
  // },
222
- // // Font weights
222
+ // # Font weights
223
223
  // fontWeights: {
224
224
  // 'light': 300,
225
225
  // 'normal': 400,
@@ -227,7 +227,7 @@ export default defineConfig({
227
227
  // 'semibold': 600,
228
228
  // 'bold': 700,
229
229
  // },
230
- // // Line heights
230
+ // # Line heights
231
231
  // lineHeights: {
232
232
  // 'tight': 1.2,
233
233
  // 'normal': 1.5,
@@ -241,11 +241,11 @@ export default defineConfig({
241
241
  * Customize border radius values.
242
242
  */
243
243
  // borderRadius: {
244
- // 'sm': '0.25rem', // 4px
245
- // 'md': '0.5rem', // 8px (default)
246
- // 'lg': '0.75rem', // 12px
247
- // 'xl': '1rem', // 16px
248
- // 'full': '9999px', // Fully rounded
244
+ // 'sm': '0.25rem', # 4px
245
+ // 'md': '0.5rem', # 8px (default)
246
+ // 'lg': '0.75rem', # 12px
247
+ // 'xl': '1rem', # 16px
248
+ // 'full': '9999px', # Fully rounded
249
249
  // },
250
250
 
251
251
  /**
@@ -304,7 +304,7 @@ export default defineConfig({
304
304
  // tokens: {
305
305
  // colors: { /* your full color system */ },
306
306
  // spacing: { /* your full spacing scale */ },
307
- // // ... other token categories
307
+ // # ... other token categories
308
308
  // },
309
309
  },
310
- });
310
+ });
package/dist/config.d.ts CHANGED
@@ -205,6 +205,80 @@ interface BorderRadiusOptions {
205
205
  * Users can augment this interface via module augmentation
206
206
  */
207
207
  interface ThemeCustomProperties {
208
+ interactiveEffects?: {
209
+ vortex?: {
210
+ enabled?: boolean;
211
+ strength?: number;
212
+ radius?: number;
213
+ decay?: number;
214
+ };
215
+ chromaticAberration?: {
216
+ enabled?: boolean;
217
+ mode?: 'longitudinal' | 'lateral' | 'hybrid';
218
+ redShift?: number;
219
+ greenShift?: number;
220
+ blueShift?: number;
221
+ edgeOnly?: boolean;
222
+ edgeThreshold?: number;
223
+ };
224
+ mouseInteraction?: {
225
+ sensitivity?: number;
226
+ trailEffect?: boolean;
227
+ };
228
+ animationSpeed?: {
229
+ base?: number;
230
+ timeMultiplier?: number;
231
+ };
232
+ };
233
+ optimization?: {
234
+ responsive?: {
235
+ breakpoints?: {
236
+ mobile?: string;
237
+ tablet?: string;
238
+ desktop?: string;
239
+ wide?: string;
240
+ };
241
+ deviceScaling?: {
242
+ mobile?: number;
243
+ tablet?: number;
244
+ desktop?: number;
245
+ };
246
+ };
247
+ performance?: {
248
+ fpsTarget?: number;
249
+ autoScaling?: boolean;
250
+ };
251
+ autoScaling?: {
252
+ enabled?: boolean;
253
+ qualityThresholds?: {
254
+ lowEnd?: number;
255
+ midRange?: number;
256
+ highEnd?: number;
257
+ };
258
+ };
259
+ };
260
+ visualPolish?: {
261
+ borders?: {
262
+ iridescentGlow?: boolean;
263
+ shimmerEffect?: boolean;
264
+ beveledEdges?: boolean;
265
+ pulsingGlow?: boolean;
266
+ };
267
+ contentAwareBlur?: {
268
+ enabled?: boolean;
269
+ depthDetection?: boolean;
270
+ edgePreservation?: boolean;
271
+ variableRadius?: boolean;
272
+ };
273
+ holographicEffects?: {
274
+ enabled?: boolean;
275
+ rainbowDiffraction?: boolean;
276
+ scanlineAnimation?: boolean;
277
+ gridOverlay?: boolean;
278
+ dataStream?: boolean;
279
+ pulseRings?: boolean;
280
+ };
281
+ };
208
282
  [key: string]: any;
209
283
  }
210
284
  /**
@@ -278,28 +352,9 @@ interface Theme extends ThemeMetadata {
278
352
  }
279
353
 
280
354
  /**
281
- * Atomix Configuration System
355
+ * Configuration Types
282
356
  *
283
- * Tailwind-like configuration for customizing the Atomix Design System.
284
- *
285
- * External developers can create `atomix.config.ts` in their project root
286
- * to customize design tokens, similar to Tailwind's tailwind.config.js
287
- *
288
- * @example
289
- * ```typescript
290
- * // atomix.config.ts (in your project)
291
- * import { defineConfig } from '@shohojdhara/atomix/config';
292
- *
293
- * export default defineConfig({
294
- * theme: {
295
- * extend: {
296
- * colors: {
297
- * primary: { main: '#7AFFD7' },
298
- * },
299
- * },
300
- * },
301
- * });
302
- * ```
357
+ * Type definitions for the Atomix configuration system.
303
358
  */
304
359
 
305
360
  /**
@@ -327,6 +382,105 @@ interface PaletteColorOptions {
327
382
  dark?: string;
328
383
  contrastText?: string;
329
384
  }
385
+ /**
386
+ * Interactive Effect Configuration
387
+ */
388
+ interface InteractiveEffectsConfig {
389
+ /** Vortex & flow field effects */
390
+ vortex?: {
391
+ enabled?: boolean;
392
+ strength?: number;
393
+ radius?: number;
394
+ decay?: number;
395
+ curlNoise?: boolean;
396
+ velocityTracking?: boolean;
397
+ };
398
+ /** Chromatic aberration effects */
399
+ chromaticAberration?: {
400
+ enabled?: boolean;
401
+ mode?: 'longitudinal' | 'lateral' | 'hybrid';
402
+ redShift?: number;
403
+ greenShift?: number;
404
+ blueShift?: number;
405
+ edgeOnly?: boolean;
406
+ edgeThreshold?: number;
407
+ };
408
+ /** Mouse interaction settings */
409
+ mouseInteraction?: {
410
+ sensitivity?: number;
411
+ trailEffect?: boolean;
412
+ pressureSensitivity?: boolean;
413
+ };
414
+ /** Animation speed controls */
415
+ animationSpeed?: {
416
+ base?: number;
417
+ timeMultiplier?: number;
418
+ };
419
+ }
420
+ /**
421
+ * Optimization Configuration
422
+ */
423
+ interface OptimizationConfig {
424
+ /** Responsive breakpoint system */
425
+ responsive?: {
426
+ breakpoints?: {
427
+ mobile?: string;
428
+ tablet?: string;
429
+ desktop?: string;
430
+ wide?: string;
431
+ };
432
+ /** Device-aware parameter scaling */
433
+ deviceScaling?: {
434
+ mobile?: number;
435
+ tablet?: number;
436
+ desktop?: number;
437
+ };
438
+ };
439
+ /** Performance monitoring */
440
+ performance?: {
441
+ enabled?: boolean;
442
+ fpsTarget?: number;
443
+ autoScaling?: boolean;
444
+ monitorDashboard?: boolean;
445
+ };
446
+ /** Auto-scaling logic based on device capabilities */
447
+ autoScaling?: {
448
+ enabled?: boolean;
449
+ qualityThresholds?: {
450
+ lowEnd?: number;
451
+ midRange?: number;
452
+ highEnd?: number;
453
+ };
454
+ };
455
+ }
456
+ /**
457
+ * Visual Polish Configuration
458
+ */
459
+ interface VisualPolishConfig {
460
+ /** Advanced border effects */
461
+ borders?: {
462
+ iridescentGlow?: boolean;
463
+ shimmerEffect?: boolean;
464
+ beveledEdges?: boolean;
465
+ pulsingGlow?: boolean;
466
+ };
467
+ /** Content-aware blur */
468
+ contentAwareBlur?: {
469
+ enabled?: boolean;
470
+ depthDetection?: boolean;
471
+ edgePreservation?: boolean;
472
+ variableRadius?: boolean;
473
+ };
474
+ /** Holographic effect modes */
475
+ holographicEffects?: {
476
+ enabled?: boolean;
477
+ rainbowDiffraction?: boolean;
478
+ scanlineAnimation?: boolean;
479
+ gridOverlay?: boolean;
480
+ dataStream?: boolean;
481
+ pulseRings?: boolean;
482
+ };
483
+ }
330
484
  /**
331
485
  * Design Tokens Schema (Tailwind-like)
332
486
  */
@@ -406,7 +560,7 @@ interface JSThemeDefinition {
406
560
  */
407
561
  type ThemeDefinition = CSSThemeDefinition | JSThemeDefinition;
408
562
  /**
409
- * Build configuration (migrated from theme.config.ts)
563
+ * Build configuration
410
564
  */
411
565
  interface BuildConfig {
412
566
  output?: {
@@ -423,7 +577,7 @@ interface BuildConfig {
423
577
  };
424
578
  }
425
579
  /**
426
- * Runtime configuration (migrated from theme.config.ts)
580
+ * Runtime configuration
427
581
  */
428
582
  interface RuntimeConfig {
429
583
  basePath?: string;
@@ -437,7 +591,7 @@ interface RuntimeConfig {
437
591
  useMinified?: boolean;
438
592
  }
439
593
  /**
440
- * Integration settings (migrated from theme.config.ts)
594
+ * Integration settings
441
595
  */
442
596
  interface IntegrationConfig {
443
597
  cssVariables?: Record<string, string>;
@@ -472,14 +626,14 @@ interface TokenEngineConfig {
472
626
  };
473
627
  }
474
628
  /**
475
- * CLI component generator defaults (merged before CLI flags; flags win).
629
+ * CLI component generator defaults
476
630
  */
477
631
  interface GeneratorConfig {
478
632
  /** Default output directory for generated components */
479
633
  outputPath?: string;
480
634
  /** Override detected framework */
481
635
  framework?: 'react' | 'next' | 'vanilla';
482
- /** Per-feature defaults (CLI --no-* flags override) */
636
+ /** Per-feature defaults */
483
637
  features?: {
484
638
  storybook?: boolean;
485
639
  hook?: boolean;
@@ -497,126 +651,47 @@ interface GeneratorConfig {
497
651
  * Atomix Configuration Interface
498
652
  *
499
653
  * Tailwind-like configuration for external developers.
500
- * Focus on theme customization - build/runtime configs are internal only.
501
654
  */
502
655
  interface AtomixConfig {
503
- /**
504
- * CSS variable prefix (default: 'atomix')
505
- *
506
- * Change this to customize all CSS variable names.
507
- * Example: prefix: 'myapp' → --myapp-primary instead of --atomix-primary
508
- */
509
656
  prefix?: string;
510
- /**
511
- * Plugins to extend CLI functionality
512
- */
513
657
  plugins?: (string | PluginConfig)[];
514
- /**
515
- * Universal Token Engine configuration
516
- */
517
658
  tokenEngine?: TokenEngineConfig;
518
- /**
519
- * AI-Assisted Scaffolding configuration
520
- */
521
659
  ai?: {
522
- /** AI provider (default: 'openai') */
523
660
  provider?: 'openai' | 'anthropic';
524
- /** LLM model to use */
525
661
  model?: string;
526
- /** API key for the provider */
527
662
  apiKey?: string;
528
- /** Temperature for AI creativity (0.0-1.0, default: 0.7) */
529
663
  temperature?: number;
530
- /** Maximum tokens per AI response (default: 4000) */
531
664
  maxTokens?: number;
532
- /** Rate limiting configuration */
533
665
  rateLimit?: {
534
- /** Maximum requests allowed */
535
666
  requests: number;
536
- /** Time window in milliseconds */
537
667
  windowMs: number;
538
668
  };
539
669
  };
540
- /**
541
- * Performance & Telemetry (Phase 4)
542
- */
543
670
  telemetry?: {
544
- /** Enable local telemetry logging (default: false) */
545
671
  enabled?: boolean;
546
- /** Output path for telemetry logs (default: '.atomix/telemetry.json') */
547
672
  path?: string;
548
- /** Anonymize telemetry data (default: true) */
549
673
  anonymize?: boolean;
550
674
  };
551
- /**
552
- * `atomix generate` defaults (CLI overrides these)
553
- */
554
675
  generator?: GeneratorConfig;
555
- /**
556
- * Theme customization (Tailwind-like)
557
- *
558
- * Use `extend` to add or override design tokens.
559
- * Use `tokens` to completely replace the default token system (advanced).
560
- */
676
+ interactiveEffects?: InteractiveEffectsConfig;
677
+ optimization?: OptimizationConfig;
678
+ visualPolish?: VisualPolishConfig;
561
679
  theme?: {
562
- /**
563
- * Extend the default design tokens
564
- *
565
- * This is the recommended way to customize Atomix.
566
- * Your values will override or extend the base tokens.
567
- */
568
680
  extend?: ThemeTokens;
569
- /**
570
- * Override the default tokens entirely (advanced)
571
- *
572
- * Use with caution - this replaces the entire token system.
573
- * Most users should use `extend` instead.
574
- */
575
681
  tokens?: ThemeTokens;
576
- /**
577
- * Register custom themes (optional)
578
- *
579
- * Define CSS or JavaScript themes that can be loaded dynamically.
580
- */
581
682
  themes?: Record<string, ThemeDefinition>;
582
683
  };
583
- /** @internal Build configuration (internal use only) */
684
+ /** @internal Build configuration */
584
685
  build?: BuildConfig;
585
- /** @internal Runtime configuration (internal use only) */
686
+ /** @internal Runtime configuration */
586
687
  runtime?: RuntimeConfig;
587
- /** @internal Integration settings (internal use only) */
688
+ /** @internal Integration settings */
588
689
  integration?: IntegrationConfig;
589
- /** @internal Theme dependencies mapping (internal use only) */
690
+ /** @internal Theme dependencies mapping */
590
691
  dependencies?: Record<string, string[]>;
591
692
  }
592
693
  /**
593
694
  * Helper function to define Atomix configuration with type safety
594
- *
595
- * @param config - Atomix configuration object
596
- * @returns The configuration object
597
- */
598
- /**
599
- * Helper function to define Atomix configuration with type safety
600
- *
601
- * Similar to Tailwind's defineConfig, provides autocomplete and type checking.
602
- *
603
- * @param config - Atomix configuration object
604
- * @returns The configuration object
605
- *
606
- * @example
607
- * ```typescript
608
- * import { defineConfig } from '@shohojdhara/atomix/config';
609
- *
610
- * export default defineConfig({
611
- * theme: {
612
- * extend: {
613
- * colors: {
614
- * primary: { main: '#7AFFD7' },
615
- * },
616
- * },
617
- * },
618
- * });
619
- * ```
620
695
  */
621
696
  declare function defineConfig(config: AtomixConfig): AtomixConfig;
622
697
 
package/dist/config.js CHANGED
@@ -1,57 +1,15 @@
1
+ import "fs";
2
+
3
+ import "path";
4
+
1
5
  /**
2
- * Atomix Configuration System
3
- *
4
- * Tailwind-like configuration for customizing the Atomix Design System.
5
- *
6
- * External developers can create `atomix.config.ts` in their project root
7
- * to customize design tokens, similar to Tailwind's tailwind.config.js
8
- *
9
- * @example
10
- * ```typescript
11
- * // atomix.config.ts (in your project)
12
- * import { defineConfig } from '@shohojdhara/atomix/config';
13
- *
14
- * export default defineConfig({
15
- * theme: {
16
- * extend: {
17
- * colors: {
18
- * primary: { main: '#7AFFD7' },
19
- * },
20
- * },
21
- * },
22
- * });
23
- * ```
24
- */
25
- /**
26
- * Helper function to define Atomix configuration with type safety
6
+ * Configuration Types
27
7
  *
28
- * @param config - Atomix configuration object
29
- * @returns The configuration object
8
+ * Type definitions for the Atomix configuration system.
30
9
  */
31
10
  /**
32
11
  * Helper function to define Atomix configuration with type safety
33
- *
34
- * Similar to Tailwind's defineConfig, provides autocomplete and type checking.
35
- *
36
- * @param config - Atomix configuration object
37
- * @returns The configuration object
38
- *
39
- * @example
40
- * ```typescript
41
- * import { defineConfig } from '@shohojdhara/atomix/config';
42
- *
43
- * export default defineConfig({
44
- * theme: {
45
- * extend: {
46
- * colors: {
47
- * primary: { main: '#7AFFD7' },
48
- * },
49
- * },
50
- * },
51
- * });
52
- * ```
53
- */
54
- function defineConfig(config) {
12
+ */ function defineConfig(config) {
55
13
  return config;
56
14
  }
57
15
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../src/lib/config/index.ts"],"sourcesContent":[null],"names":["defineConfig","config"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgXM,SAAUA,aAAaC;IAC3B,OAAOA;AACT;;"}
1
+ {"version":3,"file":"config.js","sources":["../src/lib/config/types.ts"],"sourcesContent":[null],"names":["defineConfig","config"],"mappings":";;;;;;;;;;;GAkYM,UAAUA,aAAaC;IAC3B,OAAOA;AACT;;"}