From f1fe74c2ba239d2d8f0e800e6478bed7718da05b Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 22 Mar 2021 09:58:24 +0100 Subject: [PATCH] [internal][pickers] Follow "private by default" in makeDateRangePicker (#25424) --- .../material-ui-lab/src/DateRangePicker/DateRangePicker.tsx | 2 +- .../src/DateRangePicker/makeDateRangePicker.tsx | 6 +++--- .../src/DesktopDateRangePicker/DesktopDateRangePicker.tsx | 2 +- .../src/MobileDateRangePicker/MobileDateRangePicker.tsx | 2 +- .../src/StaticDateRangePicker/StaticDateRangePicker.tsx | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/material-ui-lab/src/DateRangePicker/DateRangePicker.tsx b/packages/material-ui-lab/src/DateRangePicker/DateRangePicker.tsx index 71db8ab329c378..248fb1258f2654 100644 --- a/packages/material-ui-lab/src/DateRangePicker/DateRangePicker.tsx +++ b/packages/material-ui-lab/src/DateRangePicker/DateRangePicker.tsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import { ResponsiveTooltipWrapper } from '../internal/pickers/wrappers/ResponsiveWrapper'; -import { makeDateRangePicker } from './makeDateRangePicker'; +import makeDateRangePicker from './makeDateRangePicker'; /** * diff --git a/packages/material-ui-lab/src/DateRangePicker/makeDateRangePicker.tsx b/packages/material-ui-lab/src/DateRangePicker/makeDateRangePicker.tsx index bb9a2b4dd364ec..ab8bffe1d6e937 100644 --- a/packages/material-ui-lab/src/DateRangePicker/makeDateRangePicker.tsx +++ b/packages/material-ui-lab/src/DateRangePicker/makeDateRangePicker.tsx @@ -35,14 +35,14 @@ export interface BaseDateRangePickerProps endText?: React.ReactNode; } -export type DateRangePickerComponent = (( +type DateRangePickerComponent = (( props: BaseDateRangePickerProps & PublicWrapperProps & AllSharedDateRangePickerProps & React.RefAttributes, ) => JSX.Element) & { propTypes: unknown }; -export const useDateRangeValidation = makeValidationHook< +const useDateRangeValidation = makeValidationHook< DateRangeValidationError, RangeInput, BaseDateRangePickerProps @@ -59,7 +59,7 @@ interface WithWrapperProps { >; } -export function makeDateRangePicker( +export default function makeDateRangePicker( name: string, Wrapper: React.JSXElementConstructor, ): DateRangePickerComponent { diff --git a/packages/material-ui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx b/packages/material-ui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx index 707c6ad7a0b34a..e4a742bd17bd54 100644 --- a/packages/material-ui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx +++ b/packages/material-ui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.tsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import { makeDateRangePicker } from '../DateRangePicker/makeDateRangePicker'; +import makeDateRangePicker from '../DateRangePicker/makeDateRangePicker'; import DesktopTooltipWrapper from '../internal/pickers/wrappers/DesktopTooltipWrapper'; /** diff --git a/packages/material-ui-lab/src/MobileDateRangePicker/MobileDateRangePicker.tsx b/packages/material-ui-lab/src/MobileDateRangePicker/MobileDateRangePicker.tsx index e7502f751934d8..b7d817065ad416 100644 --- a/packages/material-ui-lab/src/MobileDateRangePicker/MobileDateRangePicker.tsx +++ b/packages/material-ui-lab/src/MobileDateRangePicker/MobileDateRangePicker.tsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import { makeDateRangePicker } from '../DateRangePicker/makeDateRangePicker'; +import makeDateRangePicker from '../DateRangePicker/makeDateRangePicker'; import MobileWrapper from '../internal/pickers/wrappers/MobileWrapper'; /** diff --git a/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.tsx b/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.tsx index 309673094b6d24..6073979575a181 100644 --- a/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.tsx +++ b/packages/material-ui-lab/src/StaticDateRangePicker/StaticDateRangePicker.tsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import { makeDateRangePicker } from '../DateRangePicker/makeDateRangePicker'; +import makeDateRangePicker from '../DateRangePicker/makeDateRangePicker'; import StaticWrapper from '../internal/pickers/wrappers/StaticWrapper'; /**