Joe Bell Cva Versions Save

Class Variance Authority

v0.7.0

11 months ago

v0.6.1

1 year ago

What's Changed

Full Changelog: https://github.com/joe-bell/cva/compare/v0.6.0...v0.6.1

v0.6.0

1 year ago

What's Changed

  • cxclsx by @joe-bell in https://github.com/joe-bell/cva/pull/152

    cva now uses clsx under-the-hood to concatenate classes with no breaking changes to the current experience and no increase to bundle-size.

    The existing cx export still exists, but as an alias of clsx

    Bringing additional benefits of:

    1. Provides additional support for booleans and variadic strings within class or className props

      const button = cva([true && "button-base", false && "not-rendered"]);
      // => 'button-base'
      
      const buttonConsumer = button({ class: [true && "extra-class"] });
      // => 'button-base extra-class'
      
    2. Provides support for object syntax within class or className props

      const button = cva({ foo: true, bar: false });
      // => 'foo baz'
      

Full Changelog: https://github.com/joe-bell/cva/compare/v0.5.3...v0.6.0

v0.5.3

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/joe-bell/cva/compare/v0.5.2...v0.5.3

v0.5.2

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/joe-bell/cva/compare/v0.5.1...v0.5.2

v0.5.1

1 year ago

What's Changed

Warning v0.5.0 is broken, please skip straight to v0.5.1

Full Changelog: https://github.com/joe-bell/cva/compare/v0.4.0...v0.5.0

Support the Project 🖤

Note I'm actually supposed to be on vacation right now, but it seems like people are desperate for TypeScript 5 support

cva is a labour of love – I don't get paid to work on this project

Contributions of any size are greatly appreciated 🙏🏼

Ethereum
0xC756F748ff6A499f3C826529A0Da30FF1A3ac28c

image

v0.4.0

1 year ago

What's Changed

Features

  • Target Multiple Variant Options within Compound Variants by @joe-bell and @JeroenReumkens in https://github.com/joe-bell/cva/pull/76

    // components/button.ts
    import { cva } from "class-variance-authority";
    
    const button = cva("…", {
      variants: {
        intent: { primary: "…", secondary: "…" },
        size: { small: "…", medium: "…" },
      },
      compoundVariants: [
        // Applied via:
        //   `button({ intent: "primary", size: "medium" })`
        //     or
        //   `button({ intent: "secondary", size: "medium" })`
        {
          intent: ["primary", "secondary"],
          size: "medium",
          class: "…",
        },
      ],
    });
    

Chores

New Contributors

Full Changelog: https://github.com/joe-bell/cva/compare/v0.3.0...v0.4.0

v0.3.0

1 year ago

What's Changed

Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.4...v0.3.0

v0.2.4

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.3...v0.2.4

v0.2.3

1 year ago

What's Changed

  • Remove class prop from VariantProps by @joe-bell (thanks for the suggestion @hasparus)

Full Changelog: https://github.com/joe-bell/cva/compare/v0.2.2...v0.2.3