-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material] Remove dependency to @mui/base #42907
Merged
Merged
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d8c5595
Move @mui/base/utils
mnajdova 44b6dc7
move composeClasses
mnajdova 2224463
Move Autocomplete & Badge dependencies
mnajdova dadb6ea
Move NoSsr
mnajdova bdb3601
Move Slider and ClassNameGenerator
mnajdova 2e71c28
Move ClickAwayListener and Modal dependencies
mnajdova 09efcda
move Popper, FocusTrap
mnajdova b7a6ecb
Move rest of the dependencies and remove @mui/base from package.json
mnajdova f99cec3
prettier
mnajdova eaad5a2
pnpm install
mnajdova f87da15
fixes
mnajdova f862f49
pnpm dedupe
mnajdova eb71306
fix popper
mnajdova 5ce9e53
more fixes
mnajdova 0c6c4a9
docs:api
mnajdova a0d474f
lint issues
mnajdova 468335a
more fixes
mnajdova 4913bbe
more fixes
mnajdova 41cc450
fix tests
mnajdova ba47077
Merge branch 'next' into core/remove-base-ui-dependency
mnajdova 107a86e
apply changes from latest next
mnajdova 16ef35b
export utils used in MUI X
mnajdova fd3dcad
move utils to @mui/utils
mnajdova e3cf68d
prettier
mnajdova cc5aea6
fix CI
mnajdova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ module.exports = [ | |
{ pathname: '/material-ui/api/checkbox' }, | ||
{ pathname: '/material-ui/api/chip' }, | ||
{ pathname: '/material-ui/api/circular-progress' }, | ||
{ pathname: '/material-ui/api/click-away-listener' }, | ||
{ pathname: '/material-ui/api/collapse' }, | ||
{ pathname: '/material-ui/api/container' }, | ||
{ pathname: '/material-ui/api/css-baseline' }, | ||
|
@@ -76,6 +77,7 @@ module.exports = [ | |
{ pathname: '/material-ui/api/mobile-stepper' }, | ||
{ pathname: '/material-ui/api/modal' }, | ||
{ pathname: '/material-ui/api/native-select' }, | ||
{ pathname: '/material-ui/api/no-ssr' }, | ||
{ pathname: '/material-ui/api/outlined-input' }, | ||
{ pathname: '/material-ui/api/pagination' }, | ||
{ pathname: '/material-ui/api/pagination-item' }, | ||
|
@@ -86,6 +88,7 @@ module.exports = [ | |
{ pathname: '/material-ui/api/pigment-stack' }, | ||
{ pathname: '/material-ui/api/popover' }, | ||
{ pathname: '/material-ui/api/popper' }, | ||
{ pathname: '/material-ui/api/portal' }, | ||
{ pathname: '/material-ui/api/radio' }, | ||
{ pathname: '/material-ui/api/radio-group' }, | ||
{ pathname: '/material-ui/api/rating' }, | ||
|
@@ -125,6 +128,7 @@ module.exports = [ | |
{ pathname: '/material-ui/api/tab-panel' }, | ||
{ pathname: '/material-ui/api/tabs' }, | ||
{ pathname: '/material-ui/api/tab-scroll-button' }, | ||
{ pathname: '/material-ui/api/textarea-autosize' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same idea as above with https://stackoverflow.com/questions/454202/creating-a-textarea-with-auto-resize |
||
{ pathname: '/material-ui/api/text-field' }, | ||
{ pathname: '/material-ui/api/timeline' }, | ||
{ pathname: '/material-ui/api/timeline-connector' }, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './click-away-listener.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return <ApiPage descriptions={descriptions} pageContent={pageContent} />; | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context( | ||
'docs/translations/api-docs/click-away-listener', | ||
false, | ||
/\.\/click-away-listener.*.json$/, | ||
); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"props": { | ||
"children": { "type": { "name": "custom", "description": "element" }, "required": true }, | ||
"onClickAway": { "type": { "name": "func" }, "required": true }, | ||
"disableReactTree": { "type": { "name": "bool" }, "default": "false" }, | ||
"mouseEvent": { | ||
"type": { | ||
"name": "enum", | ||
"description": "'onClick'<br>| 'onMouseDown'<br>| 'onMouseUp'<br>| 'onPointerDown'<br>| 'onPointerUp'<br>| false" | ||
}, | ||
"default": "'onClick'" | ||
}, | ||
"touchEvent": { | ||
"type": { | ||
"name": "enum", | ||
"description": "'onTouchEnd'<br>| 'onTouchStart'<br>| false" | ||
}, | ||
"default": "'onTouchEnd'" | ||
} | ||
}, | ||
"name": "ClickAwayListener", | ||
"imports": [ | ||
"import ClickAwayListener from '@mui/material/ClickAwayListener';", | ||
"import { ClickAwayListener } from '@mui/material';" | ||
], | ||
"classes": [], | ||
"spread": false, | ||
"themeDefaultProps": null, | ||
"muiName": "MuiClickAwayListener", | ||
"filename": "/packages/mui-material/src/ClickAwayListener/ClickAwayListener.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/material-ui/react-click-away-listener/\">Click-Away Listener</a></li>\n<li><a href=\"/material-ui/react-menu/\">Menu</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as React from 'react'; | ||
import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './no-ssr.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return <ApiPage descriptions={descriptions} pageContent={pageContent} />; | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context('docs/translations/api-docs/no-ssr', false, /\.\/no-ssr.*.json$/); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"props": { | ||
"children": { "type": { "name": "node" } }, | ||
"defer": { "type": { "name": "bool" }, "default": "false" }, | ||
"fallback": { "type": { "name": "node" }, "default": "null" } | ||
}, | ||
"name": "NoSsr", | ||
"imports": ["import NoSsr from '@mui/material/NoSsr';", "import { NoSsr } from '@mui/material';"], | ||
"classes": [], | ||
"spread": false, | ||
"themeDefaultProps": null, | ||
"muiName": "MuiNoSsr", | ||
"filename": "/packages/mui-material/src/NoSsr/NoSsr.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/material-ui/react-no-ssr/\">No SSR</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as React from 'react'; | ||
import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './portal.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return <ApiPage descriptions={descriptions} pageContent={pageContent} />; | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context('docs/translations/api-docs/portal', false, /\.\/portal.*.json$/); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"props": { | ||
"children": { "type": { "name": "node" } }, | ||
"container": { "type": { "name": "union", "description": "HTML element<br>| func" } }, | ||
"disablePortal": { "type": { "name": "bool" }, "default": "false" } | ||
}, | ||
"name": "Portal", | ||
"imports": [ | ||
"import Portal from '@mui/material/Portal';", | ||
"import { Portal } from '@mui/material';" | ||
], | ||
"classes": [], | ||
"spread": false, | ||
"themeDefaultProps": null, | ||
"muiName": "MuiPortal", | ||
"filename": "/packages/mui-material/src/Portal/Portal.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/material-ui/react-portal/\">Portal</a></li></ul>", | ||
"cssComponent": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
import ApiPage from 'docs/src/modules/components/ApiPage'; | ||
import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; | ||
import jsonPageContent from './textarea-autosize.json'; | ||
|
||
export default function Page(props) { | ||
const { descriptions, pageContent } = props; | ||
return <ApiPage descriptions={descriptions} pageContent={pageContent} />; | ||
} | ||
|
||
Page.getInitialProps = () => { | ||
const req = require.context( | ||
'docs/translations/api-docs/textarea-autosize', | ||
false, | ||
/\.\/textarea-autosize.*.json$/, | ||
); | ||
const descriptions = mapApiPageTranslations(req); | ||
|
||
return { | ||
descriptions, | ||
pageContent: jsonPageContent, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"props": { | ||
"maxRows": { "type": { "name": "union", "description": "number<br>| string" } }, | ||
"minRows": { | ||
"type": { "name": "union", "description": "number<br>| string" }, | ||
"default": "1" | ||
} | ||
}, | ||
"name": "TextareaAutosize", | ||
"imports": [ | ||
"import TextareaAutosize from '@mui/material/TextareaAutosize';", | ||
"import { TextareaAutosize } from '@mui/material';" | ||
], | ||
"classes": [], | ||
"spread": true, | ||
"themeDefaultProps": null, | ||
"muiName": "MuiTextareaAutosize", | ||
"filename": "/packages/mui-material/src/TextareaAutosize/TextareaAutosize.tsx", | ||
"inheritance": null, | ||
"demos": "<ul><li><a href=\"/material-ui/react-textarea-autosize/\">Textarea Autosize</a></li></ul>", | ||
"cssComponent": false | ||
} |
19 changes: 19 additions & 0 deletions
19
docs/translations/api-docs/click-away-listener/click-away-listener.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"componentDescription": "Listen for click events that occur somewhere in the document, outside of the element itself.\nFor instance, if you need to hide a menu when people click anywhere else on your page.", | ||
"propDescriptions": { | ||
"children": { "description": "The wrapped element.", "requiresRef": true }, | ||
"disableReactTree": { | ||
"description": "If <code>true</code>, the React tree is ignored and only the DOM tree is considered. This prop changes how portaled elements are handled." | ||
}, | ||
"mouseEvent": { | ||
"description": "The mouse event to listen to. You can disable the listener by providing <code>false</code>." | ||
}, | ||
"onClickAway": { | ||
"description": "Callback fired when a "click away" event is detected." | ||
}, | ||
"touchEvent": { | ||
"description": "The touch event to listen to. You can disable the listener by providing <code>false</code>." | ||
} | ||
}, | ||
"classDescriptions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"componentDescription": "NoSsr purposely removes components from the subject of Server Side Rendering (SSR).\n\nThis component can be useful in a variety of situations:\n\n* Escape hatch for broken dependencies not supporting SSR.\n* Improve the time-to-first paint on the client by only rendering above the fold.\n* Reduce the rendering time on the server.\n* Under too heavy server load, you can turn on service degradation.", | ||
"propDescriptions": { | ||
"children": { "description": "You can wrap a node." }, | ||
"defer": { | ||
"description": "If <code>true</code>, the component will not only prevent server-side rendering. It will also defer the rendering of the children into a different screen frame." | ||
}, | ||
"fallback": { "description": "The fallback content to display." } | ||
}, | ||
"classDescriptions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"componentDescription": "Portals provide a first-class way to render children into a DOM node\nthat exists outside the DOM hierarchy of the parent component.", | ||
"propDescriptions": { | ||
"children": { "description": "The children to render into the <code>container</code>." }, | ||
"container": { | ||
"description": "An HTML element or function that returns one. The <code>container</code> will have the portal children appended to it.<br>You can also provide a callback, which is called in a React layout effect. This lets you set the container from a ref, and also makes server-side rendering possible.<br>By default, it uses the body of the top-level document object, so it's simply <code>document.body</code> most of the time." | ||
}, | ||
"disablePortal": { | ||
"description": "The <code>children</code> will be under the DOM hierarchy of the parent component." | ||
} | ||
}, | ||
"classDescriptions": {} | ||
} |
8 changes: 8 additions & 0 deletions
8
docs/translations/api-docs/textarea-autosize/textarea-autosize.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"componentDescription": "", | ||
"propDescriptions": { | ||
"maxRows": { "description": "Maximum number of rows to display." }, | ||
"minRows": { "description": "Minimum number of rows to display." } | ||
}, | ||
"classDescriptions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused about this. Would it mean we will have:
@mui/material/ClickAwayListener
@mui/base/ClickAwayListener
@base_ui/react/ClickAwayListener
. I mean, I imagine we need it https://stackoverflow.com/questions/32553158/detect-click-outside-react-component