|
| 1 | +--- |
| 2 | +'react-class-variants': major |
| 3 | +--- |
| 4 | + |
| 5 | +Complete v2 refactor with consolidated architecture and enhanced functionality |
| 6 | + |
| 7 | +**Breaking Changes:** |
| 8 | +- Complete library restructure - all functionality consolidated into single module |
| 9 | +- `styled()` API removed in favor of `variantComponent()` |
| 10 | +- `cx()` utility removed - class merging now handled via `defineConfig({ onClassesMerged })` |
| 11 | +- Changed exports structure - now use `defineConfig()` factory pattern |
| 12 | + |
| 13 | +**New Features:** |
| 14 | +- `defineConfig(options)` - Factory function for creating variants, variantPropsResolver, and variantComponent with shared configuration |
| 15 | +- `variantComponent()` - Create React components with variants support and polymorphic rendering |
| 16 | +- `variantPropsResolver()` - Extract variant props and resolve className from full props objects |
| 17 | +- Enhanced render prop pattern - supports both React elements and render functions |
| 18 | +- `forwardProps` option - Control which variant props get forwarded to DOM |
| 19 | +- `withoutRenderProp` option - Disable render prop pattern when not needed |
| 20 | +- Improved ref forwarding and merging with `useMergeRefs()` |
| 21 | +- Better event handler and props composition with `mergeProps()` |
| 22 | + |
| 23 | +**Type System Improvements:** |
| 24 | +- Stronger type inference for optional vs required variants |
| 25 | +- Boolean variants automatically optional |
| 26 | +- Variants with defaults automatically optional |
| 27 | +- Better polymorphic component type support |
| 28 | + |
| 29 | +**Testing:** |
| 30 | +- Complete comprehensive test suite with 170+ tests |
| 31 | +- Tests for variants resolution, React components, utilities, edge cases, and TypeScript types |
| 32 | +- Vitest + React Testing Library + tsd for type testing |
| 33 | + |
| 34 | +**Documentation:** |
| 35 | +- Complete README rewrite with all new APIs and examples |
0 commit comments