Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[email protected]

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant