Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Use re exported utils from packages in docs examples #13901

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/data/charts/composition/LimitOverflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import Slider from '@mui/material/Slider';
import Box from '@mui/material/Box';
import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox';
import useId from '@mui/utils/useId';

import { useId } from '@mui/x-charts/utils';
import { ChartContainer } from '@mui/x-charts/ChartContainer';
import { ScatterPlot } from '@mui/x-charts/ScatterChart';
import { LinePlot, MarkPlot } from '@mui/x-charts/LineChart';
Expand Down
3 changes: 1 addition & 2 deletions docs/data/charts/composition/LimitOverflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import Slider from '@mui/material/Slider';
import Box from '@mui/material/Box';
import FormControlLabel from '@mui/material/FormControlLabel';
import Checkbox from '@mui/material/Checkbox';
import useId from '@mui/utils/useId';

import { useId } from '@mui/x-charts/utils';
import { ChartContainer } from '@mui/x-charts/ChartContainer';
import { ScatterPlot } from '@mui/x-charts/ScatterChart';
import { LinePlot, MarkPlot } from '@mui/x-charts/LineChart';
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/editing/CustomEditComponent.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Rating from '@mui/material/Rating';
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
import { useEnhancedEffect } from '@mui/x-data-grid/utils';
import { DataGrid, useGridApiContext } from '@mui/x-data-grid';

function renderRating(params) {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/editing/CustomEditComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Rating from '@mui/material/Rating';
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
import { useEnhancedEffect } from '@mui/x-data-grid/utils';
import {
DataGrid,
GridRenderCellParams,
Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/filtering/MultiFilteringPanelSnap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { DataGridPro, GridLogicOperator, useGridApiRef } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator';
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
import { useEnhancedEffect } from '@mui/x-data-grid/utils';

const VISIBLE_FIELDS = ['name', 'rating', 'country', 'dateCreated', 'isAdmin'];

Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/filtering/MultiFilteringPanelSnap.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { DataGridPro, GridLogicOperator, useGridApiRef } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator';
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
import { useEnhancedEffect } from '@mui/x-data-grid/utils';

const VISIBLE_FIELDS = ['name', 'rating', 'country', 'dateCreated', 'isAdmin'];

Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/performance/GridVisualization.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { unstable_useForkRef as useForkRef } from '@mui/utils';
import { useForkRef } from '@mui/x-data-grid/utils';
import { DataGridPro, GridCell } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator';

Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/performance/GridVisualization.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import { unstable_useForkRef as useForkRef } from '@mui/utils';
import { useForkRef } from '@mui/x-data-grid/utils';
import { DataGridPro, GridCell } from '@mui/x-data-grid-pro';
import { useDemoData } from '@mui/x-data-grid-generator';

Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/row-updates/LazyLoadingGrid.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { unstable_debounce as debounce } from '@mui/utils';
import { debounce } from '@mui/x-data-grid/utils';
import { DataGridPro, useGridApiRef } from '@mui/x-data-grid-pro';
import { createFakeServer, loadServerRows } from '@mui/x-data-grid-generator';

Expand Down
2 changes: 1 addition & 1 deletion docs/data/data-grid/row-updates/LazyLoadingGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { unstable_debounce as debounce } from '@mui/utils';
import { debounce } from '@mui/x-data-grid/utils';
import {
DataGridPro,
GridFetchRowsParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from '@mui/material/Button';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import DialogActions from '@mui/material/DialogActions';
import { unstable_useId as useId } from '@mui/utils';
import { useId } from '@mui/x-date-pickers/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { StaticDatePicker } from '@mui/x-date-pickers/StaticDatePicker';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from '@mui/material/Button';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import DialogActions from '@mui/material/DialogActions';
import { unstable_useId as useId } from '@mui/utils';
import { useId } from '@mui/x-date-pickers/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { StaticDatePicker } from '@mui/x-date-pickers/StaticDatePicker';
Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/custom-field/BrowserV7Field.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import useForkRef from '@mui/utils/useForkRef';
import { styled } from '@mui/material/styles';
import { useForkRef } from '@mui/x-date-pickers/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/custom-field/BrowserV7Field.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import useForkRef from '@mui/utils/useForkRef';
import { styled } from '@mui/material/styles';
import { useForkRef } from '@mui/x-date-pickers/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DatePicker, DatePickerProps } from '@mui/x-date-pickers/DatePicker';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as React from 'react';
import useForkRef from '@mui/utils/useForkRef';
import useSlotProps from '@mui/utils/useSlotProps';
import { styled } from '@mui/material/styles';
import Stack from '@mui/material/Stack';
import { useSlotProps, useForkRef } from '@mui/x-date-pickers-pro/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as React from 'react';
import useForkRef from '@mui/utils/useForkRef';
import useSlotProps from '@mui/utils/useSlotProps';
import { styled } from '@mui/material/styles';
import Stack from '@mui/material/Stack';
import { useSlotProps, useForkRef } from '@mui/x-date-pickers-pro/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { PickerValidDate } from '@mui/x-date-pickers/models';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from 'react';
import useForkRef from '@mui/utils/useForkRef';
import useSlotProps from '@mui/utils/useSlotProps';
import { styled } from '@mui/material/styles';
import IconButton from '@mui/material/IconButton';
import InputAdornment from '@mui/material/InputAdornment';
import { useSlotProps, useForkRef } from '@mui/x-date-pickers-pro/utils';
import { DateRangeIcon } from '@mui/x-date-pickers/icons';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as React from 'react';
import useForkRef from '@mui/utils/useForkRef';
import useSlotProps from '@mui/utils/useSlotProps';
import { styled } from '@mui/material/styles';
import IconButton from '@mui/material/IconButton';
import InputAdornment from '@mui/material/InputAdornment';
import { useSlotProps, useForkRef } from '@mui/x-date-pickers-pro/utils';
import { DateRangeIcon } from '@mui/x-date-pickers/icons';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
useColorScheme as useMaterialColorScheme,
Experimental_CssVarsProvider as MaterialCssVarsProvider,
} from '@mui/material/styles';
import useSlotProps from '@mui/utils/useSlotProps';
import {
extendTheme as extendJoyTheme,
useColorScheme,
Expand All @@ -17,6 +16,7 @@ import Stack from '@mui/joy/Stack';
import FormControl from '@mui/joy/FormControl';
import FormLabel from '@mui/joy/FormLabel';
import Typography from '@mui/joy/Typography';
import { useSlotProps } from '@mui/x-date-pickers-pro/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
useColorScheme as useMaterialColorScheme,
Experimental_CssVarsProvider as MaterialCssVarsProvider,
} from '@mui/material/styles';
import useSlotProps from '@mui/utils/useSlotProps';
import {
extendTheme as extendJoyTheme,
useColorScheme,
Expand All @@ -17,6 +16,7 @@ import Stack, { StackProps } from '@mui/joy/Stack';
import FormControl from '@mui/joy/FormControl';
import FormLabel from '@mui/joy/FormLabel';
import Typography, { TypographyProps } from '@mui/joy/Typography';
import { useSlotProps } from '@mui/x-date-pickers-pro/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { PickerValidDate } from '@mui/x-date-pickers/models';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
useColorScheme as useMaterialColorScheme,
Experimental_CssVarsProvider as MaterialCssVarsProvider,
} from '@mui/material/styles';
import useSlotProps from '@mui/utils/useSlotProps';
import {
extendTheme as extendJoyTheme,
useColorScheme,
Expand All @@ -16,6 +15,7 @@ import FormControl from '@mui/joy/FormControl';
import FormLabel from '@mui/joy/FormLabel';
import IconButton from '@mui/joy/IconButton';
import { DateRangeIcon } from '@mui/x-date-pickers/icons';
import { useSlotProps } from '@mui/x-date-pickers-pro/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
useColorScheme as useMaterialColorScheme,
Experimental_CssVarsProvider as MaterialCssVarsProvider,
} from '@mui/material/styles';
import useSlotProps from '@mui/utils/useSlotProps';
import {
extendTheme as extendJoyTheme,
useColorScheme,
Expand All @@ -16,6 +15,7 @@ import FormControl from '@mui/joy/FormControl';
import FormLabel from '@mui/joy/FormLabel';
import IconButton from '@mui/joy/IconButton';
import { DateRangeIcon } from '@mui/x-date-pickers/icons';
import { useSlotProps } from '@mui/x-date-pickers-pro/utils';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import dayjs from 'dayjs';
import { useRifm } from 'rifm';
import TextField from '@mui/material/TextField';
import useControlled from '@mui/utils/useControlled';
import { useControlled } from '@mui/x-date-pickers/utils';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import dayjs, { Dayjs } from 'dayjs';
import { useRifm } from 'rifm';
import TextField from '@mui/material/TextField';
import useControlled from '@mui/utils/useControlled';
import { useControlled } from '@mui/x-date-pickers/utils';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/lifecycle/ServerInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Button from '@mui/material/Button';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DateField } from '@mui/x-date-pickers/DateField';
import useControlled from '@mui/utils/useControlled';
import { useControlled } from '@mui/x-date-pickers/utils';

function DisplayEvents(props) {
const { logs, title } = props;
Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/lifecycle/ServerInteraction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Button from '@mui/material/Button';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DateField, DateFieldProps } from '@mui/x-date-pickers/DateField';
import useControlled from '@mui/utils/useControlled';
import { useControlled } from '@mui/x-date-pickers/utils';

type DisplayEventsProps = {
logs: (Dayjs | null)[];
Expand Down
1 change: 1 addition & 0 deletions packages/x-charts-pro/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@mui/x-charts/utils';
1 change: 1 addition & 0 deletions packages/x-charts/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as useId } from '@mui/utils/useId';
3 changes: 3 additions & 0 deletions packages/x-data-grid/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
export type { OutputSelector } from './createSelector';
export { default as useEnhancedEffect } from '@mui/utils/useEnhancedEffect';
export { default as useForkRef } from '@mui/utils/useForkRef';
export { default as debounce } from '@mui/utils/debounce';
1 change: 1 addition & 0 deletions packages/x-date-pickers-pro/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@mui/x-date-pickers/utils';
4 changes: 4 additions & 0 deletions packages/x-date-pickers/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as useSlotProps } from '@mui/utils/useSlotProps';
export { default as useForkRef } from '@mui/utils/useForkRef';
export { default as useId } from '@mui/utils/useId';
export { default as useControlled } from '@mui/utils/useControlled';