-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add variants to CloseButton and use that in input clear button
- Loading branch information
1 parent
a1ab773
commit c692367
Showing
7 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
import { tv } from '../tw'; | ||
import { tv, type VariantProps } from '../tw'; | ||
|
||
const closeButton = tv({ | ||
slots: { | ||
base: 'rounded-full hover:bg-default-100 transition transition-200 focus-visable:ring text-inherit', | ||
base: 'rounded-full transition transition-200 focus-visable:ring text-inherit', | ||
icon: 'size-[1em]' | ||
}, | ||
|
||
variants: { | ||
size: { | ||
xs: 'text-sm p-1', | ||
sm: 'text-base p-2', | ||
md: 'text-xl p-2', | ||
lg: 'text-2xl p-3', | ||
xl: 'text-4xl p-3' | ||
xs: { base: 'text-sm p-1' }, | ||
sm: { base: 'text-base p-2' }, | ||
md: { base: 'text-xl p-2' }, | ||
lg: { base: 'text-2xl p-3' }, | ||
xl: { base: 'text-4xl p-3' } | ||
}, | ||
variant: { | ||
transparent: { base: ['bg-transparent', 'hover:bg-default-100'] }, | ||
subtle: { | ||
base: [ | ||
'bg-default-100', | ||
'text-default-foreground dark:text-default-background', | ||
'dark:bg-default-200', | ||
'hover:bg-default-200/60 dark:hover:bg-default-800/60' | ||
] | ||
} | ||
} | ||
}, | ||
defaultVariants: { | ||
size: 'md' | ||
size: 'md', | ||
variant: 'transparent' | ||
} | ||
}); | ||
|
||
export type CloseButtonVariants = VariantProps<typeof closeButton>; | ||
export { closeButton }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters