Skip to content
Open
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
35 changes: 0 additions & 35 deletions .changeset/major-v2-refactor.md

This file was deleted.

41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# react-tailwind-variants

## 2.0.0

### Major Changes

- 4285122: Complete v2 refactor with consolidated architecture and enhanced functionality

**Breaking Changes:**

- Complete library restructure - all functionality consolidated into single module
- `styled()` API removed in favor of `variantComponent()`
- `cx()` utility removed - class merging now handled via `defineConfig({ onClassesMerged })`
- Changed exports structure - now use `defineConfig()` factory pattern

**New Features:**

- `defineConfig(options)` - Factory function for creating variants, variantPropsResolver, and variantComponent with shared configuration
- `variantComponent()` - Create React components with variants support and polymorphic rendering
- `variantPropsResolver()` - Extract variant props and resolve className from full props objects
- Enhanced render prop pattern - supports both React elements and render functions
- `forwardProps` option - Control which variant props get forwarded to DOM
- `withoutRenderProp` option - Disable render prop pattern when not needed
- Improved ref forwarding and merging with `useMergeRefs()`
- Better event handler and props composition with `mergeProps()`

**Type System Improvements:**

- Stronger type inference for optional vs required variants
- Boolean variants automatically optional
- Variants with defaults automatically optional
- Better polymorphic component type support

**Testing:**

- Complete comprehensive test suite with 170+ tests
- Tests for variants resolution, React components, utilities, edge cases, and TypeScript types
- Vitest + React Testing Library + tsd for type testing

**Documentation:**

- Complete README rewrite with all new APIs and examples

## 1.0.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-class-variants",
"version": "2.0.0-alpha.0",
"version": "2.0.0",
"description": "Type-safe React variants API for dynamic CSS class composition",
"private": false,
"main": "./dist/index.js",
Expand Down