diff --git a/docs/pages/joy-poc.tsx b/docs/pages/joy-poc.tsx new file mode 100644 index 000000000000..ac58d9892317 --- /dev/null +++ b/docs/pages/joy-poc.tsx @@ -0,0 +1,152 @@ +import * as React from 'react'; +import { deepmerge } from '@mui/utils'; +import { DataGridPro, GRID_CHECKBOX_SELECTION_FIELD, GridToolbar } from '@mui/x-data-grid-pro'; +import { useDemoData } from '@mui/x-data-grid-generator'; +import { experimental_extendTheme as extendMuiTheme, styled } from '@mui/material/styles'; +import { CssVarsProvider, extendTheme as extendJoyTheme, useColorScheme } from '@mui/joy/styles'; +import Button from '@mui/joy/Button'; +import IconButton from '@mui/joy/IconButton'; +import Checkbox from '@mui/joy/Checkbox'; +import FormControl from '@mui/joy/FormControl'; +import FormLabel from '@mui/joy/FormLabel'; +import Input from '@mui/joy/Input'; +import Select from '@mui/joy/Select'; +import DarkMode from '@mui/icons-material/DarkMode'; +import LightMode from '@mui/icons-material/LightMode'; +import { BaseTextFieldSlotProps } from '@mui/x-data-grid'; + +const muiTheme = extendMuiTheme(); +const joyTheme = extendJoyTheme({ + cssVarPrefix: 'mui', +}); +const theme = deepmerge(joyTheme, muiTheme); + +const StyledBox = styled('div')({ + display: 'flex', + flexDirection: 'column', + height: 600, + width: '100%', + marginTop: '4rem', + '& .MuiFormGroup-options': { + alignItems: 'center', + paddingBottom: theme.spacing(1), + '& > div': { + minWidth: 100, + margin: theme.spacing(2), + marginLeft: 0, + }, + }, +}); + +const ModeToggle = () => { + const { mode, setMode } = useColorScheme(); + const [mounted, setMounted] = React.useState(false); + React.useEffect(() => { + setMounted(true); + }, []); + if (!mounted) { + return null; + } + return ( + setMode(mode === 'dark' ? 'light' : 'dark')} + sx={{ position: 'fixed', top: '1rem', right: '1rem' }} + > + {mode === 'dark' ? : } + + ); +}; + +const TextFieldAdapter = React.forwardRef( + ( + { + label, + children, + fullWidth, + id, + type, + InputLabelProps, + InputProps, + // SelectProps, + inputRef, + onChange, + placeholder, + select, + value, + variant = 'outlined', + }, + ref, + ) => { + const variantMapping = { + standard: 'soft', + outlined: 'outlined', + } as const; + return ( + + {label && {label}} + {select ? ( + // @ts-ignore + + ) : ( + + )} + + ); + }, +); + +export default function Playground() { + const { loading, data } = useDemoData({ + dataSet: 'Commodity', + rowLength: 100, + maxColumns: 40, + editable: true, + }); + return ( + + + + + + + ); +}