Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update react monorepo to v19 (major) #3982

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/components-props-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
"@swc/core": "1.9.3",
"@types/fs-extra": "11.0.4",
"@types/node": "22.10.1",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"@typescript/twoslash": "3.2.8",
"@typescript/vfs": "1.6.0",
"cross-fetch": "4.0.0",
"fs-extra": "11.2.0",
"nodemon": "3.1.7",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"rimraf": "6.0.1",
"ts-node": "10.9.2",
"tslib": "2.8.1",
Expand Down
24 changes: 12 additions & 12 deletions packages/mantine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
"monaco-editor": "0.52.0"
},
"devDependencies": {
"@mantine/carousel": "7.14.3",
"@mantine/code-highlight": "7.14.3",
"@mantine/core": "7.14.3",
"@mantine/dates": "7.14.3",
"@mantine/form": "7.14.3",
"@mantine/hooks": "7.14.3",
"@mantine/modals": "7.14.3",
"@mantine/notifications": "7.14.3",
"@mantine/carousel": "7.15.1",
"@mantine/code-highlight": "7.15.1",
"@mantine/core": "7.15.1",
"@mantine/dates": "7.15.1",
"@mantine/form": "7.15.1",
"@mantine/hooks": "7.15.1",
"@mantine/modals": "7.15.1",
"@mantine/notifications": "7.15.1",
"@swc/cli": "0.5.2",
"@swc/core": "1.9.3",
"@testing-library/dom": "10.4.0",
Expand All @@ -71,17 +71,17 @@
"@testing-library/user-event": "14.5.2",
"@types/lodash.debounce": "4.0.9",
"@types/lodash.defaultsdeep": "4.6.9",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"embla-carousel-react": "7.1.0",
"identity-obj-proxy": "3.0.0",
"jsdom": "25.0.1",
"postcss": "8.4.49",
"postcss-preset-mantine": "^1.11.0",
"postcss-simple-vars": "^7.0.1",
"publint": "0.2.12",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"rimraf": "6.0.1",
"sass": "1.81.1",
"tslib": "2.8.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/__tests__/Utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {FunctionComponent, PropsWithChildren, ReactElement} from 'react';

import {Plasmantine} from '../theme';

const customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'queries'>): RenderResult => {
const customRender = (ui: ReactElement<any>, options?: Omit<RenderOptions, 'queries'>): RenderResult => {
const TestWrapper: FunctionComponent<PropsWithChildren> = ({children}) => (
<Plasmantine withCssVariables={false}>{children}</Plasmantine>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Box, Tooltip, TooltipProps} from '@mantine/core';
import {ReactNode, forwardRef} from 'react';
import {FunctionComponent, ReactNode} from 'react';

import {createPolymorphicComponent} from '../../utils';

Expand All @@ -23,18 +23,23 @@ export interface ButtonWithDisabledTooltipProps {
fullWidth?: boolean;
}

const _ButtonWithDisabledTooltip = forwardRef<HTMLDivElement, ButtonWithDisabledTooltipProps>(
({disabledTooltip, disabled, children, disabledTooltipProps, fullWidth, ...others}, ref) =>
disabledTooltip ? (
<Tooltip label={disabledTooltip} disabled={!disabled} {...disabledTooltipProps}>
<Box ref={ref} style={{'&:hover': {cursor: 'not-allowed'}, width: fullWidth && '100%'}} {...others}>
{children}
</Box>
</Tooltip>
) : (
<>{children}</>
),
);
const _ButtonWithDisabledTooltip: FunctionComponent<ButtonWithDisabledTooltipProps> = ({
disabledTooltip,
disabled,
children,
disabledTooltipProps,
fullWidth,
...others
}) =>
disabledTooltip ? (
<Tooltip label={disabledTooltip} disabled={!disabled} {...disabledTooltipProps}>
<Box style={{'&:hover': {cursor: 'not-allowed'}, width: fullWidth && '100%'}} {...others}>
{children}
</Box>
</Tooltip>
) : (
<>{children}</>
);

export const ButtonWithDisabledTooltip = createPolymorphicComponent<'div', ButtonWithDisabledTooltipProps>(
_ButtonWithDisabledTooltip,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const EllipsisText = polymorphicFactory<EllipsisTextFactory>((props, ref)
});

const [showTooltip, setShowTooltip] = useState(false);
const textRef = useRef<HTMLDivElement>();
const textRef = useRef<HTMLDivElement>(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EllipsisText is broken
image


const {className: rootClass, ...rootStyles} = getStyles('root');
const {className: textClass, ...textStyles} = getStyles('text');
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const Header = factory<HeaderFactory>((_props, ref) => {
});
const stylesApiProps = {classNames, styles};

const convertedChildren = Children.toArray(children) as ReactElement[];
const convertedChildren = Children.toArray(children) as Array<ReactElement<any>>;
const breadcrumbs = convertedChildren.find((child) => child.type === HeaderBreadcrumbs);
const actions = convertedChildren.find((child) => child.type === HeaderActions);
const docAnchor = convertedChildren.find((child) => child.type === HeaderDocAnchor);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const InlineConfirm = ((_props) => {
const {children} = useProps('InlineConfirm', defaultProps, _props);
const [confirmingId, setConfirmingId] = useState<string | null>(null);

const convertedChildren = Children.toArray(children) as ReactElement[];
const convertedChildren = Children.toArray(children) as Array<ReactElement<any>>;
const prompt = convertedChildren.find(
(child) => child.type !== InlineConfirmTarget && child.props?.inlineConfirmId === confirmingId,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ interface InlineConfirmPromptProps extends Omit<GroupProps, 'children'>, InlineC
*
* @default <Button color="red">Delete</Button>
*/
confirm?: ReactElement;
confirm?: ReactElement<{onClick?: () => void}>;
/**
* Cancel button element
*
* @default <Button variant="outline">Cancel</Button>
*/
cancel?: ReactElement;
cancel?: ReactElement<{onClick?: () => void}>;
/**
* Function called when the confirm button is clicked
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/components/prompt/Prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const Prompt = factory<PromptFactory>((_props, ref) => {
});
const stylesApiProps = {classNames, styles};

const convertedChildren = Children.toArray(children) as ReactElement[];
const convertedChildren = Children.toArray(children) as Array<ReactElement<any>>;

const otherChildren = convertedChildren.filter((child) => child.type !== PromptFooter);
const footer = convertedChildren.find((child) => child.type === PromptFooter);
Expand Down
4 changes: 2 additions & 2 deletions packages/mantine/src/components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const Table = <T,>(props: TableProps<T> & {ref?: ForwardedRef<HTMLDivElem
unstyled,
});

const convertedChildren = Children.toArray(children) as ReactElement[];
const convertedChildren = Children.toArray(children) as Array<ReactElement<any>>;
const header = convertedChildren.find((child) => child.type === TableHeader);
const footer = convertedChildren.find((child) => child.type === TableFooter);
const lastUpdated = convertedChildren.find((child) => child.type === TableLastUpdated);
Expand Down Expand Up @@ -213,7 +213,7 @@ export const Table = <T,>(props: TableProps<T> & {ref?: ForwardedRef<HTMLDivElem
}
}, [data]);

const containerRef = useRef<HTMLDivElement>();
const containerRef = useRef<HTMLDivElement>(null);
useClickOutside(
() => {
if (!store.multiRowSelectionEnabled && store.getSelectedRows().length > 0) {
Expand Down
6 changes: 3 additions & 3 deletions packages/mantine/src/components/table/Table.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type TableLayoutProps<TData = unknown> = Pick<
TableProps<TData>['layoutProps'];

export interface TableLayout {
(props: {children: ReactNode}): ReactElement;
(props: {children: ReactNode}): ReactElement<any>;
/**
* Name of the layout.
* Will be displayed in the layout control
Expand All @@ -28,12 +28,12 @@ export interface TableLayout {
* Header portion of the table.
* In the standard row layout that is where column headers would be displayed.
*/
Header: <TData>(props: TableLayoutProps<TData>) => ReactElement;
Header: <TData>(props: TableLayoutProps<TData>) => ReactElement<any>;
/**
* Body portion of the table.
* In the standard row layout that is where the rows would be displayed.
*/
Body: <TData>(props: TableLayoutProps<TData>) => ReactElement;
Body: <TData>(props: TableLayoutProps<TData>) => ReactElement<any>;
}

export interface TableProps<TData> extends BoxProps, StylesApiProps<PlasmaTableFactory> {
Expand Down
4 changes: 2 additions & 2 deletions packages/mantine/src/components/table/TableContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createSafeContext, GetStylesApi} from '@mantine/core';
import {Table} from '@tanstack/table-core';
import {MutableRefObject, ReactElement} from 'react';
import {MutableRefObject, ReactElement, type JSX} from 'react';
import {type PlasmaTableFactory} from './Table';
import {TableAction, TableLayout} from './Table.types';
import {TableStore} from './use-table';
Expand All @@ -21,4 +21,4 @@ export interface TableProviderProps<T> {

export const [TableProvider, useTableContext] = createSafeContext<TableContextValue>(
'Table component was not found in the tree',
) as [<TData>(props: TableProviderProps<TData>) => ReactElement, <TData>() => TableContextValue<TData>];
) as [<TData>(props: TableProviderProps<TData>) => ReactElement<any>, <TData>() => TableContextValue<TData>];
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type TableHeaderActionsFactory = Factory<{
const defaultProps: Partial<TableHeaderActionsProps> = {};

export const TableHeaderActions = factory<TableHeaderActionsFactory>(
(props: TableHeaderActionsProps, ref): ReactElement => {
(props: TableHeaderActionsProps, ref): ReactElement<any> => {
const {store, getStyles, getRowActions} = useTableContext();
const {style, className, classNames, styles, ...others} = useProps(
'PlasmaTableHeaderActions',
Expand Down
2 changes: 1 addition & 1 deletion packages/mantine/src/hooks/useParentHeight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getElementInnerHeight = (el: HTMLElement): number => {
*/
export const useParentHeight = (): [number, MutableRefObject<HTMLDivElement>] => {
const [height, setHeight] = useState(-1);
const ref = useRef<HTMLDivElement>();
const ref = useRef<HTMLDivElement>(null);

useEffect(() => {
if (ref.current) {
Expand Down
8 changes: 4 additions & 4 deletions packages/react-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
"@svgr/plugin-jsx": "8.1.0",
"@swc/cli": "0.5.2",
"@swc/core": "1.9.3",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"fs-extra": "11.2.0",
"glob": "11.0.0",
"lodash.groupby": "4.6.0",
"lodash.upperfirst": "4.3.1",
"publint": "0.2.12",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"rimraf": "6.0.1",
"tslib": "2.8.1",
"typescript": "5.7.2"
Expand Down
22 changes: 11 additions & 11 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"@coveord/plasma-react-icons": "workspace:*",
"@coveord/plasma-tokens": "workspace:*",
"@faker-js/faker": "9.3.0",
"@mantine/code-highlight": "7.14.3",
"@mantine/core": "7.14.3",
"@mantine/dates": "7.14.3",
"@mantine/form": "7.14.3",
"@mantine/hooks": "7.14.3",
"@mantine/modals": "7.14.3",
"@mantine/notifications": "7.14.3",
"@mantine/code-highlight": "7.15.1",
"@mantine/core": "7.15.1",
"@mantine/dates": "7.15.1",
"@mantine/form": "7.15.1",
"@mantine/hooks": "7.15.1",
"@mantine/modals": "7.15.1",
"@mantine/notifications": "7.15.1",
"@mantinex/dev-icons": "1.0.2",
"@stencil/core": "4.22.3",
"@swc/helpers": "0.5.15",
Expand All @@ -38,8 +38,8 @@
"encoding": "0.1.13",
"lodash.kebabcase": "4.1.1",
"pino-pretty": "13.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-hook-form": "7.53.2",
"react-imask": "7.6.1",
"react-markdown": "9.0.1",
Expand All @@ -52,8 +52,8 @@
"@types/klaw-sync": "6.0.5",
"@types/lodash.kebabcase": "4.1.9",
"@types/node": "22.10.1",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"@vitejs/plugin-react-swc": "3.7.2",
"autoprefixer": "10.4.20",
"fs-extra": "11.2.0",
Expand Down
Loading
Loading