Tailus-UI / tailus-ui-react

Highly customizable react components for crafting modern, personalized websites and applications.

Home Page:https://ui.tailus.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Follow steps to add the card component @ https://ui.tailus.io/react/components/card/
  2. 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.