diff --git a/frontends/nextjs/src/components/managers/component/ComponentCatalog.tsx b/frontends/nextjs/src/components/managers/component/ComponentCatalog.tsx index 5004197eb..44b29d24d 100644 --- a/frontends/nextjs/src/components/managers/component/ComponentCatalog.tsx +++ b/frontends/nextjs/src/components/managers/component/ComponentCatalog.tsx @@ -1,6 +1,6 @@ -import { Box, Card, InputAdornment, Stack, TextField, Typography } from '@mui/material' import { useState } from 'react' +import { Box, Card, Stack, TextField, Typography } from '@/fakemui' import { Search } from '@/fakemui/icons' import { getComponentIcon } from '@/components/get-component-icon' @@ -23,39 +23,22 @@ export function ComponentCatalog({ onDragStart }: ComponentCatalogProps) { const categories = Array.from(new Set(componentCatalog.map(c => c.category))) return ( - theme.custom.sidebar.width, - bgcolor: 'background.paper', - color: 'text.primary', - display: 'flex', - flexDirection: 'column', - borderRight: 1, - borderColor: 'divider', - height: '100vh', - }} - > - - + + + Components - setSearchTerm(e.target.value)} - size="small" - fullWidth - InputProps={{ - startAdornment: ( - - - - ), - }} - /> +
+ + setSearchTerm(e.target.value)} + /> +
- + {categories.map(category => { const categoryComponents = filteredComponents.filter(c => c.category === category) @@ -63,55 +46,22 @@ export function ComponentCatalog({ onDragStart }: ComponentCatalogProps) { return ( - + {category} - + {categoryComponents.map(component => ( onDragStart(component)} - sx={{ - p: 1.5, - cursor: 'grab', - '&:active': { cursor: 'grabbing' }, - transition: - 'border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease', - '&:hover': { - borderColor: 'primary.main', - boxShadow: 3, - transform: 'translateY(-1px)', - }, - }} + className="component-catalog__card" > - - - {getComponentIcon(component.icon, { sx: { fontSize: 20 } })} + + + {getComponentIcon(component.icon, { className: 'icon-sm' })} - + {component.label} diff --git a/frontends/nextjs/src/components/molecules/overlay/DropdownMenu.tsx b/frontends/nextjs/src/components/molecules/overlay/DropdownMenu.tsx index d0cfc0c7e..435c3c151 100644 --- a/frontends/nextjs/src/components/molecules/overlay/DropdownMenu.tsx +++ b/frontends/nextjs/src/components/molecules/overlay/DropdownMenu.tsx @@ -1,21 +1,11 @@ 'use client' -import { - Box, - Divider, - ListItemIcon, - ListItemText, - Menu, - MenuItem, - MenuItemProps, - MenuProps, - Typography, -} from '@mui/material' import { forwardRef, MouseEvent as ReactMouseEvent, ReactNode } from 'react' +import { Box, Divider, ListItemIcon, ListItemText, Menu, MenuItem, Typography } from '@/fakemui' import { Check, ChevronRight } from '@/fakemui/icons' -// DropdownMenu (uses MUI Menu under the hood) +// DropdownMenu (uses FakeMUI Menu under the hood) export interface DropdownMenuProps { children: ReactNode open?: boolean @@ -40,7 +30,7 @@ const DropdownMenuTrigger = forwardRef {children} @@ -51,33 +41,25 @@ const DropdownMenuTrigger = forwardRef DropdownMenuTrigger.displayName = 'DropdownMenuTrigger' // DropdownMenuContent -export interface DropdownMenuContentProps extends Omit { +export interface DropdownMenuContentProps { + children?: ReactNode align?: 'start' | 'center' | 'end' side?: 'top' | 'right' | 'bottom' | 'left' sideOffset?: number + anchorEl?: HTMLElement | null + onClose?: () => void + className?: string } const DropdownMenuContent = forwardRef( - ({ children, align = 'start', side = 'bottom', anchorEl, onClose, ...props }, ref) => { - const anchorOrigin = { - vertical: side === 'top' ? 'top' : 'bottom', - horizontal: align === 'end' ? 'right' : align === 'center' ? 'center' : 'left', - } as const - + ({ children, align = 'start', side = 'bottom', anchorEl, onClose, className, ...props }, ref) => { return ( {children} @@ -88,30 +70,28 @@ const DropdownMenuContent = forwardRef DropdownMenuContent.displayName = 'DropdownMenuContent' // DropdownMenuItem -export interface DropdownMenuItemProps extends MenuItemProps { +export interface DropdownMenuItemProps { + children?: ReactNode inset?: boolean icon?: ReactNode shortcut?: string + onClick?: () => void + disabled?: boolean + className?: string } -const DropdownMenuItem = forwardRef( - ({ children, inset, icon, shortcut, sx, ...props }, ref) => { +const DropdownMenuItem = forwardRef( + ({ children, inset, icon, shortcut, className, ...props }, ref) => { return ( - {icon && {icon}} + {icon && {icon}} {children} {shortcut && ( - + {shortcut} )} @@ -122,22 +102,24 @@ const DropdownMenuItem = forwardRef( DropdownMenuItem.displayName = 'DropdownMenuItem' // DropdownMenuCheckboxItem -interface DropdownMenuCheckboxItemProps extends Omit { +interface DropdownMenuCheckboxItemProps { + children?: ReactNode checked?: boolean onCheckedChange?: (checked: boolean) => void + className?: string } -const DropdownMenuCheckboxItem = forwardRef( - ({ children, checked, onCheckedChange, ...props }, ref) => { +const DropdownMenuCheckboxItem = forwardRef( + ({ children, checked, onCheckedChange, className, ...props }, ref) => { return ( onCheckedChange?.(!checked)} - sx={{ py: 0.75, px: 2 }} + className={`dropdown-menu-checkbox-item ${className || ''}`} {...props} > - - {checked && } + + {checked && } {children} @@ -150,18 +132,11 @@ DropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem' const DropdownMenuLabel = forwardRef< HTMLDivElement, { children: ReactNode; inset?: boolean; className?: string } ->(({ children, inset, ...props }, ref) => { +>(({ children, inset, className, ...props }, ref) => { return ( {children} @@ -171,15 +146,15 @@ const DropdownMenuLabel = forwardRef< DropdownMenuLabel.displayName = 'DropdownMenuLabel' // DropdownMenuSeparator -const DropdownMenuSeparator = forwardRef((props, ref) => { - return +const DropdownMenuSeparator = forwardRef((props, ref) => { + return }) DropdownMenuSeparator.displayName = 'DropdownMenuSeparator' // DropdownMenuShortcut const DropdownMenuShortcut = ({ children }: { children: ReactNode }) => { return ( - + {children} ) @@ -188,9 +163,9 @@ DropdownMenuShortcut.displayName = 'DropdownMenuShortcut' // DropdownMenuGroup const DropdownMenuGroup = forwardRef( - ({ children, ...props }, ref) => { + ({ children, className, ...props }, ref) => { return ( - + {children} ) @@ -204,13 +179,17 @@ DropdownMenuSub.displayName = 'DropdownMenuSub' // DropdownMenuSubTrigger const DropdownMenuSubTrigger = forwardRef< - HTMLLIElement, + HTMLButtonElement, { children: ReactNode; inset?: boolean; className?: string } ->(({ children, inset, ...props }, ref) => { +>(({ children, inset, className, ...props }, ref) => { return ( - + {children} - + ) }) @@ -220,9 +199,9 @@ DropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger' const DropdownMenuSubContent = forwardRef< HTMLDivElement, { children: ReactNode; className?: string } ->(({ children, ...props }, ref) => { +>(({ children, className, ...props }, ref) => { return ( - + {children} ) @@ -242,9 +221,9 @@ const DropdownMenuRadioGroup = forwardRef< onValueChange?: (value: string) => void className?: string } ->(({ children, ...props }, ref) => { +>(({ children, className, ...props }, ref) => { return ( - + {children} ) @@ -253,13 +232,13 @@ DropdownMenuRadioGroup.displayName = 'DropdownMenuRadioGroup' // DropdownMenuRadioItem const DropdownMenuRadioItem = forwardRef< - HTMLLIElement, + HTMLButtonElement, { children: ReactNode; value: string; className?: string } ->(({ children, value, ...props }, ref) => { +>(({ children, value, className, ...props }, ref) => { return ( - - - + + + {children} diff --git a/frontends/nextjs/src/components/molecules/overlay/Popover.tsx b/frontends/nextjs/src/components/molecules/overlay/Popover.tsx index 9dfa025bb..b4ed7ba5e 100644 --- a/frontends/nextjs/src/components/molecules/overlay/Popover.tsx +++ b/frontends/nextjs/src/components/molecules/overlay/Popover.tsx @@ -1,8 +1,9 @@ 'use client' -import { Box, Popover as MuiPopover, PopoverProps as MuiPopoverProps } from '@mui/material' import { forwardRef, ReactNode } from 'react' +import { Box, Popover as FakeMuiPopover } from '@/fakemui' + // Popover container export interface PopoverProps { children: ReactNode @@ -28,7 +29,7 @@ const PopoverTrigger = forwardRef( {children} @@ -39,15 +40,19 @@ const PopoverTrigger = forwardRef( PopoverTrigger.displayName = 'PopoverTrigger' // PopoverContent -export interface PopoverContentProps extends Omit { +export interface PopoverContentProps { + children?: ReactNode align?: 'start' | 'center' | 'end' side?: 'top' | 'right' | 'bottom' | 'left' sideOffset?: number + anchorEl?: HTMLElement | null + onClose?: () => void + className?: string } const PopoverContent = forwardRef( ( - { children, align = 'center', side = 'bottom', sideOffset = 4, anchorEl, onClose, ...props }, + { children, align = 'center', side = 'bottom', sideOffset = 4, anchorEl, onClose, className, ...props }, ref ) => { const anchorOrigin = { @@ -56,7 +61,7 @@ const PopoverContent = forwardRef( } as const return ( - ( vertical: side === 'top' ? 'bottom' : 'top', horizontal: anchorOrigin.horizontal, }} - PaperProps={{ - sx: { - p: 2, - borderRadius: 1, - boxShadow: 3, - mt: sideOffset / 8, - }, - }} + className={`popover-content ${className || ''}`} {...props} > {children} - + ) } ) @@ -87,7 +85,7 @@ PopoverContent.displayName = 'PopoverContent' const PopoverAnchor = forwardRef( ({ children, ...props }, ref) => { return ( - + {children} ) diff --git a/frontends/nextjs/src/components/ui/organisms/dialogs/alert/Content.tsx b/frontends/nextjs/src/components/ui/organisms/dialogs/alert/Content.tsx index 9314c285d..6ff8a8488 100644 --- a/frontends/nextjs/src/components/ui/organisms/dialogs/alert/Content.tsx +++ b/frontends/nextjs/src/components/ui/organisms/dialogs/alert/Content.tsx @@ -1,5 +1,7 @@ 'use client' +import { forwardRef, ReactNode } from 'react' + import { CheckCircleOutline as CheckCircleOutlineIcon, Close as CloseIcon, @@ -7,14 +9,7 @@ import { InfoOutlined as InfoOutlinedIcon, WarningAmber as WarningAmberIcon, } from '@/fakemui/icons' -import { - DialogContent, - DialogContentText, - DialogTitle, - IconButton, - Typography, -} from '@mui/material' -import { forwardRef, ReactNode } from 'react' +import { DialogContent, DialogTitle, IconButton, Typography } from '@/fakemui' interface AlertDialogContentProps { children: ReactNode @@ -35,12 +30,8 @@ const AlertDialogContent = ({ {showCloseButton && onClose && ( @@ -77,14 +68,7 @@ const AlertDialogHeader = forwardRef( {iconElement} @@ -106,12 +90,8 @@ const AlertDialogTitle = forwardRef( {children} @@ -129,8 +109,10 @@ interface AlertDialogDescriptionProps { const AlertDialogDescription = forwardRef( ({ children, className, ...props }, ref) => { return ( - - {children} + + + {children} + ) } diff --git a/frontends/nextjs/src/components/workflow/editor/WorkflowNodeCard.tsx b/frontends/nextjs/src/components/workflow/editor/WorkflowNodeCard.tsx index c28035e02..84f8711e5 100644 --- a/frontends/nextjs/src/components/workflow/editor/WorkflowNodeCard.tsx +++ b/frontends/nextjs/src/components/workflow/editor/WorkflowNodeCard.tsx @@ -1,5 +1,4 @@ -import { Card, CardContent } from '@mui/material' - +import { Card, CardContent } from '@/fakemui' import { ArrowRight, Trash } from '@/fakemui/icons' import { @@ -141,14 +140,14 @@ export const WorkflowNodeCard = ({ {index < totalNodes - 1 && (
- + Next
)}