|
1 | 1 | # Change Log |
2 | 2 |
|
| 3 | +## 2.0.0-preview.1 |
| 4 | + |
| 5 | +### Major Changes |
| 6 | + |
| 7 | +- 07a06d2: Remove `@material-ui/styles` dependency and replace with custom JSS-based implementation for React 19 compatibility. |
| 8 | + |
| 9 | + ref: https://github.com/equinor/fusion-framework/issues/3698 |
| 10 | + |
| 11 | + ### Breaking Changes |
| 12 | + - Removed `@material-ui/styles` dependency - replaced with direct JSS integration |
| 13 | + - All Material-UI v4 styling APIs are now implemented internally |
| 14 | + - No API changes - existing code should work without modifications |
| 15 | + |
| 16 | + ### Added |
| 17 | + - Custom `makeStyles` implementation using JSS directly |
| 18 | + - Custom `StylesProvider` with enhanced scope isolation via seed prefixes |
| 19 | + - Custom `ThemeProvider` with React 19 compatibility |
| 20 | + - Comprehensive test suite with Vitest (52 tests, 100% statement coverage) |
| 21 | + - Utility modules in `src/utils/`: |
| 22 | + - `jss-setup.ts` - JSS instance configuration |
| 23 | + - `class-name-generator.ts` - Class name generation logic |
| 24 | + - `sheet-manager.ts` - Stylesheet caching and management |
| 25 | + - `contexts.ts` - React context definitions |
| 26 | + - TSDoc documentation for all exported APIs |
| 27 | + - Updated README with comprehensive documentation |
| 28 | + |
| 29 | + ### Changed |
| 30 | + - Package now uses JSS directly instead of Material-UI wrapper |
| 31 | + - Improved TypeScript types with better inference |
| 32 | + - Enhanced class name isolation for micro-frontend scenarios |
| 33 | + |
| 34 | + ### Technical Details |
| 35 | + - React 19 compatible (tested with React ^18 || ^19) |
| 36 | + - Uses JSS v10 with all necessary plugins |
| 37 | + - Maintains backward compatibility with existing API surface |
| 38 | + - Full test coverage with Vitest and React Testing Library |
| 39 | + |
| 40 | +### Minor Changes |
| 41 | + |
| 42 | +- 0a1bf8d: Enhanced theme system with support for extending `FusionTheme` with custom properties, improved nested theme composition, and comprehensive documentation. |
| 43 | + |
| 44 | + ### Added |
| 45 | + - **Theme Extension Support**: `FusionTheme` now supports extending with custom properties using generics: |
| 46 | + ```typescript |
| 47 | + type MyTheme = FusionTheme<{ colors: { primary: ColorStyleProperty } }>; |
| 48 | + ``` |
| 49 | + - **Custom Base Theme Merging**: `createTheme` now accepts an optional `baseTheme` parameter for merging with custom base themes: |
| 50 | + ```typescript |
| 51 | + const extendedTheme = createTheme( |
| 52 | + { colors: { ui: { background__danger: newColor } } }, |
| 53 | + outerTheme, |
| 54 | + ); |
| 55 | + ``` |
| 56 | + - **Deep Merging Improvements**: Enhanced `deepMerge` function properly handles nested theme properties, `Record` types, and `StyleProperty` instances |
| 57 | + - **Type Exports**: Explicitly exported `ThemeProviderProps`, `StylesProviderProps`, `FusionTheme`, `StyleDefinition`, and `createTheme` for better TypeScript support |
| 58 | + - **Complete TSDoc Documentation**: All exported functions, types, and interfaces now have comprehensive TSDoc comments with examples, parameter descriptions, and usage patterns |
| 59 | + - **Theme Extension Storybook Story**: New `ThemeExtension` story demonstrating how to extend themes with custom properties, including step-by-step examples for type definition, theme creation, and usage with `useTheme` and `makeStyles` |
| 60 | + |
| 61 | + ### Changed |
| 62 | + - `createTheme` signature now accepts optional `baseTheme` parameter (backward compatible) |
| 63 | + - Improved type inference for extended themes in `ThemeProvider`, `useTheme`, and `makeStyles` |
| 64 | + - Better handling of nested theme composition when using theme functions in nested `ThemeProvider` components |
| 65 | + - **Storybook Stories Updated**: All stories now use theme CSS values (`theme.colors.*.css`, `theme.spacing.*.css`, `theme.typography.*.style.*`) instead of hardcoded custom CSS, ensuring proper integration with Fusion design system tokens |
| 66 | + |
| 67 | + ### Technical Details |
| 68 | + - Deep merging now correctly handles `StyleProperty` instances (replaces instead of merging) |
| 69 | + - Theme composition works correctly with nested `ThemeProvider` components |
| 70 | + - All types are properly exported and documented with complete TSDoc comments |
| 71 | + - Typography properties accessed via `.style.fontSize`, `.style.fontWeight`, etc. for proper CSS value extraction |
| 72 | + - Color and spacing properties accessed via `.css` property for CSS variable or value string |
| 73 | + |
3 | 74 | ## 2.0.0-preview.0 |
4 | 75 |
|
5 | 76 | ### Major Changes |
|
0 commit comments