-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Snackbar][Material You] apply md3 designs
- Loading branch information
1 parent
2f18792
commit 65d4200
Showing
9 changed files
with
218 additions
and
138 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
docs/data/material/components/snackbars/SnackbarMaterialYouPlayground.js
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,59 @@ | ||
import * as React from 'react'; | ||
import { Stack } from '@mui/material'; | ||
import { Button, SnackbarContent } from '@mui/material-next'; | ||
import MaterialYouUsageDemo from 'docs/src/modules/components/MaterialYouUsageDemo'; | ||
|
||
export default function SnackbarMaterialYouPlayground() { | ||
const actions = ( | ||
<Button | ||
size="small" | ||
color="secondary" | ||
sx={{ color: (p) => p.sys.color.inversePrimary }} | ||
> | ||
Action | ||
</Button> | ||
); | ||
|
||
const codeBlock = ` | ||
<Snackbar | ||
open={open} | ||
onClose={handleClose} | ||
message="..." | ||
action={action} | ||
/> | ||
`; | ||
|
||
const multilineMessage = ( | ||
<span> | ||
I love candy. I love cookies. | ||
<br />I love candy. I love cookies. | ||
<br />I love candy. I love cookies. | ||
</span> | ||
); | ||
|
||
const longMessage = | ||
'I love candy. I love cookies. I love cupcakes. \ | ||
I love candy. I love cookies. I love cupcakes. \ | ||
I love candy. I love cookies. I love cupcakes. '; | ||
|
||
return ( | ||
<MaterialYouUsageDemo | ||
getCodeBlock={() => codeBlock} | ||
componentName="Snackbar" | ||
renderDemo={() => { | ||
return ( | ||
<Stack spacing={2} sx={{ maxWidth: 600 }}> | ||
<SnackbarContent message="I love snacks." /> | ||
<SnackbarContent message="I love snacks." action={actions} /> | ||
|
||
<SnackbarContent message={multilineMessage} /> | ||
<SnackbarContent message={multilineMessage} action={actions} /> | ||
|
||
<SnackbarContent message={longMessage} /> | ||
<SnackbarContent message={longMessage} action={actions} /> | ||
</Stack> | ||
); | ||
}} | ||
/> | ||
); | ||
} |
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.