Skip to content

Releases: Jackardios/react-class-variants

v2.0.0-alpha.3

18 Dec 12:59

Choose a tag to compare

v2.0.0-alpha.3 Pre-release
Pre-release

Bug Fixes

mergeProps utility improvements

  • Preserve base className when override is falsy (null, undefined, empty string)
  • Preserve base event handler when override is null or undefined
  • Only merge React event handlers (onClick, onMouseDown, etc.) — props like onboarding, ongoing are no longer incorrectly merged as event handlers

Full Changelog: v2.0.0-alpha.2...v2.0.0-alpha.3

v2.0.0-alpha.2

12 Dec 08:08

Choose a tag to compare

v2.0.0-alpha.2 Pre-release
Pre-release

Performance Optimizations & Bug Fixes

Changes

  • Performance: Optimize variants() resolver by pre-computing boolean variants and caching variant names
  • Performance: Optimize compound variants loop (avoid function creation inside loop)
  • Fix: mergeProps className handling for undefined/empty values
  • DX: Add displayName to variant components for React DevTools
  • Refactor: Consolidate Simplify/Prettify types into single Simplify type
  • Docs: Add JSDoc documentation for exported types and functions
  • Tests: Comprehensive test suite rewrite (243 tests, 98.14% coverage)

Installation

npm install react-class-variants@alpha

v2.0.0-alpha.1

01 Nov 14:00

Choose a tag to compare

v2.0.0-alpha.1 Pre-release
Pre-release

Minor Changes

  • a145ff8: Add advanced type utilities and improve type system

    New Type Utilities:

    • ExtractVariantOptions<T> - Universal utility to extract variant props type from any variant function, resolver, or component
    • ExtractVariantConfig<T> - Universal utility to extract full variant configuration from any variant function, resolver, or component
    • Enhanced internal type metadata with __config property for better type extraction

    Type System Improvements:

    • Added VariantsResolverFn<C, V> type with config metadata
    • Added VariantPropsResolverFn<C, V> type with config metadata
    • Simplified BaseVariantComponentProps by removing intermediate OnlyVariantsConfig type
    • Better type inference for variant configurations

    Testing:

    • Added 150+ lines of comprehensive type tests for new utilities
    • Tests for ExtractVariantOptions and ExtractVariantConfig working with variants(), variantPropsResolver(), and variantComponent()
    • Improved edge case coverage

    Documentation:

    • Added detailed section on type utilities in README
    • Examples for ExtractVariantOptions and ExtractVariantConfig
    • Usage patterns for extracting types from variant functions and components

    Developer Experience:

    • Added test:types script to package.json
    • Integrated type tests into CI pipeline
    • Added Vitest coverage and UI tools for better testing experience

v1.0.3

23 Jul 16:02
a54b170

Choose a tag to compare

Patch Changes

  • 32ce10a: allow react v19 and tailwind-merge v2 and v3

v1.0.2

28 Mar 12:43
c53d65a

Choose a tag to compare

Patch Changes

  • d57c9b7: typescript should throw an error when passed compoundVariants or defaultVariants with non-existing variants

v1.0.1

23 Mar 23:17
21d20ab

Choose a tag to compare

Patch Changes

v1.0.0

23 Mar 00:48
012c59f

Choose a tag to compare

Major Changes

  • 9c6f874: BREAKING CHANGE: set type VariantsConfig for config argument in styled function + fix typings
  • 8dda492: BREAKING CHANGE: set variants in VariantsConfig optional + improve type-hints

v0.1.3

19 Mar 10:06
fe862c0

Choose a tag to compare

Patch Changes

  • 0c1a5c5: Add vite.config.ts and .prettierrc files to npmignore
  • 78d9d8c: Fix package homepage and bugs url

v0.1.2

18 Mar 16:42
73c501b

Choose a tag to compare

Patch Changes

v0.1.1

17 Mar 20:37
e5b6289

Choose a tag to compare

Patch Changes

  • 382b5b8: add test folder to .npmignore