refactor: add Button in FormElements
This commit is contained in:
1 parent
41bea34b2f
commit
ccf36197fe
3 files changed
+44
-32
No files matched your search
@@ -25,7 +25,7 @@ function Dropdown({ children, ...props }: ComponentPropsWithoutRef<"select">) {
|
||||
);
|
||||
}
|
||||
|
||||
export function File({ ...props }: ComponentPropsWithoutRef<"input">) {
|
||||
function File({ ...props }: ComponentPropsWithoutRef<"input">) {
|
||||
return (
|
||||
<input
|
||||
type="file"
|
||||
@@ -34,8 +34,21 @@ export function File({ ...props }: ComponentPropsWithoutRef<"input">) {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function Button({ children, ...props }: ComponentPropsWithoutRef<"button">) {
|
||||
return (
|
||||
<button
|
||||
className="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg px-4 py-2.5 transition text-sm shadow-sm"
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
export const Input = {
|
||||
Text: Textfield,
|
||||
Select: Dropdown,
|
||||
File: File,
|
||||
Button: Button,
|
||||
};
|
||||
Reference in new issue
Block a user