From e61b09f29ab2cad28fd1fcb2477c98cf021cfab0 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Wed, 8 Jan 2025 17:55:14 +0100 Subject: [PATCH 01/13] Add support for MUI v6 --- examples/crm/package.json | 4 +- .../activity/ActivityLogDealNoteCreated.tsx | 2 +- examples/crm/src/companies/CompanyShow.tsx | 78 ++--- .../crm/src/contacts/ContactListContent.tsx | 140 ++++---- .../src/dashboard/DashboardActivityLog.tsx | 9 +- examples/crm/src/deals/DealEdit.tsx | 12 +- examples/crm/src/login/LoginForm.tsx | 2 +- examples/crm/src/notes/Note.tsx | 5 +- examples/demo/package.json | 4 +- examples/demo/src/dashboard/CardWithIcon.tsx | 6 +- examples/demo/src/dashboard/PendingOrder.tsx | 69 ++-- .../demo/src/dashboard/PendingReviews.tsx | 89 +++--- examples/demo/src/reviews/ReviewItem.tsx | 30 +- examples/no-code/package.json | 2 +- examples/simple/src/tags/TagList.tsx | 22 +- packages/ra-input-rich-text/package.json | 8 +- .../src/buttons/LevelSelect.tsx | 37 ++- packages/ra-no-code/package.json | 4 +- .../ApplicationsDashboard.tsx | 37 +-- packages/ra-ui-materialui/package.json | 12 +- packages/ra-ui-materialui/src/Labeled.tsx | 9 +- .../src/button/LocalesMenuButton.tsx | 4 +- .../src/input/CheckboxGroupInput.stories.tsx | 9 +- .../src/list/BulkActionsToolbar.tsx | 7 +- .../src/list/SimpleList/SimpleListItem.tsx | 1 - .../src/list/filter/FilterListItem.tsx | 9 +- .../list/filter/SavedQueryFilterListItem.tsx | 11 +- packages/react-admin/package.json | 4 +- yarn.lock | 298 +++++++++++++++--- 29 files changed, 589 insertions(+), 335 deletions(-) diff --git a/examples/crm/package.json b/examples/crm/package.json index 33a01cec4d8..54eb93f3d0a 100644 --- a/examples/crm/package.json +++ b/examples/crm/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "@hello-pangea/dnd": "^16.3.0", - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", "@nivo/bar": "^0.80.0", "@nivo/core": "^0.80.0", "clsx": "^2.1.1", diff --git a/examples/crm/src/activity/ActivityLogDealNoteCreated.tsx b/examples/crm/src/activity/ActivityLogDealNoteCreated.tsx index 3c5673793b3..c63b4d049e6 100644 --- a/examples/crm/src/activity/ActivityLogDealNoteCreated.tsx +++ b/examples/crm/src/activity/ActivityLogDealNoteCreated.tsx @@ -1,4 +1,4 @@ -import Typography from '@mui/material/Typography'; +import { Typography } from '@mui/material'; import { ReferenceField } from 'react-admin'; import { CompanyAvatar } from '../companies/CompanyAvatar'; diff --git a/examples/crm/src/companies/CompanyShow.tsx b/examples/crm/src/companies/CompanyShow.tsx index e09c00be0cb..9c7ce79a487 100644 --- a/examples/crm/src/companies/CompanyShow.tsx +++ b/examples/crm/src/companies/CompanyShow.tsx @@ -7,6 +7,7 @@ import { List, ListItem, ListItemAvatar, + ListItemButton, ListItemSecondaryAction, ListItemText, Stack, @@ -142,43 +143,46 @@ const ContactsIterator = () => { {contacts.map(contact => ( - - - - - - {contact.title} - {contact.nb_tasks - ? ` - ${contact.nb_tasks} task${ - contact.nb_tasks > 1 ? 's' : '' - }` - : ''} -     - - - } - /> - {contact.last_seen && ( - - - last activity{' '} - {formatDistance(contact.last_seen, now)} ago{' '} - - - - )} + + + + + + + {contact.title} + {contact.nb_tasks + ? ` - ${contact.nb_tasks} task${ + contact.nb_tasks > 1 + ? 's' + : '' + }` + : ''} +     + + + } + /> + {contact.last_seen && ( + + + last activity{' '} + {formatDistance(contact.last_seen, now)}{' '} + ago + + + )} + ))} diff --git a/examples/crm/src/contacts/ContactListContent.tsx b/examples/crm/src/contacts/ContactListContent.tsx index 33cc780c3df..922db6ae305 100644 --- a/examples/crm/src/contacts/ContactListContent.tsx +++ b/examples/crm/src/contacts/ContactListContent.tsx @@ -4,6 +4,7 @@ import { Checkbox, List, ListItem, + ListItemButton, ListItemAvatar, ListItemIcon, ListItemSecondaryAction, @@ -50,76 +51,79 @@ export const ContactListContent = () => { {contacts.map(contact => ( - - - { - e.stopPropagation(); - onToggleItem(contact.id); - }} - /> - - - - - - {contact.title} - {contact.title && - contact.company_id != null && - ' at '} - {contact.company_id != null && ( - - - + + + + 1 - ? 's' - : '' - }` - : ''} -    - - - } - /> - {contact.last_seen && ( - - { + e.stopPropagation(); + onToggleItem(contact.id); + }} + /> + + + + + + {contact.title} + {contact.title && + contact.company_id != null && + ' at '} + {contact.company_id != null && ( + + + + )} + {contact.nb_tasks + ? ` - ${contact.nb_tasks} task${ + contact.nb_tasks > 1 + ? 's' + : '' + }` + : ''} +    + + + } + /> + {contact.last_seen && ( + - {!isSmall && 'last activity '} - {formatRelative( - contact.last_seen, - now - )}{' '} - - - - )} + + {!isSmall && 'last activity '} + {formatRelative( + contact.last_seen, + now + )}{' '} + + + + )} + ))} diff --git a/examples/crm/src/dashboard/DashboardActivityLog.tsx b/examples/crm/src/dashboard/DashboardActivityLog.tsx index 057820c341a..0ef247471c1 100644 --- a/examples/crm/src/dashboard/DashboardActivityLog.tsx +++ b/examples/crm/src/dashboard/DashboardActivityLog.tsx @@ -1,7 +1,5 @@ import AccessTimeIcon from '@mui/icons-material/AccessTime'; -import Box from '@mui/material/Box'; -import Card from '@mui/material/Card'; -import Typography from '@mui/material/Typography'; +import { Box, Card, Typography } from '@mui/material'; import { ActivityLog } from '../activity/ActivityLog'; import { Stack } from '@mui/material'; @@ -12,7 +10,10 @@ export function DashboardActivityLog() { - + theme.palette.text.secondary }} + > Latest Activity diff --git a/examples/crm/src/deals/DealEdit.tsx b/examples/crm/src/deals/DealEdit.tsx index 79b2f9bdd93..ad62c2c775d 100644 --- a/examples/crm/src/deals/DealEdit.tsx +++ b/examples/crm/src/deals/DealEdit.tsx @@ -1,7 +1,11 @@ -import { Button, DialogContent, Stack } from '@mui/material'; -import Dialog from '@mui/material/Dialog'; -import DialogTitle from '@mui/material/DialogTitle'; -import Typography from '@mui/material/Typography'; +import { + Button, + Dialog, + DialogContent, + DialogTitle, + Stack, + Typography, +} from '@mui/material'; import { DeleteButton, EditBase, diff --git a/examples/crm/src/login/LoginForm.tsx b/examples/crm/src/login/LoginForm.tsx index a2fa57b5a02..59c158ebbb5 100644 --- a/examples/crm/src/login/LoginForm.tsx +++ b/examples/crm/src/login/LoginForm.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useState } from 'react'; -import { styled } from '@mui/material/styles'; +import { styled } from '@mui/material'; import { Button, CardActions, diff --git a/examples/crm/src/notes/Note.tsx b/examples/crm/src/notes/Note.tsx index 7eea05511ed..d381a4f3f66 100644 --- a/examples/crm/src/notes/Note.tsx +++ b/examples/crm/src/notes/Note.tsx @@ -100,7 +100,10 @@ export const Note = ({ )} - + theme.palette.text.secondary }} + variant="body2" + > ( {createElement(icon, { fontSize: 'large' })} - {title} + theme.palette.text.secondary }} + > + {title} + {subtitle || ' '} diff --git a/examples/demo/src/dashboard/PendingOrder.tsx b/examples/demo/src/dashboard/PendingOrder.tsx index e616ca6c2e8..49a7ced13c6 100644 --- a/examples/demo/src/dashboard/PendingOrder.tsx +++ b/examples/demo/src/dashboard/PendingOrder.tsx @@ -6,6 +6,7 @@ import { ListItemText, Avatar, Box, + ListItemButton, } from '@mui/material'; import { Link } from 'react-router-dom'; import { useTranslate, useReference } from 'react-admin'; @@ -25,39 +26,41 @@ export const PendingOrder = (props: Props) => { }); return ( - - - {isPending ? ( - - ) : ( - - )} - - - - - {order.total}$ - - + + + + {isPending ? ( + + ) : ( + + )} + + + + + {order.total}$ + + + ); }; diff --git a/examples/demo/src/dashboard/PendingReviews.tsx b/examples/demo/src/dashboard/PendingReviews.tsx index f759f9a4bd7..2a717fd80f8 100644 --- a/examples/demo/src/dashboard/PendingReviews.tsx +++ b/examples/demo/src/dashboard/PendingReviews.tsx @@ -6,6 +6,7 @@ import { List, ListItem, ListItemAvatar, + ListItemButton, ListItemText, } from '@mui/material'; import CommentIcon from '@mui/icons-material/Comment'; @@ -61,51 +62,51 @@ const PendingReviews = () => { > {reviews?.map((record: Review) => ( - - - - - render={customer => ( - - )} - /> - - - - + + + - } - secondary={record.comment} - sx={{ - overflowY: 'hidden', - height: '4em', - display: '-webkit-box', - WebkitLineClamp: 2, - WebkitBoxOrient: 'vertical', - paddingRight: 0, - }} - /> + source="customer_id" + reference="customers" + link={false} + > + + render={customer => ( + + )} + /> + + + + + } + secondary={record.comment} + sx={{ + overflowY: 'hidden', + height: '4em', + display: '-webkit-box', + WebkitLineClamp: 2, + WebkitBoxOrient: 'vertical', + paddingRight: 0, + }} + /> + ))} diff --git a/examples/demo/src/reviews/ReviewItem.tsx b/examples/demo/src/reviews/ReviewItem.tsx index 85888e94eba..0447fce935f 100644 --- a/examples/demo/src/reviews/ReviewItem.tsx +++ b/examples/demo/src/reviews/ReviewItem.tsx @@ -1,6 +1,11 @@ import * as React from 'react'; import { Fragment } from 'react'; -import { ListItem, ListItemAvatar, ListItemText } from '@mui/material'; +import { + ListItem, + ListItemAvatar, + ListItemButton, + ListItemText, +} from '@mui/material'; import { useCreatePath, ReferenceField, @@ -20,16 +25,15 @@ export const ReviewItem = () => { return null; } return ( - - + + { secondary={record.comment} secondaryTypographyProps={{ noWrap: true }} /> - - + + ); }; diff --git a/examples/no-code/package.json b/examples/no-code/package.json index 5e70f237a9d..12b23c0b821 100644 --- a/examples/no-code/package.json +++ b/examples/no-code/package.json @@ -8,7 +8,7 @@ "serve": "vite preview" }, "dependencies": { - "@mui/material": "^5.16.12", + "@mui/material": "^6.0.0", "ra-data-local-storage": "^5.0.0", "ra-no-code": "^5.0.0", "react": "^18.3.1", diff --git a/examples/simple/src/tags/TagList.tsx b/examples/simple/src/tags/TagList.tsx index ba8601eac2f..cbfe7cfe257 100644 --- a/examples/simple/src/tags/TagList.tsx +++ b/examples/simple/src/tags/TagList.tsx @@ -16,6 +16,7 @@ import { Collapse, Card, Stack, + ListItemButton, } from '@mui/material'; import ExpandLess from '@mui/icons-material/ExpandLess'; import ExpandMore from '@mui/icons-material/ExpandMore'; @@ -75,18 +76,17 @@ const SubTree = ({ level, root, getChildNodes, openChildren, toggleNode }) => { const open = openChildren.includes(root.id); return ( - hasChildren && toggleNode(root)} - style={{ paddingLeft: level * 16 }} - > - {hasChildren && open && } - {hasChildren && !open && } - {!hasChildren &&
 
} - + + hasChildren && toggleNode(root)}> + {hasChildren && open && } + {hasChildren && !open && } + {!hasChildren &&
 
} + - - - + + + +
diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json index 35514ffce1f..e67d8cd1ff2 100644 --- a/packages/ra-input-rich-text/package.json +++ b/packages/ra-input-rich-text/package.json @@ -38,16 +38,16 @@ "clsx": "^2.1.1" }, "peerDependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^5.16.12 || ^6.0.0", + "@mui/material": "^5.16.12 || ^6.0.0", "ra-core": "^5.0.0", "ra-ui-materialui": "^5.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "devDependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", "@testing-library/react": "^15.0.7", "@tiptap/extension-mention": "^2.0.3", "@tiptap/suggestion": "^2.0.3", diff --git a/packages/ra-input-rich-text/src/buttons/LevelSelect.tsx b/packages/ra-input-rich-text/src/buttons/LevelSelect.tsx index 97cc0a70d15..93e411a3a45 100644 --- a/packages/ra-input-rich-text/src/buttons/LevelSelect.tsx +++ b/packages/ra-input-rich-text/src/buttons/LevelSelect.tsx @@ -1,6 +1,13 @@ import * as React from 'react'; import { useEffect, useState } from 'react'; -import { List, ListItem, ListItemText, Menu, MenuItem } from '@mui/material'; +import { + List, + ListItem, + ListItemButton, + ListItemText, + Menu, + MenuItem, +} from '@mui/material'; import { styled, alpha } from '@mui/material/styles'; import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; import { useTranslate } from 'ra-core'; @@ -93,25 +100,27 @@ export const LevelSelect = (props: LevelSelectProps) => { className={classes.list} > - - + disabled={!editor?.isEditable} + onClick={handleClickListItem} + > + + + { {applications.map(application => ( - - onApplicationSelected(application) - } - > - - - - - - + + + onApplicationSelected(application) + } + > + + + + + + + ))} diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index 69939a354d6..e86b384f1ab 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -26,9 +26,9 @@ "watch": "tsc --outDir dist/esm --module es2015 --watch" }, "devDependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", - "@mui/utils": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", + "@mui/utils": "^6.0.0", "@testing-library/react": "^15.0.7", "@types/dompurify": "^3.0.2", "@types/react": "^18.3.3", @@ -52,9 +52,9 @@ "typescript": "^5.1.3" }, "peerDependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", - "@mui/utils": "^5.16.12", + "@mui/icons-material": "^5.16.12 || ^6.0.0", + "@mui/material": "^5.16.12 || ^6.0.0", + "@mui/utils": "^5.15.20 || ^6.0.0", "ra-core": "^5.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", diff --git a/packages/ra-ui-materialui/src/Labeled.tsx b/packages/ra-ui-materialui/src/Labeled.tsx index 0c720c096b3..39fbb3a2928 100644 --- a/packages/ra-ui-materialui/src/Labeled.tsx +++ b/packages/ra-ui-materialui/src/Labeled.tsx @@ -4,6 +4,7 @@ import { Stack, StackProps, Theme, Typography } from '@mui/material'; import { styled } from '@mui/material/styles'; import { Property } from 'csstype'; import clsx from 'clsx'; +import get from 'lodash/get'; import { FieldTitle } from 'ra-core'; import { ResponsiveStyleValue } from '@mui/system'; @@ -47,7 +48,13 @@ export const Labeled = ({ children.type?.displayName !== 'Labeled' && // @ts-ignore children.type?.displayName !== 'Labeled' ? ( - + + get(theme.palette, color.toString(), color).toString(), + }} + className={LabeledClasses.label} + > styles.root, -})({}); +})({}) as typeof Box; export interface LocalesMenuButtonProps { icon?: ReactNode; diff --git a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.stories.tsx b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.stories.tsx index 85535e64582..166ce64ea55 100644 --- a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.stories.tsx +++ b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.stories.tsx @@ -71,8 +71,8 @@ export const StringChoices = () => ( const dataProvider = testDataProvider({ // @ts-ignore getList: () => Promise.resolve({ data: choices, total: choices.length }), - // @ts-ignore getMany: (resource, params) => + // @ts-ignore Promise.resolve({ data: choices.filter(choice => params.ids.includes(choice.id)), total: choices.length, @@ -197,7 +197,12 @@ const OptionTextComponent = () => { return ( <> {record?.name} - + theme.palette.text.secondary, + marginBottom: 2, + }} + > {record?.details} diff --git a/packages/ra-ui-materialui/src/list/BulkActionsToolbar.tsx b/packages/ra-ui-materialui/src/list/BulkActionsToolbar.tsx index 26e39f01da1..b824575feda 100644 --- a/packages/ra-ui-materialui/src/list/BulkActionsToolbar.tsx +++ b/packages/ra-ui-materialui/src/list/BulkActionsToolbar.tsx @@ -51,7 +51,12 @@ export const BulkActionsToolbar = (props: BulkActionsToolbarProps) => { > - + theme.palette.text.primary, + }} + variant="subtitle1" + > {translate(label, { _: label, smart_count: selectedIds.length, diff --git a/packages/ra-ui-materialui/src/list/SimpleList/SimpleListItem.tsx b/packages/ra-ui-materialui/src/list/SimpleList/SimpleListItem.tsx index ef23ad03699..8f0c694c44c 100644 --- a/packages/ra-ui-materialui/src/list/SimpleList/SimpleListItem.tsx +++ b/packages/ra-ui-materialui/src/list/SimpleList/SimpleListItem.tsx @@ -66,7 +66,6 @@ export const SimpleListItem = ( }, }} > - {/* @ts-ignore */} { const handleClick = () => setFilters(toggleFilter(value, filterValues)); return ( - + {icon && ( diff --git a/packages/ra-ui-materialui/src/list/filter/SavedQueryFilterListItem.tsx b/packages/ra-ui-materialui/src/list/filter/SavedQueryFilterListItem.tsx index e1630f7d693..06441bc6772 100644 --- a/packages/ra-ui-materialui/src/list/filter/SavedQueryFilterListItem.tsx +++ b/packages/ra-ui-materialui/src/list/filter/SavedQueryFilterListItem.tsx @@ -63,15 +63,10 @@ export const SavedQueryFilterListItem = memo( isSelected ? removeFilter() : addFilter(); return ( - // @ts-ignore - + diff --git a/packages/react-admin/package.json b/packages/react-admin/package.json index 6609bd7be33..a34200bfff5 100644 --- a/packages/react-admin/package.json +++ b/packages/react-admin/package.json @@ -36,8 +36,8 @@ "react-dom": "^18.0.0 || ^19.0.0" }, "dependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^5.16.12 || ^6.0.0", + "@mui/material": "^5.16.12 || ^6.0.0", "ra-core": "^5.4.3", "ra-i18n-polyglot": "^5.4.3", "ra-language-english": "^5.4.3", diff --git a/yarn.lock b/yarn.lock index 58cd96eb3bf..c5e708e8287 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,7 +32,7 @@ __metadata: languageName: node linkType: hard -"@apollo/client@npm:^3.12.4, @apollo/client@npm:^3.3.19, @apollo/client@npm:^3.9.11": +"@apollo/client@npm:^3.12.4": version: 3.12.4 resolution: "@apollo/client@npm:3.12.4" dependencies: @@ -69,6 +69,43 @@ __metadata: languageName: node linkType: hard +"@apollo/client@npm:^3.3.19, @apollo/client@npm:^3.9.11": + version: 3.9.11 + resolution: "@apollo/client@npm:3.9.11" + dependencies: + "@graphql-typed-document-node/core": "npm:^3.1.1" + "@wry/caches": "npm:^1.0.0" + "@wry/equality": "npm:^0.5.6" + "@wry/trie": "npm:^0.5.0" + graphql-tag: "npm:^2.12.6" + hoist-non-react-statics: "npm:^3.3.2" + optimism: "npm:^0.18.0" + prop-types: "npm:^15.7.2" + rehackt: "npm:0.0.6" + response-iterator: "npm:^0.2.6" + symbol-observable: "npm:^4.0.0" + ts-invariant: "npm:^0.10.3" + tslib: "npm:^2.3.0" + zen-observable-ts: "npm:^1.2.5" + peerDependencies: + graphql: ^15.0.0 || ^16.0.0 + graphql-ws: ^5.5.5 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + subscriptions-transport-ws: ^0.9.0 || ^0.11.0 + peerDependenciesMeta: + graphql-ws: + optional: true + react: + optional: true + react-dom: + optional: true + subscriptions-transport-ws: + optional: true + checksum: c7657a8e0d62f6d1e0b2da7573e9a9397af879946396e86682166596ffb201c22f7677d11cf65ca2ce97acc8ff2ee8e37c077716cd1b6ae9bb0e3a9cdfdecaf4 + languageName: node + linkType: hard + "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.24.7": version: 7.24.7 resolution: "@babel/code-frame@npm:7.24.7" @@ -1679,6 +1716,15 @@ __metadata: languageName: node linkType: hard +"@babel/runtime@npm:^7.26.0": + version: 7.26.0 + resolution: "@babel/runtime@npm:7.26.0" + dependencies: + regenerator-runtime: "npm:^0.14.0" + checksum: 12c01357e0345f89f4f7e8c0e81921f2a3e3e101f06e8eaa18a382b517376520cd2fa8c237726eb094dab25532855df28a7baaf1c26342b52782f6936b07c287 + languageName: node + linkType: hard + "@babel/template@npm:^7.22.15, @babel/template@npm:^7.24.0, @babel/template@npm:^7.24.7, @babel/template@npm:^7.3.3": version: 7.24.7 resolution: "@babel/template@npm:7.24.7" @@ -1797,10 +1843,10 @@ __metadata: languageName: node linkType: hard -"@emotion/hash@npm:^0.8.0": - version: 0.8.0 - resolution: "@emotion/hash@npm:0.8.0" - checksum: 706303d35d416217cd7eb0d36dbda4627bb8bdf4a32ea387e8dd99be11b8e0a998e10af21216e8a5fade518ad955ff06aa8890f20e694ce3a038ae7fc1000556 +"@emotion/hash@npm:^0.8.0, @emotion/hash@npm:^0.9.2": + version: 0.9.2 + resolution: "@emotion/hash@npm:0.9.2" + checksum: 0dc254561a3cc0a06a10bbce7f6a997883fd240c8c1928b93713f803a2e9153a257a488537012efe89dbe1246f2abfe2add62cdb3471a13d67137fcb808e81c2 languageName: node linkType: hard @@ -1843,16 +1889,16 @@ __metadata: languageName: node linkType: hard -"@emotion/serialize@npm:^1.0.2": - version: 1.0.2 - resolution: "@emotion/serialize@npm:1.0.2" +"@emotion/serialize@npm:^1.0.2, @emotion/serialize@npm:^1.3.3": + version: 1.3.3 + resolution: "@emotion/serialize@npm:1.3.3" dependencies: - "@emotion/hash": "npm:^0.8.0" - "@emotion/memoize": "npm:^0.7.4" - "@emotion/unitless": "npm:^0.7.5" - "@emotion/utils": "npm:^1.0.0" + "@emotion/hash": "npm:^0.9.2" + "@emotion/memoize": "npm:^0.9.0" + "@emotion/unitless": "npm:^0.10.0" + "@emotion/utils": "npm:^1.4.2" csstype: "npm:^3.0.2" - checksum: b29dbf33c1801d2aa039d355fa87bb921a8dd4dcecd9ef8cea0c1d7796d39ea137c913824b3173c7d3acd65ff2bb8bc6912095690a266c79696f5528c1a1c509 + checksum: b28cb7de59de382021de2b26c0c94ebbfb16967a1b969a56fdb6408465a8993df243bfbd66430badaa6800e1834724e84895f5a6a9d97d0d224de3d77852acb4 languageName: node linkType: hard @@ -1885,10 +1931,10 @@ __metadata: languageName: node linkType: hard -"@emotion/unitless@npm:^0.7.5": - version: 0.7.5 - resolution: "@emotion/unitless@npm:0.7.5" - checksum: 4d0d94f53cb97b4481bbfa394953e1899a0b877644642ba9dd7247c27eb8c48e14e22aeb11411d7d9874685ad85dd5fb5b50eb78c6d8840eb56a84b92dcef2f4 +"@emotion/unitless@npm:^0.10.0": + version: 0.10.0 + resolution: "@emotion/unitless@npm:0.10.0" + checksum: 150943192727b7650eb9a6851a98034ddb58a8b6958b37546080f794696141c3760966ac695ab9af97efe10178690987aee4791f9f0ad1ff76783cdca83c1d49 languageName: node linkType: hard @@ -2823,6 +2869,13 @@ __metadata: languageName: node linkType: hard +"@mui/core-downloads-tracker@npm:^6.3.1": + version: 6.3.1 + resolution: "@mui/core-downloads-tracker@npm:6.3.1" + checksum: a996ad8db6bd8c981c4e2e2d243526c838dd29f0bbe7dc5ab6933be357e41f748781d322b1decf79ae1c9abba24190162559d84deedcb7c8824a68754dddf216 + languageName: node + linkType: hard + "@mui/icons-material@npm:^5.16.12": version: 5.16.14 resolution: "@mui/icons-material@npm:5.16.14" @@ -2839,6 +2892,22 @@ __metadata: languageName: node linkType: hard +"@mui/icons-material@npm:^5.16.12 || ^6.0.0, @mui/icons-material@npm:^6.0.0": + version: 6.3.1 + resolution: "@mui/icons-material@npm:6.3.1" + dependencies: + "@babel/runtime": "npm:^7.26.0" + peerDependencies: + "@mui/material": ^6.3.1 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: edaf71b7368c14cfbfed6f475ef96187871a010e972b9e7608d23cadae5ce52a3a6888b32453721dc1d86e2e7ad9c61aadde83ba5cd94363782bf83803d1ab36 + languageName: node + linkType: hard + "@mui/material@npm:^5.16.12": version: 5.16.14 resolution: "@mui/material@npm:5.16.14" @@ -2872,6 +2941,42 @@ __metadata: languageName: node linkType: hard +"@mui/material@npm:^5.16.12 || ^6.0.0, @mui/material@npm:^6.0.0": + version: 6.3.1 + resolution: "@mui/material@npm:6.3.1" + dependencies: + "@babel/runtime": "npm:^7.26.0" + "@mui/core-downloads-tracker": "npm:^6.3.1" + "@mui/system": "npm:^6.3.1" + "@mui/types": "npm:^7.2.21" + "@mui/utils": "npm:^6.3.1" + "@popperjs/core": "npm:^2.11.8" + "@types/react-transition-group": "npm:^4.4.12" + clsx: "npm:^2.1.1" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + react-is: "npm:^19.0.0" + react-transition-group: "npm:^4.4.5" + peerDependencies: + "@emotion/react": ^11.5.0 + "@emotion/styled": ^11.3.0 + "@mui/material-pigment-css": ^6.3.1 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + "@mui/material-pigment-css": + optional: true + "@types/react": + optional: true + checksum: 7fb91acd9bc021dde78e70d495a2abd69d0e2df35e526e0730e060c3177bb10cc3058ee27c72b5ec9bc7622d9c2ef99831b89f511f6700bc3717f979e2cb0152 + languageName: node + linkType: hard + "@mui/private-theming@npm:^5.16.14": version: 5.16.14 resolution: "@mui/private-theming@npm:5.16.14" @@ -2889,6 +2994,23 @@ __metadata: languageName: node linkType: hard +"@mui/private-theming@npm:^6.3.1": + version: 6.3.1 + resolution: "@mui/private-theming@npm:6.3.1" + dependencies: + "@babel/runtime": "npm:^7.26.0" + "@mui/utils": "npm:^6.3.1" + prop-types: "npm:^15.8.1" + peerDependencies: + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: aafaca0d7e5fd4d83c2cade28b7de554c0d848595f8f23f26c8f7daf3fc664053c9c81342d44d24e0a04a4813b58d6f0c1d135ae2775380acda91468a21f9684 + languageName: node + linkType: hard + "@mui/styled-engine@npm:^5.16.14": version: 5.16.14 resolution: "@mui/styled-engine@npm:5.16.14" @@ -2910,6 +3032,29 @@ __metadata: languageName: node linkType: hard +"@mui/styled-engine@npm:^6.3.1": + version: 6.3.1 + resolution: "@mui/styled-engine@npm:6.3.1" + dependencies: + "@babel/runtime": "npm:^7.26.0" + "@emotion/cache": "npm:^11.13.5" + "@emotion/serialize": "npm:^1.3.3" + "@emotion/sheet": "npm:^1.4.0" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + peerDependencies: + "@emotion/react": ^11.4.1 + "@emotion/styled": ^11.3.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + checksum: 81bbf8f2016b1c7debbbaab1a44ebaf8e494e8c9d32d2201b28f8c653a082177f6570fef779bf835bad1a9120af219a64b1d7a9a8a569c9c07045f00affe6b87 + languageName: node + linkType: hard + "@mui/system@npm:^5.16.14": version: 5.16.14 resolution: "@mui/system@npm:5.16.14" @@ -2938,7 +3083,35 @@ __metadata: languageName: node linkType: hard -"@mui/types@npm:^7.2.15": +"@mui/system@npm:^6.3.1": + version: 6.3.1 + resolution: "@mui/system@npm:6.3.1" + dependencies: + "@babel/runtime": "npm:^7.26.0" + "@mui/private-theming": "npm:^6.3.1" + "@mui/styled-engine": "npm:^6.3.1" + "@mui/types": "npm:^7.2.21" + "@mui/utils": "npm:^6.3.1" + clsx: "npm:^2.1.1" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + peerDependencies: + "@emotion/react": ^11.5.0 + "@emotion/styled": ^11.3.0 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + "@types/react": + optional: true + checksum: 49613b001f7e60c7ed70f3e2ee3ffc4f3a2719509e4f9ec18faf73a354597b8d894d0ee8861bf3a5b5db763efca36bcfb75989505c88e009c1627b114bac88ef + languageName: node + linkType: hard + +"@mui/types@npm:^7.2.15, @mui/types@npm:^7.2.21": version: 7.2.21 resolution: "@mui/types@npm:7.2.21" peerDependencies: @@ -2950,7 +3123,7 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^5.16.12, @mui/utils@npm:^5.16.14": +"@mui/utils@npm:^5.16.14": version: 5.16.14 resolution: "@mui/utils@npm:5.16.14" dependencies: @@ -2970,6 +3143,26 @@ __metadata: languageName: node linkType: hard +"@mui/utils@npm:^6.0.0, @mui/utils@npm:^6.3.1": + version: 6.3.1 + resolution: "@mui/utils@npm:6.3.1" + dependencies: + "@babel/runtime": "npm:^7.26.0" + "@mui/types": "npm:^7.2.21" + "@types/prop-types": "npm:^15.7.14" + clsx: "npm:^2.1.1" + prop-types: "npm:^15.8.1" + react-is: "npm:^19.0.0" + peerDependencies: + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: b111bca7ad065b1028714d55a8df90267c47a72ffb2bfad7a1709cef0d5d9036b463855d431b3606967c9351c7ee23f1dee02457b2f3ed02513744f0173eb00c + languageName: node + linkType: hard + "@nivo/annotations@npm:0.80.0": version: 0.80.0 resolution: "@nivo/annotations@npm:0.80.0" @@ -5062,7 +5255,7 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12": +"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12, @types/prop-types@npm:^15.7.14": version: 15.7.14 resolution: "@types/prop-types@npm:15.7.14" checksum: 1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1 @@ -5087,12 +5280,12 @@ __metadata: languageName: node linkType: hard -"@types/react-transition-group@npm:^4.4.10": - version: 4.4.10 - resolution: "@types/react-transition-group@npm:4.4.10" - dependencies: - "@types/react": "npm:*" - checksum: 3eb9bca143abc21eb781aa5cb1bded0c9335689d515bf0513fb8e63217b7a8122c6a323ecd5644a06938727e1f467ee061d8df1c93b68825a80ff1b47ab777a2 +"@types/react-transition-group@npm:^4.4.10, @types/react-transition-group@npm:^4.4.12": + version: 4.4.12 + resolution: "@types/react-transition-group@npm:4.4.12" + peerDependencies: + "@types/react": "*" + checksum: 0441b8b47c69312c89ec0760ba477ba1a0808a10ceef8dc1c64b1013ed78517332c30f18681b0ec0b53542731f1ed015169fed1d127cc91222638ed955478ec7 languageName: node linkType: hard @@ -8338,8 +8531,8 @@ __metadata: resolution: "demo@workspace:examples/demo" dependencies: "@apollo/client": "npm:^3.12.4" - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@types/fetch-mock": "npm:^7.3.2" "@types/jest": "npm:^29.5.2" "@types/node": "npm:^20.10.7" @@ -14150,7 +14343,7 @@ __metadata: version: 0.0.0-use.local resolution: "no-code@workspace:examples/no-code" dependencies: - "@mui/material": "npm:^5.16.12" + "@mui/material": "npm:^6.0.0" "@vitejs/plugin-react": "npm:^4.2.1" ra-data-local-storage: "npm:^5.0.0" ra-no-code: "npm:^5.0.0" @@ -16112,8 +16305,8 @@ __metadata: version: 0.0.0-use.local resolution: "ra-input-rich-text@workspace:packages/ra-input-rich-text" dependencies: - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@testing-library/react": "npm:^15.0.7" "@tiptap/core": "npm:^2.0.3" "@tiptap/extension-color": "npm:^2.0.3" @@ -16141,8 +16334,8 @@ __metadata: tippy.js: "npm:^6.3.7" typescript: "npm:^5.1.3" peerDependencies: - "@mui/icons-material": ^5.16.12 - "@mui/material": ^5.16.12 + "@mui/icons-material": ^5.16.12 || ^6.0.0 + "@mui/material": ^5.16.12 || ^6.0.0 ra-core: ^5.0.0 ra-ui-materialui: ^5.0.0 react: ^18.0.0 || ^19.0.0 @@ -16193,8 +16386,8 @@ __metadata: rimraf: "npm:^3.0.2" typescript: "npm:^5.1.3" peerDependencies: - "@mui/icons-material": ^5.16.12 - "@mui/material": ^5.16.12 + "@mui/icons-material": ^5.16.12 || ^6.0.0 + "@mui/material": ^5.16.12 || ^6.0.0 react: ^18.0.0 || ^19.0.0 react-dom: ^18.0.0 || ^19.0.0 languageName: unknown @@ -16204,9 +16397,9 @@ __metadata: version: 0.0.0-use.local resolution: "ra-ui-materialui@workspace:packages/ra-ui-materialui" dependencies: - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" - "@mui/utils": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" + "@mui/utils": "npm:^6.0.0" "@tanstack/react-query": "npm:^5.21.7" "@testing-library/react": "npm:^15.0.7" "@types/dompurify": "npm:^3.0.2" @@ -16241,9 +16434,9 @@ __metadata: rimraf: "npm:^3.0.2" typescript: "npm:^5.1.3" peerDependencies: - "@mui/icons-material": ^5.16.12 - "@mui/material": ^5.16.12 - "@mui/utils": ^5.16.12 + "@mui/icons-material": ^5.16.12 || ^6.0.0 + "@mui/material": ^5.16.12 || ^6.0.0 + "@mui/utils": ^5.15.20 || ^6.0.0 ra-core: ^5.0.0 react: ^18.0.0 || ^19.0.0 react-dom: ^18.0.0 || ^19.0.0 @@ -16303,8 +16496,8 @@ __metadata: resolution: "react-admin-crm@workspace:examples/crm" dependencies: "@hello-pangea/dnd": "npm:^16.3.0" - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@nivo/bar": "npm:^0.80.0" "@nivo/core": "npm:^0.80.0" "@testing-library/jest-dom": "npm:^6.4.5" @@ -16391,8 +16584,8 @@ __metadata: version: 0.0.0-use.local resolution: "react-admin@workspace:packages/react-admin" dependencies: - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^5.16.12 || ^6.0.0" + "@mui/material": "npm:^5.16.12 || ^6.0.0" cross-env: "npm:^5.2.0" expect: "npm:^27.4.6" ra-core: "npm:^5.4.3" @@ -17048,6 +17241,21 @@ __metadata: languageName: node linkType: hard +"rehackt@npm:0.0.6": + version: 0.0.6 + resolution: "rehackt@npm:0.0.6" + peerDependencies: + "@types/react": "*" + react: "*" + peerDependenciesMeta: + "@types/react": + optional: true + react: + optional: true + checksum: 814c9b80b2680dc0572639ecad1ed1961b23b606e53a00976ee4c4876f6ed736ea702381235ac40ed2a5c826fb55641b46ae23343e4ddd6378ced1da3d51ada7 + languageName: node + linkType: hard + "rehackt@npm:^0.1.0": version: 0.1.0 resolution: "rehackt@npm:0.1.0" From d2ca8b42ece8420b126e24fb26f992566f4ee1dc Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:08:00 +0100 Subject: [PATCH 02/13] Fix yarn.lock --- examples/simple/package.json | 4 +- yarn.lock | 152 ++--------------------------------- 2 files changed, 7 insertions(+), 149 deletions(-) diff --git a/examples/simple/package.json b/examples/simple/package.json index 4c619b2a4d8..d653a64b7ea 100644 --- a/examples/simple/package.json +++ b/examples/simple/package.json @@ -10,8 +10,8 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@mui/icons-material": "^5.16.12", - "@mui/material": "^5.16.12", + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", "@tanstack/react-query": "^5.21.7", "@tanstack/react-query-devtools": "^5.21.7", "jsonexport": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index c5e708e8287..5388ad50279 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2862,13 +2862,6 @@ __metadata: languageName: node linkType: hard -"@mui/core-downloads-tracker@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/core-downloads-tracker@npm:5.16.14" - checksum: eb866003ee4564c40423aadc4513b4c7d72c69723fe7dee4697ac70c19951e6e11093bb190761dc51a8f4d2731e562034ecb284930eec931bae1a56b8e18ca60 - languageName: node - linkType: hard - "@mui/core-downloads-tracker@npm:^6.3.1": version: 6.3.1 resolution: "@mui/core-downloads-tracker@npm:6.3.1" @@ -2876,22 +2869,6 @@ __metadata: languageName: node linkType: hard -"@mui/icons-material@npm:^5.16.12": - version: 5.16.14 - resolution: "@mui/icons-material@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - peerDependencies: - "@mui/material": ^5.0.0 - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 11632d1f9904fda0a751e442d3d948a83977cd9ba81481cda4e61b9dfdbd80b0616e27750728c066a4dc505035d7ad6aa29ff7c6160a9b52a2b313fc89aa4be3 - languageName: node - linkType: hard - "@mui/icons-material@npm:^5.16.12 || ^6.0.0, @mui/icons-material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/icons-material@npm:6.3.1" @@ -2908,39 +2885,6 @@ __metadata: languageName: node linkType: hard -"@mui/material@npm:^5.16.12": - version: 5.16.14 - resolution: "@mui/material@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/core-downloads-tracker": "npm:^5.16.14" - "@mui/system": "npm:^5.16.14" - "@mui/types": "npm:^7.2.15" - "@mui/utils": "npm:^5.16.14" - "@popperjs/core": "npm:^2.11.8" - "@types/react-transition-group": "npm:^4.4.10" - clsx: "npm:^2.1.0" - csstype: "npm:^3.1.3" - prop-types: "npm:^15.8.1" - react-is: "npm:^19.0.0" - react-transition-group: "npm:^4.4.5" - peerDependencies: - "@emotion/react": ^11.5.0 - "@emotion/styled": ^11.3.0 - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@emotion/react": - optional: true - "@emotion/styled": - optional: true - "@types/react": - optional: true - checksum: e313c1274f18a245f7128c9ccbd6444d6edb91a99fef7b6ec9ece4d2d19da0fec9a484afc24c0c35e9fcc53fb090dc524083d682c78428754a1c5b6cebb70a63 - languageName: node - linkType: hard - "@mui/material@npm:^5.16.12 || ^6.0.0, @mui/material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/material@npm:6.3.1" @@ -2977,23 +2921,6 @@ __metadata: languageName: node linkType: hard -"@mui/private-theming@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/private-theming@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/utils": "npm:^5.16.14" - prop-types: "npm:^15.8.1" - peerDependencies: - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 9723b63bd19000c096884f5a8900dc228afbe829d880d371865ae29387448cc669c10160bb55369210f3e903afb577ba832a39bc565427351bc27b42591c8099 - languageName: node - linkType: hard - "@mui/private-theming@npm:^6.3.1": version: 6.3.1 resolution: "@mui/private-theming@npm:6.3.1" @@ -3011,27 +2938,6 @@ __metadata: languageName: node linkType: hard -"@mui/styled-engine@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/styled-engine@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@emotion/cache": "npm:^11.13.5" - csstype: "npm:^3.1.3" - prop-types: "npm:^15.8.1" - peerDependencies: - "@emotion/react": ^11.4.1 - "@emotion/styled": ^11.3.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@emotion/react": - optional: true - "@emotion/styled": - optional: true - checksum: cd512faea4ad3ff5a9b315e136a518223ea3e4e34462fe70c56d1f166c46bee0a885ed982773d75c1d56ead62b95989cc5907601e8d65bfa75494b3f3288c2ad - languageName: node - linkType: hard - "@mui/styled-engine@npm:^6.3.1": version: 6.3.1 resolution: "@mui/styled-engine@npm:6.3.1" @@ -3055,34 +2961,6 @@ __metadata: languageName: node linkType: hard -"@mui/system@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/system@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/private-theming": "npm:^5.16.14" - "@mui/styled-engine": "npm:^5.16.14" - "@mui/types": "npm:^7.2.15" - "@mui/utils": "npm:^5.16.14" - clsx: "npm:^2.1.0" - csstype: "npm:^3.1.3" - prop-types: "npm:^15.8.1" - peerDependencies: - "@emotion/react": ^11.5.0 - "@emotion/styled": ^11.3.0 - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@emotion/react": - optional: true - "@emotion/styled": - optional: true - "@types/react": - optional: true - checksum: d7ab8dfd9fbecbde4423a0d432e63f45cd8c96bb4e48116f9f9b46cb001c2e32df3a1f09727f8b30c1bc182774cc33e338b1475287a2985dba795ee5486fc4cb - languageName: node - linkType: hard - "@mui/system@npm:^6.3.1": version: 6.3.1 resolution: "@mui/system@npm:6.3.1" @@ -3111,7 +2989,7 @@ __metadata: languageName: node linkType: hard -"@mui/types@npm:^7.2.15, @mui/types@npm:^7.2.21": +"@mui/types@npm:^7.2.21": version: 7.2.21 resolution: "@mui/types@npm:7.2.21" peerDependencies: @@ -3123,26 +3001,6 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^5.16.14": - version: 5.16.14 - resolution: "@mui/utils@npm:5.16.14" - dependencies: - "@babel/runtime": "npm:^7.23.9" - "@mui/types": "npm:^7.2.15" - "@types/prop-types": "npm:^15.7.12" - clsx: "npm:^2.1.1" - prop-types: "npm:^15.8.1" - react-is: "npm:^19.0.0" - peerDependencies: - "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 5148dedb8597a76df193df4c3b4ff4bb3c19d99f3b69df8b9d6c9905c5cc5eb750a71429aea7e52a03ad8b858c7ec48d04e5670ecf4e39b8c3a6a84f1a83721a - languageName: node - linkType: hard - "@mui/utils@npm:^6.0.0, @mui/utils@npm:^6.3.1": version: 6.3.1 resolution: "@mui/utils@npm:6.3.1" @@ -5255,7 +5113,7 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12, @types/prop-types@npm:^15.7.14": +"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.14": version: 15.7.14 resolution: "@types/prop-types@npm:15.7.14" checksum: 1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1 @@ -7384,7 +7242,7 @@ __metadata: languageName: node linkType: hard -"clsx@npm:^2.0.0, clsx@npm:^2.1.0, clsx@npm:^2.1.1": +"clsx@npm:^2.0.0, clsx@npm:^2.1.1": version: 2.1.1 resolution: "clsx@npm:2.1.1" checksum: c4c8eb865f8c82baab07e71bfa8897c73454881c4f99d6bc81585aecd7c441746c1399d08363dc096c550cceaf97bd4ce1e8854e1771e9998d9f94c4fe075839 @@ -17939,8 +17797,8 @@ __metadata: resolution: "simple@workspace:examples/simple" dependencies: "@hookform/devtools": "npm:^4.3.3" - "@mui/icons-material": "npm:^5.16.12" - "@mui/material": "npm:^5.16.12" + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@tanstack/react-query": "npm:^5.21.7" "@tanstack/react-query-devtools": "npm:^5.21.7" "@vitejs/plugin-react": "npm:^4.2.1" From 41aa489083ec116e31778311fc8858c4d48b52e4 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Wed, 8 Jan 2025 18:14:29 +0100 Subject: [PATCH 03/13] Fix CRM demo --- examples/crm/src/companies/CompanyShow.tsx | 66 +++++++++++----------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/examples/crm/src/companies/CompanyShow.tsx b/examples/crm/src/companies/CompanyShow.tsx index 9c7ce79a487..00a486eeaa5 100644 --- a/examples/crm/src/companies/CompanyShow.tsx +++ b/examples/crm/src/companies/CompanyShow.tsx @@ -216,38 +216,40 @@ const DealsIterator = () => { {deals.map(deal => ( - - - {findDealLabel(dealStages, deal.stage)},{' '} - {deal.amount.toLocaleString('en-US', { - notation: 'compact', - style: 'currency', - currency: 'USD', - currencyDisplay: 'narrowSymbol', - minimumSignificantDigits: 3, - })} - {deal.category ? `, ${deal.category}` : ''} - - } - /> - - - last activity{' '} - {formatDistance(deal.updated_at, now)} ago{' '} - - + + + + {findDealLabel(dealStages, deal.stage)},{' '} + {deal.amount.toLocaleString('en-US', { + notation: 'compact', + style: 'currency', + currency: 'USD', + currencyDisplay: 'narrowSymbol', + minimumSignificantDigits: 3, + })} + {deal.category + ? `, ${deal.category}` + : ''} + + } + /> + + + last activity{' '} + {formatDistance(deal.updated_at, now)} ago{' '} + + + ))} From de6f1cb43fb46086ccc1e9275a0066d82370b424 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 09:31:18 +0100 Subject: [PATCH 04/13] Fix useTheme tests --- packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx | 4 ++-- packages/ra-ui-materialui/src/theme/useTheme.spec.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx b/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx index d3a44b62fcc..3ac247effbf 100644 --- a/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx +++ b/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx @@ -22,8 +22,8 @@ export const ThemeTestWrapper = ({ mode === 'dark' && query === '(prefers-color-scheme: dark)' ? true : false, - addListener: () => {}, - removeListener: () => {}, + addEventListener: () => {}, + removeEventListener: () => {}, }); return ( diff --git a/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx b/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx index 4907c60a706..64947e58536 100644 --- a/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx +++ b/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx @@ -35,7 +35,7 @@ describe('useTheme', () => { expect(screen.queryByText('light')).not.toBeNull(); }); - it('should return the light theme when no dark theme is provided even though user prefers dark mode', () => { + it('should return the light theme when no dark theme is provided even though user prefers dark mode', async () => { render( @@ -43,7 +43,7 @@ describe('useTheme', () => { ); - expect(screen.queryByText('light')).not.toBeNull(); + await screen.findByText('light'); }); it('should return the light theme when no dark theme is provided even though the stored theme is dark', () => { @@ -59,8 +59,8 @@ describe('useTheme', () => { it('should return the user preferred theme by default', async () => { const ssrMatchMedia = query => ({ matches: query === '(prefers-color-scheme: dark)' ? true : false, - addListener: () => {}, - removeListener: () => {}, + addEventListener: () => {}, + removeEventListener: () => {}, }); render( From 33818f1e3c387a830e5605e98200229519ac9aa1 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:05:36 +0100 Subject: [PATCH 05/13] Revert devDependencies to v5 --- examples/crm/package.json | 4 +- examples/no-code/package.json | 2 +- examples/simple/package.json | 4 +- examples/tutorial/package.json | 2 + packages/ra-input-rich-text/package.json | 4 +- packages/ra-ui-materialui/package.json | 6 +- .../src/layout/ThemeTestWrapper.tsx | 4 +- .../src/theme/useTheme.spec.tsx | 4 +- yarn.lock | 172 ++++++++++++++++-- 9 files changed, 174 insertions(+), 28 deletions(-) diff --git a/examples/crm/package.json b/examples/crm/package.json index 54eb93f3d0a..33a01cec4d8 100644 --- a/examples/crm/package.json +++ b/examples/crm/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "@hello-pangea/dnd": "^16.3.0", - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", "@nivo/bar": "^0.80.0", "@nivo/core": "^0.80.0", "clsx": "^2.1.1", diff --git a/examples/no-code/package.json b/examples/no-code/package.json index 12b23c0b821..5e70f237a9d 100644 --- a/examples/no-code/package.json +++ b/examples/no-code/package.json @@ -8,7 +8,7 @@ "serve": "vite preview" }, "dependencies": { - "@mui/material": "^6.0.0", + "@mui/material": "^5.16.12", "ra-data-local-storage": "^5.0.0", "ra-no-code": "^5.0.0", "react": "^18.3.1", diff --git a/examples/simple/package.json b/examples/simple/package.json index d653a64b7ea..4c619b2a4d8 100644 --- a/examples/simple/package.json +++ b/examples/simple/package.json @@ -10,8 +10,8 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", "@tanstack/react-query": "^5.21.7", "@tanstack/react-query-devtools": "^5.21.7", "jsonexport": "^3.2.0", diff --git a/examples/tutorial/package.json b/examples/tutorial/package.json index d281ea5c4f1..1105a69d397 100644 --- a/examples/tutorial/package.json +++ b/examples/tutorial/package.json @@ -9,6 +9,8 @@ "preview": "vite preview" }, "dependencies": { + "@mui/icons-material": "^6.0.0", + "@mui/material": "^6.0.0", "ra-data-json-server": "^5.0.0", "react": "^19.0.0", "react-admin": "^5.0.0", diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json index e67d8cd1ff2..afd1b881f95 100644 --- a/packages/ra-input-rich-text/package.json +++ b/packages/ra-input-rich-text/package.json @@ -46,8 +46,8 @@ "react-dom": "^18.0.0 || ^19.0.0" }, "devDependencies": { - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", "@testing-library/react": "^15.0.7", "@tiptap/extension-mention": "^2.0.3", "@tiptap/suggestion": "^2.0.3", diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index e86b384f1ab..b0096951ec4 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -26,9 +26,9 @@ "watch": "tsc --outDir dist/esm --module es2015 --watch" }, "devDependencies": { - "@mui/icons-material": "^6.0.0", - "@mui/material": "^6.0.0", - "@mui/utils": "^6.0.0", + "@mui/icons-material": "^5.16.12", + "@mui/material": "^5.16.12", + "@mui/utils": "^5.16.12", "@testing-library/react": "^15.0.7", "@types/dompurify": "^3.0.2", "@types/react": "^18.3.3", diff --git a/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx b/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx index 3ac247effbf..d3a44b62fcc 100644 --- a/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx +++ b/packages/ra-ui-materialui/src/layout/ThemeTestWrapper.tsx @@ -22,8 +22,8 @@ export const ThemeTestWrapper = ({ mode === 'dark' && query === '(prefers-color-scheme: dark)' ? true : false, - addEventListener: () => {}, - removeEventListener: () => {}, + addListener: () => {}, + removeListener: () => {}, }); return ( diff --git a/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx b/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx index 64947e58536..763b4a3cbc6 100644 --- a/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx +++ b/packages/ra-ui-materialui/src/theme/useTheme.spec.tsx @@ -59,8 +59,8 @@ describe('useTheme', () => { it('should return the user preferred theme by default', async () => { const ssrMatchMedia = query => ({ matches: query === '(prefers-color-scheme: dark)' ? true : false, - addEventListener: () => {}, - removeEventListener: () => {}, + addListener: () => {}, + removeListener: () => {}, }); render( diff --git a/yarn.lock b/yarn.lock index 5388ad50279..c18e951d778 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2862,6 +2862,13 @@ __metadata: languageName: node linkType: hard +"@mui/core-downloads-tracker@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/core-downloads-tracker@npm:5.16.14" + checksum: eb866003ee4564c40423aadc4513b4c7d72c69723fe7dee4697ac70c19951e6e11093bb190761dc51a8f4d2731e562034ecb284930eec931bae1a56b8e18ca60 + languageName: node + linkType: hard + "@mui/core-downloads-tracker@npm:^6.3.1": version: 6.3.1 resolution: "@mui/core-downloads-tracker@npm:6.3.1" @@ -2869,6 +2876,22 @@ __metadata: languageName: node linkType: hard +"@mui/icons-material@npm:^5.16.12": + version: 5.16.14 + resolution: "@mui/icons-material@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + peerDependencies: + "@mui/material": ^5.0.0 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 11632d1f9904fda0a751e442d3d948a83977cd9ba81481cda4e61b9dfdbd80b0616e27750728c066a4dc505035d7ad6aa29ff7c6160a9b52a2b313fc89aa4be3 + languageName: node + linkType: hard + "@mui/icons-material@npm:^5.16.12 || ^6.0.0, @mui/icons-material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/icons-material@npm:6.3.1" @@ -2885,6 +2908,39 @@ __metadata: languageName: node linkType: hard +"@mui/material@npm:^5.16.12": + version: 5.16.14 + resolution: "@mui/material@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/core-downloads-tracker": "npm:^5.16.14" + "@mui/system": "npm:^5.16.14" + "@mui/types": "npm:^7.2.15" + "@mui/utils": "npm:^5.16.14" + "@popperjs/core": "npm:^2.11.8" + "@types/react-transition-group": "npm:^4.4.10" + clsx: "npm:^2.1.0" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + react-is: "npm:^19.0.0" + react-transition-group: "npm:^4.4.5" + peerDependencies: + "@emotion/react": ^11.5.0 + "@emotion/styled": ^11.3.0 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + "@types/react": + optional: true + checksum: e313c1274f18a245f7128c9ccbd6444d6edb91a99fef7b6ec9ece4d2d19da0fec9a484afc24c0c35e9fcc53fb090dc524083d682c78428754a1c5b6cebb70a63 + languageName: node + linkType: hard + "@mui/material@npm:^5.16.12 || ^6.0.0, @mui/material@npm:^6.0.0": version: 6.3.1 resolution: "@mui/material@npm:6.3.1" @@ -2921,6 +2977,23 @@ __metadata: languageName: node linkType: hard +"@mui/private-theming@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/private-theming@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/utils": "npm:^5.16.14" + prop-types: "npm:^15.8.1" + peerDependencies: + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 9723b63bd19000c096884f5a8900dc228afbe829d880d371865ae29387448cc669c10160bb55369210f3e903afb577ba832a39bc565427351bc27b42591c8099 + languageName: node + linkType: hard + "@mui/private-theming@npm:^6.3.1": version: 6.3.1 resolution: "@mui/private-theming@npm:6.3.1" @@ -2938,6 +3011,27 @@ __metadata: languageName: node linkType: hard +"@mui/styled-engine@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/styled-engine@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@emotion/cache": "npm:^11.13.5" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + peerDependencies: + "@emotion/react": ^11.4.1 + "@emotion/styled": ^11.3.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + checksum: cd512faea4ad3ff5a9b315e136a518223ea3e4e34462fe70c56d1f166c46bee0a885ed982773d75c1d56ead62b95989cc5907601e8d65bfa75494b3f3288c2ad + languageName: node + linkType: hard + "@mui/styled-engine@npm:^6.3.1": version: 6.3.1 resolution: "@mui/styled-engine@npm:6.3.1" @@ -2961,6 +3055,34 @@ __metadata: languageName: node linkType: hard +"@mui/system@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/system@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/private-theming": "npm:^5.16.14" + "@mui/styled-engine": "npm:^5.16.14" + "@mui/types": "npm:^7.2.15" + "@mui/utils": "npm:^5.16.14" + clsx: "npm:^2.1.0" + csstype: "npm:^3.1.3" + prop-types: "npm:^15.8.1" + peerDependencies: + "@emotion/react": ^11.5.0 + "@emotion/styled": ^11.3.0 + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@emotion/react": + optional: true + "@emotion/styled": + optional: true + "@types/react": + optional: true + checksum: d7ab8dfd9fbecbde4423a0d432e63f45cd8c96bb4e48116f9f9b46cb001c2e32df3a1f09727f8b30c1bc182774cc33e338b1475287a2985dba795ee5486fc4cb + languageName: node + linkType: hard + "@mui/system@npm:^6.3.1": version: 6.3.1 resolution: "@mui/system@npm:6.3.1" @@ -2989,7 +3111,7 @@ __metadata: languageName: node linkType: hard -"@mui/types@npm:^7.2.21": +"@mui/types@npm:^7.2.15, @mui/types@npm:^7.2.21": version: 7.2.21 resolution: "@mui/types@npm:7.2.21" peerDependencies: @@ -3001,7 +3123,27 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^6.0.0, @mui/utils@npm:^6.3.1": +"@mui/utils@npm:^5.16.12, @mui/utils@npm:^5.16.14": + version: 5.16.14 + resolution: "@mui/utils@npm:5.16.14" + dependencies: + "@babel/runtime": "npm:^7.23.9" + "@mui/types": "npm:^7.2.15" + "@types/prop-types": "npm:^15.7.12" + clsx: "npm:^2.1.1" + prop-types: "npm:^15.8.1" + react-is: "npm:^19.0.0" + peerDependencies: + "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0 + react: ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 5148dedb8597a76df193df4c3b4ff4bb3c19d99f3b69df8b9d6c9905c5cc5eb750a71429aea7e52a03ad8b858c7ec48d04e5670ecf4e39b8c3a6a84f1a83721a + languageName: node + linkType: hard + +"@mui/utils@npm:^6.3.1": version: 6.3.1 resolution: "@mui/utils@npm:6.3.1" dependencies: @@ -5113,7 +5255,7 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.14": +"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12, @types/prop-types@npm:^15.7.14": version: 15.7.14 resolution: "@types/prop-types@npm:15.7.14" checksum: 1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1 @@ -7242,7 +7384,7 @@ __metadata: languageName: node linkType: hard -"clsx@npm:^2.0.0, clsx@npm:^2.1.1": +"clsx@npm:^2.0.0, clsx@npm:^2.1.0, clsx@npm:^2.1.1": version: 2.1.1 resolution: "clsx@npm:2.1.1" checksum: c4c8eb865f8c82baab07e71bfa8897c73454881c4f99d6bc81585aecd7c441746c1399d08363dc096c550cceaf97bd4ce1e8854e1771e9998d9f94c4fe075839 @@ -14201,7 +14343,7 @@ __metadata: version: 0.0.0-use.local resolution: "no-code@workspace:examples/no-code" dependencies: - "@mui/material": "npm:^6.0.0" + "@mui/material": "npm:^5.16.12" "@vitejs/plugin-react": "npm:^4.2.1" ra-data-local-storage: "npm:^5.0.0" ra-no-code: "npm:^5.0.0" @@ -16163,8 +16305,8 @@ __metadata: version: 0.0.0-use.local resolution: "ra-input-rich-text@workspace:packages/ra-input-rich-text" dependencies: - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" "@testing-library/react": "npm:^15.0.7" "@tiptap/core": "npm:^2.0.3" "@tiptap/extension-color": "npm:^2.0.3" @@ -16255,9 +16397,9 @@ __metadata: version: 0.0.0-use.local resolution: "ra-ui-materialui@workspace:packages/ra-ui-materialui" dependencies: - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" - "@mui/utils": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" + "@mui/utils": "npm:^5.16.12" "@tanstack/react-query": "npm:^5.21.7" "@testing-library/react": "npm:^15.0.7" "@types/dompurify": "npm:^3.0.2" @@ -16354,8 +16496,8 @@ __metadata: resolution: "react-admin-crm@workspace:examples/crm" dependencies: "@hello-pangea/dnd": "npm:^16.3.0" - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" "@nivo/bar": "npm:^0.80.0" "@nivo/core": "npm:^0.80.0" "@testing-library/jest-dom": "npm:^6.4.5" @@ -17797,8 +17939,8 @@ __metadata: resolution: "simple@workspace:examples/simple" dependencies: "@hookform/devtools": "npm:^4.3.3" - "@mui/icons-material": "npm:^6.0.0" - "@mui/material": "npm:^6.0.0" + "@mui/icons-material": "npm:^5.16.12" + "@mui/material": "npm:^5.16.12" "@tanstack/react-query": "npm:^5.21.7" "@tanstack/react-query-devtools": "npm:^5.21.7" "@vitejs/plugin-react": "npm:^4.2.1" @@ -18906,6 +19048,8 @@ __metadata: version: 0.0.0-use.local resolution: "tutorial@workspace:examples/tutorial" dependencies: + "@mui/icons-material": "npm:^6.0.0" + "@mui/material": "npm:^6.0.0" "@types/react": "npm:^18.3.3" "@types/react-dom": "npm:^18.3.0" "@vitejs/plugin-react": "npm:^4.2.1" From 92e0bc7198ae35741aed8b9b5455d8ff5a67800c Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:36:44 +0100 Subject: [PATCH 06/13] Fix remaining color props in demo --- examples/demo/src/layout/SubMenu.tsx | 5 ++++- examples/demo/src/visitors/Aside.tsx | 28 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/examples/demo/src/layout/SubMenu.tsx b/examples/demo/src/layout/SubMenu.tsx index 86442c66dbc..72dd73a69d5 100644 --- a/examples/demo/src/layout/SubMenu.tsx +++ b/examples/demo/src/layout/SubMenu.tsx @@ -31,7 +31,10 @@ const SubMenu = (props: Props) => { {isOpen ? : icon} - + theme.palette.text.secondary }} + > {translate(name)} diff --git a/examples/demo/src/visitors/Aside.tsx b/examples/demo/src/visitors/Aside.tsx index 161549772d1..30290c934fa 100644 --- a/examples/demo/src/visitors/Aside.tsx +++ b/examples/demo/src/visitors/Aside.tsx @@ -258,7 +258,11 @@ const Order = () => { if (!record) return null; return ( <> - + theme.palette.text.secondary }} + gutterBottom + > {new Date(record.date).toLocaleString(locale, { year: 'numeric', month: 'short', @@ -267,11 +271,18 @@ const Order = () => { minute: 'numeric', })} - + theme.palette.text.secondary }} + gutterBottom + > Reference  #{record.reference} -  - + theme.palette.text.secondary }} + > { if (!record) return null; return ( <> - + theme.palette.text.secondary }} + gutterBottom + > {new Date(record.date).toLocaleString(locale, { year: 'numeric', month: 'short', @@ -326,7 +341,10 @@ const Review = () => { > {record.comment} - + theme.palette.text.secondary }} + > From 64a7ba3ef465de5bd685cc699ec37e87bd1633be Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:40:43 +0100 Subject: [PATCH 07/13] Fix LocalesMenuButton --- packages/ra-ui-materialui/src/button/LocalesMenuButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ra-ui-materialui/src/button/LocalesMenuButton.tsx b/packages/ra-ui-materialui/src/button/LocalesMenuButton.tsx index 9086616cef6..69a67e6cf08 100644 --- a/packages/ra-ui-materialui/src/button/LocalesMenuButton.tsx +++ b/packages/ra-ui-materialui/src/button/LocalesMenuButton.tsx @@ -85,7 +85,7 @@ const PREFIX = 'RaLocalesMenuButton'; export const LocalesMenuButtonClasses = {}; -const Root = styled('div', { +const Root = styled('span', { name: PREFIX, overridesResolver: (props, styles) => styles.root, })({}) as typeof Box; From f9fddb14889e8967852802df2e0c0cfa0e8758f2 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:52:58 +0100 Subject: [PATCH 08/13] Fix yarn.lock --- yarn.lock | 54 +----------------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/yarn.lock b/yarn.lock index c18e951d778..99716b51c2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,7 +32,7 @@ __metadata: languageName: node linkType: hard -"@apollo/client@npm:^3.12.4": +"@apollo/client@npm:^3.12.4, @apollo/client@npm:^3.3.19, @apollo/client@npm:^3.9.11": version: 3.12.4 resolution: "@apollo/client@npm:3.12.4" dependencies: @@ -69,43 +69,6 @@ __metadata: languageName: node linkType: hard -"@apollo/client@npm:^3.3.19, @apollo/client@npm:^3.9.11": - version: 3.9.11 - resolution: "@apollo/client@npm:3.9.11" - dependencies: - "@graphql-typed-document-node/core": "npm:^3.1.1" - "@wry/caches": "npm:^1.0.0" - "@wry/equality": "npm:^0.5.6" - "@wry/trie": "npm:^0.5.0" - graphql-tag: "npm:^2.12.6" - hoist-non-react-statics: "npm:^3.3.2" - optimism: "npm:^0.18.0" - prop-types: "npm:^15.7.2" - rehackt: "npm:0.0.6" - response-iterator: "npm:^0.2.6" - symbol-observable: "npm:^4.0.0" - ts-invariant: "npm:^0.10.3" - tslib: "npm:^2.3.0" - zen-observable-ts: "npm:^1.2.5" - peerDependencies: - graphql: ^15.0.0 || ^16.0.0 - graphql-ws: ^5.5.5 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - subscriptions-transport-ws: ^0.9.0 || ^0.11.0 - peerDependenciesMeta: - graphql-ws: - optional: true - react: - optional: true - react-dom: - optional: true - subscriptions-transport-ws: - optional: true - checksum: c7657a8e0d62f6d1e0b2da7573e9a9397af879946396e86682166596ffb201c22f7677d11cf65ca2ce97acc8ff2ee8e37c077716cd1b6ae9bb0e3a9cdfdecaf4 - languageName: node - linkType: hard - "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7, @babel/code-frame@npm:^7.24.7": version: 7.24.7 resolution: "@babel/code-frame@npm:7.24.7" @@ -17241,21 +17204,6 @@ __metadata: languageName: node linkType: hard -"rehackt@npm:0.0.6": - version: 0.0.6 - resolution: "rehackt@npm:0.0.6" - peerDependencies: - "@types/react": "*" - react: "*" - peerDependenciesMeta: - "@types/react": - optional: true - react: - optional: true - checksum: 814c9b80b2680dc0572639ecad1ed1961b23b606e53a00976ee4c4876f6ed736ea702381235ac40ed2a5c826fb55641b46ae23343e4ddd6378ced1da3d51ada7 - languageName: node - linkType: hard - "rehackt@npm:^0.1.0": version: 0.1.0 resolution: "rehackt@npm:0.1.0" From d759c9fb49f63928c9c30485581b6bc1b6fe627a Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:02:19 +0100 Subject: [PATCH 09/13] Fix yarn.lock --- yarn.lock | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 99716b51c2d..de2b1f52605 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1670,16 +1670,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.21.5, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": - version: 7.24.4 - resolution: "@babel/runtime@npm:7.24.4" - dependencies: - regenerator-runtime: "npm:^0.14.0" - checksum: 785aff96a3aa8ff97f90958e1e8a7b1d47f793b204b47c6455eaadc3f694f48c97cd5c0a921fe3596d818e71f18106610a164fb0f1c71fd68c622a58269d537c - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.26.0": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.21.5, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.23.9, @babel/runtime@npm:^7.26.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": version: 7.26.0 resolution: "@babel/runtime@npm:7.26.0" dependencies: From 684122550f2434e3cb0b6aff65305a828c7afdb3 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:02:26 +0100 Subject: [PATCH 10/13] Fix TagList --- examples/simple/src/tags/TagList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simple/src/tags/TagList.tsx b/examples/simple/src/tags/TagList.tsx index cbfe7cfe257..bf3dd443ee5 100644 --- a/examples/simple/src/tags/TagList.tsx +++ b/examples/simple/src/tags/TagList.tsx @@ -76,7 +76,7 @@ const SubTree = ({ level, root, getChildNodes, openChildren, toggleNode }) => { const open = openChildren.includes(root.id); return ( - + hasChildren && toggleNode(root)}> {hasChildren && open && } {hasChildren && !open && } From 0a65b45155624ece7cf5eae86eb25b2cb33ca142 Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:02:37 +0100 Subject: [PATCH 11/13] Fix ApplicationsDashboard --- .../src/ApplicationsDashboard/ApplicationsDashboard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ra-no-code/src/ApplicationsDashboard/ApplicationsDashboard.tsx b/packages/ra-no-code/src/ApplicationsDashboard/ApplicationsDashboard.tsx index ad510d8a807..6b290e334b3 100644 --- a/packages/ra-no-code/src/ApplicationsDashboard/ApplicationsDashboard.tsx +++ b/packages/ra-no-code/src/ApplicationsDashboard/ApplicationsDashboard.tsx @@ -103,7 +103,7 @@ const Applications = ({ onApplicationSelected }) => { {applications.map(application => ( - + onApplicationSelected(application) From a4703fd2e29c3ad849cde0d6d31bd5767027385f Mon Sep 17 00:00:00 2001 From: Gildas <1122076+djhi@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:13:48 +0100 Subject: [PATCH 12/13] Fix Labeled issue with color --- docs/Labeled.md | 29 +++++++++++++------ examples/demo/src/dashboard/CardWithIcon.tsx | 6 +--- examples/demo/src/layout/SubMenu.tsx | 5 +--- examples/demo/src/visitors/Aside.tsx | 28 ++++-------------- .../ra-ui-materialui/src/Labeled.stories.tsx | 19 ++++++++++++ packages/ra-ui-materialui/src/Labeled.tsx | 26 ++++++++++++----- 6 files changed, 65 insertions(+), 48 deletions(-) diff --git a/docs/Labeled.md b/docs/Labeled.md index f6d379a7f70..8291e7842e0 100644 --- a/docs/Labeled.md +++ b/docs/Labeled.md @@ -36,15 +36,16 @@ const BookShow = () => ( ## Props -| Prop | Required | Type | Default | Description | -|:-------------|:---------|:-----------------|:----------|:------------| -| `children` | Required | Element | | The wrapped component | -| `className` | Optional | string | | The class name | -| `color` | Optional | string | `text.secondary` | The color of the label | -| `fullWidth` | Optional | boolean | `false` | Whether to stretch the label to the full width of the container | -| `isRequired` | Optional | boolean | `false` | Whether to display an asterisk. | -| `label` | Optional | string | | The label. If not set, the label is inferred from the child component | -| `sx` | Optional | [SxProps](https://mui.com/system/the-sx-prop/) | | Custom styles | +| Prop | Required | Type | Default | Description | +|:----------------- |:-------- |:---------------- |:----------|:------------| +| `children` | Required | Element | | The wrapped component | +| `className` | Optional | string | | The class name | +| `color` | Optional | string | `text.secondary` | The color of the label | +| `fullWidth` | Optional | boolean | `false` | Whether to stretch the label to the full width of the container | +| `isRequired` | Optional | boolean | `false` | Whether to display an asterisk. | +| `label` | Optional | string | | The label. If not set, the label is inferred from the child component | +| `sx` | Optional | [SxProps](https://mui.com/system/the-sx-prop/) | | Custom styles | +| `TypographyProps` | Optional | [TypographyProps](https://mui.com/material-ui/api/typography/) | | Custom props | Additional props are passed to the underlying [Material UI `` element](https://mui.com/material-ui/react-stack/). @@ -167,3 +168,13 @@ The `` component accepts the usual `className` prop. You can also overr To override the style of all instances of `` using the [application-wide style overrides](./AppTheme.md#theming-individual-components), use the `RaLabeled` key. + +## `TypographyProps` + +The `` component accept a `TypographyProps` prop that allows you to pass any prop supported by [``](https://mui.com/material-ui/api/typography/). + +```tsx + + + +``` diff --git a/examples/demo/src/dashboard/CardWithIcon.tsx b/examples/demo/src/dashboard/CardWithIcon.tsx index bb0c4446865..3878b17eeeb 100644 --- a/examples/demo/src/dashboard/CardWithIcon.tsx +++ b/examples/demo/src/dashboard/CardWithIcon.tsx @@ -56,11 +56,7 @@ const CardWithIcon = ({ icon, title, subtitle, to, children }: Props) => ( {createElement(icon, { fontSize: 'large' })} - theme.palette.text.secondary }} - > - {title} - + {title} {subtitle || ' '} diff --git a/examples/demo/src/layout/SubMenu.tsx b/examples/demo/src/layout/SubMenu.tsx index 72dd73a69d5..86442c66dbc 100644 --- a/examples/demo/src/layout/SubMenu.tsx +++ b/examples/demo/src/layout/SubMenu.tsx @@ -31,10 +31,7 @@ const SubMenu = (props: Props) => { {isOpen ? : icon} - theme.palette.text.secondary }} - > + {translate(name)} diff --git a/examples/demo/src/visitors/Aside.tsx b/examples/demo/src/visitors/Aside.tsx index 30290c934fa..161549772d1 100644 --- a/examples/demo/src/visitors/Aside.tsx +++ b/examples/demo/src/visitors/Aside.tsx @@ -258,11 +258,7 @@ const Order = () => { if (!record) return null; return ( <> - theme.palette.text.secondary }} - gutterBottom - > + {new Date(record.date).toLocaleString(locale, { year: 'numeric', month: 'short', @@ -271,18 +267,11 @@ const Order = () => { minute: 'numeric', })} - theme.palette.text.secondary }} - gutterBottom - > + Reference  #{record.reference} -  - theme.palette.text.secondary }} - > + { if (!record) return null; return ( <> - theme.palette.text.secondary }} - gutterBottom - > + {new Date(record.date).toLocaleString(locale, { year: 'numeric', month: 'short', @@ -341,10 +326,7 @@ const Review = () => { > {record.comment} - theme.palette.text.secondary }} - > + diff --git a/packages/ra-ui-materialui/src/Labeled.stories.tsx b/packages/ra-ui-materialui/src/Labeled.stories.tsx index acecef575d7..bb2d542b628 100644 --- a/packages/ra-ui-materialui/src/Labeled.stories.tsx +++ b/packages/ra-ui-materialui/src/Labeled.stories.tsx @@ -66,6 +66,9 @@ export const Color = () => ( + + + @@ -77,6 +80,22 @@ export const Color = () => ( ); +export const TypographyProps = () => ( + + + + theme.palette.secondary.main }, + }} + > + + + + + +); + export const IsRequired = () => ( diff --git a/packages/ra-ui-materialui/src/Labeled.tsx b/packages/ra-ui-materialui/src/Labeled.tsx index 39fbb3a2928..9009c504487 100644 --- a/packages/ra-ui-materialui/src/Labeled.tsx +++ b/packages/ra-ui-materialui/src/Labeled.tsx @@ -1,10 +1,15 @@ import * as React from 'react'; import { ElementType, ReactElement } from 'react'; -import { Stack, StackProps, Theme, Typography } from '@mui/material'; +import { + Stack, + StackProps, + Theme, + Typography, + TypographyProps, +} from '@mui/material'; import { styled } from '@mui/material/styles'; import { Property } from 'csstype'; import clsx from 'clsx'; -import get from 'lodash/get'; import { FieldTitle } from 'ra-core'; import { ResponsiveStyleValue } from '@mui/system'; @@ -24,13 +29,14 @@ import { ResponsiveStyleValue } from '@mui/system'; export const Labeled = ({ children, className = '', - color = 'text.secondary', + color, component = 'span', fullWidth, isRequired, label, resource, source, + TypographyProps, ...rest }: LabeledProps) => ( - get(theme.palette, color.toString(), color).toString(), - }} + sx={ + color + ? undefined + : { + color: theme => theme.palette.text.secondary, + } + } + color={color} className={LabeledClasses.label} + {...TypographyProps} > Date: Fri, 10 Jan 2025 15:29:10 +0100 Subject: [PATCH 13/13] Fix Labeled doc --- docs/Labeled.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/Labeled.md b/docs/Labeled.md index 8291e7842e0..ce420c098b9 100644 --- a/docs/Labeled.md +++ b/docs/Labeled.md @@ -173,8 +173,11 @@ To override the style of all instances of `` using the [application-wid The `` component accept a `TypographyProps` prop that allows you to pass any prop supported by [``](https://mui.com/material-ui/api/typography/). +{% raw %} ```tsx ``` +{% endraw %} +