|
1 | 1 | # Change Log |
2 | 2 |
|
| 3 | +## 2.0.0-preview.2 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 0a1bf8d: Enhanced theme system with support for extending `FusionTheme` with custom properties, improved nested theme composition, and comprehensive documentation. |
| 8 | + |
| 9 | + ### Added |
| 10 | + - **Theme Extension Support**: `FusionTheme` now supports extending with custom properties using generics: |
| 11 | + ```typescript |
| 12 | + type MyTheme = FusionTheme<{ colors: { primary: ColorStyleProperty } }>; |
| 13 | + ``` |
| 14 | + - **Custom Base Theme Merging**: `createTheme` now accepts an optional `baseTheme` parameter for merging with custom base themes: |
| 15 | + ```typescript |
| 16 | + const extendedTheme = createTheme( |
| 17 | + { colors: { ui: { background__danger: newColor } } }, |
| 18 | + outerTheme, |
| 19 | + ); |
| 20 | + ``` |
| 21 | + - **Deep Merging Improvements**: Enhanced `deepMerge` function properly handles nested theme properties, `Record` types, and `StyleProperty` instances |
| 22 | + - **Type Exports**: Explicitly exported `ThemeProviderProps`, `StylesProviderProps`, `FusionTheme`, `StyleDefinition`, and `createTheme` for better TypeScript support |
| 23 | + - **Complete TSDoc Documentation**: All exported functions, types, and interfaces now have comprehensive TSDoc comments with examples, parameter descriptions, and usage patterns |
| 24 | + - **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` |
| 25 | + |
| 26 | + ### Changed |
| 27 | + - `createTheme` signature now accepts optional `baseTheme` parameter (backward compatible) |
| 28 | + - Improved type inference for extended themes in `ThemeProvider`, `useTheme`, and `makeStyles` |
| 29 | + - Better handling of nested theme composition when using theme functions in nested `ThemeProvider` components |
| 30 | + - **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 |
| 31 | + |
| 32 | + ### Technical Details |
| 33 | + - Deep merging now correctly handles `StyleProperty` instances (replaces instead of merging) |
| 34 | + - Theme composition works correctly with nested `ThemeProvider` components |
| 35 | + - All types are properly exported and documented with complete TSDoc comments |
| 36 | + - Typography properties accessed via `.style.fontSize`, `.style.fontWeight`, etc. for proper CSS value extraction |
| 37 | + - Color and spacing properties accessed via `.css` property for CSS variable or value string |
| 38 | + |
3 | 39 | ## 2.0.0-preview.1 |
4 | 40 |
|
5 | 41 | ### Major Changes |
|
0 commit comments