From 8fe9074eadf0e1856ee114c731682f9b13b6f1d8 Mon Sep 17 00:00:00 2001 From: DaKheera47 Date: Thu, 22 Jan 2026 20:04:21 +0000 Subject: [PATCH] nice looking components --- .../src/client/components/OnboardingGate.tsx | 56 ++-- orchestrator/src/components/ui/field.tsx | 244 ++++++++++++++++++ orchestrator/src/components/ui/label.tsx | 26 ++ .../src/components/ui/radio-group.tsx | 42 +++ 4 files changed, 340 insertions(+), 28 deletions(-) create mode 100644 orchestrator/src/components/ui/field.tsx create mode 100644 orchestrator/src/components/ui/label.tsx create mode 100644 orchestrator/src/components/ui/radio-group.tsx diff --git a/orchestrator/src/client/components/OnboardingGate.tsx b/orchestrator/src/client/components/OnboardingGate.tsx index 1e8c846..3a5a863 100644 --- a/orchestrator/src/client/components/OnboardingGate.tsx +++ b/orchestrator/src/client/components/OnboardingGate.tsx @@ -4,6 +4,7 @@ import { toast } from "sonner" import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog" import { Button } from "@/components/ui/button" +import { Field, FieldContent, FieldDescription, FieldLabel, FieldTitle } from "@/components/ui/field" import { Input } from "@/components/ui/input" import { Progress } from "@/components/ui/progress" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" @@ -248,8 +249,6 @@ export const OnboardingGate: React.FC = () => { event.preventDefault()} - onPointerDownOutside={(event) => event.preventDefault()} - onInteractOutside={(event) => event.preventDefault()} >
@@ -260,40 +259,41 @@ export const OnboardingGate: React.FC = () => { - + {steps.map((step, index) => { const isActive = step.id === currentStep const isComplete = step.complete return ( - -
- + + + {step.label} + {step.subtitle} + + - {isComplete ? : index + 1} - - - {step.label} - -
- {step.subtitle} -
+ )} + > + {isComplete ? : index + 1} + + + + ) })}
diff --git a/orchestrator/src/components/ui/field.tsx b/orchestrator/src/components/ui/field.tsx new file mode 100644 index 0000000..0a276fc --- /dev/null +++ b/orchestrator/src/components/ui/field.tsx @@ -0,0 +1,244 @@ +"use client" + +import { useMemo } from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" +import { Label } from "@/components/ui/label" +import { Separator } from "@/components/ui/separator" + +function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) { + return ( +
[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", + className + )} + {...props} + /> + ) +} + +function FieldLegend({ + className, + variant = "legend", + ...props +}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) { + return ( + + ) +} + +function FieldGroup({ className, ...props }: React.ComponentProps<"div">) { + return ( +
[data-slot=field-group]]:gap-4", + className + )} + {...props} + /> + ) +} + +const fieldVariants = cva( + "group/field data-[invalid=true]:text-destructive flex w-full gap-3", + { + variants: { + orientation: { + vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"], + horizontal: [ + "flex-row items-center", + "[&>[data-slot=field-label]]:flex-auto", + "has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start", + ], + responsive: [ + "@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto", + "@md/field-group:[&>[data-slot=field-label]]:flex-auto", + "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px", + ], + }, + }, + defaultVariants: { + orientation: "vertical", + }, + } +) + +function Field({ + className, + orientation = "vertical", + ...props +}: React.ComponentProps<"div"> & VariantProps) { + return ( +
+ ) +} + +function FieldContent({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ) +} + +function FieldLabel({ + className, + ...props +}: React.ComponentProps) { + return ( +