github marigold-ui/marigold @marigold/system@17.5.1

latest releases: @marigold/theme-rui@6.0.0-beta.2, @marigold/system@18.0.0-beta.2, @marigold/icons@2.0.0-beta.2...
8 hours ago

Patch Changes

  • c65d2a7: fix(DSTSUP-253): make cva results assignable to ComponentStyleFunction under default strict TypeScript. @marigold/system@17.5.0 shipped cva@1.0.0-beta.4, whose narrowed return type stopped satisfying ComponentStyleFunction<Variants, Sizes> once consumers enabled strictFunctionTypes (implied by strict: true). Function-parameter contravariance rejected both the dead variant?: Variants | null slot and the string vs literal-union variant mismatch, breaking every consumer theme that followed the documented cva(...) as ThemeComponent<'Foo'> pattern. ComponentStyleFunction now types variant/size as any — honestly reflecting the runtime contract (useClassNames passes string | undefined, cva falls back to base styles for unknown values) and letting narrower cva returns satisfy the wider theme contract. Variants/Sizes/Additional generics stay for backward source-compatibility. A dedicated type-level regression test (packages/system/src/types/theme.test-d.ts) uses a StrictlyAssignable<Source, Target> conditional-type helper to verify the contract under TypeScript's structural function checking, so this class of bug is caught by the regular pnpm typecheck even though the monorepo's base config keeps strictFunctionTypes: false.

Don't miss a new marigold release

NewReleases is sending notifications on new releases.