@shohojdhara/atomix 0.3.8 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed `Module not found` error by replacing dynamic `require` with static import in `ThemeProvider`. This resolves build issues in external projects (e.g. Next.js).
8
+
3
9
  All notable changes to this project will be documented in this file.
4
10
 
5
11
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
@@ -12,7 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
18
  ### Added
13
19
 
14
20
  #### Theme Manager System
21
+
15
22
  - **Theme Manager Class**: Core theme management for vanilla JavaScript applications
23
+
16
24
  - Dynamic theme loading with CSS file management
17
25
  - Theme persistence using localStorage
18
26
  - Event system for theme changes (`themeChange`, `themeLoad`, `themeError`)
@@ -21,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
21
29
  - Comprehensive error handling
22
30
 
23
31
  - **React Integration**:
32
+
24
33
  - `ThemeProvider` component for React applications
25
34
  - `useTheme` hook for accessing theme state
26
35
  - `ThemeContext` for context-based state management
@@ -28,15 +37,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
28
37
  - Automatic cleanup on unmount
29
38
 
30
39
  - **TypeScript Support**:
40
+
31
41
  - Complete type definitions for all theme utilities
32
42
  - `ThemeMetadata`, `ThemeManagerConfig`, `ThemeChangeEvent` interfaces
33
43
  - Type-safe event system
34
44
  - Full IntelliSense support
35
45
 
36
46
  - **Package Exports**:
47
+
37
48
  - `@shohojdhara/atomix/theme` - Theme manager utilities
38
49
 
39
50
  - **Documentation**:
51
+
40
52
  - Comprehensive theme manager guide (`docs/THEME_MANAGER.md`)
41
53
  - React usage examples
42
54
  - Vanilla JavaScript examples
@@ -51,11 +63,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
51
63
  - Theme dependencies mapping
52
64
 
53
65
  ### Changed
66
+
54
67
  - Updated `README.md` with theme manager usage examples
55
68
  - Enhanced `themes.config.js` with runtime configuration options
56
69
  - Updated `src/lib/index.ts` to export theme utilities
57
70
 
58
71
  ### Features
72
+
59
73
  - 🎨 Dynamic theme switching without page reload
60
74
  - 💾 Automatic theme persistence across sessions
61
75
  - ⚡ Theme preloading for instant switching
@@ -73,11 +87,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
73
87
  ## [0.1.25] - 2025-07-02
74
88
 
75
89
  ### Fixed
90
+
76
91
  - Fixed module parse error with undefined exports in ESM build
77
92
  - Fixed Tooltip component export issue (previously exported as `Tooltip_Tooltip as Tooltip`)
78
93
  - Added post-build script to ensure all components are properly exported
79
94
 
80
95
  ### Added
96
+
81
97
  - Added support for direct component imports via `@shohojdhara/atomix/components/*`
82
98
  - Added troubleshooting guide for common issues
83
99
 
@@ -86,6 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
86
102
  ## [0.1.16] - 2025-07-02
87
103
 
88
104
  ### Added
105
+
89
106
  - Initial release of Atomix Design System
90
107
  - Core components library with React and vanilla JavaScript support
91
108
  - Multiple module formats: ESM, CJS, and UMD
@@ -94,4 +111,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
94
111
  ## [0.1.0] - 2023-06-09
95
112
 
96
113
  ### Added
97
- - Initial public release
114
+
115
+ - Initial public release
package/dist/core.d.ts CHANGED
@@ -1229,9 +1229,9 @@ type ButtonAsProp = {
1229
1229
  LinkComponent?: React$1.ComponentType<any>;
1230
1230
  [key: string]: any;
1231
1231
  };
1232
- declare const Button: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<Omit<ButtonProps & ButtonAsProp, "ref"> & React$1.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>>;
1232
+ declare const Button: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<Omit<ButtonProps & ButtonAsProp, "ref"> & React$1.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>>;
1233
1233
 
1234
- declare const Card: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLDivElement | HTMLAnchorElement>>>;
1234
+ declare const Card: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<CardProps & React$1.RefAttributes<HTMLAnchorElement | HTMLDivElement>>>;
1235
1235
 
1236
1236
  declare const ElevationCard: React$1.FC<ElevationCardProps>;
1237
1237
 
package/dist/index.esm.js CHANGED
@@ -19021,14 +19021,6 @@ function createTokens(overrides) {
19021
19021
  };
19022
19022
  }
19023
19023
 
19024
- const tokens = Object.freeze( Object.defineProperty({
19025
- __proto__: null,
19026
- createTokens: createTokens,
19027
- defaultTokens: defaultTokens
19028
- }, Symbol.toStringTag, {
19029
- value: "Module"
19030
- }));
19031
-
19032
19024
  /**
19033
19025
  * CSS Variable Generator
19034
19026
  *
@@ -20452,14 +20444,9 @@ const ThemeProvider = ({children: children, defaultTheme: defaultTheme, themes:
20452
20444
  }
20453
20445
  // Default fallback
20454
20446
  return "default";
20455
- }), [ defaultTheme, enablePersistence, storageKey ]), [currentTheme, setCurrentTheme] = useState((() => "string" == typeof initialDefaultTheme ? initialDefaultTheme : "tokens-theme")), [activeTokens, setActiveTokens] = useState((() => {
20456
- // If defaultTheme is DesignTokens, store them
20457
- if (defaultTheme && "string" != typeof defaultTheme) {
20458
- const {createTokens: createTokens} = require("../tokens/tokens");
20459
- return createTokens(defaultTheme);
20460
- }
20461
- return null;
20462
- })), [isLoading, setIsLoading] = useState(!1), [error, setError] = useState(null), loadedThemesRef = useRef(new Set), themePromisesRef = useRef({}), abortControllerRef = useRef(null);
20447
+ }), [ defaultTheme, enablePersistence, storageKey ]), [currentTheme, setCurrentTheme] = useState((() => "string" == typeof initialDefaultTheme ? initialDefaultTheme : "tokens-theme")), [activeTokens, setActiveTokens] = useState((() =>
20448
+ // If defaultTheme is DesignTokens, store them
20449
+ defaultTheme && "string" != typeof defaultTheme ? createTokens(defaultTheme) : null)), [isLoading, setIsLoading] = useState(!1), [error, setError] = useState(null), loadedThemesRef = useRef(new Set), themePromisesRef = useRef({}), abortControllerRef = useRef(null);
20463
20450
  // Handle initial DesignTokens defaultTheme
20464
20451
  useEffect((() => {
20465
20452
  defaultTheme && "string" != typeof defaultTheme && activeTokens && !isServer() && injectCSS$1(createTheme(defaultTheme), "theme-tokens-theme");
@@ -20501,9 +20488,9 @@ const ThemeProvider = ({children: children, defaultTheme: defaultTheme, themes:
20501
20488
  // Inject new theme CSS
20502
20489
  injectCSS$1(css, `theme-${themeId}`);
20503
20490
  // Store tokens for reference
20504
- const {createTokens: createTokens} = await Promise.resolve().then((() => tokens)), fullTokens = createTokens(theme);
20491
+ const fullTokens = createTokens(theme);
20505
20492
  // Check if aborted before state update
20506
- if (abortController.signal.aborted) return;
20493
+ if (abortController.signal.aborted) return;
20507
20494
  return setActiveTokens(fullTokens), setCurrentTheme(themeId), handleThemeChange(fullTokens),
20508
20495
  void setIsLoading(!1);
20509
20496
  }