diff --git a/frontends/nextjs/src/components/molecules/form/Tabs.tsx b/frontends/nextjs/src/components/molecules/form/Tabs.tsx index 7d2094d32..6792a8751 100644 --- a/frontends/nextjs/src/components/molecules/form/Tabs.tsx +++ b/frontends/nextjs/src/components/molecules/form/Tabs.tsx @@ -1,51 +1,42 @@ 'use client' -import { - Box, - Tab as MuiTab, - TabProps as MuiTabProps, - Tabs as MuiTabs, - TabsProps as MuiTabsProps, -} from '@mui/material' -import { forwardRef } from 'react' +import { forwardRef, ButtonHTMLAttributes, HTMLAttributes } from 'react' + +import { Box, Tab as FakeMuiTab, Tabs as FakeMuiTabs, TabProps as FakeMuiTabProps } from '@/fakemui' + +import styles from './Tabs.module.scss' // Tabs container -export interface TabsProps extends Omit { +export interface TabsProps extends HTMLAttributes { defaultValue?: string + value?: string onValueChange?: (value: string) => void + variant?: 'standard' | 'scrollable' | 'fullWidth' } const Tabs = forwardRef( - ({ defaultValue, value, onValueChange, children, sx, ...props }, ref) => { + ({ defaultValue, value, onValueChange, children, className, variant, ...props }, ref) => { return ( - - + onValueChange?.(newValue)} - {...props} + variant={variant} + className={styles.tabs} > {children} - + ) } ) Tabs.displayName = 'Tabs' -// TabsList (wrapper for MUI Tabs - for shadcn compat) +// TabsList (wrapper for tabs - for shadcn compat) const TabsList = forwardRef( - ({ children, ...props }, ref) => { + ({ children, className, ...props }, ref) => { return ( - + {children} ) @@ -54,29 +45,21 @@ const TabsList = forwardRef { +export interface TabsTriggerProps extends Omit, 'value'> { value: string + label?: React.ReactNode + selected?: boolean } -const TabsTrigger = forwardRef( - ({ value, label, children, sx, ...props }, ref) => { +const TabsTrigger = forwardRef( + ({ value, label, children, className, selected, ...props }, ref) => { return ( - } + ) @@ -93,7 +76,7 @@ interface TabsContentProps { } const TabsContent = forwardRef( - ({ value, children, forceMount, ...props }, ref) => { + ({ value, children, forceMount, className, ...props }, ref) => { return ( ( hidden={!forceMount} id={`tabpanel-${value}`} aria-labelledby={`tab-${value}`} - sx={{ pt: 2 }} + className={`${styles.tabContent} ${className || ''}`} {...props} > {children}