-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[material-ui][docs] Add Connect-related content #40848
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
Merged
danilo-leal
merged 78 commits into
mui:next
from
danilo-leal:connect-documentation-content
Apr 12, 2024
Merged
Changes from 14 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
8b7db60
add Connect-related content on the documentation
danilo-leal 8ab0f54
update content and image
danilo-leal 55d31ba
update border color on dark mode
danilo-leal 7e94a1a
iterate on the Design kits paragraph
danilo-leal 36db8ab
Merge branch 'master' into connect-documentation-content
danilo-leal 8e0ce99
add first skeleton of the documentation
danilo-leal fbffcd9
run pnpm docs:i18n
danilo-leal d2885a7
add image to the top of the page
danilo-leal 66ca88b
continue iterating on it
danilo-leal b902cc1
iterating on the existing tokens section
danilo-leal 119888c
trigger CI checks
danilo-leal 52fba0e
add the Material UI design kit docs
danilo-leal 28a3ff9
Merge branch 'master' into connect-documentation-content
danilo-leal 7c8f7f8
run docs:i18n
danilo-leal e9a8c44
reordering the pages
danilo-leal db30f41
run docs:i18n
danilo-leal 6ed171b
remove the MUI prefix from Connect
danilo-leal 7241d3b
remove markdown image element changes from this PR
danilo-leal 6073fb5
run docs:i18n
danilo-leal b8a9d49
Merge branch 'master' into connect-documentation-content
danilo-leal 917be65
Merge branch 'master' into connect-documentation-content
danilo-leal 0650865
update links to remove the "mui" prefix
danilo-leal 4422995
remove dash from "plugin"
danilo-leal 9d1ce9d
fix error regarding the muiMarkdown import
danilo-leal a0eaa96
add YouTube videos embeds for the design kits
danilo-leal bb0dcf0
update Connect images
danilo-leal b55e401
remove the new chip from the design kit page
danilo-leal 43c6070
iterating on the wording
danilo-leal c4d320d
Sam's first pass
danilo-leal 63d75a7
Merge branch 'next' into connect-documentation-content
danilo-leal 4821dd4
fix Vale brand name CI check
danilo-leal e5a6857
Merge branch 'next' into connect-documentation-content
danilo-leal 8000746
add beta chip on the nav drawer item
danilo-leal baf0238
update the Connect page description
danilo-leal 83ec809
lint: fix non-breaking space
danilo-leal 06f85dc
added getting started section
DavidCnoops cabb22d
Vale lint: non-breaking space
danilo-leal 8dbe6a2
formatting and adjustments
danilo-leal 5702773
edit the design resources page
danilo-leal 4179064
update to the design kits page
danilo-leal d22046d
Merge branch 'next' into connect-documentation-content
danilo-leal 0acbe09
Vale lint: fix non-breaking space
danilo-leal f1d2bce
iterate and fix things on the content + add images
danilo-leal 53b589c
add video about component customization
danilo-leal e0ea786
extra: fix Demo border styles
danilo-leal 7f6457a
add content about code customizations
danilo-leal 6ffb992
rerun CI checks again
danilo-leal 1199a00
rerun CI checks again
danilo-leal e549426
Sam's Connect page review
danilo-leal 3d28b19
Sam's review of the Material UI Design Kit page
danilo-leal bd6f6a6
Design Resources page review
danilo-leal 1891e88
ensure there's non-breaking space
danilo-leal 446741c
follow-up edits
danilo-leal 0198a40
update the Connect page
danilo-leal f54724a
update the Material UI for Figma page
danilo-leal 31e4bc5
update the Design resources page
danilo-leal 41a8875
slightly revise the Material UI for Figma page
danilo-leal 42f81a0
Vale lint: non-breakable space
danilo-leal 1dfc377
various changes and tweaks
DavidCnoops 53de30a
updated connect docs
DavidCnoops f2b83d9
updates to the Connect page
danilo-leal 77516db
updates to the Material UI page
danilo-leal 2bc570d
remove unused video
danilo-leal eee0ae0
compress all images
danilo-leal 33852e8
Vale lint: non-breaking space
danilo-leal e0f36ee
remove changes on the Demo component
danilo-leal 42050a3
rerun CI checks
danilo-leal ef9506f
small tweaks
DavidCnoops 27c7b4e
fix linting error
DavidCnoops dfbee60
has selector clarification + removal of last example
DavidCnoops 34b792a
fix linting error
DavidCnoops 6eac877
Connect page updates
danilo-leal c2819b5
Material UI for Figma updates
danilo-leal f891ea5
Design Resources updates
danilo-leal f41058a
additional edits
danilo-leal 6e53321
Vale lint: non-breakable space
danilo-leal b3df62e
fine-tune images
danilo-leal 7f47327
Vale lint: non-breakable space
danilo-leal 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
116 changes: 116 additions & 0 deletions
116
docs/data/material/design-resources/material-ui-for-figma/material-ui-for-figma.md
This file contains hidden or 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,116 @@ | ||
| # Material UI for Figma | ||
|
|
||
| <p class="description">Enhance the designer-developer working with Material UI collaboration.</p> | ||
|
|
||
| ## Getting started | ||
|
|
||
| Material UI for Figma consists of a representation of the React component in Figma so that designers and developers can communicate and iterate more efficiently as they work with a set of seamlessly integrated tools. | ||
|
|
||
| ### Community vs. full version | ||
|
|
||
| The Material UI design kits is available in [community (free)](https://www.figma.com/community/file/912837788133317724/material-ui-for-figma-and-mui-x) and [full (paid)](https://mui.com/store/items/figma-react/) versions. | ||
| Here's what you can expect from each one of them: | ||
|
|
||
| | | Community | Full version | | ||
| | :-------------------------------- | --------: | -----------: | | ||
| | Components without customizations | All | All | | ||
| | Components with customizations | 4 | All | | ||
| | Figma variables | - | ✅ | | ||
|
|
||
| ### How to install the full version? | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Start by extracting the `.zip` archive containing a couple of `.fig` files. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Then, you can either follow [Figma's import guide](https://help.figma.com/hc/en-us/articles/360041003114-Import-files-into-Figma) or [add it to your team library](https://help.figma.com/hc/en-us/articles/360041051154-Getting-Started-with-Team-Library). | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Theme | ||
|
|
||
| ### When I open the local variables panel, I see only 2 values; where are the rest? | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| When opening the local variables panel for the first time, you will see this: | ||
|
|
||
| <!--  --> | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| To access the rest of the props, navigate to the variable collections, similar to the code's `theme` structure. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Then, follow the steps shown in the video below: | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### How can I customize colors? | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The design kit uses variables, meaning colors can only be modified from the variables panel. | ||
| To access it, ensure you do not have any layers or frames selected, allowing you to view the global right-hand panel. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <!-- [MUI for Figma v5.14.0 - Material - Changing Colors 1080p.mov](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/cc45d58e-d5c4-4411-a051-e9a1001c8c72/MUI_for_Figma_v5.14.0_-_Material_-_Changing_Colors_1080p.mov) --> | ||
|
|
||
| ### How do I customize the typography? | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Unfortunately, variables do not yet support typography variables, but this feature is planned for the future. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Until then, changing global styles, such as the font family, requires some effort (approximately 5 minutes). | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| We have already defined everything as a style, so your only point of command is the right-hand panel. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <!-- [MUI for Figma v5.14.0 - Material - Changing Typography.mov](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0f06be08-3a7d-4089-a1d0-7916c453830c/MUI_for_Figma_v5.14.0_-_Material_-_Changing_Typography.mov) --> | ||
|
|
||
| ### Switching modes (light/dark) | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <!-- [MUI for Figma v5.14.0 - Material - Changing Modes.mov](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2c670fba-c1f0-4636-88c3-5f0d1c33bc94/MUI_for_Figma_v5.14.0_-_Material_-_Changing_Modes.mov) --> | ||
|
|
||
| ## Code sync | ||
|
|
||
| ### Do the kits output React code? | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| You can export the design tokens and component customizations to code if paired with [the MUI Connect Figma plugin](/material-ui/design-resources/mui-connect/). | ||
| Material UI for Figma has been built to be as close to the React components as possible, making it for a fluid integration with code. | ||
|
|
||
| ### How do I migrate from Design to React? | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The Material UI for Figma design kit components are as close as possible to the React components. | ||
| In practice, you will find the same names, design tokens, default values, and anything contributing to reducing the gap between the two realms. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| That said, we recommend using the design tokens as much as possible to perform component customizations, as it's easier to share the values between Figma and React. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| :::info | ||
| A "design token" is simply a variable that can be shared with the React implementation—for example, the font size pixels of the `body2` variant. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ::: | ||
|
|
||
| Learn more about the Material UI theme structure by visiting the [Theming](https://mui.com/material-ui/customization/theming/) and [Default theme viewer](https://mui.com/material-ui/customization/theming/) pages. | ||
|
|
||
| ## FAQ | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### How can I edit the master components? | ||
|
|
||
| Master components were difficult to maintain, and it required sticking to the elements available in that master instance only, so we decided to leave the master components in favor of using a plugin called [Similayer](https://www.figma.com/community/plugin/735733267883397781/Similayer). | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <!-- [141292007-d545374e-ec0b-4f5e-8873-1b4ce1a89556.mov](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/eadfa8fa-f1a8-49d8-8311-64ffc144e6ab/141292007-d545374e-ec0b-4f5e-8873-1b4ce1a89556.mov) --> | ||
|
|
||
| ### Why build "Material UI for Figma" instead of using Google's Material Design Figma file? | ||
|
|
||
| Material UI is an _independent_ React implementation of Material Design. | ||
| It fills the gaps that Google's design have with the MUI's expertise around web development best practices. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Anyone generally interested in Material Design can benefit from the Material UI for Figma library, but it is particularly great for designers who work with developers using the actual Material UI React library. | ||
| The way the components have been structured in Figma (also considering properties and variables) is meant to closely mirror what you'd experience in the code. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| You should expect to see: | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - extra components and features that aren't covered in Material Design | ||
| - the same UI output | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - the same terminology used between Figma and code for props, design tokens, etc. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Table component | ||
|
|
||
| #### How do I add a new column in the table? | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <iframe src="https://www.loom.com/embed/6dd71cc374bc4d84af35ebb75d107d38?sid=1d3a4790-4c28-433e-94ce-97dd969601dd" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="width: 100%; height: 500px;"></iframe> | ||
|
|
||
| #### How do I add new columns in the main component? | ||
|
|
||
| <!-- [MUIF-5.14-Add columns_voiceover2.mov](https://prod-files-secure.s3.us-west-2.amazonaws.com/e747f181-8f1e-4455-91f8-127e5f0b8f94/f8fefcc6-5303-4dbc-99a1-c2df358d6ab6/MUIF-5.14-Add_columns_voiceover2.mov) --> | ||
|
|
||
| ## Updates | ||
|
|
||
| ### I've received an update; how can I replace one component with another? | ||
|
|
||
| Unfortunately, Figma does not work like an npm package that we can update the dependencies of yet! | ||
| Most of the time, we don't release breaking changes in the updates. | ||
| We add new content. For a single component replacement, there are a couple of options: | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 1. Add the new version of the design kit as a library and use [the new Figma library swap feature](https://www.youtube.com/watch?v=GQ2jztKpxLk). Ensure the components have the same name in the old library and the new one for this to work properly. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 2. Observe the new component and re-apply the changes to the existing projects. This is the recommended approach when having a high number of projects. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 3. Copy-paste the new component in your existing project, temporarily rename it differently (for example, "New Button"), and re-link tokens to the New Button (using [Select Similar plugins](https://www.figma.com/community/plugin/792767780551514994/Select-Similar) shouldn't take more than 5 minutes). Having this done, you can replace the old Button with the New Button. | ||
danilo-leal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
63 changes: 63 additions & 0 deletions
63
docs/data/material/design-resources/mui-connect/mui-connect.md
This file contains hidden or 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,63 @@ | ||
| # MUI Connect plugin | ||
|
|
||
| <p class="description">A Figma plugin that lets you generate a theme from the Material UI Design kit for Figma. </p> | ||
|
|
||
| ## Introduction | ||
|
|
||
| MUI Connect is a Figma plugin that lets you generate a theme from the Material UI Design kit for Figma. | ||
| You can customize both design tokens and components, generate a theme JSON, and see your changes from an embedded Storybook instance. | ||
|
|
||
| :::warning | ||
| The plugin is in beta and doesn't currently support customization to all Material UI components. | ||
| ::: | ||
|
|
||
| <img src="/static/material-ui/design-resources/connect.png" style="width: 814px;" alt="A screenshot of Figma together with the MUI Connect plug-in running on the side, doing customziations to the Material UI Switch component." width="1628" height="400" /> | ||
|
|
||
| ## Running the plugin | ||
|
|
||
| ### Pre-requisites | ||
|
|
||
| The MUI Connect Figma plugin only currently works on the Material UI Design kit. | ||
| It doesn't support other kits, such as Joy UI, at the moment. | ||
|
|
||
| ### Basics | ||
|
|
||
| Test the plugin by starting with [the Community version](https://www.figma.com/community/file/912837788133317724/material-ui-for-figma-and-mui-x). | ||
| Then, visit the Store to get access to [the complete version](https://mui.com/r/material-ui-figma-latest/) with all of the Material UI components. | ||
|
|
||
| Once you've installed it, go to your copy of the Material UI design kit, click on the "Resources" button, go to the "Plugins" tab, and then click on "MUI Connect". | ||
|
|
||
| <img src="/static/material-ui/design-resources/connect-access.png" style="width: 814px;" alt="A screenshot of Figma showcasing the resources menu, which is where you'd go to access MUI Connect." width="1628" height="400" /> | ||
|
|
||
| <!-- The image above will be replaced for a better one once the plugin is actually live --> | ||
|
|
||
| ## Customizing design tokens | ||
|
|
||
| Design tokens consist of the styles that are defined through Figma's "local variables" and "local styles" features. | ||
|
|
||
| ### Existing tokens | ||
|
|
||
| The Material UI design kit comes fully loaded with design tokens that map out to the React library's default theme. | ||
| MUI Connect can read all of the existing tokens in the theme. | ||
|
|
||
| <img src="/static/material-ui/design-resources/connect-variables.png" style="width: 814px;" alt="A screenshot of Figma showcasing the locals variables menu, which is where all of the design tokens are stored and where you'd go to add new ones." width="1628" height="400" /> | ||
|
|
||
| To customize them, open the Local variables modal or one text style or shadow in the Local styles panel, and change their values. | ||
| Then, open the plugin and click on "Generate theme". | ||
| You should be able to see the modified tokens on the code and the Storybook preview tab. | ||
|
|
||
| ### Adding new tokens | ||
|
|
||
| Adding new tokens to the existing category of tokens supported (such as colors, shadows, typography, etc.) is also possible. | ||
| Ensure you add the new ones within the corresponding category and click "Generate theme" again to see them in the code and Storybook. | ||
|
|
||
| ## Customizing the components | ||
|
|
||
| You can also customize how a component looks and generate its theme code using MUI Connect. | ||
| Currently, the only supported Material UI components are the Button, Switch, and Typography. | ||
|
|
||
| ## Adding the theme code into your codebase | ||
|
|
||
| ## Give feedback | ||
|
|
||
| Use [the MUI Design kits GitHub repository](https://github.com/mui/mui-design-kits/issues/new/choose) to open issues about bugs or feature requests for MUI Connect. |
This file contains hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
docs/pages/material-ui/design-resources/material-ui-for-figma.js
This file contains hidden or 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,7 @@ | ||
| import * as React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import * as pageProps from 'docs/data/material/design-resources/material-ui-for-figma/material-ui-for-figma.md?@mui/markdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs {...pageProps} />; | ||
| } |
This file contains hidden or 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,7 @@ | ||
| import * as React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import * as pageProps from 'docs/data/material/design-resources/mui-connect/mui-connect.md?@mui/markdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs {...pageProps} />; | ||
| } |
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74.7 KB
docs/public/static/material-ui/design-resources/connect-variables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.