@shohojdhara/atomix 0.2.7 → 0.2.9

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 (54) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +40 -1
  3. package/dist/atomix.css +412 -77
  4. package/dist/atomix.min.css +3 -3
  5. package/dist/index.d.ts +913 -12
  6. package/dist/index.esm.js +1739 -209
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.js +1763 -208
  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/themes/applemix.css +412 -77
  13. package/dist/themes/applemix.min.css +3 -3
  14. package/dist/themes/boomdevs.css +411 -76
  15. package/dist/themes/boomdevs.min.css +3 -3
  16. package/dist/themes/esrar.css +412 -77
  17. package/dist/themes/esrar.min.css +3 -3
  18. package/dist/themes/flashtrade.css +1803 -622
  19. package/dist/themes/flashtrade.min.css +113 -7
  20. package/dist/themes/mashroom.css +411 -76
  21. package/dist/themes/mashroom.min.css +4 -4
  22. package/dist/themes/shaj-default.css +411 -76
  23. package/dist/themes/shaj-default.min.css +3 -3
  24. package/package.json +13 -2
  25. package/src/components/Button/Button.stories.tsx +174 -0
  26. package/src/components/Button/Button.tsx +238 -78
  27. package/src/components/Card/Card.stories.tsx +202 -0
  28. package/src/components/Card/Card.tsx +253 -77
  29. package/src/components/Form/Input.stories.tsx +228 -2
  30. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +301 -13
  31. package/src/components/Navigation/SideMenu/SideMenu.tsx +236 -9
  32. package/src/components/Tooltip/Tooltip.tsx +68 -66
  33. package/src/lib/composables/useButton.ts +37 -5
  34. package/src/lib/composables/useInput.ts +39 -1
  35. package/src/lib/composables/useSideMenu.ts +89 -30
  36. package/src/lib/constants/components.ts +53 -0
  37. package/src/lib/index.ts +5 -0
  38. package/src/lib/theme/ThemeContext.tsx +17 -0
  39. package/src/lib/theme/ThemeManager.stories.tsx +472 -0
  40. package/src/lib/theme/ThemeManager.test.ts +186 -0
  41. package/src/lib/theme/ThemeManager.ts +501 -0
  42. package/src/lib/theme/ThemeProvider.tsx +227 -0
  43. package/src/lib/theme/index.ts +56 -0
  44. package/src/lib/theme/types.ts +247 -0
  45. package/src/lib/theme/useTheme.test.tsx +66 -0
  46. package/src/lib/theme/useTheme.ts +80 -0
  47. package/src/lib/theme/utils.test.ts +140 -0
  48. package/src/lib/theme/utils.ts +398 -0
  49. package/src/lib/types/components.ts +304 -4
  50. package/src/styles/01-settings/_settings.tooltip.scss +2 -2
  51. package/src/styles/06-components/_components.button.scss +100 -0
  52. package/src/styles/06-components/_components.card.scss +235 -2
  53. package/src/styles/06-components/_components.side-menu.scss +79 -18
  54. package/src/styles/06-components/_components.tooltip.scss +89 -66
package/CHANGELOG.md CHANGED
@@ -7,6 +7,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ #### Theme Manager System
13
+ - **Theme Manager Class**: Core theme management for vanilla JavaScript applications
14
+ - Dynamic theme loading with CSS file management
15
+ - Theme persistence using localStorage
16
+ - Event system for theme changes (`themeChange`, `themeLoad`, `themeError`)
17
+ - Theme preloading for faster switching
18
+ - SSR-safe implementation
19
+ - Comprehensive error handling
20
+
21
+ - **React Integration**:
22
+ - `ThemeProvider` component for React applications
23
+ - `useTheme` hook for accessing theme state
24
+ - `ThemeContext` for context-based state management
25
+ - Loading and error states
26
+ - Automatic cleanup on unmount
27
+
28
+ - **TypeScript Support**:
29
+ - Complete type definitions for all theme utilities
30
+ - `ThemeMetadata`, `ThemeManagerConfig`, `ThemeChangeEvent` interfaces
31
+ - Type-safe event system
32
+ - Full IntelliSense support
33
+
34
+ - **Package Exports**:
35
+ - `@shohojdhara/atomix/theme` - Theme manager utilities
36
+ - `@shohojdhara/atomix/themes/config` - Theme configuration
37
+
38
+ - **Documentation**:
39
+ - Comprehensive theme manager guide (`docs/THEME_MANAGER.md`)
40
+ - React usage examples
41
+ - Vanilla JavaScript examples
42
+ - API reference
43
+ - Migration guide
44
+ - Troubleshooting section
45
+
46
+ - **Runtime Configuration**:
47
+ - Added runtime section to `themes.config.js`
48
+ - Support for CDN paths
49
+ - Theme preloading configuration
50
+ - Theme dependencies mapping
51
+
52
+ ### Changed
53
+ - Updated `README.md` with theme manager usage examples
54
+ - Enhanced `themes.config.js` with runtime configuration options
55
+ - Updated `src/lib/index.ts` to export theme utilities
56
+
57
+ ### Features
58
+ - 🎨 Dynamic theme switching without page reload
59
+ - 💾 Automatic theme persistence across sessions
60
+ - ⚡ Theme preloading for instant switching
61
+ - 🔒 Full TypeScript support
62
+ - ♿ SSR compatible (Next.js, Remix, etc.)
63
+ - 🎯 Works with React and vanilla JavaScript
64
+ - 📦 Zero breaking changes to existing API
65
+
66
+ ## [0.2.8] - 2025-01-28
67
+
10
68
  ## [0.2.7] - 2025-01-27
11
69
 
12
70
  ## [0.1.25] - 2025-07-02
package/README.md CHANGED
@@ -32,7 +32,6 @@ npm install @shohojdhara/atomix
32
32
 
33
33
  ### React
34
34
 
35
- ```jsx
36
35
  import { Button } from '@shohojdhara/atomix';
37
36
  import '@shohojdhara/atomix/css';
38
37
 
@@ -41,6 +40,46 @@ function App() {
41
40
  }
42
41
  ```
43
42
 
43
+ ### Theme Management
44
+
45
+ Atomix includes a powerful theme manager for dynamic theme switching:
46
+
47
+ ```jsx
48
+ import { ThemeProvider, useTheme } from '@shohojdhara/atomix/theme';
49
+ import { themesConfig } from '@shohojdhara/atomix/themes/config';
50
+
51
+ function App() {
52
+ return (
53
+ <ThemeProvider themes={themesConfig.metadata} defaultTheme="shaj-default">
54
+ <YourApp />
55
+ </ThemeProvider>
56
+ );
57
+ }
58
+
59
+ function ThemeSwitcher() {
60
+ const { theme, setTheme, availableThemes } = useTheme();
61
+
62
+ return (
63
+ <select value={theme} onChange={(e) => setTheme(e.target.value)}>
64
+ {availableThemes.map(t => (
65
+ <option key={t.class} value={t.class}>{t.name}</option>
66
+ ))}
67
+ </select>
68
+ );
69
+ }
70
+ ```
71
+
72
+ **Available Themes:**
73
+ - `shaj-default` - Default theme (stable)
74
+ - `flashtrade` - Crypto trading platform theme (stable)
75
+ - `boomdevs` - BoomDevs theme (beta)
76
+ - `esrar` - Esrar theme (beta)
77
+ - `mashroom` - Mashroom theme (beta)
78
+ - `applemix` - Apple-inspired glass morphism theme (experimental)
79
+
80
+ For detailed theme manager documentation, see [Theme Manager Guide](docs/THEME_MANAGER.md).
81
+
82
+
44
83
  ## Styles
45
84
 
46
85
  Atomix provides comprehensive styling through CSS or SCSS: