diff --git a/apps/www/__registry__/blocks/index.ts b/apps/www/__registry__/blocks/index.ts index 44b58fc..450bb1a 100644 --- a/apps/www/__registry__/blocks/index.ts +++ b/apps/www/__registry__/blocks/index.ts @@ -3,6 +3,8 @@ import { Blocks_registry } from "@/registry/blocks"; import Login1 from "@/components/blocks/login-1"; +import Register1 from "@/components/blocks/register-1"; +import Forgot1 from "@/components/blocks/forgot-1"; export const blocks_registry: Blocks_registry[] = [ { @@ -16,4 +18,26 @@ export const blocks_registry: Blocks_registry[] = [ ], default_export: Login1, }, + { + name: "register-1", + files: ["register-1.tsx"], + dependencies: ["react-hook-form", "@hookform/resolvers", "zod"], + components: ["button", "input", "form"], + type: "block:component", + content: [ + '"use client";\n\n/* eslint-disable @next/next/no-img-element */\nimport Image from "next/image";\n\nimport Link from "next/link";\nimport React from "react";\nimport { useForm } from "react-hook-form";\nimport { zodResolver } from "@hookform/resolvers/zod";\nimport { z } from "zod";\nimport { Button } from "ruru-ui/components/button";\nimport { Input, PasswordInput } from "ruru-ui/components/input";\nimport {\n Form,\n FormControl,\n FormField,\n FormLabel,\n FormItem,\n FormMessage,\n} from "ruru-ui/components/form";\n\nconst Register1 = () => {\n const registerSchema = z.object({\n firstName: z\n .string()\n .min(3, { message: "First name must be at least 3 characters long." }),\n lastName: z\n .string()\n .min(3, { message: "Last name must be at least 3 characters long." }),\n email: z.string().email({ message: "Please enter a valid email address." }),\n password: z\n .string()\n .min(8, { message: "Password must be at least 8 characters long." }),\n });\n\n const form = useForm>({\n resolver: zodResolver(registerSchema),\n defaultValues: {\n firstName: "",\n lastName: "",\n email: "",\n password: "",\n },\n });\n\n function onSubmit(values: z.infer) {\n // Do something with the form values.\n console.log(values);\n }\n\n return (\n
\n
\n
\n
\n \n \n Ruru UI\n
\n \n Create an account\n \n
\n\n
\n \n
\n
\n (\n \n First Name\n \n \n \n \n \n )}\n />\n\n (\n \n Last Name\n \n \n \n \n \n )}\n />\n
\n\n (\n \n Email\n \n \n \n \n \n )}\n />\n\n (\n \n Password\n \n \n \n \n \n )}\n />\n
\n\n
\n \n console.log("Login with Github")}\n >\n Register with Github\n \n
\n\n \n Already have an account?\n \n \n \n
\n
\n );\n};\n\nexport default Register1;\n', + ], + default_export: Register1, + }, + { + name: "forgot-1", + files: ["forgot-1.tsx"], + dependencies: ["react-hook-form", "@hookform/resolvers", "zod"], + components: ["button", "input", "form"], + type: "block:component", + content: [ + '"use client";\n\n/* eslint-disable @next/next/no-img-element */\nimport Image from "next/image";\n\nimport Link from "next/link";\nimport React from "react";\nimport { useForm } from "react-hook-form";\nimport { zodResolver } from "@hookform/resolvers/zod";\nimport { z } from "zod";\nimport { Button } from "ruru-ui/components/button";\nimport { Input } from "ruru-ui/components/input";\nimport {\n Form,\n FormControl,\n FormField,\n FormLabel,\n FormItem,\n FormMessage,\n} from "ruru-ui/components/form";\n\nconst Forgot1 = (): React.ReactNode => {\n const formSchema = z.object({\n email: z.string().email({ message: "Please enter a valid email address." }),\n });\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n email: "",\n },\n });\n\n function onSubmit(values: z.infer) {\n // Do something with the form values.\n console.log(values);\n }\n\n return (\n
\n
\n
\n
\n \n \n Ruru UI\n
\n \n Forgot your password?\n \n
\n\n
\n \n
\n (\n \n Email\n \n \n \n \n \n )}\n />\n
\n\n
\n \n
\n\n \n Back to login\n \n \n \n
\n
\n );\n};\n\nexport default Forgot1;\n', + ], + default_export: Forgot1, + }, ]; diff --git a/apps/www/app/(home)/page.tsx b/apps/www/app/(home)/page.tsx index a8fc78e..0e22095 100644 --- a/apps/www/app/(home)/page.tsx +++ b/apps/www/app/(home)/page.tsx @@ -439,7 +439,7 @@ const Terminal = ({ data }: { data: string }) => { Terminal -
+
         {data}
diff --git a/apps/www/components/blocks/forgot-1.tsx b/apps/www/components/blocks/forgot-1.tsx
new file mode 100644
index 0000000..1b22633
--- /dev/null
+++ b/apps/www/components/blocks/forgot-1.tsx
@@ -0,0 +1,105 @@
+"use client";
+
+/* eslint-disable @next/next/no-img-element */
+import Image from "next/image";
+
+import Link from "next/link";
+import React from "react";
+import { useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { z } from "zod";
+import { Button } from "ruru-ui/components/button";
+import { Input } from "ruru-ui/components/input";
+import {
+  Form,
+  FormControl,
+  FormField,
+  FormLabel,
+  FormItem,
+  FormMessage,
+} from "ruru-ui/components/form";
+
+const Forgot1 = (): React.ReactNode => {
+  const formSchema = z.object({
+    email: z.string().email({ message: "Please enter a valid email address." }),
+  });
+
+  const form = useForm>({
+    resolver: zodResolver(formSchema),
+    defaultValues: {
+      email: "",
+    },
+  });
+
+  function onSubmit(values: z.infer) {
+    // Do something with the form values.
+    console.log(values);
+  }
+
+  return (
+    
+
+
+
+ logo + logo + Ruru UI +
+ + Forgot your password? + +
+ +
+ +
+ ( + + Email + + + + + + )} + /> +
+ +
+ +
+ + + Back to login + +
+ +
+
+ ); +}; + +export default Forgot1; diff --git a/apps/www/components/blocks/register-1.tsx b/apps/www/components/blocks/register-1.tsx new file mode 100644 index 0000000..2242137 --- /dev/null +++ b/apps/www/components/blocks/register-1.tsx @@ -0,0 +1,168 @@ +"use client"; + +/* eslint-disable @next/next/no-img-element */ +import Image from "next/image"; + +import Link from "next/link"; +import React from "react"; +import { useForm } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { z } from "zod"; +import { Button } from "ruru-ui/components/button"; +import { Input, PasswordInput } from "ruru-ui/components/input"; +import { + Form, + FormControl, + FormField, + FormLabel, + FormItem, + FormMessage, +} from "ruru-ui/components/form"; + +const Register1 = () => { + const registerSchema = z.object({ + firstName: z + .string() + .min(3, { message: "First name must be at least 3 characters long." }), + lastName: z + .string() + .min(3, { message: "Last name must be at least 3 characters long." }), + email: z.string().email({ message: "Please enter a valid email address." }), + password: z + .string() + .min(8, { message: "Password must be at least 8 characters long." }), + }); + + const form = useForm>({ + resolver: zodResolver(registerSchema), + defaultValues: { + firstName: "", + lastName: "", + email: "", + password: "", + }, + }); + + function onSubmit(values: z.infer) { + // Do something with the form values. + console.log(values); + } + + return ( +
+
+
+
+ logo + logo + Ruru UI +
+ + Create an account + +
+ +
+ +
+
+ ( + + First Name + + + + + + )} + /> + + ( + + Last Name + + + + + + )} + /> +
+ + ( + + Email + + + + + + )} + /> + + ( + + Password + + + + + + )} + /> +
+ +
+ + +
+ + + Already have an account? + +
+ +
+
+ ); +}; + +export default Register1; diff --git a/apps/www/public/registry/blocks/forgot-1.json b/apps/www/public/registry/blocks/forgot-1.json new file mode 100644 index 0000000..03347ac --- /dev/null +++ b/apps/www/public/registry/blocks/forgot-1.json @@ -0,0 +1,13 @@ +{ + "name": "forgot-1", + "files": [ + { + "name": "forgot-1.tsx", + "content": "\"use client\";\n\n/* eslint-disable @next/next/no-img-element */\nimport Image from \"next/image\";\n\nimport Link from \"next/link\";\nimport React from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { z } from \"zod\";\nimport { Button } from \"ruru-ui/components/button\";\nimport { Input } from \"ruru-ui/components/input\";\nimport {\n Form,\n FormControl,\n FormField,\n FormLabel,\n FormItem,\n FormMessage,\n} from \"ruru-ui/components/form\";\n\nconst Forgot1 = (): React.ReactNode => {\n const formSchema = z.object({\n email: z.string().email({ message: \"Please enter a valid email address.\" }),\n });\n\n const form = useForm>({\n resolver: zodResolver(formSchema),\n defaultValues: {\n email: \"\",\n },\n });\n\n function onSubmit(values: z.infer) {\n // Do something with the form values.\n console.log(values);\n }\n\n return (\n
\n
\n
\n
\n \n \n Ruru UI\n
\n \n Forgot your password?\n \n
\n\n
\n \n
\n (\n \n Email\n \n \n \n \n \n )}\n />\n
\n\n
\n \n
\n\n \n Back to login\n \n \n \n
\n
\n );\n};\n\nexport default Forgot1;\n" + } + ], + "dependencies": ["react-hook-form", "@hookform/resolvers", "zod"], + "components": ["button", "input", "form"], + "type": "block:component", + "default_export": "Forgot1" +} diff --git a/apps/www/public/registry/blocks/index.json b/apps/www/public/registry/blocks/index.json index 928d903..c7eb3f9 100644 --- a/apps/www/public/registry/blocks/index.json +++ b/apps/www/public/registry/blocks/index.json @@ -6,5 +6,21 @@ "components": ["button", "input", "form"], "type": "block:component", "default_export": "Login1" + }, + { + "name": "register-1", + "files": ["register-1.tsx"], + "dependencies": ["react-hook-form", "@hookform/resolvers", "zod"], + "components": ["button", "input", "form"], + "type": "block:component", + "default_export": "Register1" + }, + { + "name": "forgot-1", + "files": ["forgot-1.tsx"], + "dependencies": ["react-hook-form", "@hookform/resolvers", "zod"], + "components": ["button", "input", "form"], + "type": "block:component", + "default_export": "Forgot1" } ] diff --git a/apps/www/public/registry/blocks/register-1.json b/apps/www/public/registry/blocks/register-1.json new file mode 100644 index 0000000..3537c8b --- /dev/null +++ b/apps/www/public/registry/blocks/register-1.json @@ -0,0 +1,13 @@ +{ + "name": "register-1", + "files": [ + { + "name": "register-1.tsx", + "content": "\"use client\";\n\n/* eslint-disable @next/next/no-img-element */\nimport Image from \"next/image\";\n\nimport Link from \"next/link\";\nimport React from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport { z } from \"zod\";\nimport { Button } from \"ruru-ui/components/button\";\nimport { Input, PasswordInput } from \"ruru-ui/components/input\";\nimport {\n Form,\n FormControl,\n FormField,\n FormLabel,\n FormItem,\n FormMessage,\n} from \"ruru-ui/components/form\";\n\nconst Register1 = () => {\n const registerSchema = z.object({\n firstName: z\n .string()\n .min(3, { message: \"First name must be at least 3 characters long.\" }),\n lastName: z\n .string()\n .min(3, { message: \"Last name must be at least 3 characters long.\" }),\n email: z.string().email({ message: \"Please enter a valid email address.\" }),\n password: z\n .string()\n .min(8, { message: \"Password must be at least 8 characters long.\" }),\n });\n\n const form = useForm>({\n resolver: zodResolver(registerSchema),\n defaultValues: {\n firstName: \"\",\n lastName: \"\",\n email: \"\",\n password: \"\",\n },\n });\n\n function onSubmit(values: z.infer) {\n // Do something with the form values.\n console.log(values);\n }\n\n return (\n
\n
\n
\n
\n \n \n Ruru UI\n
\n \n Create an account\n \n
\n\n
\n \n
\n
\n (\n \n First Name\n \n \n \n \n \n )}\n />\n\n (\n \n Last Name\n \n \n \n \n \n )}\n />\n
\n\n (\n \n Email\n \n \n \n \n \n )}\n />\n\n (\n \n Password\n \n \n \n \n \n )}\n />\n
\n\n
\n \n console.log(\"Login with Github\")}\n >\n Register with Github\n \n
\n\n \n Already have an account?\n \n \n \n
\n
\n );\n};\n\nexport default Register1;\n" + } + ], + "dependencies": ["react-hook-form", "@hookform/resolvers", "zod"], + "components": ["button", "input", "form"], + "type": "block:component", + "default_export": "Register1" +} diff --git a/apps/www/registry/blocks.ts b/apps/www/registry/blocks.ts index d11d724..abae8f6 100644 --- a/apps/www/registry/blocks.ts +++ b/apps/www/registry/blocks.ts @@ -23,4 +23,20 @@ export const blocks: Block[] = [ type: "block:component", default_export: "Login1", }, + { + name: "register-1", + files: ["register-1.tsx"], + dependencies: ["react-hook-form", "@hookform/resolvers", "zod"], + components: ["button", "input", "form"], + type: "block:component", + default_export: "Register1", + }, + { + name: "forgot-1", + files: ["forgot-1.tsx"], + dependencies: ["react-hook-form", "@hookform/resolvers", "zod"], + components: ["button", "input", "form"], + type: "block:component", + default_export: "Forgot1", + }, ];