Skip to content

Commit b1cae01

Browse files
Version Packages (preview) (#2847)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 28fcf56 commit b1cae01

File tree

5 files changed

+110
-3
lines changed

5 files changed

+110
-3
lines changed

.changeset/pre.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@
2323
"@equinor/fusion-react-utils": "3.0.0",
2424
"@equinor/fusion-react-components-stories": "5.0.0"
2525
},
26-
"changesets": []
26+
"changesets": [
27+
"react-styles-remove-material-ui",
28+
"react-styles-theme-extensions",
29+
"storybook-styles-docs"
30+
]
2731
}

packages/styles/CHANGELOG.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,76 @@
11
# Change Log
22

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+
374
## 2.0.0-preview.0
475

576
### Major Changes

packages/styles/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@equinor/fusion-react-styles",
3-
"version": "2.0.0-preview.0",
3+
"version": "2.0.0-preview.1",
44
"description": "style lib inspired by @material-ui/styles",
55
"keywords": [
66
"styling",

storybook/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Change Log
22

3+
## 5.0.1-preview.1
4+
5+
### Patch Changes
6+
7+
- f9c381b: Add comprehensive Storybook documentation and stories for `@equinor/fusion-react-styles` package.
8+
9+
ref: https://github.com/equinor/fusion-framework/issues/3698
10+
11+
### Added
12+
- **Styles Documentation (`styles.mdx`)**: Comprehensive MDX documentation page showcasing all styling features
13+
- **Story Groups**: Organized stories into logical groups:
14+
- **Basic Usage**: Basic styles, dynamic styles, and theme-based styles
15+
- **Scope Isolation**: Demonstrates critical micro-frontend style isolation with nested and side-by-side `StylesProvider` examples
16+
- **Advanced Features**: Nested selectors, multiple style rules, and style caching
17+
- **Theme System**: Theme composition, `useTheme` hook examples, and **Theme Extension** guide
18+
- **Utilities**: `createStyles` helper examples
19+
- **Visual Demonstrations**: Interactive stories showing:
20+
- Class name generation and isolation
21+
- Dynamic style updates based on props
22+
- Theme integration using actual Fusion theme CSS values
23+
- CSS features like nested selectors and hover states
24+
- **Theme Extension**: Step-by-step guide for extending `FusionTheme` with custom properties
25+
26+
### Changed
27+
- Storybook port updated to 3000
28+
- Removed `@material-ui/styles` dependency from Storybook package
29+
- **All stories now use Fusion theme CSS values**: Replaced hardcoded custom CSS with proper theme values (`theme.colors.*.css`, `theme.spacing.*.css`, `theme.typography.*.style.*`) for consistent design system integration
30+
31+
- Updated dependencies [07a06d2]
32+
- Updated dependencies [0a1bf8d]
33+
- @equinor/fusion-react-styles@2.0.0-preview.1
34+
335
## 5.0.1-preview.0
436

537
### Patch Changes

storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@equinor/fusion-react-components-stories",
3-
"version": "5.0.1-preview.0",
3+
"version": "5.0.1-preview.1",
44
"description": "",
55
"private": true,
66
"scripts": {

0 commit comments

Comments
 (0)