diff --git a/docs/data/material/getting-started/templates/dashboard/Chart.js b/docs/data/material/getting-started/templates/dashboard/Chart.js deleted file mode 100644 index fbacebefa328ea..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Chart.js +++ /dev/null @@ -1,77 +0,0 @@ -import * as React from 'react'; -import { useTheme } from '@mui/material/styles'; -import { LineChart, axisClasses } from '@mui/x-charts'; - -import Title from './Title'; - -// Generate Sales Data -function createData(time, amount) { - return { time, amount: amount ?? null }; -} - -const data = [ - createData('00:00', 0), - createData('03:00', 300), - createData('06:00', 600), - createData('09:00', 800), - createData('12:00', 1500), - createData('15:00', 2000), - createData('18:00', 2400), - createData('21:00', 2400), - createData('24:00'), -]; - -export default function Chart() { - const theme = useTheme(); - - return ( - - Today -
- -
-
- ); -} diff --git a/docs/data/material/getting-started/templates/dashboard/Chart.tsx b/docs/data/material/getting-started/templates/dashboard/Chart.tsx deleted file mode 100644 index 0897a67f0c1cb9..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Chart.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import * as React from 'react'; -import { useTheme } from '@mui/material/styles'; -import { LineChart, axisClasses } from '@mui/x-charts'; -import { ChartsTextStyle } from '@mui/x-charts/ChartsText'; -import Title from './Title'; - -// Generate Sales Data -function createData( - time: string, - amount?: number, -): { time: string; amount: number | null } { - return { time, amount: amount ?? null }; -} - -const data = [ - createData('00:00', 0), - createData('03:00', 300), - createData('06:00', 600), - createData('09:00', 800), - createData('12:00', 1500), - createData('15:00', 2000), - createData('18:00', 2400), - createData('21:00', 2400), - createData('24:00'), -]; - -export default function Chart() { - const theme = useTheme(); - - return ( - - Today -
- -
-
- ); -} diff --git a/docs/data/material/getting-started/templates/dashboard/Dashboard.js b/docs/data/material/getting-started/templates/dashboard/Dashboard.js index 0c8503667b3f30..c311599af0a6dd 100644 --- a/docs/data/material/getting-started/templates/dashboard/Dashboard.js +++ b/docs/data/material/getting-started/templates/dashboard/Dashboard.js @@ -1,204 +1,63 @@ import * as React from 'react'; -import { styled, createTheme, ThemeProvider } from '@mui/material/styles'; + +import { createTheme, ThemeProvider } from '@mui/material/styles'; import CssBaseline from '@mui/material/CssBaseline'; -import MuiDrawer from '@mui/material/Drawer'; import Box from '@mui/material/Box'; -import MuiAppBar from '@mui/material/AppBar'; -import Toolbar from '@mui/material/Toolbar'; -import List from '@mui/material/List'; -import Typography from '@mui/material/Typography'; -import Divider from '@mui/material/Divider'; -import IconButton from '@mui/material/IconButton'; -import Badge from '@mui/material/Badge'; import Container from '@mui/material/Container'; -import Grid from '@mui/material/Grid'; -import Paper from '@mui/material/Paper'; -import Link from '@mui/material/Link'; -import MenuIcon from '@mui/icons-material/Menu'; -import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; -import NotificationsIcon from '@mui/icons-material/Notifications'; -import { mainListItems, secondaryListItems } from './listItems'; -import Chart from './Chart'; -import Deposits from './Deposits'; -import Orders from './Orders'; - -function Copyright(props) { - return ( - - {'Copyright © '} - - Your Website - {' '} - {new Date().getFullYear()} - {'.'} - - ); -} - -const drawerWidth = 240; +import getDashboardTheme from './getDashboardTheme'; +import ToggleCustomTheme from './internals/components/ToggleCustomTheme'; +import Copyright from './internals/components/Copyright'; +import Navbar from './components/Navbar'; +import Header from './components/Header'; +import MainGrid from './components/MainGrid'; -const AppBar = styled(MuiAppBar, { - shouldForwardProp: (prop) => prop !== 'open', -})(({ theme, open }) => ({ - zIndex: theme.zIndex.drawer + 1, - transition: theme.transitions.create(['width', 'margin'], { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen, - }), - ...(open && { - marginLeft: drawerWidth, - width: `calc(100% - ${drawerWidth}px)`, - transition: theme.transitions.create(['width', 'margin'], { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.enteringScreen, - }), - }), -})); - -const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== 'open' })( - ({ theme, open }) => ({ - '& .MuiDrawer-paper': { - position: 'relative', - whiteSpace: 'nowrap', - width: drawerWidth, - transition: theme.transitions.create('width', { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.enteringScreen, - }), - boxSizing: 'border-box', - ...(!open && { - overflowX: 'hidden', - transition: theme.transitions.create('width', { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen, - }), - width: theme.spacing(7), - [theme.breakpoints.up('sm')]: { - width: theme.spacing(9), - }, - }), - }, - }), -); +export default function Dashboard() { + const [mode, setMode] = React.useState('light'); + const [showCustomTheme, setShowCustomTheme] = React.useState(true); + const dashboardTheme = createTheme(getDashboardTheme(mode)); + const defaultTheme = createTheme({ palette: { mode } }); -// TODO remove, this demo shouldn't need to reset the theme. -const defaultTheme = createTheme(); + const toggleColorMode = () => { + setMode((prev) => (prev === 'dark' ? 'light' : 'dark')); + }; -export default function Dashboard() { - const [open, setOpen] = React.useState(true); - const toggleDrawer = () => { - setOpen(!open); + const toggleCustomTheme = () => { + setShowCustomTheme((prev) => !prev); }; return ( - + + - - - - - - - - Dashboard - - - - - - - - - - - - - - - - - {mainListItems} - - {secondaryListItems} - - + - theme.palette.mode === 'light' - ? theme.palette.grey[100] - : theme.palette.grey[900], + backgroundColor: 'background.default', flexGrow: 1, height: '100vh', overflow: 'auto', }} > - - - - {/* Chart */} - - - - - - {/* Recent Deposits */} - - - - - - {/* Recent Orders */} - - - - - - - + {/* Main content */} + +
+ + + ); diff --git a/docs/data/material/getting-started/templates/dashboard/Dashboard.tsx b/docs/data/material/getting-started/templates/dashboard/Dashboard.tsx index 1e9e9023891160..9285b6a8e2a421 100644 --- a/docs/data/material/getting-started/templates/dashboard/Dashboard.tsx +++ b/docs/data/material/getting-started/templates/dashboard/Dashboard.tsx @@ -1,208 +1,63 @@ import * as React from 'react'; -import { styled, createTheme, ThemeProvider } from '@mui/material/styles'; +import { PaletteMode } from '@mui/material'; +import { createTheme, ThemeProvider } from '@mui/material/styles'; import CssBaseline from '@mui/material/CssBaseline'; -import MuiDrawer from '@mui/material/Drawer'; import Box from '@mui/material/Box'; -import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@mui/material/AppBar'; -import Toolbar from '@mui/material/Toolbar'; -import List from '@mui/material/List'; -import Typography from '@mui/material/Typography'; -import Divider from '@mui/material/Divider'; -import IconButton from '@mui/material/IconButton'; -import Badge from '@mui/material/Badge'; import Container from '@mui/material/Container'; -import Grid from '@mui/material/Grid'; -import Paper from '@mui/material/Paper'; -import Link from '@mui/material/Link'; -import MenuIcon from '@mui/icons-material/Menu'; -import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; -import NotificationsIcon from '@mui/icons-material/Notifications'; -import { mainListItems, secondaryListItems } from './listItems'; -import Chart from './Chart'; -import Deposits from './Deposits'; -import Orders from './Orders'; +import getDashboardTheme from './getDashboardTheme'; +import ToggleCustomTheme from './internals/components/ToggleCustomTheme'; +import Copyright from './internals/components/Copyright'; +import Navbar from './components/Navbar'; +import Header from './components/Header'; +import MainGrid from './components/MainGrid'; -function Copyright(props: any) { - return ( - - {'Copyright © '} - - Your Website - {' '} - {new Date().getFullYear()} - {'.'} - - ); -} - -const drawerWidth: number = 240; - -interface AppBarProps extends MuiAppBarProps { - open?: boolean; -} - -const AppBar = styled(MuiAppBar, { - shouldForwardProp: (prop) => prop !== 'open', -})(({ theme, open }) => ({ - zIndex: theme.zIndex.drawer + 1, - transition: theme.transitions.create(['width', 'margin'], { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen, - }), - ...(open && { - marginLeft: drawerWidth, - width: `calc(100% - ${drawerWidth}px)`, - transition: theme.transitions.create(['width', 'margin'], { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.enteringScreen, - }), - }), -})); - -const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== 'open' })( - ({ theme, open }) => ({ - '& .MuiDrawer-paper': { - position: 'relative', - whiteSpace: 'nowrap', - width: drawerWidth, - transition: theme.transitions.create('width', { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.enteringScreen, - }), - boxSizing: 'border-box', - ...(!open && { - overflowX: 'hidden', - transition: theme.transitions.create('width', { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen, - }), - width: theme.spacing(7), - [theme.breakpoints.up('sm')]: { - width: theme.spacing(9), - }, - }), - }, - }), -); +export default function Dashboard() { + const [mode, setMode] = React.useState('light'); + const [showCustomTheme, setShowCustomTheme] = React.useState(true); + const dashboardTheme = createTheme(getDashboardTheme(mode)); + const defaultTheme = createTheme({ palette: { mode } }); -// TODO remove, this demo shouldn't need to reset the theme. -const defaultTheme = createTheme(); + const toggleColorMode = () => { + setMode((prev) => (prev === 'dark' ? 'light' : 'dark')); + }; -export default function Dashboard() { - const [open, setOpen] = React.useState(true); - const toggleDrawer = () => { - setOpen(!open); + const toggleCustomTheme = () => { + setShowCustomTheme((prev) => !prev); }; return ( - + + - - - - - - - - Dashboard - - - - - - - - - - - - - - - - - {mainListItems} - - {secondaryListItems} - - + - theme.palette.mode === 'light' - ? theme.palette.grey[100] - : theme.palette.grey[900], + backgroundColor: 'background.default', flexGrow: 1, height: '100vh', overflow: 'auto', }} > - - - - {/* Chart */} - - - - - - {/* Recent Deposits */} - - - - - - {/* Recent Orders */} - - - - - - - + {/* Main content */} + +
+ + + ); diff --git a/docs/data/material/getting-started/templates/dashboard/Deposits.js b/docs/data/material/getting-started/templates/dashboard/Deposits.js deleted file mode 100644 index d99bf6eb69d128..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Deposits.js +++ /dev/null @@ -1,27 +0,0 @@ -import * as React from 'react'; -import Link from '@mui/material/Link'; -import Typography from '@mui/material/Typography'; -import Title from './Title'; - -function preventDefault(event) { - event.preventDefault(); -} - -export default function Deposits() { - return ( - - Recent Deposits - - $3,024.00 - - - on 15 March, 2019 - -
- - View balance - -
-
- ); -} diff --git a/docs/data/material/getting-started/templates/dashboard/Deposits.tsx b/docs/data/material/getting-started/templates/dashboard/Deposits.tsx deleted file mode 100644 index 0622041c26040f..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Deposits.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import * as React from 'react'; -import Link from '@mui/material/Link'; -import Typography from '@mui/material/Typography'; -import Title from './Title'; - -function preventDefault(event: React.MouseEvent) { - event.preventDefault(); -} - -export default function Deposits() { - return ( - - Recent Deposits - - $3,024.00 - - - on 15 March, 2019 - -
- - View balance - -
-
- ); -} diff --git a/docs/data/material/getting-started/templates/dashboard/Deposits.tsx.preview b/docs/data/material/getting-started/templates/dashboard/Deposits.tsx.preview deleted file mode 100644 index e7e01a7df11ec0..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Deposits.tsx.preview +++ /dev/null @@ -1,14 +0,0 @@ - - Recent Deposits - - $3,024.00 - - - on 15 March, 2019 - -
- - View balance - -
-
\ No newline at end of file diff --git a/docs/data/material/getting-started/templates/dashboard/Orders.js b/docs/data/material/getting-started/templates/dashboard/Orders.js deleted file mode 100644 index ef98995932640b..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Orders.js +++ /dev/null @@ -1,86 +0,0 @@ -import * as React from 'react'; -import Link from '@mui/material/Link'; -import Table from '@mui/material/Table'; -import TableBody from '@mui/material/TableBody'; -import TableCell from '@mui/material/TableCell'; -import TableHead from '@mui/material/TableHead'; -import TableRow from '@mui/material/TableRow'; -import Title from './Title'; - -// Generate Order Data -function createData(id, date, name, shipTo, paymentMethod, amount) { - return { id, date, name, shipTo, paymentMethod, amount }; -} - -const rows = [ - createData( - 0, - '16 Mar, 2019', - 'Elvis Presley', - 'Tupelo, MS', - 'VISA ⠀•••• 3719', - 312.44, - ), - createData( - 1, - '16 Mar, 2019', - 'Paul McCartney', - 'London, UK', - 'VISA ⠀•••• 2574', - 866.99, - ), - createData(2, '16 Mar, 2019', 'Tom Scholz', 'Boston, MA', 'MC ⠀•••• 1253', 100.81), - createData( - 3, - '16 Mar, 2019', - 'Michael Jackson', - 'Gary, IN', - 'AMEX ⠀•••• 2000', - 654.39, - ), - createData( - 4, - '15 Mar, 2019', - 'Bruce Springsteen', - 'Long Branch, NJ', - 'VISA ⠀•••• 5919', - 212.79, - ), -]; - -function preventDefault(event) { - event.preventDefault(); -} - -export default function Orders() { - return ( - - Recent Orders - - - - Date - Name - Ship To - Payment Method - Sale Amount - - - - {rows.map((row) => ( - - {row.date} - {row.name} - {row.shipTo} - {row.paymentMethod} - {`$${row.amount}`} - - ))} - -
- - See more orders - -
- ); -} diff --git a/docs/data/material/getting-started/templates/dashboard/Orders.tsx b/docs/data/material/getting-started/templates/dashboard/Orders.tsx deleted file mode 100644 index 77abe82a3490ef..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Orders.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import * as React from 'react'; -import Link from '@mui/material/Link'; -import Table from '@mui/material/Table'; -import TableBody from '@mui/material/TableBody'; -import TableCell from '@mui/material/TableCell'; -import TableHead from '@mui/material/TableHead'; -import TableRow from '@mui/material/TableRow'; -import Title from './Title'; - -// Generate Order Data -function createData( - id: number, - date: string, - name: string, - shipTo: string, - paymentMethod: string, - amount: number, -) { - return { id, date, name, shipTo, paymentMethod, amount }; -} - -const rows = [ - createData( - 0, - '16 Mar, 2019', - 'Elvis Presley', - 'Tupelo, MS', - 'VISA ⠀•••• 3719', - 312.44, - ), - createData( - 1, - '16 Mar, 2019', - 'Paul McCartney', - 'London, UK', - 'VISA ⠀•••• 2574', - 866.99, - ), - createData(2, '16 Mar, 2019', 'Tom Scholz', 'Boston, MA', 'MC ⠀•••• 1253', 100.81), - createData( - 3, - '16 Mar, 2019', - 'Michael Jackson', - 'Gary, IN', - 'AMEX ⠀•••• 2000', - 654.39, - ), - createData( - 4, - '15 Mar, 2019', - 'Bruce Springsteen', - 'Long Branch, NJ', - 'VISA ⠀•••• 5919', - 212.79, - ), -]; - -function preventDefault(event: React.MouseEvent) { - event.preventDefault(); -} - -export default function Orders() { - return ( - - Recent Orders - - - - Date - Name - Ship To - Payment Method - Sale Amount - - - - {rows.map((row) => ( - - {row.date} - {row.name} - {row.shipTo} - {row.paymentMethod} - {`$${row.amount}`} - - ))} - -
- - See more orders - -
- ); -} diff --git a/docs/data/material/getting-started/templates/dashboard/Title.js b/docs/data/material/getting-started/templates/dashboard/Title.js deleted file mode 100644 index d686a1ae8498da..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Title.js +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react'; -import PropTypes from 'prop-types'; -import Typography from '@mui/material/Typography'; - -function Title(props) { - return ( - - {props.children} - - ); -} - -Title.propTypes = { - children: PropTypes.node, -}; - -export default Title; diff --git a/docs/data/material/getting-started/templates/dashboard/Title.tsx b/docs/data/material/getting-started/templates/dashboard/Title.tsx deleted file mode 100644 index c060b0906caf65..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/Title.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import Typography from '@mui/material/Typography'; - -interface TitleProps { - children?: React.ReactNode; -} - -export default function Title(props: TitleProps) { - return ( - - {props.children} - - ); -} diff --git a/docs/data/material/getting-started/templates/dashboard/components/ChartUserByCountry.js b/docs/data/material/getting-started/templates/dashboard/components/ChartUserByCountry.js new file mode 100644 index 00000000000000..00446928c8b14b --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/ChartUserByCountry.js @@ -0,0 +1,171 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import { PieChart } from '@mui/x-charts/PieChart'; +import { useDrawingArea } from '@mui/x-charts/hooks'; +import { styled } from '@mui/material/styles'; +import Typography from '@mui/material/Typography'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress'; + +import { + IndiaFlag, + UsaFlag, + BrazilFlag, + GlobeFlag, +} from '../internals/components/CustomIcons'; + +const data = [ + { label: 'India', value: 50000 }, + { label: 'USA', value: 35000 }, + { label: 'Brazil', value: 10000 }, + { label: 'Other', value: 5000 }, +]; + +const countries = [ + { + name: 'India', + value: 50, + flag: , + color: 'hsl(220, 25%, 65%)', + }, + { + name: 'USA', + value: 35, + flag: , + color: 'hsl(220, 25%, 45%)', + }, + { + name: 'Brazil', + value: 10, + flag: , + color: 'hsl(220, 25%, 30%)', + }, + { + name: 'Other', + value: 5, + flag: , + color: 'hsl(220, 25%, 20%)', + }, +]; + +const StyledText = styled('text', { + shouldForwardProp: (prop) => prop !== 'variant', +})(({ theme, variant }) => ({ + textAnchor: 'middle', + dominantBaseline: 'central', + fill: theme.palette.text.secondary, + fontSize: + variant === 'primary' + ? theme.typography.h5.fontSize + : theme.typography.body2.fontSize, + fontWeight: + variant === 'primary' + ? theme.typography.h5.fontWeight + : theme.typography.body2.fontWeight, +})); + +function PieCenterLabel({ primaryText, secondaryText }) { + const { width, height, left, top } = useDrawingArea(); + const primaryY = top + height / 2 - 10; + const secondaryY = primaryY + 24; + + return ( + + + {primaryText} + + + {secondaryText} + + + ); +} + +PieCenterLabel.propTypes = { + primaryText: PropTypes.string.isRequired, + secondaryText: PropTypes.string.isRequired, +}; + +const colors = [ + 'hsl(220, 25%, 65%)', + 'hsl(220, 25%, 45%)', + 'hsl(220, 25%, 30%)', + 'hsl(220, 25%, 20%)', +]; + +export default function ChartUserByCountry() { + return ( + + + + Users by country + + + + + + + {countries.map((country, index) => ( + + {country.flag} + + + + {country.name} + + + {country.value}% + + + + + + ))} + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/ChartUserByCountry.tsx b/docs/data/material/getting-started/templates/dashboard/components/ChartUserByCountry.tsx new file mode 100644 index 00000000000000..5048ba82ec7e62 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/ChartUserByCountry.tsx @@ -0,0 +1,174 @@ +import * as React from 'react'; +import { PieChart } from '@mui/x-charts/PieChart'; +import { useDrawingArea } from '@mui/x-charts/hooks'; +import { styled } from '@mui/material/styles'; +import Typography from '@mui/material/Typography'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress'; + +import { + IndiaFlag, + UsaFlag, + BrazilFlag, + GlobeFlag, +} from '../internals/components/CustomIcons'; + +const data = [ + { label: 'India', value: 50000 }, + { label: 'USA', value: 35000 }, + { label: 'Brazil', value: 10000 }, + { label: 'Other', value: 5000 }, +]; + +const countries = [ + { + name: 'India', + value: 50, + flag: , + color: 'hsl(220, 25%, 65%)', + }, + { + name: 'USA', + value: 35, + flag: , + color: 'hsl(220, 25%, 45%)', + }, + { + name: 'Brazil', + value: 10, + flag: , + color: 'hsl(220, 25%, 30%)', + }, + { + name: 'Other', + value: 5, + flag: , + color: 'hsl(220, 25%, 20%)', + }, +]; + +interface StyledTextProps { + variant: 'primary' | 'secondary'; +} + +const StyledText = styled('text', { + shouldForwardProp: (prop) => prop !== 'variant', +})(({ theme, variant }) => ({ + textAnchor: 'middle', + dominantBaseline: 'central', + fill: theme.palette.text.secondary, + fontSize: + variant === 'primary' + ? theme.typography.h5.fontSize + : theme.typography.body2.fontSize, + fontWeight: + variant === 'primary' + ? theme.typography.h5.fontWeight + : theme.typography.body2.fontWeight, +})); + +interface PieCenterLabelProps { + primaryText: string; + secondaryText: string; +} + +function PieCenterLabel({ primaryText, secondaryText }: PieCenterLabelProps) { + const { width, height, left, top } = useDrawingArea(); + const primaryY = top + height / 2 - 10; + const secondaryY = primaryY + 24; + + return ( + + + {primaryText} + + + {secondaryText} + + + ); +} + +const colors = [ + 'hsl(220, 25%, 65%)', + 'hsl(220, 25%, 45%)', + 'hsl(220, 25%, 30%)', + 'hsl(220, 25%, 20%)', +]; + +export default function ChartUserByCountry() { + return ( + + + + Users by country + + + + + + + {countries.map((country, index) => ( + + {country.flag} + + + + {country.name} + + + {country.value}% + + + + + + ))} + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/CustomDatePicker.js b/docs/data/material/getting-started/templates/dashboard/components/CustomDatePicker.js new file mode 100644 index 00000000000000..e64f0631283a99 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/CustomDatePicker.js @@ -0,0 +1,79 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import dayjs from 'dayjs'; +import Button from '@mui/material/Button'; +import CalendarTodayRoundedIcon from '@mui/icons-material/CalendarTodayRounded'; +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; + +import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; +import { DatePicker } from '@mui/x-date-pickers/DatePicker'; + +function ButtonField(props) { + const { + setOpen, + label, + id, + disabled, + InputProps: { ref } = {}, + inputProps: { 'aria-label': ariaLabel } = {}, + } = props; + + return ( + + ); +} + +ButtonField.propTypes = { + /** + * If `true`, the component is disabled. + * @default false + */ + disabled: PropTypes.bool, + id: PropTypes.string, + inputProps: PropTypes.shape({ + 'aria-label': PropTypes.string, + }), + InputProps: PropTypes.shape({ + endAdornment: PropTypes.node, + startAdornment: PropTypes.node, + }), + label: PropTypes.node, + setOpen: PropTypes.func, +}; + +export default function CustomDatePicker() { + const [value, setValue] = React.useState(dayjs('2023-04-17')); + const [open, setOpen] = React.useState(false); + + return ( + + setValue(newValue)} + slots={{ field: ButtonField }} + slotProps={{ + field: { setOpen }, + nextIconButton: { size: 'small' }, + previousIconButton: { size: 'small' }, + }} + open={open} + onClose={() => setOpen(false)} + onOpen={() => setOpen(true)} + views={['day', 'month', 'year']} + /> + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/CustomDatePicker.tsx b/docs/data/material/getting-started/templates/dashboard/components/CustomDatePicker.tsx new file mode 100644 index 00000000000000..316f327a8e226c --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/CustomDatePicker.tsx @@ -0,0 +1,77 @@ +import * as React from 'react'; +import dayjs, { Dayjs } from 'dayjs'; +import Button from '@mui/material/Button'; +import CalendarTodayRoundedIcon from '@mui/icons-material/CalendarTodayRounded'; +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; +import { UseDateFieldProps } from '@mui/x-date-pickers/DateField'; +import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; +import { DatePicker } from '@mui/x-date-pickers/DatePicker'; +import { + BaseSingleInputFieldProps, + DateValidationError, + FieldSection, +} from '@mui/x-date-pickers/models'; + +interface ButtonFieldProps + extends UseDateFieldProps, + BaseSingleInputFieldProps< + Dayjs | null, + Dayjs, + FieldSection, + false, + DateValidationError + > { + setOpen?: React.Dispatch>; +} + +function ButtonField(props: ButtonFieldProps) { + const { + setOpen, + label, + id, + disabled, + InputProps: { ref } = {}, + inputProps: { 'aria-label': ariaLabel } = {}, + } = props; + + return ( + + ); +} + +export default function CustomDatePicker() { + const [value, setValue] = React.useState(dayjs('2023-04-17')); + const [open, setOpen] = React.useState(false); + + return ( + + setValue(newValue)} + slots={{ field: ButtonField }} + slotProps={{ + field: { setOpen } as any, + nextIconButton: { size: 'small' }, + previousIconButton: { size: 'small' }, + }} + open={open} + onClose={() => setOpen(false)} + onOpen={() => setOpen(true)} + views={['day', 'month', 'year']} + /> + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/CustomizedDataGrid.js b/docs/data/material/getting-started/templates/dashboard/components/CustomizedDataGrid.js new file mode 100644 index 00000000000000..e2a10335890dd7 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/CustomizedDataGrid.js @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { DataGrid } from '@mui/x-data-grid'; +import { columns, rows } from '../internals/data/gridData'; + +export default function CustomizedDataGrid() { + return ( + + params.indexRelativeToCurrentPage % 2 === 0 ? 'even' : 'odd' + } + initialState={{ + pagination: { paginationModel: { pageSize: 10 } }, + }} + pageSizeOptions={[10, 25, 50]} + disableColumnResize + /> + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/CustomizedDataGrid.tsx b/docs/data/material/getting-started/templates/dashboard/components/CustomizedDataGrid.tsx new file mode 100644 index 00000000000000..e2a10335890dd7 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/CustomizedDataGrid.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { DataGrid } from '@mui/x-data-grid'; +import { columns, rows } from '../internals/data/gridData'; + +export default function CustomizedDataGrid() { + return ( + + params.indexRelativeToCurrentPage % 2 === 0 ? 'even' : 'odd' + } + initialState={{ + pagination: { paginationModel: { pageSize: 10 } }, + }} + pageSizeOptions={[10, 25, 50]} + disableColumnResize + /> + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/CustomizedTreeView.js b/docs/data/material/getting-started/templates/dashboard/components/CustomizedTreeView.js new file mode 100644 index 00000000000000..bedfba4e43698e --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/CustomizedTreeView.js @@ -0,0 +1,228 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import clsx from 'clsx'; +import { animated, useSpring } from '@react-spring/web'; + +import Box from '@mui/material/Box'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Collapse from '@mui/material/Collapse'; +import Typography from '@mui/material/Typography'; +import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; +import { unstable_useTreeItem2 as useTreeItem2 } from '@mui/x-tree-view/useTreeItem2'; +import { + TreeItem2Content, + TreeItem2IconContainer, + TreeItem2Label, + TreeItem2Root, +} from '@mui/x-tree-view/TreeItem2'; +import { TreeItem2Icon } from '@mui/x-tree-view/TreeItem2Icon'; +import { TreeItem2Provider } from '@mui/x-tree-view/TreeItem2Provider'; + +import { useTheme } from '@mui/material/styles'; + +const ITEMS = [ + { + id: '1', + label: 'Website', + children: [ + { id: '1.1', label: 'Home', color: 'green' }, + { id: '1.2', label: 'Pricing', color: 'green' }, + { id: '1.3', label: 'About us', color: 'green' }, + { + id: '1.4', + label: 'Blog', + children: [ + { id: '1.1.1', label: 'Announcements', color: 'blue' }, + { id: '1.1.2', label: 'April lookahead', color: 'blue' }, + { id: '1.1.3', label: "What's new", color: 'blue' }, + { id: '1.1.4', label: 'Meet the team', color: 'blue' }, + ], + }, + ], + }, + { + id: '2', + label: 'Store', + children: [ + { id: '2.1', label: 'All products', color: 'green' }, + { + id: '2.2', + label: 'Categories', + children: [ + { id: '2.2.1', label: 'Gadgets', color: 'blue' }, + { id: '2.2.2', label: 'Phones', color: 'blue' }, + { id: '2.2.3', label: 'Wearables', color: 'blue' }, + ], + }, + { id: '2.3', label: 'Bestsellers', color: 'green' }, + { id: '2.4', label: 'Sales', color: 'green' }, + ], + }, + { id: '4', label: 'Contact', color: 'blue' }, + { id: '5', label: 'Help', color: 'blue' }, +]; + +function DotIcon({ color }) { + return ( + + + + + + ); +} + +DotIcon.propTypes = { + color: PropTypes.string.isRequired, +}; + +const AnimatedCollapse = animated(Collapse); + +function TransitionComponent(props) { + const style = useSpring({ + to: { + opacity: props.in ? 1 : 0, + transform: `translate3d(0,${props.in ? 0 : 20}px,0)`, + }, + }); + + return ; +} + +TransitionComponent.propTypes = { + /** + * Show the component; triggers the enter or exit states + */ + in: PropTypes.bool, +}; + +function CustomLabel({ color, expandable, children, ...other }) { + const theme = useTheme(); + const colors = { + blue: theme.palette.primary.main, + green: theme.palette.success.main, + }; + + const iconColor = color ? colors[color] : null; + return ( + + {iconColor && } + + + {children} + + + ); +} + +CustomLabel.propTypes = { + children: PropTypes.node, + color: PropTypes.oneOf(['blue', 'green']), + expandable: PropTypes.bool, +}; + +const CustomTreeItem = React.forwardRef(function CustomTreeItem(props, ref) { + const { id, itemId, label, disabled, children, ...other } = props; + + const { + getRootProps, + getContentProps, + getIconContainerProps, + getLabelProps, + getGroupTransitionProps, + status, + publicAPI, + } = useTreeItem2({ id, itemId, children, label, disabled, rootRef: ref }); + + const item = publicAPI.getItem(itemId); + const color = item?.color; + return ( + + + + {status.expandable && ( + + + + )} + + + + {children && ( + + )} + + + ); +}); + +CustomTreeItem.propTypes = { + /** + * The content of the component. + */ + children: PropTypes.node, + /** + * If `true`, the item is disabled. + * @default false + */ + disabled: PropTypes.bool, + /** + * The id attribute of the item. If not provided, it will be generated. + */ + id: PropTypes.string, + /** + * The id of the item. + * Must be unique. + */ + itemId: PropTypes.string.isRequired, + /** + * The label of the item. + */ + label: PropTypes.node, +}; + +export default function CustomizedTreeView() { + return ( + + + Product tree + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/CustomizedTreeView.tsx b/docs/data/material/getting-started/templates/dashboard/components/CustomizedTreeView.tsx new file mode 100644 index 00000000000000..76406d4526faaa --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/CustomizedTreeView.tsx @@ -0,0 +1,209 @@ +import * as React from 'react'; +import clsx from 'clsx'; +import { animated, useSpring } from '@react-spring/web'; +import { TransitionProps } from '@mui/material/transitions'; +import Box from '@mui/material/Box'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Collapse from '@mui/material/Collapse'; +import Typography from '@mui/material/Typography'; +import { RichTreeView } from '@mui/x-tree-view/RichTreeView'; +import { + unstable_useTreeItem2 as useTreeItem2, + UseTreeItem2Parameters, +} from '@mui/x-tree-view/useTreeItem2'; +import { + TreeItem2Content, + TreeItem2IconContainer, + TreeItem2Label, + TreeItem2Root, +} from '@mui/x-tree-view/TreeItem2'; +import { TreeItem2Icon } from '@mui/x-tree-view/TreeItem2Icon'; +import { TreeItem2Provider } from '@mui/x-tree-view/TreeItem2Provider'; +import { TreeViewBaseItem } from '@mui/x-tree-view/models'; +import { useTheme } from '@mui/material/styles'; + +type Color = 'blue' | 'green'; + +type ExtendedTreeItemProps = { + color?: Color; + id: string; + label: string; +}; + +const ITEMS: TreeViewBaseItem[] = [ + { + id: '1', + label: 'Website', + children: [ + { id: '1.1', label: 'Home', color: 'green' }, + { id: '1.2', label: 'Pricing', color: 'green' }, + { id: '1.3', label: 'About us', color: 'green' }, + { + id: '1.4', + label: 'Blog', + children: [ + { id: '1.1.1', label: 'Announcements', color: 'blue' }, + { id: '1.1.2', label: 'April lookahead', color: 'blue' }, + { id: '1.1.3', label: "What's new", color: 'blue' }, + { id: '1.1.4', label: 'Meet the team', color: 'blue' }, + ], + }, + ], + }, + { + id: '2', + label: 'Store', + children: [ + { id: '2.1', label: 'All products', color: 'green' }, + { + id: '2.2', + label: 'Categories', + children: [ + { id: '2.2.1', label: 'Gadgets', color: 'blue' }, + { id: '2.2.2', label: 'Phones', color: 'blue' }, + { id: '2.2.3', label: 'Wearables', color: 'blue' }, + ], + }, + { id: '2.3', label: 'Bestsellers', color: 'green' }, + { id: '2.4', label: 'Sales', color: 'green' }, + ], + }, + { id: '4', label: 'Contact', color: 'blue' }, + { id: '5', label: 'Help', color: 'blue' }, +]; + +function DotIcon({ color }: { color: string }) { + return ( + + + + + + ); +} + +const AnimatedCollapse = animated(Collapse); + +function TransitionComponent(props: TransitionProps) { + const style = useSpring({ + to: { + opacity: props.in ? 1 : 0, + transform: `translate3d(0,${props.in ? 0 : 20}px,0)`, + }, + }); + + return ; +} + +interface CustomLabelProps { + children: React.ReactNode; + color?: Color; + expandable?: boolean; +} + +function CustomLabel({ color, expandable, children, ...other }: CustomLabelProps) { + const theme = useTheme(); + const colors = { + blue: theme.palette.primary.main, + green: theme.palette.success.main, + }; + + const iconColor = color ? colors[color] : null; + return ( + + {iconColor && } + + + {children} + + + ); +} + +interface CustomTreeItemProps + extends Omit, + Omit, 'onFocus'> {} + +const CustomTreeItem = React.forwardRef(function CustomTreeItem( + props: CustomTreeItemProps, + ref: React.Ref, +) { + const { id, itemId, label, disabled, children, ...other } = props; + + const { + getRootProps, + getContentProps, + getIconContainerProps, + getLabelProps, + getGroupTransitionProps, + status, + publicAPI, + } = useTreeItem2({ id, itemId, children, label, disabled, rootRef: ref }); + + const item = publicAPI.getItem(itemId); + const color = item?.color; + return ( + + + + {status.expandable && ( + + + + )} + + + + {children && ( + + )} + + + ); +}); + +export default function CustomizedTreeView() { + return ( + + + Product tree + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/Header.js b/docs/data/material/getting-started/templates/dashboard/components/Header.js new file mode 100644 index 00000000000000..baee88632126d1 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/Header.js @@ -0,0 +1,30 @@ +import * as React from 'react'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; +import Search from './Search'; +import CustomDatePicker from './CustomDatePicker'; + +export default function Header() { + return ( + + + + Dashboard + + + Real-time analytics to improve user engagement and guide strategy. + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/Header.tsx b/docs/data/material/getting-started/templates/dashboard/components/Header.tsx new file mode 100644 index 00000000000000..baee88632126d1 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/Header.tsx @@ -0,0 +1,30 @@ +import * as React from 'react'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; +import Search from './Search'; +import CustomDatePicker from './CustomDatePicker'; + +export default function Header() { + return ( + + + + Dashboard + + + Real-time analytics to improve user engagement and guide strategy. + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/HighlightedCard.js b/docs/data/material/getting-started/templates/dashboard/components/HighlightedCard.js new file mode 100644 index 00000000000000..659baca1bdc683 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/HighlightedCard.js @@ -0,0 +1,49 @@ +import * as React from 'react'; +import { styled } from '@mui/material/styles'; +import MuiCard from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Button from '@mui/material/Button'; +import Typography from '@mui/material/Typography'; +import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded'; +import InsightsRoundedIcon from '@mui/icons-material/InsightsRounded'; + +const Card = styled(MuiCard)(({ theme }) => ({ + border: '1px solid', + borderColor: + theme.palette.mode === 'light' + ? theme.palette.primary.light + : theme.palette.primary.dark, + boxShadow: 'none', + background: + theme.palette.mode === 'light' + ? 'hsl(210, 100%, 98%)' + : 'hsla(210, 100%, 15%, 0.25)', + color: + theme.palette.mode === 'light' + ? theme.palette.grey[900] + : theme.palette.grey[200], +})); + +export default function HighlightedCard() { + return ( + + + + + Explore your data + + + Uncover performance and visitor insights with our data wizardry. + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/HighlightedCard.tsx b/docs/data/material/getting-started/templates/dashboard/components/HighlightedCard.tsx new file mode 100644 index 00000000000000..659baca1bdc683 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/HighlightedCard.tsx @@ -0,0 +1,49 @@ +import * as React from 'react'; +import { styled } from '@mui/material/styles'; +import MuiCard from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Button from '@mui/material/Button'; +import Typography from '@mui/material/Typography'; +import ChevronRightRoundedIcon from '@mui/icons-material/ChevronRightRounded'; +import InsightsRoundedIcon from '@mui/icons-material/InsightsRounded'; + +const Card = styled(MuiCard)(({ theme }) => ({ + border: '1px solid', + borderColor: + theme.palette.mode === 'light' + ? theme.palette.primary.light + : theme.palette.primary.dark, + boxShadow: 'none', + background: + theme.palette.mode === 'light' + ? 'hsl(210, 100%, 98%)' + : 'hsla(210, 100%, 15%, 0.25)', + color: + theme.palette.mode === 'light' + ? theme.palette.grey[900] + : theme.palette.grey[200], +})); + +export default function HighlightedCard() { + return ( + + + + + Explore your data + + + Uncover performance and visitor insights with our data wizardry. + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/MainGrid.js b/docs/data/material/getting-started/templates/dashboard/components/MainGrid.js new file mode 100644 index 00000000000000..7790a233c9c72c --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/MainGrid.js @@ -0,0 +1,81 @@ +import * as React from 'react'; +import Grid from '@mui/material/Unstable_Grid2'; +import Stack from '@mui/material/Stack'; +import ChartUserByCountry from './ChartUserByCountry'; +import CustomizedTreeView from './CustomizedTreeView'; +import CustomizedDataGrid from './CustomizedDataGrid'; +import HighlightedCard from './HighlightedCard'; +import PageViewsBarChart from './PageViewsBarChart'; +import PageViewsChart from './PageViewsChart'; +import StatCard from './StatCard'; + +const data = [ + { + title: 'Users', + value: '14k', + interval: 'Last 30 days', + trend: 'up', + data: [2, 4, 3, 5, 7, 6, 8, 10], + }, + { + title: 'Conversions', + value: '325', + interval: 'Last 30 days', + trend: 'down', + data: [10, 7, 6, 8, 5, 4, 4, 2], + }, + { + title: 'Event count', + value: '200k', + interval: 'Last 30 days', + trend: 'neutral', + data: [5, 4, 6, 3, 4, 3, 7, 6], + }, + { + title: 'Engagements', + value: '30k', + interval: 'Last 30 days', + trend: 'up', + data: [2, 4, 3, 4, 5, 4, 7, 8], + }, +]; + +export default function MainGrid() { + return ( + + {/* cards */} + + + {data.map((card, index) => ( + + + + ))} + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/MainGrid.tsx b/docs/data/material/getting-started/templates/dashboard/components/MainGrid.tsx new file mode 100644 index 00000000000000..360b077c2a65ce --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/MainGrid.tsx @@ -0,0 +1,81 @@ +import * as React from 'react'; +import Grid from '@mui/material/Unstable_Grid2'; +import Stack from '@mui/material/Stack'; +import ChartUserByCountry from './ChartUserByCountry'; +import CustomizedTreeView from './CustomizedTreeView'; +import CustomizedDataGrid from './CustomizedDataGrid'; +import HighlightedCard from './HighlightedCard'; +import PageViewsBarChart from './PageViewsBarChart'; +import PageViewsChart from './PageViewsChart'; +import StatCard, { StatCardProps } from './StatCard'; + +const data: StatCardProps[] = [ + { + title: 'Users', + value: '14k', + interval: 'Last 30 days', + trend: 'up', + data: [2, 4, 3, 5, 7, 6, 8, 10], + }, + { + title: 'Conversions', + value: '325', + interval: 'Last 30 days', + trend: 'down', + data: [10, 7, 6, 8, 5, 4, 4, 2], + }, + { + title: 'Event count', + value: '200k', + interval: 'Last 30 days', + trend: 'neutral', + data: [5, 4, 6, 3, 4, 3, 7, 6], + }, + { + title: 'Engagements', + value: '30k', + interval: 'Last 30 days', + trend: 'up', + data: [2, 4, 3, 4, 5, 4, 7, 8], + }, +]; + +export default function MainGrid() { + return ( + + {/* cards */} + + + {data.map((card, index) => ( + + + + ))} + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/MenuButton.js b/docs/data/material/getting-started/templates/dashboard/components/MenuButton.js new file mode 100644 index 00000000000000..d324b3ba822816 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/MenuButton.js @@ -0,0 +1,25 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import Badge from '@mui/material/Badge'; +import IconButton from '@mui/material/IconButton'; + +function MenuButton({ showBadge = false, ...props }) { + return ( + + + + ); +} + +MenuButton.propTypes = { + showBadge: PropTypes.bool, +}; + +export default MenuButton; diff --git a/docs/data/material/getting-started/templates/dashboard/components/MenuButton.tsx b/docs/data/material/getting-started/templates/dashboard/components/MenuButton.tsx new file mode 100644 index 00000000000000..35453496a9181a --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/MenuButton.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; +import Badge from '@mui/material/Badge'; +import IconButton, { IconButtonProps } from '@mui/material/IconButton'; + +interface StyledMenuButtonProps extends IconButtonProps { + showBadge?: boolean; +} + +export default function MenuButton({ + showBadge = false, + ...props +}: StyledMenuButtonProps) { + return ( + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/Navbar.js b/docs/data/material/getting-started/templates/dashboard/components/Navbar.js new file mode 100644 index 00000000000000..23a7fae0c99cd5 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/Navbar.js @@ -0,0 +1,119 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import { styled } from '@mui/material/styles'; + +import AppBar from '@mui/material/AppBar'; +import Stack from '@mui/material/Stack'; +import MuiToolbar from '@mui/material/Toolbar'; +import Tab from '@mui/material/Tab'; +import Tabs from '@mui/material/Tabs'; +import MenuRoundedIcon from '@mui/icons-material/MenuRounded'; +import NotificationsRoundedIcon from '@mui/icons-material/NotificationsRounded'; +import ToggleColorMode from './ToggleColorMode'; +import SideNav from './SideNav'; +import MenuButton from './MenuButton'; +import NavbarBreadcrumbs from './NavbarBreadcrumbs'; +import OptionsMenu from './OptionsMenu'; + +const Toolbar = styled(MuiToolbar)({ + maxWidth: 1538, + width: '100%', + padding: '16px 16px 0 16px', + display: 'flex', + flexDirection: 'column', + alignItems: 'start', + justifyContent: 'center', + gap: '12px', + flexShrink: 0, + backdropFilter: 'blur(24px)', + '& .MuiTabs-flexContainer': { + gap: '8px', + p: '8px', + pb: 0, + }, +}); + +function a11yProps(index) { + return { + id: `simple-tab-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, + }; +} + +function Navbar({ mode, toggleColorMode }) { + const [open, setOpen] = React.useState(false); + + const toggleDrawer = (newOpen) => () => { + setOpen(newOpen); + }; + + const [value, setValue] = React.useState(0); + + const handleChange = (event, newValue) => { + setValue(newValue); + }; + + return ( + ({ + boxShadow: 0, + bgcolor: 'transparent', + backgroundImage: 'none', + alignItems: 'center', + borderBottom: '1px solid', + borderColor: theme.palette.divider, + })} + > + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +Navbar.propTypes = { + mode: PropTypes.oneOf(['dark', 'light']).isRequired, + toggleColorMode: PropTypes.func.isRequired, +}; + +export default Navbar; diff --git a/docs/data/material/getting-started/templates/dashboard/components/Navbar.tsx b/docs/data/material/getting-started/templates/dashboard/components/Navbar.tsx new file mode 100644 index 00000000000000..b04d10dd672164 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/Navbar.tsx @@ -0,0 +1,116 @@ +import * as React from 'react'; +import { styled } from '@mui/material/styles'; +import { PaletteMode } from '@mui/material'; +import AppBar from '@mui/material/AppBar'; +import Stack from '@mui/material/Stack'; +import MuiToolbar from '@mui/material/Toolbar'; +import Tab from '@mui/material/Tab'; +import Tabs from '@mui/material/Tabs'; +import MenuRoundedIcon from '@mui/icons-material/MenuRounded'; +import NotificationsRoundedIcon from '@mui/icons-material/NotificationsRounded'; +import ToggleColorMode from './ToggleColorMode'; +import SideNav from './SideNav'; +import MenuButton from './MenuButton'; +import NavbarBreadcrumbs from './NavbarBreadcrumbs'; +import OptionsMenu from './OptionsMenu'; + +interface NavBarProps { + mode: PaletteMode; + toggleColorMode: () => void; +} + +const Toolbar = styled(MuiToolbar)({ + maxWidth: 1538, + width: '100%', + padding: '16px 16px 0 16px', + display: 'flex', + flexDirection: 'column', + alignItems: 'start', + justifyContent: 'center', + gap: '12px', + flexShrink: 0, + backdropFilter: 'blur(24px)', + '& .MuiTabs-flexContainer': { + gap: '8px', + p: '8px', + pb: 0, + }, +}); + +function a11yProps(index: number) { + return { + id: `simple-tab-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, + }; +} + +export default function Navbar({ mode, toggleColorMode }: NavBarProps) { + const [open, setOpen] = React.useState(false); + + const toggleDrawer = (newOpen: boolean) => () => { + setOpen(newOpen); + }; + + const [value, setValue] = React.useState(0); + + const handleChange = (event: React.SyntheticEvent, newValue: number) => { + setValue(newValue); + }; + + return ( + ({ + boxShadow: 0, + bgcolor: 'transparent', + backgroundImage: 'none', + alignItems: 'center', + borderBottom: '1px solid', + borderColor: theme.palette.divider, + })} + > + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/NavbarBreadcrumbs.js b/docs/data/material/getting-started/templates/dashboard/components/NavbarBreadcrumbs.js new file mode 100644 index 00000000000000..a7ea114b17330b --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/NavbarBreadcrumbs.js @@ -0,0 +1,25 @@ +import * as React from 'react'; +import { styled } from '@mui/material/styles'; +import Typography from '@mui/material/Typography'; +import Breadcrumbs from '@mui/material/Breadcrumbs'; +import { SitemarkIcon } from '../internals/components/CustomIcons'; + +const StyledBreadcrumbs = styled(Breadcrumbs)(({ theme }) => ({ + '& .MuiBreadcrumbs-separator': { + color: theme.palette.action.disabled, + }, + '& .MuiBreadcrumbs-ol': { + alignItems: 'normal', + }, +})); + +export default function NavbarBreadcrumbs() { + return ( + + + + Project (Production) + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/NavbarBreadcrumbs.tsx b/docs/data/material/getting-started/templates/dashboard/components/NavbarBreadcrumbs.tsx new file mode 100644 index 00000000000000..a7ea114b17330b --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/NavbarBreadcrumbs.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; +import { styled } from '@mui/material/styles'; +import Typography from '@mui/material/Typography'; +import Breadcrumbs from '@mui/material/Breadcrumbs'; +import { SitemarkIcon } from '../internals/components/CustomIcons'; + +const StyledBreadcrumbs = styled(Breadcrumbs)(({ theme }) => ({ + '& .MuiBreadcrumbs-separator': { + color: theme.palette.action.disabled, + }, + '& .MuiBreadcrumbs-ol': { + alignItems: 'normal', + }, +})); + +export default function NavbarBreadcrumbs() { + return ( + + + + Project (Production) + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/OptionsMenu.js b/docs/data/material/getting-started/templates/dashboard/components/OptionsMenu.js new file mode 100644 index 00000000000000..da6b2efeb22c58 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/OptionsMenu.js @@ -0,0 +1,58 @@ +import * as React from 'react'; +import Avatar from '@mui/material/Avatar'; +import Divider from '@mui/material/Divider'; +import Menu from '@mui/material/Menu'; +import MenuItem from '@mui/material/MenuItem'; +import Typography from '@mui/material/Typography'; +import MoreVertRoundedIcon from '@mui/icons-material/MoreVertRounded'; +import MenuButton from './MenuButton'; + +export default function OptionsMenu() { + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + const handleClick = (event) => { + setAnchorEl(event.currentTarget); + }; + const handleClose = () => { + setAnchorEl(null); + }; + return ( + + + + + + + + + Riley Carter + + + + Profile + My account + + Add another account + Settings + Logout + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/OptionsMenu.tsx b/docs/data/material/getting-started/templates/dashboard/components/OptionsMenu.tsx new file mode 100644 index 00000000000000..ad68a17337210d --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/OptionsMenu.tsx @@ -0,0 +1,58 @@ +import * as React from 'react'; +import Avatar from '@mui/material/Avatar'; +import Divider from '@mui/material/Divider'; +import Menu from '@mui/material/Menu'; +import MenuItem from '@mui/material/MenuItem'; +import Typography from '@mui/material/Typography'; +import MoreVertRoundedIcon from '@mui/icons-material/MoreVertRounded'; +import MenuButton from './MenuButton'; + +export default function OptionsMenu() { + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + const handleClick = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }; + const handleClose = () => { + setAnchorEl(null); + }; + return ( + + + + + + + + + Riley Carter + + + + Profile + My account + + Add another account + Settings + Logout + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/PageViewsBarChart.js b/docs/data/material/getting-started/templates/dashboard/components/PageViewsBarChart.js new file mode 100644 index 00000000000000..b5b75c47922e57 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/PageViewsBarChart.js @@ -0,0 +1,87 @@ +import * as React from 'react'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Typography from '@mui/material/Typography'; +import { BarChart } from '@mui/x-charts/BarChart'; +import { gray } from '../themePrimitives'; + +const colorPaletteLight = [gray[700], gray[500], gray[300]]; +const colorPalette = (mode) => + mode === 'dark' ? colorPaletteLight : colorPaletteLight; + +export default function PageViewsBarChart() { + return ( + + + + Page views and downloads + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/PageViewsBarChart.tsx b/docs/data/material/getting-started/templates/dashboard/components/PageViewsBarChart.tsx new file mode 100644 index 00000000000000..5dab2c76f85a9f --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/PageViewsBarChart.tsx @@ -0,0 +1,89 @@ +import * as React from 'react'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Typography from '@mui/material/Typography'; +import { BarChart } from '@mui/x-charts/BarChart'; +import { gray } from '../themePrimitives'; + +const colorPaletteLight = [gray[700], gray[500], gray[300]]; +const colorPalette = (mode: 'light' | 'dark') => + mode === 'dark' ? colorPaletteLight : colorPaletteLight; + +export default function PageViewsBarChart() { + return ( + + + + Page views and downloads + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/PageViewsChart.js b/docs/data/material/getting-started/templates/dashboard/components/PageViewsChart.js new file mode 100644 index 00000000000000..93ef070b493fb5 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/PageViewsChart.js @@ -0,0 +1,164 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import { useTheme } from '@mui/material/styles'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Typography from '@mui/material/Typography'; +import { LineChart } from '@mui/x-charts/LineChart'; + +function AreaGradient({ color, id }) { + return ( + + + + + + + ); +} + +AreaGradient.propTypes = { + color: PropTypes.string.isRequired, + id: PropTypes.string.isRequired, +}; + +function getDaysInMonth(month, year) { + const date = new Date(year, month, 0); + const monthName = date.toLocaleDateString('en-US', { + month: 'short', + }); + const daysInMonth = date.getDate(); + const days = []; + let i = 1; + while (days.length < daysInMonth) { + days.push(`${monthName} ${i}`); + i += 1; + } + return days; +} + +export default function PageViewsChart() { + const theme = useTheme(); + const mode = theme.palette.mode; + const data = getDaysInMonth(4, 2024); + + const colorPaletteLight = [ + theme.palette.grey[300], + theme.palette.grey[400], + theme.palette.grey[500], + ]; + + const colorPaletteDark = [ + theme.palette.grey[400], + theme.palette.grey[500], + theme.palette.grey[700], + ]; + + const colorPalette = mode === 'dark' ? colorPaletteDark : colorPaletteLight; + + return ( + + + + Sessions + + (i + 1) % 5 === 0, + }, + ]} + series={[ + { + id: 'organic', + label: 'Organic', + showMark: false, + curve: 'linear', + stack: 'total', + stackOrder: 'ascending', + data: [ + 6234, 6087, 6421, 6312, 6190, 6400, 6357, 6029, 6173, 6482, 6215, + 6051, 6338, 6142, 6018, 6247, 6463, 6371, 6060, 6100, 6389, 6203, + 6497, 6036, 6156, 6470, 6269, 6091, 6445, 6121, + ], + area: true, + }, + { + id: 'referral', + label: 'Referral', + showMark: false, + curve: 'linear', + stack: 'total', + area: true, + stackOrder: 'ascending', + data: [ + 4486, 4255, 4046, 4316, 4418, 4498, 4421, 4474, 4036, 4049, 4206, + 4458, 4259, 4353, 4496, 4178, 4265, 4424, 4186, 4003, 4204, 4467, + 4120, 4410, 4292, 4143, 4403, 4373, 4079, 4291, + ], + }, + { + id: 'direct', + label: 'Direct', + showMark: false, + curve: 'linear', + stack: 'total', + area: true, + stackOrder: 'ascending', + data: [ + 2238, 2172, 2305, 2140, 2135, 2100, 2465, 2053, 2342, 2494, 2497, + 2277, 2356, 2012, 2309, 2301, 2029, 2028, 2129, 2324, 2152, 2235, + 2430, 2027, 2168, 2111, 2235, 2166, 2309, 2268, + ], + }, + ]} + height={320} + margin={{ left: 50, right: 0, top: 60, bottom: 30 }} + grid={{ horizontal: true }} + sx={{ + '& .MuiAreaElement-series-organic': { + fill: "url('#organic')", + }, + '& .MuiAreaElement-series-referral': { + fill: "url('#referral')", + }, + '& .MuiAreaElement-series-direct': { + fill: "url('#direct')", + }, + }} + slotProps={{ + legend: { + labelStyle: { fontSize: 14 }, + itemMarkWidth: 10, + itemMarkHeight: 10, + itemGap: 24, + position: { vertical: 'top', horizontal: 'right' }, + }, + }} + > + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/PageViewsChart.tsx b/docs/data/material/getting-started/templates/dashboard/components/PageViewsChart.tsx new file mode 100644 index 00000000000000..75ccda32685aef --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/PageViewsChart.tsx @@ -0,0 +1,156 @@ +import * as React from 'react'; +import { useTheme } from '@mui/material/styles'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Typography from '@mui/material/Typography'; +import { LineChart } from '@mui/x-charts/LineChart'; + +function AreaGradient({ color, id }: { color: string; id: string }) { + return ( + + + + + + + ); +} + +function getDaysInMonth(month: number, year: number) { + const date = new Date(year, month, 0); + const monthName = date.toLocaleDateString('en-US', { + month: 'short', + }); + const daysInMonth = date.getDate(); + const days = []; + let i = 1; + while (days.length < daysInMonth) { + days.push(`${monthName} ${i}`); + i += 1; + } + return days; +} + +export default function PageViewsChart() { + const theme = useTheme(); + const mode = theme.palette.mode; + const data = getDaysInMonth(4, 2024); + + const colorPaletteLight = [ + theme.palette.grey[300], + theme.palette.grey[400], + theme.palette.grey[500], + ]; + const colorPaletteDark = [ + theme.palette.grey[400], + theme.palette.grey[500], + theme.palette.grey[700], + ]; + const colorPalette = mode === 'dark' ? colorPaletteDark : colorPaletteLight; + + return ( + + + + Sessions + + (i + 1) % 5 === 0, + }, + ]} + series={[ + { + id: 'organic', + label: 'Organic', + showMark: false, + curve: 'linear', + stack: 'total', + stackOrder: 'ascending', + data: [ + 6234, 6087, 6421, 6312, 6190, 6400, 6357, 6029, 6173, 6482, 6215, + 6051, 6338, 6142, 6018, 6247, 6463, 6371, 6060, 6100, 6389, 6203, + 6497, 6036, 6156, 6470, 6269, 6091, 6445, 6121, + ], + area: true, + }, + { + id: 'referral', + label: 'Referral', + showMark: false, + curve: 'linear', + stack: 'total', + area: true, + stackOrder: 'ascending', + data: [ + 4486, 4255, 4046, 4316, 4418, 4498, 4421, 4474, 4036, 4049, 4206, + 4458, 4259, 4353, 4496, 4178, 4265, 4424, 4186, 4003, 4204, 4467, + 4120, 4410, 4292, 4143, 4403, 4373, 4079, 4291, + ], + }, + { + id: 'direct', + label: 'Direct', + showMark: false, + curve: 'linear', + stack: 'total', + area: true, + stackOrder: 'ascending', + data: [ + 2238, 2172, 2305, 2140, 2135, 2100, 2465, 2053, 2342, 2494, 2497, + 2277, 2356, 2012, 2309, 2301, 2029, 2028, 2129, 2324, 2152, 2235, + 2430, 2027, 2168, 2111, 2235, 2166, 2309, 2268, + ], + }, + ]} + height={320} + margin={{ left: 50, right: 0, top: 60, bottom: 30 }} + grid={{ horizontal: true }} + sx={{ + '& .MuiAreaElement-series-organic': { + fill: "url('#organic')", + }, + '& .MuiAreaElement-series-referral': { + fill: "url('#referral')", + }, + '& .MuiAreaElement-series-direct': { + fill: "url('#direct')", + }, + }} + slotProps={{ + legend: { + labelStyle: { fontSize: 14 }, + itemMarkWidth: 10, + itemMarkHeight: 10, + itemGap: 24, + position: { vertical: 'top', horizontal: 'right' }, + }, + }} + > + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/Search.js b/docs/data/material/getting-started/templates/dashboard/components/Search.js new file mode 100644 index 00000000000000..58408e82350bae --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/Search.js @@ -0,0 +1,26 @@ +import * as React from 'react'; +import FormControl from '@mui/material/FormControl'; +import InputAdornment from '@mui/material/InputAdornment'; +import OutlinedInput from '@mui/material/OutlinedInput'; +import SearchRoundedIcon from '@mui/icons-material/SearchRounded'; + +export default function Search() { + return ( + + + + + } + inputProps={{ + 'aria-label': 'search', + }} + /> + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/Search.tsx b/docs/data/material/getting-started/templates/dashboard/components/Search.tsx new file mode 100644 index 00000000000000..58408e82350bae --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/Search.tsx @@ -0,0 +1,26 @@ +import * as React from 'react'; +import FormControl from '@mui/material/FormControl'; +import InputAdornment from '@mui/material/InputAdornment'; +import OutlinedInput from '@mui/material/OutlinedInput'; +import SearchRoundedIcon from '@mui/icons-material/SearchRounded'; + +export default function Search() { + return ( + + + + + } + inputProps={{ + 'aria-label': 'search', + }} + /> + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/SideNav.js b/docs/data/material/getting-started/templates/dashboard/components/SideNav.js new file mode 100644 index 00000000000000..da44888b9966e0 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/SideNav.js @@ -0,0 +1,107 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; + +import Avatar from '@mui/material/Avatar'; +import Button from '@mui/material/Button'; +import Divider from '@mui/material/Divider'; +import Drawer from '@mui/material/Drawer'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemIcon from '@mui/material/ListItemIcon'; +import ListItemText from '@mui/material/ListItemText'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; + +import AddRoundedIcon from '@mui/icons-material/AddRounded'; +import AccountCircleRoundedIcon from '@mui/icons-material/AccountCircleRounded'; +import ContactPageRoundedIcon from '@mui/icons-material/ContactPageRounded'; +import LogoutRoundedIcon from '@mui/icons-material/LogoutRounded'; +import SettingsRoundedIcon from '@mui/icons-material/SettingsRounded'; +import NotificationsRoundedIcon from '@mui/icons-material/NotificationsRounded'; + +import MenuButton from './MenuButton'; +import ToggleColorMode from './ToggleColorMode'; + +const accountsList = [ + { label: 'Profile', icon: }, + { label: 'My account', icon: }, +]; + +const settingsList = [ + { label: 'Add account', icon: }, + { label: 'Settings', icon: }, +]; + +function SideNav({ open, toggleDrawer, mode, toggleColorMode }) { + return ( + + + + + + + Riley Carter + + + + + + + + + + + {accountsList.map((item, index) => ( + + + {item.icon} + + + + ))} + + {settingsList.map((item, index) => ( + + + {item.icon} + + + + ))} + + + + + + + + ); +} + +SideNav.propTypes = { + mode: PropTypes.oneOf(['dark', 'light']).isRequired, + open: PropTypes.bool, + toggleColorMode: PropTypes.func.isRequired, + toggleDrawer: PropTypes.func.isRequired, +}; + +export default SideNav; diff --git a/docs/data/material/getting-started/templates/dashboard/components/SideNav.tsx b/docs/data/material/getting-started/templates/dashboard/components/SideNav.tsx new file mode 100644 index 00000000000000..6a9edc72f87048 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/SideNav.tsx @@ -0,0 +1,109 @@ +import * as React from 'react'; +import { PaletteMode } from '@mui/material'; +import Avatar from '@mui/material/Avatar'; +import Button from '@mui/material/Button'; +import Divider from '@mui/material/Divider'; +import Drawer from '@mui/material/Drawer'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemIcon from '@mui/material/ListItemIcon'; +import ListItemText from '@mui/material/ListItemText'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; + +import AddRoundedIcon from '@mui/icons-material/AddRounded'; +import AccountCircleRoundedIcon from '@mui/icons-material/AccountCircleRounded'; +import ContactPageRoundedIcon from '@mui/icons-material/ContactPageRounded'; +import LogoutRoundedIcon from '@mui/icons-material/LogoutRounded'; +import SettingsRoundedIcon from '@mui/icons-material/SettingsRounded'; +import NotificationsRoundedIcon from '@mui/icons-material/NotificationsRounded'; + +import MenuButton from './MenuButton'; +import ToggleColorMode from './ToggleColorMode'; + +interface SideNavProps { + open: boolean | undefined; + toggleDrawer: (newOpen: boolean) => () => void; + mode: PaletteMode; + toggleColorMode: () => void; +} + +const accountsList = [ + { label: 'Profile', icon: }, + { label: 'My account', icon: }, +]; + +const settingsList = [ + { label: 'Add account', icon: }, + { label: 'Settings', icon: }, +]; + +export default function SideNav({ + open, + toggleDrawer, + mode, + toggleColorMode, +}: SideNavProps) { + return ( + + + + + + + Riley Carter + + + + + + + + + + + {accountsList.map((item, index) => ( + + + {item.icon} + + + + ))} + + {settingsList.map((item, index) => ( + + + {item.icon} + + + + ))} + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/StatCard.js b/docs/data/material/getting-started/templates/dashboard/components/StatCard.js new file mode 100644 index 00000000000000..8b1830d4b9a53b --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/StatCard.js @@ -0,0 +1,112 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import { useTheme } from '@mui/material/styles'; +import Box from '@mui/material/Box'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Chip from '@mui/material/Chip'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; +import { SparkLineChart } from '@mui/x-charts/SparkLineChart'; +import { areaElementClasses } from '@mui/x-charts/LineChart'; + +function AreaGradient({ color, id }) { + return ( + + + + + + + ); +} + +AreaGradient.propTypes = { + color: PropTypes.string.isRequired, + id: PropTypes.string.isRequired, +}; + +function StatCard({ title, value, interval, trend, data }) { + const theme = useTheme(); + + const trendColors = { + up: + theme.palette.mode === 'light' + ? theme.palette.success.main + : theme.palette.success.dark, + down: + theme.palette.mode === 'light' + ? theme.palette.error.main + : theme.palette.error.dark, + neutral: + theme.palette.mode === 'light' + ? theme.palette.grey[400] + : theme.palette.grey[700], + }; + + const labelColors = { + up: 'success', + down: 'error', + neutral: 'default', + }; + + const color = labelColors[trend]; + const chartColor = trendColors[trend]; + const trendValues = { up: '+25%', down: '-25%', neutral: '+5%' }; + + return ( + + + + {title} + + + + + + {value} + + + + + {interval} + + + + + + + + + + + ); +} + +StatCard.propTypes = { + data: PropTypes.arrayOf(PropTypes.number).isRequired, + interval: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, + trend: PropTypes.oneOf(['down', 'neutral', 'up']).isRequired, + value: PropTypes.string.isRequired, +}; + +export default StatCard; diff --git a/docs/data/material/getting-started/templates/dashboard/components/StatCard.tsx b/docs/data/material/getting-started/templates/dashboard/components/StatCard.tsx new file mode 100644 index 00000000000000..67776b8e0d09c0 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/StatCard.tsx @@ -0,0 +1,110 @@ +import * as React from 'react'; +import { useTheme } from '@mui/material/styles'; +import Box from '@mui/material/Box'; +import Card from '@mui/material/Card'; +import CardContent from '@mui/material/CardContent'; +import Chip from '@mui/material/Chip'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; +import { SparkLineChart } from '@mui/x-charts/SparkLineChart'; +import { areaElementClasses } from '@mui/x-charts/LineChart'; + +export type StatCardProps = { + title: string; + value: string; + interval: string; + trend: 'up' | 'down' | 'neutral'; + data: number[]; +}; + +function AreaGradient({ color, id }: { color: string; id: string }) { + return ( + + + + + + + ); +} + +export default function StatCard({ + title, + value, + interval, + trend, + data, +}: StatCardProps) { + const theme = useTheme(); + + const trendColors = { + up: + theme.palette.mode === 'light' + ? theme.palette.success.main + : theme.palette.success.dark, + down: + theme.palette.mode === 'light' + ? theme.palette.error.main + : theme.palette.error.dark, + neutral: + theme.palette.mode === 'light' + ? theme.palette.grey[400] + : theme.palette.grey[700], + }; + + const labelColors = { + up: 'success' as const, + down: 'error' as const, + neutral: 'default' as const, + }; + + const color = labelColors[trend]; + const chartColor = trendColors[trend]; + const trendValues = { up: '+25%', down: '-25%', neutral: '+5%' }; + + return ( + + + + {title} + + + + + + {value} + + + + + {interval} + + + + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/components/ToggleColorMode.js b/docs/data/material/getting-started/templates/dashboard/components/ToggleColorMode.js new file mode 100644 index 00000000000000..317b5b764c06c4 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/ToggleColorMode.js @@ -0,0 +1,29 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; + +import WbSunnyRoundedIcon from '@mui/icons-material/WbSunnyRounded'; +import ModeNightRoundedIcon from '@mui/icons-material/ModeNightRounded'; +import MenuButton from './MenuButton'; + +function ToggleColorMode({ mode, toggleColorMode }) { + return ( + + {mode === 'dark' ? ( + + ) : ( + + )} + + ); +} + +ToggleColorMode.propTypes = { + mode: PropTypes.oneOf(['dark', 'light']).isRequired, + toggleColorMode: PropTypes.func.isRequired, +}; + +export default ToggleColorMode; diff --git a/docs/data/material/getting-started/templates/dashboard/components/ToggleColorMode.tsx b/docs/data/material/getting-started/templates/dashboard/components/ToggleColorMode.tsx new file mode 100644 index 00000000000000..9642c2d2f21fcb --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/components/ToggleColorMode.tsx @@ -0,0 +1,29 @@ +import * as React from 'react'; +import { PaletteMode } from '@mui/material'; +import WbSunnyRoundedIcon from '@mui/icons-material/WbSunnyRounded'; +import ModeNightRoundedIcon from '@mui/icons-material/ModeNightRounded'; +import MenuButton from './MenuButton'; + +interface ToggleColorModeProps { + mode: PaletteMode; + toggleColorMode: () => void; +} + +export default function ToggleColorMode({ + mode, + toggleColorMode, +}: ToggleColorModeProps) { + return ( + + {mode === 'dark' ? ( + + ) : ( + + )} + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/getDashboardTheme.js b/docs/data/material/getting-started/templates/dashboard/getDashboardTheme.js new file mode 100644 index 00000000000000..faf6155e1fc22d --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/getDashboardTheme.js @@ -0,0 +1,1115 @@ +import * as React from 'react'; + +import { alpha } from '@mui/material/styles'; + +import CheckBoxOutlineBlankRoundedIcon from '@mui/icons-material/CheckBoxOutlineBlankRounded'; +import CheckRoundedIcon from '@mui/icons-material/CheckRounded'; +import RemoveRoundedIcon from '@mui/icons-material/RemoveRounded'; +import { brand, getDesignTokens, gray, green, red } from './themePrimitives'; + +export default function getDashboardTheme(mode) { + return { + ...getDesignTokens(mode), + components: { + MuiButtonBase: { + defaultProps: { + disableTouchRipple: true, + disableRipple: true, + }, + styleOverrides: { + root: ({ theme }) => ({ + boxSizing: 'border-box', + transition: 'all 100ms ease-in', + '&:focus-visible': { + outline: `3px solid ${alpha(theme.palette.primary.main, 0.5)}`, + outlineOffset: '2px', + }, + }), + }, + }, + MuiButton: { + styleOverrides: { + root: ({ theme }) => ({ + boxShadow: 'none', + borderRadius: theme.shape.borderRadius, + textTransform: 'none', + '& .MuiSvgIcon-root': { width: '1.125rem', height: '1.125rem' }, + variants: [ + { + props: { + size: 'small', + }, + style: { + height: '2rem', // 32px + padding: '0 0.5rem', + }, + }, + { + props: { + size: 'medium', + }, + style: { + height: '2.5rem', // 40px + }, + }, + { + props: { + color: 'primary', + variant: 'contained', + }, + style: { + color: 'white', + backgroundColor: gray[900], + backgroundImage: `linear-gradient(to bottom, ${gray[700]}, ${gray[800]})`, + boxShadow: `inset 0 2px 0 ${gray[600]}, inset 0 -2px 0 hsl(220, 0%, 0%)`, + border: `1px solid ${gray[700]}`, + '&:hover': { + backgroundImage: 'none', + backgroundColor: gray[700], + boxShadow: 'none', + }, + '&:active': { + backgroundColor: gray[800], + }, + ...theme.applyStyles('dark', { + color: 'black', + backgroundColor: gray[50], + backgroundImage: `linear-gradient(to bottom, ${gray[100]}, ${gray[50]})`, + boxShadow: + 'inset 0 2px 0 hsl(220, 0%, 100%), inset 0 -2px 0 hsl(220, 30%, 90%)', + border: `1px solid ${gray[100]}`, + '&:hover': { + backgroundImage: 'none', + backgroundColor: gray[300], + boxShadow: 'none', + }, + '&:active': { + backgroundColor: gray[400], + }, + }), + }, + }, + { + props: { + color: 'secondary', + variant: 'contained', + }, + style: { + color: 'white', + backgroundColor: brand[300], + backgroundImage: `linear-gradient(to bottom, ${alpha(brand[400], 0.8)}, ${brand[500]})`, + boxShadow: `inset 0 2px 0 ${alpha(brand[200], 0.2)}, inset 0 -2px 0 ${alpha(brand[700], 0.4)}`, + border: `1px solid ${brand[500]}`, + '&:hover': { + backgroundColor: brand[700], + boxShadow: 'none', + }, + '&:active': { + backgroundColor: brand[700], + backgroundImage: 'none', + }, + }, + }, + { + props: { + variant: 'outlined', + }, + style: { + color: theme.palette.text.primary, + border: `1px solid ${theme.palette.divider}`, + backgroundColor: gray[50], + '&:hover': { + backgroundColor: gray[100], + borderColor: gray[300], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + '&:hover': { + backgroundColor: gray[900], + borderColor: gray[600], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + }, + }, + { + props: { + color: 'secondary', + variant: 'outlined', + }, + style: { + color: brand[700], + border: '1px solid', + borderColor: brand[200], + backgroundColor: brand[50], + '&:hover': { + backgroundColor: brand[100], + borderColor: brand[400], + }, + '&:active': { + backgroundColor: alpha(brand[200], 0.7), + }, + ...theme.applyStyles('dark', { + color: brand[50], + border: '1px solid', + borderColor: brand[900], + backgroundColor: alpha(brand[900], 0.3), + '&:hover': { + borderColor: brand[700], + backgroundColor: alpha(brand[900], 0.6), + }, + '&:active': { + backgroundColor: alpha(brand[900], 0.5), + }, + }), + }, + }, + { + props: { + variant: 'text', + }, + style: { + color: gray[600], + '&:hover': { + backgroundColor: gray[100], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + color: gray[50], + '&:hover': { + backgroundColor: gray[700], + }, + '&:active': { + backgroundColor: alpha(gray[700], 0.7), + }, + }), + }, + }, + { + props: { + color: 'secondary', + variant: 'text', + }, + style: { + color: brand[700], + '&:hover': { + backgroundColor: alpha(brand[100], 0.5), + }, + '&:active': { + backgroundColor: alpha(brand[200], 0.7), + }, + ...theme.applyStyles('dark', { + color: brand[100], + '&:hover': { + backgroundColor: alpha(brand[900], 0.5), + }, + '&:active': { + backgroundColor: alpha(brand[900], 0.3), + }, + }), + }, + }, + ], + }), + }, + }, + MuiCard: { + styleOverrides: { + root: ({ theme }) => { + return { + padding: 16, + transition: 'all 100ms ease', + backgroundColor: gray[50], + borderRadius: theme.shape.borderRadius, + border: `1px solid ${alpha(gray[200], 0.5)}`, + boxShadow: 'none', + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + border: `1px solid ${alpha(gray[700], 0.3)}`, + }), + variants: [ + { + props: { + variant: 'outlined', + }, + style: { + border: `1px solid ${gray[200]}`, + boxShadow: 'none', + background: `linear-gradient(to bottom, hsl(0, 0%, 100%), ${gray[50]})`, + }, + }, + { + props: { + variant: 'outlined', + }, + style: { + ...theme.applyStyles('dark', { + border: `1px solid ${alpha(gray[700], 0.4)}`, + boxShadow: 'none', + background: `linear-gradient(to bottom, ${gray[900]}, ${alpha( + gray[800], + 0.5, + )})`, + }), + }, + }, + ], + }; + }, + }, + }, + MuiCheckbox: { + defaultProps: { + disableRipple: true, + icon: ( + + ), + checkedIcon: , + indeterminateIcon: , + }, + styleOverrides: { + root: ({ theme }) => ({ + margin: 10, + height: 16, + width: 16, + borderRadius: 5, + border: '1px solid ', + borderColor: alpha(gray[300], 0.8), + boxShadow: '0 0 0 1.5px hsla(210, 0%, 0%, 0.04) inset', + backgroundColor: alpha(gray[100], 0.4), + transition: 'border-color, background-color, 120ms ease-in', + '&:hover': { + borderColor: brand[300], + }, + '&.Mui-focusVisible': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + borderColor: brand[400], + }, + '&.Mui-checked': { + color: 'white', + backgroundColor: brand[500], + borderColor: brand[500], + boxShadow: `none`, + '&:hover': { + backgroundColor: brand[600], + }, + }, + ...theme.applyStyles('dark', { + borderColor: alpha(gray[700], 0.5), + boxShadow: '0 0 0 1.5px hsl(210, 0%, 0%) inset', + backgroundColor: alpha(gray[900], 0.8), + '&:hover': { + borderColor: brand[300], + }, + '&.Mui-focusVisible': { + borderColor: brand[400], + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + }, + }), + }), + }, + }, + MuiCardContent: { + styleOverrides: { + root: { + padding: 0, + '&:last-child': { paddingBottom: 0 }, + }, + }, + }, + MuiChip: { + styleOverrides: { + root: ({ theme }) => ({ + border: '1px solid', + borderRadius: '999px', + '& .MuiChip-label': { + padding: '0 4px', + fontWeight: 600, + }, + variants: [ + { + props: { + color: 'default', + }, + style: { + borderColor: gray[200], + backgroundColor: gray[100], + '& .MuiChip-label': { + color: gray[500], + }, + '& .MuiChip-icon': { + color: gray[500], + }, + ...theme.applyStyles('dark', { + borderColor: gray[700], + backgroundColor: gray[800], + '& .MuiChip-label': { + color: gray[300], + }, + '& .MuiChip-icon': { + color: gray[300], + }, + }), + }, + }, + { + props: { + color: 'success', + }, + style: { + borderColor: green[200], + backgroundColor: green[50], + '& .MuiChip-label': { + color: green[500], + }, + '& .MuiChip-icon': { + color: green[500], + }, + ...theme.applyStyles('dark', { + borderColor: green[800], + backgroundColor: green[900], + '& .MuiChip-label': { + color: green[300], + }, + '& .MuiChip-icon': { + color: green[300], + }, + }), + }, + }, + { + props: { + color: 'error', + }, + style: { + borderColor: red[100], + backgroundColor: red[50], + '& .MuiChip-label': { + color: red[500], + }, + '& .MuiChip-icon': { + color: red[500], + }, + ...theme.applyStyles('dark', { + borderColor: red[800], + backgroundColor: red[900], + '& .MuiChip-label': { + color: red[200], + }, + '& .MuiChip-icon': { + color: red[300], + }, + }), + }, + }, + ], + }), + }, + }, + MuiIconButton: { + styleOverrides: { + root: ({ theme }) => ({ + boxShadow: 'none', + borderRadius: theme.shape.borderRadius, + textTransform: 'none', + fontWeight: theme.typography.fontWeightMedium, + letterSpacing: 0, + color: theme.palette.text.primary, + border: `1px solid ${theme.palette.divider}`, + backgroundColor: gray[50], + '&:hover': { + backgroundColor: gray[100], + borderColor: gray[300], + }, + '&:active': { + backgroundColor: gray[200], + }, + '& .MuiSvgIcon-root': { width: '1.125rem', height: '1.125rem' }, + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + '&:hover': { + backgroundColor: gray[900], + borderColor: gray[600], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + variants: [ + { + props: { + size: 'small', + }, + style: { + width: '2rem', + height: '2rem', + padding: '0.25rem', + }, + }, + { + props: { + size: 'medium', + }, + style: { + width: '2.5rem', + height: '2.5rem', + }, + }, + ], + }), + }, + }, + MuiInputBase: { + styleOverrides: { + root: { + border: 'none', + }, + }, + }, + MuiLinearProgress: { + styleOverrides: { + root: ({ theme }) => ({ + height: 8, + borderRadius: 8, + backgroundColor: gray[200], + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + }), + }), + }, + }, + MuiLink: { + defaultProps: { + underline: 'none', + }, + styleOverrides: { + root: ({ theme }) => ({ + color: brand[600], + fontWeight: 500, + position: 'relative', + textDecoration: 'none', + '&::before': { + content: '""', + position: 'absolute', + width: 0, + height: '1px', + bottom: 0, + left: 0, + backgroundColor: brand[200], + opacity: 0.7, + transition: 'width 0.3s ease, opacity 0.3s ease', + }, + '&:hover::before': { + width: '100%', + opacity: 1, + }, + '&:focus-visible': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '4px', + borderRadius: '2px', + }, + ...theme.applyStyles('dark', { + color: brand[200], + }), + }), + }, + }, + MuiList: { + styleOverrides: { + root: { + display: 'flex', + flexDirection: 'column', + gap: 8, + }, + }, + }, + MuiListItem: { + styleOverrides: { + root: ({ theme }) => ({ + padding: 0, + '&.Mui-selected': { borderRadius: theme.shape.borderRadius }, + }), + }, + }, + MuiListItemIcon: { + styleOverrides: { + root: ({ theme }) => ({ + minWidth: 0, + marginRight: '8px', + color: theme.palette.grey[500], + ...theme.applyStyles('dark', { color: theme.palette.grey[100] }), + }), + }, + }, + MuiListItemText: { + styleOverrides: { + root: ({ theme }) => ({ + color: theme.palette.grey[700], + ...theme.applyStyles('dark', { color: theme.palette.grey[50] }), + }), + primary: { fontWeight: 600 }, + }, + }, + MuiListItemButton: { + styleOverrides: { + root: ({ theme }) => ({ + padding: '4px 0', + borderRadius: theme.shape.borderRadius, + background: 'transparent', + }), + }, + }, + MuiMenu: { + styleOverrides: { + paper: ({ theme }) => ({ + marginTop: '4px', + padding: '0 8px', + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + backgroundImage: 'none', + boxShadow: + 'hsla(220, 30%, 5%, 0.07) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.07) 0px 8px 16px -5px', + '& .MuiMenuItem-root': { + borderRadius: 6, + padding: '6px 8px', + }, + '& .MuiMenu-list': { + '& .MuiDivider-root': { margin: '0 -8px' }, + }, + ...theme.applyStyles('dark', { + boxShadow: + 'hsla(220, 30%, 5%, 0.7) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.8) 0px 8px 16px -5px', + }), + }), + }, + }, + MuiOutlinedInput: { + styleOverrides: { + root: ({ theme }) => ({ + color: theme.palette.text.primary, + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + transition: 'border 120ms ease-in', + '&:hover': { + borderColor: gray[400], + }, + '&.Mui-focused': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + borderColor: brand[400], + }, + ...theme.applyStyles('dark', { + '&:hover': { + borderColor: gray[500], + }, + }), + variants: [ + { + props: { + size: 'small', + }, + style: { + height: '2rem', + padding: '0 0.5rem', + }, + }, + { + props: { + size: 'medium', + }, + style: { + height: '2.5rem', + }, + }, + ], + }), + notchedOutline: { + border: 'none', + }, + }, + }, + MuiPaper: { + defaultProps: { + elevation: 0, + }, + }, + MuiToggleButtonGroup: { + styleOverrides: { + root: ({ theme }) => ({ + borderRadius: '10px', + boxShadow: `0 4px 16px ${alpha(gray[400], 0.2)}`, + '& .Mui-selected': { + color: brand[500], + }, + ...theme.applyStyles('dark', { + '& .Mui-selected': { + color: '#fff', + }, + boxShadow: `0 4px 16px ${alpha(brand[700], 0.5)}`, + }), + }), + }, + }, + MuiToggleButton: { + styleOverrides: { + root: ({ theme }) => ({ + padding: '12px 16px', + textTransform: 'none', + borderRadius: '10px', + fontWeight: 500, + ...theme.applyStyles('dark', { + color: gray[400], + boxShadow: '0 4px 16px rgba(0, 0, 0, 0.5)', + '&.Mui-selected': { color: brand[300] }, + }), + }), + }, + }, + MuiTabs: { + styleOverrides: { + root: { minHeight: 'fit-content' }, + indicator: ({ theme }) => ({ + backgroundColor: theme.palette.grey[800], + ...theme.applyStyles('dark', { + backgroundColor: theme.palette.grey[200], + }), + }), + }, + }, + MuiTab: { + styleOverrides: { + root: ({ theme }) => ({ + padding: '6px 8px', + marginBottom: '8px', + textTransform: 'none', + minWidth: 'fit-content', + minHeight: 'fit-content', + color: theme.palette.text.secondary, + borderRadius: theme.shape.borderRadius, + border: '1px solid', + borderColor: 'transparent', + ':hover': { + color: theme.palette.text.primary, + backgroundColor: gray[100], + borderColor: gray[200], + }, + '&.Mui-selected': { + color: gray[900], + }, + ...theme.applyStyles('dark', { + ':hover': { + color: theme.palette.text.primary, + backgroundColor: gray[800], + borderColor: gray[700], + }, + '&.Mui-selected': { + color: '#fff', + }, + }), + }), + }, + }, + MuiInputAdornment: { + styleOverrides: { + root: ({ theme }) => ({ + color: theme.palette.grey[500], + ...theme.applyStyles('dark', { + color: theme.palette.grey[400], + }), + }), + }, + }, + MuiPickersPopper: { + styleOverrides: { + paper: ({ theme }) => ({ + marginTop: 4, + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + backgroundImage: 'none', + boxShadow: + 'hsla(220, 30%, 5%, 0.07) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.07) 0px 8px 16px -5px', + '& .MuiMenuItem-root': { borderRadius: 6, margin: '0 6px' }, + ...theme.applyStyles('dark', { + boxShadow: + 'hsla(220, 30%, 5%, 0.7) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.8) 0px 8px 16px -5px', + }), + }), + }, + }, + MuiPickersArrowSwitcher: { + styleOverrides: { + button: ({ theme }) => ({ + color: theme.palette.grey[500], + ...theme.applyStyles('dark', { + color: theme.palette.grey[400], + }), + }), + }, + }, + MuiPickersCalendarHeader: { + styleOverrides: { + switchViewButton: { + padding: 0, + border: 'none', + }, + }, + }, + MuiPickersMonth: { + styleOverrides: { + monthButton: ({ theme }) => ({ + fontSize: theme.typography.body1.fontSize, + color: theme.palette.grey[600], + padding: theme.spacing(0.5), + borderRadius: theme.shape.borderRadius, + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + backgroundColor: gray[700], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[700] }, + }, + ...theme.applyStyles('dark', { + color: theme.palette.grey[500], + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + color: theme.palette.common.black, + backgroundColor: gray[300], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[300] }, + }, + }), + }), + }, + }, + MuiPickersYear: { + styleOverrides: { + yearButton: ({ theme }) => ({ + fontSize: theme.typography.body1.fontSize, + color: theme.palette.grey[600], + padding: theme.spacing(0.5), + borderRadius: theme.shape.borderRadius, + height: 'fit-content', + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + backgroundColor: gray[700], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[700] }, + }, + ...theme.applyStyles('dark', { + color: theme.palette.grey[500], + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + color: theme.palette.common.black, + backgroundColor: gray[300], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[300] }, + }, + }), + }), + }, + }, + MuiPickersDay: { + styleOverrides: { + root: ({ theme }) => ({ + fontSize: theme.typography.body1.fontSize, + color: theme.palette.grey[600], + padding: theme.spacing(0.5), + borderRadius: theme.shape.borderRadius, + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + backgroundColor: gray[700], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[700] }, + }, + ...theme.applyStyles('dark', { + color: theme.palette.grey[500], + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + color: theme.palette.common.black, + backgroundColor: gray[300], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[300] }, + }, + }), + }), + }, + }, + MuiChartsAxis: { + styleOverrides: { + root: ({ theme }) => ({ + '& .MuiChartsAxis-line': { + stroke: gray[300], + }, + '& .MuiChartsAxis-tick': { + stroke: gray[300], + }, + '& .MuiChartsAxis-tickLabel': { + fill: gray[400], + fontWeight: 500, + }, + ...theme.applyStyles('dark', { + '& .MuiChartsAxis-line': { + stroke: gray[700], + }, + '& .MuiChartsAxis-tick': { + stroke: gray[700], + }, + '& .MuiChartsAxis-tickLabel': { + fill: gray[400], + fontWeight: 500, + }, + }), + }), + }, + }, + MuiChartsLegend: { + styleOverrides: { + root: { + '& .MuiChartsLegend-mark': { + ry: 6, + }, + }, + }, + }, + MuiChartsGrid: { + styleOverrides: { + root: ({ theme }) => ({ + '& .MuiChartsGrid-line': { + stroke: gray[200], + strokeDasharray: '4 2', + strokeWidth: 0.8, + }, + ...theme.applyStyles('dark', { + '& .MuiChartsGrid-line': { + stroke: gray[700], + strokeDasharray: '4 2', + strokeWidth: 0.8, + }, + }), + }), + }, + }, + MuiTreeItem2: { + styleOverrides: { + root: ({ theme }) => ({ + position: 'relative', + boxSizing: 'border-box', + padding: theme.spacing(0, 1), + '& .groupTransition': { + marginLeft: theme.spacing(2), + padding: theme.spacing(0), + borderLeft: '1px solid', + borderColor: theme.palette.divider, + }, + }), + content: ({ theme }) => ({ + marginTop: theme.spacing(1), + padding: theme.spacing(0.5, 1), + overflow: 'clip', + '&:hover': { + backgroundColor: alpha(gray[300], 0.2), + }, + '&.focused': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + '&:hover': { + backgroundColor: alpha(gray[300], 0.2), + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + }, + }, + '&.selected': { + backgroundColor: alpha(gray[300], 0.4), + '&:hover': { + backgroundColor: alpha(gray[300], 0.6), + }, + }, + ...theme.applyStyles('dark', { + '&:hover': { + backgroundColor: alpha(gray[500], 0.2), + }, + '&:focus-visible': { + '&:hover': { + backgroundColor: alpha(gray[500], 0.2), + }, + }, + '&.selected': { + backgroundColor: alpha(gray[500], 0.4), + '&:hover': { + backgroundColor: alpha(gray[500], 0.6), + }, + }, + }), + }), + }, + }, + MuiTablePagination: { + styleOverrides: { + actions: { + display: 'flex', + gap: 8, + marginRight: 6, + '& .MuiIconButton-root': { minWidth: 0, width: 36, height: 36 }, + }, + }, + }, + MuiDataGrid: { + styleOverrides: { + root: ({ theme }) => ({ + borderColor: theme.palette.divider, + }), + cell: ({ theme }) => ({ borderTopColor: theme.palette.divider }), + menu: ({ theme }) => ({ + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + backgroundImage: 'none', + boxShadow: + 'hsla(220, 30%, 5%, 0.07) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.07) 0px 8px 16px -5px', + '& .MuiMenuItem-root': { + borderRadius: theme.shape.borderRadius, + margin: '0 6px', + }, + ...theme.applyStyles('dark', { + boxShadow: + 'hsla(220, 30%, 5%, 0.7) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.8) 0px 8px 16px -5px', + }), + }), + row: ({ theme }) => ({ + // borderBottom: `1px solid ${theme.palette.divider}`, + '&:last-of-type': { borderBottom: `1px solid ${theme.palette.divider}` }, + '&:hover': { + background: alpha(theme.palette.primary.main, 0.1), + }, + '&.Mui-selected': { + background: theme.palette.grey[100], + '&:hover': { + background: alpha(theme.palette.primary.main, 0.2), + }, + }, + '&.even': { + background: alpha(theme.palette.grey[200], 0.3), + '&:hover': { + background: alpha(theme.palette.primary.main, 0.1), + }, + '&.Mui-selected': { + background: theme.palette.grey[100], + '&:hover': { + background: alpha(theme.palette.primary.main, 0.2), + }, + }, + }, + ...theme.applyStyles('dark', { + backgroundColor: theme.palette.grey[900], + '&.Mui-selected': { + background: theme.palette.grey[800], + }, + '&.even': { + background: alpha(theme.palette.grey[800], 0.4), + '&:hover': { + background: alpha(theme.palette.primary.main, 0.1), + }, + '&.Mui-selected': { + background: theme.palette.grey[800], + '&:hover': { + background: alpha(theme.palette.primary.main, 0.2), + }, + }, + }, + }), + }), + iconButtonContainer: ({ theme }) => ({ + '& .MuiIconButton-root': { + border: 'none', + backgroundColor: 'transparent', + '&:hover': { + backgroundColor: gray[100], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + color: gray[50], + '&:hover': { + backgroundColor: gray[800], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + }, + }), + menuIconButton: ({ theme }) => ({ + border: 'none', + backgroundColor: 'transparent', + '&:hover': { + backgroundColor: gray[100], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + color: gray[50], + '&:hover': { + backgroundColor: gray[800], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + }), + columnHeaderTitleContainer: { + flexGrow: 1, + justifyContent: 'space-between', + }, + columnHeaderDraggableContainer: { paddingRight: 2 }, + }, + }, + }, + }; +} diff --git a/docs/data/material/getting-started/templates/dashboard/getDashboardTheme.tsx b/docs/data/material/getting-started/templates/dashboard/getDashboardTheme.tsx new file mode 100644 index 00000000000000..b8922dd62fcb9b --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/getDashboardTheme.tsx @@ -0,0 +1,1121 @@ +import * as React from 'react'; +import type {} from '@mui/material/themeCssVarsAugmentation'; +import { ThemeOptions, alpha, Theme } from '@mui/material/styles'; +import { PaletteMode } from '@mui/material'; +import type {} from '@mui/x-date-pickers/themeAugmentation'; +import type {} from '@mui/x-charts/themeAugmentation'; +import type {} from '@mui/x-data-grid/themeAugmentation'; +import type {} from '@mui/x-tree-view/themeAugmentation'; +import CheckBoxOutlineBlankRoundedIcon from '@mui/icons-material/CheckBoxOutlineBlankRounded'; +import CheckRoundedIcon from '@mui/icons-material/CheckRounded'; +import RemoveRoundedIcon from '@mui/icons-material/RemoveRounded'; +import { brand, getDesignTokens, gray, green, red } from './themePrimitives'; + +export default function getDashboardTheme(mode: PaletteMode): ThemeOptions { + return { + ...getDesignTokens(mode), + components: { + MuiButtonBase: { + defaultProps: { + disableTouchRipple: true, + disableRipple: true, + }, + styleOverrides: { + root: ({ theme }) => ({ + boxSizing: 'border-box', + transition: 'all 100ms ease-in', + '&:focus-visible': { + outline: `3px solid ${alpha(theme.palette.primary.main, 0.5)}`, + outlineOffset: '2px', + }, + }), + }, + }, + MuiButton: { + styleOverrides: { + root: ({ theme }) => ({ + boxShadow: 'none', + borderRadius: theme.shape.borderRadius, + textTransform: 'none', + '& .MuiSvgIcon-root': { width: '1.125rem', height: '1.125rem' }, + variants: [ + { + props: { + size: 'small', + }, + style: { + height: '2rem', // 32px + padding: '0 0.5rem', + }, + }, + { + props: { + size: 'medium', + }, + style: { + height: '2.5rem', // 40px + }, + }, + { + props: { + color: 'primary', + variant: 'contained', + }, + style: { + color: 'white', + backgroundColor: gray[900], + backgroundImage: `linear-gradient(to bottom, ${gray[700]}, ${gray[800]})`, + boxShadow: `inset 0 2px 0 ${gray[600]}, inset 0 -2px 0 hsl(220, 0%, 0%)`, + border: `1px solid ${gray[700]}`, + '&:hover': { + backgroundImage: 'none', + backgroundColor: gray[700], + boxShadow: 'none', + }, + '&:active': { + backgroundColor: gray[800], + }, + ...theme.applyStyles('dark', { + color: 'black', + backgroundColor: gray[50], + backgroundImage: `linear-gradient(to bottom, ${gray[100]}, ${gray[50]})`, + boxShadow: + 'inset 0 2px 0 hsl(220, 0%, 100%), inset 0 -2px 0 hsl(220, 30%, 90%)', + border: `1px solid ${gray[100]}`, + '&:hover': { + backgroundImage: 'none', + backgroundColor: gray[300], + boxShadow: 'none', + }, + '&:active': { + backgroundColor: gray[400], + }, + }), + }, + }, + { + props: { + color: 'secondary', + variant: 'contained', + }, + style: { + color: 'white', + backgroundColor: brand[300], + backgroundImage: `linear-gradient(to bottom, ${alpha(brand[400], 0.8)}, ${brand[500]})`, + boxShadow: `inset 0 2px 0 ${alpha(brand[200], 0.2)}, inset 0 -2px 0 ${alpha(brand[700], 0.4)}`, + border: `1px solid ${brand[500]}`, + '&:hover': { + backgroundColor: brand[700], + boxShadow: 'none', + }, + '&:active': { + backgroundColor: brand[700], + backgroundImage: 'none', + }, + }, + }, + { + props: { + variant: 'outlined', + }, + style: { + color: theme.palette.text.primary, + border: `1px solid ${theme.palette.divider}`, + backgroundColor: gray[50], + '&:hover': { + backgroundColor: gray[100], + borderColor: gray[300], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + '&:hover': { + backgroundColor: gray[900], + borderColor: gray[600], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + }, + }, + { + props: { + color: 'secondary', + variant: 'outlined', + }, + style: { + color: brand[700], + border: '1px solid', + borderColor: brand[200], + backgroundColor: brand[50], + '&:hover': { + backgroundColor: brand[100], + borderColor: brand[400], + }, + '&:active': { + backgroundColor: alpha(brand[200], 0.7), + }, + ...theme.applyStyles('dark', { + color: brand[50], + border: '1px solid', + borderColor: brand[900], + backgroundColor: alpha(brand[900], 0.3), + '&:hover': { + borderColor: brand[700], + backgroundColor: alpha(brand[900], 0.6), + }, + '&:active': { + backgroundColor: alpha(brand[900], 0.5), + }, + }), + }, + }, + { + props: { + variant: 'text', + }, + style: { + color: gray[600], + '&:hover': { + backgroundColor: gray[100], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + color: gray[50], + '&:hover': { + backgroundColor: gray[700], + }, + '&:active': { + backgroundColor: alpha(gray[700], 0.7), + }, + }), + }, + }, + { + props: { + color: 'secondary', + variant: 'text', + }, + style: { + color: brand[700], + '&:hover': { + backgroundColor: alpha(brand[100], 0.5), + }, + '&:active': { + backgroundColor: alpha(brand[200], 0.7), + }, + ...theme.applyStyles('dark', { + color: brand[100], + '&:hover': { + backgroundColor: alpha(brand[900], 0.5), + }, + '&:active': { + backgroundColor: alpha(brand[900], 0.3), + }, + }), + }, + }, + ], + }), + }, + }, + MuiCard: { + styleOverrides: { + root: ({ theme }) => { + return { + padding: 16, + transition: 'all 100ms ease', + backgroundColor: gray[50], + borderRadius: theme.shape.borderRadius, + border: `1px solid ${alpha(gray[200], 0.5)}`, + boxShadow: 'none', + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + border: `1px solid ${alpha(gray[700], 0.3)}`, + }), + variants: [ + { + props: { + variant: 'outlined', + }, + style: { + border: `1px solid ${gray[200]}`, + boxShadow: 'none', + background: `linear-gradient(to bottom, hsl(0, 0%, 100%), ${gray[50]})`, + }, + }, + { + props: { + variant: 'outlined', + }, + style: { + ...theme.applyStyles('dark', { + border: `1px solid ${alpha(gray[700], 0.4)}`, + boxShadow: 'none', + background: `linear-gradient(to bottom, ${gray[900]}, ${alpha( + gray[800], + 0.5, + )})`, + }), + }, + }, + ], + }; + }, + }, + }, + MuiCheckbox: { + defaultProps: { + disableRipple: true, + icon: ( + + ), + checkedIcon: , + indeterminateIcon: , + }, + styleOverrides: { + root: ({ theme }) => ({ + margin: 10, + height: 16, + width: 16, + borderRadius: 5, + border: '1px solid ', + borderColor: alpha(gray[300], 0.8), + boxShadow: '0 0 0 1.5px hsla(210, 0%, 0%, 0.04) inset', + backgroundColor: alpha(gray[100], 0.4), + transition: 'border-color, background-color, 120ms ease-in', + '&:hover': { + borderColor: brand[300], + }, + '&.Mui-focusVisible': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + borderColor: brand[400], + }, + '&.Mui-checked': { + color: 'white', + backgroundColor: brand[500], + borderColor: brand[500], + boxShadow: `none`, + '&:hover': { + backgroundColor: brand[600], + }, + }, + ...theme.applyStyles('dark', { + borderColor: alpha(gray[700], 0.5), + boxShadow: '0 0 0 1.5px hsl(210, 0%, 0%) inset', + backgroundColor: alpha(gray[900], 0.8), + '&:hover': { + borderColor: brand[300], + }, + '&.Mui-focusVisible': { + borderColor: brand[400], + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + }, + }), + }), + }, + }, + MuiCardContent: { + styleOverrides: { + root: { + padding: 0, + '&:last-child': { paddingBottom: 0 }, + }, + }, + }, + MuiChip: { + styleOverrides: { + root: ({ theme }) => ({ + border: '1px solid', + borderRadius: '999px', + '& .MuiChip-label': { + padding: '0 4px', + fontWeight: 600, + }, + variants: [ + { + props: { + color: 'default', + }, + style: { + borderColor: gray[200], + backgroundColor: gray[100], + '& .MuiChip-label': { + color: gray[500], + }, + '& .MuiChip-icon': { + color: gray[500], + }, + ...theme.applyStyles('dark', { + borderColor: gray[700], + backgroundColor: gray[800], + '& .MuiChip-label': { + color: gray[300], + }, + '& .MuiChip-icon': { + color: gray[300], + }, + }), + }, + }, + { + props: { + color: 'success', + }, + style: { + borderColor: green[200], + backgroundColor: green[50], + '& .MuiChip-label': { + color: green[500], + }, + '& .MuiChip-icon': { + color: green[500], + }, + ...theme.applyStyles('dark', { + borderColor: green[800], + backgroundColor: green[900], + '& .MuiChip-label': { + color: green[300], + }, + '& .MuiChip-icon': { + color: green[300], + }, + }), + }, + }, + { + props: { + color: 'error', + }, + style: { + borderColor: red[100], + backgroundColor: red[50], + '& .MuiChip-label': { + color: red[500], + }, + '& .MuiChip-icon': { + color: red[500], + }, + ...theme.applyStyles('dark', { + borderColor: red[800], + backgroundColor: red[900], + '& .MuiChip-label': { + color: red[200], + }, + '& .MuiChip-icon': { + color: red[300], + }, + }), + }, + }, + ], + }), + }, + }, + MuiIconButton: { + styleOverrides: { + root: ({ theme }) => ({ + boxShadow: 'none', + borderRadius: theme.shape.borderRadius, + textTransform: 'none', + fontWeight: theme.typography.fontWeightMedium, + letterSpacing: 0, + color: theme.palette.text.primary, + border: `1px solid ${theme.palette.divider}`, + backgroundColor: gray[50], + '&:hover': { + backgroundColor: gray[100], + borderColor: gray[300], + }, + '&:active': { + backgroundColor: gray[200], + }, + '& .MuiSvgIcon-root': { width: '1.125rem', height: '1.125rem' }, + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + '&:hover': { + backgroundColor: gray[900], + borderColor: gray[600], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + variants: [ + { + props: { + size: 'small', + }, + style: { + width: '2rem', + height: '2rem', + padding: '0.25rem', + }, + }, + { + props: { + size: 'medium', + }, + style: { + width: '2.5rem', + height: '2.5rem', + }, + }, + ], + }), + }, + }, + MuiInputBase: { + styleOverrides: { + root: { + border: 'none', + }, + }, + }, + MuiLinearProgress: { + styleOverrides: { + root: ({ theme }) => ({ + height: 8, + borderRadius: 8, + backgroundColor: gray[200], + ...theme.applyStyles('dark', { + backgroundColor: gray[800], + }), + }), + }, + }, + MuiLink: { + defaultProps: { + underline: 'none', + }, + styleOverrides: { + root: ({ theme }) => ({ + color: brand[600], + fontWeight: 500, + position: 'relative', + textDecoration: 'none', + '&::before': { + content: '""', + position: 'absolute', + width: 0, + height: '1px', + bottom: 0, + left: 0, + backgroundColor: brand[200], + opacity: 0.7, + transition: 'width 0.3s ease, opacity 0.3s ease', + }, + '&:hover::before': { + width: '100%', + opacity: 1, + }, + '&:focus-visible': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '4px', + borderRadius: '2px', + }, + ...theme.applyStyles('dark', { + color: brand[200], + }), + }), + }, + }, + MuiList: { + styleOverrides: { + root: { + display: 'flex', + flexDirection: 'column', + gap: 8, + }, + }, + }, + MuiListItem: { + styleOverrides: { + root: ({ theme }) => ({ + padding: 0, + '&.Mui-selected': { borderRadius: theme.shape.borderRadius }, + }), + }, + }, + MuiListItemIcon: { + styleOverrides: { + root: ({ theme }) => ({ + minWidth: 0, + marginRight: '8px', + color: theme.palette.grey[500], + ...theme.applyStyles('dark', { color: theme.palette.grey[100] }), + }), + }, + }, + MuiListItemText: { + styleOverrides: { + root: ({ theme }) => ({ + color: theme.palette.grey[700], + ...theme.applyStyles('dark', { color: theme.palette.grey[50] }), + }), + primary: { fontWeight: 600 }, + }, + }, + MuiListItemButton: { + styleOverrides: { + root: ({ theme }) => ({ + padding: '4px 0', + borderRadius: theme.shape.borderRadius, + background: 'transparent', + }), + }, + }, + MuiMenu: { + styleOverrides: { + paper: ({ theme }) => ({ + marginTop: '4px', + padding: '0 8px', + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + backgroundImage: 'none', + boxShadow: + 'hsla(220, 30%, 5%, 0.07) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.07) 0px 8px 16px -5px', + '& .MuiMenuItem-root': { + borderRadius: 6, + padding: '6px 8px', + }, + '& .MuiMenu-list': { + '& .MuiDivider-root': { margin: '0 -8px' }, + }, + ...theme.applyStyles('dark', { + boxShadow: + 'hsla(220, 30%, 5%, 0.7) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.8) 0px 8px 16px -5px', + }), + }), + }, + }, + MuiOutlinedInput: { + styleOverrides: { + root: ({ theme }) => ({ + color: theme.palette.text.primary, + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + transition: 'border 120ms ease-in', + '&:hover': { + borderColor: gray[400], + }, + '&.Mui-focused': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + borderColor: brand[400], + }, + ...theme.applyStyles('dark', { + '&:hover': { + borderColor: gray[500], + }, + }), + variants: [ + { + props: { + size: 'small', + }, + style: { + height: '2rem', + padding: '0 0.5rem', + }, + }, + { + props: { + size: 'medium', + }, + style: { + height: '2.5rem', + }, + }, + ], + }), + notchedOutline: { + border: 'none', + }, + }, + }, + MuiPaper: { + defaultProps: { + elevation: 0, + }, + }, + MuiToggleButtonGroup: { + styleOverrides: { + root: ({ theme }) => ({ + borderRadius: '10px', + boxShadow: `0 4px 16px ${alpha(gray[400], 0.2)}`, + '& .Mui-selected': { + color: brand[500], + }, + ...theme.applyStyles('dark', { + '& .Mui-selected': { + color: '#fff', + }, + boxShadow: `0 4px 16px ${alpha(brand[700], 0.5)}`, + }), + }), + }, + }, + MuiToggleButton: { + styleOverrides: { + root: ({ theme }) => ({ + padding: '12px 16px', + textTransform: 'none', + borderRadius: '10px', + fontWeight: 500, + ...theme.applyStyles('dark', { + color: gray[400], + boxShadow: '0 4px 16px rgba(0, 0, 0, 0.5)', + '&.Mui-selected': { color: brand[300] }, + }), + }), + }, + }, + MuiTabs: { + styleOverrides: { + root: { minHeight: 'fit-content' }, + indicator: ({ theme }) => ({ + backgroundColor: theme.palette.grey[800], + ...theme.applyStyles('dark', { + backgroundColor: theme.palette.grey[200], + }), + }), + }, + }, + MuiTab: { + styleOverrides: { + root: ({ theme }) => ({ + padding: '6px 8px', + marginBottom: '8px', + textTransform: 'none', + minWidth: 'fit-content', + minHeight: 'fit-content', + color: theme.palette.text.secondary, + borderRadius: theme.shape.borderRadius, + border: '1px solid', + borderColor: 'transparent', + ':hover': { + color: theme.palette.text.primary, + backgroundColor: gray[100], + borderColor: gray[200], + }, + '&.Mui-selected': { + color: gray[900], + }, + ...theme.applyStyles('dark', { + ':hover': { + color: theme.palette.text.primary, + backgroundColor: gray[800], + borderColor: gray[700], + }, + '&.Mui-selected': { + color: '#fff', + }, + }), + }), + }, + }, + MuiInputAdornment: { + styleOverrides: { + root: ({ theme }) => ({ + color: theme.palette.grey[500], + ...theme.applyStyles('dark', { + color: theme.palette.grey[400], + }), + }), + }, + }, + MuiPickersPopper: { + styleOverrides: { + paper: ({ theme }) => ({ + marginTop: 4, + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + backgroundImage: 'none', + boxShadow: + 'hsla(220, 30%, 5%, 0.07) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.07) 0px 8px 16px -5px', + '& .MuiMenuItem-root': { borderRadius: 6, margin: '0 6px' }, + ...theme.applyStyles('dark', { + boxShadow: + 'hsla(220, 30%, 5%, 0.7) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.8) 0px 8px 16px -5px', + }), + }), + }, + }, + MuiPickersArrowSwitcher: { + styleOverrides: { + button: ({ theme }) => ({ + color: theme.palette.grey[500], + ...theme.applyStyles('dark', { + color: theme.palette.grey[400], + }), + }), + }, + }, + MuiPickersCalendarHeader: { + styleOverrides: { + switchViewButton: { + padding: 0, + border: 'none', + }, + }, + }, + MuiPickersMonth: { + styleOverrides: { + monthButton: ({ theme }) => ({ + fontSize: theme.typography.body1.fontSize, + color: theme.palette.grey[600], + padding: theme.spacing(0.5), + borderRadius: theme.shape.borderRadius, + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + backgroundColor: gray[700], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[700] }, + }, + ...theme.applyStyles('dark', { + color: theme.palette.grey[500], + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + color: theme.palette.common.black, + backgroundColor: gray[300], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[300] }, + }, + }), + }), + }, + }, + MuiPickersYear: { + styleOverrides: { + yearButton: ({ theme }) => ({ + fontSize: theme.typography.body1.fontSize, + color: theme.palette.grey[600], + padding: theme.spacing(0.5), + borderRadius: theme.shape.borderRadius, + height: 'fit-content', + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + backgroundColor: gray[700], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[700] }, + }, + ...theme.applyStyles('dark', { + color: theme.palette.grey[500], + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + color: theme.palette.common.black, + backgroundColor: gray[300], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[300] }, + }, + }), + }), + }, + }, + MuiPickersDay: { + styleOverrides: { + root: ({ theme }) => ({ + fontSize: theme.typography.body1.fontSize, + color: theme.palette.grey[600], + padding: theme.spacing(0.5), + borderRadius: theme.shape.borderRadius, + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + backgroundColor: gray[700], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[700] }, + }, + ...theme.applyStyles('dark', { + color: theme.palette.grey[500], + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, + '&.Mui-selected': { + color: theme.palette.common.black, + backgroundColor: gray[300], + }, + '&:focus': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + backgroundColor: 'transparent', + '&.Mui-selected': { backgroundColor: gray[300] }, + }, + }), + }), + }, + }, + MuiChartsAxis: { + styleOverrides: { + root: ({ theme }) => ({ + '& .MuiChartsAxis-line': { + stroke: gray[300], + }, + '& .MuiChartsAxis-tick': { + stroke: gray[300], + }, + '& .MuiChartsAxis-tickLabel': { + fill: gray[400], + fontWeight: 500, + }, + ...(theme as Omit).applyStyles('dark', { + '& .MuiChartsAxis-line': { + stroke: gray[700], + }, + '& .MuiChartsAxis-tick': { + stroke: gray[700], + }, + '& .MuiChartsAxis-tickLabel': { + fill: gray[400], + fontWeight: 500, + }, + }), + }), + }, + }, + MuiChartsLegend: { + styleOverrides: { + root: { + '& .MuiChartsLegend-mark': { + ry: 6, + }, + }, + }, + }, + MuiChartsGrid: { + styleOverrides: { + root: ({ theme }) => ({ + '& .MuiChartsGrid-line': { + stroke: gray[200], + strokeDasharray: '4 2', + strokeWidth: 0.8, + }, + ...(theme as Omit).applyStyles('dark', { + '& .MuiChartsGrid-line': { + stroke: gray[700], + strokeDasharray: '4 2', + strokeWidth: 0.8, + }, + }), + }), + }, + }, + MuiTreeItem2: { + styleOverrides: { + root: ({ theme }) => ({ + position: 'relative', + boxSizing: 'border-box', + padding: theme.spacing(0, 1), + '& .groupTransition': { + marginLeft: theme.spacing(2), + padding: theme.spacing(0), + borderLeft: '1px solid', + borderColor: theme.palette.divider, + }, + }), + content: ({ theme }) => ({ + marginTop: theme.spacing(1), + padding: theme.spacing(0.5, 1), + overflow: 'clip', + '&:hover': { + backgroundColor: alpha(gray[300], 0.2), + }, + '&.focused': { + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + '&:hover': { + backgroundColor: alpha(gray[300], 0.2), + outline: `3px solid ${alpha(brand[500], 0.5)}`, + outlineOffset: '2px', + }, + }, + '&.selected': { + backgroundColor: alpha(gray[300], 0.4), + '&:hover': { + backgroundColor: alpha(gray[300], 0.6), + }, + }, + ...theme.applyStyles('dark', { + '&:hover': { + backgroundColor: alpha(gray[500], 0.2), + }, + '&:focus-visible': { + '&:hover': { + backgroundColor: alpha(gray[500], 0.2), + }, + }, + '&.selected': { + backgroundColor: alpha(gray[500], 0.4), + '&:hover': { + backgroundColor: alpha(gray[500], 0.6), + }, + }, + }), + }), + }, + }, + MuiTablePagination: { + styleOverrides: { + actions: { + display: 'flex', + gap: 8, + marginRight: 6, + '& .MuiIconButton-root': { minWidth: 0, width: 36, height: 36 }, + }, + }, + }, + MuiDataGrid: { + styleOverrides: { + root: ({ theme }) => ({ + borderColor: theme.palette.divider, + }), + + cell: ({ theme }) => ({ borderTopColor: theme.palette.divider }), + menu: ({ theme }) => ({ + borderRadius: theme.shape.borderRadius, + border: `1px solid ${theme.palette.divider}`, + backgroundImage: 'none', + boxShadow: + 'hsla(220, 30%, 5%, 0.07) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.07) 0px 8px 16px -5px', + '& .MuiMenuItem-root': { + borderRadius: theme.shape.borderRadius, + margin: '0 6px', + }, + ...theme.applyStyles('dark', { + boxShadow: + 'hsla(220, 30%, 5%, 0.7) 0px 4px 16px 0px, hsla(220, 25%, 10%, 0.8) 0px 8px 16px -5px', + }), + }), + row: ({ theme }) => ({ + // borderBottom: `1px solid ${theme.palette.divider}`, + '&:last-of-type': { borderBottom: `1px solid ${theme.palette.divider}` }, + '&:hover': { + background: alpha(theme.palette.primary.main, 0.1), + }, + '&.Mui-selected': { + background: theme.palette.grey[100], + '&:hover': { + background: alpha(theme.palette.primary.main, 0.2), + }, + }, + '&.even': { + background: alpha(theme.palette.grey[200], 0.3), + '&:hover': { + background: alpha(theme.palette.primary.main, 0.1), + }, + '&.Mui-selected': { + background: theme.palette.grey[100], + '&:hover': { + background: alpha(theme.palette.primary.main, 0.2), + }, + }, + }, + ...theme.applyStyles('dark', { + backgroundColor: theme.palette.grey[900], + '&.Mui-selected': { + background: theme.palette.grey[800], + }, + '&.even': { + background: alpha(theme.palette.grey[800], 0.4), + '&:hover': { + background: alpha(theme.palette.primary.main, 0.1), + }, + '&.Mui-selected': { + background: theme.palette.grey[800], + '&:hover': { + background: alpha(theme.palette.primary.main, 0.2), + }, + }, + }, + }), + }), + iconButtonContainer: ({ theme }) => ({ + '& .MuiIconButton-root': { + border: 'none', + backgroundColor: 'transparent', + '&:hover': { + backgroundColor: gray[100], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + color: gray[50], + '&:hover': { + backgroundColor: gray[800], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + }, + }), + menuIconButton: ({ theme }) => ({ + border: 'none', + backgroundColor: 'transparent', + '&:hover': { + backgroundColor: gray[100], + }, + '&:active': { + backgroundColor: gray[200], + }, + ...theme.applyStyles('dark', { + color: gray[50], + '&:hover': { + backgroundColor: gray[800], + }, + '&:active': { + backgroundColor: gray[900], + }, + }), + }), + + columnHeaderTitleContainer: { + flexGrow: 1, + justifyContent: 'space-between', + }, + columnHeaderDraggableContainer: { paddingRight: 2 }, + }, + }, + }, + }; +} diff --git a/docs/data/material/getting-started/templates/dashboard/internals/components/Copyright.js b/docs/data/material/getting-started/templates/dashboard/internals/components/Copyright.js new file mode 100644 index 00000000000000..c4310abda3e321 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/components/Copyright.js @@ -0,0 +1,16 @@ +import * as React from 'react'; +import Link from '@mui/material/Link'; +import Typography from '@mui/material/Typography'; + +export default function Copyright(props) { + return ( + + {'Copyright © '} + + Sitemark + {' '} + {new Date().getFullYear()} + {'.'} + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/internals/components/Copyright.tsx b/docs/data/material/getting-started/templates/dashboard/internals/components/Copyright.tsx new file mode 100644 index 00000000000000..52f72c48f2c05d --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/components/Copyright.tsx @@ -0,0 +1,16 @@ +import * as React from 'react'; +import Link from '@mui/material/Link'; +import Typography from '@mui/material/Typography'; + +export default function Copyright(props: any) { + return ( + + {'Copyright © '} + + Sitemark + {' '} + {new Date().getFullYear()} + {'.'} + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/internals/components/CustomIcons.js b/docs/data/material/getting-started/templates/dashboard/internals/components/CustomIcons.js new file mode 100644 index 00000000000000..8cc34623cfa8b6 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/components/CustomIcons.js @@ -0,0 +1,326 @@ +import * as React from 'react'; +import SvgIcon from '@mui/material/SvgIcon'; + +export function SitemarkIcon() { + return ( + + + + + + + + + + + + + ); +} + +export function IndiaFlag() { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +export function UsaFlag() { + return ( + + + + + + + + + + + + + + + + + + + + + + ); +} +export function BrazilFlag() { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +export function GlobeFlag() { + return ( + + + + + + + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/internals/components/CustomIcons.tsx b/docs/data/material/getting-started/templates/dashboard/internals/components/CustomIcons.tsx new file mode 100644 index 00000000000000..8cc34623cfa8b6 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/components/CustomIcons.tsx @@ -0,0 +1,326 @@ +import * as React from 'react'; +import SvgIcon from '@mui/material/SvgIcon'; + +export function SitemarkIcon() { + return ( + + + + + + + + + + + + + ); +} + +export function IndiaFlag() { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +export function UsaFlag() { + return ( + + + + + + + + + + + + + + + + + + + + + + ); +} +export function BrazilFlag() { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} + +export function GlobeFlag() { + return ( + + + + + + + + + + + + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/internals/components/ToggleCustomTheme.js b/docs/data/material/getting-started/templates/dashboard/internals/components/ToggleCustomTheme.js new file mode 100644 index 00000000000000..21a8f10f6e75b1 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/components/ToggleCustomTheme.js @@ -0,0 +1,50 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import Box from '@mui/material/Box'; +import ToggleButton from '@mui/material/ToggleButton'; +import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; +import AutoAwesomeRoundedIcon from '@mui/icons-material/AutoAwesomeRounded'; + +function ToggleCustomTheme({ showCustomTheme, toggleCustomTheme }) { + return ( + + + + + Custom theme + + Material Design 2 + + + ); +} + +ToggleCustomTheme.propTypes = { + showCustomTheme: PropTypes.shape({ + valueOf: PropTypes.func.isRequired, + }).isRequired, + toggleCustomTheme: PropTypes.func.isRequired, +}; + +export default ToggleCustomTheme; diff --git a/docs/data/material/getting-started/templates/dashboard/internals/components/ToggleCustomTheme.tsx b/docs/data/material/getting-started/templates/dashboard/internals/components/ToggleCustomTheme.tsx new file mode 100644 index 00000000000000..58df9e79a64226 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/components/ToggleCustomTheme.tsx @@ -0,0 +1,48 @@ +import * as React from 'react'; +import Box from '@mui/material/Box'; +import ToggleButton from '@mui/material/ToggleButton'; +import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; +import AutoAwesomeRoundedIcon from '@mui/icons-material/AutoAwesomeRounded'; + +interface ToggleCustomThemeProps { + showCustomTheme: Boolean; + toggleCustomTheme: () => void; +} + +export default function ToggleCustomTheme({ + showCustomTheme, + toggleCustomTheme, +}: ToggleCustomThemeProps) { + return ( + + + + + Custom theme + + Material Design 2 + + + ); +} diff --git a/docs/data/material/getting-started/templates/dashboard/internals/data/gridData.js b/docs/data/material/getting-started/templates/dashboard/internals/data/gridData.js new file mode 100644 index 00000000000000..a24b8589635fe2 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/data/gridData.js @@ -0,0 +1,145 @@ +import * as React from 'react'; +import Avatar from '@mui/material/Avatar'; +import Chip from '@mui/material/Chip'; + +export function renderStatus(params) { + const colors = { + new: 'info', + verified: 'success', + blocked: 'error', + uncertain: 'default', + }; + + return ( + + ); +} +export function renderAvatar(params) { + if (params.value == null) { + return ''; + } + + return ( + + {params.value.name.toUpperCase().substring(0, 1)} + + ); +} + +export const columns = [ + { field: 'id', headerName: 'ID', width: 90 }, + { field: 'pageTitle', headerName: 'Page Title', width: 200 }, + { field: 'eventCount', headerName: 'Event Count', width: 130 }, + { field: 'users', headerName: 'Users', width: 100 }, + { + field: 'viewsPerUser', + headerName: 'Views per User', + width: 130, + }, + { field: 'averageTime', headerName: 'Average Time', width: 130 }, + { field: 'conversions', headerName: 'Conversions', width: 120 }, +]; + +export const rows = [ + { + id: 1, + pageTitle: 'Homepage Overview', + eventCount: 6345, + users: 192423, + viewsPerUser: 19.2, + averageTime: '2m 23s', + conversions: 400, + }, + { + id: 2, + pageTitle: 'Product Details - Gadgets', + eventCount: 4653, + users: 152240, + viewsPerUser: 10.2, + averageTime: '2m 23s', + conversions: 321, + }, + { + id: 3, + pageTitle: 'Checkout Process - Step 1', + eventCount: 2455, + users: 61240, + viewsPerUser: 16.4, + averageTime: '2m 23s', + conversions: 120, + }, + { + id: 4, + pageTitle: 'User Profile Dashboard', + eventCount: 123543, + users: 102240, + viewsPerUser: 3.74, + averageTime: '2m 23s', + conversions: 40, + }, + { + id: 5, + pageTitle: 'Article Listing - Tech News', + eventCount: 4653, + users: 132240, + viewsPerUser: 2.24, + averageTime: '2m 23s', + conversions: 49, + }, + { + id: 6, + pageTitle: 'FAQs - Customer Support', + eventCount: 123543, + users: 12240, + viewsPerUser: 3.67, + averageTime: '2m 23s', + conversions: 80, + }, + { + id: 7, + pageTitle: 'About Us - Company Info', + eventCount: 4653, + users: 19240, + viewsPerUser: 1.02, + averageTime: '2m 23s', + conversions: 2, + }, + { + id: 8, + pageTitle: 'Contact Form Page', + eventCount: 123543, + users: 12240, + viewsPerUser: 3.67, + averageTime: '2m 23s', + conversions: 80, + }, + { + id: 9, + pageTitle: 'Services Overview - Web Development', + eventCount: 6345, + users: 19240, + viewsPerUser: 1.02, + averageTime: '2m 23s', + conversions: 2, + }, + { + id: 10, + pageTitle: 'Pricing Page - Subscription Plans', + eventCount: 2455, + users: 12240, + viewsPerUser: 3.67, + averageTime: '2m 23s', + conversions: 80, + }, +]; diff --git a/docs/data/material/getting-started/templates/dashboard/internals/data/gridData.tsx b/docs/data/material/getting-started/templates/dashboard/internals/data/gridData.tsx new file mode 100644 index 00000000000000..62552af61e0f60 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/internals/data/gridData.tsx @@ -0,0 +1,154 @@ +import * as React from 'react'; +import Avatar from '@mui/material/Avatar'; +import Chip from '@mui/material/Chip'; +import { GridCellParams, GridRowsProp, GridColDef } from '@mui/x-data-grid'; + +export function renderStatus( + params: GridCellParams< + { status: 'verified' | 'new' | 'blocked' | 'uncertain' }, + any, + any + >, +) { + const colors: { [index: string]: 'error' | 'success' | 'info' | 'default' } = { + new: 'info', + verified: 'success', + blocked: 'error', + uncertain: 'default', + }; + + return ( + + ); +} +export function renderAvatar( + params: GridCellParams<{ name: string; color: string }, any, any>, +) { + if (params.value == null) { + return ''; + } + + return ( + + {params.value.name.toUpperCase().substring(0, 1)} + + ); +} + +export const columns: GridColDef[] = [ + { field: 'id', headerName: 'ID', width: 90 }, + { field: 'pageTitle', headerName: 'Page Title', width: 200 }, + { field: 'eventCount', headerName: 'Event Count', width: 130 }, + { field: 'users', headerName: 'Users', width: 100 }, + { + field: 'viewsPerUser', + headerName: 'Views per User', + width: 130, + }, + { field: 'averageTime', headerName: 'Average Time', width: 130 }, + { field: 'conversions', headerName: 'Conversions', width: 120 }, +]; + +export const rows: GridRowsProp = [ + { + id: 1, + pageTitle: 'Homepage Overview', + eventCount: 6345, + users: 192423, + viewsPerUser: 19.2, + averageTime: '2m 23s', + conversions: 400, + }, + { + id: 2, + pageTitle: 'Product Details - Gadgets', + eventCount: 4653, + users: 152240, + viewsPerUser: 10.2, + averageTime: '2m 23s', + conversions: 321, + }, + { + id: 3, + pageTitle: 'Checkout Process - Step 1', + eventCount: 2455, + users: 61240, + viewsPerUser: 16.4, + averageTime: '2m 23s', + conversions: 120, + }, + { + id: 4, + pageTitle: 'User Profile Dashboard', + eventCount: 123543, + users: 102240, + viewsPerUser: 3.74, + averageTime: '2m 23s', + conversions: 40, + }, + { + id: 5, + pageTitle: 'Article Listing - Tech News', + eventCount: 4653, + users: 132240, + viewsPerUser: 2.24, + averageTime: '2m 23s', + conversions: 49, + }, + { + id: 6, + pageTitle: 'FAQs - Customer Support', + eventCount: 123543, + users: 12240, + viewsPerUser: 3.67, + averageTime: '2m 23s', + conversions: 80, + }, + { + id: 7, + pageTitle: 'About Us - Company Info', + eventCount: 4653, + users: 19240, + viewsPerUser: 1.02, + averageTime: '2m 23s', + conversions: 2, + }, + { + id: 8, + pageTitle: 'Contact Form Page', + eventCount: 123543, + users: 12240, + viewsPerUser: 3.67, + averageTime: '2m 23s', + conversions: 80, + }, + { + id: 9, + pageTitle: 'Services Overview - Web Development', + eventCount: 6345, + users: 19240, + viewsPerUser: 1.02, + averageTime: '2m 23s', + conversions: 2, + }, + { + id: 10, + pageTitle: 'Pricing Page - Subscription Plans', + eventCount: 2455, + users: 12240, + viewsPerUser: 3.67, + averageTime: '2m 23s', + conversions: 80, + }, +]; diff --git a/docs/data/material/getting-started/templates/dashboard/listItems.js b/docs/data/material/getting-started/templates/dashboard/listItems.js deleted file mode 100644 index 7d4090b3c738dd..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/listItems.js +++ /dev/null @@ -1,72 +0,0 @@ -import * as React from 'react'; -import ListItemButton from '@mui/material/ListItemButton'; -import ListItemIcon from '@mui/material/ListItemIcon'; -import ListItemText from '@mui/material/ListItemText'; -import ListSubheader from '@mui/material/ListSubheader'; -import DashboardIcon from '@mui/icons-material/Dashboard'; -import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; -import PeopleIcon from '@mui/icons-material/People'; -import BarChartIcon from '@mui/icons-material/BarChart'; -import LayersIcon from '@mui/icons-material/Layers'; -import AssignmentIcon from '@mui/icons-material/Assignment'; - -export const mainListItems = ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export const secondaryListItems = ( - - - Saved reports - - - - - - - - - - - - - - - - - - - - -); diff --git a/docs/data/material/getting-started/templates/dashboard/listItems.tsx b/docs/data/material/getting-started/templates/dashboard/listItems.tsx deleted file mode 100644 index 7d4090b3c738dd..00000000000000 --- a/docs/data/material/getting-started/templates/dashboard/listItems.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import * as React from 'react'; -import ListItemButton from '@mui/material/ListItemButton'; -import ListItemIcon from '@mui/material/ListItemIcon'; -import ListItemText from '@mui/material/ListItemText'; -import ListSubheader from '@mui/material/ListSubheader'; -import DashboardIcon from '@mui/icons-material/Dashboard'; -import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; -import PeopleIcon from '@mui/icons-material/People'; -import BarChartIcon from '@mui/icons-material/BarChart'; -import LayersIcon from '@mui/icons-material/Layers'; -import AssignmentIcon from '@mui/icons-material/Assignment'; - -export const mainListItems = ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -); - -export const secondaryListItems = ( - - - Saved reports - - - - - - - - - - - - - - - - - - - - -); diff --git a/docs/data/material/getting-started/templates/dashboard/themePrimitives.js b/docs/data/material/getting-started/templates/dashboard/themePrimitives.js new file mode 100644 index 00000000000000..1b98cf9e83a5e6 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/themePrimitives.js @@ -0,0 +1,203 @@ +import { createTheme, alpha } from '@mui/material/styles'; + +const customTheme = createTheme(); + +export const brand = { + 50: 'hsl(210, 100%, 95%)', + 100: 'hsl(210, 100%, 92%)', + 200: 'hsl(210, 100%, 80%)', + 300: 'hsl(210, 100%, 65%)', + 400: 'hsl(210, 98%, 48%)', + 500: 'hsl(210, 98%, 42%)', + 600: 'hsl(210, 98%, 55%)', + 700: 'hsl(210, 100%, 35%)', + 800: 'hsl(210, 100%, 16%)', + 900: 'hsl(210, 100%, 21%)', +}; + +export const gray = { + 50: 'hsl(220, 60%, 97%)', + 100: 'hsl(220, 35%, 94%)', + 200: 'hsl(220, 35%, 88%)', + 300: 'hsl(220, 25%, 80%)', + 400: 'hsl(220, 20%, 65%)', + 500: 'hsl(220, 20%, 42%)', + 600: 'hsl(220, 25%, 35%)', + 700: 'hsl(220, 25%, 25%)', + 800: 'hsl(220, 25%, 10%)', + 900: 'hsl(220, 30%, 5%)', +}; + +export const green = { + 50: 'hsl(120, 80%, 98%)', + 100: 'hsl(120, 75%, 94%)', + 200: 'hsl(120, 75%, 87%)', + 300: 'hsl(120, 61%, 77%)', + 400: 'hsl(120, 44%, 53%)', + 500: 'hsl(120, 59%, 30%)', + 600: 'hsl(120, 70%, 25%)', + 700: 'hsl(120, 75%, 16%)', + 800: 'hsl(120, 84%, 10%)', + 900: 'hsl(120, 87%, 6%)', +}; + +export const orange = { + 50: 'hsl(45, 100%, 97%)', + 100: 'hsl(45, 92%, 90%)', + 200: 'hsl(45, 94%, 80%)', + 300: 'hsl(45, 90%, 65%)', + 400: 'hsl(45, 90%, 40%)', + 500: 'hsl(45, 90%, 35%)', + 600: 'hsl(45, 91%, 25%)', + 700: 'hsl(45, 94%, 20%)', + 800: 'hsl(45, 95%, 16%)', + 900: 'hsl(45, 93%, 12%)', +}; + +export const red = { + 50: 'hsl(0, 100%, 97%)', + 100: 'hsl(0, 92%, 90%)', + 200: 'hsl(0, 94%, 80%)', + 300: 'hsl(0, 90%, 65%)', + 400: 'hsl(0, 90%, 40%)', + 500: 'hsl(0, 90%, 30%)', + 600: 'hsl(0, 91%, 25%)', + 700: 'hsl(0, 94%, 18%)', + 800: 'hsl(0, 95%, 12%)', + 900: 'hsl(0, 93%, 6%)', +}; + +export const getDesignTokens = (mode) => ({ + palette: { + mode, + primary: { + light: brand[200], + main: brand[500], + dark: brand[800], + contrastText: brand[50], + ...(mode === 'dark' && { + contrastText: brand[50], + light: brand[300], + main: brand[400], + dark: brand[800], + }), + }, + info: { + light: brand[100], + main: brand[300], + dark: brand[600], + contrastText: gray[50], + ...(mode === 'dark' && { + contrastText: brand[300], + light: brand[500], + main: brand[700], + dark: brand[900], + }), + }, + warning: { + light: orange[300], + main: orange[400], + dark: orange[800], + ...(mode === 'dark' && { + light: orange[400], + main: orange[500], + dark: orange[700], + }), + }, + error: { + light: red[300], + main: red[400], + dark: red[800], + ...(mode === 'dark' && { + light: red[400], + main: red[500], + dark: red[700], + }), + }, + success: { + light: green[300], + main: green[400], + dark: green[800], + ...(mode === 'dark' && { + light: green[400], + main: green[500], + dark: green[700], + }), + }, + grey: { + ...gray, + }, + divider: mode === 'dark' ? alpha(gray[600], 0.3) : alpha(gray[300], 0.5), + background: { + default: gray[50], + paper: gray[100], + ...(mode === 'dark' && { default: gray[900], paper: gray[800] }), + }, + text: { + primary: gray[800], + secondary: gray[600], + warning: orange[400], + ...(mode === 'dark' && { primary: 'hsl(0, 0%, 100%)', secondary: gray[400] }), + }, + action: { + hover: alpha(gray[300], 0.2), + selected: `${alpha(brand[200], 0.2)}`, + ...(mode === 'dark' && { + hover: alpha(gray[500], 0.2), + selected: alpha(brand[800], 0.2), + }), + }, + }, + typography: { + fontFamily: ['"Inter", "sans-serif"'].join(','), + h1: { + fontSize: customTheme.typography.pxToRem(48), + fontWeight: 600, + lineHeight: 1.2, + letterSpacing: -0.5, + }, + h2: { + fontSize: customTheme.typography.pxToRem(36), + fontWeight: 600, + lineHeight: 1.2, + }, + h3: { + fontSize: customTheme.typography.pxToRem(30), + lineHeight: 1.2, + }, + h4: { + fontSize: customTheme.typography.pxToRem(24), + fontWeight: 600, + lineHeight: 1.5, + }, + h5: { + fontSize: customTheme.typography.pxToRem(20), + fontWeight: 600, + }, + h6: { + fontSize: customTheme.typography.pxToRem(18), + fontWeight: 600, + }, + subtitle1: { + fontSize: customTheme.typography.pxToRem(18), + }, + subtitle2: { + fontSize: customTheme.typography.pxToRem(14), + fontWeight: 500, + }, + body1: { + fontSize: customTheme.typography.pxToRem(14), + }, + body2: { + fontSize: customTheme.typography.pxToRem(14), + fontWeight: 400, + }, + caption: { + fontSize: customTheme.typography.pxToRem(12), + fontWeight: 400, + }, + }, + shape: { + borderRadius: 10, + }, +}); diff --git a/docs/data/material/getting-started/templates/dashboard/themePrimitives.ts b/docs/data/material/getting-started/templates/dashboard/themePrimitives.ts new file mode 100644 index 00000000000000..c4b4887c7b62e5 --- /dev/null +++ b/docs/data/material/getting-started/templates/dashboard/themePrimitives.ts @@ -0,0 +1,226 @@ +import { PaletteMode } from '@mui/material'; +import { createTheme, alpha } from '@mui/material/styles'; + +declare module '@mui/material/Paper' { + interface PaperPropsVariantOverrides { + highlighted: true; + } +} +declare module '@mui/material/styles/createPalette' { + interface ColorRange { + 50: string; + 100: string; + 200: string; + 300: string; + 400: string; + 500: string; + 600: string; + 700: string; + 800: string; + 900: string; + } + + interface PaletteColor extends ColorRange {} +} + +const customTheme = createTheme(); + +export const brand = { + 50: 'hsl(210, 100%, 95%)', + 100: 'hsl(210, 100%, 92%)', + 200: 'hsl(210, 100%, 80%)', + 300: 'hsl(210, 100%, 65%)', + 400: 'hsl(210, 98%, 48%)', + 500: 'hsl(210, 98%, 42%)', + 600: 'hsl(210, 98%, 55%)', + 700: 'hsl(210, 100%, 35%)', + 800: 'hsl(210, 100%, 16%)', + 900: 'hsl(210, 100%, 21%)', +}; + +export const gray = { + 50: 'hsl(220, 60%, 97%)', + 100: 'hsl(220, 35%, 94%)', + 200: 'hsl(220, 35%, 88%)', + 300: 'hsl(220, 25%, 80%)', + 400: 'hsl(220, 20%, 65%)', + 500: 'hsl(220, 20%, 42%)', + 600: 'hsl(220, 25%, 35%)', + 700: 'hsl(220, 25%, 25%)', + 800: 'hsl(220, 25%, 10%)', + 900: 'hsl(220, 30%, 5%)', +}; + +export const green = { + 50: 'hsl(120, 80%, 98%)', + 100: 'hsl(120, 75%, 94%)', + 200: 'hsl(120, 75%, 87%)', + 300: 'hsl(120, 61%, 77%)', + 400: 'hsl(120, 44%, 53%)', + 500: 'hsl(120, 59%, 30%)', + 600: 'hsl(120, 70%, 25%)', + 700: 'hsl(120, 75%, 16%)', + 800: 'hsl(120, 84%, 10%)', + 900: 'hsl(120, 87%, 6%)', +}; + +export const orange = { + 50: 'hsl(45, 100%, 97%)', + 100: 'hsl(45, 92%, 90%)', + 200: 'hsl(45, 94%, 80%)', + 300: 'hsl(45, 90%, 65%)', + 400: 'hsl(45, 90%, 40%)', + 500: 'hsl(45, 90%, 35%)', + 600: 'hsl(45, 91%, 25%)', + 700: 'hsl(45, 94%, 20%)', + 800: 'hsl(45, 95%, 16%)', + 900: 'hsl(45, 93%, 12%)', +}; + +export const red = { + 50: 'hsl(0, 100%, 97%)', + 100: 'hsl(0, 92%, 90%)', + 200: 'hsl(0, 94%, 80%)', + 300: 'hsl(0, 90%, 65%)', + 400: 'hsl(0, 90%, 40%)', + 500: 'hsl(0, 90%, 30%)', + 600: 'hsl(0, 91%, 25%)', + 700: 'hsl(0, 94%, 18%)', + 800: 'hsl(0, 95%, 12%)', + 900: 'hsl(0, 93%, 6%)', +}; + +export const getDesignTokens = (mode: PaletteMode) => ({ + palette: { + mode, + primary: { + light: brand[200], + main: brand[500], + dark: brand[800], + contrastText: brand[50], + ...(mode === 'dark' && { + contrastText: brand[50], + light: brand[300], + main: brand[400], + dark: brand[800], + }), + }, + info: { + light: brand[100], + main: brand[300], + dark: brand[600], + contrastText: gray[50], + ...(mode === 'dark' && { + contrastText: brand[300], + light: brand[500], + main: brand[700], + dark: brand[900], + }), + }, + warning: { + light: orange[300], + main: orange[400], + dark: orange[800], + ...(mode === 'dark' && { + light: orange[400], + main: orange[500], + dark: orange[700], + }), + }, + error: { + light: red[300], + main: red[400], + dark: red[800], + ...(mode === 'dark' && { + light: red[400], + main: red[500], + dark: red[700], + }), + }, + success: { + light: green[300], + main: green[400], + dark: green[800], + ...(mode === 'dark' && { + light: green[400], + main: green[500], + dark: green[700], + }), + }, + grey: { + ...gray, + }, + divider: mode === 'dark' ? alpha(gray[600], 0.3) : alpha(gray[300], 0.5), + background: { + default: gray[50], + paper: gray[100], + ...(mode === 'dark' && { default: gray[900], paper: gray[800] }), + }, + text: { + primary: gray[800], + secondary: gray[600], + warning: orange[400], + ...(mode === 'dark' && { primary: 'hsl(0, 0%, 100%)', secondary: gray[400] }), + }, + action: { + hover: alpha(gray[300], 0.2), + selected: `${alpha(brand[200], 0.2)}`, + ...(mode === 'dark' && { + hover: alpha(gray[500], 0.2), + selected: alpha(brand[800], 0.2), + }), + }, + }, + typography: { + fontFamily: ['"Inter", "sans-serif"'].join(','), + h1: { + fontSize: customTheme.typography.pxToRem(48), + fontWeight: 600, + lineHeight: 1.2, + letterSpacing: -0.5, + }, + h2: { + fontSize: customTheme.typography.pxToRem(36), + fontWeight: 600, + lineHeight: 1.2, + }, + h3: { + fontSize: customTheme.typography.pxToRem(30), + lineHeight: 1.2, + }, + h4: { + fontSize: customTheme.typography.pxToRem(24), + fontWeight: 600, + lineHeight: 1.5, + }, + h5: { + fontSize: customTheme.typography.pxToRem(20), + fontWeight: 600, + }, + h6: { + fontSize: customTheme.typography.pxToRem(18), + fontWeight: 600, + }, + subtitle1: { + fontSize: customTheme.typography.pxToRem(18), + }, + subtitle2: { + fontSize: customTheme.typography.pxToRem(14), + fontWeight: 500, + }, + body1: { + fontSize: customTheme.typography.pxToRem(14), + }, + body2: { + fontSize: customTheme.typography.pxToRem(14), + fontWeight: 400, + }, + caption: { + fontSize: customTheme.typography.pxToRem(12), + fontWeight: 400, + }, + }, + shape: { + borderRadius: 10, + }, +}); diff --git a/docs/package.json b/docs/package.json index b40c0f2b96984e..e54e3bc6de9b6e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -33,9 +33,9 @@ "@mui/base": "workspace:*", "@mui/docs": "workspace:^", "@mui/icons-material": "workspace:^", + "@mui/internal-markdown": "workspace:^", "@mui/joy": "workspace:*", "@mui/lab": "workspace:*", - "@mui/internal-markdown": "workspace:^", "@mui/material": "workspace:^", "@mui/styled-engine": "workspace:^", "@mui/styled-engine-sc": "workspace:^", @@ -68,6 +68,7 @@ "css-mediaquery": "^0.1.2", "date-fns": "^2.30.0", "date-fns-jalali": "^2.21.3-1", + "dayjs": "^1.11.10", "feed": "^4.2.2", "fg-loadcss": "^3.1.0", "final-form": "^4.20.10", diff --git a/docs/pages/experiments/website/dashboard-template-theme.tsx b/docs/pages/experiments/website/dashboard-template-theme.tsx new file mode 100644 index 00000000000000..d89cf524819b30 --- /dev/null +++ b/docs/pages/experiments/website/dashboard-template-theme.tsx @@ -0,0 +1,286 @@ +import * as React from 'react'; +import PropTypes from 'prop-types'; +import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; +import Card from '@mui/material/Card'; +import CardActions from '@mui/material/CardActions'; +import CardContent from '@mui/material/CardContent'; +import Container from '@mui/material/Container'; +import CssBaseline from '@mui/material/CssBaseline'; +import Divider from '@mui/material/Divider'; +import IconButton from '@mui/material/IconButton'; +import LinearProgress from '@mui/material/LinearProgress'; +import Link from '@mui/material/Link'; +import Menu from '@mui/material/Menu'; +import MenuItem from '@mui/material/MenuItem'; +import OutlinedInput from '@mui/material/OutlinedInput'; +import Stack from '@mui/material/Stack'; +import Tab from '@mui/material/Tab'; +import Tabs from '@mui/material/Tabs'; +import Typography from '@mui/material/Typography'; + +import MoreVertIcon from '@mui/icons-material/MoreVert'; +import NotificationsRoundedIcon from '@mui/icons-material/NotificationsRounded'; +import WbSunnyRoundedIcon from '@mui/icons-material/WbSunnyRounded'; +import ModeNightRoundedIcon from '@mui/icons-material/ModeNightRounded'; + +import { createTheme, ThemeProvider } from '@mui/material/styles'; +import { PaletteMode } from '@mui/material'; + +import Head from 'docs/src/modules/components/Head'; +import getDashboardTheme from 'docs/data/material/getting-started/templates/dashboard/getDashboardTheme'; +import CustomDatePicker from 'docs/data/material/getting-started/templates/dashboard/components/CustomDatePicker'; + +interface ToggleColorModeProps { + mode: PaletteMode; + toggleColorMode: () => void; +} + +export function ToggleColorMode({ mode, toggleColorMode }: ToggleColorModeProps) { + return ( + + + {mode === 'dark' ? ( + + ) : ( + + )} + + + ); +} + +function CustomTabPanel(props: { [x: string]: any; children: any; value: any; index: any }) { + const { children, value, index, ...other } = props; + + return ( + + ); +} + +CustomTabPanel.propTypes = { + children: PropTypes.node, + index: PropTypes.number.isRequired, + value: PropTypes.number.isRequired, +}; + +function a11yProps(index: number) { + return { + id: `simple-tab-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, + }; +} + +export default function DashboardTemplateTheme() { + const [mode, setMode] = React.useState('light'); + const dashboardTheme = createTheme(getDashboardTheme(mode)); + const toggleColorMode = () => { + setMode((prev) => (prev === 'dark' ? 'light' : 'dark')); + }; + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + const handleClick = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); + }; + const handleClose = () => { + setAnchorEl(null); + }; + const [value, setValue] = React.useState(0); + const handleChange = (_event: any, newValue: React.SetStateAction) => { + setValue(newValue); + }; + + return ( + + + + + + + Dashboard template theme + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Word of the Day + + + be•nev•o•lent + + + adjective + + + well meaning and kindly. +
+ {'"a benevolent smile"'} +
+
+ + + +
+ + + + Word of the Day + + + be•nev•o•lent + + + adjective + + + well meaning and kindly. +
+ {'"a benevolent smile"'} +
+
+ + + +
+
+ + + Link + + + + + + + Profile + My account + + Add another account + Settings + Logout + + + + + + + + + + + + + + + + + + + + + Item One + + + Item Two + + + Item Three + + +
+
+ ); +} diff --git a/docs/public/static/images/templates/dashboard-dark.png b/docs/public/static/images/templates/dashboard-dark.png index 42984725db85dc..5caee83f9c31a3 100644 Binary files a/docs/public/static/images/templates/dashboard-dark.png and b/docs/public/static/images/templates/dashboard-dark.png differ diff --git a/docs/public/static/images/templates/dashboard-light.png b/docs/public/static/images/templates/dashboard-light.png index e93b5e52c57954..721390ed90afe6 100644 Binary files a/docs/public/static/images/templates/dashboard-light.png and b/docs/public/static/images/templates/dashboard-light.png differ diff --git a/packages/mui-docs/src/translations/translations.json b/packages/mui-docs/src/translations/translations.json index 7ce0de59c20934..306501b6a72c1a 100644 --- a/packages/mui-docs/src/translations/translations.json +++ b/packages/mui-docs/src/translations/translations.json @@ -94,7 +94,7 @@ "copySource": "Copy the source", "copySourceLinkJS": "Copy link to JavaScript source", "copySourceLinkTS": "Copy link to TypeScript source", - "dashboardDescr": "Contains a taskbar and a mini variant drawer. The chart is courtesy of Recharts.", + "dashboardDescr": "A collection of charts and complex components in a responsive dashboard layout.", "dashboardTitle": "Dashboard", "decreaseSpacing": "decrease spacing", "demoToolbarLabel": "demo source", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f865b7063848af..dfc0c4e7abe42b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -639,10 +639,10 @@ importers: version: 7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(react-dom@18.2.0)(react@18.2.0) '@mui/x-date-pickers': specifier: 7.5.1 - version: 7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(react-dom@18.2.0)(react@18.2.0) + version: 7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0) '@mui/x-date-pickers-pro': specifier: 7.5.1 - version: 7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(react-dom@18.2.0)(react@18.2.0) + version: 7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0) '@mui/x-license': specifier: 7.2.1 version: 7.2.1(@types/react@18.2.55)(react@18.2.0) @@ -697,6 +697,9 @@ importers: date-fns-jalali: specifier: ^2.21.3-1 version: 2.21.3-1 + dayjs: + specifier: ^1.11.10 + version: 1.11.10 feed: specifier: ^4.2.2 version: 4.2.2 @@ -5559,7 +5562,7 @@ packages: - '@types/react' dev: false - /@mui/x-date-pickers-pro@7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(react-dom@18.2.0)(react@18.2.0): + /@mui/x-date-pickers-pro@7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-aTBPoPE2CnTNMnE80wKJcypM39n7g6hYrvhOF+u8uVy0/W61w07AZVMNfVklBxi7QehZn+tfgF9NAfJLcwSL7g==} engines: {node: '>=14.0.0'} peerDependencies: @@ -5602,11 +5605,12 @@ packages: '@mui/material': link:packages/mui-material/build '@mui/system': 5.15.14(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@types/react@18.2.55)(react@18.2.0) '@mui/utils': 5.15.14(@types/react@18.2.55)(react@18.2.0) - '@mui/x-date-pickers': 7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(react-dom@18.2.0)(react@18.2.0) + '@mui/x-date-pickers': 7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0) '@mui/x-license': 7.2.1(@types/react@18.2.55)(react@18.2.0) clsx: 2.1.1 date-fns: 2.30.0 date-fns-jalali: 2.21.3-1 + dayjs: 1.11.10 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -5615,7 +5619,7 @@ packages: - '@types/react' dev: false - /@mui/x-date-pickers@7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(react-dom@18.2.0)(react@18.2.0): + /@mui/x-date-pickers@7.5.1(@emotion/react@11.11.4)(@emotion/styled@11.11.5)(@mui/material@packages+mui-material+build)(@types/react@18.2.55)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(dayjs@1.11.10)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-O3K2pewxk5u9mK8PG0+xgIOAn+GSBRWHtU0ZbzaqCjS8ZbxNT2OhkI0aXqp/W2ECVwxYaGjwtjl3ypQIdqRvjw==} engines: {node: '>=14.0.0'} peerDependencies: @@ -5662,6 +5666,7 @@ packages: clsx: 2.1.1 date-fns: 2.30.0 date-fns-jalali: 2.21.3-1 + dayjs: 1.11.10 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) diff --git a/test/regressions/index.js b/test/regressions/index.js index 2d6fe49c0dad6e..55e2bee3072859 100644 --- a/test/regressions/index.js +++ b/test/regressions/index.js @@ -27,6 +27,10 @@ importRegressionFixtures.keys().forEach((path) => { }, []); const blacklist = [ + 'docs-getting-started-templates-dashboard-internals-components/CustomIcons.png', // No public components + 'docs-getting-started-templates-dashboard-components/SideNav.png', // No public components + 'docs-getting-started-templates-dashboard-components/PageViewsBarChart.png', // No public components + 'docs-getting-started-templates-dashboard-components/StatCard.png', // No public components 'docs-getting-started-templates-sign-in-side/CustomIcons.png', // Theme file 'docs-getting-started-templates-sign-in/CustomIcons.png', // Theme file 'docs-getting-started-templates-sign-up/CustomIcons.png', // Theme file