diff --git a/frontends/nextjs/src/components/molecules/form/SearchBar.tsx b/frontends/nextjs/src/components/molecules/form/SearchBar.tsx index f7a97ff9a..8466eb546 100644 --- a/frontends/nextjs/src/components/molecules/form/SearchBar.tsx +++ b/frontends/nextjs/src/components/molecules/form/SearchBar.tsx @@ -1,10 +1,12 @@ 'use client' -import { Box, IconButton, InputAdornment, TextField } from '@mui/material' import { forwardRef, ReactNode } from 'react' +import { Box, IconButton, TextField } from '@/fakemui' import { Clear, FilterList, Search } from '@/fakemui/icons' +import styles from './SearchBar.module.scss' + export interface SearchBarProps { value?: string onChange?: (value: string) => void @@ -34,6 +36,7 @@ const SearchBar = forwardRef( disabled = false, loading = false, endAdornment, + className, ...props }, ref @@ -49,65 +52,42 @@ const SearchBar = forwardRef( return ( - - - ), - endAdornment: ( - - - {showClearButton && value && !disabled && ( - - - - )} - {showFilterButton && ( - - - - )} - {endAdornment} - - - ), - }, - }} - sx={{ - '& .MuiOutlinedInput-root': { - borderRadius: 2, - bgcolor: 'background.paper', - transition: 'box-shadow 0.2s', - '&:hover': { - boxShadow: 1, - }, - '&.Mui-focused': { - boxShadow: 2, - }, - }, - }} + className={`${styles.searchBar} ${className || ''}`} + startAdornment={ + + } + endAdornment={ + + {showClearButton && value && !disabled && ( + + + + )} + {showFilterButton && ( + + + + )} + {endAdornment} + + } {...props} /> ) diff --git a/frontends/nextjs/src/components/molecules/form/Select.tsx b/frontends/nextjs/src/components/molecules/form/Select.tsx index 433609468..d449366df 100644 --- a/frontends/nextjs/src/components/molecules/form/Select.tsx +++ b/frontends/nextjs/src/components/molecules/form/Select.tsx @@ -1,14 +1,8 @@ 'use client' -import { - FormControl, - FormHelperText, - InputLabel, - Select as MuiSelect, - SelectProps as MuiSelectProps, -} from '@mui/material' -import { forwardRef, ReactNode } from 'react' +import { forwardRef, ReactNode, SelectHTMLAttributes } from 'react' +import { Box, FormControl, FormHelperText, FormLabel, Select as FakeMuiSelect } from '@/fakemui' import { KeyboardArrowDown } from '@/fakemui/icons' import { SelectContent } from './SelectContent' @@ -20,12 +14,17 @@ import { SelectSeparator } from './SelectSeparator' import { SelectTrigger } from './SelectTrigger' import { SelectValue } from './SelectValue' -export interface SelectProps extends Omit, 'onChange'> { +import styles from './Select.module.scss' + +export interface SelectProps extends Omit, 'onChange'> { onValueChange?: (value: string) => void helperText?: ReactNode + label?: ReactNode + error?: boolean + fullWidth?: boolean } -const Select = forwardRef( +const Select = forwardRef( ( { onValueChange, @@ -35,27 +34,30 @@ const Select = forwardRef( error, helperText, children, - sx, - variant = 'outlined', + className, + fullWidth = true, ...props }, ref ) => { return ( - - {label && {label}} - - value={value} - defaultValue={defaultValue} - label={label} - variant={variant} - onChange={e => onValueChange?.(e.target.value as string)} - IconComponent={KeyboardArrowDownIcon} - {...props} - > - {children} - - {helperText && {helperText}} + + {label && {label}} + + onValueChange?.(e.target.value)} + error={error} + className={styles.select} + {...props} + > + {children} + + + + {helperText && {helperText}} ) }