Skip to content

Commit 05203de

Browse files
committed
feat(components): add new link props and theme
- Add new colors - Add text, hover, icon variables BREAKING CHANGE: changed the name of the variables from the past versions
1 parent 6cdc933 commit 05203de

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

src/components/Link/iconVariants.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const iconVariants = cva('group-hover:fill-none', {
1010
twitter: 'fill-celestial-500',
1111
instagram: 'fill-amethyst-400',
1212
storybook: 'fill-rose-200',
13-
'bell-plus': 'fill-yellow-200',
1413
home: 'fill-steal-800',
1514
white: 'fill-white',
1615
none: '',

src/components/Link/index.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as React from 'react'
21
import { LinkProps } from '@/@types/components'
32
import { cn } from '@/utils/cn'
43

@@ -12,8 +11,8 @@ const Link = ({
1211
variant = 'decorated',
1312
iconName,
1413
hover,
15-
color,
16-
text,
14+
iconColor,
15+
textColor,
1716
background,
1817
size,
1918
children,
@@ -25,16 +24,16 @@ const Link = ({
2524
return (
2625
<a
2726
className={cn(
28-
linkVariants({ variant, text, size, className, background, hover })
27+
linkVariants({ variant, textColor, size, className, background, hover })
2928
)}
3029
{...props}
3130
>
3231
<span>
3332
{Icon && (
3433
<Icon
3534
size={22}
36-
strokeWidth={1.8}
37-
color={color || '#171717'}
35+
strokeWidth={1.4}
36+
color={iconColor || '#171717'}
3837
className={cn(iconVariants({ color: iconFillColor }))}
3938
/>
4039
)}

src/components/Link/linkVariants.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,26 @@ const linkVariants = cva(
1616
black3: 'bg-black/30',
1717
none: '',
1818
},
19-
text: {
19+
textColor: {
2020
black: '[&>span]:text-neutral-800 [&>span]:hover:text-white',
2121
gray: '[&>span]:text-neutral-300 ',
2222
white: '[&>span]:text-white ',
2323
},
2424
hover: {
25-
green: 'hover:bg-lime-300/30',
26-
cyan: 'hover:bg-cyan-300/30',
27-
textGreen: 'hover:text-lime-300',
25+
bgGreen: 'hover:bg-lime-300/30',
26+
bgCyan: 'hover:bg-cyan-300/30',
27+
textYellow: 'hover:text-yellow-500',
2828
},
2929
size: {
30-
normal: 'h-12 w-full',
30+
normal: 'h-12 w-full min-w-[200px]',
3131
none: '',
32+
sm: 'm-0 inline-block w-0 min-w-min p-0 text-base sm:text-lg md:min-w-min',
3233
},
3334
},
3435
defaultVariants: {
3536
variant: 'decorated',
3637
size: 'normal',
37-
hover: 'green',
38+
hover: 'bgGreen',
3839
background: 'white',
3940
},
4041
}

0 commit comments

Comments
 (0)