Props to gradient card is different than card props
imprakharshukla opened this issue · comments
Describe the bug
Cannot pass variant prop to the gradientCard
function since:
Type '"outlined" | "soft" | "mixed" | "elevated"' is not assignable to type '"soft" | "elevated" | undefined'.
Type '"outlined"' is not assignable to type '"soft" | "elevated" | undefined'
To Reproduce
- Follow steps to add the card component @ https://ui.tailus.io/react/components/card/
- TS throw the type mismatch error on
const { outer } = gradientCard({ variant });
Expected behavior
gradient card variant type should be consistent with card variant type.
Desktop (please complete the following information):
- OS: MacOS
- Browser Chrome
Additional context
"@tailus/themer": "^0.1.5",
When the gradient
property is set to true
, the variant property should only be "soft", "elevated", or undefined.
Any other value for variant is not acceptable in this context.
This means that if you are using the gradient option, the appearance of the gradient
can only be controlled by the variant values "soft", "elevated", or the default appearance when variant is undefined. Other variant
values like "outlined" or "mixed" are not valid when gradient
is true
.
I'll make it clear in the documentation
Understood! The types should reflect this.