github heroui-inc/tailwind-variants v4.1.0

3 hours ago

✨ Features

  • defineVariants & VariantProps — Added a zero-runtime defineVariants helper (exported from ., /lite, and /config) for defining typed options outside tv() and reading them directly with VariantProps<typeof theme> by @messenjer and @tianenpang in #326 (closes #325)

⚡ Performance

  • Props cache keys — Keyed the props cache strictly on variant axes and compound condition keys so pass-through props (id, aria-label, onClick, children) hit the cache instead of missing or serializing by @g4lb and @tianenpang in #327
  • Compound matching — Added a string fast path for compound variant matching by @tianenpang in #328

🐛 Fixes

  • Cold vs. cached consistency — Aligned cold and cached calls on compound matching (false/"false" match null or an omitted prop with no default; 1 matches "1") and prototype-named variants by @tianenpang in #328
  • Cached slot results — Copied effective props on cached slot results so later mutations do not leak into slot overrides by @tianenpang in #328
  • Cache-key collisions & static refresh — Fixed null/"null", NaN/"NaN", and array/object cache-key collisions, and refreshed static results when non-variant compound defaults change in place by @tianenpang in #328

Full Changelog: v4.0.2...v4.1.0

Don't miss a new tailwind-variants release

NewReleases is sending notifications on new releases.