-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[docs-infra] Add a feature list "component" #41484
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 11 commits into
mui:master
from
danilo-leal:add-feature-list-component
Mar 15, 2024
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ff4a2ad
add approach one: FeatureList component
danilo-leal 696be6d
add approach two: plain HTML
danilo-leal 1361e3e
add experiment page for demo
danilo-leal a0372c6
simplify FeatureList component
danilo-leal 09b5355
fix eslint ci
danilo-leal 4a7ac06
remove warning
alexfauquette a8cbe1c
Implement option 3
alexfauquette a9cb935
remove other approaches and focus go with the third
danilo-leal a864438
add instruction on the demo page
danilo-leal eaed9d2
update custom components page name
danilo-leal d329b04
Merge branch 'master' into add-feature-list-component
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
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
| 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 './custom-components.md?muiMarkdown'; | ||
|
|
||
| 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,27 @@ | ||
| # Callouts | ||
|
|
||
| <p class="description">Type of callouts.</p> | ||
|
|
||
| ## Header chips | ||
|
|
||
| {{"component": "modules/components/ComponentLinkHeader.js"}} | ||
|
|
||
| ## Feature list | ||
|
|
||
| ### Approach 1: Componentized | ||
|
|
||
| Easier to protect the styles, but worse to read and write | ||
|
|
||
| {{"component": "modules/components/FeatureList.js", "features": ["Manages modal stacking when one-at-a-time just isn't enough.", "Creates a backdrop, for disabling interaction below the modal.", "It disables scrolling of the page content while open.", "It properly manages focus; moving to the modal content, and keeping it there until the modal is closed.", "Adds the appropriate ARIA roles automatically."]}} | ||
|
|
||
| ### Approach 2: Plain HTML | ||
|
|
||
| Easier to write and read, and potentially easier to violate the styles? | ||
|
|
||
| <ul class='feature-list'> | ||
| <li>Manages modal stacking when one-at-a-time just isn't enough.</li> | ||
| <li>Creates a backdrop, for disabling interaction below the modal.est</li> | ||
| <li>It disables scrolling of the page content while open.</li> | ||
| <li>It properly manages focus; moving to the modal content, and keeping it there until the modal is closed.</li> | ||
| <li>Adds the appropriate ARIA roles automatically.</li> | ||
| </ul> | ||
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,40 @@ | ||
| import * as React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import Stack from '@mui/material/Stack'; | ||
| import Typography from '@mui/material/Typography'; | ||
| import IconImage from 'docs/src/components/icon/IconImage'; | ||
| import { styled } from '@mui/material/styles'; | ||
|
|
||
| const ListRoot = styled('ul')({ | ||
| padding: 0, | ||
| margin: 0, | ||
| marginBottom: 16, | ||
| listStyle: 'none', | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: 6, | ||
| }); | ||
|
|
||
| export default function FeatureList({ features }) { | ||
| return ( | ||
| <ListRoot> | ||
| {features.map((feature, item) => ( | ||
| <Stack | ||
| key={item} | ||
| component="li" | ||
| direction="row" | ||
| alignItems="center" | ||
| spacing={1.5} | ||
| useFlexGap | ||
| > | ||
| <IconImage name="pricing/yes" /> | ||
| <Typography color="text.secondary">{feature}</Typography> | ||
| </Stack> | ||
| ))} | ||
| </ListRoot> | ||
| ); | ||
| } | ||
|
|
||
| FeatureList.propTypes = { | ||
| features: PropTypes.string, | ||
| }; |
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.