Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Aug 22, 2024
1 parent 6bb06b9 commit f766a4c
Show file tree
Hide file tree
Showing 44 changed files with 79 additions and 69 deletions.
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<any>;
children?: React.ReactElement<unknown>;
}

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<any>;
children?: React.ReactElement<unknown>;
}

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<any>;
children?: React.ReactElement<unknown>;
}

function HideOnScroll(props: Props) {
Expand Down
12 changes: 8 additions & 4 deletions docs/data/material/components/autocomplete/Virtualize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ const ListboxComponent = React.forwardRef<
React.HTMLAttributes<HTMLElement>
>(function ListboxComponent(props, ref) {
const { children, ...other } = props;
const itemData: React.ReactElement<any>[] = [];
(children as React.ReactElement<any>[]).forEach(
(item: React.ReactElement<any> & { children?: React.ReactElement<any>[] }) => {
const itemData: React.ReactElement<unknown>[] = [];
(children as React.ReactElement<unknown>[]).forEach(
(
item: React.ReactElement<unknown> & {
children?: React.ReactElement<unknown>[];
},
) => {
itemData.push(item);
itemData.push(...(item.children || []));
},
Expand All @@ -73,7 +77,7 @@ const ListboxComponent = React.forwardRef<
const itemCount = itemData.length;
const itemSize = smUp ? 36 : 48;

const getChildSize = (child: React.ReactElement<any>) => {
const getChildSize = (child: React.ReactElement<unknown>) => {
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<any>;
children: React.ReactElement<unknown>;
},
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<any>) {
function generate(element: React.ReactElement<unknown>) {
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<any>;
children: React.ReactElement<unknown>;
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<any>;
children?: React.ReactElement<unknown>;
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<any>;
icon: React.ReactElement<unknown>;
label: string;
};
} = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const ColorlibStepIconRoot = styled('div')<{
function ColorlibStepIcon(props: StepIconProps) {
const { active, completed, className } = props;

const icons: { [index: string]: React.ReactElement<any> } = {
const icons: { [index: string]: React.ReactElement<unknown> } = {
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 @@ -27,7 +27,7 @@ function Router(props: { children?: React.ReactNode }) {
}

interface ListItemLinkProps {
icon?: React.ReactElement<any>;
icon?: React.ReactElement<unknown>;
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<any>;
icon: React.ReactElement<unknown>;
}) {
return (
<Paper
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<any>;
icon: React.ReactElement<unknown>;
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<any>;
children: React.ReactElement<unknown>;
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<any>;
company?: React.ReactElement<unknown>;
};
}) {
return (
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/pricing/PricingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ function RowHead({
children,
startIcon,
...props
}: BoxProps & { startIcon?: React.ReactElement<any> }) {
}: BoxProps & { startIcon?: React.ReactElement<unknown> }) {
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<any>, nested?: boolean) {
function renderList(content: React.ReactElement<unknown>, 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<any>> = {
const viewIcons: Record<View, React.ReactElement<unknown>> = {
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<any>;
title: string | React.ReactElement<unknown>;
}

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<any>;
left: React.ReactElement<unknown>;
linearGradient?: boolean;
right: React.ReactElement<any>;
right: React.ReactElement<unknown>;
rightSx?: BoxProps['sx'];
}

Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/JoyThemeBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ function getAvailableTokens(colorSchemes: any, colorMode: 'light' | 'dark') {
return tokens;
}

function TemplatesDialog({ children, data }: { children: React.ReactElement<any>; data: any }) {
function TemplatesDialog({ children, data }: { children: React.ReactElement<unknown>; 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<any>;
renderDemo: (props: ComponentProps) => React.ReactElement<unknown>;
}

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<any>;
renderField: (item: DataItem) => React.ReactElement<unknown>;
defaultOpen?: boolean;
}

Expand Down Expand Up @@ -83,7 +83,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<any>;
renderDemo: (sx: { [k: string]: string | number }) => React.ReactElement<unknown>;
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<any>;
export default function HighlightedCode(props: Props): React.ReactElement<unknown>;
}

declare module 'react-imask';
12 changes: 6 additions & 6 deletions packages-internal/test-utils/src/createRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export interface MuiRenderToStringResult {
}

function render(
element: React.ReactElement<any>,
element: React.ReactElement<unknown>,
configuration: ClientRenderConfiguration,
): MuiRenderResult {
const { container, hydrate, wrapper } = configuration;
Expand Down Expand Up @@ -322,7 +322,7 @@ function render(
}

function renderToString(
element: React.ReactElement<any>,
element: React.ReactElement<unknown>,
configuration: ServerRenderConfiguration,
): { container: HTMLElement; hydrate(): MuiRenderResult } {
const { container, wrapper: Wrapper } = configuration;
Expand Down Expand Up @@ -444,9 +444,9 @@ function createClock(defaultMode: 'fake' | 'real', config: ClockConfig): Clock {

export interface Renderer {
clock: Clock;
render(element: React.ReactElement<any>, options?: RenderOptions): MuiRenderResult;
render(element: React.ReactElement<unknown>, options?: RenderOptions): MuiRenderResult;
renderToString(
element: React.ReactElement<any>,
element: React.ReactElement<unknown>,
options?: RenderOptions,
): MuiRenderToStringResult;
}
Expand Down Expand Up @@ -586,7 +586,7 @@ export function createRenderer(globalOptions: CreateRendererOptions = {}): Rende

return {
clock,
render(element: React.ReactElement<any>, options: RenderOptions = {}) {
render(element: React.ReactElement<unknown>, options: RenderOptions = {}) {
if (!prepared) {
throw new Error(
'Unable to finish setup before `render()` was called. ' +
Expand All @@ -601,7 +601,7 @@ export function createRenderer(globalOptions: CreateRendererOptions = {}): Rende
wrapper: createWrapper(options),
});
},
renderToString(element: React.ReactElement<any>, options: RenderOptions = {}) {
renderToString(element: React.ReactElement<unknown>, options: RenderOptions = {}) {
if (!prepared) {
throw new Error(
'Unable to finish setup before `render()` was called. ' +
Expand Down
Loading

0 comments on commit f766a4c

Please sign in to comment.