Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Oct 31, 2024
2 parents 5b0029f + 1ca98d3 commit 2b77887
Show file tree
Hide file tree
Showing 91 changed files with 104 additions and 139 deletions.
2 changes: 1 addition & 1 deletion packages/x-charts-pro/src/Heatmap/Heatmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import { useThemeProps } from '@mui/material/styles';
import useId from '@mui/utils/useId';
import { MakeOptional } from '@mui/x-internals/types';
import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
import { ChartsAxis, ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
import {
Expand All @@ -12,7 +13,6 @@ import {
ChartsTooltipSlots,
} from '@mui/x-charts/ChartsTooltip';
import {
MakeOptional,
ChartsAxisSlots,
ChartsAxisSlotProps,
ChartsXAxisProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts-pro/src/models/seriesType/heatmap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DefaultizedProps } from '@mui/x-internals/types';
import {
DefaultizedProps,
CommonDefaultizedProps,
CommonSeriesType,
CartesianSeriesType,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts-pro/src/typeOverloads/modules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DefaultizedProps } from '@mui/x-charts/internals';
import { DefaultizedProps } from '@mui/x-internals/types';
import {
HeatmapItemIdentifier,
HeatmapSeriesType,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { useThemeProps } from '@mui/material/styles';
import { MakeOptional } from '@mui/x-internals/types';
import { BarPlot, BarPlotProps, BarPlotSlotProps, BarPlotSlots } from './BarPlot';
import {
ResponsiveChartContainer,
ResponsiveChartContainerProps,
} from '../ResponsiveChartContainer';
import { ChartsAxis, ChartsAxisProps } from '../ChartsAxis';
import { BarSeriesType } from '../models/seriesType/bar';
import { MakeOptional } from '../models/helpers';
import {
ChartsTooltip,
ChartsTooltipProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/BarChart/BarElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { styled } from '@mui/material/styles';
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
import { AnimatedProps, animated } from '@react-spring/web';
import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
import { SeriesId } from '../models/seriesType/common';
import { useItemHighlighted } from '../context';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/BarChart/BarLabel/BarLabelItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import useSlotProps from '@mui/utils/useSlotProps';
import PropTypes from 'prop-types';
import { SlotComponentPropsFromProps } from '../../internals/SlotComponentPropsFromProps';
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
import { useUtilityClasses } from './barLabelClasses';
import { BarLabelOwnerState, BarItem, BarLabelContext } from './BarLabel.types';
import { getBarLabel } from './getBarLabel';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/BarChart/formatter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
import { warnOnce } from '@mui/x-internals/warning';
import { DefaultizedProps } from '@mui/x-internals/types';
import { getStackingGroups } from '../internals/stackSeries';
import { ChartSeries, DatasetElementType, DatasetType } from '../models/seriesType/config';
import { defaultizeValueFormatter } from '../internals/defaultizeValueFormatter';
import { DefaultizedProps } from '../models/helpers';
import { SeriesId } from '../models/seriesType/common';
import { SeriesFormatter } from '../context/PluginProvider/SeriesFormatter.types';

Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartContainer/ChartContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import { MakeOptional } from '@mui/x-internals/types';
import { DrawingProvider, DrawingProviderProps } from '../context/DrawingProvider';
import { SeriesProvider, SeriesProviderProps } from '../context/SeriesProvider';
import { InteractionProvider } from '../context/InteractionProvider';
Expand All @@ -16,7 +17,6 @@ import {
import { PluginProvider, PluginProviderProps } from '../context/PluginProvider';
import { useChartContainerProps } from './useChartContainerProps';
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../models/axis';
import { MakeOptional } from '../models/helpers';
import { AnimationProvider, AnimationProviderProps } from '../context/AnimationProvider';

export type ChartContainerProps = Omit<
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartContainer/useDefaultizeAxis.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import * as React from 'react';
import { MakeOptional } from '@mui/x-internals/types';
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
import { MakeOptional } from '../models/helpers';
import { AxisConfig, ScaleName } from '../models';
import { ChartsAxisProps } from '../models/axis';
import { DatasetType } from '../models/seriesType/config';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartsLegend/ChartsLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import useSlotProps from '@mui/utils/useSlotProps';
import composeClasses from '@mui/utils/composeClasses';
import { DefaultizedProps } from '@mui/x-internals/types';
import { useThemeProps, useTheme, Theme } from '@mui/material/styles';
import { getSeriesToDisplay } from './utils';
import { getLegendUtilityClass } from './chartsLegendClasses';
import { DefaultizedProps } from '../models/helpers';
import { DefaultChartsLegend, LegendRendererProps } from './DefaultChartsLegend';
import { useSeries } from '../hooks/useSeries';
import { LegendPlacement } from './legend.types';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartsLegend/LegendPerItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';
import * as React from 'react';
import { DefaultizedProps } from '@mui/x-internals/types';
import NoSsr from '@mui/material/NoSsr';
import { useTheme, styled } from '@mui/material/styles';
import { DrawingArea } from '../context/DrawingProvider';
Expand All @@ -12,7 +13,6 @@ import { useDrawingArea } from '../hooks/useDrawingArea';
import { AnchorPosition, Direction, LegendPlacement } from './legend.types';
import { ChartsLegendItem } from './ChartsLegendItem';
import { ChartsLegendClasses } from './chartsLegendClasses';
import { DefaultizedProps } from '../models/helpers';

export type ChartsLegendRootOwnerState = {
position: AnchorPosition;
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartsOverlay/ChartsOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import * as React from 'react';
import { SxProps, Theme } from '@mui/material/styles';
import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
import { ChartsLoadingOverlay } from './ChartsLoadingOverlay';
import { useSeries } from '../hooks/useSeries';
import { SeriesId } from '../models/seriesType/common';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/AreaElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import composeClasses from '@mui/utils/composeClasses';
import useSlotProps from '@mui/utils/useSlotProps';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
import { AnimatedArea, AnimatedAreaProps } from './AnimatedArea';
import { SeriesId } from '../models/seriesType/common';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { useThemeProps } from '@mui/material/styles';
import { MakeOptional } from '@mui/x-internals/types';
import { AreaPlot, AreaPlotProps, AreaPlotSlotProps, AreaPlotSlots } from './AreaPlot';
import { LinePlot, LinePlotProps, LinePlotSlotProps, LinePlotSlots } from './LinePlot';
import {
Expand All @@ -11,7 +12,6 @@ import {
import { MarkPlot, MarkPlotProps, MarkPlotSlotProps, MarkPlotSlots } from './MarkPlot';
import { ChartsAxis, ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
import { LineSeriesType } from '../models/seriesType/line';
import { MakeOptional } from '../models/helpers';
import {
ChartsTooltip,
ChartsTooltipProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/LineElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import composeClasses from '@mui/utils/composeClasses';
import useSlotProps from '@mui/utils/useSlotProps';
import generateUtilityClass from '@mui/utils/generateUtilityClass';
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
import { AnimatedLine, AnimatedLineProps } from './AnimatedLine';
import { SeriesId } from '../models/seriesType/common';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/LineHighlightPlot.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import { SlotComponentPropsFromProps } from '../internals/SlotComponentPropsFromProps';
import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
import { useCartesianContext } from '../context/CartesianProvider';
import { LineHighlightElement, LineHighlightElementProps } from './LineHighlightElement';
import { getValueToPositionMapper } from '../hooks/useScale';
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/LineChart/formatter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
import { warnOnce } from '@mui/x-internals/warning';
import { DefaultizedProps } from '@mui/x-internals/types';
import { getStackingGroups } from '../internals/stackSeries';
import { ChartSeries, DatasetElementType, DatasetType } from '../models/seriesType/config';
import { defaultizeValueFormatter } from '../internals/defaultizeValueFormatter';
import { DefaultizedProps } from '../models/helpers';
import { SeriesId } from '../models/seriesType/common';
import { SeriesFormatter } from '../context/PluginProvider/SeriesFormatter.types';

Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/PieChart/PieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import * as React from 'react';
import PropTypes from 'prop-types';
import { useRtl } from '@mui/system/RtlProvider';
import { useThemeProps } from '@mui/material/styles';
import { MakeOptional } from '@mui/x-internals/types';
import {
ResponsiveChartContainer,
ResponsiveChartContainerProps,
} from '../ResponsiveChartContainer';
import { ChartsAxis, ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
import { PieSeriesType } from '../models/seriesType';
import { MakeOptional } from '../models/helpers';
import { DEFAULT_X_AXIS_KEY } from '../constants';
import {
ChartsTooltip,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ScatterChart/ScatterChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { useThemeProps } from '@mui/material/styles';
import { MakeOptional } from '@mui/x-internals/types';
import {
ScatterPlot,
ScatterPlotProps,
Expand All @@ -14,7 +15,6 @@ import {
} from '../ResponsiveChartContainer';
import { ChartsAxis, ChartsAxisProps } from '../ChartsAxis';
import { ScatterSeriesType } from '../models/seriesType/scatter';
import { MakeOptional } from '../models/helpers';
import {
ChartsTooltip,
ChartsTooltipProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/SparkLineChart/SparkLineChart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import { MakeOptional } from '@mui/x-internals/types';
import { BarPlot } from '../BarChart';
import { LinePlot, AreaPlot, LineHighlightPlot } from '../LineChart';
import {
Expand All @@ -16,7 +17,6 @@ import {
} from '../ChartsTooltip';
import { ChartsAxisHighlight, ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '../models/axis';
import { MakeOptional } from '../models/helpers';
import { LineSeriesType, BarSeriesType } from '../models/seriesType';
import { CardinalDirections } from '../models/layout';
import { AreaPlotSlots, AreaPlotSlotProps } from '../LineChart/AreaPlot';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MakeOptional } from '@mui/x-internals/types';
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../../constants';
import { MakeOptional } from '../../models/helpers';
import { AxisConfig, ScaleName } from '../../models';
import { ChartsAxisProps } from '../../models/axis';

Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/context/ZAxisContextProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import { MakeOptional } from '@mui/x-internals/types';
import { DatasetType } from '../models/seriesType/config';
import { MakeOptional } from '../models/helpers';
import { getColorScale, getOrdinalColorScale } from '../internals/colorScale';
import { ZAxisConfig, ZAxisDefaultized } from '../models/z-axis';

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/x-charts/src/internals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ export { getAxisExtremum } from '../context/CartesianProvider/getAxisExtremum';
export * from '../models/seriesType/config';
export * from '../models/seriesType/common';

export * from '../models/helpers';
export * from '../models/z-axis';
export * from '../models/axis';
2 changes: 1 addition & 1 deletion packages/x-charts/src/models/seriesType/bar.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DefaultizedProps } from '../helpers';
import { DefaultizedProps } from '@mui/x-internals/types';
import type { StackOffsetType } from '../stacking';
import {
CartesianSeriesType,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/models/seriesType/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DefaultizedProps, MakeOptional } from '@mui/x-internals/types';
import {
ScatterSeriesType,
DefaultizedScatterSeriesType,
Expand All @@ -13,7 +14,6 @@ import {
PieValueType,
DefaultizedPieValueType,
} from './pie';
import { DefaultizedProps, MakeOptional } from '../helpers';

export interface ChartsSeriesConfig {
bar: {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/models/seriesType/line.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DefaultizedProps } from '../helpers';
import { DefaultizedProps } from '@mui/x-internals/types';
import type { StackOffsetType } from '../stacking';
import {
CartesianSeriesType,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/models/seriesType/pie.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PieArcDatum as D3PieArcDatum } from '@mui/x-charts-vendor/d3-shape';
import { DefaultizedProps } from '../helpers';
import { DefaultizedProps } from '@mui/x-internals/types';
import { CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';

export type PieItemId = string | number;
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/models/seriesType/scatter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DefaultizedProps } from '../helpers';
import { DefaultizedProps } from '@mui/x-internals/types';
import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';

export type ScatterValueType = {
Expand Down
1 change: 1 addition & 0 deletions packages/x-codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@babel/core": "^7.26.0",
"@babel/runtime": "^7.26.0",
"@babel/traverse": "^7.25.9",
"@mui/x-internals": "workspace:*",
"jscodeshift": "17.0.0",
"yargs": "^17.7.2"
},
Expand Down
7 changes: 3 additions & 4 deletions packages/x-codemod/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { FileInfo, API } from 'jscodeshift';
import { MakeOptional } from '@mui/x-internals/types';

type MakeRequired<Type, Key extends keyof Type> = Pick<Type, Key> & Partial<Omit<Type, Key>>;

type MakeOptional<Type, Key extends keyof Type> = Omit<Type, Key> & Partial<Pick<Type, Key>>;
type KeepRequired<Type, Key extends keyof Type> = Pick<Type, Key> & Partial<Omit<Type, Key>>;

export type JsCodeShiftFileInfo = MakeOptional<FileInfo, 'path'>;

export type JsCodeShiftAPI = MakeRequired<API, 'jscodeshift'>;
export type JsCodeShiftAPI = KeepRequired<API, 'jscodeshift'>;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';
import { SxProps } from '@mui/system';
import { SlotComponentProps } from '@mui/utils';
import { Theme } from '@mui/material/styles';
import { DefaultizedProps } from '@mui/x-internals/types';
import { PickerValidDate, TimezoneProps } from '@mui/x-date-pickers/models';
import {
PickersCalendarHeader,
Expand All @@ -10,7 +11,6 @@ import {
} from '@mui/x-date-pickers/PickersCalendarHeader';
import {
BaseDateValidationProps,
DefaultizedProps,
ExportedDayCalendarProps,
DayCalendarSlots,
DayCalendarSlotProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers-pro/src/DateRangePicker/shared.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { DefaultizedProps } from '@mui/x-internals/types';
import { useThemeProps } from '@mui/material/styles';
import { LocalizedComponent, PickersInputLocaleText } from '@mui/x-date-pickers/locales';
import {
DefaultizedProps,
useDefaultDates,
useUtils,
applyDefaultDate,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as React from 'react';
import { DefaultizedProps } from '@mui/x-internals/types';
import {
PickerSelectionState,
PickerViewRenderer,
isInternalTimeView,
useUtils,
TimeViewWithMeridiem,
BaseClockProps,
DefaultizedProps,
} from '@mui/x-date-pickers/internals';
import { PickerValidDate } from '@mui/x-date-pickers/models';
import { DateRange } from '../models';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { DefaultizedProps } from '@mui/x-internals/types';
import { useThemeProps } from '@mui/material/styles';
import { LocalizedComponent } from '@mui/x-date-pickers/locales';
import {
DefaultizedProps,
useDefaultDates,
useUtils,
applyDefaultDate,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MakeOptional } from '@mui/x-date-pickers/internals';
import { MakeOptional } from '@mui/x-internals/types';
import { PickerValidDate } from '@mui/x-date-pickers/models';
import {
UseDesktopRangePickerSlots,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import { DefaultizedProps } from '@mui/x-internals/types';
import {
DefaultizedProps,
isDatePickerView,
isInternalTimeView,
PickerViewRenderer,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MakeOptional } from '@mui/x-date-pickers/internals';
import { MakeOptional } from '@mui/x-internals/types';
import { PickerValidDate } from '@mui/x-date-pickers/models';
import {
UseDesktopRangePickerSlots,
Expand Down
Loading

0 comments on commit 2b77887

Please sign in to comment.