This commit resolves a TypeScript build issue caused by the combined import of VariantProps (a type) and cva (a runtime value) from class-variance-authority.
Context
When verbatimModuleSyntax is enabled, TypeScript enforces strict separation of type-only imports (import type) and runtime imports (import). The current code:
import { VariantProps, cva } from "class-variance-authority";
causes the following build error in strict TypeScript environments (e.g., Vercel deployments):
Type error: 'VariantProps' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
Changes Made
Updated the import statement to:
import { cva } from "class-variance-authority"; // For runtime use
import type { VariantProps } from "class-variance-authority"; // For type-checking only
This ensures compliance with verbatimModuleSyntax while preserving the functionality of the existing code.
Testing Performed:
Verified locally with TypeScript and ESLint to ensure no new errors are introduced.
Successfully deployed to Vercel, confirming the build error is resolved.
This commit resolves a TypeScript build issue caused by the combined import of
VariantProps
(a type) andcva
(a runtime value) fromclass-variance-authority
.Context
When
verbatimModuleSyntax
is enabled, TypeScript enforces strict separation of type-only imports (import type
) and runtime imports (import
). The current code:import { VariantProps, cva } from "class-variance-authority";
causes the following build error in strict TypeScript environments (e.g., Vercel deployments):
Type error: 'VariantProps' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
Changes Made Updated the import statement to:
This ensures compliance with verbatimModuleSyntax while preserving the functionality of the existing code. Testing Performed: