Skip to content

Commit c827d24

Browse files
committed
feat(fluffy/button): added animation, fix colors
1 parent cceed30 commit c827d24

File tree

1 file changed

+31
-6
lines changed
  • packages/kit-fluffy/src/components/button

1 file changed

+31
-6
lines changed

packages/kit-fluffy/src/components/button/button.tsx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const buttonVariants = cva(
1111
variants: {
1212
intent: {
1313
basic:
14-
'text-black dark:text-white font-semibold py-2 px-4 border border-gray-300 rounded hover:bg-accent',
14+
'text-foreground font-semibold py-2 px-4 border border-gray-300 rounded hover:bg-accent hover:text-accent-foreground',
1515
primary: 'bg-primary text-primary-foreground hover:bg-primary/80',
1616
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
1717
danger: 'bg-destructive text-destructive-foreground hover:bg-destructive/80',
@@ -20,9 +20,9 @@ export const buttonVariants = cva(
2020
link: `border-transparent bg-transparent text-foreground
2121
hover:underline hover:bg-transparent shadow-none outline-current`,
2222
ghost:
23-
'border-transparent bg-transparent border hover:bg-accent hover:text-accent-foreground',
23+
'border-transparent bg-transparent border hover:bg-accent hover:text-accent-foreground',
2424
outline:
25-
'bg-transparent border border-input hover:bg-accent hover:text-accent-foreground',
25+
'bg-transparent border border-input hover:bg-accent hover:text-accent-foreground',
2626
},
2727
shape: {
2828
rounded: 'rounded',
@@ -37,7 +37,7 @@ export const buttonVariants = cva(
3737
},
3838
animation: {
3939
none: '',
40-
bouncy: 'transition duration-300 ease-in-out transform hover:scale-105',
40+
bouncy: 'transition active:scale-90',
4141
},
4242
size: {
4343
sm: 'h-8 rounded-md px-3',
@@ -50,13 +50,38 @@ export const buttonVariants = cva(
5050
state: 'enabled',
5151
intent: 'primary',
5252
size: 'md',
53-
animation: 'none',
53+
animation: 'bouncy',
5454
},
5555
compoundVariants: [
5656
{
5757
intent: 'primary',
5858
look: ['outline', 'ghost'],
59-
class: 'text-primary',
59+
class: 'text-primary hover:text-primary',
60+
},
61+
{
62+
intent: 'secondary',
63+
look: ['outline', 'ghost'],
64+
class: 'text-secondary hover:text-secondary',
65+
},
66+
{
67+
intent: 'danger',
68+
look: ['outline', 'ghost'],
69+
class: 'text-destructive hover:text-destructive',
70+
},
71+
{
72+
intent: 'primary',
73+
look: ['outline'],
74+
class: 'border-primary',
75+
},
76+
{
77+
intent: 'secondary',
78+
look: ['outline'],
79+
class: 'border-secondary',
80+
},
81+
{
82+
intent: 'danger',
83+
look: ['outline'],
84+
class: 'border-destructive',
6085
},
6186
],
6287
},

0 commit comments

Comments
 (0)