Skip to content

Commit

Permalink
Run react-element-default-any-props
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai committed May 22, 2024
1 parent d87a976 commit 30af6f2
Show file tree
Hide file tree
Showing 75 changed files with 153 additions and 118 deletions.
4 changes: 2 additions & 2 deletions docs/data/base/components/modal/SpringModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function SpringModal() {

const Backdrop = React.forwardRef<
HTMLDivElement,
{ children: React.ReactElement; open: boolean }
{ children: React.ReactElement<any>; open: boolean }
>((props, ref) => {
const { open, ...other } = props;
return <Fade ref={ref} in={open} {...other} />;
Expand All @@ -61,7 +61,7 @@ const StyledBackdrop = styled(Backdrop)`
`;

interface FadeProps {
children: React.ReactElement;
children: React.ReactElement<any>;
in?: boolean;
onClick?: any;
onEnter?: (node: HTMLElement, isAppearing: boolean) => void;
Expand Down
2 changes: 1 addition & 1 deletion docs/data/base/components/modal/UseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function UseModal() {
}

interface ModalProps {
children: React.ReactElement;
children: React.ReactElement<any>;
closeAfterTransition?: boolean;
container?: Element | (() => Element | null) | null;
disableAutoFocus?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion docs/data/base/components/slider/DiscreteSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function DiscreteSlider() {
}

interface SliderValueLabelProps {
children: React.ReactElement;
children: React.ReactElement<any>;
}

function SliderValueLabel({ children }: SliderValueLabelProps) {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/base/components/slider/LabeledValuesSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function LabeledValuesSlider() {
}

interface SliderValueLabelProps {
children: React.ReactElement;
children: React.ReactElement<any>;
}

function SliderValueLabel({ children }: SliderValueLabelProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function PopupWithTrigger(props: PopupProps) {
);
}

function MaterialUITransitionAdapter(props: { children: React.ReactElement }) {
function MaterialUITransitionAdapter(props: { children: React.ReactElement<any> }) {
const { requestedEnter, onExited } = useTransitionStateManager();
const { children } = props;

Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/alert/AlertVariousStates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function AlertVariousStates() {
const items: {
title: string;
color: ColorPaletteProp;
icon: React.ReactElement;
icon: React.ReactElement<any>;
}[] = [
{ title: 'Success', color: 'success', icon: <CheckCircleIcon /> },
{ title: 'Warning', color: 'warning', icon: <WarningIcon /> },
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/autocomplete/Virtualize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const ListboxComponent = React.forwardRef<
const { children, anchorEl, open, modifiers, ...other } = props;
const itemData: Array<any> = [];
(
children as [Array<{ children: Array<React.ReactElement> | undefined }>]
children as [Array<{ children: Array<React.ReactElement<any>> | undefined }>]
)[0].forEach((item) => {
if (item) {
itemData.push(item);
Expand Down
2 changes: 1 addition & 1 deletion docs/data/joy/components/menu/MenuIconSideNavExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import MenuButton from '@mui/joy/MenuButton';
// https://popper.js.org/docs/v2/modifiers/offset/
interface MenuButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
children: React.ReactNode;
menu: React.ReactElement;
menu: React.ReactElement<any>;
open: boolean;
onOpen: (
event?:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>;
id: string;
menus: Array<{ label: string } & { [k: string]: any }>;
}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> },
) {
const { icon, sx, ...other } = props;
return (
<Card
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import RemoveCircleOutlineRoundedIcon from '@mui/icons-material/RemoveCircleOutl

export default function FileUpload(
props: CardProps & {
icon?: React.ReactElement;
icon?: React.ReactElement<any>;
fileName: string;
fileSize: string;
progress: number;
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/app-bar/BackToTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface Props {
* You won't need it on your project.
*/
window?: () => Window;
children?: React.ReactElement;
children?: React.ReactElement<any>;
}

function ScrollTop(props: Props) {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/app-bar/ElevateAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface Props {
* You won't need it on your project.
*/
window?: () => Window;
children?: React.ReactElement;
children?: React.ReactElement<any>;
}

function ElevationScroll(props: Props) {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/app-bar/HideAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Props {
* You won't need it on your project.
*/
window?: () => Window;
children?: React.ReactElement;
children?: React.ReactElement<any>;
}

function HideOnScroll(props: Props) {
Expand Down
8 changes: 4 additions & 4 deletions docs/data/material/components/autocomplete/Virtualize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ const ListboxComponent = React.forwardRef<
React.HTMLAttributes<HTMLElement>
>(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<any>[] = [];
(children as React.ReactElement<any>[]).forEach(
(item: React.ReactElement<any> & { children?: React.ReactElement<any>[] }) => {
itemData.push(item);
itemData.push(...(item.children || []));
},
Expand All @@ -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<any>) => {
if (child.hasOwnProperty('group')) {
return 48;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/dialogs/FullScreenDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { TransitionProps } from '@mui/material/transitions';

const Transition = React.forwardRef(function Transition(
props: TransitionProps & {
children: React.ReactElement;
children: React.ReactElement<any>;
},
ref: React.Ref<unknown>,
) {
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/lists/InteractiveList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
return [0, 1, 2].map((value) =>
React.cloneElement(element, {
key: value,
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/modal/SpringModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>;
in?: boolean;
onClick?: any;
onEnter?: (node: HTMLElement, isAppearing: boolean) => void;
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/popper/SpringPopper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>;
in?: boolean;
onEnter?: () => void;
onExited?: () => void;
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/rating/RadioGroupRating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const StyledRating = styled(Rating)(({ theme }) => ({

const customIcons: {
[index: string]: {
icon: React.ReactElement;
icon: React.ReactElement<any>;
label: string;
};
} = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> } = {
1: <SettingsIcon />,
2: <GroupAddIcon />,
3: <VideoLabelIcon />,
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/integrations/routing/ListRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Router(props: { children?: React.ReactNode }) {
}

interface ListItemLinkProps {
icon?: React.ReactElement;
icon?: React.ReactElement<any>;
primary: string;
to: string;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/about/HowToSupport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Widget({
}: {
children: React.ReactNode;
title: string;
icon: React.ReactElement;
icon: React.ReactElement<any>;
}) {
return (
<Paper
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/action/StylingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function StylingInfo({
appeared,
stylingContent,
...props
}: { appeared: boolean; stylingContent?: React.ReactElement } & BoxProps) {
}: { appeared: boolean; stylingContent?: React.ReactElement<any> } & BoxProps) {
const [hidden, setHidden] = React.useState(false);
const defaultContent = (
<React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/header/HeaderNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const PRODUCT_IDS = [
];

type ProductSubMenuProps = {
icon: React.ReactElement;
icon: React.ReactElement<any>;
name: React.ReactNode;
description: React.ReactNode;
chip?: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/home/MaterialDesignComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function Demo({
}: {
name: string;
theme: Theme | undefined;
children: React.ReactElement;
children: React.ReactElement<any>;
control?: { prop: string; values: Array<string>; defaultValue?: string };
}) {
const [propValue, setPropValue] = React.useState(
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/home/UserFeedbacks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Feedback({
avatarSrcSet: string;
name: string;
role: string;
company?: React.ReactElement;
company?: React.ReactElement<any>;
};
}) {
return (
Expand Down
6 changes: 5 additions & 1 deletion docs/src/components/pricing/PricingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> }) {
return (
<Box
{...props}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/productX/XRoadmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function RoadmapStatusDot({ color }: RoadmapStatusDotProps) {
}

export default function XRoadmap() {
function renderList(content: React.ReactElement, nested?: boolean) {
function renderList(content: React.ReactElement<any>, nested?: boolean) {
return (
<Box
sx={{
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/showcase/ViewToggleButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const views = ['quilt', 'module', 'agenda', 'week', 'sidebar'] as const;

type View = (typeof views)[number];

const viewIcons: Record<View, React.ReactElement> = {
const viewIcons: Record<View, React.ReactElement<any>> = {
quilt: <ViewQuiltRounded />,
module: <ViewModuleRounded />,
agenda: <ViewAgendaRounded />,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/typography/SectionHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface SectionHeadlineProps {
*/
inverted?: boolean;
overline?: React.ReactNode;
title: string | React.ReactElement;
title: string | React.ReactElement<any>;
}

export default function SectionHeadline(props: SectionHeadlineProps) {
Expand Down
4 changes: 2 additions & 2 deletions docs/src/layouts/HeroContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { alpha } from '@mui/material/styles';
interface HeroContainerProps {
disableMobileHidden?: boolean;
disableTabExclusion?: boolean;
left: React.ReactElement;
left: React.ReactElement<any>;
linearGradient?: boolean;
right: React.ReactElement;
right: React.ReactElement<any>;
rightSx?: BoxProps['sx'];
}

Expand Down
3 changes: 1 addition & 2 deletions docs/src/modules/components/JoyThemeBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</Typography>

<Sheet
variant="outlined"
sx={{
Expand Down Expand Up @@ -1273,7 +1272,7 @@ function getAvailableTokens(colorSchemes: any, colorMode: 'light' | 'dark') {
return tokens;
}

function TemplatesDialog({ children, data }: { children: React.ReactElement; data: any }) {
function TemplatesDialog({ children, data }: { children: React.ReactElement<any>; data: any }) {
const [open, setOpen] = React.useState(false);
const { map: templateMap } = sourceJoyTemplates();
const renderItem = (name: string, item: TemplateData) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/JoyUsageDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ interface JoyUsageDemoProps<ComponentProps> {
* A function to override the code block result.
*/
getCodeBlock?: (code: string, props: ComponentProps) => string;
renderDemo: (props: ComponentProps) => React.ReactElement;
renderDemo: (props: ComponentProps) => React.ReactElement<any>;
}

export default function JoyUsageDemo<T extends { [k: string]: any } = {}>({
Expand Down
4 changes: 2 additions & 2 deletions docs/src/modules/components/JoyVariablesDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function formatSx(sx: { [k: string]: string | number }) {
interface SlotVariablesProps {
slot: string;
data: Array<DataItem>;
renderField: (item: DataItem) => React.ReactElement;
renderField: (item: DataItem) => React.ReactElement<any>;
defaultOpen?: boolean;
}

Expand Down Expand Up @@ -88,7 +88,7 @@ export default function JoyVariablesDemo(props: {
componentName: string;
childrenAccepted?: boolean;
data: Array<DataItem | [string, Array<DataItem>, { defaultOpen?: boolean } | undefined]>;
renderDemo: (sx: { [k: string]: string | number }) => React.ReactElement;
renderDemo: (sx: { [k: string]: string | number }) => React.ReactElement<any>;
renderCode?: (formattedSx: string) => string;
}) {
const { componentName, data = [], childrenAccepted = false, renderCode } = props;
Expand Down
2 changes: 1 addition & 1 deletion docs/types/docs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>;
}

declare module 'react-imask';
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface ClickAwayListenerProps {
/**
* The wrapped element.
*/
children: React.ReactElement;
children: React.ReactElement<any>;
/**
* If `true`, the React tree is ignored and only the DOM tree is considered.
* This prop changes how portaled elements are handled.
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/FocusTrap/FocusTrap.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface FocusTrapProps {
/**
* A single child content element.
*/
children: React.ReactElement;
children: React.ReactElement<any>;
/**
* 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.
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-base/src/Modal/Modal.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ModalOwnProps {
/**
* A single child content element.
*/
children: React.ReactElement;
children: React.ReactElement<any>;
/**
* When set to true the Modal waits until a nested Transition is completed before closing.
* @default false
Expand Down
Loading

0 comments on commit 30af6f2

Please sign in to comment.