diff --git a/amnet-web/src/components/am-card.tsx b/amnet-web/src/components/am-card.tsx index 045f3f7..895cae6 100644 --- a/amnet-web/src/components/am-card.tsx +++ b/amnet-web/src/components/am-card.tsx @@ -24,7 +24,7 @@ export function AMCard(props: AMCardActionProps & { title: string, titlePerforms {props.actionClicked && ( - )} diff --git a/amnet-web/src/components/am-header.tsx b/amnet-web/src/components/am-header.tsx index fcff32c..873bfff 100644 --- a/amnet-web/src/components/am-header.tsx +++ b/amnet-web/src/components/am-header.tsx @@ -5,7 +5,7 @@ export function AMHeader(props: { title: string, children?: Readonly
-

{props.title}

+

{props.title}

{props.children}
diff --git a/amnet-web/src/components/loading-indicator.tsx b/amnet-web/src/components/loading-indicator.tsx index 4fce56c..b152ee7 100644 --- a/amnet-web/src/components/loading-indicator.tsx +++ b/amnet-web/src/components/loading-indicator.tsx @@ -2,7 +2,7 @@ import {Loader} from "lucide-react"; export function LoadingIndicator() { return ( -
+
Loading...
diff --git a/amnet-web/src/components/ui/alert-dialog.tsx b/amnet-web/src/components/ui/alert-dialog.tsx index 8722561..c744f9c 100644 --- a/amnet-web/src/components/ui/alert-dialog.tsx +++ b/amnet-web/src/components/ui/alert-dialog.tsx @@ -10,37 +10,43 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger const AlertDialogPortal = AlertDialogPrimitive.Portal -const AlertDialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - & { + ref: React.RefObject>; + } +) => () +AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName + +const AlertDialogContent = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => ( + + -)) -AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName - -const AlertDialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - - -)) +) AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName const AlertDialogHeader = ({ @@ -71,57 +77,69 @@ const AlertDialogFooter = ({ ) AlertDialogFooter.displayName = "AlertDialogFooter" -const AlertDialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const AlertDialogTitle = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName -const AlertDialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const AlertDialogDescription = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName -const AlertDialogAction = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const AlertDialogAction = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName -const AlertDialogCancel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const AlertDialogCancel = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName export { diff --git a/amnet-web/src/components/ui/alert.tsx b/amnet-web/src/components/ui/alert.tsx index f853162..564886f 100644 --- a/amnet-web/src/components/ui/alert.tsx +++ b/amnet-web/src/components/ui/alert.tsx @@ -19,41 +19,49 @@ const alertVariants = cva( } ) -const Alert = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes & VariantProps ->(({ className, variant, ...props }, ref) => ( -
-)) +const Alert = ( + { + ref, + className, + variant, + ...props + } +) => (
) Alert.displayName = "Alert" -const AlertTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) +const AlertTitle = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref?: React.RefObject; + } +) => (
) AlertTitle.displayName = "AlertTitle" -const AlertDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) +const AlertDescription = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref?: React.RefObject; + } +) => (
) AlertDescription.displayName = "AlertDescription" export { Alert, AlertTitle, AlertDescription } diff --git a/amnet-web/src/components/ui/button.tsx b/amnet-web/src/components/ui/button.tsx index 0ba4277..4d19d71 100644 --- a/amnet-web/src/components/ui/button.tsx +++ b/amnet-web/src/components/ui/button.tsx @@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const buttonVariants = cva( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", { variants: { variant: { @@ -39,18 +39,27 @@ export interface ButtonProps asChild?: boolean } -const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button" - return ( - - ) +const Button = ( + { + ref, + className, + variant, + size, + asChild = false, + ...props + }: ButtonProps & { + ref?: React.RefObject; } -) +) => { + const Comp = asChild ? Slot : "button" + return ( + + ) +} Button.displayName = "Button" export { Button, buttonVariants } diff --git a/amnet-web/src/components/ui/card.tsx b/amnet-web/src/components/ui/card.tsx index afa13ec..2445422 100644 --- a/amnet-web/src/components/ui/card.tsx +++ b/amnet-web/src/components/ui/card.tsx @@ -2,78 +2,96 @@ import * as React from "react" import { cn } from "@/lib/utils" -const Card = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) +const Card = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref: React.RefObject; + } +) => (
) Card.displayName = "Card" -const CardHeader = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) +const CardHeader = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref: React.RefObject; + } +) => (
) CardHeader.displayName = "CardHeader" -const CardTitle = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) +const CardTitle = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref?: React.RefObject; + } +) => (

) CardTitle.displayName = "CardTitle" -const CardDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) +const CardDescription = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref?: React.RefObject; + } +) => (

) CardDescription.displayName = "CardDescription" -const CardContent = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -

-)) +const CardContent = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref: React.RefObject; + } +) => (
) CardContent.displayName = "CardContent" -const CardFooter = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => ( -
-)) +const CardFooter = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref: React.RefObject; + } +) => (
) CardFooter.displayName = "CardFooter" export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } diff --git a/amnet-web/src/components/ui/context-menu.tsx b/amnet-web/src/components/ui/context-menu.tsx index 3e52999..9c5f668 100644 --- a/amnet-web/src/components/ui/context-menu.tsx +++ b/amnet-web/src/components/ui/context-menu.tsx @@ -16,151 +16,170 @@ const ContextMenuSub = ContextMenuPrimitive.Sub const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup -const ContextMenuSubTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean +const ContextMenuSubTrigger = ( + { + ref, + className, + inset, + children, + ...props } ->(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) +) => ( + {children} + +) ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName -const ContextMenuSubContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const ContextMenuSubContent = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName -const ContextMenuContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - -)) -ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName - -const ContextMenuItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean +const ContextMenuContent = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; } ->(({ className, inset, ...props }, ref) => ( - ( + -)) +) +ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName + +const ContextMenuItem = ( + { + ref, + className, + inset, + ...props + } +) => () ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName -const ContextMenuCheckboxItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, checked, ...props }, ref) => ( - - - - - - - {children} - -)) +const ContextMenuCheckboxItem = ( + { + ref, + className, + children, + checked, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => ( + + + + + + {children} +) ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName -const ContextMenuRadioItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - - - - - - {children} - -)) +const ContextMenuRadioItem = ( + { + ref, + className, + children, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => ( + + + + + + {children} +) ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName -const ContextMenuLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean +const ContextMenuLabel = ( + { + ref, + className, + inset, + ...props } ->(({ className, inset, ...props }, ref) => ( - -)) +) => () ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName -const ContextMenuSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const ContextMenuSeparator = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName const ContextMenuShortcut = ({ diff --git a/amnet-web/src/components/ui/dialog.tsx b/amnet-web/src/components/ui/dialog.tsx index c23630e..65468c9 100644 --- a/amnet-web/src/components/ui/dialog.tsx +++ b/amnet-web/src/components/ui/dialog.tsx @@ -12,43 +12,50 @@ const DialogPortal = DialogPrimitive.Portal const DialogClose = DialogPrimitive.Close -const DialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - & { + ref: React.RefObject>; + } +) => () +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName + +const DialogContent = ( + { + ref, + className, + children, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => ( + + -)) -DialogOverlay.displayName = DialogPrimitive.Overlay.displayName - -const DialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - - - {children} - - - Close - - - -)) + > + {children} + + + Close + + +) DialogContent.displayName = DialogPrimitive.Content.displayName const DialogHeader = ({ @@ -79,31 +86,37 @@ const DialogFooter = ({ ) DialogFooter.displayName = "DialogFooter" -const DialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const DialogTitle = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () DialogTitle.displayName = DialogPrimitive.Title.displayName -const DialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const DialogDescription = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () DialogDescription.displayName = DialogPrimitive.Description.displayName export { diff --git a/amnet-web/src/components/ui/drawer.tsx b/amnet-web/src/components/ui/drawer.tsx index c17b0cc..9ca8224 100644 --- a/amnet-web/src/components/ui/drawer.tsx +++ b/amnet-web/src/components/ui/drawer.tsx @@ -20,37 +20,44 @@ const DrawerPortal = DrawerPrimitive.Portal const DrawerClose = DrawerPrimitive.Close -const DrawerOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const DrawerOverlay = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName -const DrawerContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - - -
- {children} - - -)) +const DrawerContent = ( + { + ref, + className, + children, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => ( + + +
+ {children} + +) DrawerContent.displayName = "DrawerContent" const DrawerHeader = ({ @@ -75,31 +82,37 @@ const DrawerFooter = ({ ) DrawerFooter.displayName = "DrawerFooter" -const DrawerTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const DrawerTitle = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () DrawerTitle.displayName = DrawerPrimitive.Title.displayName -const DrawerDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const DrawerDescription = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () DrawerDescription.displayName = DrawerPrimitive.Description.displayName export { diff --git a/amnet-web/src/components/ui/form.tsx b/amnet-web/src/components/ui/form.tsx index 4603f8b..d5bb07b 100644 --- a/amnet-web/src/components/ui/form.tsx +++ b/amnet-web/src/components/ui/form.tsx @@ -70,10 +70,15 @@ const FormItemContext = React.createContext( {} as FormItemContextValue ) -const FormItem = React.forwardRef< - HTMLDivElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => { +const FormItem = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref: React.RefObject; + } +) => { const id = React.useId() return ( @@ -81,13 +86,18 @@ const FormItem = React.forwardRef<
) -}) +} FormItem.displayName = "FormItem" -const FormLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => { +const FormLabel = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => { const { error, formItemId } = useFormField() return ( @@ -98,13 +108,17 @@ const FormLabel = React.forwardRef< {...props} /> ) -}) +} FormLabel.displayName = "FormLabel" -const FormControl = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ ...props }, ref) => { +const FormControl = ( + { + ref, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => { const { error, formItemId, formDescriptionId, formMessageId } = useFormField() return ( @@ -120,13 +134,18 @@ const FormControl = React.forwardRef< {...props} /> ) -}) +} FormControl.displayName = "FormControl" -const FormDescription = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, ...props }, ref) => { +const FormDescription = ( + { + ref, + className, + ...props + }: React.HTMLAttributes & { + ref?: React.RefObject; + } +) => { const { formDescriptionId } = useFormField() return ( @@ -137,13 +156,19 @@ const FormDescription = React.forwardRef< {...props} /> ) -}) +} FormDescription.displayName = "FormDescription" -const FormMessage = React.forwardRef< - HTMLParagraphElement, - React.HTMLAttributes ->(({ className, children, ...props }, ref) => { +const FormMessage = ( + { + ref, + className, + children, + ...props + }: React.HTMLAttributes & { + ref?: React.RefObject; + } +) => { const { error, formMessageId } = useFormField() const body = error ? String(error?.message) : children @@ -161,7 +186,7 @@ const FormMessage = React.forwardRef< {body}

) -}) +} FormMessage.displayName = "FormMessage" export { diff --git a/amnet-web/src/components/ui/input.tsx b/amnet-web/src/components/ui/input.tsx index 677d05f..90656f0 100644 --- a/amnet-web/src/components/ui/input.tsx +++ b/amnet-web/src/components/ui/input.tsx @@ -5,21 +5,28 @@ import { cn } from "@/lib/utils" export interface InputProps extends React.InputHTMLAttributes {} -const Input = React.forwardRef( - ({ className, type, ...props }, ref) => { - return ( - - ) +const Input = ( + { + ref, + className, + type, + ...props + }: InputProps & { + ref: React.RefObject; } -) +) => { + return ( + + ) +} Input.displayName = "Input" export { Input } diff --git a/amnet-web/src/components/ui/label.tsx b/amnet-web/src/components/ui/label.tsx index 683faa7..88156bb 100644 --- a/amnet-web/src/components/ui/label.tsx +++ b/amnet-web/src/components/ui/label.tsx @@ -8,17 +8,17 @@ const labelVariants = cva( "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" ) -const Label = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & - VariantProps ->(({ className, ...props }, ref) => ( - -)) +const Label = ( + { + ref, + className, + ...props + } +) => () Label.displayName = LabelPrimitive.Root.displayName export { Label } diff --git a/amnet-web/src/components/ui/separator.tsx b/amnet-web/src/components/ui/separator.tsx index 6d7f122..bffc41a 100644 --- a/amnet-web/src/components/ui/separator.tsx +++ b/amnet-web/src/components/ui/separator.tsx @@ -3,27 +3,27 @@ import * as SeparatorPrimitive from "@radix-ui/react-separator" import { cn } from "@/lib/utils" -const Separator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->( - ( - { className, orientation = "horizontal", decorative = true, ...props }, - ref - ) => ( - - ) -) +const Separator = ( + { + ref, + className, + orientation = "horizontal", + decorative = true, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () Separator.displayName = SeparatorPrimitive.Root.displayName export { Separator } diff --git a/amnet-web/src/components/ui/toast.tsx b/amnet-web/src/components/ui/toast.tsx index a822477..9452f9b 100644 --- a/amnet-web/src/components/ui/toast.tsx +++ b/amnet-web/src/components/ui/toast.tsx @@ -7,23 +7,26 @@ import { cn } from "@/lib/utils" const ToastProvider = ToastPrimitives.Provider -const ToastViewport = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const ToastViewport = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () ToastViewport.displayName = ToastPrimitives.Viewport.displayName const toastVariants = cva( - "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", + "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", { variants: { variant: { @@ -38,11 +41,14 @@ const toastVariants = cva( } ) -const Toast = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & - VariantProps ->(({ className, variant, ...props }, ref) => { +const Toast = ( + { + ref, + className, + variant, + ...props + } +) => { return ( ) -}) +} Toast.displayName = ToastPrimitives.Root.displayName -const ToastAction = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const ToastAction = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () ToastAction.displayName = ToastPrimitives.Action.displayName -const ToastClose = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - -)) +const ToastClose = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => ( + +) ToastClose.displayName = ToastPrimitives.Close.displayName -const ToastTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const ToastTitle = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () ToastTitle.displayName = ToastPrimitives.Title.displayName -const ToastDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) +const ToastDescription = ( + { + ref, + className, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () ToastDescription.displayName = ToastPrimitives.Description.displayName type ToastProps = React.ComponentPropsWithoutRef diff --git a/amnet-web/src/components/ui/tooltip.tsx b/amnet-web/src/components/ui/tooltip.tsx index e121f0a..07f18d4 100644 --- a/amnet-web/src/components/ui/tooltip.tsx +++ b/amnet-web/src/components/ui/tooltip.tsx @@ -9,20 +9,24 @@ const Tooltip = TooltipPrimitive.Root const TooltipTrigger = TooltipPrimitive.Trigger -const TooltipContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, sideOffset = 4, ...props }, ref) => ( - -)) +const TooltipContent = ( + { + ref, + className, + sideOffset = 4, + ...props + }: React.ComponentPropsWithoutRef & { + ref: React.RefObject>; + } +) => () TooltipContent.displayName = TooltipPrimitive.Content.displayName export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } diff --git a/amnet-web/src/main.tsx b/amnet-web/src/main.tsx index 9f406d4..200b85e 100644 --- a/amnet-web/src/main.tsx +++ b/amnet-web/src/main.tsx @@ -46,11 +46,17 @@ const router = createHashRouter([ } ]) -createRoot(document.getElementById('root')!).render( - +function App() { + return ( + ) +} + +createRoot(document.getElementById('root')!).render( + + , ) diff --git a/amnet-web/src/pages/card-in-screen.tsx b/amnet-web/src/pages/card-in-screen.tsx index 50e9e53..9d3204d 100644 --- a/amnet-web/src/pages/card-in-screen.tsx +++ b/amnet-web/src/pages/card-in-screen.tsx @@ -66,7 +66,7 @@ function CardList(props: { cards: ReadonlyArray | null, cardSelected: return (<>

{props.cards?.length ? "Cards" : "Additional Cards"}

- + @@ -187,7 +187,7 @@ function ServerCardInPage() { setServerReloadCounter(serverReloadCounter + 1)}/> {server && ( -
+
{selectedCard && (<>

{gameName ? `Play ${gameName}` : "Selected Card"}

@@ -197,7 +197,7 @@ function ServerCardInPage() { - -
+
{cards ? : }
diff --git a/amnet-web/src/pages/privacy.tsx b/amnet-web/src/pages/privacy.tsx index 7241758..4301803 100644 --- a/amnet-web/src/pages/privacy.tsx +++ b/amnet-web/src/pages/privacy.tsx @@ -19,7 +19,7 @@ function PrivacyPolicy() { -
+

Privacy

The AMNet card switcher collects and stores the following information locally (on-device):

    diff --git a/amnet-web/src/pages/server-listing.tsx b/amnet-web/src/pages/server-listing.tsx index 2e050f0..57f94cb 100644 --- a/amnet-web/src/pages/server-listing.tsx +++ b/amnet-web/src/pages/server-listing.tsx @@ -43,7 +43,7 @@ function ServerListing() { -
    +
    @@ -172,7 +172,7 @@ function ServerAddForm() { control={form.control} name="address" render={({field}) => ( - +