Packages

class-variance-authority

0.7.1 · 26 Nov 2024Apache-2.087.5M / weekRepositoryHomepagenpmAtom feed

Your version

18 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 0.7.x · latest line
  2. 0.7.1

    26 Nov 2024
    • Add LICENSE Comments

  3. 0.7.0

    17 Jul 2023
    • Upgrade to clsx@2.0.0

  4. 0.6.x
  5. 0.6.1

    26 Jun 2023
    • Add missing license key in package.json

    • Upgrade to typescript@5.1.3

  6. 0.6.0

    27 Apr 2023
    • cx → clsx

      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:

  7. 0.5.x
  8. 0.5.3

    26 Apr 2023
    • Issue #147 where map files are not present for esm files

      Thank you @pfried!

    • Added explicit undefined type to support exactOptionalPropertyTypes option

      This has been a long standing issue for me and I'm so grateful to @totto2727 for making the fix

  9. 0.5.2

    11 Apr 2023
    • Support for moduleResolution: bundler (add types to exports field in package.json)

  10. 0.5.1

    2 Apr 2023
    • Support for TypeScript 5

  11. 0.5.0

    2 Apr 2023
  12. 0.4.x
  13. 0.4.0

    5 Dec 2022
    • Target Multiple Variant Options within Compound Variants

      // 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: "…",
          },
        ],
      });
    • Readme example

  14. 0.3.x
  15. 0.3.0

    7 Nov 2022
    • Add Support for the className Prop

      React.js friends, you can be at peace: you can now use the className or the class prop.

  16. 0.2.x
  17. 0.2.4

    14 Oct 2022
    • Fix variant key 0 use-case

  18. 0.2.3

    15 Jul 2022
    • Remove class prop from VariantProps

  19. 0.2.2

    12 Jun 2022
    • Breaking

      Support for Typescript 4.7 (non-breaking change)

  20. 0.2.1

    6 Apr 2022
    • Support Compiling TypeScript with --declaration Flag

  21. 0.2.0

    5 Apr 2022
    • Improved/corrected support for boolean variants; both as a prop and defaultVariant

    • defaultVariants styles can now be disabled/removed completely by setting the relevant variant as null

      const button = cva("button", {
       variants: {
         disabled: { false: "button--enabled", true: "button--enabled" },
       },
       defaultVariants: {
         disabled: false,
       },
      });
      
      const buttonWithDefault = button();
      // "button button--enabled"
      
      const buttonWithoutDefault = button({ disabled: null });
      // "button"
      
      
    • Advise aliasing during install instead of TS Paths

  22. 0.1.x
  23. 0.1.0

    13 Feb 2022

    Adds support for boolean variants (huge thanks to @mariusflorescu) 🚀

  24. 0.0.x
  25. 0.0.1

    9 Feb 2022

    Initial release 🚀

  26. 0.0.0

    26 Jan 2022

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.