Skip to content

Commit 2c177d2

Browse files
committed
chore(Button): updated to 5.0.0
1 parent f00654c commit 2c177d2

File tree

2 files changed

+101
-1
lines changed

2 files changed

+101
-1
lines changed

src/Button/Button.stories.tsx

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,102 @@ export const BrandColors: Story<ButtonProps> = (args) => {
4747
}
4848
BrandColors.args = {}
4949

50+
export const SoftStyle: Story<ButtonProps> = (args) => {
51+
return (
52+
<div className="flex items-center gap-2">
53+
<Button {...args}>Default</Button>
54+
<Button {...args} color="primary">
55+
Primary
56+
</Button>
57+
<Button {...args} color="secondary">
58+
Secondary
59+
</Button>
60+
<Button {...args} color="accent">
61+
Accent
62+
</Button>
63+
<Button {...args} color="info">
64+
Info
65+
</Button>
66+
<Button {...args} color="success">
67+
Success
68+
</Button>
69+
<Button {...args} color="warning">
70+
Warning
71+
</Button>
72+
<Button {...args} color="error">
73+
Error
74+
</Button>
75+
</div>
76+
)
77+
}
78+
SoftStyle.args = {
79+
variant: 'soft',
80+
}
81+
82+
export const OutlineStyle: Story<ButtonProps> = (args) => {
83+
return (
84+
<div className="flex items-center gap-2">
85+
<Button {...args}>Default</Button>
86+
<Button {...args} color="primary">
87+
Primary
88+
</Button>
89+
<Button {...args} color="secondary">
90+
Secondary
91+
</Button>
92+
<Button {...args} color="accent">
93+
Accent
94+
</Button>
95+
<Button {...args} color="info">
96+
Info
97+
</Button>
98+
<Button {...args} color="success">
99+
Success
100+
</Button>
101+
<Button {...args} color="warning">
102+
Warning
103+
</Button>
104+
<Button {...args} color="error">
105+
Error
106+
</Button>
107+
</div>
108+
)
109+
}
110+
OutlineStyle.args = {
111+
variant: 'outline',
112+
}
113+
114+
export const DashStyle: Story<ButtonProps> = (args) => {
115+
return (
116+
<div className="flex items-center gap-2">
117+
<Button {...args}>Default</Button>
118+
<Button {...args} color="primary">
119+
Primary
120+
</Button>
121+
<Button {...args} color="secondary">
122+
Secondary
123+
</Button>
124+
<Button {...args} color="accent">
125+
Accent
126+
</Button>
127+
<Button {...args} color="info">
128+
Info
129+
</Button>
130+
<Button {...args} color="success">
131+
Success
132+
</Button>
133+
<Button {...args} color="warning">
134+
Warning
135+
</Button>
136+
<Button {...args} color="error">
137+
Error
138+
</Button>
139+
</div>
140+
)
141+
}
142+
DashStyle.args = {
143+
variant: 'dash',
144+
}
145+
50146
export const ActiveButtons: Story<ButtonProps> = (args) => {
51147
return (
52148
<div className="flex items-center gap-2">

src/Button/Button.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
IComponentBaseProps,
88
ComponentColor,
99
ComponentShape,
10+
ComponentVariant,
1011
ComponentSize,
1112
} from '../types'
1213

@@ -52,8 +53,8 @@ export type ButtonProps<
5253
IComponentBaseProps & {
5354
shape?: ComponentShape
5455
size?: ComponentSize
55-
variant?: 'outline' | 'link'
5656
color?: ComponentColor
57+
variant?: ComponentVariant | 'link'
5758
glass?: boolean
5859
wide?: boolean
5960
fullWidth?: boolean
@@ -115,12 +116,15 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
115116
'btn',
116117
className,
117118
clsx(((startIcon && !loading) || endIcon) && 'gap-2', {
119+
'btn-xl': size === 'xl',
118120
'btn-lg': size === 'lg',
119121
'btn-md': size === 'md',
120122
'btn-sm': size === 'sm',
121123
'btn-xs': size === 'xs',
122124
'btn-circle': shape === 'circle',
123125
'btn-square': shape === 'square',
126+
'btn-soft': variant === 'soft',
127+
'btn-dash': variant === 'dash',
124128
'btn-outline': variant === 'outline',
125129
'btn-link': variant === 'link',
126130
'btn-neutral': color === 'neutral',

0 commit comments

Comments
 (0)