From 0c4ff5fc8ce9c443fc2c8f83f3af770d5568b1fe Mon Sep 17 00:00:00 2001 From: Richard Ward Date: Tue, 30 Dec 2025 17:55:45 +0000 Subject: [PATCH] code: tsx,nextjs,frontends (2 files) --- .../ui/organisms/dialogs/AlertDialog.tsx | 17 ++++--- .../ui/organisms/dialogs/Sheet/Drawer.tsx | 50 +++++++------------ 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/frontends/nextjs/src/components/ui/organisms/dialogs/AlertDialog.tsx b/frontends/nextjs/src/components/ui/organisms/dialogs/AlertDialog.tsx index 4c3c5fcdd..ad11aa73c 100644 --- a/frontends/nextjs/src/components/ui/organisms/dialogs/AlertDialog.tsx +++ b/frontends/nextjs/src/components/ui/organisms/dialogs/AlertDialog.tsx @@ -1,6 +1,6 @@ 'use client' -import { Dialog } from '@mui/material' +import { Dialog, DialogPanel } from '@/fakemui/fakemui/utils' import { forwardRef, ReactNode } from 'react' import { AlertDialogAction, AlertDialogCancel, AlertDialogFooter } from './alert/Actions' @@ -10,6 +10,7 @@ import { AlertDialogHeader, AlertDialogTitle, } from './alert/Content' +import styles from './AlertDialog.module.scss' interface AlertDialogProps { open: boolean @@ -28,16 +29,20 @@ const AlertDialog = forwardRef( } return ( - {children} + + {children} + ) } @@ -53,7 +58,7 @@ interface AlertDialogTriggerProps { const AlertDialogTrigger = forwardRef( ({ children, onClick, asChild, ...props }, ref) => { return ( - + {children} ) diff --git a/frontends/nextjs/src/components/ui/organisms/dialogs/Sheet/Drawer.tsx b/frontends/nextjs/src/components/ui/organisms/dialogs/Sheet/Drawer.tsx index 557798351..16589b9c8 100644 --- a/frontends/nextjs/src/components/ui/organisms/dialogs/Sheet/Drawer.tsx +++ b/frontends/nextjs/src/components/ui/organisms/dialogs/Sheet/Drawer.tsx @@ -1,28 +1,29 @@ 'use client' import { Close as CloseIcon } from '@/fakemui/icons' -import { Box, Drawer, DrawerProps, IconButton } from '@mui/material' -import { forwardRef, ReactNode, SyntheticEvent } from 'react' +import { Box } from '@/fakemui/fakemui/layout' +import { Drawer } from '@/fakemui/fakemui/surfaces' +import { IconButton } from '@/fakemui/fakemui/inputs' +import { forwardRef, ReactNode } from 'react' -interface SheetProps extends Omit { +import styles from './Drawer.module.scss' + +interface SheetProps { children: ReactNode side?: 'left' | 'right' | 'top' | 'bottom' + open?: boolean + onClose?: () => void onOpenChange?: (open: boolean) => void } const Sheet = forwardRef( ({ children, side = 'right', open, onClose, onOpenChange, ...props }, ref) => { - const handleClose = ( - _event: SyntheticEvent | object, - reason: 'backdropClick' | 'escapeKeyDown' - ) => { - if (typeof onClose === 'function') { - onClose(_event, reason) - } + const handleClose = () => { + onClose?.() onOpenChange?.(false) } return ( - + {children} ) @@ -39,7 +40,7 @@ interface SheetTriggerProps { const SheetTrigger = forwardRef( ({ children, onClick, asChild, ...props }, ref) => { return ( - + {children} ) @@ -56,35 +57,22 @@ interface SheetContentProps { } const SheetContent = forwardRef( - ({ children, side = 'right', onClose, showCloseButton = true, ...props }, ref) => { + ({ children, side = 'right', onClose, showCloseButton = true, className, ...props }, ref) => { const isHorizontal = side === 'left' || side === 'right' return ( {showCloseButton && ( - + )} {children} @@ -103,7 +91,7 @@ interface SheetCloseProps { const SheetClose = forwardRef( ({ children, onClick, ...props }, ref) => { return ( - + {children} )