Skip to content

Commit

Permalink
Avoid proptypes for internal components
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Oct 16, 2024
1 parent 2c81a89 commit 325653d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
3 changes: 3 additions & 0 deletions packages/x-charts-pro/src/BarChartPro/BarChartPro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import { ZoomSetup } from '../context/ZoomProvider/ZoomSetup';
import { useZoom } from '../context/ZoomProvider/useZoom';
import { ZoomProps } from '../context/ZoomProvider';

/**
* @ignore - internal component.
*/
function BarChartPlotZoom(props: BarPlotProps) {
const { isInteracting } = useZoom();

Expand Down
9 changes: 9 additions & 0 deletions packages/x-charts-pro/src/LineChartPro/LineChartPro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,25 @@ import { ZoomSetup } from '../context/ZoomProvider/ZoomSetup';
import { useZoom } from '../context/ZoomProvider/useZoom';
import { ZoomProps } from '../context/ZoomProvider';

/**
* @ignore - internal component.
*/
function AreaPlotZoom(props: AreaPlotProps) {
const { isInteracting } = useZoom();
return <AreaPlot {...props} skipAnimation={isInteracting || undefined} />;
}

/**
* @ignore - internal component.
*/
function LinePlotZoom(props: LinePlotProps) {
const { isInteracting } = useZoom();
return <LinePlot {...props} skipAnimation={isInteracting || undefined} />;
}

/**
* @ignore - internal component.
*/
function MarkPlotZoom(props: MarkPlotProps) {
const { isInteracting } = useZoom();
return <MarkPlot {...props} skipAnimation={isInteracting || undefined} />;
Expand Down
3 changes: 3 additions & 0 deletions packages/x-data-grid/src/components/GridRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export interface GridRowProps extends React.HTMLAttributes<HTMLDivElement> {
[x: string]: any; // Allow custom attributes like data-* and aria-*
}

/**
* @ignore - internal component.
*/
function EmptyCell({ width }: { width: number }) {
if (!width) {
return null;
Expand Down
3 changes: 3 additions & 0 deletions packages/x-data-grid/src/components/base/GridOverlays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const useUtilityClasses = (ownerState: OwnerState) => {
return composeClasses(slots, getDataGridUtilityClass, classes);
};

/**
* @ignore - internal component.
*/
function GridOverlayWrapper(props: React.PropsWithChildren<GridOverlaysProps>) {
const apiRef = useGridApiContext();
const rootProps = useGridRootProps();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ const DateRangeCalendarMonthContainer = styled('div', {

const weeksContainerHeight = (DAY_RANGE_SIZE + DAY_MARGIN * 2) * 6;

/**
* @ignore - internal component.
*/
const DayCalendarForRange = styled(DayCalendar)(({ theme }) => ({
minWidth: 312,
minHeight: weeksContainerHeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ interface PickersSectionProps extends Pick<PickersSectionListProps, 'slots' | 's
}

/**
* Demos:
*
* - [Custom field](https://mui.com/x/react-date-pickers/custom-field/)
*
* API:
*
* - [PickersSectionList API](https://mui.com/x/api/date-pickers/pickers-section-list/)
* @ignore - internal component.
*/
function PickersSection(props: PickersSectionProps) {
const { slots, slotProps, element, classes } = props;
Expand Down Expand Up @@ -120,6 +114,15 @@ type PickersSectionListComponent = ((
props: PickersSectionListProps & React.RefAttributes<HTMLDivElement>,
) => React.JSX.Element) & { propTypes?: any };

/**
* Demos:
*
* - [Custom field](https://mui.com/x/react-date-pickers/custom-field/)
*
* API:
*
* - [PickersSectionList API](https://mui.com/x/api/date-pickers/pickers-section-list/)
*/
const PickersSectionList = React.forwardRef(function PickersSectionList(
inProps: PickersSectionListProps,
ref: React.Ref<HTMLDivElement>,
Expand Down

0 comments on commit 325653d

Please sign in to comment.