✨ Features
defineVariants&VariantProps— Added a zero-runtimedefineVariantshelper (exported from.,/lite, and/config) for defining typed options outsidetv()and reading them directly withVariantProps<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"matchnullor an omitted prop with no default;1matches"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