diff --git a/components.json b/components.json index e974414..5dd1250 100644 --- a/components.json +++ b/components.json @@ -7,7 +7,7 @@ "config": "tailwind.config.js", "css": "src/styles/globals.css", "baseColor": "gray", - "cssVariables": false, + "cssVariables": true, "prefix": "" }, "aliases": { diff --git a/package.json b/package.json index 1a2fd34..754ebe0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ }, "dependencies": { "@hookform/resolvers": "^3.3.4", + "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-icons": "^1.3.0", + "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-slot": "^1.0.2", "@reduxjs/toolkit": "^2.1.0", "@tanstack/react-query": "^5.18.1", @@ -24,7 +26,8 @@ "react-redux": "^9.1.0", "tailwind-merge": "^2.2.1", "tailwindcss-animate": "^1.0.7", - "yup": "^1.3.3" + "yup": "^1.3.3", + "zod": "^3.22.4" }, "devDependencies": { "autoprefixer": "^10.4.17", diff --git a/public/assets/images/auth-layout-image.jpg b/public/assets/images/auth-layout-image.jpg new file mode 100644 index 0000000..1020b31 Binary files /dev/null and b/public/assets/images/auth-layout-image.jpg differ diff --git a/src/components/ui/button.jsx b/src/components/ui/button.jsx index d7a8601..61fbd6f 100644 --- a/src/components/ui/button.jsx +++ b/src/components/ui/button.jsx @@ -5,20 +5,20 @@ import { cva } from "class-variance-authority"; import { cn } from "@/src/lib/utils" const buttonVariants = cva( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950 disabled:pointer-events-none disabled:opacity-50 dark:focus-visible:ring-gray-300", + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { default: - "bg-gray-900 text-gray-50 shadow hover:bg-gray-900/90 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/90", + "bg-primary text-primary-foreground shadow hover:bg-primary/90", destructive: - "bg-red-500 text-gray-50 shadow-sm hover:bg-red-500/90 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/90", + "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", outline: - "border border-gray-200 bg-white shadow-sm hover:bg-gray-100 hover:text-gray-900 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-800 dark:hover:text-gray-50", + "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", secondary: - "bg-gray-100 text-gray-900 shadow-sm hover:bg-gray-100/80 dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-800/80", - ghost: "hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-50", - link: "text-gray-900 underline-offset-4 hover:underline dark:text-gray-50", + "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "text-primary underline-offset-4 hover:underline", }, size: { default: "h-9 px-4 py-2", diff --git a/src/components/ui/checkbox.jsx b/src/components/ui/checkbox.jsx new file mode 100644 index 0000000..08a42b1 --- /dev/null +++ b/src/components/ui/checkbox.jsx @@ -0,0 +1,22 @@ +import * as React from "react" +import * as CheckboxPrimitive from "@radix-ui/react-checkbox" +import { CheckIcon } from "@radix-ui/react-icons" + +import { cn } from "@/src/lib/utils" + +const Checkbox = React.forwardRef(({ className, ...props }, ref) => ( + + + + + +)) +Checkbox.displayName = CheckboxPrimitive.Root.displayName + +export { Checkbox } diff --git a/src/components/ui/form.jsx b/src/components/ui/form.jsx new file mode 100644 index 0000000..c8deaa0 --- /dev/null +++ b/src/components/ui/form.jsx @@ -0,0 +1,133 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { Controller, FormProvider, useFormContext } from "react-hook-form"; + +import { cn } from "@/src/lib/utils" +import { Label } from "@/src/components/ui/label" + +const Form = FormProvider + +const FormFieldContext = React.createContext({}) + +const FormField = ( + { + ...props + } +) => { + return ( + ( + + ) + ); +} + +const useFormField = () => { + const fieldContext = React.useContext(FormFieldContext) + const itemContext = React.useContext(FormItemContext) + const { getFieldState, formState } = useFormContext() + + const fieldState = getFieldState(fieldContext.name, formState) + + if (!fieldContext) { + throw new Error("useFormField should be used within ") + } + + const { id } = itemContext + + return { + id, + name: fieldContext.name, + formItemId: `${id}-form-item`, + formDescriptionId: `${id}-form-item-description`, + formMessageId: `${id}-form-item-message`, + ...fieldState, + } +} + +const FormItemContext = React.createContext({}) + +const FormItem = React.forwardRef(({ className, ...props }, ref) => { + const id = React.useId() + + return ( + ( +
+ ) + ); +}) +FormItem.displayName = "FormItem" + +const FormLabel = React.forwardRef(({ className, ...props }, ref) => { + const { error, formItemId } = useFormField() + + return ( + (