Skip to content

Commit

Permalink
[website] Update MUI X deps and migrate TreeView demos to v7 API (#42149
Browse files Browse the repository at this point in the history
)

Signed-off-by: Nora <72460825+noraleonte@users.noreply.github.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
  • Loading branch information
3 people committed May 9, 2024
1 parent 2fe514a commit 93e2591
Show file tree
Hide file tree
Showing 9 changed files with 569 additions and 539 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { extendTheme } from '@mui/joy/styles';
import Box from '@mui/joy/Box';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import ThemeViewer, {
useNodeIdsLazy,
useItemIdsLazy,
} from 'docs/src/modules/components/ThemeViewer';

const defaultTheme = extendTheme();
Expand Down Expand Up @@ -39,7 +39,7 @@ export default function JoyDefaultTheme() {
}, []);

const data = defaultTheme;
const allNodeIds = useNodeIdsLazy(data);
const allNodeIds = useItemIdsLazy(data);
React.useDebugValue(allNodeIds);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import FormControlLabel from '@mui/material/FormControlLabel';
import Switch from '@mui/material/Switch';
import { useTranslate } from '@mui/docs/i18n';
import ThemeViewer, {
useNodeIdsLazy,
useItemIdsLazy,
} from 'docs/src/modules/components/ThemeViewer';
import { blue, grey } from '@mui/docs/branding';

Expand Down Expand Up @@ -104,7 +104,7 @@ function DefaultTheme() {
});
}, [darkTheme]);

const allNodeIds = useNodeIdsLazy(data);
const allNodeIds = useItemIdsLazy(data);
React.useDebugValue(allNodeIds);
React.useEffect(() => {
if (checked) {
Expand Down
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
"@mui/system": "workspace:^",
"@mui/types": "workspace:^",
"@mui/utils": "workspace:^",
"@mui/x-charts": "6.19.8",
"@mui/x-charts": "7.3.2",
"@mui/x-data-grid": "7.3.1",
"@mui/x-data-grid-generator": "7.3.1",
"@mui/x-data-grid-premium": "7.3.1",
"@mui/x-data-grid-pro": "7.3.1",
"@mui/x-date-pickers": "6.19.9",
"@mui/x-date-pickers-pro": "6.19.9",
"@mui/x-license-pro": "6.10.2",
"@mui/x-tree-view": "6.17.0",
"@mui/x-date-pickers": "7.3.2",
"@mui/x-date-pickers-pro": "7.3.2",
"@mui/x-license": "7.2.0",
"@mui/x-tree-view": "7.3.1",
"@popperjs/core": "^2.11.8",
"@react-spring/web": "^9.7.3",
"autoprefixer": "^10.4.19",
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { loadCSS } from 'fg-loadcss/src/loadCSS';
import NextHead from 'next/head';
import PropTypes from 'prop-types';
import { useRouter } from 'next/router';
import { LicenseInfo } from '@mui/x-data-grid-pro';
import { LicenseInfo } from '@mui/x-license';
import materialPkgJson from 'packages/mui-material/package.json';
import joyPkgJson from 'packages/mui-joy/package.json';
import systemPkgJson from 'packages/mui-system/package.json';
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/productX/XDateRangeDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const endDate = new Date();
endDate.setDate(endDate.getDate() + 28);

function CustomRangeShortcuts(props: PickersShortcutsProps<DateRange<Date>>) {
const { items, onChange, isValid } = props;
const { items, onChange, isValid, changeImportance = 'accept' } = props;

if (items == null || items.length === 0) {
return null;
Expand All @@ -31,7 +31,7 @@ function CustomRangeShortcuts(props: PickersShortcutsProps<DateRange<Date>>) {
return {
label: item.label,
onClick: () => {
onChange(newValue);
onChange(newValue, changeImportance, item);
},
disabled: !isValid(newValue),
};
Expand Down

0 comments on commit 93e2591

Please sign in to comment.