diff --git a/src/app/(auth)/layout.tsx b/src/app/(auth)/layout.tsx new file mode 100644 index 0000000..dc8cace --- /dev/null +++ b/src/app/(auth)/layout.tsx @@ -0,0 +1,12 @@ +import Header from "#/components/header"; + +export default function AuthLayout({ children }: { children: React.ReactNode }) { + return( +
+
+
+ {children} +
+
+ ) +} \ No newline at end of file diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx new file mode 100644 index 0000000..8fa888f --- /dev/null +++ b/src/app/(auth)/login/page.tsx @@ -0,0 +1,27 @@ +import Form from "#/components/form/form" + +export default function LoginPage() { + return( +
+
Login} + /> +
+ ) +} \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index a2dc41e..744cca3 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,5 +1,6 @@ @import "tailwindcss"; + :root { --background: #ffffff; --foreground: #171717; @@ -24,3 +25,30 @@ body { color: var(--foreground); font-family: Arial, Helvetica, sans-serif; } + +.input-form { + width: 100%; + padding: 12px; + border: 1px solid #d1d5dc; + border-radius: 9999px; + + &:focus { + outline-color: none; + } +} + +.input-label { + position: absolute; + left: 12px; + top: -0.45rem; + background-color: white; + padding-inline: 4px; + z-index: 1; +} + +.btn-floating { + position: absolute; + right: 12px; + top: 50%; + transform: translateY(-50%); +} \ No newline at end of file diff --git a/src/components/floatingLabelInput.tsx b/src/components/floatingLabelInput.tsx new file mode 100644 index 0000000..63cd2d0 --- /dev/null +++ b/src/components/floatingLabelInput.tsx @@ -0,0 +1,94 @@ +"use client"; + +import { FloatingLabelInputProps } from '#/types'; +import React, { useState } from 'react'; + + + +export default function FloatingLabelInput({ + label, + placeholder, + type, + options, + button, + showPasswordToggle = false, + name, + defaultValue +}: FloatingLabelInputProps) { + const [showPassword, setShowPassword] = useState(false); + + const renderInput = () => { + switch(type) { + case 'select': + return ( +
+ + {button &&
{button}
} +
+ ); + + case 'password': + return ( +
+ + {/* {showPasswordToggle && ( + + )} */} +
+ ); + + default: + return ( +
+ + {button &&
{button}
} +
+ ); + } + }; + + return ( +
+ + {renderInput()} +
+ ); +} \ No newline at end of file diff --git a/src/components/form/form.tsx b/src/components/form/form.tsx new file mode 100644 index 0000000..abfb5f7 --- /dev/null +++ b/src/components/form/form.tsx @@ -0,0 +1,31 @@ +import FloatingLabelInput from "../floatingLabelInput" +import { FormProps } from "#/types" + +export default function Form({ + fields, + submit, + className, + child +} : FormProps) { + return ( + + { + fields.map((item, index) => ( + + )) + } + {child} + + + ) +} \ No newline at end of file diff --git a/src/components/header.tsx b/src/components/header.tsx new file mode 100644 index 0000000..e76f5de --- /dev/null +++ b/src/components/header.tsx @@ -0,0 +1,17 @@ +import Image from "next/image"; + +export default function Header() { + return( +
+
+ Private Docs +
+
+ ) +} \ No newline at end of file diff --git a/src/components/table/table.tsx b/src/components/table/table.tsx new file mode 100644 index 0000000..914c8b8 --- /dev/null +++ b/src/components/table/table.tsx @@ -0,0 +1,5 @@ +export default function Table() { + return( + <> + ) +} \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..f84ed64 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,19 @@ +import { FormEventHandler, ReactNode } from "react"; + +export interface FloatingLabelInputProps { + label: string; + placeholder?: string; + type: 'text' | 'password' | 'select' | 'email' | 'number'; + options?: string[]; + button?: React.ReactNode; + showPasswordToggle?: boolean; + name: string; + defaultValue?: string; +} + +export interface FormProps { + fields: FloatingLabelInputProps[], + submit: FormEventHandler | undefined, + className: string, + child: ReactNode +} \ No newline at end of file