From a72460742e892f6583c44986ed0a4279e56b6531 Mon Sep 17 00:00:00 2001 From: ruru <142723369+ruru-m07@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:39:54 +0530 Subject: [PATCH] fix(assets): refactor assets folder structure --- apps/www/__registry__/blocks/index.ts | 12 ------------ apps/www/public/registry/blocks/forgot-1.json | 4 ---- apps/www/public/registry/blocks/login-1.json | 4 ---- apps/www/public/registry/blocks/register-1.json | 4 ---- apps/www/public/registry/components/input.json | 4 ---- apps/www/public/registry/components/select.json | 4 ---- 6 files changed, 32 deletions(-) diff --git a/apps/www/__registry__/blocks/index.ts b/apps/www/__registry__/blocks/index.ts index 74af98c..68749f5 100644 --- a/apps/www/__registry__/blocks/index.ts +++ b/apps/www/__registry__/blocks/index.ts @@ -14,11 +14,7 @@ export const blocks_registry: Blocks_registry[] = [ components: ["button", "input", "form"], type: "block:component", content: [ -<<<<<<< Updated upstream '"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 Login1 = (): React.ReactNode => {\n const loginSchema = z.object({\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(loginSchema),\n defaultValues: {\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 Welcome back\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 Forgot password?\n \n\n
\n \n console.log("Login with Github")}\n >\n Login with Github\n \n
\n\n \n Don't have an account?\n \n \n \n
\n
\n );\n};\n\nexport default Login1;\n', -======= - '"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 Login1 = (): React.ReactNode => {\n const loginSchema = z.object({\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(loginSchema),\n defaultValues: {\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 Welcome back\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 Forgot password?\n \n\n
\n \n console.log("Login with Github")}\n >\n Login with Github\n \n
\n\n \n Don't have an account?\n \n \n \n
\n
\n );\n};\n\nexport default Login1;\n', ->>>>>>> Stashed changes ], default_export: Login1, }, @@ -29,11 +25,7 @@ export const blocks_registry: Blocks_registry[] = [ components: ["button", "input", "form"], type: "block:component", content: [ -<<<<<<< Updated upstream '"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', -======= - '"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', ->>>>>>> Stashed changes ], default_export: Register1, }, @@ -44,11 +36,7 @@ export const blocks_registry: Blocks_registry[] = [ components: ["button", "input", "form"], type: "block:component", content: [ -<<<<<<< Updated upstream '"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', -======= - '"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', ->>>>>>> Stashed changes ], default_export: Forgot1, }, diff --git a/apps/www/public/registry/blocks/forgot-1.json b/apps/www/public/registry/blocks/forgot-1.json index 9c17345..737779a 100644 --- a/apps/www/public/registry/blocks/forgot-1.json +++ b/apps/www/public/registry/blocks/forgot-1.json @@ -3,11 +3,7 @@ "files": [ { "name": "forgot-1.tsx", -<<<<<<< Updated upstream "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" -======= - "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" ->>>>>>> Stashed changes } ], "dependencies": ["react-hook-form", "@hookform/resolvers", "zod"], diff --git a/apps/www/public/registry/blocks/login-1.json b/apps/www/public/registry/blocks/login-1.json index bd72b63..a5bdf9f 100644 --- a/apps/www/public/registry/blocks/login-1.json +++ b/apps/www/public/registry/blocks/login-1.json @@ -3,11 +3,7 @@ "files": [ { "name": "login-1.tsx", -<<<<<<< Updated upstream "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 Login1 = (): React.ReactNode => {\n const loginSchema = z.object({\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(loginSchema),\n defaultValues: {\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 Welcome back\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 Forgot password?\n \n\n
\n \n console.log(\"Login with Github\")}\n >\n Login with Github\n \n
\n\n \n Don't have an account?\n \n \n \n
\n
\n );\n};\n\nexport default Login1;\n" -======= - "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 Login1 = (): React.ReactNode => {\n const loginSchema = z.object({\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(loginSchema),\n defaultValues: {\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 Welcome back\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 Forgot password?\n \n\n
\n \n console.log(\"Login with Github\")}\n >\n Login with Github\n \n
\n\n \n Don't have an account?\n \n \n \n
\n
\n );\n};\n\nexport default Login1;\n" ->>>>>>> Stashed changes } ], "dependencies": ["react-hook-form", "@hookform/resolvers", "zod"], diff --git a/apps/www/public/registry/blocks/register-1.json b/apps/www/public/registry/blocks/register-1.json index 2c0c4c3..8cdbf69 100644 --- a/apps/www/public/registry/blocks/register-1.json +++ b/apps/www/public/registry/blocks/register-1.json @@ -3,11 +3,7 @@ "files": [ { "name": "register-1.tsx", -<<<<<<< Updated upstream "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" -======= - "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" ->>>>>>> Stashed changes } ], "dependencies": ["react-hook-form", "@hookform/resolvers", "zod"], diff --git a/apps/www/public/registry/components/input.json b/apps/www/public/registry/components/input.json index 6f6eab6..9f7bdc9 100644 --- a/apps/www/public/registry/components/input.json +++ b/apps/www/public/registry/components/input.json @@ -3,11 +3,7 @@ "files": [ { "name": "input.tsx", -<<<<<<< Updated upstream "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { EyeClosedIcon, EyeOpenIcon } from \"@radix-ui/react-icons\";\n\nexport interface InputProps\n extends Omit<\n React.InputHTMLAttributes,\n \"children\" | \"prefix\" | \"suffix\"\n > {\n \n className?: string;\n \n iclassName?: string;\n \n prefix?: React.ReactNode | string;\n \n suffix?: React.ReactNode | string;\n \n prefixStyling?: boolean;\n \n label?: string;\n \n suffixStyling?: boolean;\n \n error?: string;\n}\n\nconst Input = React.forwardRef(\n (\n {\n className,\n iclassName,\n prefix,\n suffix,\n prefixStyling = true,\n suffixStyling = true,\n label,\n type,\n error,\n ...props\n },\n ref,\n ) => {\n \n const prefixRef = React.useRef(null);\n const suffixRef = React.useRef(null);\n \n const [prefixWidth, setPrefixWidth] = React.useState(0);\n const [suffixWidth, setSuffixWidth] = React.useState(0);\n \n React.useEffect(() => {\n if (prefixRef.current) {\n setPrefixWidth(prefixRef.current.offsetWidth);\n }\n if (suffixRef.current) {\n setSuffixWidth(suffixRef.current.offsetWidth);\n }\n }, [prefix, suffix]);\n\n return (\n
\n {label && (\n \n {label}\n \n )}\n {prefix && (\n \n {prefix}\n {prefixStyling &&
}\n
\n )}\n \n {suffix && (\n \n {suffixStyling && (\n
\n )}\n {suffix}\n
\n )}\n {error && (\n \n \n \n \n \n
\n )}\n \n );\n },\n);\n\nInput.displayName = \"Input\";\n\nexport interface SearchInputProps\n extends Omit, \"children\"> {\n \n enablePrefixStyling?: boolean;\n}\n\nconst SearchInput = React.forwardRef(\n ({ enablePrefixStyling = false, ...props }, ref) => {\n return (\n \n \n \n }\n prefixStyling={enablePrefixStyling}\n className={cn(\"rounded-full\", props.className)}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nSearchInput.displayName = \"SearchInput\";\n\nconst PasswordInput = React.forwardRef<\n HTMLInputElement,\n Omit\n>(({ className, ...props }, ref) => {\n const [showPassword, setShowPassword] = React.useState(false);\n\n return (\n
\n \n setShowPassword((prev) => !prev)}\n disabled={props.disabled}\n >\n {showPassword ? (\n \n ) : (\n \n )}\n \n {showPassword ? \"Hide password\" : \"Show password\"}\n \n \n\n {}\n \n
\n );\n});\nPasswordInput.displayName = \"PasswordInput\";\n\nexport { Input, SearchInput, PasswordInput };\n" -======= - "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { EyeClosedIcon, EyeOpenIcon } from \"@radix-ui/react-icons\";\n\nexport interface InputProps\n extends Omit<\n React.InputHTMLAttributes,\n \"children\" | \"prefix\" | \"suffix\"\n > {\n \n className?: string;\n \n iclassName?: string;\n \n prefix?: React.ReactNode | string;\n \n suffix?: React.ReactNode | string;\n \n prefixStyling?: boolean;\n \n label?: string;\n \n suffixStyling?: boolean;\n \n error?: string;\n}\n\nconst Input = React.forwardRef(\n (\n {\n className,\n iclassName,\n prefix,\n suffix,\n prefixStyling = true,\n suffixStyling = true,\n label,\n type,\n error,\n ...props\n },\n ref,\n ) => {\n \n const prefixRef = React.useRef(null);\n const suffixRef = React.useRef(null);\n \n const [prefixWidth, setPrefixWidth] = React.useState(0);\n const [suffixWidth, setSuffixWidth] = React.useState(0);\n \n React.useEffect(() => {\n if (prefixRef.current) {\n setPrefixWidth(prefixRef.current.offsetWidth);\n }\n if (suffixRef.current) {\n setSuffixWidth(suffixRef.current.offsetWidth);\n }\n }, [prefix, suffix]);\n\n return (\n
\n {label && (\n \n {label}\n \n )}\n {prefix && (\n \n {prefix}\n {prefixStyling &&
}\n
\n )}\n \n {suffix && (\n \n {suffixStyling && (\n
\n )}\n {suffix}\n
\n )}\n {error && (\n \n \n \n \n \n
\n )}\n \n );\n },\n);\n\nInput.displayName = \"Input\";\n\nexport interface SearchInputProps\n extends Omit, \"children\"> {\n \n enablePrefixStyling?: boolean;\n}\n\nconst SearchInput = React.forwardRef(\n ({ enablePrefixStyling = false, ...props }, ref) => {\n return (\n \n \n \n }\n prefixStyling={enablePrefixStyling}\n className={cn(\"rounded-full\", props.className)}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nSearchInput.displayName = \"SearchInput\";\n\nconst PasswordInput = React.forwardRef<\n HTMLInputElement,\n Omit\n>(({ className, ...props }, ref) => {\n const [showPassword, setShowPassword] = React.useState(false);\n\n return (\n
\n \n setShowPassword((prev) => !prev)}\n disabled={props.disabled}\n >\n {showPassword ? (\n \n ) : (\n \n )}\n \n {showPassword ? \"Hide password\" : \"Show password\"}\n \n \n\n {}\n \n
\n );\n});\nPasswordInput.displayName = \"PasswordInput\";\n\nexport { Input, SearchInput, PasswordInput };\n" ->>>>>>> Stashed changes } ], "type": "components:ui" diff --git a/apps/www/public/registry/components/select.json b/apps/www/public/registry/components/select.json index 31a0b0c..0c52f42 100644 --- a/apps/www/public/registry/components/select.json +++ b/apps/www/public/registry/components/select.json @@ -4,11 +4,7 @@ "files": [ { "name": "select.tsx", -<<<<<<< Updated upstream "content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from \"@radix-ui/react-icons\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cn } from \"@/utils/cn\";\nimport { motion } from \"framer-motion\";\nimport { useRuru } from \"@/provider\";\n\nconst Select = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\nexport const selectAnimationVariants = {\n zoom: {\n initial: { opacity: 0, scale: 0.9 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.9 },\n transition: { type: \"spring\", stiffness: 600, damping: 25 },\n },\n scaleBounce: {\n initial: { opacity: 0, scale: 0.5 },\n animate: { opacity: 1, scale: [1.2, 0.9, 1] },\n exit: { opacity: 0, scale: 0.5 },\n transition: { type: \"spring\", stiffness: 600, damping: 20 },\n },\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0.3 },\n },\n slideUp: {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: 20 },\n transition: { type: \"spring\", stiffness: 500, damping: 20 },\n },\n slideDown: {\n initial: { opacity: 0, y: -20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -20 },\n transition: { type: \"spring\", stiffness: 500, damping: 20 },\n },\n slideRight: {\n initial: { opacity: 0, x: -30 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: -30 },\n transition: { type: \"spring\", stiffness: 400, damping: 20 },\n },\n slideLeft: {\n initial: { opacity: 0, x: 30 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 30 },\n transition: { type: \"spring\", stiffness: 400, damping: 20 },\n },\n flip: {\n initial: { opacity: 0, rotateY: 90 },\n animate: { opacity: 1, rotateY: 0 },\n exit: { opacity: 0, rotateY: 90 },\n transition: { type: \"spring\", stiffness: 500, damping: 30 },\n },\n rotate: {\n initial: { opacity: 0, rotate: -180 },\n animate: { opacity: 1, rotate: 0 },\n exit: { opacity: 0, rotate: -180 },\n transition: { type: \"spring\", stiffness: 500, damping: 25 },\n },\n};\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n enableAnimation?: boolean;\n }\n>(({ className, children, enableAnimation = false, ...props }, ref) => {\n const { animation } = useRuru();\n return animation && enableAnimation ? (\n \n span]:line-clamp-1\",\n className,\n )}\n {...props}\n >\n {children}\n \n \n \n \n \n ) : (\n span]:line-clamp-1\",\n className,\n )}\n {...props}\n >\n {children}\n \n \n \n \n );\n});\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n\nconst AnimatedSelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n selectedVariant: keyof typeof selectAnimationVariants;\n }\n>(\n (\n { className, children, position = \"popper\", selectedVariant, ...props },\n ref,\n ) => (\n \n \n \n \n \n {children}\n \n \n \n \n \n ),\n);\nAnimatedSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n\nconst StaticSelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n \n \n \n \n {children}\n \n \n \n \n));\nStaticSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n variants?: keyof typeof selectAnimationVariants;\n }\n>((props, ref) => {\n const { animation } = useRuru();\n const selectedVariant = props.variants || \"zoom\";\n\n return animation ? (\n \n ) : (\n \n );\n});\n\nSelectContent.displayName = \"SelectContent\";\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n \n \n \n \n {children}\n \n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n" -======= - "content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n CaretSortIcon,\n CheckIcon,\n ChevronDownIcon,\n ChevronUpIcon,\n} from \"@radix-ui/react-icons\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cn } from \"@/utils/cn\";\nimport { motion } from \"framer-motion\";\nimport { useRuru } from \"@/provider\";\n\nconst Select = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\nexport const selectAnimationVariants = {\n zoom: {\n initial: { opacity: 0, scale: 0.9 },\n animate: { opacity: 1, scale: 1 },\n exit: { opacity: 0, scale: 0.9 },\n transition: { type: \"spring\", stiffness: 600, damping: 25 },\n },\n scaleBounce: {\n initial: { opacity: 0, scale: 0.5 },\n animate: { opacity: 1, scale: [1.2, 0.9, 1] },\n exit: { opacity: 0, scale: 0.5 },\n transition: { type: \"spring\", stiffness: 600, damping: 20 },\n },\n fade: {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0.3 },\n },\n slideUp: {\n initial: { opacity: 0, y: 20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: 20 },\n transition: { type: \"spring\", stiffness: 500, damping: 20 },\n },\n slideDown: {\n initial: { opacity: 0, y: -20 },\n animate: { opacity: 1, y: 0 },\n exit: { opacity: 0, y: -20 },\n transition: { type: \"spring\", stiffness: 500, damping: 20 },\n },\n slideRight: {\n initial: { opacity: 0, x: -30 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: -30 },\n transition: { type: \"spring\", stiffness: 400, damping: 20 },\n },\n slideLeft: {\n initial: { opacity: 0, x: 30 },\n animate: { opacity: 1, x: 0 },\n exit: { opacity: 0, x: 30 },\n transition: { type: \"spring\", stiffness: 400, damping: 20 },\n },\n flip: {\n initial: { opacity: 0, rotateY: 90 },\n animate: { opacity: 1, rotateY: 0 },\n exit: { opacity: 0, rotateY: 90 },\n transition: { type: \"spring\", stiffness: 500, damping: 30 },\n },\n rotate: {\n initial: { opacity: 0, rotate: -180 },\n animate: { opacity: 1, rotate: 0 },\n exit: { opacity: 0, rotate: -180 },\n transition: { type: \"spring\", stiffness: 500, damping: 25 },\n },\n};\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n enableAnimation?: boolean;\n }\n>(({ className, children, enableAnimation = false, ...props }, ref) => {\n const { animation } = useRuru();\n return animation && enableAnimation ? (\n \n span]:line-clamp-1\",\n className,\n )}\n {...props}\n >\n {children}\n \n \n \n \n \n ) : (\n span]:line-clamp-1\",\n className,\n )}\n {...props}\n >\n {children}\n \n \n \n \n );\n});\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\n\nconst AnimatedSelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n selectedVariant: keyof typeof selectAnimationVariants;\n }\n>(\n (\n { className, children, position = \"popper\", selectedVariant, ...props },\n ref,\n ) => (\n \n \n \n \n \n {children}\n \n \n \n \n \n ),\n);\nAnimatedSelectContent.displayName = SelectPrimitive.Content.displayName;\n\n\nconst StaticSelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n \n \n \n \n {children}\n \n \n \n \n));\nStaticSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & {\n variants?: keyof typeof selectAnimationVariants;\n }\n>((props, ref) => {\n const { animation } = useRuru();\n const selectedVariant = props.variants || \"zoom\";\n\n return animation ? (\n \n ) : (\n \n );\n});\n\nSelectContent.displayName = \"SelectContent\";\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n \n \n \n \n {children}\n \n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n" ->>>>>>> Stashed changes } ], "type": "components:ui"