From 78d723bcf565a829d74fe5dfa742ad776106ca7d Mon Sep 17 00:00:00 2001 From: Diego Andai Date: Fri, 24 May 2024 12:11:12 -0400 Subject: [PATCH] [core] Apply React 19 type changes that don't require upcoming `@types/` packages (#42346) --- apps/local-ui-lib/index.d.ts | 4 +- .../base/components/modal/SpringModal.tsx | 4 +- docs/data/base/components/modal/UseModal.tsx | 2 +- .../components/popper/PlacementPopper.tsx | 2 +- docs/data/base/components/popup/Placement.tsx | 2 +- .../UnstyledSelectBasic/system/index.tsx | 2 +- .../components/select/UnstyledSelectForm.tsx | 2 +- .../base/components/slider/DiscreteSlider.tsx | 2 +- .../components/slider/LabeledValuesSlider.tsx | 2 +- .../transitions/ReactTransitionGroup.tsx | 2 +- .../accessibility/KeyboardNavigation.tsx | 2 +- .../components/alert/AlertVariousStates.tsx | 2 +- .../autocomplete/AutocompleteHint.tsx | 2 +- .../components/autocomplete/Virtualize.tsx | 2 +- .../components/input/FloatingLabelInput.tsx | 2 +- .../menu/MenuIconSideNavExample.tsx | 2 +- .../components/menu/MenuToolbarExample.tsx | 2 +- .../textarea/FloatingLabelTextarea.tsx | 2 +- .../templates/files/components/Menu.tsx | 2 +- .../profile-dashboard/components/DropZone.tsx | 4 +- .../components/FileUpload.tsx | 2 +- .../material/components/app-bar/BackToTop.tsx | 2 +- .../components/app-bar/ElevateAppBar.tsx | 2 +- .../components/app-bar/HideAppBar.tsx | 2 +- .../components/autocomplete/Virtualize.tsx | 8 +-- .../components/dialogs/FullScreenDialog.tsx | 2 +- .../components/lists/InteractiveList.tsx | 2 +- .../material/components/modal/SpringModal.tsx | 2 +- .../components/popper/SpringPopper.tsx | 2 +- .../components/rating/RadioGroupRating.tsx | 2 +- .../steppers/CustomizedSteppers.tsx | 2 +- .../integrations/routing/ListRouter.tsx | 2 +- docs/pages/base-ui/api/use-modal.json | 4 +- docs/src/components/about/HowToSupport.tsx | 2 +- docs/src/components/action/StylingInfo.tsx | 2 +- docs/src/components/header/HeaderNavBar.tsx | 4 +- .../home/MaterialDesignComponents.tsx | 2 +- .../components/home/StoreTemplatesBanner.tsx | 2 +- docs/src/components/home/UserFeedbacks.tsx | 2 +- docs/src/components/icon/IconImage.tsx | 2 +- docs/src/components/pricing/PricingTable.tsx | 6 +- .../components/BaseInputDemo.tsx | 31 ++++----- docs/src/components/productX/XRoadmap.tsx | 2 +- .../components/showcase/ViewToggleButton.tsx | 2 +- .../components/typography/SectionHeadline.tsx | 2 +- docs/src/layouts/HeroContainer.tsx | 4 +- .../modules/components/JoyThemeBuilder.tsx | 3 +- docs/src/modules/components/JoyUsageDemo.tsx | 2 +- .../modules/components/JoyVariablesDemo.tsx | 4 +- .../onepirate/modules/withRoot.tsx | 2 +- docs/types/docs.d.ts | 4 +- .../test/boolean-values/optional/input.d.ts | 2 +- .../test/boolean-values/required/input.d.ts | 2 +- .../test/code-order/input.d.ts | 2 +- .../test/default-value/input.d.ts | 2 +- .../test/generator/html-elements/input.d.ts | 2 +- .../test/generic/input.d.ts | 2 +- .../test/getThemeProps/input.d.ts | 2 +- .../test/omit-conditional/input.d.ts | 2 +- .../overloaded-function-component/input.d.ts | 6 +- .../test/partial-any-props/input.d.ts | 2 +- .../test/propTypes-casting/input.tsx | 2 +- .../test/reconcile-prop-types/input.d.ts | 2 +- .../test/sort-unions/input.d.ts | 2 +- .../test/union-props/input.d.ts | 2 +- .../ClickAwayListener/ClickAwayListener.tsx | 4 +- packages/mui-base/src/FocusTrap/FocusTrap.tsx | 2 +- .../mui-base/src/FocusTrap/FocusTrap.types.ts | 2 +- packages/mui-base/src/Modal/Modal.types.ts | 2 +- packages/mui-base/src/NoSsr/NoSsr.tsx | 2 +- packages/mui-base/src/Option/Option.types.ts | 2 +- packages/mui-base/src/Select/Select.types.ts | 2 +- .../mui-base/src/Snackbar/Snackbar.test.tsx | 2 +- .../src/unstable_useModal/useModal.types.ts | 2 +- .../src/utils/PolymorphicComponent.ts | 2 +- .../mui-base/src/utils/appendOwnerState.ts | 2 +- .../test/describeConformanceUnstyled.tsx | 17 +++-- .../mui-joy/src/Autocomplete/Autocomplete.tsx | 2 +- .../mui-joy/src/Breadcrumbs/Breadcrumbs.tsx | 2 +- packages/mui-joy/src/Button/Button.spec.tsx | 2 +- packages/mui-joy/src/Button/ButtonProps.ts | 2 +- .../mui-joy/src/IconButton/IconButtonProps.ts | 2 +- packages/mui-joy/src/Link/Link.tsx | 4 +- .../src/ListItemButton/ListItemButtonProps.ts | 2 +- .../mui-joy/src/MenuItem/MenuItem.test.tsx | 2 +- .../mui-joy/src/MenuItem/MenuItemProps.ts | 2 +- packages/mui-joy/src/Option/OptionProps.ts | 4 +- packages/mui-joy/src/Select/Select.tsx | 4 +- .../mui-joy/src/Snackbar/Snackbar.test.tsx | 2 +- .../ToggleButtonGroup/ToggleButtonGroup.tsx | 4 +- packages/mui-joy/src/Tooltip/TooltipProps.ts | 2 +- .../src/Typography/Typography.spec.tsx | 2 +- .../mui-joy/src/Typography/Typography.tsx | 4 +- packages/mui-joy/test/describeConformance.ts | 2 +- .../src/CalendarPicker/CalendarPicker.tsx | 2 +- .../CalendarPickerSkeleton.tsx | 2 +- .../mui-lab/src/ClockPicker/ClockPicker.tsx | 2 +- .../mui-lab/src/DatePicker/DatePicker.tsx | 2 +- .../src/DateRangePicker/DateRangePicker.ts | 2 +- .../DateRangePickerDay/DateRangePickerDay.ts | 2 +- .../src/DateTimePicker/DateTimePicker.tsx | 2 +- .../DesktopDatePicker/DesktopDatePicker.tsx | 2 +- .../DesktopDateRangePicker.ts | 2 +- .../DesktopDateTimePicker.tsx | 2 +- .../DesktopTimePicker/DesktopTimePicker.tsx | 2 +- .../LocalizationProvider.tsx | 2 +- .../src/MobileDatePicker/MobileDatePicker.tsx | 2 +- .../MobileDateRangePicker.ts | 2 +- .../MobileDateTimePicker.tsx | 2 +- .../src/MobileTimePicker/MobileTimePicker.tsx | 2 +- .../mui-lab/src/MonthPicker/MonthPicker.tsx | 2 +- .../mui-lab/src/PickersDay/PickersDay.tsx | 2 +- .../src/StaticDatePicker/StaticDatePicker.tsx | 2 +- .../StaticDateRangePicker.ts | 2 +- .../StaticDateTimePicker.tsx | 2 +- .../src/StaticTimePicker/StaticTimePicker.tsx | 2 +- .../mui-lab/src/TabContext/TabContext.d.ts | 2 +- packages/mui-lab/src/TabPanel/TabPanel.d.ts | 2 +- .../mui-lab/src/TimePicker/TimePicker.tsx | 2 +- .../TimelineConnector/TimelineConnector.d.ts | 2 +- .../src/TimelineContent/TimelineContent.d.ts | 2 +- .../mui-lab/src/TimelineDot/TimelineDot.d.ts | 2 +- .../src/TimelineItem/TimelineItem.d.ts | 2 +- .../TimelineOppositeContent.d.ts | 4 +- .../TimelineSeparator/TimelineSeparator.d.ts | 2 +- packages/mui-lab/src/TreeItem/TreeItem.tsx | 2 +- packages/mui-lab/src/TreeView/TreeView.tsx | 2 +- .../mui-lab/src/YearPicker/YearPicker.tsx | 2 +- packages/mui-lab/test/describeConformance.ts | 2 +- .../pagesRouterV13Document.tsx | 4 +- .../AccordionActions/AccordionActions.d.ts | 2 +- .../AccordionDetails/AccordionDetails.d.ts | 2 +- packages/mui-material/src/Alert/Alert.d.ts | 2 +- .../src/AlertTitle/AlertTitle.d.ts | 2 +- .../src/Autocomplete/Autocomplete.d.ts | 2 +- .../src/AvatarGroup/AvatarGroup.d.ts | 2 +- packages/mui-material/src/Button/Button.d.ts | 2 +- .../src/ButtonBase/ButtonBase.d.ts | 2 +- .../src/CardActions/CardActions.d.ts | 2 +- .../src/CardHeader/CardHeader.d.ts | 2 +- .../mui-material/src/Checkbox/Checkbox.d.ts | 2 +- packages/mui-material/src/Chip/Chip.d.ts | 6 +- .../CircularProgress/CircularProgress.d.ts | 2 +- .../mui-material/src/Collapse/Collapse.d.ts | 2 +- .../src/CssBaseline/CssBaseline.d.ts | 2 +- packages/mui-material/src/Dialog/Dialog.d.ts | 2 +- .../src/DialogActions/DialogActions.d.ts | 2 +- .../src/DialogContent/DialogContent.d.ts | 2 +- packages/mui-material/src/Drawer/Drawer.d.ts | 2 +- packages/mui-material/src/Fade/Fade.d.ts | 2 +- .../src/FilledInput/FilledInput.d.ts | 2 +- .../FormControlLabel/FormControlLabel.d.ts | 2 +- .../mui-material/src/FormGroup/FormGroup.d.ts | 2 +- .../src/GlobalStyles/GlobalStyles.d.ts | 2 +- packages/mui-material/src/Grow/Grow.d.ts | 2 +- .../ImageListItemBar/ImageListItemBar.d.ts | 2 +- packages/mui-material/src/Input/Input.d.ts | 2 +- .../mui-material/src/InputBase/InputBase.d.ts | 2 +- .../src/LinearProgress/LinearProgress.d.ts | 2 +- .../src/ListItemAvatar/ListItemAvatar.d.ts | 2 +- .../src/ListItemIcon/ListItemIcon.d.ts | 2 +- .../ListItemSecondaryAction.d.ts | 4 +- .../src/ListItemText/ListItemText.d.ts | 4 +- packages/mui-material/src/Menu/Menu.d.ts | 2 +- .../src/MobileStepper/MobileStepper.d.ts | 2 +- packages/mui-material/src/Modal/Modal.d.ts | 2 +- .../src/NativeSelect/NativeSelect.d.ts | 2 +- .../src/OutlinedInput/OutlinedInput.d.ts | 4 +- .../src/OverridableComponent.d.ts | 4 +- .../src/Pagination/Pagination.d.ts | 2 +- .../mui-material/src/Popover/Popover.d.ts | 2 +- .../mui-material/src/Popper/Popper.spec.tsx | 2 +- packages/mui-material/src/Radio/Radio.d.ts | 2 +- .../src/RadioGroup/RadioGroup.d.ts | 2 +- packages/mui-material/src/Rating/Rating.d.ts | 2 +- packages/mui-material/src/Select/Select.d.ts | 2 +- packages/mui-material/src/Slide/Slide.d.ts | 2 +- packages/mui-material/src/Slider/Slider.d.ts | 2 +- .../src/Slider/SliderValueLabel.types.ts | 2 +- .../mui-material/src/Snackbar/Snackbar.d.ts | 2 +- .../src/SnackbarContent/SnackbarContent.d.ts | 2 +- .../mui-material/src/SpeedDial/SpeedDial.d.ts | 2 +- .../src/SpeedDialAction/SpeedDialAction.d.ts | 2 +- .../src/SpeedDialIcon/SpeedDialIcon.d.ts | 4 +- .../src/StepConnector/StepConnector.d.ts | 4 +- .../src/StepContent/StepContent.d.ts | 2 +- .../mui-material/src/StepIcon/StepIcon.d.ts | 2 +- .../mui-material/src/StepLabel/StepLabel.d.ts | 2 +- packages/mui-material/src/Switch/Switch.d.ts | 2 +- packages/mui-material/src/Tab/Tab.d.ts | 2 +- .../src/TabScrollButton/TabScrollButton.d.ts | 2 +- .../mui-material/src/TableCell/TableCell.d.ts | 2 +- .../mui-material/src/TextField/TextField.d.ts | 2 +- .../ToggleButtonGroup/ToggleButtonGroup.d.ts | 2 +- .../mui-material/src/Tooltip/Tooltip.d.ts | 2 +- .../src/Typography/typography.spec.tsx | 2 +- packages/mui-material/src/Zoom/Zoom.d.ts | 2 +- .../types/OverridableComponentAugmentation.ts | 4 +- .../mui-material/test/describeConformance.ts | 2 +- .../src/GlobalStyles/GlobalStyles.d.ts | 2 +- .../src/GlobalStyles/GlobalStyles.spec.tsx | 2 +- .../StyledEngineProvider.d.ts | 2 +- packages/mui-styled-engine-sc/src/index.d.ts | 37 ++++++----- .../src/GlobalStyles/GlobalStyles.d.ts | 2 +- .../src/GlobalStyles/GlobalStyles.spec.tsx | 2 +- .../StyledEngineProvider.d.ts | 2 +- packages/mui-styled-engine/src/index.d.ts | 14 ++-- .../ServerStyleSheets/ServerStyleSheets.d.ts | 2 +- packages/mui-styles/src/styled/styled.d.ts | 2 +- .../mui-styles/src/withTheme/withTheme.d.ts | 2 +- packages/mui-styles/test/styles.spec.tsx | 2 +- packages/mui-system/src/Stack/createStack.tsx | 4 +- .../src/Unstable_Grid/createGrid.tsx | 2 +- .../src/cssVars/createCssVarsProvider.d.ts | 2 +- .../mui-system/test/describeConformance.ts | 2 +- .../OverridableComponentAugmentation.ts | 4 +- packages/mui-types/index.d.ts | 9 ++- .../getValidReactChildren.ts | 2 +- packages/test-utils/src/createMount.tsx | 4 +- packages/test-utils/src/createRenderer.tsx | 15 +++-- .../test-utils/src/describeConformance.tsx | 66 +++++++++++++------ 221 files changed, 372 insertions(+), 316 deletions(-) diff --git a/apps/local-ui-lib/index.d.ts b/apps/local-ui-lib/index.d.ts index a24be41b8decc5..3f926bfe3bb446 100644 --- a/apps/local-ui-lib/index.d.ts +++ b/apps/local-ui-lib/index.d.ts @@ -1,6 +1,8 @@ +import * as React from 'react'; + export const bounceAnim: string; export const Button: React.ComponentType< - JSX.IntrinsicElements['button'] & { + React.JSX.IntrinsicElements['button'] & { isRed?: boolean; sx?: unknown; } diff --git a/docs/data/base/components/modal/SpringModal.tsx b/docs/data/base/components/modal/SpringModal.tsx index e2411c77d73684..44c2f280a8b452 100644 --- a/docs/data/base/components/modal/SpringModal.tsx +++ b/docs/data/base/components/modal/SpringModal.tsx @@ -37,7 +37,7 @@ export default function SpringModal() { const Backdrop = React.forwardRef< HTMLDivElement, - { children: React.ReactElement; open: boolean } + { children: React.ReactElement; open: boolean } >((props, ref) => { const { open, ...other } = props; return ; @@ -61,7 +61,7 @@ const StyledBackdrop = styled(Backdrop)` `; interface FadeProps { - children: React.ReactElement; + children: React.ReactElement; in?: boolean; onClick?: any; onEnter?: (node: HTMLElement, isAppearing: boolean) => void; diff --git a/docs/data/base/components/modal/UseModal.tsx b/docs/data/base/components/modal/UseModal.tsx index 8024572f55d57b..0462704cf259e6 100644 --- a/docs/data/base/components/modal/UseModal.tsx +++ b/docs/data/base/components/modal/UseModal.tsx @@ -39,7 +39,7 @@ export default function UseModal() { } interface ModalProps { - children: React.ReactElement; + children: React.ReactElement; closeAfterTransition?: boolean; container?: Element | (() => Element | null) | null; disableAutoFocus?: boolean; diff --git a/docs/data/base/components/popper/PlacementPopper.tsx b/docs/data/base/components/popper/PlacementPopper.tsx index ce9c2b6bb352ab..d6d036e8175761 100644 --- a/docs/data/base/components/popper/PlacementPopper.tsx +++ b/docs/data/base/components/popper/PlacementPopper.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { Popper, PopperPlacementType } from '@mui/base/Popper'; -function Radio({ value, ...props }: JSX.IntrinsicElements['input']) { +function Radio({ value, ...props }: React.JSX.IntrinsicElements['input']) { return ( ; }) as ( props: SelectProps & React.RefAttributes, -) => JSX.Element; +) => React.JSX.Element; export default function UnstyledSelectBasic() { return ( diff --git a/docs/data/base/components/select/UnstyledSelectForm.tsx b/docs/data/base/components/select/UnstyledSelectForm.tsx index 114d64115e0a0c..9668cb831fcbdb 100644 --- a/docs/data/base/components/select/UnstyledSelectForm.tsx +++ b/docs/data/base/components/select/UnstyledSelectForm.tsx @@ -47,7 +47,7 @@ const Select = React.forwardRef(function CustomSelect< return ; }) as ( props: SelectProps & React.RefAttributes, -) => JSX.Element; +) => React.JSX.Element; const blue = { 100: '#DAECFF', diff --git a/docs/data/base/components/slider/DiscreteSlider.tsx b/docs/data/base/components/slider/DiscreteSlider.tsx index deb51db7f93215..87216292aca7cd 100644 --- a/docs/data/base/components/slider/DiscreteSlider.tsx +++ b/docs/data/base/components/slider/DiscreteSlider.tsx @@ -21,7 +21,7 @@ export default function DiscreteSlider() { } interface SliderValueLabelProps { - children: React.ReactElement; + children: React.ReactElement; } function SliderValueLabel({ children }: SliderValueLabelProps) { diff --git a/docs/data/base/components/slider/LabeledValuesSlider.tsx b/docs/data/base/components/slider/LabeledValuesSlider.tsx index e7f0357f3869b9..143073006c60bb 100644 --- a/docs/data/base/components/slider/LabeledValuesSlider.tsx +++ b/docs/data/base/components/slider/LabeledValuesSlider.tsx @@ -11,7 +11,7 @@ export default function LabeledValuesSlider() { } interface SliderValueLabelProps { - children: React.ReactElement; + children: React.ReactElement; } function SliderValueLabel({ children }: SliderValueLabelProps) { diff --git a/docs/data/base/components/transitions/ReactTransitionGroup.tsx b/docs/data/base/components/transitions/ReactTransitionGroup.tsx index 1f3ef41aaf6dfc..cc72ef63550fbc 100644 --- a/docs/data/base/components/transitions/ReactTransitionGroup.tsx +++ b/docs/data/base/components/transitions/ReactTransitionGroup.tsx @@ -115,7 +115,7 @@ function PopupWithTrigger(props: PopupProps) { ); } -function MaterialUITransitionAdapter(props: { children: React.ReactElement }) { +function MaterialUITransitionAdapter(props: { children: React.ReactElement }) { const { requestedEnter, onExited } = useTransitionStateManager(); const { children } = props; diff --git a/docs/data/base/getting-started/accessibility/KeyboardNavigation.tsx b/docs/data/base/getting-started/accessibility/KeyboardNavigation.tsx index 917e340d1ea07d..90109120fee33e 100644 --- a/docs/data/base/getting-started/accessibility/KeyboardNavigation.tsx +++ b/docs/data/base/getting-started/accessibility/KeyboardNavigation.tsx @@ -54,7 +54,7 @@ const Select = React.forwardRef(function Select< return ; }) as ( props: SelectProps & React.RefAttributes, -) => JSX.Element; +) => React.JSX.Element; const SelectButton = React.forwardRef(function SelectButton< TValue extends {}, diff --git a/docs/data/joy/components/alert/AlertVariousStates.tsx b/docs/data/joy/components/alert/AlertVariousStates.tsx index d5809cf4f57b3c..417632d2c3641c 100644 --- a/docs/data/joy/components/alert/AlertVariousStates.tsx +++ b/docs/data/joy/components/alert/AlertVariousStates.tsx @@ -14,7 +14,7 @@ export default function AlertVariousStates() { const items: { title: string; color: ColorPaletteProp; - icon: React.ReactElement; + icon: React.ReactElement; }[] = [ { title: 'Success', color: 'success', icon: }, { title: 'Warning', color: 'warning', icon: }, diff --git a/docs/data/joy/components/autocomplete/AutocompleteHint.tsx b/docs/data/joy/components/autocomplete/AutocompleteHint.tsx index 4b8ff21f8a4d04..4d7c518c49500f 100644 --- a/docs/data/joy/components/autocomplete/AutocompleteHint.tsx +++ b/docs/data/joy/components/autocomplete/AutocompleteHint.tsx @@ -12,7 +12,7 @@ const StyledDiv = styled('div')({ }); type WrapperProps = { - children: JSX.Element; + children: React.JSX.Element; hint: string; }; diff --git a/docs/data/joy/components/autocomplete/Virtualize.tsx b/docs/data/joy/components/autocomplete/Virtualize.tsx index 3484ab6a27358b..96737ce4ed76cd 100644 --- a/docs/data/joy/components/autocomplete/Virtualize.tsx +++ b/docs/data/joy/components/autocomplete/Virtualize.tsx @@ -66,7 +66,7 @@ const ListboxComponent = React.forwardRef< const { children, anchorEl, open, modifiers, ...other } = props; const itemData: Array = []; ( - children as [Array<{ children: Array | undefined }>] + children as [Array<{ children: Array> | undefined }>] )[0].forEach((item) => { if (item) { itemData.push(item); diff --git a/docs/data/joy/components/input/FloatingLabelInput.tsx b/docs/data/joy/components/input/FloatingLabelInput.tsx index 521eb66351af7c..562227ac60e82f 100644 --- a/docs/data/joy/components/input/FloatingLabelInput.tsx +++ b/docs/data/joy/components/input/FloatingLabelInput.tsx @@ -56,7 +56,7 @@ const StyledLabel = styled('label')(({ theme }) => ({ const InnerInput = React.forwardRef< HTMLInputElement, - JSX.IntrinsicElements['input'] + React.JSX.IntrinsicElements['input'] >(function InnerInput(props, ref) { const id = React.useId(); return ( diff --git a/docs/data/joy/components/menu/MenuIconSideNavExample.tsx b/docs/data/joy/components/menu/MenuIconSideNavExample.tsx index 28d26843928d4e..de451cc1bd3989 100644 --- a/docs/data/joy/components/menu/MenuIconSideNavExample.tsx +++ b/docs/data/joy/components/menu/MenuIconSideNavExample.tsx @@ -15,7 +15,7 @@ import MenuButton from '@mui/joy/MenuButton'; // https://popper.js.org/docs/v2/modifiers/offset/ interface MenuButtonProps extends React.HTMLAttributes { children: React.ReactNode; - menu: React.ReactElement; + menu: React.ReactElement; open: boolean; onOpen: ( event?: diff --git a/docs/data/joy/components/menu/MenuToolbarExample.tsx b/docs/data/joy/components/menu/MenuToolbarExample.tsx index d2cead8ad4fa98..764a66b010ec98 100644 --- a/docs/data/joy/components/menu/MenuToolbarExample.tsx +++ b/docs/data/joy/components/menu/MenuToolbarExample.tsx @@ -13,7 +13,7 @@ import { Theme } from '@mui/joy'; type MenuBarButtonProps = Pick & { onOpen: DropdownProps['onOpenChange']; onKeyDown: React.KeyboardEventHandler; - menu: JSX.Element; + menu: React.JSX.Element; onMouseEnter: React.MouseEventHandler; }; diff --git a/docs/data/joy/components/textarea/FloatingLabelTextarea.tsx b/docs/data/joy/components/textarea/FloatingLabelTextarea.tsx index 0115794252e0a7..f361e06583d233 100644 --- a/docs/data/joy/components/textarea/FloatingLabelTextarea.tsx +++ b/docs/data/joy/components/textarea/FloatingLabelTextarea.tsx @@ -48,7 +48,7 @@ const StyledLabel = styled('label')(({ theme }) => ({ const InnerTextarea = React.forwardRef< HTMLTextAreaElement, - JSX.IntrinsicElements['textarea'] + React.JSX.IntrinsicElements['textarea'] >(function InnerTextarea(props, ref) { const id = React.useId(); return ( diff --git a/docs/data/joy/getting-started/templates/files/components/Menu.tsx b/docs/data/joy/getting-started/templates/files/components/Menu.tsx index 9eb339005910d4..b5edc3477a58c0 100644 --- a/docs/data/joy/getting-started/templates/files/components/Menu.tsx +++ b/docs/data/joy/getting-started/templates/files/components/Menu.tsx @@ -4,7 +4,7 @@ import MenuItem from '@mui/joy/MenuItem'; import { ListActionTypes } from '@mui/base/useList'; export default function Menu(props: { - control: React.ReactElement; + control: React.ReactElement; id: string; menus: Array<{ label: string } & { [k: string]: any }>; }) { diff --git a/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx b/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx index 2d132f8a5ace3a..33d4a3025e113d 100644 --- a/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx +++ b/docs/data/joy/getting-started/templates/profile-dashboard/components/DropZone.tsx @@ -7,7 +7,9 @@ import AspectRatio from '@mui/joy/AspectRatio'; import FileUploadRoundedIcon from '@mui/icons-material/FileUploadRounded'; -export default function DropZone(props: CardProps & { icon?: React.ReactElement }) { +export default function DropZone( + props: CardProps & { icon?: React.ReactElement }, +) { const { icon, sx, ...other } = props; return ( ; fileName: string; fileSize: string; progress: number; diff --git a/docs/data/material/components/app-bar/BackToTop.tsx b/docs/data/material/components/app-bar/BackToTop.tsx index 87eca489bf5c9f..c2d9673bdfa8fe 100644 --- a/docs/data/material/components/app-bar/BackToTop.tsx +++ b/docs/data/material/components/app-bar/BackToTop.tsx @@ -16,7 +16,7 @@ interface Props { * You won't need it on your project. */ window?: () => Window; - children?: React.ReactElement; + children?: React.ReactElement; } function ScrollTop(props: Props) { diff --git a/docs/data/material/components/app-bar/ElevateAppBar.tsx b/docs/data/material/components/app-bar/ElevateAppBar.tsx index 195908dcaf13fe..df548678f153fd 100644 --- a/docs/data/material/components/app-bar/ElevateAppBar.tsx +++ b/docs/data/material/components/app-bar/ElevateAppBar.tsx @@ -13,7 +13,7 @@ interface Props { * You won't need it on your project. */ window?: () => Window; - children?: React.ReactElement; + children?: React.ReactElement; } function ElevationScroll(props: Props) { diff --git a/docs/data/material/components/app-bar/HideAppBar.tsx b/docs/data/material/components/app-bar/HideAppBar.tsx index 4bc84bfc663305..925410ed692eb9 100644 --- a/docs/data/material/components/app-bar/HideAppBar.tsx +++ b/docs/data/material/components/app-bar/HideAppBar.tsx @@ -14,7 +14,7 @@ interface Props { * You won't need it on your project. */ window?: () => Window; - children?: React.ReactElement; + children?: React.ReactElement; } function HideOnScroll(props: Props) { diff --git a/docs/data/material/components/autocomplete/Virtualize.tsx b/docs/data/material/components/autocomplete/Virtualize.tsx index 9cbc173d404c7f..7d7dab92ebd8c4 100644 --- a/docs/data/material/components/autocomplete/Virtualize.tsx +++ b/docs/data/material/components/autocomplete/Virtualize.tsx @@ -56,9 +56,9 @@ const ListboxComponent = React.forwardRef< React.HTMLAttributes >(function ListboxComponent(props, ref) { const { children, ...other } = props; - const itemData: React.ReactElement[] = []; - (children as React.ReactElement[]).forEach( - (item: React.ReactElement & { children?: React.ReactElement[] }) => { + const itemData: React.ReactElement[] = []; + (children as React.ReactElement[]).forEach( + (item: React.ReactElement & { children?: React.ReactElement[] }) => { itemData.push(item); itemData.push(...(item.children || [])); }, @@ -71,7 +71,7 @@ const ListboxComponent = React.forwardRef< const itemCount = itemData.length; const itemSize = smUp ? 36 : 48; - const getChildSize = (child: React.ReactElement) => { + const getChildSize = (child: React.ReactElement) => { if (child.hasOwnProperty('group')) { return 48; } diff --git a/docs/data/material/components/dialogs/FullScreenDialog.tsx b/docs/data/material/components/dialogs/FullScreenDialog.tsx index 1edd984e8388f5..5b0dc07b9cd042 100644 --- a/docs/data/material/components/dialogs/FullScreenDialog.tsx +++ b/docs/data/material/components/dialogs/FullScreenDialog.tsx @@ -15,7 +15,7 @@ import { TransitionProps } from '@mui/material/transitions'; const Transition = React.forwardRef(function Transition( props: TransitionProps & { - children: React.ReactElement; + children: React.ReactElement; }, ref: React.Ref, ) { diff --git a/docs/data/material/components/lists/InteractiveList.tsx b/docs/data/material/components/lists/InteractiveList.tsx index ba8ed0cfabbd5d..661995d60917d4 100644 --- a/docs/data/material/components/lists/InteractiveList.tsx +++ b/docs/data/material/components/lists/InteractiveList.tsx @@ -16,7 +16,7 @@ import Typography from '@mui/material/Typography'; import FolderIcon from '@mui/icons-material/Folder'; import DeleteIcon from '@mui/icons-material/Delete'; -function generate(element: React.ReactElement) { +function generate(element: React.ReactElement) { return [0, 1, 2].map((value) => React.cloneElement(element, { key: value, diff --git a/docs/data/material/components/modal/SpringModal.tsx b/docs/data/material/components/modal/SpringModal.tsx index b478ef1dc38fb2..31c07aadab1754 100644 --- a/docs/data/material/components/modal/SpringModal.tsx +++ b/docs/data/material/components/modal/SpringModal.tsx @@ -7,7 +7,7 @@ import Typography from '@mui/material/Typography'; import { useSpring, animated } from '@react-spring/web'; interface FadeProps { - children: React.ReactElement; + children: React.ReactElement; in?: boolean; onClick?: any; onEnter?: (node: HTMLElement, isAppearing: boolean) => void; diff --git a/docs/data/material/components/popper/SpringPopper.tsx b/docs/data/material/components/popper/SpringPopper.tsx index e7e5c98dee72f2..5526317503ff16 100644 --- a/docs/data/material/components/popper/SpringPopper.tsx +++ b/docs/data/material/components/popper/SpringPopper.tsx @@ -4,7 +4,7 @@ import Popper from '@mui/material/Popper'; import { useSpring, animated } from '@react-spring/web'; interface FadeProps { - children?: React.ReactElement; + children?: React.ReactElement; in?: boolean; onEnter?: () => void; onExited?: () => void; diff --git a/docs/data/material/components/rating/RadioGroupRating.tsx b/docs/data/material/components/rating/RadioGroupRating.tsx index 097970dd4bcd89..f42709d21c1359 100644 --- a/docs/data/material/components/rating/RadioGroupRating.tsx +++ b/docs/data/material/components/rating/RadioGroupRating.tsx @@ -15,7 +15,7 @@ const StyledRating = styled(Rating)(({ theme }) => ({ const customIcons: { [index: string]: { - icon: React.ReactElement; + icon: React.ReactElement; label: string; }; } = { diff --git a/docs/data/material/components/steppers/CustomizedSteppers.tsx b/docs/data/material/components/steppers/CustomizedSteppers.tsx index 2fa6b486f6197f..3a4c2e7ddf879c 100644 --- a/docs/data/material/components/steppers/CustomizedSteppers.tsx +++ b/docs/data/material/components/steppers/CustomizedSteppers.tsx @@ -122,7 +122,7 @@ const ColorlibStepIconRoot = styled('div')<{ function ColorlibStepIcon(props: StepIconProps) { const { active, completed, className } = props; - const icons: { [index: string]: React.ReactElement } = { + const icons: { [index: string]: React.ReactElement } = { 1: , 2: , 3: , diff --git a/docs/data/material/integrations/routing/ListRouter.tsx b/docs/data/material/integrations/routing/ListRouter.tsx index 1900b67cf2d582..be912a6f8c9eff 100644 --- a/docs/data/material/integrations/routing/ListRouter.tsx +++ b/docs/data/material/integrations/routing/ListRouter.tsx @@ -33,7 +33,7 @@ function Router(props: { children?: React.ReactNode }) { } interface ListItemLinkProps { - icon?: React.ReactElement; + icon?: React.ReactElement; primary: string; to: string; } diff --git a/docs/pages/base-ui/api/use-modal.json b/docs/pages/base-ui/api/use-modal.json index 494620611cab21..81e8315c9273b4 100644 --- a/docs/pages/base-ui/api/use-modal.json +++ b/docs/pages/base-ui/api/use-modal.json @@ -2,8 +2,8 @@ "parameters": { "children": { "type": { - "name": "React.ReactElement | undefined | null", - "description": "React.ReactElement | undefined | null" + "name": "React.ReactElement<any> | undefined | null", + "description": "React.ReactElement<any> | undefined | null" }, "required": true }, diff --git a/docs/src/components/about/HowToSupport.tsx b/docs/src/components/about/HowToSupport.tsx index 128763cae41126..880347d3782e78 100644 --- a/docs/src/components/about/HowToSupport.tsx +++ b/docs/src/components/about/HowToSupport.tsx @@ -21,7 +21,7 @@ function Widget({ }: { children: React.ReactNode; title: string; - icon: React.ReactElement; + icon: React.ReactElement; }) { return ( } & BoxProps) { const [hidden, setHidden] = React.useState(false); const defaultContent = ( diff --git a/docs/src/components/header/HeaderNavBar.tsx b/docs/src/components/header/HeaderNavBar.tsx index a2c3f3fadff065..f135aa52fb9138 100644 --- a/docs/src/components/header/HeaderNavBar.tsx +++ b/docs/src/components/header/HeaderNavBar.tsx @@ -75,12 +75,12 @@ const PRODUCT_IDS = [ ]; type ProductSubMenuProps = { - icon: React.ReactElement; + icon: React.ReactElement; name: React.ReactNode; description: React.ReactNode; chip?: React.ReactNode; href: string; -} & Omit; +} & Omit; const ProductSubMenu = React.forwardRef( function ProductSubMenu({ icon, name, description, chip, href, ...props }, ref) { diff --git a/docs/src/components/home/MaterialDesignComponents.tsx b/docs/src/components/home/MaterialDesignComponents.tsx index c83c844faec8c4..645d2786cc7410 100644 --- a/docs/src/components/home/MaterialDesignComponents.tsx +++ b/docs/src/components/home/MaterialDesignComponents.tsx @@ -125,7 +125,7 @@ function Demo({ }: { name: string; theme: Theme | undefined; - children: React.ReactElement; + children: React.ReactElement; control?: { prop: string; values: Array; defaultValue?: string }; }) { const [propValue, setPropValue] = React.useState( diff --git a/docs/src/components/home/StoreTemplatesBanner.tsx b/docs/src/components/home/StoreTemplatesBanner.tsx index b71858367e3545..3c074746c06428 100644 --- a/docs/src/components/home/StoreTemplatesBanner.tsx +++ b/docs/src/components/home/StoreTemplatesBanner.tsx @@ -100,7 +100,7 @@ const StoreTemplateLink = React.forwardRef< const StoreTemplateImage = React.forwardRef< HTMLImageElement, - { brand: TemplateBrand } & Omit + { brand: TemplateBrand } & Omit >(function StoreTemplateImage({ brand, ...props }, ref) { return ( ; }; }) { return ( diff --git a/docs/src/components/icon/IconImage.tsx b/docs/src/components/icon/IconImage.tsx index 0e6c75d91ed790..1b6809d16d98cf 100644 --- a/docs/src/components/icon/IconImage.tsx +++ b/docs/src/components/icon/IconImage.tsx @@ -40,7 +40,7 @@ export type IconImageProps = { mode?: '' | 'light' | 'dark'; sx?: SxProps; width?: number; -} & Omit; +} & Omit; const Img = styled('img')({ display: 'inline-block', verticalAlign: 'bottom' }); diff --git a/docs/src/components/pricing/PricingTable.tsx b/docs/src/components/pricing/PricingTable.tsx index c342fed6910a1e..bfb7cbff5b33ea 100644 --- a/docs/src/components/pricing/PricingTable.tsx +++ b/docs/src/components/pricing/PricingTable.tsx @@ -382,7 +382,11 @@ function Cell({ highlighted = false, ...props }: BoxProps & { highlighted?: bool ); } -function RowHead({ children, startIcon, ...props }: BoxProps & { startIcon?: React.ReactElement }) { +function RowHead({ + children, + startIcon, + ...props +}: BoxProps & { startIcon?: React.ReactElement }) { return ( ( - function StyledFloatingLabelInput(props, ref) { - const id = unstable_useId(props.id); - return ( - - - - - ); - }, -); +const StyledFloatingLabelInput = React.forwardRef< + HTMLInputElement, + React.JSX.IntrinsicElements['input'] +>(function StyledFloatingLabelInput(props, ref) { + const id = unstable_useId(props.id); + return ( + + + + + ); +}); -const FloatingLabelInput = React.forwardRef( +const FloatingLabelInput = React.forwardRef( function FloatingLabelInput(props, ref) { const id = unstable_useId(props.id); return ( @@ -121,7 +122,7 @@ const FloatingLabelInput = React.forwardRef(function TailwindFloatingLabelInput({ ownerState, ...props }, ref) { const id = unstable_useId(props.id); @@ -192,7 +193,7 @@ const Field = styled('div')\`${fieldStyles}\`; const StyledInput = styled('input')\`${inputStyles}/\`; const FloatingLabelInput = React.forwardRef< - HTMLInputElement, JSX.IntrinsicElements['input'] + HTMLInputElement, React.JSX.IntrinsicElements['input'] >( function FloatingLabelInput(props, ref) { const id = unstable_useId(props.id); @@ -219,7 +220,7 @@ const FloatingLabelInput = React.forwardRef< import './styles.css'; const FloatingLabelInput = React.forwardRef< - HTMLInputElement, JSX.IntrinsicElements['input'] + HTMLInputElement, React.JSX.IntrinsicElements['input'] >( function FloatingLabelInput(props, ref) { const id = unstable_useId(props.id); diff --git a/docs/src/components/productX/XRoadmap.tsx b/docs/src/components/productX/XRoadmap.tsx index fc3803d400f5aa..a396a0f934fc1e 100644 --- a/docs/src/components/productX/XRoadmap.tsx +++ b/docs/src/components/productX/XRoadmap.tsx @@ -41,7 +41,7 @@ function RoadmapStatusDot({ color }: RoadmapStatusDotProps) { } export default function XRoadmap() { - function renderList(content: React.ReactElement, nested?: boolean) { + function renderList(content: React.ReactElement, nested?: boolean) { return ( = { +const viewIcons: Record> = { quilt: , module: , agenda: , diff --git a/docs/src/components/typography/SectionHeadline.tsx b/docs/src/components/typography/SectionHeadline.tsx index b2b587eee4595b..b1e30e3eb76611 100644 --- a/docs/src/components/typography/SectionHeadline.tsx +++ b/docs/src/components/typography/SectionHeadline.tsx @@ -11,7 +11,7 @@ interface SectionHeadlineProps { */ inverted?: boolean; overline?: React.ReactNode; - title: string | React.ReactElement; + title: string | React.ReactElement; } export default function SectionHeadline(props: SectionHeadlineProps) { diff --git a/docs/src/layouts/HeroContainer.tsx b/docs/src/layouts/HeroContainer.tsx index 240e794e5a0599..0fcd853ab1a7b9 100644 --- a/docs/src/layouts/HeroContainer.tsx +++ b/docs/src/layouts/HeroContainer.tsx @@ -8,9 +8,9 @@ import { alpha } from '@mui/material/styles'; interface HeroContainerProps { disableMobileHidden?: boolean; disableTabExclusion?: boolean; - left: React.ReactElement; + left: React.ReactElement; linearGradient?: boolean; - right: React.ReactElement; + right: React.ReactElement; rightSx?: BoxProps['sx']; } diff --git a/docs/src/modules/components/JoyThemeBuilder.tsx b/docs/src/modules/components/JoyThemeBuilder.tsx index 7cceb465dcba4b..849e4ab7297e94 100644 --- a/docs/src/modules/components/JoyThemeBuilder.tsx +++ b/docs/src/modules/components/JoyThemeBuilder.tsx @@ -1037,7 +1037,6 @@ function GlobalVariantForm({ Pick the specific primitive color, now in CSS variables form already, to correspond to a semantic global variant token. - ; data: any }) { const [open, setOpen] = React.useState(false); const { map: templateMap } = sourceJoyTemplates(); const renderItem = (name: string, item: TemplateData) => { diff --git a/docs/src/modules/components/JoyUsageDemo.tsx b/docs/src/modules/components/JoyUsageDemo.tsx index 787c5c22800aa4..afc7d5a4d6e19f 100644 --- a/docs/src/modules/components/JoyUsageDemo.tsx +++ b/docs/src/modules/components/JoyUsageDemo.tsx @@ -165,7 +165,7 @@ interface JoyUsageDemoProps { * A function to override the code block result. */ getCodeBlock?: (code: string, props: ComponentProps) => string; - renderDemo: (props: ComponentProps) => React.ReactElement; + renderDemo: (props: ComponentProps) => React.ReactElement; } export default function JoyUsageDemo({ diff --git a/docs/src/modules/components/JoyVariablesDemo.tsx b/docs/src/modules/components/JoyVariablesDemo.tsx index fe4fb76e37d8ef..79d1ebd4dd03f5 100644 --- a/docs/src/modules/components/JoyVariablesDemo.tsx +++ b/docs/src/modules/components/JoyVariablesDemo.tsx @@ -33,7 +33,7 @@ function formatSx(sx: { [k: string]: string | number }) { interface SlotVariablesProps { slot: string; data: Array; - renderField: (item: DataItem) => React.ReactElement; + renderField: (item: DataItem) => React.ReactElement; defaultOpen?: boolean; } @@ -88,7 +88,7 @@ export default function JoyVariablesDemo(props: { componentName: string; childrenAccepted?: boolean; data: Array, { defaultOpen?: boolean } | undefined]>; - renderDemo: (sx: { [k: string]: string | number }) => React.ReactElement; + renderDemo: (sx: { [k: string]: string | number }) => React.ReactElement; renderCode?: (formattedSx: string) => string; }) { const { componentName, data = [], childrenAccepted = false, renderCode } = props; diff --git a/docs/src/pages/premium-themes/onepirate/modules/withRoot.tsx b/docs/src/pages/premium-themes/onepirate/modules/withRoot.tsx index e2d99a652a1988..d89dd45fea732e 100644 --- a/docs/src/pages/premium-themes/onepirate/modules/withRoot.tsx +++ b/docs/src/pages/premium-themes/onepirate/modules/withRoot.tsx @@ -3,7 +3,7 @@ import { ThemeProvider } from '@mui/material/styles'; import CssBaseline from '@mui/material/CssBaseline'; import theme from './theme'; -export default function withRoot

( +export default function withRoot

( Component: React.ComponentType

, ) { function WithRoot(props: P) { diff --git a/docs/types/docs.d.ts b/docs/types/docs.d.ts index ccfe104621b766..fc96dea50c386a 100644 --- a/docs/types/docs.d.ts +++ b/docs/types/docs.d.ts @@ -10,7 +10,7 @@ declare module 'docs/src/modules/components/HighlightedCode' { */ code: string; copyButtonHidden?: boolean; - copyButtonProps?: JSX.IntrinsicElements['button']; + copyButtonProps?: React.JSX.IntrinsicElements['button']; /** * short identifier of the code language * see @mui/internal-markdown/prism for possible languages @@ -23,7 +23,7 @@ declare module 'docs/src/modules/components/HighlightedCode' { component?: React.ElementType; sx?: object; } - export default function HighlightedCode(props: Props): React.ReactElement; + export default function HighlightedCode(props: Props): React.ReactElement; } declare module 'react-imask'; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/optional/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/optional/input.d.ts index 953ef5a74ea240..5481039977a030 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/optional/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/optional/input.d.ts @@ -4,4 +4,4 @@ type Props = { baz?: false; }; -export default function Foo(props: Props): JSX.Element; +export default function Foo(props: Props): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/required/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/required/input.d.ts index 5567ba9073b92c..e7aa7242683598 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/required/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/boolean-values/required/input.d.ts @@ -4,4 +4,4 @@ type Props = { baz: false; }; -export default function Foo(props: Props): JSX.Element; +export default function Foo(props: Props): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/code-order/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/code-order/input.d.ts index 4aeb223970ab39..0574e9ebe9651b 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/code-order/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/code-order/input.d.ts @@ -4,4 +4,4 @@ export interface Props { value: unknown; } -export default function Component(props: Props): JSX.Element; +export default function Component(props: Props): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/default-value/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/default-value/input.d.ts index 013e60b90d7ae4..6a227c3c2101ec 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/default-value/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/default-value/input.d.ts @@ -6,4 +6,4 @@ interface Props { type?: 'button' | 'reset' | 'submit'; } -export function Foo(props: Props): JSX.Element; +export function Foo(props: Props): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/generator/html-elements/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/generator/html-elements/input.d.ts index ae12666f21c37d..38cb5e239a5192 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/generator/html-elements/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/generator/html-elements/input.d.ts @@ -3,4 +3,4 @@ export function Foo(props: { optional?: Element; htmlElement: HTMLElement; bothTypes: Element | HTMLElement; -}): JSX.Element; +}): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/generic/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/generic/input.d.ts index a9e29a70c9b050..61227d0f785937 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/generic/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/generic/input.d.ts @@ -7,4 +7,4 @@ interface ParentProps { interface ChildProps extends ParentProps<'one' | 'two'> {} -export function Foo(props: ChildProps): JSX.Element; +export function Foo(props: ChildProps): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/getThemeProps/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/getThemeProps/input.d.ts index 6c9d2db1d951be..47ee0a18f6dfd3 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/getThemeProps/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/getThemeProps/input.d.ts @@ -1,3 +1,3 @@ import * as React from 'react'; -export default function Modal(props: React.HTMLAttributes): JSX.Element; +export default function Modal(props: React.HTMLAttributes): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/omit-conditional/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/omit-conditional/input.d.ts index 6a1e4b7aedd2ba..b06a97e352fd75 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/omit-conditional/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/omit-conditional/input.d.ts @@ -2,4 +2,4 @@ type TextFieldProps = A extends true ? { testProp: string } : type Props = Omit, 'b'> -export function Foo(props: Props): JSX.Element; +export function Foo(props: Props): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/overloaded-function-component/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/overloaded-function-component/input.d.ts index d9fddc0e5f9303..406b40ac196649 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/overloaded-function-component/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/overloaded-function-component/input.d.ts @@ -5,9 +5,9 @@ interface ButtonProps { } interface Component { - (props: ButtonProps): JSX.Element; - (props: { component: C } & ButtonProps): JSX.Element; + (props: ButtonProps): React.JSX.Element; + (props: { component: C } & ButtonProps): React.JSX.Element; } // a component using overloading and intersection of function signature -declare const ButtonBase: Component & ((props: { href: string } & ButtonProps) => JSX.Element); +declare const ButtonBase: Component & ((props: { href: string } & ButtonProps) => React.JSX.Element); diff --git a/packages-internal/scripts/typescript-to-proptypes/test/partial-any-props/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/partial-any-props/input.d.ts index 03a37509db9dac..d11bad94c16c3f 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/partial-any-props/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/partial-any-props/input.d.ts @@ -2,4 +2,4 @@ type Props = { foo: any; }; -export default function Foo(props: Partial): JSX.Element; +export default function Foo(props: Partial): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/propTypes-casting/input.tsx b/packages-internal/scripts/typescript-to-proptypes/test/propTypes-casting/input.tsx index 7c16789e21a3bf..89dccc3a6f106d 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/propTypes-casting/input.tsx +++ b/packages-internal/scripts/typescript-to-proptypes/test/propTypes-casting/input.tsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; // empty props are likely a mistake. // We want to make sure we catch this instead of keeping .propTypes -export default function Component(props: {}): JSX.Element { +export default function Component(props: {}): React.JSX.Element { return

; } diff --git a/packages-internal/scripts/typescript-to-proptypes/test/reconcile-prop-types/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/reconcile-prop-types/input.d.ts index 6e43fc6bc542bb..324e24da284d4f 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/reconcile-prop-types/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/reconcile-prop-types/input.d.ts @@ -4,4 +4,4 @@ interface Props { children?: React.ReactNode; } -export default function Component(props: Props): JSX.Element; +export default function Component(props: Props): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/sort-unions/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/sort-unions/input.d.ts index 5379600ee91549..7eefff1a862f14 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/sort-unions/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/sort-unions/input.d.ts @@ -11,4 +11,4 @@ export interface Props { only?: Breakpoint | Breakpoint[]; } -export default function Hidden(props: Props): JSX.Element; +export default function Hidden(props: Props): React.JSX.Element; diff --git a/packages-internal/scripts/typescript-to-proptypes/test/union-props/input.d.ts b/packages-internal/scripts/typescript-to-proptypes/test/union-props/input.d.ts index 551c9bcf1002ff..f5debd26d41bc7 100644 --- a/packages-internal/scripts/typescript-to-proptypes/test/union-props/input.d.ts +++ b/packages-internal/scripts/typescript-to-proptypes/test/union-props/input.d.ts @@ -16,4 +16,4 @@ export interface FilledProps extends BaseProps { export type TextFieldProps = StandardProps | OutlinedProps | FilledProps; -export default function TextField(props: TextFieldProps): JSX.Element; +export default function TextField(props: TextFieldProps): React.JSX.Element; diff --git a/packages/mui-base/src/ClickAwayListener/ClickAwayListener.tsx b/packages/mui-base/src/ClickAwayListener/ClickAwayListener.tsx index dbdfcee7f097d1..ee00d7d9fc8d2b 100644 --- a/packages/mui-base/src/ClickAwayListener/ClickAwayListener.tsx +++ b/packages/mui-base/src/ClickAwayListener/ClickAwayListener.tsx @@ -35,7 +35,7 @@ export interface ClickAwayListenerProps { /** * The wrapped element. */ - children: React.ReactElement; + children: React.ReactElement; /** * If `true`, the React tree is ignored and only the DOM tree is considered. * This prop changes how portaled elements are handled. @@ -70,7 +70,7 @@ export interface ClickAwayListenerProps { * * - [ClickAwayListener API](https://mui.com/base-ui/react-click-away-listener/components-api/#click-away-listener) */ -function ClickAwayListener(props: ClickAwayListenerProps): JSX.Element { +function ClickAwayListener(props: ClickAwayListenerProps): React.JSX.Element { const { children, disableReactTree = false, diff --git a/packages/mui-base/src/FocusTrap/FocusTrap.tsx b/packages/mui-base/src/FocusTrap/FocusTrap.tsx index bd52658ac9b7df..3d00b5fc6f7bdc 100644 --- a/packages/mui-base/src/FocusTrap/FocusTrap.tsx +++ b/packages/mui-base/src/FocusTrap/FocusTrap.tsx @@ -132,7 +132,7 @@ function defaultIsEnabled(): boolean { * * - [FocusTrap API](https://mui.com/base-ui/react-focus-trap/components-api/#focus-trap) */ -function FocusTrap(props: FocusTrapProps): JSX.Element { +function FocusTrap(props: FocusTrapProps): React.JSX.Element { const { children, disableAutoFocus = false, diff --git a/packages/mui-base/src/FocusTrap/FocusTrap.types.ts b/packages/mui-base/src/FocusTrap/FocusTrap.types.ts index 70c6861eeaf4f7..be9cf5ee1e93c3 100644 --- a/packages/mui-base/src/FocusTrap/FocusTrap.types.ts +++ b/packages/mui-base/src/FocusTrap/FocusTrap.types.ts @@ -24,7 +24,7 @@ export interface FocusTrapProps { /** * A single child content element. */ - children: React.ReactElement; + children: React.ReactElement; /** * If `true`, the focus trap will not automatically shift focus to itself when it opens, and * replace it to the last focused element when it closes. diff --git a/packages/mui-base/src/Modal/Modal.types.ts b/packages/mui-base/src/Modal/Modal.types.ts index 899d1721291cdc..8aa7f1ea29ee85 100644 --- a/packages/mui-base/src/Modal/Modal.types.ts +++ b/packages/mui-base/src/Modal/Modal.types.ts @@ -10,7 +10,7 @@ export interface ModalOwnProps { /** * A single child content element. */ - children: React.ReactElement; + children: React.ReactElement; /** * When set to true the Modal waits until a nested Transition is completed before closing. * @default false diff --git a/packages/mui-base/src/NoSsr/NoSsr.tsx b/packages/mui-base/src/NoSsr/NoSsr.tsx index e2abe25adfb3fd..c637df94e70b61 100644 --- a/packages/mui-base/src/NoSsr/NoSsr.tsx +++ b/packages/mui-base/src/NoSsr/NoSsr.tsx @@ -22,7 +22,7 @@ import { NoSsrProps } from './NoSsr.types'; * * - [NoSsr API](https://mui.com/base-ui/react-no-ssr/components-api/#no-ssr) */ -function NoSsr(props: NoSsrProps): JSX.Element { +function NoSsr(props: NoSsrProps): React.JSX.Element { const { children, defer = false, fallback = null } = props; const [mountedState, setMountedState] = React.useState(false); diff --git a/packages/mui-base/src/Option/Option.types.ts b/packages/mui-base/src/Option/Option.types.ts index 3e08daa5712c90..907b8a8f601775 100644 --- a/packages/mui-base/src/Option/Option.types.ts +++ b/packages/mui-base/src/Option/Option.types.ts @@ -65,7 +65,7 @@ export interface OptionType { RootComponentType extends React.ElementType = OptionTypeMap['defaultComponent'], >( props: PolymorphicProps, RootComponentType>, - ): JSX.Element | null; + ): React.JSX.Element | null; propTypes?: any; displayName?: string | undefined; } diff --git a/packages/mui-base/src/Select/Select.types.ts b/packages/mui-base/src/Select/Select.types.ts index cca29cc508554d..d6cd2b1c35aa72 100644 --- a/packages/mui-base/src/Select/Select.types.ts +++ b/packages/mui-base/src/Select/Select.types.ts @@ -191,7 +191,7 @@ export interface SelectType { >['defaultComponent'], >( props: PolymorphicProps, RootComponentType>, - ): JSX.Element | null; + ): React.JSX.Element | null; propTypes?: any; displayName?: string | undefined; } diff --git a/packages/mui-base/src/Snackbar/Snackbar.test.tsx b/packages/mui-base/src/Snackbar/Snackbar.test.tsx index 3cd45136355ba5..21067dce9e9af1 100644 --- a/packages/mui-base/src/Snackbar/Snackbar.test.tsx +++ b/packages/mui-base/src/Snackbar/Snackbar.test.tsx @@ -17,7 +17,7 @@ describe('', () => { * We have to defer the effect manually like `useEffect` would so we have to flush the effect manually instead of relying on `act()`. * React bug: https://github.com/facebook/react/issues/20074 */ - function render(...args: [React.ReactElement]) { + function render(...args: [React.ReactElement]) { const result = clientRender(...args); clock.tick(0); return result; diff --git a/packages/mui-base/src/unstable_useModal/useModal.types.ts b/packages/mui-base/src/unstable_useModal/useModal.types.ts index 337b5b3918dfd0..ef7068b56f3a59 100644 --- a/packages/mui-base/src/unstable_useModal/useModal.types.ts +++ b/packages/mui-base/src/unstable_useModal/useModal.types.ts @@ -22,7 +22,7 @@ export type UseModalParameters = { /** * A single child content element. */ - children: React.ReactElement | undefined | null; + children: React.ReactElement | undefined | null; /** * When set to true the Modal waits until a nested Transition is completed before closing. * @default false diff --git a/packages/mui-base/src/utils/PolymorphicComponent.ts b/packages/mui-base/src/utils/PolymorphicComponent.ts index 0110cfc87ff530..abcc2682228f1f 100644 --- a/packages/mui-base/src/utils/PolymorphicComponent.ts +++ b/packages/mui-base/src/utils/PolymorphicComponent.ts @@ -10,7 +10,7 @@ import { DistributiveOmit, OverridableTypeMap } from '@mui/types'; export type PolymorphicComponent = { ( props: PolymorphicProps, - ): JSX.Element | null; + ): React.JSX.Element | null; propTypes?: any; displayName?: string | undefined; }; diff --git a/packages/mui-base/src/utils/appendOwnerState.ts b/packages/mui-base/src/utils/appendOwnerState.ts index 0ef5e0c47a4f60..965867cd8e71f0 100644 --- a/packages/mui-base/src/utils/appendOwnerState.ts +++ b/packages/mui-base/src/utils/appendOwnerState.ts @@ -10,7 +10,7 @@ import { isHostComponent } from './isHostComponent'; type OwnerStateWhenApplicable = ElementType extends React.ComponentType ? OwnerState - : ElementType extends keyof JSX.IntrinsicElements + : ElementType extends keyof React.JSX.IntrinsicElements ? undefined : OwnerState | undefined; diff --git a/packages/mui-base/test/describeConformanceUnstyled.tsx b/packages/mui-base/test/describeConformanceUnstyled.tsx index 750748d411eed9..ea9fef9b922acc 100644 --- a/packages/mui-base/test/describeConformanceUnstyled.tsx +++ b/packages/mui-base/test/describeConformanceUnstyled.tsx @@ -60,7 +60,7 @@ function forEachSlot( } function testPropForwarding( - element: React.ReactElement, + element: React.ReactElement, getOptions: () => UnstyledConformanceOptions, ) { const { @@ -110,7 +110,10 @@ function testPropForwarding( }); } -function testSlotsProp(element: React.ReactElement, getOptions: () => UnstyledConformanceOptions) { +function testSlotsProp( + element: React.ReactElement, + getOptions: () => UnstyledConformanceOptions, +) { const { render, slots, @@ -224,7 +227,7 @@ function testSlotsProp(element: React.ReactElement, getOptions: () => UnstyledCo } function testSlotPropsProp( - element: React.ReactElement, + element: React.ReactElement, getOptions: () => UnstyledConformanceOptions, ) { const { render, slots } = getOptions(); @@ -271,7 +274,7 @@ interface TestOwnerState { } function testSlotPropsCallbacks( - element: React.ReactElement, + element: React.ReactElement, getOptions: () => UnstyledConformanceOptions, ) { const { render, slots } = getOptions(); @@ -307,7 +310,7 @@ function testSlotPropsCallbacks( } function testOwnerStatePropagation( - element: React.ReactElement, + element: React.ReactElement, getOptions: () => UnstyledConformanceOptions, ) { const { @@ -359,7 +362,7 @@ function testOwnerStatePropagation( } function testDisablingClassGeneration( - element: React.ReactElement, + element: React.ReactElement, getOptions: () => UnstyledConformanceOptions, ) { const { render } = getOptions(); @@ -394,7 +397,7 @@ const fullSuite = { }; function describeConformance( - minimalElement: React.ReactElement, + minimalElement: React.ReactElement, getOptions: () => UnstyledConformanceOptions, ) { const { after: runAfterHook = () => {}, only = Object.keys(fullSuite), skip = [] } = getOptions(); diff --git a/packages/mui-joy/src/Autocomplete/Autocomplete.tsx b/packages/mui-joy/src/Autocomplete/Autocomplete.tsx index dbbb1631332c72..21879755e722cc 100644 --- a/packages/mui-joy/src/Autocomplete/Autocomplete.tsx +++ b/packages/mui-joy/src/Autocomplete/Autocomplete.tsx @@ -735,7 +735,7 @@ interface AutocompleteComponent { FreeSolo extends boolean | undefined = undefined, >( props: AutocompleteProps, - ): JSX.Element; + ): React.JSX.Element; propTypes?: any; } diff --git a/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx b/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx index 6da089a2c1d580..10a278263f5500 100644 --- a/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx +++ b/packages/mui-joy/src/Breadcrumbs/Breadcrumbs.tsx @@ -154,7 +154,7 @@ const Breadcrumbs = React.forwardRef(function Breadcrumbs(inProps, ref) { const allItems = ( React.Children.toArray(children).filter((child) => { return React.isValidElement(child); - }) as Array + }) as Array> ).map((child, index) => ( {isMuiElement(child, ['Typography']) diff --git a/packages/mui-joy/src/Button/Button.spec.tsx b/packages/mui-joy/src/Button/Button.spec.tsx index 0eb33a5f726351..c24940a6880324 100644 --- a/packages/mui-joy/src/Button/Button.spec.tsx +++ b/packages/mui-joy/src/Button/Button.spec.tsx @@ -47,7 +47,7 @@ function CustomLink({ children, to, ...props -}: React.PropsWithChildren<{ to: string } & Omit>) { +}: React.PropsWithChildren<{ to: string } & Omit>) { return ( {children} diff --git a/packages/mui-joy/src/Button/ButtonProps.ts b/packages/mui-joy/src/Button/ButtonProps.ts index 6cb4ab2d12c8df..5c4a676bf0d0b5 100644 --- a/packages/mui-joy/src/Button/ButtonProps.ts +++ b/packages/mui-joy/src/Button/ButtonProps.ts @@ -147,5 +147,5 @@ export interface ButtonOwnerState extends ApplyColorInversion { export type ExtendButton = (( props: OverrideProps, 'a'>, -) => JSX.Element) & +) => React.JSX.Element) & OverridableComponent>; diff --git a/packages/mui-joy/src/IconButton/IconButtonProps.ts b/packages/mui-joy/src/IconButton/IconButtonProps.ts index 69479718836f3d..573fdc45783f50 100644 --- a/packages/mui-joy/src/IconButton/IconButtonProps.ts +++ b/packages/mui-joy/src/IconButton/IconButtonProps.ts @@ -120,5 +120,5 @@ export interface IconButtonOwnerState extends ApplyColorInversion = (( props: OverrideProps, 'a'>, -) => JSX.Element) & +) => React.JSX.Element) & OverridableComponent>; diff --git a/packages/mui-joy/src/Link/Link.tsx b/packages/mui-joy/src/Link/Link.tsx index 378a91b8d2f142..bac2fbe4f315bc 100644 --- a/packages/mui-joy/src/Link/Link.tsx +++ b/packages/mui-joy/src/Link/Link.tsx @@ -292,8 +292,8 @@ const Link = React.forwardRef(function Link(inProps, ref) { )} {isMuiElement(children, ['Skeleton']) - ? React.cloneElement(children as React.ReactElement, { - variant: (children as React.ReactElement).props.variant || 'inline', + ? React.cloneElement(children as React.ReactElement, { + variant: (children as React.ReactElement).props.variant || 'inline', }) : children} {endDecorator && {endDecorator}} diff --git a/packages/mui-joy/src/ListItemButton/ListItemButtonProps.ts b/packages/mui-joy/src/ListItemButton/ListItemButtonProps.ts index 54402f51c8991d..4fe2151bff8fcd 100644 --- a/packages/mui-joy/src/ListItemButton/ListItemButtonProps.ts +++ b/packages/mui-joy/src/ListItemButton/ListItemButtonProps.ts @@ -123,5 +123,5 @@ export interface ListItemButtonOwnerState extends ApplyColorInversion = (( props: OverrideProps, 'a'>, -) => JSX.Element) & +) => React.JSX.Element) & OverridableComponent>; diff --git a/packages/mui-joy/src/MenuItem/MenuItem.test.tsx b/packages/mui-joy/src/MenuItem/MenuItem.test.tsx index 7492c1e39340e3..27956ec5ab260f 100644 --- a/packages/mui-joy/src/MenuItem/MenuItem.test.tsx +++ b/packages/mui-joy/src/MenuItem/MenuItem.test.tsx @@ -26,7 +26,7 @@ function Wrapper({ children }: { children: React.ReactNode }) { describe('Joy ', () => { const { render: baseRender } = createRenderer(); - const render = (element: JSX.Element, options = {}) => + const render = (element: React.JSX.Element, options = {}) => baseRender(element, { wrapper: Wrapper as React.JSXElementConstructor<{ children?: React.ReactNode }>, ...options, diff --git a/packages/mui-joy/src/MenuItem/MenuItemProps.ts b/packages/mui-joy/src/MenuItem/MenuItemProps.ts index d67ec37029a28a..d87650a1bf351c 100644 --- a/packages/mui-joy/src/MenuItem/MenuItemProps.ts +++ b/packages/mui-joy/src/MenuItem/MenuItemProps.ts @@ -50,5 +50,5 @@ export interface MenuItemOwnerState extends ApplyColorInversion { export type ExtendMenuItem = (( props: OverrideProps, 'a'>, -) => JSX.Element) & +) => React.JSX.Element) & OverridableComponent>; diff --git a/packages/mui-joy/src/Option/OptionProps.ts b/packages/mui-joy/src/Option/OptionProps.ts index e13575dfa2bcd3..6466898f1f634a 100644 --- a/packages/mui-joy/src/Option/OptionProps.ts +++ b/packages/mui-joy/src/Option/OptionProps.ts @@ -48,7 +48,7 @@ export interface OptionTypeMap

{ * A text representation of the option's content. * Used for keyboard text navigation matching. */ - label?: string | React.ReactElement; + label?: string | React.ReactElement; /** * The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use. * @default 'plain' @@ -100,5 +100,5 @@ export interface OptionOwnerState extends ApplyColorInversion = (( props: OverrideProps, 'a'>, -) => JSX.Element) & +) => React.JSX.Element) & OverridableComponent>; diff --git a/packages/mui-joy/src/Select/Select.tsx b/packages/mui-joy/src/Select/Select.tsx index 017fd87c2c348e..5a4db947b53849 100644 --- a/packages/mui-joy/src/Select/Select.tsx +++ b/packages/mui-joy/src/Select/Select.tsx @@ -626,12 +626,12 @@ interface SelectComponent { component: C; multiple?: Multiple; } & OverrideProps, C>, - ): JSX.Element | null; + ): React.JSX.Element | null; ( props: { multiple?: Multiple; } & DefaultComponentProps>, - ): JSX.Element | null; + ): React.JSX.Element | null; propTypes?: any; } diff --git a/packages/mui-joy/src/Snackbar/Snackbar.test.tsx b/packages/mui-joy/src/Snackbar/Snackbar.test.tsx index e0041cbe6e5ab1..2d9fdc6c2173a3 100644 --- a/packages/mui-joy/src/Snackbar/Snackbar.test.tsx +++ b/packages/mui-joy/src/Snackbar/Snackbar.test.tsx @@ -19,7 +19,7 @@ describe('Joy ', () => { * We have to defer the effect manually like `useEffect` would so we have to flush the effect manually instead of relying on `act()`. * React bug: https://github.com/facebook/react/issues/20074 */ - function render(...args: [React.ReactElement]) { + function render(...args: [React.ReactElement]) { const result = clientRender(...args); clock.tick(0); return result; diff --git a/packages/mui-joy/src/ToggleButtonGroup/ToggleButtonGroup.tsx b/packages/mui-joy/src/ToggleButtonGroup/ToggleButtonGroup.tsx index 54564bcc9c78b2..85282d67ef56aa 100644 --- a/packages/mui-joy/src/ToggleButtonGroup/ToggleButtonGroup.tsx +++ b/packages/mui-joy/src/ToggleButtonGroup/ToggleButtonGroup.tsx @@ -193,10 +193,10 @@ interface ToggleButtonGroupComponent { */ component: C; } & OverrideProps, C>, - ): JSX.Element | null; + ): React.JSX.Element | null; ( props: DefaultComponentProps>, - ): JSX.Element | null; + ): React.JSX.Element | null; propTypes?: any; } diff --git a/packages/mui-joy/src/Tooltip/TooltipProps.ts b/packages/mui-joy/src/Tooltip/TooltipProps.ts index bd01a316186c3c..f76a50e775fd86 100644 --- a/packages/mui-joy/src/Tooltip/TooltipProps.ts +++ b/packages/mui-joy/src/Tooltip/TooltipProps.ts @@ -47,7 +47,7 @@ export interface TooltipTypeMap

{ /** * Tooltip reference element. */ - children: React.ReactElement; + children: React.ReactElement; /** * The color of the component. It supports those theme colors that make sense for this component. * @default 'neutral' diff --git a/packages/mui-joy/src/Typography/Typography.spec.tsx b/packages/mui-joy/src/Typography/Typography.spec.tsx index 87059cd77ed56c..c85d02d5e2ebc2 100644 --- a/packages/mui-joy/src/Typography/Typography.spec.tsx +++ b/packages/mui-joy/src/Typography/Typography.spec.tsx @@ -6,7 +6,7 @@ import Typography, { TypographyOwnerState } from '@mui/joy/Typography'; Text ; -function Link(props: JSX.IntrinsicElements['a']) { +function Link(props: React.JSX.IntrinsicElements['a']) { return ; } diff --git a/packages/mui-joy/src/Typography/Typography.tsx b/packages/mui-joy/src/Typography/Typography.tsx index e77423e8c6400e..dd520cde4d4d3b 100644 --- a/packages/mui-joy/src/Typography/Typography.tsx +++ b/packages/mui-joy/src/Typography/Typography.tsx @@ -250,8 +250,8 @@ const Typography = React.forwardRef(function Typography(inProps, ref) { )} {hasSkeleton - ? React.cloneElement(children as React.ReactElement, { - variant: (children as React.ReactElement).props.variant || 'inline', + ? React.cloneElement(children as React.ReactElement, { + variant: (children as React.ReactElement).props.variant || 'inline', }) : children} {endDecorator && {endDecorator}} diff --git a/packages/mui-joy/test/describeConformance.ts b/packages/mui-joy/test/describeConformance.ts index f82c1e1e0215b7..ade3a04028c76a 100644 --- a/packages/mui-joy/test/describeConformance.ts +++ b/packages/mui-joy/test/describeConformance.ts @@ -6,7 +6,7 @@ import { ThemeProvider } from '@mui/joy/styles'; import { createTheme } from '@mui/system'; export default function describeConformance( - minimalElement: React.ReactElement, + minimalElement: React.ReactElement, getOptions: () => ConformanceOptions, ) { function getOptionsWithDefaults() { diff --git a/packages/mui-lab/src/CalendarPicker/CalendarPicker.tsx b/packages/mui-lab/src/CalendarPicker/CalendarPicker.tsx index d1b244336688e5..f5999beccc8488 100644 --- a/packages/mui-lab/src/CalendarPicker/CalendarPicker.tsx +++ b/packages/mui-lab/src/CalendarPicker/CalendarPicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type CalendarPickerComponent = (( props: CalendarPickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The CalendarPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/CalendarPickerSkeleton/CalendarPickerSkeleton.tsx b/packages/mui-lab/src/CalendarPickerSkeleton/CalendarPickerSkeleton.tsx index 5a5eedc42e23ba..1fdb678f251d1a 100644 --- a/packages/mui-lab/src/CalendarPickerSkeleton/CalendarPickerSkeleton.tsx +++ b/packages/mui-lab/src/CalendarPickerSkeleton/CalendarPickerSkeleton.tsx @@ -23,7 +23,7 @@ const warn = () => { type CalendarPickerSkeletonComponent = (( props: CalendarPickerSkeletonProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The CalendarPickerSkeleton component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/ClockPicker/ClockPicker.tsx b/packages/mui-lab/src/ClockPicker/ClockPicker.tsx index ff9f19395863cb..47187af85eee8c 100644 --- a/packages/mui-lab/src/ClockPicker/ClockPicker.tsx +++ b/packages/mui-lab/src/ClockPicker/ClockPicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type ClockPickerComponent = (( props: ClockPickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The ClockPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/DatePicker/DatePicker.tsx b/packages/mui-lab/src/DatePicker/DatePicker.tsx index de1b2d83ea164c..a684d79cae4e1f 100644 --- a/packages/mui-lab/src/DatePicker/DatePicker.tsx +++ b/packages/mui-lab/src/DatePicker/DatePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type DatePickerComponent = (( props: DatePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @ignore - do not document. diff --git a/packages/mui-lab/src/DateRangePicker/DateRangePicker.ts b/packages/mui-lab/src/DateRangePicker/DateRangePicker.ts index a0e08d393c6d44..24c4bfc4352984 100644 --- a/packages/mui-lab/src/DateRangePicker/DateRangePicker.ts +++ b/packages/mui-lab/src/DateRangePicker/DateRangePicker.ts @@ -23,7 +23,7 @@ const warn = () => { type DateRangePickerComponent = (( props: DateRangePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The DateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/DateRangePickerDay/DateRangePickerDay.ts b/packages/mui-lab/src/DateRangePickerDay/DateRangePickerDay.ts index 2b2c3db7ed6912..f7a27e2bbb22f7 100644 --- a/packages/mui-lab/src/DateRangePickerDay/DateRangePickerDay.ts +++ b/packages/mui-lab/src/DateRangePickerDay/DateRangePickerDay.ts @@ -22,7 +22,7 @@ const warn = () => { type DateRangePickerDayComponent = (( props: DateRangePickerDayProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The DateRangePickerDay component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/DateTimePicker/DateTimePicker.tsx b/packages/mui-lab/src/DateTimePicker/DateTimePicker.tsx index c65c2db4a7d155..aefd8cde158008 100644 --- a/packages/mui-lab/src/DateTimePicker/DateTimePicker.tsx +++ b/packages/mui-lab/src/DateTimePicker/DateTimePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type DateTimePickerComponent = (( props: DateTimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The DateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/DesktopDatePicker/DesktopDatePicker.tsx b/packages/mui-lab/src/DesktopDatePicker/DesktopDatePicker.tsx index 23bfe7b4a463b8..0d48b7a1847e35 100644 --- a/packages/mui-lab/src/DesktopDatePicker/DesktopDatePicker.tsx +++ b/packages/mui-lab/src/DesktopDatePicker/DesktopDatePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type DesktopDatePickerComponent = (( props: DesktopDatePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The DesktopDatePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.ts b/packages/mui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.ts index bc5697f3f97cdd..b9343203786669 100644 --- a/packages/mui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.ts +++ b/packages/mui-lab/src/DesktopDateRangePicker/DesktopDateRangePicker.ts @@ -23,7 +23,7 @@ const warn = () => { type DesktopDateRangePickerComponent = (( props: DesktopDateRangePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The DesktopDateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx b/packages/mui-lab/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx index fc3f559a4a3ff2..c7cc3a097b1a7d 100644 --- a/packages/mui-lab/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx +++ b/packages/mui-lab/src/DesktopDateTimePicker/DesktopDateTimePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type DesktopDateTimePickerComponent = (( props: DesktopDateTimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The DesktopDateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/DesktopTimePicker/DesktopTimePicker.tsx b/packages/mui-lab/src/DesktopTimePicker/DesktopTimePicker.tsx index f09c774b9bf6e7..cb9be262d70210 100644 --- a/packages/mui-lab/src/DesktopTimePicker/DesktopTimePicker.tsx +++ b/packages/mui-lab/src/DesktopTimePicker/DesktopTimePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type DesktopTimePickerComponent = (( props: DesktopTimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The DesktopTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/LocalizationProvider/LocalizationProvider.tsx b/packages/mui-lab/src/LocalizationProvider/LocalizationProvider.tsx index 2e3ead720c4300..8b662afd80a00f 100644 --- a/packages/mui-lab/src/LocalizationProvider/LocalizationProvider.tsx +++ b/packages/mui-lab/src/LocalizationProvider/LocalizationProvider.tsx @@ -22,7 +22,7 @@ const warn = () => { type LocalizationProviderComponent = (( props: LocalizationProviderProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The LocalizationProvider component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/MobileDatePicker/MobileDatePicker.tsx b/packages/mui-lab/src/MobileDatePicker/MobileDatePicker.tsx index f0b0f9defa6395..d2fb825a73f84e 100644 --- a/packages/mui-lab/src/MobileDatePicker/MobileDatePicker.tsx +++ b/packages/mui-lab/src/MobileDatePicker/MobileDatePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type MobileDatePickerComponent = (( props: MobileDatePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The MobileDatePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/MobileDateRangePicker/MobileDateRangePicker.ts b/packages/mui-lab/src/MobileDateRangePicker/MobileDateRangePicker.ts index a5a9768e1e57aa..d8609f6a180f4e 100644 --- a/packages/mui-lab/src/MobileDateRangePicker/MobileDateRangePicker.ts +++ b/packages/mui-lab/src/MobileDateRangePicker/MobileDateRangePicker.ts @@ -23,7 +23,7 @@ const warn = () => { type MobileDateRangePickerComponent = (( props: MobileDateRangePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The MobileDateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/MobileDateTimePicker/MobileDateTimePicker.tsx b/packages/mui-lab/src/MobileDateTimePicker/MobileDateTimePicker.tsx index 6a24b35b216f53..992337cf359ec3 100644 --- a/packages/mui-lab/src/MobileDateTimePicker/MobileDateTimePicker.tsx +++ b/packages/mui-lab/src/MobileDateTimePicker/MobileDateTimePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type MobileDateTimePickerComponent = (( props: MobileDateTimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The MobileDateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/MobileTimePicker/MobileTimePicker.tsx b/packages/mui-lab/src/MobileTimePicker/MobileTimePicker.tsx index aef9f13eb0f734..b59f3e8066f2fc 100644 --- a/packages/mui-lab/src/MobileTimePicker/MobileTimePicker.tsx +++ b/packages/mui-lab/src/MobileTimePicker/MobileTimePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type MobileTimePickerComponent = (( props: MobileTimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The MobileTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/MonthPicker/MonthPicker.tsx b/packages/mui-lab/src/MonthPicker/MonthPicker.tsx index baa3643955e109..bfd784b256e06b 100644 --- a/packages/mui-lab/src/MonthPicker/MonthPicker.tsx +++ b/packages/mui-lab/src/MonthPicker/MonthPicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type MonthPickerComponent = (( props: MonthPickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The MonthPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/PickersDay/PickersDay.tsx b/packages/mui-lab/src/PickersDay/PickersDay.tsx index dbd13583b7e868..d4ec6e02fe99e1 100644 --- a/packages/mui-lab/src/PickersDay/PickersDay.tsx +++ b/packages/mui-lab/src/PickersDay/PickersDay.tsx @@ -23,7 +23,7 @@ const warn = () => { type PickersDayComponent = (( props: PickersDayProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The PickersDay component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/StaticDatePicker/StaticDatePicker.tsx b/packages/mui-lab/src/StaticDatePicker/StaticDatePicker.tsx index 07aedfa8e1c201..e25bd78b8df689 100644 --- a/packages/mui-lab/src/StaticDatePicker/StaticDatePicker.tsx +++ b/packages/mui-lab/src/StaticDatePicker/StaticDatePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type StaticDatePickerComponent = (( props: StaticDatePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The StaticDatePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/StaticDateRangePicker/StaticDateRangePicker.ts b/packages/mui-lab/src/StaticDateRangePicker/StaticDateRangePicker.ts index ab9e86fe8bcfa0..51954ef4cabaa1 100644 --- a/packages/mui-lab/src/StaticDateRangePicker/StaticDateRangePicker.ts +++ b/packages/mui-lab/src/StaticDateRangePicker/StaticDateRangePicker.ts @@ -23,7 +23,7 @@ const warn = () => { type StaticDateRangePickerComponent = (( props: StaticDateRangePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The StaticDateRangePicker component was moved from `@mui/lab` to `@mui/x-date-pickers-pro`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/StaticDateTimePicker/StaticDateTimePicker.tsx b/packages/mui-lab/src/StaticDateTimePicker/StaticDateTimePicker.tsx index e2adcb889202ea..cee2ec9b345afc 100644 --- a/packages/mui-lab/src/StaticDateTimePicker/StaticDateTimePicker.tsx +++ b/packages/mui-lab/src/StaticDateTimePicker/StaticDateTimePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type StaticDateTimePickerComponent = (( props: StaticDateTimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The StaticDateTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/StaticTimePicker/StaticTimePicker.tsx b/packages/mui-lab/src/StaticTimePicker/StaticTimePicker.tsx index 743b8168c0d2b2..d09364b5804bd3 100644 --- a/packages/mui-lab/src/StaticTimePicker/StaticTimePicker.tsx +++ b/packages/mui-lab/src/StaticTimePicker/StaticTimePicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type StaticTimePickerComponent = (( props: StaticTimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The StaticTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/TabContext/TabContext.d.ts b/packages/mui-lab/src/TabContext/TabContext.d.ts index b3db92467f8936..38274ad8257053 100644 --- a/packages/mui-lab/src/TabContext/TabContext.d.ts +++ b/packages/mui-lab/src/TabContext/TabContext.d.ts @@ -25,7 +25,7 @@ export interface TabContextProps { * * - [TabContext API](https://mui.com/material-ui/api/tab-context/) */ -export default function TabContext(props: TabContextProps): JSX.Element; +export default function TabContext(props: TabContextProps): React.JSX.Element; export function useTabContext(): TabContextValue | null; export function getPanelId(context: TabContextValue, tabValue: string): string; export function getTabId(context: TabContextValue, tabValue: string): string; diff --git a/packages/mui-lab/src/TabPanel/TabPanel.d.ts b/packages/mui-lab/src/TabPanel/TabPanel.d.ts index 378190b80f60e7..47905950704896 100644 --- a/packages/mui-lab/src/TabPanel/TabPanel.d.ts +++ b/packages/mui-lab/src/TabPanel/TabPanel.d.ts @@ -39,4 +39,4 @@ export interface TabPanelProps extends StandardProps { type TimePickerComponent = (( props: TimePickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The StaticTimePicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/src/TimelineConnector/TimelineConnector.d.ts b/packages/mui-lab/src/TimelineConnector/TimelineConnector.d.ts index df54d02189e8cb..168b023cece9c2 100644 --- a/packages/mui-lab/src/TimelineConnector/TimelineConnector.d.ts +++ b/packages/mui-lab/src/TimelineConnector/TimelineConnector.d.ts @@ -30,4 +30,4 @@ export interface TimelineConnectorProps * * - [TimelineConnector API](https://mui.com/material-ui/api/timeline-connector/) */ -export default function TimelineConnector(props: TimelineConnectorProps): JSX.Element; +export default function TimelineConnector(props: TimelineConnectorProps): React.JSX.Element; diff --git a/packages/mui-lab/src/TimelineContent/TimelineContent.d.ts b/packages/mui-lab/src/TimelineContent/TimelineContent.d.ts index a7991cd1aba397..6bfe5fe24e9ffd 100644 --- a/packages/mui-lab/src/TimelineContent/TimelineContent.d.ts +++ b/packages/mui-lab/src/TimelineContent/TimelineContent.d.ts @@ -30,4 +30,4 @@ export interface TimelineContentProps extends StandardProps { * - [TimelineContent API](https://mui.com/material-ui/api/timeline-content/) * - inherits [Typography API](https://mui.com/material-ui/api/typography/) */ -export default function TimelineContent(props: TimelineContentProps): JSX.Element; +export default function TimelineContent(props: TimelineContentProps): React.JSX.Element; diff --git a/packages/mui-lab/src/TimelineDot/TimelineDot.d.ts b/packages/mui-lab/src/TimelineDot/TimelineDot.d.ts index 2109ee9592186c..1d04d9caacd8f4 100644 --- a/packages/mui-lab/src/TimelineDot/TimelineDot.d.ts +++ b/packages/mui-lab/src/TimelineDot/TimelineDot.d.ts @@ -47,4 +47,4 @@ export interface TimelineDotProps extends StandardProps JSX.Element) & { +declare const TimelineOppositeContent: (( + props: TimelineOppositeContentProps, +) => React.JSX.Element) & { muiName: string; }; diff --git a/packages/mui-lab/src/TimelineSeparator/TimelineSeparator.d.ts b/packages/mui-lab/src/TimelineSeparator/TimelineSeparator.d.ts index 4f851adbfa3f7e..3f5b950647e812 100644 --- a/packages/mui-lab/src/TimelineSeparator/TimelineSeparator.d.ts +++ b/packages/mui-lab/src/TimelineSeparator/TimelineSeparator.d.ts @@ -30,4 +30,4 @@ export interface TimelineSeparatorProps * * - [TimelineSeparator API](https://mui.com/material-ui/api/timeline-separator/) */ -export default function TimelineSeparator(props: TimelineSeparatorProps): JSX.Element; +export default function TimelineSeparator(props: TimelineSeparatorProps): React.JSX.Element; diff --git a/packages/mui-lab/src/TreeItem/TreeItem.tsx b/packages/mui-lab/src/TreeItem/TreeItem.tsx index 5920ce65567cae..6a202115c04d23 100644 --- a/packages/mui-lab/src/TreeItem/TreeItem.tsx +++ b/packages/mui-lab/src/TreeItem/TreeItem.tsx @@ -22,7 +22,7 @@ const warn = () => { type TreeItemComponent = (( props: TreeItemProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The TreeItem component was moved from `@mui/lab` to `@mui/x-tree-view`. More information about this migration on our blog: https://mui.com/blog/lab-tree-view-to-mui-x/. diff --git a/packages/mui-lab/src/TreeView/TreeView.tsx b/packages/mui-lab/src/TreeView/TreeView.tsx index a9baef3618f4ba..cc7b3000f58154 100644 --- a/packages/mui-lab/src/TreeView/TreeView.tsx +++ b/packages/mui-lab/src/TreeView/TreeView.tsx @@ -23,7 +23,7 @@ const warn = () => { type TreeViewComponent = (( props: TreeViewProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The TreeView component was moved from `@mui/lab` to `@mui/x-tree-view`. More information about this migration on our blog: https://mui.com/blog/lab-tree-view-to-mui-x/. diff --git a/packages/mui-lab/src/YearPicker/YearPicker.tsx b/packages/mui-lab/src/YearPicker/YearPicker.tsx index b83ba6b10812dd..9f67498da59c8d 100644 --- a/packages/mui-lab/src/YearPicker/YearPicker.tsx +++ b/packages/mui-lab/src/YearPicker/YearPicker.tsx @@ -23,7 +23,7 @@ const warn = () => { type YearPickerComponent = (( props: YearPickerProps & React.RefAttributes, -) => JSX.Element) & { propTypes?: any }; +) => React.JSX.Element) & { propTypes?: any }; /** * @deprecated The YearPicker component was moved from `@mui/lab` to `@mui/x-date-pickers`. More information about this migration on our blog: https://mui.com/blog/lab-date-pickers-to-mui-x/. diff --git a/packages/mui-lab/test/describeConformance.ts b/packages/mui-lab/test/describeConformance.ts index 633cf72e03ebbe..4715d91bad6817 100644 --- a/packages/mui-lab/test/describeConformance.ts +++ b/packages/mui-lab/test/describeConformance.ts @@ -5,7 +5,7 @@ import { import { ThemeProvider, createTheme } from '@mui/material/styles'; export default function describeConformance( - minimalElement: React.ReactElement, + minimalElement: React.ReactElement, getOptions: () => ConformanceOptions, ) { function getOptionsWithDefaults() { diff --git a/packages/mui-material-nextjs/src/v13-pagesRouter/pagesRouterV13Document.tsx b/packages/mui-material-nextjs/src/v13-pagesRouter/pagesRouterV13Document.tsx index c8c385ea74ab10..2bc922d62dd059 100644 --- a/packages/mui-material-nextjs/src/v13-pagesRouter/pagesRouterV13Document.tsx +++ b/packages/mui-material-nextjs/src/v13-pagesRouter/pagesRouterV13Document.tsx @@ -9,7 +9,7 @@ import createEmotionCache from './createCache'; interface Plugin { enhanceApp: ( App: React.ComponentType>, - ) => (props: any) => JSX.Element; + ) => (props: any) => React.JSX.Element; resolveProps: (initialProps: DocumentInitialProps) => Promise; } @@ -37,7 +37,7 @@ export function createGetInitialProps(plugins: Plugin[]) { } export interface DocumentHeadTagsProps { - emotionStyleTags: React.ReactElement[]; + emotionStyleTags: React.ReactElement[]; } export function DocumentHeadTags(props: DocumentHeadTagsProps) { diff --git a/packages/mui-material/src/AccordionActions/AccordionActions.d.ts b/packages/mui-material/src/AccordionActions/AccordionActions.d.ts index 2e8b781355f70a..39c13ee770255f 100644 --- a/packages/mui-material/src/AccordionActions/AccordionActions.d.ts +++ b/packages/mui-material/src/AccordionActions/AccordionActions.d.ts @@ -33,4 +33,4 @@ export interface AccordionActionsProps extends StandardProps { * - [AlertTitle API](https://mui.com/material-ui/api/alert-title/) * - inherits [Typography API](https://mui.com/material-ui/api/typography/) */ -export default function AlertTitle(props: AlertTitleProps): JSX.Element; +export default function AlertTitle(props: AlertTitleProps): React.JSX.Element; diff --git a/packages/mui-material/src/Autocomplete/Autocomplete.d.ts b/packages/mui-material/src/Autocomplete/Autocomplete.d.ts index cfc564954e847c..3119083dab2ef3 100644 --- a/packages/mui-material/src/Autocomplete/Autocomplete.d.ts +++ b/packages/mui-material/src/Autocomplete/Autocomplete.d.ts @@ -372,4 +372,4 @@ export default function Autocomplete< ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'], >( props: AutocompleteProps, -): JSX.Element; +): React.JSX.Element; diff --git a/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts b/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts index ed052bbf48d468..e0f06ce925decd 100644 --- a/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts +++ b/packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts @@ -92,4 +92,4 @@ export interface AvatarGroupProps extends StandardProps { export type ExtendButton = (( props: { href: string } & OverrideProps, 'a'>, -) => JSX.Element) & +) => React.JSX.Element) & OverridableComponent>; /** diff --git a/packages/mui-material/src/ButtonBase/ButtonBase.d.ts b/packages/mui-material/src/ButtonBase/ButtonBase.d.ts index af1edc9aa88849..53a65f79fc1920 100644 --- a/packages/mui-material/src/ButtonBase/ButtonBase.d.ts +++ b/packages/mui-material/src/ButtonBase/ButtonBase.d.ts @@ -105,7 +105,7 @@ export interface ExtendButtonBaseTypeMap { export type ExtendButtonBase = (( props: { href: string } & OverrideProps, 'a'>, -) => JSX.Element) & +) => React.JSX.Element) & OverridableComponent>; /** diff --git a/packages/mui-material/src/CardActions/CardActions.d.ts b/packages/mui-material/src/CardActions/CardActions.d.ts index 3258f2ca248e6d..eb5494dc0e0229 100644 --- a/packages/mui-material/src/CardActions/CardActions.d.ts +++ b/packages/mui-material/src/CardActions/CardActions.d.ts @@ -33,4 +33,4 @@ export interface CardActionsProps extends StandardProps, - ): JSX.Element; + ): React.JSX.Element; } export type CardHeaderProps< diff --git a/packages/mui-material/src/Checkbox/Checkbox.d.ts b/packages/mui-material/src/Checkbox/Checkbox.d.ts index 8d3b3529cde81e..9d9d6ffca56d24 100644 --- a/packages/mui-material/src/Checkbox/Checkbox.d.ts +++ b/packages/mui-material/src/Checkbox/Checkbox.d.ts @@ -115,4 +115,4 @@ export interface CheckboxProps * - [Checkbox API](https://mui.com/material-ui/api/checkbox/) * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/) */ -export default function Checkbox(props: CheckboxProps): JSX.Element; +export default function Checkbox(props: CheckboxProps): React.JSX.Element; diff --git a/packages/mui-material/src/Chip/Chip.d.ts b/packages/mui-material/src/Chip/Chip.d.ts index 1b576bf9705a27..4db5e9ac779872 100644 --- a/packages/mui-material/src/Chip/Chip.d.ts +++ b/packages/mui-material/src/Chip/Chip.d.ts @@ -15,7 +15,7 @@ export interface ChipOwnProps { /** * The Avatar element to display. */ - avatar?: React.ReactElement; + avatar?: React.ReactElement; /** * This prop isn't supported. * Use the `component` prop if you need to change the children structure. @@ -47,7 +47,7 @@ export interface ChipOwnProps { /** * Override the default delete icon element. Shown only if `onDelete` is set. */ - deleteIcon?: React.ReactElement; + deleteIcon?: React.ReactElement; /** * If `true`, the component is disabled. * @default false @@ -56,7 +56,7 @@ export interface ChipOwnProps { /** * Icon element. */ - icon?: React.ReactElement; + icon?: React.ReactElement; /** * The content of the component. */ diff --git a/packages/mui-material/src/CircularProgress/CircularProgress.d.ts b/packages/mui-material/src/CircularProgress/CircularProgress.d.ts index c0046a5b247e2b..31b99ab6a7273e 100644 --- a/packages/mui-material/src/CircularProgress/CircularProgress.d.ts +++ b/packages/mui-material/src/CircularProgress/CircularProgress.d.ts @@ -73,4 +73,4 @@ export interface CircularProgressProps * * - [CircularProgress API](https://mui.com/material-ui/api/circular-progress/) */ -export default function CircularProgress(props: CircularProgressProps): JSX.Element; +export default function CircularProgress(props: CircularProgressProps): React.JSX.Element; diff --git a/packages/mui-material/src/Collapse/Collapse.d.ts b/packages/mui-material/src/Collapse/Collapse.d.ts index 2206f44019aefc..aa756bb779a3f7 100644 --- a/packages/mui-material/src/Collapse/Collapse.d.ts +++ b/packages/mui-material/src/Collapse/Collapse.d.ts @@ -69,4 +69,4 @@ export interface CollapseProps extends StandardProps * - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition/#Transition-props) */ -export default function Collapse(props: CollapseProps): JSX.Element; +export default function Collapse(props: CollapseProps): React.JSX.Element; diff --git a/packages/mui-material/src/CssBaseline/CssBaseline.d.ts b/packages/mui-material/src/CssBaseline/CssBaseline.d.ts index 45af35281561a9..11cb225bd7ac03 100644 --- a/packages/mui-material/src/CssBaseline/CssBaseline.d.ts +++ b/packages/mui-material/src/CssBaseline/CssBaseline.d.ts @@ -26,4 +26,4 @@ export interface CssBaselineProps extends StyledComponentProps { * * - [CssBaseline API](https://mui.com/material-ui/api/css-baseline/) */ -export default function CssBaseline(props: CssBaselineProps): JSX.Element; +export default function CssBaseline(props: CssBaselineProps): React.JSX.Element; diff --git a/packages/mui-material/src/Dialog/Dialog.d.ts b/packages/mui-material/src/Dialog/Dialog.d.ts index 14fdf0f2bc5c9d..d3c52d4ce7ccb4 100644 --- a/packages/mui-material/src/Dialog/Dialog.d.ts +++ b/packages/mui-material/src/Dialog/Dialog.d.ts @@ -118,4 +118,4 @@ export interface DialogProps extends StandardProps { * - [Dialog API](https://mui.com/material-ui/api/dialog/) * - inherits [Modal API](https://mui.com/material-ui/api/modal/) */ -export default function Dialog(props: DialogProps): JSX.Element; +export default function Dialog(props: DialogProps): React.JSX.Element; diff --git a/packages/mui-material/src/DialogActions/DialogActions.d.ts b/packages/mui-material/src/DialogActions/DialogActions.d.ts index 5e6a13e309c1d0..3f1842f3461c08 100644 --- a/packages/mui-material/src/DialogActions/DialogActions.d.ts +++ b/packages/mui-material/src/DialogActions/DialogActions.d.ts @@ -33,4 +33,4 @@ export interface DialogActionsProps extends StandardProps { * - [Fade API](https://mui.com/material-ui/api/fade/) * - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition/#Transition-props) */ -export default function Fade(props: FadeProps): JSX.Element; +export default function Fade(props: FadeProps): React.JSX.Element; diff --git a/packages/mui-material/src/FilledInput/FilledInput.d.ts b/packages/mui-material/src/FilledInput/FilledInput.d.ts index b54d7c165608ec..c31279ed4f8b8b 100644 --- a/packages/mui-material/src/FilledInput/FilledInput.d.ts +++ b/packages/mui-material/src/FilledInput/FilledInput.d.ts @@ -37,6 +37,6 @@ export interface FilledInputProps extends StandardProps { * - [FilledInput API](https://mui.com/material-ui/api/filled-input/) * - inherits [InputBase API](https://mui.com/material-ui/api/input-base/) */ -declare const FilledInput: ((props: FilledInputProps) => JSX.Element) & { muiName: string }; +declare const FilledInput: ((props: FilledInputProps) => React.JSX.Element) & { muiName: string }; export default FilledInput; diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts index 0a171d69a5db2f..8191b83c0638bc 100644 --- a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts +++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts @@ -106,4 +106,4 @@ export interface FormControlLabelProps * * - [FormControlLabel API](https://mui.com/material-ui/api/form-control-label/) */ -export default function FormControlLabel(props: FormControlLabelProps): JSX.Element; +export default function FormControlLabel(props: FormControlLabelProps): React.JSX.Element; diff --git a/packages/mui-material/src/FormGroup/FormGroup.d.ts b/packages/mui-material/src/FormGroup/FormGroup.d.ts index b8e6478f1b3ef4..120c8bda2f6ad4 100644 --- a/packages/mui-material/src/FormGroup/FormGroup.d.ts +++ b/packages/mui-material/src/FormGroup/FormGroup.d.ts @@ -37,4 +37,4 @@ export interface FormGroupProps extends StandardProps; diff --git a/packages/mui-material/src/Grow/Grow.d.ts b/packages/mui-material/src/Grow/Grow.d.ts index 173360b6ed7b55..244a6278f734e6 100644 --- a/packages/mui-material/src/Grow/Grow.d.ts +++ b/packages/mui-material/src/Grow/Grow.d.ts @@ -47,4 +47,4 @@ export interface GrowProps extends Omit { * - [Grow API](https://mui.com/material-ui/api/grow/) * - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition/#Transition-props) */ -export default function Grow(props: GrowProps): JSX.Element; +export default function Grow(props: GrowProps): React.JSX.Element; diff --git a/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts b/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts index fb9e5260c08a64..b134d22e35121d 100644 --- a/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts +++ b/packages/mui-material/src/ImageListItemBar/ImageListItemBar.d.ts @@ -48,4 +48,4 @@ export interface ImageListItemBarProps * * - [ImageListItemBar API](https://mui.com/material-ui/api/image-list-item-bar/) */ -export default function ImageListItemBar(props: ImageListItemBarProps): JSX.Element; +export default function ImageListItemBar(props: ImageListItemBarProps): React.JSX.Element; diff --git a/packages/mui-material/src/Input/Input.d.ts b/packages/mui-material/src/Input/Input.d.ts index 87e624d32c0b21..771af138da3324 100644 --- a/packages/mui-material/src/Input/Input.d.ts +++ b/packages/mui-material/src/Input/Input.d.ts @@ -30,6 +30,6 @@ export interface InputProps extends StandardProps { * - [Input API](https://mui.com/material-ui/api/input/) * - inherits [InputBase API](https://mui.com/material-ui/api/input-base/) */ -declare const Input: ((props: InputProps) => JSX.Element) & { muiName: string }; +declare const Input: ((props: InputProps) => React.JSX.Element) & { muiName: string }; export default Input; diff --git a/packages/mui-material/src/InputBase/InputBase.d.ts b/packages/mui-material/src/InputBase/InputBase.d.ts index 98d5fb1e411020..abf037f2288987 100644 --- a/packages/mui-material/src/InputBase/InputBase.d.ts +++ b/packages/mui-material/src/InputBase/InputBase.d.ts @@ -263,4 +263,4 @@ export interface InputBaseComponentProps * * - [InputBase API](https://mui.com/material-ui/api/input-base/) */ -export default function InputBase(props: InputBaseProps): JSX.Element; +export default function InputBase(props: InputBaseProps): React.JSX.Element; diff --git a/packages/mui-material/src/LinearProgress/LinearProgress.d.ts b/packages/mui-material/src/LinearProgress/LinearProgress.d.ts index 9b940c879c61bd..58e7a73e9e80c5 100644 --- a/packages/mui-material/src/LinearProgress/LinearProgress.d.ts +++ b/packages/mui-material/src/LinearProgress/LinearProgress.d.ts @@ -59,4 +59,4 @@ export interface LinearProgressProps * * - [LinearProgress API](https://mui.com/material-ui/api/linear-progress/) */ -export default function LinearProgress(props: LinearProgressProps): JSX.Element; +export default function LinearProgress(props: LinearProgressProps): React.JSX.Element; diff --git a/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts b/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts index 0fe8e56956dc83..5a13d4c9d5d8de 100644 --- a/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts +++ b/packages/mui-material/src/ListItemAvatar/ListItemAvatar.d.ts @@ -28,4 +28,4 @@ export interface ListItemAvatarProps extends StandardProps JSX.Element) & { +declare const ListItemSecondaryAction: (( + props: ListItemSecondaryActionProps, +) => React.JSX.Element) & { muiName: string; }; diff --git a/packages/mui-material/src/ListItemText/ListItemText.d.ts b/packages/mui-material/src/ListItemText/ListItemText.d.ts index 5c1f4f1690ca8b..f99f467ec6b74c 100644 --- a/packages/mui-material/src/ListItemText/ListItemText.d.ts +++ b/packages/mui-material/src/ListItemText/ListItemText.d.ts @@ -73,4 +73,6 @@ export interface ListItemTextProps< export default function ListItemText< PrimaryTypographyComponent extends React.ElementType = 'span', SecondaryTypographyComponent extends React.ElementType = 'p', ->(props: ListItemTextProps): JSX.Element; +>( + props: ListItemTextProps, +): React.JSX.Element; diff --git a/packages/mui-material/src/Menu/Menu.d.ts b/packages/mui-material/src/Menu/Menu.d.ts index 34b27cb8cca448..4e25f63ddfd124 100644 --- a/packages/mui-material/src/Menu/Menu.d.ts +++ b/packages/mui-material/src/Menu/Menu.d.ts @@ -94,4 +94,4 @@ export declare const MenuPaper: React.FC; * - [Menu API](https://mui.com/material-ui/api/menu/) * - inherits [Popover API](https://mui.com/material-ui/api/popover/) */ -export default function Menu(props: MenuProps): JSX.Element; +export default function Menu(props: MenuProps): React.JSX.Element; diff --git a/packages/mui-material/src/MobileStepper/MobileStepper.d.ts b/packages/mui-material/src/MobileStepper/MobileStepper.d.ts index 86a5e95f20981e..9a05cabb4b9b5d 100644 --- a/packages/mui-material/src/MobileStepper/MobileStepper.d.ts +++ b/packages/mui-material/src/MobileStepper/MobileStepper.d.ts @@ -59,4 +59,4 @@ export interface MobileStepperProps extends StandardProps; /** * Override or extend the styles applied to the component. */ diff --git a/packages/mui-material/src/NativeSelect/NativeSelect.d.ts b/packages/mui-material/src/NativeSelect/NativeSelect.d.ts index 6e4d078e6179ce..4f09d74c00833a 100644 --- a/packages/mui-material/src/NativeSelect/NativeSelect.d.ts +++ b/packages/mui-material/src/NativeSelect/NativeSelect.d.ts @@ -64,6 +64,6 @@ export interface NativeSelectProps * - [NativeSelect API](https://mui.com/material-ui/api/native-select/) * - inherits [Input API](https://mui.com/material-ui/api/input/) */ -declare const NativeSelect: ((props: NativeSelectProps) => JSX.Element) & { muiName: string }; +declare const NativeSelect: ((props: NativeSelectProps) => React.JSX.Element) & { muiName: string }; export default NativeSelect; diff --git a/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts b/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts index 61646bc8096fef..f8faee63a44db8 100644 --- a/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts +++ b/packages/mui-material/src/OutlinedInput/OutlinedInput.d.ts @@ -35,6 +35,8 @@ export interface OutlinedInputProps extends StandardProps { * - [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/) * - inherits [InputBase API](https://mui.com/material-ui/api/input-base/) */ -declare const OutlinedInput: ((props: OutlinedInputProps) => JSX.Element) & { muiName: string }; +declare const OutlinedInput: ((props: OutlinedInputProps) => React.JSX.Element) & { + muiName: string; +}; export default OutlinedInput; diff --git a/packages/mui-material/src/OverridableComponent.d.ts b/packages/mui-material/src/OverridableComponent.d.ts index 1a65de60e6c1f5..d982e97a4d009a 100644 --- a/packages/mui-material/src/OverridableComponent.d.ts +++ b/packages/mui-material/src/OverridableComponent.d.ts @@ -20,8 +20,8 @@ export interface OverridableComponent { */ component: RootComponent; } & OverrideProps, - ): JSX.Element | null; - (props: DefaultComponentProps): JSX.Element | null; + ): React.JSX.Element | null; + (props: DefaultComponentProps): React.JSX.Element | null; } /** diff --git a/packages/mui-material/src/Pagination/Pagination.d.ts b/packages/mui-material/src/Pagination/Pagination.d.ts index 11a27ca7b51a4c..130d148f830c15 100644 --- a/packages/mui-material/src/Pagination/Pagination.d.ts +++ b/packages/mui-material/src/Pagination/Pagination.d.ts @@ -86,4 +86,4 @@ export interface PaginationProps * * - [Pagination API](https://mui.com/material-ui/api/pagination/) */ -export default function Pagination(props: PaginationProps): JSX.Element; +export default function Pagination(props: PaginationProps): React.JSX.Element; diff --git a/packages/mui-material/src/Popover/Popover.d.ts b/packages/mui-material/src/Popover/Popover.d.ts index d8308b68ac7a5b..cd61ebd110215c 100644 --- a/packages/mui-material/src/Popover/Popover.d.ts +++ b/packages/mui-material/src/Popover/Popover.d.ts @@ -195,4 +195,4 @@ export declare const PopoverPaper: React.FC; * - [Popover API](https://mui.com/material-ui/api/popover/) * - inherits [Modal API](https://mui.com/material-ui/api/modal/) */ -export default function Popover(props: PopoverProps): JSX.Element; +export default function Popover(props: PopoverProps): React.JSX.Element; diff --git a/packages/mui-material/src/Popper/Popper.spec.tsx b/packages/mui-material/src/Popper/Popper.spec.tsx index c970097dd3db65..0431883265da3f 100644 --- a/packages/mui-material/src/Popper/Popper.spec.tsx +++ b/packages/mui-material/src/Popper/Popper.spec.tsx @@ -3,7 +3,7 @@ import { Instance } from '@popperjs/core'; import Tooltip from '@mui/material/Tooltip'; interface Props { - children: React.ReactElement; + children: React.ReactElement; value: number; } diff --git a/packages/mui-material/src/Radio/Radio.d.ts b/packages/mui-material/src/Radio/Radio.d.ts index 9b07e5576a34c3..839696994c4b31 100644 --- a/packages/mui-material/src/Radio/Radio.d.ts +++ b/packages/mui-material/src/Radio/Radio.d.ts @@ -62,4 +62,4 @@ export interface RadioProps * - [Radio API](https://mui.com/material-ui/api/radio/) * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/) */ -export default function Radio(props: RadioProps): JSX.Element; +export default function Radio(props: RadioProps): React.JSX.Element; diff --git a/packages/mui-material/src/RadioGroup/RadioGroup.d.ts b/packages/mui-material/src/RadioGroup/RadioGroup.d.ts index 3cfdf5713537e9..3793f088ac1384 100644 --- a/packages/mui-material/src/RadioGroup/RadioGroup.d.ts +++ b/packages/mui-material/src/RadioGroup/RadioGroup.d.ts @@ -36,4 +36,4 @@ export interface RadioGroupProps extends Omit { * - [RadioGroup API](https://mui.com/material-ui/api/radio-group/) * - inherits [FormGroup API](https://mui.com/material-ui/api/form-group/) */ -export default function RadioGroup(props: RadioGroupProps): JSX.Element; +export default function RadioGroup(props: RadioGroupProps): React.JSX.Element; diff --git a/packages/mui-material/src/Rating/Rating.d.ts b/packages/mui-material/src/Rating/Rating.d.ts index 1eb262d4c43d9f..6056f8966d5d4f 100644 --- a/packages/mui-material/src/Rating/Rating.d.ts +++ b/packages/mui-material/src/Rating/Rating.d.ts @@ -124,4 +124,4 @@ export interface RatingProps * * - [Rating API](https://mui.com/material-ui/api/rating/) */ -export default function Rating(props: RatingProps): JSX.Element; +export default function Rating(props: RatingProps): React.JSX.Element; diff --git a/packages/mui-material/src/Select/Select.d.ts b/packages/mui-material/src/Select/Select.d.ts index f4984bdc71f84d..3f68467ee861ab 100644 --- a/packages/mui-material/src/Select/Select.d.ts +++ b/packages/mui-material/src/Select/Select.d.ts @@ -196,7 +196,7 @@ export type SelectProps = * - [Select API](https://mui.com/material-ui/api/select/) * - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/) */ -declare const Select: ((props: SelectProps) => JSX.Element) & { +declare const Select: ((props: SelectProps) => React.JSX.Element) & { muiName: string; }; diff --git a/packages/mui-material/src/Slide/Slide.d.ts b/packages/mui-material/src/Slide/Slide.d.ts index 76621b10735cbf..c7e2d14e5bc92f 100644 --- a/packages/mui-material/src/Slide/Slide.d.ts +++ b/packages/mui-material/src/Slide/Slide.d.ts @@ -61,4 +61,4 @@ export interface SlideProps extends TransitionProps { * - [Slide API](https://mui.com/material-ui/api/slide/) * - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition/#Transition-props) */ -export default function Slide(props: SlideProps): JSX.Element; +export default function Slide(props: SlideProps): React.JSX.Element; diff --git a/packages/mui-material/src/Slider/Slider.d.ts b/packages/mui-material/src/Slider/Slider.d.ts index 98a9f281f14ae6..4aa0b3f0f7a399 100644 --- a/packages/mui-material/src/Slider/Slider.d.ts +++ b/packages/mui-material/src/Slider/Slider.d.ts @@ -281,7 +281,7 @@ export interface SliderTypeMap< } export interface SliderValueLabelProps extends React.HTMLAttributes { - children: React.ReactElement; + children: React.ReactElement; index: number; open: boolean; value: number; diff --git a/packages/mui-material/src/Slider/SliderValueLabel.types.ts b/packages/mui-material/src/Slider/SliderValueLabel.types.ts index 68fe865e14d10f..251c91edc65617 100644 --- a/packages/mui-material/src/Slider/SliderValueLabel.types.ts +++ b/packages/mui-material/src/Slider/SliderValueLabel.types.ts @@ -1,5 +1,5 @@ export interface SliderValueLabelProps { - children?: React.ReactElement; + children?: React.ReactElement; className?: string; style?: React.CSSProperties; /** diff --git a/packages/mui-material/src/Snackbar/Snackbar.d.ts b/packages/mui-material/src/Snackbar/Snackbar.d.ts index 30b6fc17082d8b..7c9d89895df2e7 100644 --- a/packages/mui-material/src/Snackbar/Snackbar.d.ts +++ b/packages/mui-material/src/Snackbar/Snackbar.d.ts @@ -127,4 +127,4 @@ export interface SnackbarProps extends StandardProps JSX.Element) & { muiName: string }; +declare const SpeedDialIcon: ((props: SpeedDialIconProps) => React.JSX.Element) & { + muiName: string; +}; export default SpeedDialIcon; diff --git a/packages/mui-material/src/StepConnector/StepConnector.d.ts b/packages/mui-material/src/StepConnector/StepConnector.d.ts index 28d55ad48c9476..e60c7c6bac61b4 100644 --- a/packages/mui-material/src/StepConnector/StepConnector.d.ts +++ b/packages/mui-material/src/StepConnector/StepConnector.d.ts @@ -4,7 +4,7 @@ import { InternalStandardProps as StandardProps } from '..'; import { Theme } from '../styles'; import { StepConnectorClasses } from './stepConnectorClasses'; -export type StepConnectorIcon = React.ReactElement | string | number; +export type StepConnectorIcon = React.ReactElement | string | number; export interface StepConnectorProps extends StandardProps, 'children'> { @@ -30,4 +30,4 @@ export type StepConnectorClasskey = keyof NonNullable * * - [StepContent API](https://mui.com/material-ui/api/step-content/) */ -export default function StepContent(props: StepContentProps): JSX.Element; +export default function StepContent(props: StepContentProps): React.JSX.Element; diff --git a/packages/mui-material/src/StepIcon/StepIcon.d.ts b/packages/mui-material/src/StepIcon/StepIcon.d.ts index 4f0c11140ae708..d71906a033977e 100644 --- a/packages/mui-material/src/StepIcon/StepIcon.d.ts +++ b/packages/mui-material/src/StepIcon/StepIcon.d.ts @@ -47,4 +47,4 @@ export type StepIconClasskey = keyof NonNullable; * * - [StepIcon API](https://mui.com/material-ui/api/step-icon/) */ -export default function StepIcon(props: StepIconProps): JSX.Element; +export default function StepIcon(props: StepIconProps): React.JSX.Element; diff --git a/packages/mui-material/src/StepLabel/StepLabel.d.ts b/packages/mui-material/src/StepLabel/StepLabel.d.ts index c695ac48ef9fe5..f3606a5e8c7b55 100644 --- a/packages/mui-material/src/StepLabel/StepLabel.d.ts +++ b/packages/mui-material/src/StepLabel/StepLabel.d.ts @@ -92,7 +92,7 @@ export type StepLabelClasskey = keyof NonNullable; * * - [StepLabel API](https://mui.com/material-ui/api/step-label/) */ -declare const StepLabel: ((props: StepLabelProps) => JSX.Element) & { +declare const StepLabel: ((props: StepLabelProps) => React.JSX.Element) & { muiName: string; }; diff --git a/packages/mui-material/src/Switch/Switch.d.ts b/packages/mui-material/src/Switch/Switch.d.ts index e4592a27ebfd57..b57cb0aa32fa4c 100644 --- a/packages/mui-material/src/Switch/Switch.d.ts +++ b/packages/mui-material/src/Switch/Switch.d.ts @@ -66,4 +66,4 @@ export interface SwitchProps * - [Switch API](https://mui.com/material-ui/api/switch/) * - inherits [IconButton API](https://mui.com/material-ui/api/icon-button/) */ -export default function Switch(props: SwitchProps): JSX.Element; +export default function Switch(props: SwitchProps): React.JSX.Element; diff --git a/packages/mui-material/src/Tab/Tab.d.ts b/packages/mui-material/src/Tab/Tab.d.ts index dc19a6eed31db4..f4885f67009c07 100644 --- a/packages/mui-material/src/Tab/Tab.d.ts +++ b/packages/mui-material/src/Tab/Tab.d.ts @@ -28,7 +28,7 @@ export interface TabOwnProps { /** * The icon to display. */ - icon?: string | React.ReactElement; + icon?: string | React.ReactElement; /** * The position of the icon relative to the label. * @default 'top' diff --git a/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts b/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts index e8d396e4a49b12..e755333b88ed82 100644 --- a/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts +++ b/packages/mui-material/src/TabScrollButton/TabScrollButton.d.ts @@ -75,4 +75,4 @@ export interface TabScrollButtonProps extends ButtonBaseProps { * * - [TabScrollButton API](https://mui.com/material-ui/api/tab-scroll-button/) */ -export default function TabScrollButton(props: TabScrollButtonProps): JSX.Element; +export default function TabScrollButton(props: TabScrollButtonProps): React.JSX.Element; diff --git a/packages/mui-material/src/TableCell/TableCell.d.ts b/packages/mui-material/src/TableCell/TableCell.d.ts index a702716b8e456f..0a5de08842ca09 100644 --- a/packages/mui-material/src/TableCell/TableCell.d.ts +++ b/packages/mui-material/src/TableCell/TableCell.d.ts @@ -83,4 +83,4 @@ export type SortDirection = 'asc' | 'desc' | false; * * - [TableCell API](https://mui.com/material-ui/api/table-cell/) */ -export default function TableCell(props: TableCellProps): JSX.Element; +export default function TableCell(props: TableCellProps): React.JSX.Element; diff --git a/packages/mui-material/src/TextField/TextField.d.ts b/packages/mui-material/src/TextField/TextField.d.ts index 84c910a3e11599..eaa9d2ab97c03d 100644 --- a/packages/mui-material/src/TextField/TextField.d.ts +++ b/packages/mui-material/src/TextField/TextField.d.ts @@ -340,4 +340,4 @@ export default function TextField( */ variant?: Variant; } & Omit, -): JSX.Element; +): React.JSX.Element; diff --git a/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts b/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts index 2ba480dca945d4..dee8f289b5553b 100644 --- a/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts +++ b/packages/mui-material/src/ToggleButtonGroup/ToggleButtonGroup.d.ts @@ -86,4 +86,4 @@ export interface ToggleButtonGroupProps * * - [ToggleButtonGroup API](https://mui.com/material-ui/api/toggle-button-group/) */ -export default function ToggleButtonGroup(props: ToggleButtonGroupProps): JSX.Element; +export default function ToggleButtonGroup(props: ToggleButtonGroupProps): React.JSX.Element; diff --git a/packages/mui-material/src/Tooltip/Tooltip.d.ts b/packages/mui-material/src/Tooltip/Tooltip.d.ts index a6f699533ec61f..aa47de7a123329 100644 --- a/packages/mui-material/src/Tooltip/Tooltip.d.ts +++ b/packages/mui-material/src/Tooltip/Tooltip.d.ts @@ -225,4 +225,4 @@ export interface TooltipProps extends StandardProps { ...props }: TypographyProps & { maxLines?: number; - }): JSX.Element => { + }): React.JSX.Element => { return ( , - ): JSX.Element; - (props: DefaultComponentPropsVer2): JSX.Element; + ): React.JSX.Element; + (props: DefaultComponentPropsVer2): React.JSX.Element; } /** diff --git a/packages/mui-material/test/describeConformance.ts b/packages/mui-material/test/describeConformance.ts index 633cf72e03ebbe..4715d91bad6817 100644 --- a/packages/mui-material/test/describeConformance.ts +++ b/packages/mui-material/test/describeConformance.ts @@ -5,7 +5,7 @@ import { import { ThemeProvider, createTheme } from '@mui/material/styles'; export default function describeConformance( - minimalElement: React.ReactElement, + minimalElement: React.ReactElement, getOptions: () => ConformanceOptions, ) { function getOptionsWithDefaults() { diff --git a/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.d.ts b/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.d.ts index 6e46a0722a27e1..0c2ef1cd47e33f 100644 --- a/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.d.ts +++ b/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.d.ts @@ -8,4 +8,4 @@ export interface GlobalStylesProps { export default function Global( props: GlobalStylesProps, -): React.ReactElement; +): React.ReactElement; diff --git a/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.spec.tsx b/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.spec.tsx index a87926dad34aac..f253f453661a40 100644 --- a/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.spec.tsx +++ b/packages/mui-styled-engine-sc/src/GlobalStyles/GlobalStyles.spec.tsx @@ -25,7 +25,7 @@ export interface GlobalStylesProps { styles: SCGlobalStylesProps['styles']; } -function GlobalStyles(props: GlobalStylesProps): React.ReactElement { +function GlobalStyles(props: GlobalStylesProps): React.ReactElement { return ; } diff --git a/packages/mui-styled-engine-sc/src/StyledEngineProvider/StyledEngineProvider.d.ts b/packages/mui-styled-engine-sc/src/StyledEngineProvider/StyledEngineProvider.d.ts index 64288e446205fd..267542a1f6be31 100644 --- a/packages/mui-styled-engine-sc/src/StyledEngineProvider/StyledEngineProvider.d.ts +++ b/packages/mui-styled-engine-sc/src/StyledEngineProvider/StyledEngineProvider.d.ts @@ -5,4 +5,4 @@ export interface StyledEngineProviderProps { injectFirst?: boolean; } -export default function StyledEngineProvider(props: StyledEngineProviderProps): JSX.Element; +export default function StyledEngineProvider(props: StyledEngineProviderProps): React.JSX.Element; diff --git a/packages/mui-styled-engine-sc/src/index.d.ts b/packages/mui-styled-engine-sc/src/index.d.ts index ea46672d21563a..994c02c99c3c28 100644 --- a/packages/mui-styled-engine-sc/src/index.d.ts +++ b/packages/mui-styled-engine-sc/src/index.d.ts @@ -23,7 +23,7 @@ type Defaultize = P extends any Partial>> : never; -export type IntrinsicElementsKeys = keyof JSX.IntrinsicElements; +export type IntrinsicElementsKeys = keyof React.JSX.IntrinsicElements; type ReactDefaultizedProps = C extends { defaultProps: infer D } ? Defaultize : P; type MakeAttrsOptional< @@ -156,7 +156,7 @@ type StyledComponentPropsWithAs< }; export type StyledComponent< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, T extends object = {}, O extends object = {}, A extends keyof any = never, @@ -217,7 +217,7 @@ export interface StyledComponentBase< O & StyledComponentInnerOtherProps, A | StyledComponentInnerAttrs >; - withComponent>( + withComponent>( component: WithC, ): StyledComponent; } @@ -232,18 +232,18 @@ type StyledComponentInterpolation = type AnyIfEmpty = keyof T extends never ? any : T; type ThemedStyledComponentFactories = { - [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunctionBase; + [TTag in keyof React.JSX.IntrinsicElements]: ThemedStyledFunctionBase; }; export type StyledComponentPropsWithRef< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, > = C extends AnyStyledComponent ? React.ComponentPropsWithRef> : React.ComponentPropsWithRef; // Same as in styled-components, but copied here so that it would use the Interpolation & CSS typings from above export interface ThemedStyledFunctionBase< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never, @@ -267,7 +267,7 @@ export interface ThemedStyledFunctionBase< // same as ThemedStyledFunction in styled-components, but without attrs, and withConfig export interface ThemedStyledFunction< - C extends keyof JSX.IntrinsicElements | React.ComponentType, + C extends keyof React.JSX.IntrinsicElements | React.ComponentType, T extends object, O extends object = {}, A extends keyof any = never, @@ -348,22 +348,24 @@ export interface ThemedBaseStyledInterface< ): CreateStyledComponent & MUIStyledCommonProps, {}, {}, Theme>; < - Tag extends keyof JSX.IntrinsicElements, - ForwardedProps extends keyof JSX.IntrinsicElements[Tag] = keyof JSX.IntrinsicElements[Tag], + Tag extends keyof React.JSX.IntrinsicElements, + ForwardedProps extends + keyof React.JSX.IntrinsicElements[Tag] = keyof React.JSX.IntrinsicElements[Tag], >( tag: Tag, - options: FilteringStyledOptions & MuiStyledOptions, + options: FilteringStyledOptions & + MuiStyledOptions, ): CreateStyledComponent< MUIStyledCommonProps, - Pick, + Pick, {}, Theme >; - ( + ( tag: Tag, options?: StyledConfig & MuiStyledOptions, - ): CreateStyledComponent; + ): CreateStyledComponent; } export type CreateMUIStyled< @@ -372,8 +374,9 @@ export type CreateMUIStyled< T extends object = {}, > = ThemedBaseStyledInterface>; -export type PropsOf> = - JSX.LibraryManagedAttributes>; +export type PropsOf< + C extends keyof React.JSX.IntrinsicElements | React.JSXElementConstructor, +> = React.JSX.LibraryManagedAttributes>; export interface MUIStyledComponent< ComponentProps extends {}, @@ -386,7 +389,7 @@ export interface MUIStyledComponent< withComponent>>( component: C, ): MUIStyledComponent>; - withComponent( + withComponent( tag: Tag, - ): MUIStyledComponent; + ): MUIStyledComponent; } diff --git a/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.d.ts b/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.d.ts index 41b379c3214083..e746c3036a3a62 100644 --- a/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.d.ts +++ b/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.d.ts @@ -8,4 +8,4 @@ export interface GlobalStylesProps { export default function GlobalStyles( props: GlobalStylesProps, -): React.ReactElement; +): React.ReactElement; diff --git a/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.spec.tsx b/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.spec.tsx index 2420e7ea060d97..13b34d7f29b019 100644 --- a/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.spec.tsx +++ b/packages/mui-styled-engine/src/GlobalStyles/GlobalStyles.spec.tsx @@ -25,7 +25,7 @@ export interface GlobalStylesProps { styles: EmGlobalStylesProps['styles']; } -function GlobalStyles(props: GlobalStylesProps): React.ReactElement { +function GlobalStyles(props: GlobalStylesProps): React.ReactElement { return ; } diff --git a/packages/mui-styled-engine/src/StyledEngineProvider/StyledEngineProvider.d.ts b/packages/mui-styled-engine/src/StyledEngineProvider/StyledEngineProvider.d.ts index 64288e446205fd..267542a1f6be31 100644 --- a/packages/mui-styled-engine/src/StyledEngineProvider/StyledEngineProvider.d.ts +++ b/packages/mui-styled-engine/src/StyledEngineProvider/StyledEngineProvider.d.ts @@ -5,4 +5,4 @@ export interface StyledEngineProviderProps { injectFirst?: boolean; } -export default function StyledEngineProvider(props: StyledEngineProviderProps): JSX.Element; +export default function StyledEngineProvider(props: StyledEngineProviderProps): React.JSX.Element; diff --git a/packages/mui-styled-engine/src/index.d.ts b/packages/mui-styled-engine/src/index.d.ts index 4bc50bc1452bda..d0df929ca95554 100644 --- a/packages/mui-styled-engine/src/index.d.ts +++ b/packages/mui-styled-engine/src/index.d.ts @@ -200,20 +200,22 @@ export interface CreateMUIStyled< ): CreateStyledComponent & MUIStyledCommonProps, {}, {}, Theme>; < - Tag extends keyof JSX.IntrinsicElements, - ForwardedProps extends keyof JSX.IntrinsicElements[Tag] = keyof JSX.IntrinsicElements[Tag], + Tag extends keyof React.JSX.IntrinsicElements, + ForwardedProps extends + keyof React.JSX.IntrinsicElements[Tag] = keyof React.JSX.IntrinsicElements[Tag], >( tag: Tag, - options: FilteringStyledOptions & MuiStyledOptions, + options: FilteringStyledOptions & + MuiStyledOptions, ): CreateStyledComponent< MUIStyledCommonProps, - Pick, + Pick, {}, Theme >; - ( + ( tag: Tag, options?: StyledOptions & MuiStyledOptions, - ): CreateStyledComponent; + ): CreateStyledComponent; } diff --git a/packages/mui-styles/src/ServerStyleSheets/ServerStyleSheets.d.ts b/packages/mui-styles/src/ServerStyleSheets/ServerStyleSheets.d.ts index 84617671784509..24ec50839ed00a 100644 --- a/packages/mui-styles/src/ServerStyleSheets/ServerStyleSheets.d.ts +++ b/packages/mui-styles/src/ServerStyleSheets/ServerStyleSheets.d.ts @@ -5,7 +5,7 @@ declare class ServerStyleSheets { constructor(options?: object); collect(children: React.ReactNode, options?: object): React.ReactElement; toString(): string; - getStyleElement(props?: object): React.ReactElement; + getStyleElement(props?: object): React.ReactElement; } export default ServerStyleSheets; diff --git a/packages/mui-styles/src/styled/styled.d.ts b/packages/mui-styles/src/styled/styled.d.ts index 7e3666e301b576..f0d15df8f4dff6 100644 --- a/packages/mui-styles/src/styled/styled.d.ts +++ b/packages/mui-styles/src/styled/styled.d.ts @@ -23,7 +23,7 @@ export type ComponentCreator = < options?: WithStylesOptions, ) => StyledComponent< DistributiveOmit< - JSX.LibraryManagedAttributes>, + React.JSX.LibraryManagedAttributes>, 'classes' | 'className' > & StyledComponentProps<'root'> & diff --git a/packages/mui-styles/src/withTheme/withTheme.d.ts b/packages/mui-styles/src/withTheme/withTheme.d.ts index e211c3e54086ae..82d1f8f1b473fc 100644 --- a/packages/mui-styles/src/withTheme/withTheme.d.ts +++ b/packages/mui-styles/src/withTheme/withTheme.d.ts @@ -25,7 +25,7 @@ export default function withTheme< component: C, ): React.JSXElementConstructor< DistributiveOmit< - JSX.LibraryManagedAttributes>, + React.JSX.LibraryManagedAttributes>, keyof WithTheme > & Partial> & diff --git a/packages/mui-styles/test/styles.spec.tsx b/packages/mui-styles/test/styles.spec.tsx index 2b68e4278ccf56..8ed6a1d215f263 100644 --- a/packages/mui-styles/test/styles.spec.tsx +++ b/packages/mui-styles/test/styles.spec.tsx @@ -215,7 +215,7 @@ withStyles((theme) => }); interface ListItemContentProps extends WithStyles { - children?: React.ReactElement; + children?: React.ReactElement; inset?: boolean; row?: boolean; } diff --git a/packages/mui-system/src/Stack/createStack.tsx b/packages/mui-system/src/Stack/createStack.tsx index 840163c4e20799..0f1f9659ebb952 100644 --- a/packages/mui-system/src/Stack/createStack.tsx +++ b/packages/mui-system/src/Stack/createStack.tsx @@ -50,7 +50,7 @@ function useThemePropsDefault(props: T) { * > joinChildren([1,2,3], 0) * [1,0,2,0,3] */ -function joinChildren(children: React.ReactNode, separator: React.ReactElement) { +function joinChildren(children: React.ReactNode, separator: React.ReactElement) { const childrenArray = React.Children.toArray(children).filter(Boolean); return childrenArray.reduce((output, child, index) => { @@ -209,7 +209,7 @@ export default function createStack( className={clsx(classes.root, className)} {...other} > - {divider ? joinChildren(children, divider as React.ReactElement) : children} + {divider ? joinChildren(children, divider as React.ReactElement) : children} ); }) as OverridableComponent; diff --git a/packages/mui-system/src/Unstable_Grid/createGrid.tsx b/packages/mui-system/src/Unstable_Grid/createGrid.tsx index 092185ae30fcb1..e0984a90dd7f23 100644 --- a/packages/mui-system/src/Unstable_Grid/createGrid.tsx +++ b/packages/mui-system/src/Unstable_Grid/createGrid.tsx @@ -166,7 +166,7 @@ export default function createGrid( {React.Children.map(children, (child) => { if (React.isValidElement(child) && isMuiElement(child, ['Grid'])) { return React.cloneElement(child, { - unstable_level: child.props.unstable_level ?? level + 1, + unstable_level: (child.props as any).unstable_level ?? level + 1, } as GridProps); } return child; diff --git a/packages/mui-system/src/cssVars/createCssVarsProvider.d.ts b/packages/mui-system/src/cssVars/createCssVarsProvider.d.ts index b8dc3ff9a2d703..2e8e398d6dadb8 100644 --- a/packages/mui-system/src/cssVars/createCssVarsProvider.d.ts +++ b/packages/mui-system/src/cssVars/createCssVarsProvider.d.ts @@ -90,7 +90,7 @@ export interface CreateCssVarsProviderResult< disableStyleSheetGeneration?: boolean; } >, - ) => React.ReactElement; + ) => React.ReactElement; useColorScheme: () => ColorSchemeContextValue; getInitColorSchemeScript: typeof getInitColorSchemeScript; } diff --git a/packages/mui-system/test/describeConformance.ts b/packages/mui-system/test/describeConformance.ts index 85ce541f937df4..aa876199917f98 100644 --- a/packages/mui-system/test/describeConformance.ts +++ b/packages/mui-system/test/describeConformance.ts @@ -5,7 +5,7 @@ import { import { ThemeProvider, createTheme } from '@mui/system'; export default function describeConformance( - minimalElement: React.ReactElement, + minimalElement: React.ReactElement, getOptions: () => ConformanceOptions, ) { function getOptionsWithDefaults() { diff --git a/packages/mui-types/OverridableComponentAugmentation.ts b/packages/mui-types/OverridableComponentAugmentation.ts index aa50ed447020f4..4c735e21896bbb 100644 --- a/packages/mui-types/OverridableComponentAugmentation.ts +++ b/packages/mui-types/OverridableComponentAugmentation.ts @@ -15,8 +15,8 @@ declare module '@mui/types' { */ component: C; } & OverridePropsVer2, - ): JSX.Element; - (props: DefaultComponentPropsVer2): JSX.Element; + ): React.JSX.Element; + (props: DefaultComponentPropsVer2): React.JSX.Element; propTypes?: any; } diff --git a/packages/mui-types/index.d.ts b/packages/mui-types/index.d.ts index 64daa8cb6bb7bc..7988996932d6be 100644 --- a/packages/mui-types/index.d.ts +++ b/packages/mui-types/index.d.ts @@ -27,7 +27,10 @@ export type PropInjector = < >( component: C, ) => React.JSXElementConstructor< - DistributiveOmit>, keyof InjectedProps> & + DistributiveOmit< + React.JSX.LibraryManagedAttributes>, + keyof InjectedProps + > & AdditionalProps >; @@ -101,8 +104,8 @@ export interface OverridableComponent { */ component: C; } & OverrideProps, - ): JSX.Element | null; - (props: DefaultComponentProps): JSX.Element | null; + ): React.JSX.Element | null; + (props: DefaultComponentProps): React.JSX.Element | null; propTypes?: any; } diff --git a/packages/mui-utils/src/getValidReactChildren/getValidReactChildren.ts b/packages/mui-utils/src/getValidReactChildren/getValidReactChildren.ts index 6a2d5912347563..ea1132e5fc32ba 100644 --- a/packages/mui-utils/src/getValidReactChildren/getValidReactChildren.ts +++ b/packages/mui-utils/src/getValidReactChildren/getValidReactChildren.ts @@ -9,5 +9,5 @@ import * as React from 'react'; export default function getValidReactChildren(children: React.ReactNode) { return React.Children.toArray(children).filter((child) => React.isValidElement(child), - ) as React.ReactElement[]; + ) as React.ReactElement[]; } diff --git a/packages/test-utils/src/createMount.tsx b/packages/test-utils/src/createMount.tsx index 03f0d273d08bff..f690f03a7bb327 100644 --- a/packages/test-utils/src/createMount.tsx +++ b/packages/test-utils/src/createMount.tsx @@ -11,7 +11,7 @@ interface ModeProps { * using `wrapper.setProps({ children })` would work differently if this component * would be the root. */ - __element: React.ReactElement; + __element: React.ReactElement; __strict: boolean; } @@ -93,7 +93,7 @@ export default function createMount(options: CreateMountOptions = {}) { }); const mountWithContext = function mountWithContext( - node: React.ReactElement, + node: React.ReactElement, localOptions: Omit = {}, ) { const { strict = globalStrict, ...localEnzymeOptions } = localOptions; diff --git a/packages/test-utils/src/createRenderer.tsx b/packages/test-utils/src/createRenderer.tsx index 33d7a6017dfa3b..4813c6a5e63236 100644 --- a/packages/test-utils/src/createRenderer.tsx +++ b/packages/test-utils/src/createRenderer.tsx @@ -281,7 +281,7 @@ export interface MuiRenderToStringResult { } function render( - element: React.ReactElement, + element: React.ReactElement, configuration: ClientRenderConfiguration, ): MuiRenderResult { const { container, hydrate, wrapper } = configuration; @@ -316,7 +316,7 @@ function render( } function renderToString( - element: React.ReactElement, + element: React.ReactElement, configuration: ServerRenderConfiguration, ): { container: HTMLElement; hydrate(): MuiRenderResult } { const { container, wrapper: Wrapper } = configuration; @@ -438,8 +438,11 @@ function createClock(defaultMode: 'fake' | 'real', config: ClockConfig): Clock { interface Renderer { clock: Clock; - render(element: React.ReactElement, options?: RenderOptions): MuiRenderResult; - renderToString(element: React.ReactElement, options?: RenderOptions): MuiRenderToStringResult; + render(element: React.ReactElement, options?: RenderOptions): MuiRenderResult; + renderToString( + element: React.ReactElement, + options?: RenderOptions, + ): MuiRenderToStringResult; } export interface CreateRendererOptions extends Pick { @@ -577,7 +580,7 @@ export function createRenderer(globalOptions: CreateRendererOptions = {}): Rende return { clock, - render(element: React.ReactElement, options: RenderOptions = {}) { + render(element: React.ReactElement, options: RenderOptions = {}) { if (!prepared) { throw new Error( 'Unable to finish setup before `render()` was called. ' + @@ -592,7 +595,7 @@ export function createRenderer(globalOptions: CreateRendererOptions = {}): Rende wrapper: createWrapper(options), }); }, - renderToString(element: React.ReactElement, options: RenderOptions = {}) { + renderToString(element: React.ReactElement, options: RenderOptions = {}) { if (!prepared) { throw new Error( 'Unable to finish setup before `render()` was called. ' + diff --git a/packages/test-utils/src/describeConformance.tsx b/packages/test-utils/src/describeConformance.tsx index 1c5b6505118dfe..4cb6d35c2120bb 100644 --- a/packages/test-utils/src/describeConformance.tsx +++ b/packages/test-utils/src/describeConformance.tsx @@ -26,7 +26,7 @@ export interface SlotTestingOptions { /** * A custom HTML tag to use for the `slots` prop. */ - testWithElement?: keyof JSX.IntrinsicElements | null; + testWithElement?: keyof React.JSX.IntrinsicElements | null; /** * To ensure that the slot has this class name when `slotProps` is provided. */ @@ -45,8 +45,8 @@ export interface ConformanceOptions { refInstanceof: any; after?: () => void; inheritComponent?: React.ElementType; - render: (node: React.ReactElement) => MuiRenderResult; - mount?: (node: React.ReactElement) => ReactWrapper; + render: (node: React.ReactElement) => MuiRenderResult; + mount?: (node: React.ReactElement) => ReactWrapper; only?: Array; skip?: Array; testComponentsRootPropWith?: string; @@ -58,8 +58,8 @@ export interface ConformanceOptions { testVariantProps?: object; testLegacyComponentsProp?: boolean; wrapMount?: ( - mount: (node: React.ReactElement) => ReactWrapper, - ) => (node: React.ReactElement) => ReactWrapper; + mount: (node: React.ReactElement) => ReactWrapper, + ) => (node: React.ReactElement) => ReactWrapper; slots?: Record; ThemeProvider?: React.ElementType; createTheme?: (arg: any) => any; @@ -79,7 +79,7 @@ function assertDOMNode(node: unknown) { * The element should have a component wrapped in withStyles as the root */ function testRef( - element: React.ReactElement, + element: React.ReactElement, mount: ConformanceOptions['mount'], onRef: (instance: unknown, wrapper: import('enzyme').ReactWrapper) => void = assertDOMNode, ) { @@ -129,7 +129,10 @@ function throwMissingPropError(field: string): never { * MUI components have a `className` prop. The `className` is applied to * the root component. */ -export function testClassName(element: React.ReactElement, getOptions: () => ConformanceOptions) { +export function testClassName( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { it('applies the className to the root component', () => { const { mount } = getOptions(); if (!mount) { @@ -149,7 +152,7 @@ export function testClassName(element: React.ReactElement, getOptions: () => Con * Component from @inheritComponent */ export function testComponentProp( - element: React.ReactElement, + element: React.ReactElement, getOptions: () => ConformanceOptions, ) { describe('prop: component', () => { @@ -169,7 +172,10 @@ export function testComponentProp( /** * MUI components can spread additional props to a documented component. */ -export function testPropsSpread(element: React.ReactElement, getOptions: () => ConformanceOptions) { +export function testPropsSpread( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { it(`spreads props to the root component`, () => { // type def in ConformanceOptions const { inheritComponent, mount } = getOptions(); @@ -199,7 +205,10 @@ export function testPropsSpread(element: React.ReactElement, getOptions: () => C * This is determined by a given constructor i.e. a React.Component or HTMLElement for * components that forward their ref and attach it to a host component. */ -export function describeRef(element: React.ReactElement, getOptions: () => ConformanceOptions) { +export function describeRef( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { describe('ref', () => { it(`attaches the ref`, () => { // type def in ConformanceOptions @@ -220,7 +229,10 @@ export function describeRef(element: React.ReactElement, getOptions: () => Confo /** * Tests that the root component has the root class */ -export function testRootClass(element: React.ReactElement, getOptions: () => ConformanceOptions) { +export function testRootClass( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { it('applies the root class to the root component if it has this class', () => { const { classes, render, skip } = getOptions(); if (classes.root == null) { @@ -259,7 +271,7 @@ export function testRootClass(element: React.ReactElement, getOptions: () => Con * Tests that the component can be rendered with react-test-renderer. * This is important for snapshot testing with Jest (even if we don't encourage it). */ -export function testReactTestRenderer(element: React.ReactElement) { +export function testReactTestRenderer(element: React.ReactElement) { it('should render without errors in ReactTestRenderer', () => { ReactTestRenderer.act(() => { ReactTestRenderer.create(element, { @@ -286,7 +298,7 @@ function forEachSlot( }); } -function testSlotsProp(element: React.ReactElement, getOptions: () => ConformanceOptions) { +function testSlotsProp(element: React.ReactElement, getOptions: () => ConformanceOptions) { const { render, slots, testLegacyComponentsProp } = getOptions(); const CustomComponent = React.forwardRef< @@ -457,7 +469,7 @@ function testSlotsProp(element: React.ReactElement, getOptions: () => Conformanc }); } -function testSlotPropsProp(element: React.ReactElement, getOptions: () => ConformanceOptions) { +function testSlotPropsProp(element: React.ReactElement, getOptions: () => ConformanceOptions) { const { render, slots, testLegacyComponentsProp } = getOptions(); if (!render) { @@ -540,7 +552,10 @@ function testSlotPropsProp(element: React.ReactElement, getOptions: () => Confor }); } -function testSlotPropsCallback(element: React.ReactElement, getOptions: () => ConformanceOptions) { +function testSlotPropsCallback( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { const { render, slots } = getOptions(); if (!render) { @@ -568,7 +583,10 @@ function testSlotPropsCallback(element: React.ReactElement, getOptions: () => Co * MUI components have a `components` prop that allows rendering a different * Components from @inheritComponent */ -function testComponentsProp(element: React.ReactElement, getOptions: () => ConformanceOptions) { +function testComponentsProp( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { describe('prop components:', () => { it('can render another root component with the `components` prop', () => { const { mount, testComponentsRootPropWith: component = 'em' } = getOptions(); @@ -587,7 +605,10 @@ function testComponentsProp(element: React.ReactElement, getOptions: () => Confo * MUI theme has a components section that allows specifying default props. * Components from @inheritComponent */ -function testThemeDefaultProps(element: React.ReactElement, getOptions: () => ConformanceOptions) { +function testThemeDefaultProps( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { describe('theme default components:', () => { it("respect theme's defaultProps", () => { const testProp = 'data-id'; @@ -631,7 +652,7 @@ function testThemeDefaultProps(element: React.ReactElement, getOptions: () => Co * Components from @inheritComponent */ function testThemeStyleOverrides( - element: React.ReactElement, + element: React.ReactElement, getOptions: () => ConformanceOptions, ) { describe('theme style overrides:', () => { @@ -877,7 +898,7 @@ function testThemeStyleOverrides( * MUI theme has a components section that allows specifying custom variants. * Components from @inheritComponent */ -function testThemeVariants(element: React.ReactElement, getOptions: () => ConformanceOptions) { +function testThemeVariants(element: React.ReactElement, getOptions: () => ConformanceOptions) { describe('theme variants:', () => { it("respect theme's variants", function test() { if (/jsdom/.test(window.navigator.userAgent)) { @@ -982,7 +1003,10 @@ function testThemeVariants(element: React.ReactElement, getOptions: () => Confor * MUI theme supports custom palettes. * The components that iterate over the palette via `variants` should be able to render with or without applying the custom palette styles. */ -function testThemeCustomPalette(element: React.ReactElement, getOptions: () => ConformanceOptions) { +function testThemeCustomPalette( + element: React.ReactElement, + getOptions: () => ConformanceOptions, +) { describe('theme extended palette:', () => { it('should render without errors', function test() { const { render, ThemeProvider, createTheme } = getOptions(); @@ -1026,7 +1050,7 @@ const fullSuite = { * components. */ function describeConformance( - minimalElement: React.ReactElement, + minimalElement: React.ReactElement, getOptions: () => ConformanceOptions, ) { let originalMatchmedia: typeof window.matchMedia;