Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .changeset/react-styles-remove-material-ui.md

This file was deleted.

41 changes: 0 additions & 41 deletions .changeset/react-styles-theme-extensions.md

This file was deleted.

30 changes: 0 additions & 30 deletions .changeset/storybook-styles-docs.md

This file was deleted.

8 changes: 8 additions & 0 deletions packages/context-selector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 2.0.1

### Patch Changes

- Updated dependencies [15eacdf]
- Updated dependencies [15eacdf]
- @equinor/fusion-react-styles@2.0.0

## 2.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/context-selector/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-context-selector",
"version": "2.0.0",
"version": "2.0.1",
"description": "React component for context selector",
"keywords": [
"contextselector",
Expand Down
8 changes: 8 additions & 0 deletions packages/errorboundary/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 2.0.1

### Patch Changes

- Updated dependencies [15eacdf]
- Updated dependencies [15eacdf]
- @equinor/fusion-react-styles@2.0.0

## 2.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/errorboundary/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-errorboundary",
"version": "2.0.0",
"version": "2.0.1",
"description": "React component for error boundary",
"keywords": [
"error-boundary",
Expand Down
8 changes: 8 additions & 0 deletions packages/filter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 2.0.1

### Patch Changes

- Updated dependencies [15eacdf]
- Updated dependencies [15eacdf]
- @equinor/fusion-react-styles@2.0.0

## 2.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/filter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-filter",
"version": "2.0.0",
"version": "2.0.1",
"description": "component for Filtering data",
"author": "",
"homepage": "https://github.com/equinor/fusion-react-components/tree/master/packages/filter#readme",
Expand Down
8 changes: 8 additions & 0 deletions packages/hanging-garden/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 2.0.1

### Patch Changes

- Updated dependencies [15eacdf]
- Updated dependencies [15eacdf]
- @equinor/fusion-react-styles@2.0.0

## 2.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/hanging-garden/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-hanging-garden",
"version": "2.0.0",
"version": "2.0.1",
"description": "component handling rendering of hanging gardens",
"author": "",
"homepage": "https://github.com/equinor/fusion-react-components/tree/master/packages/HangingGarden#readme",
Expand Down
74 changes: 74 additions & 0 deletions packages/styles/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
# Change Log

## 2.0.0

### Major Changes

- 15eacdf: Remove `@material-ui/styles` dependency and replace with custom JSS-based implementation for React 19 compatibility.

ref: https://github.com/equinor/fusion-framework/issues/3698

### Breaking Changes
- Removed `@material-ui/styles` dependency - replaced with direct JSS integration
- All Material-UI v4 styling APIs are now implemented internally
- No API changes - existing code should work without modifications

### Added
- Custom `makeStyles` implementation using JSS directly
- Custom `StylesProvider` with enhanced scope isolation via seed prefixes
- Custom `ThemeProvider` with React 19 compatibility
- Comprehensive test suite with Vitest (52 tests, 100% statement coverage)
- Utility modules in `src/utils/`:
- `jss-setup.ts` - JSS instance configuration
- `class-name-generator.ts` - Class name generation logic
- `sheet-manager.ts` - Stylesheet caching and management
- `contexts.ts` - React context definitions
- TSDoc documentation for all exported APIs
- Updated README with comprehensive documentation

### Changed
- Package now uses JSS directly instead of Material-UI wrapper
- Improved TypeScript types with better inference
- Enhanced class name isolation for micro-frontend scenarios

### Technical Details
- React 19 compatible (tested with React ^18 || ^19)
- Uses JSS v10 with all necessary plugins
- Maintains backward compatibility with existing API surface
- Full test coverage with Vitest and React Testing Library

### Minor Changes

- 15eacdf: Enhanced theme system with support for extending `FusionTheme` with custom properties, improved nested theme composition, and comprehensive documentation.

### Added
- **Theme Extension Support**: `FusionTheme` now supports extending with custom properties using generics:
```typescript
type MyTheme = FusionTheme<{ colors: { primary: ColorStyleProperty } }>;
```
- **Custom Base Theme Merging**: `createTheme` now accepts an optional `baseTheme` parameter for merging with custom base themes:
```typescript
const extendedTheme = createTheme(
{ colors: { ui: { background__danger: newColor } } },
outerTheme,
);
```
- **Deep Merging Improvements**: Enhanced `deepMerge` function properly handles nested theme properties, `Record` types, and `StyleProperty` instances
- **Type Exports**: Explicitly exported `ThemeProviderProps`, `StylesProviderProps`, `FusionTheme`, `StyleDefinition`, and `createTheme` for better TypeScript support
- **Complete TSDoc Documentation**: All exported functions, types, and interfaces now have comprehensive TSDoc comments with examples, parameter descriptions, and usage patterns
- **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`

### Changed
- `createTheme` signature now accepts optional `baseTheme` parameter (backward compatible)
- Improved type inference for extended themes in `ThemeProvider`, `useTheme`, and `makeStyles`
- Better handling of nested theme composition when using theme functions in nested `ThemeProvider` components
- **Storybook Stories Updated**: All stories now consistently use the `.getVariable()` method for accessing theme CSS values (e.g., `theme.colors.*.getVariable('color')`, `theme.spacing.*.getVariable('padding')`). Direct usage of the `.css` property has been replaced to ensure proper integration with Fusion design system tokens and to match the documented API usage.
- **README Updated**: Updated all documentation examples to use correct `getVariable()` API for theme properties

### Technical Details
- Deep merging now correctly handles `StyleProperty` instances (replaces instead of merging)
- Theme composition works correctly with nested `ThemeProvider` components
- All types are properly exported and documented with complete TSDoc comments
- Typography properties accessed via `.style.fontSize`, `.style.fontWeight`, etc. for proper CSS value extraction
- Color properties accessed via `.getVariable('color')` method to get CSS variable strings
- Spacing properties accessed via `.getVariable('padding')` method to get CSS variable strings
- `makeStyles` now returns `Record<ClassKey, string>` where `ClassKey` is inferred from style rules, providing type-safe access to class names when using `createStyles`

## 1.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-styles",
"version": "1.0.0",
"version": "2.0.0",
"description": "style lib inspired by @material-ui/styles",
"keywords": [
"styling",
Expand Down
36 changes: 36 additions & 0 deletions storybook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Change Log

## 5.0.1

### Patch Changes

- 15eacdf: Add comprehensive Storybook documentation and stories for `@equinor/fusion-react-styles` package.

ref: https://github.com/equinor/fusion-framework/issues/3698

### Added
- **Styles Documentation (`styles.mdx`)**: Comprehensive MDX documentation page showcasing all styling features
- **Story Groups**: Organized stories into logical groups:
- **Basic Usage**: Basic styles, dynamic styles, and theme-based styles
- **Scope Isolation**: Demonstrates critical micro-frontend style isolation with nested and side-by-side `StylesProvider` examples
- **Advanced Features**: Nested selectors, multiple style rules, and style caching
- **Theme System**: Theme composition, `useTheme` hook examples, and **Theme Extension** guide
- **Utilities**: `createStyles` helper examples
- **Visual Demonstrations**: Interactive stories showing:
- Class name generation and isolation
- Dynamic style updates based on props
- Theme integration using actual Fusion theme CSS values
- CSS features like nested selectors and hover states
- **Theme Extension**: Step-by-step guide for extending `FusionTheme` with custom properties

### Changed
- Storybook port updated to 3000
- Removed `@material-ui/styles` dependency from Storybook package
- **All stories now use Fusion theme CSS values**: Replaced hardcoded custom CSS with proper theme values using `getVariable()` API (`theme.colors.*.getVariable('color')`, `theme.spacing.*.getVariable('padding')`, `theme.typography.*.style.*`) for consistent design system integration

- Updated dependencies [15eacdf]
- Updated dependencies [15eacdf]
- @equinor/fusion-react-styles@2.0.0
- @equinor/fusion-react-context-selector@2.0.1
- @equinor/fusion-react-errorboundary@2.0.1
- @equinor/fusion-react-filter@2.0.1
- @equinor/fusion-react-hanging-garden@2.0.1

## 5.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/fusion-react-components-stories",
"version": "5.0.0",
"version": "5.0.1",
"description": "",
"private": true,
"scripts": {
Expand Down