Skip to content

Commit f01cc87

Browse files
authored
Update Button.tsx
1 parent 0cfbb6f commit f01cc87

File tree

1 file changed

+150
-0
lines changed

1 file changed

+150
-0
lines changed

src/components/Button.tsx

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,154 @@ export function Button({
4343
);
4444
}
4545

46+
export function FooButton({
47+
children,
48+
onClick,
49+
active = false,
50+
className,
51+
style,
52+
}: ButtonProps) {
53+
return (
54+
<button
55+
style={style}
56+
onMouseDown={(evt) => {
57+
evt.preventDefault();
58+
evt.stopPropagation();
59+
}}
60+
onClick={onClick}
61+
className={cn(
62+
className,
63+
'text-base leading-tight font-bold rounded-full py-2 px-4 focus:outline focus:outline-offset-2 focus:outline-link dark:focus:outline-link-dark inline-flex items-center my-1',
64+
{
65+
'bg-link border-link text-white hover:bg-link focus:bg-link active:bg-link':
66+
active,
67+
'bg-transparent text-primary dark:text-primary-dark active:text-primary shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10':
68+
!active,
69+
}
70+
)}>
71+
{children}
72+
</button>
73+
);
74+
}
75+
76+
export function BarButton({
77+
children,
78+
onClick,
79+
active = false,
80+
className,
81+
style,
82+
}: ButtonProps) {
83+
return (
84+
<button
85+
style={style}
86+
onMouseDown={(evt) => {
87+
evt.preventDefault();
88+
evt.stopPropagation();
89+
}}
90+
onClick={onClick}
91+
className={cn(
92+
className,
93+
'text-base leading-tight font-bold rounded-full py-2 px-4 focus:outline focus:outline-offset-2 focus:outline-link dark:focus:outline-link-dark inline-flex items-center my-1',
94+
{
95+
'bg-link border-link text-white hover:bg-link focus:bg-link active:bg-link':
96+
active,
97+
'bg-transparent text-primary dark:text-primary-dark active:text-primary shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10':
98+
!active,
99+
}
100+
)}>
101+
{children}
102+
</button>
103+
);
104+
}
105+
106+
export function FooBarButton({
107+
children,
108+
onClick,
109+
active = false,
110+
className,
111+
style,
112+
}: ButtonProps) {
113+
return (
114+
<button
115+
style={style}
116+
onMouseDown={(evt) => {
117+
evt.preventDefault();
118+
evt.stopPropagation();
119+
}}
120+
onClick={onClick}
121+
className={cn(
122+
className,
123+
'text-base leading-tight font-bold rounded-full py-2 px-4 focus:outline focus:outline-offset-2 focus:outline-link dark:focus:outline-link-dark inline-flex items-center my-1',
124+
{
125+
'bg-link border-link text-white hover:bg-link focus:bg-link active:bg-link':
126+
active,
127+
'bg-transparent text-primary dark:text-primary-dark active:text-primary shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10':
128+
!active,
129+
}
130+
)}>
131+
{children}
132+
</button>
133+
);
134+
}
135+
136+
export function BarFooButton({
137+
children,
138+
onClick,
139+
active = false,
140+
className,
141+
style,
142+
}: ButtonProps) {
143+
return (
144+
<button
145+
style={style}
146+
onMouseDown={(evt) => {
147+
evt.preventDefault();
148+
evt.stopPropagation();
149+
}}
150+
onClick={onClick}
151+
className={cn(
152+
className,
153+
'text-base leading-tight font-bold rounded-full py-2 px-4 focus:outline focus:outline-offset-2 focus:outline-link dark:focus:outline-link-dark inline-flex items-center my-1',
154+
{
155+
'bg-link border-link text-white hover:bg-link focus:bg-link active:bg-link':
156+
active,
157+
'bg-transparent text-primary dark:text-primary-dark active:text-primary shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10':
158+
!active,
159+
}
160+
)}>
161+
{children}
162+
</button>
163+
);
164+
}
165+
166+
export function FooBarBazButton({
167+
children,
168+
onClick,
169+
active = false,
170+
className,
171+
style,
172+
}: ButtonProps) {
173+
return (
174+
<button
175+
style={style}
176+
onMouseDown={(evt) => {
177+
evt.preventDefault();
178+
evt.stopPropagation();
179+
}}
180+
onClick={onClick}
181+
className={cn(
182+
className,
183+
'text-base leading-tight font-bold rounded-full py-2 px-4 focus:outline focus:outline-offset-2 focus:outline-link dark:focus:outline-link-dark inline-flex items-center my-1',
184+
{
185+
'bg-link border-link text-white hover:bg-link focus:bg-link active:bg-link':
186+
active,
187+
'bg-transparent text-primary dark:text-primary-dark active:text-primary shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10':
188+
!active,
189+
}
190+
)}>
191+
{children}
192+
</button>
193+
);
194+
}
195+
46196
export default Button;

0 commit comments

Comments
 (0)