index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/grid/GridTemplateRows.tsx.preview
<Box sx={{ display: 'grid', gridTemplateRows: 'repeat(3, 1fr)' }}> <Item>1</Item> <Item>2</Item> <Item>3</Item> </Box>
3,900
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/grid/RowAndColumnGap.js
import * as React from 'react'; import PropTypes from 'prop-types'; import Box from '@mui/material/Box'; function Item(props) { const { sx, ...other } = props; return ( <Box sx={{ bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => (theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800'), border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', p: 1, borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', ...sx, }} {...other} /> ); } Item.propTypes = { /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.oneOfType([ PropTypes.arrayOf( PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool]), ), PropTypes.func, PropTypes.object, ]), }; export default function RowAndColumnGap() { return ( <div style={{ width: '100%' }}> <Box sx={{ display: 'grid', columnGap: 3, rowGap: 1, gridTemplateColumns: 'repeat(2, 1fr)', }} > <Item>1</Item> <Item>2</Item> <Item>3</Item> <Item>4</Item> </Box> </div> ); }
3,901
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/grid/RowAndColumnGap.tsx
import * as React from 'react'; import Box, { BoxProps } from '@mui/material/Box'; function Item(props: BoxProps) { const { sx, ...other } = props; return ( <Box sx={{ bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => (theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800'), border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', p: 1, borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', ...sx, }} {...other} /> ); } export default function RowAndColumnGap() { return ( <div style={{ width: '100%' }}> <Box sx={{ display: 'grid', columnGap: 3, rowGap: 1, gridTemplateColumns: 'repeat(2, 1fr)', }} > <Item>1</Item> <Item>2</Item> <Item>3</Item> <Item>4</Item> </Box> </div> ); }
3,902
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/grid/RowAndColumnGap.tsx.preview
<Box sx={{ display: 'grid', columnGap: 3, rowGap: 1, gridTemplateColumns: 'repeat(2, 1fr)', }} > <Item>1</Item> <Item>2</Item> <Item>3</Item> <Item>4</Item> </Box>
3,903
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/grid/grid.md
# CSS Grid <p class="description">Quickly manage the layout, alignment, and sizing of grid columns, navigation, components, and more with a full suite of responsive grid utilities.</p> If you are **new to or unfamiliar with grid**, you're encouraged to read this [CSS-Tricks grid](https://css-tricks.com/snippets/css/complete-guide-grid/) guide. ## Properties for the parent ### display To define a `grid` container, you must specify the `display` CSS property to have one of the values: `grid` or `inline-grid`. {{"demo": "Display.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ display: 'grid' }}>…</Box> <Box sx={{ display: 'inline-grid' }}>…</Box> ``` ### grid-template-rows The `grid-template-rows` property defines the line names and track sizing functions of the grid rows. {{"demo": "GridTemplateRows.js", "bg": true}} ### grid-template-columns The `grid-template-columns` property defines the line names and track sizing functions of the grid columns. {{"demo": "GridTemplateColumns.js", "bg": true}} ### gap The `gap: size` property specifies the gap between the different items inside the CSS grid. {{"demo": "Gap.js", "bg": true}} ### row-gap & column-gap The `row-gap` and `column-gap` CSS properties allow for specifying the row and column gaps independently. {{"demo": "RowAndColumnGap.js", "bg": true}} ### grid-template-areas The `grid-template-area` property defines a grid template by referencing the names of the grid areas which are specified with the `grid-area` property. {{"demo": "GridTemplateAreas.js", "bg": true}} ### grid-auto-columns The `grid-auto-column` property specifies the size of an implicitly-created grid column track or pattern of tracks. {{"demo": "GridAutoColumns.js", "bg": true}} On the demo above, the second non-visible column has a width of `1fr`/4 which is approximately equal to `25%`. ### grid-auto-rows The `grid-auto-rows` property specifies the size of an implicitly-created grid row track or pattern of tracks. {{"demo": "GridAutoRows.js", "bg": true}} ### grid-auto-flow The `grid-auto-flow` property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. {{"demo": "GridAutoFlow.js", "bg": true}} ## Properties for the children ### grid-column The `grid-column` property is a shorthand for `grid-column-start` + `grid-column-end`. You can see how it's used in the [grid-auto-columns example](/system/grid/#grid-auto-columns). You can either set the start and end line: ```jsx <Box sx={{ gridColumn: '1 / 3' }}>… ``` Or set the number of columns to span: ```jsx <Box sx={{ gridColumn: 'span 2' }}>… ``` ### grid-row The `grid-row` property is a shorthand for `grid-row-start` + `grid-row-end`. You can see how it's used in the [grid-auto-rows example](/system/grid/#grid-auto-rows). You can either set the start and end line: ```jsx <Box sx={{ gridRow: '1 / 3' }}>… ``` Or set the number of rows to span: ```jsx <Box sx={{ gridRow: 'span 2' }}>… ``` ### grid-area The `grid-area` property allows you to give an item a name so that it can be referenced by a template created with the `grid-template-areas` property. You can see how it's used in the [grid-template-area example](/system/grid/#grid-template-areas). ```jsx <Box sx={{ gridArea: 'header' }}>… ``` ## API ```js import { grid } from '@mui/system'; ``` | Import name | Prop | CSS property | Theme key | | :-------------------- | :-------------------- | :---------------------- | :-------- | | `gap` | `gap` | `gap` | none | | `columnGap` | `columnGap` | `column-gap` | none | | `rowGap` | `rowGap` | `row-gap` | none | | `gridColumn` | `gridColumn` | `grid-column` | none | | `gridRow` | `gridRow` | `grid-row` | none | | `gridAutoFlow` | `gridAutoFlow` | `grid-auto-flow` | none | | `gridAutoColumns` | `gridAutoColumns` | `grid-auto-columns` | none | | `gridAutoRows` | `gridAutoRows` | `grid-auto-rows` | none | | `gridTemplateColumns` | `gridTemplateColumns` | `grid-template-columns` | none | | `gridTemplateRows` | `gridTemplateRows` | `grid-template-rows` | none | | `gridTemplateAreas` | `gridTemplateAreas` | `grid-template-areas` | none | | `gridArea` | `gridArea` | `grid-area` | none |
3,904
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/palette/BackgroundColor.js
import * as React from 'react'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; export default function BackgroundColor() { return ( <Grid container spacing={1}> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'primary.main', color: 'primary.contrastText', p: 2 }}> primary.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'secondary.main', color: 'secondary.contrastText', p: 2, }} > secondary.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'error.main', color: 'error.contrastText', p: 2 }}> error.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'warning.main', color: 'warning.contrastText', p: 2 }}> warning.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'info.main', color: 'info.contrastText', p: 2 }}> info.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'success.main', color: 'success.contrastText', p: 2 }}> success.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'text.primary', color: 'background.paper', p: 2 }}> text.primary </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'text.secondary', color: 'background.paper', p: 2 }}> text.secondary </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'text.disabled', color: 'background.paper', p: 2 }}> text.disabled </Box> </Grid> </Grid> ); }
3,905
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/palette/BackgroundColor.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; export default function BackgroundColor() { return ( <Grid container spacing={1}> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'primary.main', color: 'primary.contrastText', p: 2 }}> primary.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'secondary.main', color: 'secondary.contrastText', p: 2, }} > secondary.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'error.main', color: 'error.contrastText', p: 2 }}> error.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'warning.main', color: 'warning.contrastText', p: 2 }}> warning.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'info.main', color: 'info.contrastText', p: 2 }}> info.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'success.main', color: 'success.contrastText', p: 2 }}> success.main </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'text.primary', color: 'background.paper', p: 2 }}> text.primary </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'text.secondary', color: 'background.paper', p: 2 }}> text.secondary </Box> </Grid> <Grid item xs={12} sm={4}> <Box sx={{ bgcolor: 'text.disabled', color: 'background.paper', p: 2 }}> text.disabled </Box> </Grid> </Grid> ); }
3,906
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/palette/Color.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function Color() { return ( <Typography component="div" variant="body1"> <Box sx={{ color: 'primary.main' }}>primary.main</Box> <Box sx={{ color: 'secondary.main' }}>secondary.main</Box> <Box sx={{ color: 'error.main' }}>error.main</Box> <Box sx={{ color: 'warning.main' }}>warning.main</Box> <Box sx={{ color: 'info.main' }}>info.main</Box> <Box sx={{ color: 'success.main' }}>success.main</Box> <Box sx={{ color: 'text.primary' }}>text.primary</Box> <Box sx={{ color: 'text.secondary' }}>text.secondary</Box> <Box sx={{ color: 'text.disabled' }}>text.disabled</Box> </Typography> ); }
3,907
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/palette/Color.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function Color() { return ( <Typography component="div" variant="body1"> <Box sx={{ color: 'primary.main' }}>primary.main</Box> <Box sx={{ color: 'secondary.main' }}>secondary.main</Box> <Box sx={{ color: 'error.main' }}>error.main</Box> <Box sx={{ color: 'warning.main' }}>warning.main</Box> <Box sx={{ color: 'info.main' }}>info.main</Box> <Box sx={{ color: 'success.main' }}>success.main</Box> <Box sx={{ color: 'text.primary' }}>text.primary</Box> <Box sx={{ color: 'text.secondary' }}>text.secondary</Box> <Box sx={{ color: 'text.disabled' }}>text.disabled</Box> </Typography> ); }
3,908
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/palette/Color.tsx.preview
<Typography component="div" variant="body1"> <Box sx={{ color: 'primary.main' }}>primary.main</Box> <Box sx={{ color: 'secondary.main' }}>secondary.main</Box> <Box sx={{ color: 'error.main' }}>error.main</Box> <Box sx={{ color: 'warning.main' }}>warning.main</Box> <Box sx={{ color: 'info.main' }}>info.main</Box> <Box sx={{ color: 'success.main' }}>success.main</Box> <Box sx={{ color: 'text.primary' }}>text.primary</Box> <Box sx={{ color: 'text.secondary' }}>text.secondary</Box> <Box sx={{ color: 'text.disabled' }}>text.disabled</Box> </Typography>
3,909
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/palette/palette.md
# Palette <p class="description">Convey meaning through color with a handful of color utility classes. Includes support for styling links with hover states, too.</p> ## Color {{"demo": "Color.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ color: 'primary.main' }}>… <Box sx={{ color: 'secondary.main' }}>… <Box sx={{ color: 'error.main' }}>… <Box sx={{ color: 'warning.main' }}>… <Box sx={{ color: 'info.main' }}>… <Box sx={{ color: 'success.main' }}>… <Box sx={{ color: 'text.primary' }}>… <Box sx={{ color: 'text.secondary' }}>… <Box sx={{ color: 'text.disabled' }}>… ``` ## Background color {{"demo": "BackgroundColor.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ bgcolor: 'primary.main' }}>… <Box sx={{ bgcolor: 'secondary.main' }}>… <Box sx={{ bgcolor: 'error.main' }}>… <Box sx={{ bgcolor: 'warning.main' }}>… <Box sx={{ bgcolor: 'info.main' }}>… <Box sx={{ bgcolor: 'success.main' }}>… <Box sx={{ bgcolor: 'text.primary' }}>… <Box sx={{ bgcolor: 'text.secondary' }}>… <Box sx={{ bgcolor: 'text.disabled' }}>… ``` ## API ```js import { palette } from '@mui/system'; ``` | Import name | Prop | CSS property | Theme key | | :---------- | :-------- | :---------------- | :--------------------------------------------------------------------------- | | `color` | `color` | `color` | [`palette`](/material-ui/customization/default-theme/?expand-path=$.palette) | | `bgcolor` | `bgcolor` | `backgroundColor` | [`palette`](/material-ui/customization/default-theme/?expand-path=$.palette) |
3,910
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/positions/ZIndex.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function ZIndex() { return ( <Typography component="div" variant="body1" style={{ height: 100, width: '100%', position: 'relative', }} > <Box sx={{ bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.600', color: (theme) => (theme.palette.mode === 'dark' ? 'grey.300' : 'grey.50'), border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', p: 2, borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', position: 'absolute', top: 40, left: '40%', zIndex: 'tooltip', }} > z-index tooltip </Box> <Box sx={{ bgcolor: (theme) => (theme.palette.mode === 'dark' ? 'grey.800' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', p: 2, borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', position: 'absolute', top: 0, left: '43%', zIndex: 'modal', }} > z-index modal </Box> </Typography> ); }
3,911
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/positions/ZIndex.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function ZIndex() { return ( <Typography component="div" variant="body1" style={{ height: 100, width: '100%', position: 'relative', }} > <Box sx={{ bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.600', color: (theme) => (theme.palette.mode === 'dark' ? 'grey.300' : 'grey.50'), border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', p: 2, borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', position: 'absolute', top: 40, left: '40%', zIndex: 'tooltip', }} > z-index tooltip </Box> <Box sx={{ bgcolor: (theme) => (theme.palette.mode === 'dark' ? 'grey.800' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', p: 2, borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', position: 'absolute', top: 0, left: '43%', zIndex: 'modal', }} > z-index modal </Box> </Typography> ); }
3,912
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/positions/positions.md
# Positions <p class="description">Use these shorthand utilities for quickly configuring the position of an element.</p> ## z-index {{"demo": "ZIndex.js", "defaultCodeOpen": false, "bg": true}} ```jsx <Box sx={{ zIndex: 'tooltip' }}> <Box sx={{ zIndex: 'modal' }}> ``` ## API ```js import { positions } from '@mui/system'; ``` | Import name | Prop | CSS property | Theme key | | :---------- | :--------- | :----------- | :------------------------------------------------------------------------- | | `position` | `position` | `position` | none | | `zIndex` | `zIndex` | `z-index` | [`zIndex`](/material-ui/customization/default-theme/?expand-path=$.zIndex) | | `top` | `top` | `top` | none | | `right` | `right` | `right` | none | | `bottom` | `bottom` | `bottom` | none | | `left` | `left` | `left` | none |
3,913
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/properties/properties.md
# Properties <p class="description">This API page lists all the custom MUI System properties, how they are linked with the theme, and which CSS properties they compute.</p> While this page documents the custom properties, MUI System was designed to be a superset of CSS, so all other regular CSS properties and selectors are supported too. ## Properties reference table Note that this table only lists custom properties. All other regular CSS properties and selectors are supported too. You can check out the [legend](/system/properties/#legend) below. | System key(s) | CSS property/properties | System style function | Theme mapping | | :-------------------- | :------------------------------------------------------------------------------------------- | :----------------------------------------------------------- | :-------------------------------------------------------------------------------------------------- | | `border` | `border` | [`border`](/system/borders/#border) | `${value}px solid` | | `borderBottom` | `border-bottom` | [`borderBottom`](/system/borders/#border) | `${value}px solid` | | `borderColor` | `border-color` | [`borderColor`](/system/borders/#border-color) | [`theme.palette[value]`](/material-ui/customization/default-theme/?expand-path=$.palette) | | `borderLeft` | `border-left` | [`borderLeft`](/system/borders/#border) | `${value}px solid` | | `borderRadius` | `border-radius` | [`borderRadius`](/system/borders/#border-radius) | [`theme.shape.borderRadius * value`](/material-ui/customization/default-theme/?expand-path=$.shape) | | `borderRight` | `border-right` | [`borderRight`](/system/borders/#border) | `${value}px solid` | | `borderTop` | `border-top` | [`borderTop`](/system/borders/#border) | `${value}px solid` | | `boxShadow` | `box-shadow` | [`boxShadow`](/system/shadows/) | `theme.shadows[value]` | | `displayPrint` | `display` | [`displayPrint`](/system/display/#display-in-print) | none | | `display` | `display` | [`displayRaw`](/system/display/) | none | | `alignContent` | `align-content` | [`alignContent`](/system/flexbox/#align-content) | none | | `alignItems` | `align-items` | [`alignItems`](/system/flexbox/#align-items) | none | | `alignSelf` | `align-self` | [`alignSelf`](/system/flexbox/#align-self) | none | | `flex` | `flex` | [`flex`](/system/flexbox/) | none | | `flexDirection` | `flex-direction` | [`flexDirection`](/system/flexbox/#flex-direction) | none | | `flexGrow` | `flex-grow` | [`flexGrow`](/system/flexbox/#flex-grow) | none | | `flexShrink` | `flex-shrink` | [`flexShrink`](/system/flexbox/#flex-shrink) | none | | `flexWrap` | `flex-wrap` | [`flexWrap`](/system/flexbox/#flex-wrap) | none | | `justifyContent` | `justify-content` | [`justifyContent`](/system/flexbox/#justify-content) | none | | `order` | `order` | [`order`](/system/flexbox/#order) | none | | `gap` | `gap` | [`gap`](/system/grid/#gap) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `columnGap` | `column-gap` | [`columnGap`](/system/grid/#row-gap-amp-column-gap) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `rowGap` | `row-gap` | [`rowGap`](/system/grid/#row-gap-amp-column-gap) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `gridColumn` | `grid-column` | [`gridColumn`](/system/grid/#grid-column) | none | | `gridRow` | `grid-row` | [`gridRow`](/system/grid/#grid-row) | none | | `gridAutoFlow` | `grid-auto-flow` | [`gridAutoFlow`](/system/grid/#grid-auto-flow) | none | | `gridAutoColumns` | `grid-auto-columns` | [`gridAutoColumns`](/system/grid/#grid-auto-columns) | none | | `gridAutoRows` | `grid-auto-rows` | [`gridAutoRows`](/system/grid/#grid-auto-rows) | none | | `gridTemplateColumns` | `grid-template-columns` | [`gridTemplateColumns`](/system/grid/#grid-template-columns) | none | | `gridTemplateRows` | `grid-template-rows` | [`gridTemplateRows`](/system/grid/#grid-template-rows) | none | | `gridTemplateAreas` | `grid-template-areas` | [`gridTemplateAreas`](/system/grid/#grid-template-areas) | none | | `gridArea` | `grid-area` | [`gridArea`](/system/grid/#grid-area) | none | | `bgcolor` | `background-color` | [`bgcolor`](/system/palette/#background-color) | [`theme.palette[value]`](/material-ui/customization/default-theme/?expand-path=$.palette) | | `color` | `color` | [`color`](/system/palette/#color) | [`theme.palette[value]`](/material-ui/customization/default-theme/?expand-path=$.palette) | | `bottom` | `bottom` | [`bottom`](/system/positions/) | none | | `left` | `left` | [`left`](/system/positions/) | none | | `position` | `position` | [`position`](/system/positions/) | none | | `right` | `right` | [`right`](/system/positions/) | none | | `top` | `top` | [`top`](/system/positions/) | none | | `zIndex` | `z-index` | [`zIndex`](/system/positions/#z-index) | [`theme.zIndex[value]`](/material-ui/customization/default-theme/?expand-path=$.zIndex) | | `height` | `height` | [`height`](/system/sizing/#height) | none | | `maxHeight` | `max-height` | [`maxHeight`](/system/sizing/) | none | | `maxWidth` | `max-width` | [`maxWidth`](/system/sizing/) | none | | `minHeight` | `min-height` | [`minHeight`](/system/sizing/) | none | | `minWidth` | `min-width` | [`minWidth`](/system/sizing/) | none | | `width` | `width` | [`width`](/system/sizing/#width) | none | | `boxSizing` | `box-sizing` | [`boxSizing`](/system/sizing/) | none | | `m`, `margin` | `margin` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `mb`, `marginBottom` | `margin-bottom` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `ml`, `marginLeft` | `margin-left` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `mr`, `marginRight` | `margin-right` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `mt`, `marginTop` | `margin-top` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `mx`, `marginX` | `margin-left`, `margin-right` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `my`, `marginY` | `margin-top`, `margin-bottom` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `marginInline` | `margin-inline` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `marginInlineStart` | `margin-inline-start` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `marginInlineEnd` | `margin-inline-end` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `marginBlock` | `margin-block` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `marginBlockStart` | `margin-block-start` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `marginBlockEnd` | `margin-block-end` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `p`, `padding` | `padding` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `pb`, `paddingBottom` | `padding-bottom` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `pl`, `paddingLeft` | `padding-left` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `pr`, `paddingRight` | `padding-right` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `pt`, `paddingTop` | `padding-top` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `px`, `paddingX` | `padding-left`, `padding-right` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `py`, `paddingY` | `padding-top`, `padding-bottom` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `paddingInline` | `padding-inline` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `paddingInlineStart` | `padding-inline-start` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `paddingInlineEnd` | `padding-inline-end` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `paddingBlock` | `padding-block` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `paddingBlockStart` | `padding-block-start` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `paddingBlockEnd` | `padding-block-end` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `typography` | `font-family`, `font-weight`, `font-size`, `line-height`, `letter-spacing`, `text-transform` | [`typography`](/system/typography/#variant) | [`theme.typography[value]`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontFamily` | `font-family` | [`fontFamily`](/system/typography/#font-family) | [`theme.typography[value]`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontSize` | `font-size` | [`fontSize`](/system/typography/#font-size) | [`theme.typography[value]`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontStyle` | `font-style` | [`fontStyle`](/system/typography/#font-style) | [`theme.typography[value]`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontWeight` | `font-weight` | [`fontWeight`](/system/typography/#font-weight) | [`theme.typography[value]`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `letterSpacing` | `letter-spacing` | [`letterSpacing`](/system/typography/#letter-spacing) | [`theme.typography[value]`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `lineHeight` | `line-height` | [`lineHeight`](/system/typography/#line-height) | [`theme.typography[value]`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `textAlign` | `text-align` | [`textAlign`](/system/typography/#text-alignment) | none | ## Legend Let's take one row from [the table above](#properties-reference-table), for example: | System key(s) | CSS property/properties | System style function | Theme mapping | | :------------------- | :---------------------- | :---------------------------- | :---------------------------------------------------------------------------------------- | | `mb`, `marginBottom` | `margin-bottom` | [`spacing`](/system/spacing/) | [`theme.spacing(value)`](/material-ui/customization/default-theme/?expand-path=$.spacing) | <br /> and detail each column: - **System keys**. The column lists the key(s) by which you can use this property with the `sx` prop (or as a system function). ```jsx <Button sx={{ mb: 3 }}> // or <Box mb={3}> // or <Box marginBottom={3}> ``` - **CSS properties**. The column describes which CSS property will be generated when this system property is used. ```css .my-class { margin-bottom: Xpx; } ``` - **System style function**. The column lists the function which generates the properties shown in the other columns, as a reference in case you want to add this functionality to your custom components. The functions can be imported from `@mui/system`. You can see an example of using the style functions on the [Custom components page](/system/getting-started/custom-components/#using-standalone-system-utilities). The content links to the documentation page where this properties are described; in this example, the [spacing](/system/spacing/) page. - **Theme mapping**. Lastly, the column tells you how this property is wired with the theme – with this example, whatever value you provide will be used as input to the `theme.spacing` helper. Let's take a look at an example: ```jsx <Button sx={{ mb: 3 }} /> // is equivalent to <Button sx={{ marginBottom: theme => theme.spacing(3)}} /> ``` As the default theme spacing is 8px, this will result in the following CSS class: ```css .my-class { margin-bottom: 24px; } ```
3,914
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/screen-readers/VisuallyHiddenUsage.js
import * as React from 'react'; import Link from '@mui/material/Link'; import Box from '@mui/material/Box'; import { visuallyHidden } from '@mui/utils'; export default function VisuallyHiddenUsage() { return ( <Link href="#foo"> Read more {/* always visually hidden because the parent is focusable element */} <Box sx={visuallyHidden}>about how to visually hide elements</Box> </Link> ); }
3,915
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/screen-readers/VisuallyHiddenUsage.tsx
import * as React from 'react'; import Link from '@mui/material/Link'; import Box from '@mui/material/Box'; import { visuallyHidden } from '@mui/utils'; export default function VisuallyHiddenUsage() { return ( <Link href="#foo"> Read more {/* always visually hidden because the parent is focusable element */} <Box sx={visuallyHidden}>about how to visually hide elements</Box> </Link> ); }
3,916
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/screen-readers/VisuallyHiddenUsage.tsx.preview
<Link href="#foo"> Read more {/* always visually hidden because the parent is focusable element */} <Box sx={visuallyHidden}>about how to visually hide elements</Box> </Link>
3,917
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/screen-readers/screen-readers.md
# Screen readers <p class="description">Collection of utilities for improving accessibility with screen readers.</p> ## Visually hidden elements The visually hidden style utility provides a common mechanism for hidings elements visually, but making them available for assistive technology. It's a simple style object of type `React.CSSProperties`. {{"demo": "VisuallyHiddenUsage.js", "defaultCodeOpen": true}} If you don't have a strict CSP policy in place, you can also do: ```jsx import { visuallyHidden } from '@mui/utils'; <div style={visuallyHidden}>about how to visually hide elements</div>; ```
3,918
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/shadows/ShadowsDemo.js
import * as React from 'react'; import Grid from '@mui/material/Grid'; import Box from '@mui/material/Box'; export default function ShadowsDemo() { return ( <Grid container> <Box sx={{ boxShadow: 0, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 0 </Box> <Box sx={{ boxShadow: 1, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 1 </Box> <Box sx={{ boxShadow: 2, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 2 </Box> <Box sx={{ boxShadow: 3, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 3 </Box> </Grid> ); }
3,919
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/shadows/ShadowsDemo.tsx
import * as React from 'react'; import Grid from '@mui/material/Grid'; import Box from '@mui/material/Box'; export default function ShadowsDemo() { return ( <Grid container> <Box sx={{ boxShadow: 0, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 0 </Box> <Box sx={{ boxShadow: 1, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 1 </Box> <Box sx={{ boxShadow: 2, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 2 </Box> <Box sx={{ boxShadow: 3, width: '8rem', height: '5rem', bgcolor: (theme) => (theme.palette.mode === 'dark' ? '#101010' : '#fff'), color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', p: 1, m: 1, borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > boxShadow: 3 </Box> </Grid> ); }
3,920
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/shadows/shadows.md
# Shadows <p class="description">Add or remove shadows to elements with box-shadow utilities.</p> ## Example The helpers allow you to control relative depth, or distance, between two surfaces along the z-axis. By default, there are 25 elevation levels. {{"demo": "ShadowsDemo.js", "defaultCodeOpen": false, "bg": true}} ```jsx <Box sx={{ boxShadow: 0 }}>… <Box sx={{ boxShadow: 1 }}>… <Box sx={{ boxShadow: 2 }}>… <Box sx={{ boxShadow: 3 }}>… ``` ## API ```js import { shadows } from '@mui/system'; ``` | Import name | Prop | CSS property | Theme key | | :---------- | :---------- | :----------- | :-------- | | `boxShadow` | `boxShadow` | `box-shadow` | `shadows` |
3,921
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/sizing/Height.js
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Height() { return ( <Box sx={{ height: 100, width: '100%' }}> <Box sx={{ height: '25%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 25% </Box> <Box sx={{ height: '50%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 50% </Box> <Box sx={{ height: '75%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 75% </Box> <Box sx={{ height: '100%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 100% </Box> </Box> ); }
3,922
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/sizing/Height.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Height() { return ( <Box sx={{ height: 100, width: '100%' }}> <Box sx={{ height: '25%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 25% </Box> <Box sx={{ height: '50%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 50% </Box> <Box sx={{ height: '75%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 75% </Box> <Box sx={{ height: '100%', width: 120, display: 'inline-block', p: 1, mx: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Height 100% </Box> </Box> ); }
3,923
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/sizing/Values.js
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Values() { return ( <Box sx={{ width: '100%' }}> <Box sx={{ width: 1 / 4, p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 1/4 </Box> <Box sx={{ width: 300, p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 300 </Box> <Box sx={{ width: '75%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 75% </Box> <Box sx={{ width: 1, p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 1 </Box> </Box> ); }
3,924
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/sizing/Values.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Values() { return ( <Box sx={{ width: '100%' }}> <Box sx={{ width: 1 / 4, p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 1/4 </Box> <Box sx={{ width: 300, p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 300 </Box> <Box sx={{ width: '75%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 75% </Box> <Box sx={{ width: 1, p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 1 </Box> </Box> ); }
3,925
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/sizing/Width.js
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Width() { return ( <Box sx={{ width: '100%' }}> <Box sx={{ width: '25%', p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 25% </Box> <Box sx={{ width: '50%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 50% </Box> <Box sx={{ width: '75%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 75% </Box> <Box sx={{ width: '100%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 100% </Box> <Box sx={{ width: 'auto', p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width auto </Box> </Box> ); }
3,926
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/sizing/Width.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Width() { return ( <Box sx={{ width: '100%' }}> <Box sx={{ width: '25%', p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 25% </Box> <Box sx={{ width: '50%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 50% </Box> <Box sx={{ width: '75%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 75% </Box> <Box sx={{ width: '100%', p: 1, my: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width 100% </Box> <Box sx={{ width: 'auto', p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.100', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', textAlign: 'center', }} > Width auto </Box> </Box> ); }
3,927
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/sizing/sizing.md
# Sizing <p class="description">Easily make an element as wide or as tall (relative to its parent) with the width and height utilities.</p> ## Supported values The sizing properties: `width`, `height`, `minHeight`, `maxHeight`, `minWidth`, and `maxWidth` are using the following custom transform function for the value: ```js function transform(value) { return value <= 1 && value !== 0 ? `${value * 100}%` : value; } ``` If the value is between (0, 1], it's converted to percent. Otherwise, it is directly set on the CSS property. {{"demo": "Values.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ width: 1/4 }}> // Equivalent to width: '25%' <Box sx={{ width: 300 }}> // Numbers are converted to pixel values. <Box sx={{ width: '75%' }}> // String values are used as raw CSS. <Box sx={{ width: 1 }}> // 100% ``` ## Width {{"demo": "Width.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ width: '25%' }}>… <Box sx={{ width: '50%' }}>… <Box sx={{ width: '75%' }}>… <Box sx={{ width: '100%' }}>… <Box sx={{ width: 'auto' }}>… ``` ### Max-width The max-width property allows setting a constraint on your breakpoints. In this example, the value resolves to [`theme.breakpoints.values.md`](/material-ui/customization/default-theme/?expand-path=$.breakpoints.values). ```jsx <Box sx={{ maxWidth: 'md' }}>… ``` ## Height {{"demo": "Height.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ height: '25%' }}>… <Box sx={{ height: '50%' }}>… <Box sx={{ height: '75%' }}>… <Box sx={{ height: '100%' }}>… ``` ## API ```js import { sizing } from '@mui/system'; ``` | Import name | Prop | CSS property | Theme key | | :---------- | :---------- | :----------- | :------------------------------------------------------------------------------------------------------- | | `width` | `width` | `width` | none | | `maxWidth` | `maxWidth` | `max-width` | [`theme.breakpoints.values`](/material-ui/customization/default-theme/?expand-path=$.breakpoints.values) | | `minWidth` | `minWidth` | `min-width` | none | | `height` | `height` | `height` | none | | `maxHeight` | `maxHeight` | `max-height` | none | | `minHeight` | `minHeight` | `min-height` | none | | `boxSizing` | `boxSizing` | `box-sizing` | none |
3,928
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/spacing/HorizontalCentering.js
import * as React from 'react'; import Box from '@mui/material/Box'; export default function HorizontalCentering() { return ( <div> <Box sx={{ mx: 'auto', width: 200, p: 1, m: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > Centered element </Box> </div> ); }
3,929
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/spacing/HorizontalCentering.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; export default function HorizontalCentering() { return ( <div> <Box sx={{ mx: 'auto', width: 200, p: 1, m: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, textAlign: 'center', fontSize: '0.875rem', fontWeight: '700', }} > Centered element </Box> </div> ); }
3,930
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/spacing/SpacingDemo.js
import * as React from 'react'; import Box from '@mui/material/Box'; export default function SpacingDemo() { return ( <div> <Box sx={{ p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', }} > p: 1 </Box> <Box sx={{ m: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', }} > m: 1 </Box> <Box sx={{ p: 2, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', }} > p: 2 </Box> </div> ); }
3,931
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/spacing/SpacingDemo.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; export default function SpacingDemo() { return ( <div> <Box sx={{ p: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', }} > p: 1 </Box> <Box sx={{ m: 1, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', }} > m: 1 </Box> <Box sx={{ p: 2, bgcolor: (theme) => theme.palette.mode === 'dark' ? '#101010' : 'grey.50', color: (theme) => theme.palette.mode === 'dark' ? 'grey.300' : 'grey.800', border: '1px solid', borderColor: (theme) => theme.palette.mode === 'dark' ? 'grey.800' : 'grey.300', borderRadius: 2, fontSize: '0.875rem', fontWeight: '700', }} > p: 2 </Box> </div> ); }
3,932
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/spacing/spacing.md
# Spacing <p class="description">A wide range of shorthand responsive margin and padding utility classes to modify an element's appearance.</p> ## Notation The space utility converts shorthand margin and padding props to margin and padding CSS declarations. The props are named using the format `{property}{sides}`. Where _property_ is one of: - `m` - for classes that set _margin_ - `p` - for classes that set _padding_ Where _sides_ is one of: - `t` - for classes that set _margin-top_ or _padding-top_ - `b` - for classes that set _margin-bottom_ or _padding-bottom_ - `l` - for classes that set _margin-left_ or _padding-left_ - `r` - for classes that set _margin-right_ or _padding-right_ - `x` - for classes that set both _\*-left_ and _\*-right_ - `y` - for classes that set both _\*-top_ and _\*-bottom_ - blank - for classes that set a margin or padding on all 4 sides of the element ## Transformation Depending on the input and the theme configuration, the following transformation is applied: - input: `number` & theme: `number`: the prop value is multiplied by the theme value. ```jsx const theme = { spacing: 8, } <Box sx={{ m: -2 }} /> // margin: -16px; <Box sx={{ m: 0 }} /> // margin: 0px; <Box sx={{ m: 0.5 }} /> // margin: 4px; <Box sx={{ m: 2 }} /> // margin: 16px; ``` - input: `number` & theme: `array`: the prop value is used as the array index. ```jsx const theme = { spacing: [0, 2, 3, 5, 8], } <Box sx={{ m: -2 }} /> // margin: -3px; <Box sx={{ m: 0 }} /> // margin: 0px; <Box sx={{ m: 2 }} /> // margin: 3px; ``` - input: `number` & theme: `function`: the function is called with the prop value. ```jsx const theme = { spacing: value => value * 2, } <Box sx={{ m: 0 }} /> // margin: 0px; <Box sx={{ m: 2 }} /> // margin: 4px; ``` - input: `string`: the prop value is passed as raw CSS value. ```jsx <Box sx={{ m: '2rem' }} /> // margin: 2rem; <Box sx={{ mx: 'auto' }} /> // margin-left: auto; margin-right: auto; ``` ## Example {{"demo": "SpacingDemo.js", "defaultCodeOpen": false, "bg": true}} ```jsx <Box sx={{ p: 1 }}>… <Box sx={{ m: 1 }}>… <Box sx={{ p: 2 }}>… ``` ## Horizontal centering The CSS flex and grid display properties are often used to align elements at the center. However, you can also use `margin-left: auto;`, `margin-right: auto;`, and a width for horizontally centering: {{"demo": "HorizontalCentering.js", "defaultCodeOpen": false, "bg": true}} ```jsx <Box sx={{ mx: 'auto', width: 200 }}>… ``` ## API ```js import { spacing } from '@mui/system'; ``` | Import name | Prop | CSS property | Theme key | | :---------- | :--- | :------------------------------ | :--------------------------------------------------------------------------- | | `spacing` | `m` | `margin` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `mt` | `margin-top` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `mr` | `margin-right` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `mb` | `margin-bottom` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `ml` | `margin-left` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `mx` | `margin-left`, `margin-right` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `my` | `margin-top`, `margin-bottom` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `p` | `padding` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `pt` | `padding-top` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `pr` | `padding-right` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `pb` | `padding-bottom` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `pl` | `padding-left` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `px` | `padding-left`, `padding-right` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | | `spacing` | `py` | `padding-top`, `padding-bottom` | [`spacing`](/material-ui/customization/default-theme/?expand-path=$.spacing) | _Some people find the prop shorthand confusing, you can use the full version if you prefer:_ ```diff -<Box sx={{ pt: 2 }} /> +<Box sx={{ paddingTop: 2 }} /> ``` ```diff -<Box sx={{ px: 2 }} /> +<Box sx={{ paddingX: 2 }} /> ```
3,933
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/BasicUsage.js
import * as React from 'react'; import { styled } from '@mui/system'; const MyComponent = styled('div')({ color: 'darkslategray', backgroundColor: 'aliceblue', padding: 8, borderRadius: 4, }); export default function BasicUsage() { return <MyComponent>Styled div</MyComponent>; }
3,934
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/BasicUsage.tsx
import * as React from 'react'; import { styled } from '@mui/system'; const MyComponent = styled('div')({ color: 'darkslategray', backgroundColor: 'aliceblue', padding: 8, borderRadius: 4, }); export default function BasicUsage() { return <MyComponent>Styled div</MyComponent>; }
3,935
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/BasicUsage.tsx.preview
<MyComponent>Styled div</MyComponent>
3,936
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/ThemeUsage.js
import * as React from 'react'; import { styled, createTheme, ThemeProvider } from '@mui/system'; const customTheme = createTheme({ palette: { primary: { main: '#1976d2', contrastText: 'white', }, }, }); const MyThemeComponent = styled('div')(({ theme }) => ({ color: theme.palette.primary.contrastText, backgroundColor: theme.palette.primary.main, padding: theme.spacing(1), borderRadius: theme.shape.borderRadius, })); export default function ThemeUsage() { return ( <ThemeProvider theme={customTheme}> <MyThemeComponent>Styled div with theme</MyThemeComponent> </ThemeProvider> ); }
3,937
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/ThemeUsage.tsx
import * as React from 'react'; import { styled, createTheme, ThemeProvider } from '@mui/system'; const customTheme = createTheme({ palette: { primary: { main: '#1976d2', contrastText: 'white', }, }, }); const MyThemeComponent = styled('div')(({ theme }) => ({ color: theme.palette.primary.contrastText, backgroundColor: theme.palette.primary.main, padding: theme.spacing(1), borderRadius: theme.shape.borderRadius, })); export default function ThemeUsage() { return ( <ThemeProvider theme={customTheme}> <MyThemeComponent>Styled div with theme</MyThemeComponent> </ThemeProvider> ); }
3,938
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/ThemeUsage.tsx.preview
<ThemeProvider theme={customTheme}> <MyThemeComponent>Styled div with theme</MyThemeComponent> </ThemeProvider>
3,939
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/UsingOptions.js
import * as React from 'react'; import { styled, createTheme, ThemeProvider } from '@mui/system'; const customTheme = createTheme({ components: { MyThemeComponent: { styleOverrides: { root: { color: 'darkslategray', }, primary: { color: 'darkblue', }, secondary: { color: 'darkred', backgroundColor: 'pink', }, }, variants: [ { props: { variant: 'dashed', color: 'primary' }, style: { border: '1px dashed darkblue', }, }, { props: { variant: 'dashed', color: 'secondary' }, style: { border: '1px dashed darkred', }, }, ], }, }, }); const MyThemeComponent = styled('div', { // Configure which props should be forwarded on DOM shouldForwardProp: (prop) => prop !== 'color' && prop !== 'variant' && prop !== 'sx', name: 'MyThemeComponent', slot: 'Root', // We are specifying here how the styleOverrides are being applied based on props overridesResolver: (props, styles) => [ styles.root, props.color === 'primary' && styles.primary, props.color === 'secondary' && styles.secondary, ], })(({ theme }) => ({ backgroundColor: 'aliceblue', padding: theme.spacing(1), })); export default function UsingOptions() { return ( <ThemeProvider theme={customTheme}> <MyThemeComponent sx={{ m: 1 }} color="primary" variant="dashed"> Primary </MyThemeComponent> <MyThemeComponent sx={{ m: 1 }} color="secondary"> Secondary </MyThemeComponent> </ThemeProvider> ); }
3,940
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/UsingOptions.tsx
import * as React from 'react'; import { styled, createTheme, ThemeProvider } from '@mui/system'; interface MyThemeComponentProps { color?: 'primary' | 'secondary'; variant?: 'normal' | 'dashed'; } const customTheme = createTheme({ components: { MyThemeComponent: { styleOverrides: { root: { color: 'darkslategray', }, primary: { color: 'darkblue', }, secondary: { color: 'darkred', backgroundColor: 'pink', }, }, variants: [ { props: { variant: 'dashed', color: 'primary' }, style: { border: '1px dashed darkblue', }, }, { props: { variant: 'dashed', color: 'secondary' }, style: { border: '1px dashed darkred', }, }, ], }, }, }); const MyThemeComponent = styled('div', { // Configure which props should be forwarded on DOM shouldForwardProp: (prop) => prop !== 'color' && prop !== 'variant' && prop !== 'sx', name: 'MyThemeComponent', slot: 'Root', // We are specifying here how the styleOverrides are being applied based on props overridesResolver: (props, styles) => [ styles.root, props.color === 'primary' && styles.primary, props.color === 'secondary' && styles.secondary, ], })<MyThemeComponentProps>(({ theme }) => ({ backgroundColor: 'aliceblue', padding: theme.spacing(1), })); export default function UsingOptions() { return ( <ThemeProvider theme={customTheme}> <MyThemeComponent sx={{ m: 1 }} color="primary" variant="dashed"> Primary </MyThemeComponent> <MyThemeComponent sx={{ m: 1 }} color="secondary"> Secondary </MyThemeComponent> </ThemeProvider> ); }
3,941
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/UsingOptions.tsx.preview
<ThemeProvider theme={customTheme}> <MyThemeComponent sx={{ m: 1 }} color="primary" variant="dashed"> Primary </MyThemeComponent> <MyThemeComponent sx={{ m: 1 }} color="secondary"> Secondary </MyThemeComponent> </ThemeProvider>
3,942
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/UsingWithSx.js
import * as React from 'react'; import { styled, createTheme, ThemeProvider } from '@mui/system'; const customTheme = createTheme({ palette: { primary: { main: '#1976d2', contrastText: 'white', }, }, }); const MyThemeComponent = styled('div')(({ theme }) => theme.unstable_sx({ color: 'primary.contrastText', backgroundColor: 'primary.main', padding: 1, borderRadius: 1, }), ); export default function UsingWithSx() { return ( <ThemeProvider theme={customTheme}> <MyThemeComponent>Styled div with theme</MyThemeComponent> </ThemeProvider> ); }
3,943
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/UsingWithSx.tsx
import * as React from 'react'; import { styled, createTheme, ThemeProvider } from '@mui/system'; const customTheme = createTheme({ palette: { primary: { main: '#1976d2', contrastText: 'white', }, }, }); const MyThemeComponent = styled('div')(({ theme }) => theme.unstable_sx({ color: 'primary.contrastText', backgroundColor: 'primary.main', padding: 1, borderRadius: 1, }), ); export default function UsingWithSx() { return ( <ThemeProvider theme={customTheme}> <MyThemeComponent>Styled div with theme</MyThemeComponent> </ThemeProvider> ); }
3,944
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/UsingWithSx.tsx.preview
<ThemeProvider theme={customTheme}> <MyThemeComponent>Styled div with theme</MyThemeComponent> </ThemeProvider>
3,945
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/styled/styled.md
# `styled()` <p class="description">Utility for creating styled components.</p> ## Introduction All MUI components are styled with the `styled()` utility. This utility is built on top of the `styled()` module of `@mui/styled-engine`and provides additional features. ### Import path You can use the utility coming from the `@mui/system` package, or if you are using `@mui/material`, you can import it from `@mui/material/styles`. The difference is in the default `theme` that is used (if no theme is available in the React context). ### What problems does it solve? The utility can be used as a replacement for emotion's or styled-components' styled() utility. It aims to solve the same problem, but also provides the following benefits: 1. It uses MUI's default `theme` if no theme is available in React context. 2. It supports the theme's [`styleOverrides`](/material-ui/customization/theme-components/#theme-style-overrides) and [`variants`](/material-ui/customization/theme-components/#creating-new-component-variants) to be applied, based on the `name` applied in the options (can be skipped). 3. It adds support for the [the `sx` prop](/system/getting-started/the-sx-prop/) (can be skipped). 4. It adds by default the `shouldForwardProp` option (that can be overridden), taking into account all props used internally in the MUI components: `ownerState`, `theme`, `sx`, and `as`. ## API ### `styled(Component, [options])(styles) => Component` #### Arguments 1. `Component`: The component that will be wrapped. 2. `options` (_object_ [optional]): - `options.shouldForwardProp` (_`(prop: string) => bool`_ [optional]): Indicates whether the `prop` should be forwarded to the `Component`. - `options.label` (_string_ [optional]): The suffix of the style sheet. Useful for debugging. - `options.name` (_string_ [optional]): The key used under `theme.components` for specifying `styleOverrides` and `variants`. Also used for generating the `label`. - `options.slot` (_string_ [optional]): If `Root`, it automatically applies the theme's `variants`. - `options.overridesResolver` (_(props: object, styles: Record<string, styles>) => styles_ [optional]): Function that returns styles based on the props and the `theme.components[name].styleOverrides` object. - `options.skipVariantsResolver` (_bool_): Disables the automatic resolver for the `theme.components[name].variants`. - `options.skipSx` (_bool_ [optional]): Disables the `sx` prop on the component. - The other keys are forwarded to the `options` argument of emotion's [`styled([Component], [options])`](https://emotion.sh/docs/styled). 3. `styles` (_object | `({ ...props, theme }) => object`_ [optional]): A styles object or a function returning a styles object. The function receives the theme and component's props in an object which is its single argument. #### Returns `Component`: The new component created. ## Basic usage {{"demo": "BasicUsage.js", "defaultCodeOpen": true}} ## Using the theme {{"demo": "ThemeUsage.js", "defaultCodeOpen": true}} ## Custom components This example demonstrates how you can use the `styled` API to create custom components, with the same capabilities as the core components: {{"demo": "UsingOptions.js", "defaultCodeOpen": true }} If you inspect this element with the browser DevTools in development mode, you will notice that the class of the component now ends with the `MyThemeComponent-root`, which comes from the `name` and `slot` options that were provided. <img src="/static/images/system/styled-options.png" alt="browser DevTools showing the rendered component" width="654" height="258" style="width: 327px" /> In addition to this, the `color`, `sx`, and `variant` props are not propagated to the generated `div` element. ## Removing features If you would like to remove some of the MUI specific features, you can do it like this: ```diff const StyledComponent = styled('div', {}, { name: 'MuiStyled', slot: 'Root', - overridesResolver: (props, styles) => styles.root, // disables theme.components[name].styleOverrides + skipVariantsResolver: true, // disables theme.components[name].variants + skipSx: true, // disables the sx prop }); ``` ## Create custom `styled()` utility If you want to have a different default theme for the `styled()` utility, you can create your own version of it, using the `createStyled()` utility. ```js import { createStyled, createTheme } from '@mui/system'; const defaultTheme = createTheme({ // your custom theme values }); const styled = createStyled({ defaultTheme }); export default styled; ``` ## Difference with the `sx` prop The `styled` function is an extension of the `styled` utility provided by the underlying style library used – either Emotion or styled-components. It is guaranteed that it will produce the same output as the `styled` function coming from the style library for the same input. The [`sx`](/system/getting-started/the-sx-prop/) prop, on the other hand, is a new way of styling your components, focused on fast customization. `styled` is a function, while `sx` is a prop of the MUI components. Therefore, you will notice the following differences: ### `sx` provides more shortcuts than `styled` With `styled`: ```js const MyStyledButton = styled('button')({ mx: 1, // ❌ don't use this! This shortcut is only provided by the `sx` prop }); ``` With `sx`: ```js import Button from '@mui/material/Button'; const MyStyledButton = (props) => ( <Button sx={{ mx: 1, // ✔️ this shortcut is specific to the `sx` prop, }} > {props.children} </Button> ); ``` ### The style definition varies slightly With `styled`: ```js const MyStyledButton = styled('button')({ padding: 1, // means "1px", NOT "theme.spacing(1)" }); ``` With `sx`: ```js import Button from '@mui/material/Button'; const MyStyledButton = (props) => ( <Button sx={{ padding: 1, // means "theme.spacing(1)", NOT "1px" }} > {props.children} </Button> ); ``` ### Patterns for how to use props differ With `styled`: ```js const MyStyledButton = styled('button')((props) => ({ backgroundColor: props.myBackgroundColor, })); ``` With `sx`: ```js import Button from '@mui/material/Button'; const MyStyledButton = (props) => ( <Button sx={{ backgroundColor: props.myCustomColor }}>{props.children}</Button> ); ``` ### Parameter when using function are different for each field With `styled` (not recommended): ```js // You may find this syntax in the wild, but for code readability // we recommend using only one top-level function const MyStyledButtonPropsPerField = styled('button')({ backgroundColor: (props) => props.myBackgroundColor, }); ``` With `sx`: ```js import Button from '@mui/material/Button'; import { lighten } from 'polished'; const MyStyledButton = (props) => ( <Button sx={{ backgroundColor: (theme) => lighten(0.2, theme.palette.primary.main) }} > {props.children} </Button> ); // Note: for direct theme access without modification, you can also use a shortcut by providing the key as a string const MyStyledButton = (props) => ( <Button sx={{ backgroundColor: 'primary.main' }}>{props.children}</Button> ); ``` ### How can I use the `sx` syntax with the `styled()` utility? If you prefer the `sx` syntax and want to use it in both the `sx` prop and the `styled()` utility, you can use the `unstable_sx` utility from the `theme`: {{"demo": "UsingWithSx.js", "defaultCodeOpen": true}} The overhead added by using the `unstable_sx` utility is the same as if you were to use the `sx` prop on the component. > Note: You can use `unstable_sx` outside of the `styled()` utility, too; e.g., for defining `variants` in your custom theme. ## How to use components selector API If you've ever used the `styled()` API of either [`emotion`](https://emotion.sh/docs/styled#targeting-another-emotion-component) or [`styled-components`](https://styled-components.com/docs/advanced#referring-to-other-components), you should have been able to use components as selectors. ```jsx import styled from '@emotion/styled'; const Child = styled.div` color: red; `; const Parent = styled.div` ${Child} { color: green; } `; render( <div> <Parent> <Child>Green because I am inside a Parent</Child> </Parent> <Child>Red because I am not inside a Parent</Child> </div>, ); ``` With MUI's `styled()` utility, you can use components as selectors, too. When using `@mui/styled-engine-sc` (`styled-components`), nothing needs to be done. When using `@mui/styled-engine` (`emotion`), the default engine, there are a few steps you should perform: First, you should install [`@emotion/babel-plugin`](https://emotion.sh/docs/@emotion/babel-plugin). ```bash npm install @emotion/babel-plugin ``` Then, configure the plugin to know about the MUI version of the `styled()` utility: **babel.config.js** ```js module.exports = { ... plugins: [ [ "@emotion", { importMap: { "@mui/system": { styled: { canonicalImport: ["@emotion/styled", "default"], styledBaseImport: ["@mui/system", "styled"] } }, "@mui/material/styles": { styled: { canonicalImport: ["@emotion/styled", "default"], styledBaseImport: ["@mui/material/styles", "styled"] } } } } ] ] }; ``` Now you should be able to use components as your selectors!
3,946
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontFamily.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontFamily() { return ( <Typography component="div"> <Box sx={{ fontFamily: 'default', m: 1 }}>Default</Box> <Box sx={{ fontFamily: 'Monospace', fontSize: 'h6.fontSize', m: 1 }}> Monospace </Box> </Typography> ); }
3,947
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontFamily.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontFamily() { return ( <Typography component="div"> <Box sx={{ fontFamily: 'default', m: 1 }}>Default</Box> <Box sx={{ fontFamily: 'Monospace', fontSize: 'h6.fontSize', m: 1 }}> Monospace </Box> </Typography> ); }
3,948
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontFamily.tsx.preview
<Typography component="div"> <Box sx={{ fontFamily: 'default', m: 1 }}>Default</Box> <Box sx={{ fontFamily: 'Monospace', fontSize: 'h6.fontSize', m: 1 }}> Monospace </Box> </Typography>
3,949
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontSize.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontSize() { return ( <Typography component="div"> <Box sx={{ fontSize: 'default', m: 1 }}>Default</Box> <Box sx={{ fontSize: 'h6.fontSize', m: 1 }}>h6.fontSize</Box> <Box sx={{ fontSize: 16, m: 1 }}>16px</Box> </Typography> ); }
3,950
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontSize.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontSize() { return ( <Typography component="div"> <Box sx={{ fontSize: 'default', m: 1 }}>Default</Box> <Box sx={{ fontSize: 'h6.fontSize', m: 1 }}>h6.fontSize</Box> <Box sx={{ fontSize: 16, m: 1 }}>16px</Box> </Typography> ); }
3,951
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontSize.tsx.preview
<Typography component="div"> <Box sx={{ fontSize: 'default', m: 1 }}>Default</Box> <Box sx={{ fontSize: 'h6.fontSize', m: 1 }}>h6.fontSize</Box> <Box sx={{ fontSize: 16, m: 1 }}>16px</Box> </Typography>
3,952
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontStyle.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontStyle() { return ( <Typography component="div"> <Box sx={{ fontStyle: 'normal', m: 1 }}>Normal font style.</Box> <Box sx={{ fontStyle: 'italic', m: 1 }}>Italic font Style.</Box> <Box sx={{ fontStyle: 'oblique', m: 1 }}>Oblique font style.</Box> </Typography> ); }
3,953
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontStyle.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontStyle() { return ( <Typography component="div"> <Box sx={{ fontStyle: 'normal', m: 1 }}>Normal font style.</Box> <Box sx={{ fontStyle: 'italic', m: 1 }}>Italic font Style.</Box> <Box sx={{ fontStyle: 'oblique', m: 1 }}>Oblique font style.</Box> </Typography> ); }
3,954
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontStyle.tsx.preview
<Typography component="div"> <Box sx={{ fontStyle: 'normal', m: 1 }}>Normal font style.</Box> <Box sx={{ fontStyle: 'italic', m: 1 }}>Italic font Style.</Box> <Box sx={{ fontStyle: 'oblique', m: 1 }}>Oblique font style.</Box> </Typography>
3,955
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontWeight.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontWeight() { return ( <Typography component="div"> <Box sx={{ fontWeight: 'light', m: 1 }}>Light</Box> <Box sx={{ fontWeight: 'regular', m: 1 }}>Regular</Box> <Box sx={{ fontWeight: 'medium', m: 1 }}>Medium</Box> <Box sx={{ fontWeight: 500, m: 1 }}>500</Box> <Box sx={{ fontWeight: 'bold', m: 1 }}>Bold</Box> </Typography> ); }
3,956
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontWeight.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function FontWeight() { return ( <Typography component="div"> <Box sx={{ fontWeight: 'light', m: 1 }}>Light</Box> <Box sx={{ fontWeight: 'regular', m: 1 }}>Regular</Box> <Box sx={{ fontWeight: 'medium', m: 1 }}>Medium</Box> <Box sx={{ fontWeight: 500, m: 1 }}>500</Box> <Box sx={{ fontWeight: 'bold', m: 1 }}>Bold</Box> </Typography> ); }
3,957
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/FontWeight.tsx.preview
<Typography component="div"> <Box sx={{ fontWeight: 'light', m: 1 }}>Light</Box> <Box sx={{ fontWeight: 'regular', m: 1 }}>Regular</Box> <Box sx={{ fontWeight: 'medium', m: 1 }}>Medium</Box> <Box sx={{ fontWeight: 500, m: 1 }}>500</Box> <Box sx={{ fontWeight: 'bold', m: 1 }}>Bold</Box> </Typography>
3,958
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/LetterSpacing.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function LetterSpacing() { return ( <Typography component="div"> <Box sx={{ letterSpacing: 6, m: 1 }}>Letter Spacing 6px.</Box> <Box sx={{ letterSpacing: 10, m: 1 }}>Letter Spacing 10px.</Box> </Typography> ); }
3,959
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/LetterSpacing.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function LetterSpacing() { return ( <Typography component="div"> <Box sx={{ letterSpacing: 6, m: 1 }}>Letter Spacing 6px.</Box> <Box sx={{ letterSpacing: 10, m: 1 }}>Letter Spacing 10px.</Box> </Typography> ); }
3,960
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/LetterSpacing.tsx.preview
<Typography component="div"> <Box sx={{ letterSpacing: 6, m: 1 }}>Letter Spacing 6px.</Box> <Box sx={{ letterSpacing: 10, m: 1 }}>Letter Spacing 10px.</Box> </Typography>
3,961
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/LineHeight.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function LineHeight() { return ( <Typography component="div"> <Box sx={{ lineHeight: 'normal', m: 1 }}>Normal height.</Box> <Box sx={{ lineHeight: 2, m: 1 }}>line-height: 2</Box> </Typography> ); }
3,962
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/LineHeight.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function LineHeight() { return ( <Typography component="div"> <Box sx={{ lineHeight: 'normal', m: 1 }}>Normal height.</Box> <Box sx={{ lineHeight: 2, m: 1 }}>line-height: 2</Box> </Typography> ); }
3,963
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/LineHeight.tsx.preview
<Typography component="div"> <Box sx={{ lineHeight: 'normal', m: 1 }}>Normal height.</Box> <Box sx={{ lineHeight: 2, m: 1 }}>line-height: 2</Box> </Typography>
3,964
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/TextAlignment.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function TextAlignment() { return ( <Typography component="div"> <Box sx={{ textAlign: 'justify', m: 1 }}> Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. </Box> <Box sx={{ textAlign: 'left', m: 1 }}>Left aligned text.</Box> <Box sx={{ textAlign: 'center', m: 1 }}>Center aligned text.</Box> <Box sx={{ textAlign: 'right', m: 1 }}>Right aligned text.</Box> </Typography> ); }
3,965
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/TextAlignment.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function TextAlignment() { return ( <Typography component="div"> <Box sx={{ textAlign: 'justify', m: 1 }}> Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. </Box> <Box sx={{ textAlign: 'left', m: 1 }}>Left aligned text.</Box> <Box sx={{ textAlign: 'center', m: 1 }}>Center aligned text.</Box> <Box sx={{ textAlign: 'right', m: 1 }}>Right aligned text.</Box> </Typography> ); }
3,966
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/TextAlignment.tsx.preview
<Typography component="div"> <Box sx={{ textAlign: 'justify', m: 1 }}> Ambitioni dedisse scripsisse iudicaretur. Cras mattis iudicium purus sit amet fermentum. Donec sed odio operae, eu vulputate felis rhoncus. </Box> <Box sx={{ textAlign: 'left', m: 1 }}>Left aligned text.</Box> <Box sx={{ textAlign: 'center', m: 1 }}>Center aligned text.</Box> <Box sx={{ textAlign: 'right', m: 1 }}>Right aligned text.</Box> </Typography>
3,967
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/TextTransform.js
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function TextTransform() { return ( <Typography component="div"> <Box sx={{ textTransform: 'capitalize', m: 1 }}>capitalized text.</Box> <Box sx={{ textTransform: 'lowercase', m: 1 }}>Lowercase Text.</Box> <Box sx={{ textTransform: 'uppercase', m: 1 }}>Uppercase Text.</Box> </Typography> ); }
3,968
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/TextTransform.tsx
import * as React from 'react'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; export default function TextTransform() { return ( <Typography component="div"> <Box sx={{ textTransform: 'capitalize', m: 1 }}>capitalized text.</Box> <Box sx={{ textTransform: 'lowercase', m: 1 }}>Lowercase Text.</Box> <Box sx={{ textTransform: 'uppercase', m: 1 }}>Uppercase Text.</Box> </Typography> ); }
3,969
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/TextTransform.tsx.preview
<Typography component="div"> <Box sx={{ textTransform: 'capitalize', m: 1 }}>capitalized text.</Box> <Box sx={{ textTransform: 'lowercase', m: 1 }}>Lowercase Text.</Box> <Box sx={{ textTransform: 'uppercase', m: 1 }}>Uppercase Text.</Box> </Typography>
3,970
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/Variant.js
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Variant() { return ( <div> <Box sx={{ typography: 'subtitle2' }}>subtitle2</Box> <Box sx={{ typography: 'body1' }}>body1</Box> <Box sx={{ typography: 'body2' }}>body2</Box> </div> ); }
3,971
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/Variant.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; export default function Variant() { return ( <div> <Box sx={{ typography: 'subtitle2' }}>subtitle2</Box> <Box sx={{ typography: 'body1' }}>body1</Box> <Box sx={{ typography: 'body2' }}>body2</Box> </div> ); }
3,972
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/Variant.tsx.preview
<Box sx={{ typography: 'subtitle2' }}>subtitle2</Box> <Box sx={{ typography: 'body1' }}>body1</Box> <Box sx={{ typography: 'body2' }}>body2</Box>
3,973
0
petrpan-code/mui/material-ui/docs/data/system
petrpan-code/mui/material-ui/docs/data/system/typography/typography.md
# Typography <p class="description">Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.</p> ## Variant {{"demo": "Variant.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ typography: 'subtitle2' }}>… // theme.typography.subtitle2 <Box sx={{ typography: 'body1' }}>… <Box sx={{ typography: 'body2' }}>… ``` ## Text alignment {{"demo": "TextAlignment.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ textAlign: 'left' }}>… <Box sx={{ textAlign: 'center' }}>… <Box sx={{ textAlign: 'right' }}>… ``` ## Text transformation {{"demo": "TextTransform.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ textTransform: 'capitalize' }}>… <Box sx={{ textTransform: 'lowercase' }}>… <Box sx={{ textTransform: 'uppercase' }}>… ``` ## Font weight {{"demo": "FontWeight.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ fontWeight: 'light' }}>… // theme.typography.fontWeightLight <Box sx={{ fontWeight: 'regular' }}>… <Box sx={{ fontWeight: 'medium' }}>… <Box sx={{ fontWeight: 500 }}>… <Box sx={{ fontWeight: 'bold' }}>… ``` ## Font size {{"demo": "FontSize.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ fontSize: 'default' }}>… // theme.typography.fontSize <Box sx={{ fontSize: 'h6.fontSize' }}>… <Box sx={{ fontSize: 16 }}>… ``` ## Font style {{"demo": "FontStyle.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ fontStyle: 'normal' }}>… <Box sx={{ fontStyle: 'italic' }}>… <Box sx={{ fontStyle: 'oblique' }}>… ``` ## Font family {{"demo": "FontFamily.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ fontFamily: 'default' }}>… <Box sx={{ fontFamily: 'Monospace' }}>… ``` ## Letter spacing {{"demo": "LetterSpacing.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ letterSpacing: 6 }}>… <Box sx={{ letterSpacing: 10 }}>… ``` ## Line height {{"demo": "LineHeight.js", "defaultCodeOpen": false}} ```jsx <Box sx={{ lineHeight: 'normal' }}>… <Box sx={{ lineHeight: 10 }}>… ``` ## API ```js import { typography } from '@mui/system'; ``` | Import name | Prop | CSS property | Theme key | | :-------------- | :-------------- | :------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | `typography` | `typography` | `font-family`, `font-weight`, `font-size`, `line-height`, `letter-spacing`, `text-transform` | [`typography`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontFamily` | `fontFamily` | `font-family` | [`typography`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontSize` | `fontSize` | `font-size` | [`typography`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontStyle` | `fontStyle` | `font-style` | [`typography`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `fontWeight` | `fontWeight` | `font-weight` | [`typography`](/material-ui/customization/default-theme/?expand-path=$.typography) | | `letterSpacing` | `letterSpacing` | `letter-spacing` | none | | `lineHeight` | `lineHeight` | `line-height` | none | | `textAlign` | `textAlign` | `text-align` | none | | `textTransform` | `textTransform` | `text-transform` | none |
3,974
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/lib/sourcing.ts
import fs from 'fs'; import path from 'path'; import { getHeaders } from '@mui/markdown'; const blogDir = path.join(process.cwd(), 'pages/blog'); export const getBlogFilePaths = (ext = '.md') => { return fs.readdirSync(blogDir).filter((file) => file.endsWith(ext)); }; export interface BlogPost { slug: string; title: string; description: string; image?: string; tags: Array<string>; authors?: Array<string>; date?: string; } export const getBlogPost = (filePath: string): BlogPost => { const slug = filePath.replace(/\.md$/, ''); const content = fs.readFileSync(path.join(blogDir, filePath), 'utf-8'); const headers = getHeaders(content) as unknown as BlogPost; return { ...headers, slug, }; }; // Avoid typos in the blog markdown pages. // https://www.notion.so/mui-org/Blog-247ec2bff5fa46e799ef06a693c94917 const ALLOWED_TAGS = ['MUI Core', 'MUI X', 'News', 'Company', 'Developer survey', 'Product']; export const getAllBlogPosts = () => { const filePaths = getBlogFilePaths(); const rawBlogPosts = filePaths .map((name) => getBlogPost(name)) // sort allBlogPosts by date in descending order .sort((post1, post2) => { if (post1.date && post2.date) { return new Date(post1.date) > new Date(post2.date) ? -1 : 1; } if (post1.date && !post2.date) { return 1; } return -1; }); const allBlogPosts = rawBlogPosts.filter((post) => !!post.title); const tagInfo: Record<string, number | undefined> = {}; allBlogPosts.forEach((post) => { post.tags.forEach((tag) => { if (!ALLOWED_TAGS.includes(tag)) { throw new Error( `The tag "${tag}" in "${post.title}" was not whitelisted. Are you sure it's not a typo?`, ); } tagInfo[tag] = (tagInfo[tag] || 0) + 1; }); }); return { allBlogPosts, // posts with at least a title tagInfo, }; };
3,975
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/_app.js
import 'docs/src/modules/components/bootstrap'; // --- Post bootstrap ----- import * as React from 'react'; import { loadCSS } from 'fg-loadcss/src/loadCSS'; import NextHead from 'next/head'; import PropTypes from 'prop-types'; import { useRouter } from 'next/router'; import { LicenseInfo } from '@mui/x-data-grid-pro'; import materialPkgJson from 'packages/mui-material/package.json'; import joyPkgJson from 'packages/mui-joy/package.json'; import systemPkgJson from 'packages/mui-system/package.json'; import basePkgJson from 'packages/mui-base/package.json'; import generalDocsPages from 'docs/data/docs/pages'; import basePages from 'docs/data/base/pages'; import docsInfraPages from 'docs/data/docs-infra/pages'; import materialPages from 'docs/data/material/pages'; import joyPages from 'docs/data/joy/pages'; import systemPages from 'docs/data/system/pages'; import PageContext from 'docs/src/modules/components/PageContext'; import GoogleAnalytics from 'docs/src/modules/components/GoogleAnalytics'; import { CodeCopyProvider } from 'docs/src/modules/utils/CodeCopy'; import { ThemeProvider } from 'docs/src/modules/components/ThemeContext'; import { CodeVariantProvider } from 'docs/src/modules/utils/codeVariant'; import { CodeStylingProvider } from 'docs/src/modules/utils/codeStylingSolution'; import { UserLanguageProvider } from 'docs/src/modules/utils/i18n'; import DocsStyledEngineProvider from 'docs/src/modules/utils/StyledEngineProvider'; import createEmotionCache from 'docs/src/createEmotionCache'; import findActivePage from 'docs/src/modules/utils/findActivePage'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import getProductInfoFromUrl from 'docs/src/modules/utils/getProductInfoFromUrl'; import './global.css'; import './base-theme.css'; // Remove the license warning from demonstration purposes LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_LICENSE); // Client-side cache, shared for the whole session of the user in the browser. const clientSideEmotionCache = createEmotionCache(); let reloadInterval; // Avoid infinite loop when "Upload on reload" is set in the Chrome sw dev tools. function lazyReload() { clearInterval(reloadInterval); reloadInterval = setInterval(() => { if (document.hasFocus()) { window.location.reload(); } }, 100); } // Inspired by // https://developers.google.com/web/tools/workbox/guides/advanced-recipes#offer_a_page_reload_for_users function forcePageReload(registration) { // console.log('already controlled?', Boolean(navigator.serviceWorker.controller)); if (!navigator.serviceWorker.controller) { // The window client isn't currently controlled so it's a new service // worker that will activate immediately. return; } // console.log('registration waiting?', Boolean(registration.waiting)); if (registration.waiting) { // SW is waiting to activate. Can occur if multiple clients open and // one of the clients is refreshed. registration.waiting.postMessage('skipWaiting'); return; } function listenInstalledStateChange() { registration.installing.addEventListener('statechange', (event) => { // console.log('statechange', event.target.state); if (event.target.state === 'installed' && registration.waiting) { // A new service worker is available, inform the user registration.waiting.postMessage('skipWaiting'); } else if (event.target.state === 'activated') { // Force the control of the page by the activated service worker. lazyReload(); } }); } if (registration.installing) { listenInstalledStateChange(); return; } // We are currently controlled so a new SW may be found... // Add a listener in case a new SW is found, registration.addEventListener('updatefound', listenInstalledStateChange); } async function registerServiceWorker() { if ( 'serviceWorker' in navigator && process.env.NODE_ENV === 'production' && window.location.host.indexOf('mui.com') !== -1 ) { // register() automatically attempts to refresh the sw.js. const registration = await navigator.serviceWorker.register('/sw.js'); // Force the page reload for users. forcePageReload(registration); } } let dependenciesLoaded = false; function loadDependencies() { if (dependenciesLoaded) { return; } dependenciesLoaded = true; loadCSS( 'https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Two+Tone', document.querySelector('#material-icon-font'), ); } if (typeof window !== 'undefined' && process.env.NODE_ENV === 'production') { // eslint-disable-next-line no-console console.log( `%c ███╗ ███╗ ██╗ ██╗ ██████╗ ████╗ ████║ ██║ ██║ ██╔═╝ ██╔████╔██║ ██║ ██║ ██║ ██║╚██╔╝██║ ██║ ██║ ██║ ██║ ╚═╝ ██║ ╚██████╔╝ ██████╗ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ Tip: you can access the documentation \`theme\` object directly in the console. `, 'font-family:monospace;color:#1976d2;font-size:12px;', ); } function AppWrapper(props) { const { children, emotionCache, pageProps } = props; const router = useRouter(); // TODO move productId & productCategoryId resolution to page layout. // We should use the productId field from the markdown and fallback to getProductInfoFromUrl() // if not present const { productId, productCategoryId } = getProductInfoFromUrl(router.asPath); React.useEffect(() => { loadDependencies(); registerServiceWorker(); // Remove the server-side injected CSS. const jssStyles = document.querySelector('#jss-server-side'); if (jssStyles) { jssStyles.parentElement.removeChild(jssStyles); } }, []); const productIdentifier = React.useMemo(() => { const languagePrefix = pageProps.userLanguage === 'en' ? '' : `/${pageProps.userLanguage}`; if (productId === 'material-ui') { return { metadata: 'MUI Core', name: 'Material UI', versions: [ { text: `v${materialPkgJson.version}`, current: true }, { text: 'v4', href: `https://v4.mui.com${languagePrefix}/getting-started/installation/`, }, { text: 'View all versions', href: `https://mui.com${languagePrefix}/versions/`, }, ], }; } if (productId === 'joy-ui') { return { metadata: 'MUI Core', name: 'Joy UI', versions: [{ text: `v${joyPkgJson.version}`, current: true }], }; } if (productId === 'system') { return { metadata: 'MUI Core', name: 'MUI System', versions: [ { text: `v${systemPkgJson.version}`, current: true }, { text: 'v4', href: `https://v4.mui.com${languagePrefix}/system/basics/` }, { text: 'View all versions', href: `https://mui.com${languagePrefix}/versions/`, }, ], }; } if (productId === 'base-ui') { return { metadata: 'MUI Core', name: 'Base UI', versions: [{ text: `v${basePkgJson.version}`, current: true }], }; } if (productId === 'core') { return { metadata: '', name: 'MUI Core', versions: [ { text: `v${materialPkgJson.version}`, current: true }, { text: 'View all versions', href: `https://mui.com${languagePrefix}/versions/`, }, ], }; } if (productId === 'docs-infra') { return { metadata: '', name: 'Docs-infra', versions: [ { text: 'v0.0.0', href: `https://mui.com${languagePrefix}/versions/`, }, ], }; } if (productId === 'docs') { return { metadata: '', name: 'Home docs', versions: [ { text: 'v0.0.0', href: `https://mui.com${languagePrefix}/versions/`, }, ], }; } return null; }, [pageProps.userLanguage, productId]); const pageContextValue = React.useMemo(() => { let pages = generalDocsPages; if (productId === 'base-ui') { pages = basePages; } else if (productId === 'material-ui') { pages = materialPages; } else if (productId === 'joy-ui') { pages = joyPages; } else if (productId === 'system') { pages = systemPages; } else if (productId === 'docs-infra') { pages = docsInfraPages; } const { activePage, activePageParents } = findActivePage(pages, router.pathname); return { activePage, activePageParents, pages, productIdentifier, productId, productCategoryId, }; }, [productId, productCategoryId, productIdentifier, router.pathname]); let fonts = []; if (pathnameToLanguage(router.asPath).canonicalAs.match(/onepirate/)) { fonts = [ 'https://fonts.googleapis.com/css?family=Roboto+Condensed:700|Work+Sans:300,400&display=swap', ]; } return ( <React.Fragment> <NextHead> <meta name="viewport" content="initial-scale=1, width=device-width" /> {fonts.map((font) => ( <link rel="stylesheet" href={font} key={font} /> ))} <meta name="mui:productId" content={productId} /> <meta name="mui:productCategoryId" content={productCategoryId} /> </NextHead> <UserLanguageProvider defaultUserLanguage={pageProps.userLanguage}> <CodeCopyProvider> <CodeStylingProvider> <CodeVariantProvider> <PageContext.Provider value={pageContextValue}> <ThemeProvider> <DocsStyledEngineProvider cacheLtr={emotionCache}> {children} <GoogleAnalytics /> </DocsStyledEngineProvider> </ThemeProvider> </PageContext.Provider> </CodeVariantProvider> </CodeStylingProvider> </CodeCopyProvider> </UserLanguageProvider> </React.Fragment> ); } AppWrapper.propTypes = { children: PropTypes.node.isRequired, emotionCache: PropTypes.object.isRequired, pageProps: PropTypes.object.isRequired, }; export default function MyApp(props) { const { Component, emotionCache = clientSideEmotionCache, pageProps } = props; const getLayout = Component.getLayout ?? ((page) => page); return ( <AppWrapper emotionCache={emotionCache} pageProps={pageProps}> {getLayout(<Component {...pageProps} />)} </AppWrapper> ); } MyApp.propTypes = { Component: PropTypes.elementType.isRequired, emotionCache: PropTypes.object, pageProps: PropTypes.object.isRequired, }; MyApp.getInitialProps = async ({ ctx, Component }) => { let pageProps = {}; if (Component.getInitialProps) { pageProps = await Component.getInitialProps(ctx); } return { pageProps: { userLanguage: ctx.query.userLanguage || 'en', ...pageProps, }, }; }; // Track fraction of actual events to prevent exceeding event quota. // Filter sessions instead of individual events so that we can track multiple metrics per device. // See https://github.com/GoogleChromeLabs/web-vitals-report to use this data const disableWebVitalsReporting = Math.random() > 0.0001; export function reportWebVitals({ id, name, label, delta, value }) { if (disableWebVitalsReporting) { return; } window.gtag('event', name, { value: delta, metric_label: label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric', metric_value: value, metric_delta: delta, metric_id: id, // id unique to current page load }); }
3,976
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/_document.js
import * as React from 'react'; import Script from 'next/script'; import { ServerStyleSheets as JSSServerStyleSheets } from '@mui/styles'; import { ServerStyleSheet } from 'styled-components'; import createEmotionServer from '@emotion/server/create-instance'; import Document, { Html, Head, Main, NextScript } from 'next/document'; import GlobalStyles from '@mui/material/GlobalStyles'; import { getInitColorSchemeScript as getMuiInitColorSchemeScript } from '@mui/material/styles'; import { getInitColorSchemeScript as getJoyInitColorSchemeScript } from '@mui/joy/styles'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import createEmotionCache from 'docs/src/createEmotionCache'; import { getMetaThemeColor } from 'docs/src/modules/brandingTheme'; // You can find a benchmark of the available CSS minifiers under // https://github.com/GoalSmashers/css-minification-benchmark // We have found that clean-css is faster than cssnano but the output is larger. // Waiting for https://github.com/cssinjs/jss/issues/279 // 4% slower but 12% smaller output than doing it in a single step. // // It's using .browserslistrc let prefixer; let cleanCSS; if (process.env.NODE_ENV === 'production') { /* eslint-disable global-require */ const postcss = require('postcss'); const autoprefixer = require('autoprefixer'); const CleanCSS = require('clean-css'); /* eslint-enable global-require */ prefixer = postcss([autoprefixer]); cleanCSS = new CleanCSS(); } const PRODUCTION_GA = process.env.DEPLOY_ENV === 'production' || process.env.DEPLOY_ENV === 'staging'; const GOOGLE_ANALYTICS_ID_V4 = PRODUCTION_GA ? 'G-5NXDQLC2ZK' : 'G-XJ83JQEK7J'; export default class MyDocument extends Document { render() { const { canonicalAsServer, userLanguage } = this.props; return ( <Html lang={userLanguage} data-mui-color-scheme="light" data-joy-color-scheme="light"> <Head> {/* manifest.json provides metadata used when your web app is added to the homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/ */} <link rel="manifest" href="/static/manifest.json" /> {/* PWA primary color */} <meta name="theme-color" content={getMetaThemeColor('light')} media="(prefers-color-scheme: light)" /> <meta name="theme-color" content={getMetaThemeColor('dark')} media="(prefers-color-scheme: dark)" /> <link rel="shortcut icon" href="/static/favicon.ico" /> {/* iOS Icon */} <link rel="apple-touch-icon" sizes="180x180" href="/static/icons/180x180.png" /> {/* SEO */} <link rel="canonical" href={`https://mui.com${ userLanguage === 'en' ? '' : `/${userLanguage}` }${canonicalAsServer}`} /> <link rel="alternate" href={`https://mui.com${canonicalAsServer}`} hrefLang="x-default" /> {/* Preconnect allows the browser to setup early connections before an HTTP request is actually sent to the server. This includes DNS lookups, TLS negotiations, TCP handshakes. */} <link href="https://fonts.gstatic.com" rel="preconnect" crossOrigin="anonymous" /> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet" /> {/* ========== Font preload (prevent font flash) ============= */} <link rel="preload" // optimized for english characters (40kb -> 6kb) href="/static/fonts/GeneralSans-Semibold-subset.woff2" as="font" type="font/woff2" crossOrigin="anonymous" /> <style // the above <link> does not work in mobile device, this inline <style> fixes it without blocking resources // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: `@font-face{font-family:'General Sans';font-style:normal;font-weight:600;font-display:swap;src:url('/static/fonts/GeneralSans-Semibold-subset.woff2') format('woff2');}`, }} /> <link rel="preload" // optimized for english characters (40kb -> 6kb) href="/static/fonts/IBMPlexSans-Regular-subset.woff2" as="font" type="font/woff2" crossOrigin="anonymous" /> <style // the above <link> does not work in mobile device, this inline <style> fixes it without blocking resources // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: `@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:400;font-display:swap;src:url('/static/fonts/IBMPlexSans-Regular-subset.woff2') format('woff2');}`, }} /> {/* =========================================================== */} <style // Loads General Sans: Regular (400), Medium (500), SemiBold (600), Bold (700) // Typeface documentation: https://www.fontshare.com/fonts/general-sans // use https://cssminifier.com/ to minify // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: `@font-face{font-family:'General Sans';src:url(/static/fonts/GeneralSans-Regular.woff2) format('woff2'),url(/static/fonts/GeneralSans-Regular.ttf) format('truetype');font-weight:400;font-style:normal;font-display:swap;}@font-face{font-family:'General Sans';src:url(/static/fonts/GeneralSans-Medium.woff2) format('woff2'),url(/static/fonts/GeneralSans-Medium.ttf) format('truetype');font-weight:500;font-style:normal;font-display:swap;}@font-face{font-family:'General Sans';src:url(/static/fonts/GeneralSans-SemiBold.woff2) format('woff2'),url(/static/fonts/GeneralSans-SemiBold.ttf) format('truetype');font-weight:600;font-style:normal;font-display:swap;}@font-face{font-family:'General Sans';src:url(/static/fonts/GeneralSans-Bold.woff2) format('woff2'),url(/static/fonts/GeneralSans-Bold.ttf) format('truetype');font-weight:700;font-style:normal;font-display:swap;}`, }} /> <style // Loads IBM Plex Sans: 400,500,700 & IBM Plex Mono: 400, 600 // use https://cssminifier.com/ to minify // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: `@font-face{font-family:'IBM Plex Sans';src:url(/static/fonts/IBMPlexSans-Regular.woff2) format('woff2'),url(/static/fonts/IBMPlexSans-Regular.woff) format('woff'),url(/static/fonts/IBMPlexSans-Regular.ttf) format('truetype');font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:'IBM Plex Sans';src:url(/static/fonts/IBMPlexSans-Medium.woff2) format('woff2'),url(/static/fonts/IBMPlexSans-Medium.woff) format('woff'),url(/static/fonts/IBMPlexSans-Medium.ttf) format('truetype');font-weight:500;font-style:normal;font-display:swap}@font-face{font-family:'IBM Plex Sans';src:url(/static/fonts/IBMPlexSans-SemiBold.woff2) format('woff2'),url(/static/fonts/IBMPlexSans-SemiBold.woff) format('woff'),url(/static/fonts/IBMPlexSans-SemiBold.ttf) format('truetype');font-weight:600;font-style:normal;font-display:swap}@font-face{font-family:'IBM Plex Sans';src:url(/static/fonts/IBMPlexSans-Bold.woff2) format('woff2'),url(/static/fonts/IBMPlexSans-Bold.woff) format('woff'),url(/static/fonts/IBMPlexSans-Bold.ttf) format('truetype');font-weight:700;font-style:normal;font-display:swap}`, }} /> <GlobalStyles styles={{ // First SSR paint '.only-light-mode': { display: 'block', }, '.only-dark-mode': { display: 'none', }, // Post SSR Hydration '.mode-dark .only-light-mode': { display: 'none', }, '.mode-dark .only-dark-mode': { display: 'block', }, // TODO migrate to .only-dark-mode to .only-dark-mode-v2 '[data-mui-color-scheme="light"] .only-dark-mode-v2': { display: 'none', }, '[data-mui-color-scheme="dark"] .only-light-mode-v2': { display: 'none', }, '.plan-pro, .plan-premium': { display: 'inline-block', height: '1em', width: '1em', verticalAlign: 'middle', marginLeft: '0.3em', marginBottom: '0.08em', backgroundSize: 'contain', backgroundRepeat: 'no-repeat', }, '.plan-pro': { backgroundImage: 'url(/static/x/pro.svg)', }, '.plan-premium': { backgroundImage: 'url(/static/x/premium.svg)', }, }} /> </Head> <body> {getMuiInitColorSchemeScript({ defaultMode: 'system' })} {getJoyInitColorSchemeScript({ defaultMode: 'system' })} <Main /> <script // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: ` window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} window.gtag = gtag; gtag('js', new Date()); gtag('config', '${GOOGLE_ANALYTICS_ID_V4}', { send_page_view: false, }); `, }} /> {/** * A better alternative to <script async>, to delay its execution * https://developer.chrome.com/blog/script-component/ */} <Script strategy="afterInteractive" src={`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_ID_V4}`} /> <NextScript /> </body> </Html> ); } } // `getInitialProps` belongs to `_document` (instead of `_app`), // it's compatible with static-site generation (SSG). MyDocument.getInitialProps = async (ctx) => { // Resolution order // // On the server: // 1. app.getInitialProps // 2. page.getInitialProps // 3. document.getInitialProps // 4. app.render // 5. page.render // 6. document.render // // On the server with error: // 1. document.getInitialProps // 2. app.render // 3. page.render // 4. document.render // // On the client // 1. app.getInitialProps // 2. page.getInitialProps // 3. app.render // 4. page.render // Render app and page and get the context of the page with collected side effects. const jssSheets = new JSSServerStyleSheets(); const styledComponentsSheet = new ServerStyleSheet(); const originalRenderPage = ctx.renderPage; const cache = createEmotionCache(); const { extractCriticalToChunks } = createEmotionServer(cache); try { ctx.renderPage = () => originalRenderPage({ enhanceApp: (App) => (props) => styledComponentsSheet.collectStyles( jssSheets.collect(<App emotionCache={cache} {...props} />), ), }); const initialProps = await Document.getInitialProps(ctx); const emotionStyles = extractCriticalToChunks(initialProps.html); const emotionStyleTags = emotionStyles.styles.map((style) => ( <style data-emotion={`${style.key} ${style.ids.join(' ')}`} key={style.key} // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: style.css }} /> )); let css = jssSheets.toString(); // It might be undefined, e.g. after an error. if (css && process.env.NODE_ENV === 'production') { const result1 = await prefixer.process(css, { from: undefined }); css = result1.css; css = cleanCSS.minify(css).styles; } // All the URLs should have a leading /. // This is missing in the Next.js static export. let url = ctx.req.url; if (url[url.length - 1] !== '/') { url += '/'; } return { ...initialProps, canonicalAsServer: pathnameToLanguage(url).canonicalAsServer, userLanguage: ctx.query.userLanguage || 'en', // Styles fragment is rendered after the app and page rendering finish. styles: [ <style id="material-icon-font" key="material-icon-font" />, <style id="font-awesome-css" key="font-awesome-css" />, styledComponentsSheet.getStyleElement(), ...emotionStyleTags, <style id="jss-server-side" key="jss-server-side" // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: css }} />, <style id="app-search" key="app-search" />, <style id="prismjs" key="prismjs" />, <style id="insertion-point-jss" key="insertion-point-jss" />, ...React.Children.toArray(initialProps.styles), ], }; } finally { styledComponentsSheet.seal(); } };
3,977
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/about.tsx
import * as React from 'react'; import Divider from '@mui/material/Divider'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import AboutHero from 'docs/src/components/about/AboutHero'; import OurValues from 'docs/src/components/about/OurValues'; import Team from 'docs/src/components/about/Team'; import HowToSupport from 'docs/src/components/about/HowToSupport'; import AboutEnd from 'docs/src/components/about/AboutEnd'; import Head from 'docs/src/modules/components/Head'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; export default function About() { return ( <BrandingCssVarsProvider> <Head title="About us - MUI" description="MUI is a 100% remote globally distributed team, supported by a community of thousands of developers all across the world." /> <AppHeaderBanner /> <AppHeader /> <main id="main-content"> <AboutHero /> <Divider /> <OurValues /> <Divider /> <Team /> <Divider /> <HowToSupport /> <Divider /> <AboutEnd /> <Divider /> </main> <AppFooter /> </BrandingCssVarsProvider> ); }
3,978
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/base-theme.css
:root { --cyan-50: #e9f9fc; --cyan-100: #c1ecf4; --cyan-200: #99dae5; --cyan-300: #66bbca; --cyan-400: #1f91a5; --cyan-500: #0d535f; --cyan-600: #094651; --cyan-700: #063b44; --cyan-800: #042f37; --cyan-900: #022126; --grey-50: #f3f6f9; --grey-100: #e5eaf2; --grey-200: #dae2ed; --grey-300: #c7d0dd; --grey-400: #b0b8c4; --grey-500: #9da8b7; --grey-600: #6b7a90; --grey-700: #434d5b; --grey-800: #303740; --grey-900: #1c2025; } .GalleryBadge { margin: 0; padding: 0; font-size: 14px; font-variant: tabular-nums; list-style: none; font-family: IBM Plex Sans, sans-serif; position: relative; display: inline-block; line-height: 1; } .GalleryBadge-badge { box-sizing: border-box; z-index: auto; position: absolute; top: 0; right: 0; min-width: 22px; height: 22px; padding: 0 6px; color: #fff; font-weight: 600; font-size: 12px; line-height: 22px; white-space: nowrap; text-align: center; border-radius: 12px; background: var(--cyan-500); box-shadow: 0px 4px 8px var(--GalleryBadge-badge-boxShadow-color, var(--grey-300)); transform: translate(50%, -50%); transform-origin: 100% 0; } .GalleryBadge-content { width: 40px; height: 40px; border-radius: 12px; background: var(--GalleryBadge-content-background-color, var(--grey-300)); display: inline-block; vertical-align: middle; } @media (prefers-color-scheme: dark) { .GalleryBadge { --GalleryBadge-badge-boxShadow-color: var(--grey-900); --GalleryBadge-content-background-color: var(--grey-400); } } .GalleryButton { font-family: IBM Plex Sans, sans-serif; font-weight: 600; font-size: 0.875rem; line-height: 1.5; background-color: var(--cyan-500); padding: 8px 16px; border-radius: 8px; color: white; transition: all 150ms ease; cursor: pointer; border: 1px solid var(--cyan-500); box-shadow: 0 2px 4px var(--GalleryButton-boxShadow-color, rgba(13, 84, 99, 0.5)), inset 0 1.5px 1px var(--cyan-400), inset 0 -2px 1px var(--cyan-600); } .GalleryButton:hover { background-color: var(--cyan-600); } .GalleryButton:active { background-color: var(--cyan-700); box-shadow: none; } .GalleryButton:focus-visible { box-shadow: 0 0 0 4px var(--GalleryButton-focusVisible-boxShadow-color, var(--cyan-200)); outline: none; } .GalleryButton:disabled { background-color: var(--GalleryButton-disabled-background-color, var(--grey-200)); color: var(--GalleryButton-disabled-color, var(--grey-700)); border: 0; cursor: not-allowed; box-shadow: none; } .GalleryButton:disabled:hover { background-color: var(--GaleryButton-disabled-hover-background-color, var(--grey-200)); } @media (prefers-color-scheme: dark) { .GalleryButton { --GalleryButton-boxShadow-color: rgba(0, 0, 0, 0.5); --GalleryButton-focusVisible-boxShadow-color: var(--cyan-300); --GalleryButton-disabled-color: var(--grey-200); --GalleryButton-disabled-background-color: var(--grey-700); --GaleryButton-disabled-hover-background-color: var(--grey-700); } } .GalleryInput .MuiInput-input { width: 320px; font-family: IBM Plex Sans, sans-serif; font-size: 0.875rem; font-weight: 400; line-height: 1.5; padding: 8px 12px; border-radius: 8px; color: var(--GalleryInput-input-color, var(--grey-900)); background: var(--GalleryInput-input-background-color, '#fff'); border: 1px solid var(--GalleryInput-input-border-color, var(--grey-200)); box-shadow: 0px 2px 2px var(--GalleryInput-input-boxShadow-color, var(--grey-50)); } .GalleryInput .MuiInput-input:hover { border-color: var(--cyan-400); } .GalleryInput .MuiInput-input:focus { outline: 0; border-color: var(--cyan-400); box-shadow: 0 0 0 3px var(--GalleryInput-input-focus-boxShadow-color, var(--cyan-200)); } @media (prefers-color-scheme: dark) { .GalleryInput { --GalleryInput-input-color: var(--grey-300); --GalleryInput-input-background-color: var(--grey-900); --GalleryInput-input-border-color: var(--grey-700); --GalleryInput-input-boxShadow-color: var(--grey-900); --GalleryInput-input-focus-boxShadow-color: var(--cyan-600); } } .GalleryMenu-listbox { font-family: IBM Plex Sans, sans-serif; font-size: 0.875rem; box-sizing: border-box; padding: 6px; margin: 12px 0; min-width: 200px; border-radius: 12px; overflow: auto; outline: 0px; background: var(--GalleryMenu-listbox-background, #fff); border: 1px solid var(--GalleryMenu-listbox-border-color, var(--grey-200)); color: var(--GalleryMenu-listbox-color, var(--grey-900)); box-shadow: 0px 4px 30px var(--GalleryMenu-listbox-boxShadow-color, var(--grey-200)); } .GalleryMenu-item { list-style: none; padding: 8px; border-radius: 8px; cursor: default; user-select: none; } .GalleryMenu-item:last-of-type { border-bottom: none; } .GalleryMenu-item.Mui-focusVisible { outline: 3px solid var(--GalleryMenu-item-outline-color, var(--cyan-200)); background-color: var(--GalleryMenu-item-background-color, var(--grey-100)); color: var(--GalleryMenu-item-color, var(--grey-900)); } .GalleryMenu-item.Mui-disabled { color: var(--GalleryMenu-item-disabled-color, var(--grey-400)); } .GalleryMenu-item:hover:not(.Mui-disabled) { background-color: var(--GalleryMenu-item-hover-background-color, var(--cyan-50)); color: var(--GalleryMenu-item-hover-color, var(--grey-900)); } .GalleryMenu { z-index: 1; } @media (prefers-color-scheme: dark) { .GalleryInput { --GalleryMenu-listbox-background: var(--grey-900); --GalleryMenu-listbox-border-color: var(--grey-700); --GalleryMenu-listbox-color: var(--grey-300); --GalleryMenu-listbox-boxShadow-color: var(--grey-900); --GalleryMenu-item-outline-color: var(--cyan-600); --GalleryMenu-item-background-color: var(--grey-800); --GalleryMenu-item-color: var(--grey-300); --GalleryMenu-item-disabled-color: var(--grey-700); --GalleryMenu-item-hover-background-color: var(--cyan-800); --GalleryMenu-item-hover-color: var(--grey-300); } } .GalleryNumberInput { font-family: IBM Plex Sans, sans-serif; font-weight: 400; border-radius: 8px; color: var(--GalleryNumberInput-color, var(--grey-900)); background: var(--GalleryNumberInput-background-color, '#fff'); border: 1px solid var(--GalleryNumberInput-border-color, var(--grey-200)); box-shadow: 0px 2px 4px var(--GalleryNumberInput-boxShadow-color, rgba(0, 0, 0, 0.05)); display: grid; grid-template-columns: 1fr 19px; grid-template-rows: 1fr 1fr; overflow: hidden; column-gap: 8px; padding: 4px; } .GalleryNumberInput:hover { border-color: var(--cyan-400); } .GalleryNumberInput.Mui-focused { border-color: var(--cyan-400); box-shadow: 0 0 0 3px var(--GalleryNumberInput-focused-boxShadow-color, var(--cyan-200)); } .GalleryNumberInput .input { font-size: 0.875rem; font-family: inherit; font-weight: 400; line-height: 1.5; grid-column: 1/2; grid-row: 1/3; color: var(--GalleryNumberInput-input-color, var(--grey-900)); background: inherit; border: none; border-radius: inherit; padding: 8px 12px; outline: 0; } .GalleryNumberInput .input:focus-visible { outline: 0; } .GalleryNumberInput .btn { display: flex; flex-flow: row nowrap; justify-content: center; align-items: center; appearance: none; padding: 0; width: 19px; height: 19px; font-family: system-ui, sans-serif; font-size: 0.875rem; line-height: 1; box-sizing: border-box; background: var(--GalleryNumberInput-btn-background-color, '#fff'); border: 0; color: var(--GalleryNumberInput-btn-color, var(--grey-900)); transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 120ms; } .GalleryNumberInput .btn:hover { background: var(--GalleryNumberInput-btn-hover-background-color, var(--grey-50)); border-color: var(--GalleryNumberInput-btn-hover-border-color, var(--grey-300)); cursor: pointer; } .GalleryNumberInput .btn.increment { grid-column: 2/3; grid-row: 1/2; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid; border-bottom: 0; border-color: var(--GalleryNumberInput-btn-increment-border-color, var(--grey-200)); background: var(--GalleryNumberInput-btn-increment-background-color, var(--grey-50)); color: var(--GalleryNumberInput-btn-increment-color, var(--grey-900)); &:hover { cursor: pointer; color: #fff; background: var(--GalleryNumberInput-btn-increment-hover-background-color, var(--cyan-500)); border-color: var(--GalleryNumberInput-btn-increment-hover-color, var(--cyan-600)); } } .GalleryNumberInput .btn.decrement { grid-column: 2/3; grid-row: 2/3; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border: 1px solid; border-color: var(--GalleryNumberInput-btn-decrement-border-color, var(--grey-200)); background: var(--GalleryNumberInput-btn-decrement-background-color, var(--grey-50)); color: var(--GalleryNumberInput-btn-decrement-color, var(--grey-900)); } .GalleryNumberInput .btn.decrement:hover { cursor: pointer; color: #fff; background: var(--GalleryNumberInput-btn-decrement-hover-background-color, var(--cyan-500)); border-color: var(--GalleryNumberInput-btn-decrement-hover-border-color, var(--cyan-600)); } .GalleryNumberInput .btn.decrement .arrow { transform: translateY(-1px); } @media (prefers-color-scheme: dark) { .GalleryNumberInput { --GalleryNumberInput-color: var(--grey-300); --GalleryNumberInput-background-color: var(--grey-900); --GalleryNumberInput-border-color: var(--grey-700); --GalleryNumberInput-boxShadow-color: gba(0, 0, 0, 0.5); --GalleryNumberInput-focused-boxShadow-color: var(--cyan-500); --GalleryNumberInput-input-color: var(--grey-300); --GalleryNumberInput-btn-color: var(--grey-300); --GalleryNumberInput-btn-increment-border-color: var(--grey-800); --GalleryNumberInput-btn-increment-background-color: var(--grey-900); --GalleryNumberInput-btn-increment-color: var(--grey-200); --GalleryNumberInput-btn-increment-hover-background-color: var(--cyan-100); --GalleryNumberInput-btn-increment-hover-color: var(--cyan-400); --GalleryNumberInput-btn-decrement-hover-background-color: var(--cyan-100); --GalleryNumberInput-btn-decrement-hover-border-color: var(--cyan-400); --GalleryNumberInput-btn-decrement-border-color: var(--grey-800); --GalleryNumberInput-btn-decrement-background-color: var(--grey-900); --GalleryNumberInput-btn-decrement-color: var(--grey-200); --GalleryNumberInput-btn-hover-background-color: var(--grey-800); --GalleryNumberInput-btn-hover-border-color: var(--grey-600); --GalleryNumberInput-btn-background-color: var(--grey-900); } } .GalleryPopper, .GalleryPopup { border-radius: 8px; padding: 0.75rem; font-size: 0.875rem; font-family: 'IBM Plex Sans', sans-serif; font-weight: 500; opacity: 1; margin: 0.25rem 0px; } .GalleryPopper { background-color: var(--GalleryPopper-background-color, #fff); border: 1px solid var(--GalleryPopper-color, var(--grey-200)); box-shadow: 0 4px 8px var(--GalleryPopper-boxShadow-color, rgb(0 0 0 / 0.1)); color: var(--GalleryPopper-color, var(--grey-700)); } .GalleryPopup { background-color: var(--GalleryPopup-background-color, #fff); border: 1px solid var(--GalleryPopup-color, var(--grey-200)); box-shadow: 0 4px 8px var(--GalleryPopup-boxShadow-color, rgb(0 0 0 / 0.1)); color: var(--GalleryPopup-color, var(--grey-700)); } @media (prefers-color-scheme: dark) { .GalleryPopper { --GalleryPopper-background-color: var(--grey-900); --GalleryPopper-border-color: var(--grey-700); --GalleryPopper-color: var(--grey-100); --GalleryPopper-boxShadow-color: rgb(0 0 0 / 0.7); } .GalleryPopup { --GalleryPopup-background-color: var(--grey-900); --GalleryPopup-border-color: var(--grey-700); --GalleryPopup-color: var(--grey-100); --GalleryPopup-boxShadow-color: rgb(0 0 0 / 0.7); } } .GallerySelect { font-family: IBM Plex Sans, sans-serif; font-size: 0.875rem; box-sizing: border-box; min-width: 320px; padding: 8px 12px; border-radius: 8px; text-align: left; line-height: 1.5; background: var(--GallerySelect-background-color, #fff); border: 1px solid var(--GallerySelect-border-color, var(--grey-200)); color: var(--GallerySelect-color, var(--grey-900)); position: relative; box-shadow: 0px 2px 4px var(--GallerySelect-boxShadow-color, rgba(0, 0, 0, 0.05)); transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 120ms; &:hover { background: var(--GallerySelect-hover-background-color, var(--grey-50)); border-color: var(--GallerySelect-hover-border-color, var(--grey-300)); } &.Mui-focusVisible { outline: 0; border-color: var(--cyan-400); box-shadow: 0 0 0 3px var(--GallerySelect-focusVisible-boxShadow-color, var(--cyan-200)); } & > svg { font-size: 1rem; position: absolute; height: 100%; top: 0; right: 10px; } } .GallerySelect-listbox { font-family: IBM Plex Sans, sans-serif; font-size: 0.875rem; box-sizing: border-box; padding: 6px; margin: 12px 0; min-width: 320px; border-radius: 12px; overflow: auto; outline: 0px; background: var(--GallerySelect-listbox-background-color, #fff); border: 1px solid var(--GallerySelect-listbox-border-color, var(--grey-200)); color: var(--GallerySelect-listbox-color, var(--grey-900)); box-shadow: 0px 4px 6px var(--GallerySelect-listbox-boxShadow-color, rgba(0, 0, 0, 0.05)); } .GallerySelect-popper { z-index: 1; } .GallerySelect-option { list-style: none; padding: 8px; border-radius: 8px; cursor: default; &:last-of-type { border-bottom: none; } &.Mui-selected { background-color: var(--GallerySelect-option-selected-background-color, var(--cyan-100)); color: var(--GallerySelect-option-selected-color, var(--cyan-900)); } &.MuiOption-highlighted { background-color: var(--SelectGallery-option-highlighted-background-color, var(--grey-100)); color: var(--SelectGallery-option-highlighted-color, var(--grey-900)); } &.MuiOption-highlighted.Mui-selected { background-color: var( --GallerySelect-option-highlighted-selected-background-color, var(--cyan-100) ); color: var(--GallerySelect-option-highlighted-selected-color, var(--cyan-900)); } &.Mui-disabled { color: var(--GallerySelect-option-disabled-color var(--grey-700), var(--grey-400)); } &:hover:not(.Mui-disabled) { background-color: var(--GallerySelect-option-disabled-background-color, var(--grey-100)); color: var(--GallerySelect-option-disabled-color, var(--grey-900)); } } @media (prefers-color-scheme: dark) { .GallerySelect { --GallerySelect-background-color: var(--grey-900); --GallerySelect-border-color: var(--grey-700); --GallerySelect-color: var(--grey-300); --GallerySelect-boxShadow-color: rgba(0, 0, 0, 0.5); --GallerySelect-hover-background-color: var(--grey-800); --GallerySelect-hover-border-color: var(--grey-600); --GallerySelect-focusVisible-boxShadow-color: var(--cyan-600); --GallerySelect-listbox-background-color: var(--grey-900); --GallerySelect-listbox-border-color: var(--grey-700); --GallerySelect-listbox-color: var(--grey-300); --GallerySelect-listbox-boxShadow-color: rgba(0, 0, 0, 0.5); --GallerySelect-option-selected-background-color: var(--cyan-700); --GallerySelect-option-selected-color: var(--cyan-50); --GallerySelect-option-disabled-background-color: var(--grey-800); --GallerySelect-option-disabled-color: var(--grey-300); --SelectGallery-option-highlighted-background-color: var(--grey-800); --SelectGallery-option-highlighted-color: var(--grey-300); --GallerySelect-option-highlighted-selected-background-color: var(--cyan-700); --GallerySelect-option-highlighted-selected-color: var(--cyan-50); --GallerySelect-option-disabled-color: var(--grey-700); } } .GallerySlider { color: var(--GallerySlider-color, var(--cyan-500)); height: 6px; width: 100%; padding: 16px 0; display: inline-block; position: relative; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; } .GallerySlider:hover { opacity: 1; } .GallerySlider.Mui-disabled { pointer-events: none; cursor: default; color: var(--GallerySlider-disabled-color, var(--grey-300)); opacity: 0.5; outline: none; } .GallerySlider-rail { display: block; position: absolute; width: 100%; height: 4px; border-radius: 2px; background-color: currentColor; opacity: 0.4; } .GallerySlider-track { display: block; position: absolute; height: 4px; border-radius: 2px; background-color: currentColor; } .GallerySlider-thumb { position: absolute; width: 16px; height: 16px; margin-left: -6px; margin-top: -6px; box-sizing: border-box; border-radius: 50%; outline: 0; border: 3px solid currentColor; background-color: #fff; } /* TODO: alpha used, needs to be changed */ /* .GallerySlider-thumb:hover { box-shadow: 0 0 0 0.25rem ${alpha(isDarkMode ? var(--cyan-300) : var(--cyan-200), 0.5)}; } */ .GallerySlider-thumb:focus-visible { box-shadow: 0 0 0 4px var(--GallerySlider-focusVisible-boxShadow-color, var(--cyan-200)); } .GallerySlider-thumb.Mui-active { box-shadow: 0 0 0 4px var(--GallerySlider-active-boxShadow-color, var(--cyan-300)); } @media (prefers-color-scheme: dark) { .GallerySlider { --GallerySlider-color: var(--cyan-300); --GallerySlider-disabled-color: var(--grey-600); --GallerySlider-focusVisible-boxShadow-color: var(--cyan-700); --GallerySlider-active-boxShadow-color: var(--cyan-600); } } @keyframes in-right { from { transform: translateX(100%); } to { transform: translateX(0); } } .GallerySnackbar { position: fixed; z-index: 5500; display: flex; bottom: 16px; right: 16px; max-width: 560px; min-width: 300px; } .GallerySnackbar-content { display: flex; gap: 8px; overflow: hidden; background-color: var(--GallerySnackbar-content-background-color, #fff); border-radius: 8px; border: 1px solid var(--GallerySnackbar-content-border-color, var(--grey-200)); box-shadow: 0 2px 16px var(--GallerySnackbar-content-boxShadow-color, var(--grey-200)); padding: 0.75rem; color: var(--GallerySnackbar-content-color, var(--grey-900)); font-family: IBM Plex Sans, sans-serif; font-weight: 500; text-align: start; position: relative; & .snackbar-message { flex: 1 1 0%; max-width: 100%; } & .snackbar-title { margin: 0; line-height: 1.5rem; margin-right: 0.5rem; } & .snackbar-description { margin: 0; line-height: 1.5rem; font-weight: 400; color: var(--GallerySnackbar-description-color, var(--grey-800)); } & .snackbar-close-icon { cursor: pointer; flex-shrink: 0; padding: 2px; border-radius: 4px; &:hover { background: var(--GallerySnackbar-closeIcon-background-color, var(--grey-50)); } } } @media (prefers-color-scheme: dark) { .GallerySnackbar { --GallerySnackbar-content-background-color: var(--grey-900); --GallerySnackbar-content-border-color: var(--grey-700); --GallerySnackbar-content-color: var(--grey-50); --GallerySnackbar-description-color: var(--grey-400); --GallerySnackbar-closeIcon-background-color: var(--grey-800); --GallerySnackbar-content-boxShadow-color: rgba(0, 0, 0, 0.5); } } .GallerySwitch { font-size: 0; position: relative; display: inline-block; width: 38px; height: 24px; margin: 10px; cursor: pointer; } .GallerySwitch.Mui-disabled { opacity: 0.4; cursor: not-allowed; } .GallerySwitch-track { background: var(--GallerySwitch-track-background-color, var(--grey-50)); border: 1px solid var(--GallerySwitch-track-border-color, var(--grey-200)); border-radius: 24px; display: block; height: 100%; width: 100%; position: absolute; box-shadow: inset 0px 1px 1px var(--GallerySwitch-track-boxShadow-color, rgba(0, 0, 0, 0.05)); } .GallerySwitch:hover .GallerySwitch-track { background: var(--GallerySwitch-hover-track-background-color, var(--grey-100)); border-color: var(--GallerySwitch-hover-track-border-color, var(--grey-300)); } .GallerySwitch-thumb { display: block; width: 16px; height: 16px; top: 4px; left: 4px; border-radius: 16px; border: 1px solid var(--GallerySwitch-track-border-color, var(--grey-200)); background-color: #fff; position: relative; transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 120ms; } .GallerySwitch.Mui-focusVisible .GallerySwitch-track { box-shadow: 0 0 0 3px var(--GallerySwitch-focusVisible-track, var(--cyan-200)); } .GallerySwitch.Mui-checked .GallerySwitch-thumb { left: 18px; background-color: #fff; box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); } .GallerySwitch.Mui-checked .GallerySwitch-track { background: var(--cyan-500); } .GallerySwitch-input { cursor: inherit; position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0; z-index: 1; margin: 0; } @media (prefers-color-scheme: dark) { .GallerySwitch { --GallerySwitch-track-background-color: var(--grey-900); --GallerySwitch-track-border-color: var(--grey-800); --GallerySwitch-hover-track-background-color: var(--grey-800); --GallerySwitch-hover-track-border-color: var(--grey-600); --GallerySwitch-track-boxShadow-color: rgba(0, 0, 0, 0.5); --GallerySwitch-focusVisible-track: var(--cyan-400); } } /* Demo's table styles start */ .GalleryTablePaginationDemo { width: 500px; max-width: 100%; } .GalleryTablePaginationDemo th { background-color: var(--GalleryTablePaginationDemo-th-background-color, #fff); } .GalleryTablePaginationDemo table { font-family: IBM Plex Sans, sans-serif; font-size: 0.875rem; width: 100%; background-color: var(--GalleryTablePainationDemo-table-background-color, #fff); box-shadow: 0px 2px 16px var(--GalleryTablePainationDemo-table-boxShadow-color, var(--grey-200)); border-radius: 12px; overflow: hidden; border: 1px solid var(--GalleryTablePainationDemo-table-border-color, var(--grey-200)); } .GalleryTablePaginationDemo td, .GalleryTablePaginationDemo th { padding: 16px; } .GalleryTablePaginationDemo th { background-color: var(--GalleryTablePaginationDemo-th-background-color, #fff); } @media (prefers-color-scheme: dark) { .GalleryTablePaginationDemo { --GalleryTablePainationDemo-table-background-color: var(--grey-900); --GalleryTablePainationDemo-table-boxShadow-color: var(--grey-900); --GalleryTablePainationDemo-table-border-color: var(--grey-800); --GalleryTablePaginationDemo-th-background-color: var(--grey-900); --GalleryTablePaginationDemo-th-background-color: var(--grey-900); } } /* Demo's table styles end */ .GalleryTablePagination .MuiTablePagination-spacer { display: none; } .GalleryTablePagination .MuiTablePagination-toolbar { font-family: IBM Plex Sans, sans-serif; font-size: 0.875rem; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; @media (min-width: 768px) { flex-direction: row; align-items: center; } } .GalleryTablePagination .MuiTablePagination-selectLabel { margin: 0; } .GalleryTablePagination .MuiTablePagination-select { padding: 2px 6px; border: 1px solid var(--GalleryTablePagination-select-border-color, var(--grey-200)); border-radius: 50px; background-color: transparent; } .GalleryTablePagination .MuiTablePagination-select:hover { background-color: var(--GalleryTablePagination-select-hover-background-color, var(--grey-50)); } .GalleryTablePagination .MuiTablePagination-select:focus { outline: 1px solid var(--GalleryTablePagination-select-focus-outline-color, var(--cyan-200)); } .GalleryTablePagination .MuiTablePagination-displayedRows { margin: 0; @media (min-width: 768px) { margin-left: auto; } } .GalleryTablePagination .MuiTablePagination-actions { padding: 2px 6px; border: 1px solid var(--GalleryTablePagination-actions-border-color, var(--grey-200)); border-radius: 50px; text-align: center; } .GalleryTablePagination .MuiTablePagination-actions > button { margin: 0 8px; border: transparent; border-radius: 2px; background-color: transparent; } .GalleryTablePagination .MuiTablePagination-actions > button:hover { background-color: var( --GalleryTablePagination-actions-button-hover-background-color, var(--grey-50) ); } .GalleryTablePagination .MuiTablePagination-actions > button:focus { outline: 1px solid var(--GalleryTablePagination-actions-button-focus-outline-color, var(--cyan-200)); } .GalleryTablePagination .MuiTablePagination-actions > button:disabled { opacity: 0.7; } @media (prefers-color-scheme: dark) { .GalleryTablePagination { --GalleryTablePagination-select-border-color: var(--grey-800); --GalleryTablePagination-select-hover-background-color: var(--grey-800); --GalleryTablePagination-select-focus-outline-color: var(--cyan-400); --GalleryTablePagination-actions-border-color: var(--grey-800); --GalleryTablePagination-actions-button-hover-background-color: var(--grey-800); --GalleryTablePagination-actions-button-focus-outline-color: var(--cyan-400); } } .GalleryTabsList { min-width: 400px; background-color: var(--cyan-500); border-radius: 12px; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; align-content: space-between; box-shadow: 0px 4px 6px var(--GalleryTabsList-boxShadow-color, var(--grey-200)); } .GalleryTab { font-family: 'IBM Plex Sans', sans-serif; color: #fff; cursor: pointer; font-size: 0.875rem; font-weight: 600; background-color: transparent; width: 100%; padding: 10px 12px; margin: 6px; border: none; border-radius: 7px; display: flex; justify-content: center; } .GalleryTab:hover { background-color: var(--cyan-400); } .GalleryTab:focus { color: #fff; outline: 3px solid var(--cyan-200); } .GalleryTab.Mui-selected { background-color: #fff; color: var(--cyan-600); } .GalleryTab.Mui-disabled { opacity: 0.5; cursor: not-allowed; } .GalleryTabPanel { width: 100%; font-family: 'IBM Plex Sans', sans-serif; font-size: 0.875rem; padding: 20px 12px; background: var(--GalleryTabPanel-background-color, #fff); border: 1px solid var(--GalleryTabPanel-border-color, var(--grey-200)); border-radius: 12px; opacity: 0.6; } @media (prefers-color-scheme: dark) { .GalleryTabList { --GalleryTabsList-boxShadow-color: var(--grey-900); } .GalleryTabPanel { --GalleryTabPanel-background-color: var(--grey-900); --GalleryTabPanel-border-color: var(--grey-700); } } .GalleryTextarea { width: 320px; font-family: IBM Plex Sans, sans-serif; font-size: 0.875rem; font-weight: 400; line-height: 1.5; padding: 12px; border-radius: 8px 8px 0 8px; color: var(--GalleryTextarea-color, var(--grey-900)); background: var(--GalleryTextarea-background-color, '#fff'); border: 1px solid var(--GalleryTextarea-border-color, var(--grey-200)); box-shadow: 0px 2px 24px var(--GalleryTextarea-boxShadow-color, var(--grey-50)); } .GalleryTextarea:hover { border-color: var(--cyan-400); } .GalleryTextarea:focus { border-color: var(--cyan-400); box-shadow: 0 0 0 3px var(--GalleryTextarea-focus-boxShadow-color, var(--cyan-200)); outline: none; } /* firefox */ .GalleryTextarea:focus-visible { outline: 0; } @media (prefers-color-scheme: dark) { .GalleryTextarea { --GalleryTextarea-color: var(--grey-300); --GalleryTextarea-background-color: var(--grey-900); --GalleryTextarea-border-color: var(--grey-700); --GalleryTextarea-boxShadow-color: var(--cyan-900); --GalleryTextarea-focus-boxShadow-color: var(--cyan-600); } }
3,979
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/base-ui.tsx
import * as React from 'react'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; import BaseUIHero from 'docs/src/components/productBaseUI/BaseUIHero'; import BaseUISummary from 'docs/src/components/productBaseUI/BaseUISummary'; import BaseUIComponents from 'docs/src/components/productBaseUI/BaseUIComponents'; import BaseUICustomization from 'docs/src/components/productBaseUI/BaseUICustomization'; import BaseUIEnd from 'docs/src/components/productBaseUI/BaseUIEnd'; import BaseUITestimonial from 'docs/src/components/productBaseUI/BaseUITestimonial'; export default function Core() { return ( <BrandingCssVarsProvider> <Head title="Base UI: Ship accessible & sleek components" description={`Base UI is a library of headless ("unstyled") React UI components and low-level hooks. You can style them with any CSS solutions like PostCSS or Tailwind CSS.`} card="/static/blog/introducing-base-ui/card.png" > {/* eslint-disable-next-line @next/next/no-page-custom-font */} <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet" /> </Head> <AppHeaderBanner /> <AppHeader gitHubRepository="https://github.com/mui/material-ui" /> <main id="main-content"> <BaseUIHero /> <BaseUISummary /> <Divider /> <BaseUIComponents /> <Divider /> <BaseUICustomization /> <Divider /> <BaseUITestimonial /> <Divider /> <BaseUIEnd /> <Divider /> </main> <AppFooter /> </BrandingCssVarsProvider> ); }
3,980
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/blog.tsx
import * as React from 'react'; import { InferGetStaticPropsType } from 'next'; import { useRouter } from 'next/router'; import { alpha } from '@mui/material/styles'; import Avatar from '@mui/material/Avatar'; import AvatarGroup from '@mui/material/AvatarGroup'; import Box from '@mui/material/Box'; import Container from '@mui/material/Container'; import Divider from '@mui/material/Divider'; import Typography from '@mui/material/Typography'; import Paper from '@mui/material/Paper'; import Pagination from '@mui/material/Pagination'; import Button from '@mui/material/Button'; import KeyboardArrowRightRoundedIcon from '@mui/icons-material/KeyboardArrowRightRounded'; import Chip from '@mui/material/Chip'; import TwitterIcon from '@mui/icons-material/Twitter'; import GitHubIcon from '@mui/icons-material/GitHub'; import LinkedInIcon from '@mui/icons-material/LinkedIn'; import YouTubeIcon from '@mui/icons-material/YouTube'; import DiscordIcon from 'docs/src/icons/DiscordIcon'; import Head from 'docs/src/modules/components/Head'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import GradientText from 'docs/src/components/typography/GradientText'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import { authors as AUTHORS } from 'docs/src/modules/components/TopLayoutBlog'; import HeroEnd from 'docs/src/components/home/HeroEnd'; import Link from 'docs/src/modules/components/Link'; import generateRssFeed from 'docs/scripts/generateRSSFeed'; import Section from 'docs/src/layouts/Section'; import { getAllBlogPosts, BlogPost } from 'docs/lib/sourcing'; export const getStaticProps = () => { const data = getAllBlogPosts(); generateRssFeed(data.allBlogPosts); return { props: data, }; }; function PostPreview(props: BlogPost) { return ( <React.Fragment> <Box sx={{ display: 'flex', gap: 1, mb: 1.5 }}> {props.tags.map((tag) => ( <Chip key={tag} label={tag} size="small" sx={[ (theme) => ({ fontWeight: 500, color: (theme.vars || theme).palette.primary[600], background: (theme.vars || theme).palette.primary[50], border: '1px solid', borderColor: (theme.vars || theme).palette.primary[100], '&:hover': { background: (theme.vars || theme).palette.primary[50], }, }), (theme) => theme.applyDarkStyles({ color: (theme.vars || theme).palette.primary[100], background: alpha(theme.palette.primary[900], 0.4), borderColor: alpha(theme.palette.primary[800], 0.5), '&:hover': { background: alpha(theme.palette.primary[900], 0.4), }, }), ]} /> ))} </Box> <Typography component="h2" fontWeight="bold" variant="subtitle1" sx={{ mb: 0.5, }} > <Link aria-describedby={`describe-${props.slug}`} href={`/blog/${props.slug}`} sx={{ color: 'text.primary', '&:hover': { textDecoration: 'underline', }, }} > {props.title} </Link> </Typography> <Typography color="text.secondary" sx={{ mb: 'auto' }}> {props.description} </Typography> {props.authors && ( <AvatarGroup sx={[ (theme) => ({ mt: 2, mb: 1, alignSelf: 'flex-start', '& .MuiAvatar-circular': { width: 28, height: 28, border: 3, borderColor: '#FFF', backgroundColor: (theme.vars || theme).palette.grey[100], color: (theme.vars || theme).palette.grey[800], fontSize: theme.typography.pxToRem(13), fontWeight: 500, }, }), (theme) => theme.applyDarkStyles({ '& .MuiAvatar-circular': { borderColor: (theme.vars || theme).palette.primaryDark[800], backgroundColor: (theme.vars || theme).palette.primaryDark[700], color: (theme.vars || theme).palette.primaryDark[100], }, }), ]} > {(props.authors as Array<keyof typeof AUTHORS>).map((author) => ( <Avatar key={author} alt="" srcSet={`${AUTHORS[author].avatar}?s=${28 * 2} 2x`} src={`${AUTHORS[author].avatar}?s=${28}`} /> ))} </AvatarGroup> )} <Box sx={{ display: { sm: 'block', md: 'flex' }, justifyContent: 'space-between', alignItems: 'end', }} > <Box sx={{ position: 'relative' }}> {props.authors && ( <Typography variant="body2" fontWeight="500"> {props.authors .slice(0, 3) .map((userId) => { const name = AUTHORS[userId as keyof typeof AUTHORS]?.name; if (name) { if (props.authors && props.authors.length > 1) { // display only firstName return name.split(' ')[0]; } return name; } return userId; }) .join(', ')} {props.authors.length > 2 && ', and more.'} </Typography> )} {props.date && ( <Typography variant="caption" fontWeight="400" color="text.secondary"> {new Date(props.date).toDateString()} </Typography> )} </Box> <Button component={Link} aria-describedby={`describe-${props.slug}`} href={`/blog/${props.slug}`} id={`describe-${props.slug}`} endIcon={<KeyboardArrowRightRoundedIcon />} sx={(theme) => ({ mt: { xs: 1, md: 0 }, mb: { xs: -1, md: 0 }, color: (theme.vars || theme).palette.primary[600], '& .MuiButton-endIcon': { ml: 0, }, ...theme.applyDarkStyles({ color: (theme.vars || theme).palette.primary[300], }), })} > Read more </Button> </Box> </React.Fragment> ); } const PAGE_SIZE = 5; export default function Blog(props: InferGetStaticPropsType<typeof getStaticProps>) { const router = useRouter(); const postListRef = React.useRef<HTMLDivElement | null>(null); const [page, setPage] = React.useState(0); const [selectedTags, setSelectedTags] = React.useState<Record<string, boolean>>({}); const { allBlogPosts, tagInfo: rawTagInfo } = props; const [firstPost, secondPost, ...otherPosts] = allBlogPosts; const tagInfo = { ...rawTagInfo }; [firstPost, secondPost].forEach((post) => { post.tags.forEach((tag) => { if (tagInfo[tag]) { tagInfo[tag]! -= 1; } }); }); Object.entries(tagInfo).forEach(([tagName, tagCount]) => { if (tagCount === 0) { delete tagInfo[tagName]; } }); const filteredPosts = otherPosts.filter((post) => { if (Object.keys(selectedTags).length === 0) { return true; } return post.tags.some((tag) => { return Object.keys(selectedTags).includes(tag); }); }); const pageStart = page * PAGE_SIZE; const totalPage = Math.ceil(filteredPosts.length / PAGE_SIZE); const displayedPosts = filteredPosts.slice(pageStart, pageStart + PAGE_SIZE); const getTags = React.useCallback(() => { const { tags = '' } = router.query; return (typeof tags === 'string' ? tags.split(',') : tags || []) .map((str) => str.trim()) .filter((tag) => !!tag); }, [router.query]); React.useEffect(() => { const arrayTags = getTags(); const finalTags: Record<string, boolean> = {}; arrayTags.forEach((tag) => { finalTags[tag] = true; }); setSelectedTags(finalTags); setPage(0); }, [getTags]); const removeTag = (tag: string) => { router.push( { query: { ...router.query, tags: getTags().filter((value) => value !== tag), }, }, undefined, { shallow: true }, ); }; return ( <BrandingCssVarsProvider> <Head title="Blog - MUI" description="Follow the MUI blog to learn about new product features, latest advancements in UI development, and business initiatives." disableAlternateLocale /> <AppHeader /> <main id="main-content"> <Box sx={(theme) => ({ background: `linear-gradient(180deg, #FFF 50%, ${(theme.vars || theme).palette.primary[50]} 100%) `, ...theme.applyDarkStyles({ background: `linear-gradient(180deg, ${ (theme.vars || theme).palette.primaryDark[800] } 50%, ${alpha(theme.palette.primary[900], 0.2)} 100%) `, }), })} > <Section bg="transparent" cozy> <Typography variant="body2" color="primary.main" fontWeight="bold" textAlign="center" gutterBottom > Blog </Typography> <Typography component="h1" variant="h2" textAlign="center" sx={{ mb: { xs: 5, md: 10 } }} > The <GradientText>latest</GradientText> about MUI </Typography> <Box component="ul" sx={{ display: 'grid', m: 0, p: 0, gap: 2, gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', }} > {[firstPost, secondPost].map((post) => ( <Paper key={post.slug} component="li" variant="outlined" sx={[ { p: 2, display: 'flex', flexDirection: 'column', position: 'relative', transition: 'all ease 120ms', '&:hover, &:focus-within': { borderColor: 'grey.300', boxShadow: '0px 4px 20px rgba(170, 180, 190, 0.3)', }, '&:focus-within': { '& a': { outline: 0, }, }, }, (theme) => theme.applyDarkStyles({ '&:hover, &:focus-within': { borderColor: 'primary.600', boxShadow: '0px 4px 20px rgba(0, 0, 0, 0.5)', }, }), ]} > {post.image && ( <Box component="img" src={post.image} sx={{ aspectRatio: '16 / 9', width: '100%', height: 'auto', objectFit: 'cover', borderRadius: '4px', }} /> )} <PostPreview {...post} /> </Paper> ))} </Box> </Section> </Box> <Divider /> <Container ref={postListRef} sx={{ py: { xs: 4, sm: 6, md: 8 }, mt: -6, display: 'grid', gridTemplateColumns: { md: '1fr 380px' }, columnGap: 8, }} > <Typography component="h2" variant="h6" fontWeight="700" sx={{ mb: { xs: 1, sm: 2 }, mt: 8 }} // margin-top makes the title appear when scroll into view > Posts{' '} {Object.keys(selectedTags).length ? ( <span> tagged as{' '} <Typography component="span" variant="inherit" color="primary" noWrap> &quot;{Object.keys(selectedTags)[0]}&quot; </Typography> </span> ) : ( '' )} </Typography> <Box sx={{ gridRow: 'span 2' }}> <Box sx={(theme) => ({ position: 'sticky', top: 100, alignSelf: 'start', mb: 2, mt: { xs: 3, sm: 2, md: 9 }, // margin-top makes the title appear when scroll into view p: 2, borderRadius: 1, border: '1px solid', background: 'rgba(255, 255, 255, 0.2)', borderColor: (theme.vars || theme).palette.grey[200], ...theme.applyDarkStyles({ background: alpha(theme.palette.primaryDark[700], 0.2), borderColor: (theme.vars || theme).palette.primaryDark[700], }), })} > <Typography color="text.primary" fontWeight="semiBold" sx={{ mb: 2 }}> Filter by tag </Typography> <Box sx={{ display: 'flex', gap: 1, flexWrap: 'wrap' }}> {Object.keys(tagInfo).map((tag) => { const selected = !!selectedTags[tag]; return ( <Chip key={tag} variant={selected ? 'filled' : 'outlined'} color={selected ? 'primary' : undefined} {...(selected ? { label: tag, onDelete: () => { postListRef.current?.scrollIntoView(); removeTag(tag); }, } : { label: tag, onClick: () => { postListRef.current?.scrollIntoView(); router.push( { query: { ...router.query, tags: tag, }, }, undefined, { shallow: true }, ); }, })} size="small" sx={{ py: 1.2, }} /> ); })} </Box> <Divider sx={{ mt: 3, mb: 2 }} /> <Typography color="text.primary" fontWeight="semiBold" sx={{ mb: 1 }}> Want to hear more from us? </Typography> <Typography variant="body2" color="text.secondary" sx={{ mb: 2 }}> Stay on the loop about everything MUI-related through our social media: </Typography> <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 2, '* > svg': { mr: 1 } }}> <Link href="https://github.com/mui" target="_blank" fontSize={14}> <GitHubIcon fontSize="small" /> GitHub </Link> <Link href="https://twitter.com/MUI_hq" target="_blank" fontSize={14}> <TwitterIcon fontSize="small" /> Twitter </Link> <Link href="https://mui.com/r/discord/" target="_blank" fontSize={14}> <DiscordIcon fontSize="small" /> Discord </Link> <Link href="https://www.linkedin.com/company/mui/" target="_blank" fontSize={14}> <LinkedInIcon fontSize="small" /> LinkedIn </Link> <Link href="https://www.youtube.com/@MUI_hq" target="_blank" fontSize={14}> <YouTubeIcon fontSize="small" /> Youtube </Link> </Box> </Box> </Box> <div> <Box component="ul" sx={{ p: 0, m: 0 }}> {displayedPosts.map((post) => ( <Box component="li" key={post.slug} sx={() => ({ py: 2.5, display: 'flex', flexDirection: 'column', position: 'relative', '&:not(:last-of-type)': { borderBottom: '1px solid', borderColor: 'divider', }, })} > <PostPreview {...post} /> </Box> ))} </Box> <Pagination page={page + 1} count={totalPage} variant="outlined" shape="rounded" onChange={(_, value) => { setPage(value - 1); postListRef.current?.scrollIntoView(); }} sx={{ mt: 1, mb: 8 }} /> </div> </Container> </main> <Divider /> <HeroEnd /> <Divider /> <AppFooter /> </BrandingCssVarsProvider> ); }
3,981
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/careers.tsx
import * as React from 'react'; import { styled } from '@mui/material/styles'; import Box from '@mui/material/Box'; import Divider from '@mui/material/Divider'; import Grid from '@mui/material/Grid'; import Stack from '@mui/material/Stack'; import Paper from '@mui/material/Paper'; import Button from '@mui/material/Button'; import Badge from '@mui/material/Badge'; import Typography from '@mui/material/Typography'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded'; import MuiAccordion from '@mui/material/Accordion'; import MuiAccordionSummary from '@mui/material/AccordionSummary'; import MuiAccordionDetail from '@mui/material/AccordionDetails'; import OurValues from 'docs/src/components/about/OurValues'; import Link from 'docs/src/modules/components/Link'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import GradientText from 'docs/src/components/typography/GradientText'; import IconImage from 'docs/src/components/icon/IconImage'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import Section from 'docs/src/layouts/Section'; import SectionHeadline from 'docs/src/components/typography/SectionHeadline'; import Head from 'docs/src/modules/components/Head'; import ROUTES from 'docs/src/route'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; interface RoleProps { description: string; title: string; url?: string; } function Role(props: RoleProps) { if (props.url) { return ( <Box component="div" sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'start', flexDirection: { xs: 'column', lg: 'row' }, }} > <span> <Typography variant="body1" color="text.primary" fontWeight="semiBold" gutterBottom> {props.title} </Typography> <Typography component="p" color="text.secondary" sx={{ maxWidth: 700 }}> {props.description} </Typography> </span> <Button component="a" // @ts-expect-error variant="link" size="small" href={props.url} endIcon={<KeyboardArrowRightRounded />} > More about this role </Button> </Box> ); } return ( <div> <Typography variant="body1" color="text.primary" fontWeight={700} sx={{ my: 1 }}> {props.title} </Typography> <Typography color="text.secondary" sx={{ maxWidth: 700 }}> {props.description} </Typography> </div> ); } const Accordion = styled(MuiAccordion)(({ theme }) => ({ padding: theme.spacing(2), transition: theme.transitions.create('box-shadow'), borderRadius: theme.shape.borderRadius, '&:hover': { boxShadow: '0 4px 8px 0 rgb(90 105 120 / 20%)', }, '&:not(:last-of-type)': { marginBottom: theme.spacing(2), }, '&:before': { display: 'none', }, '&:after': { display: 'none', }, })); const AccordionSummary = styled(MuiAccordionSummary)(({ theme }) => ({ padding: theme.spacing(2), margin: theme.spacing(-2), minHeight: 'auto', '&.Mui-expanded': { minHeight: 'auto', }, '& .MuiAccordionSummary-content': { margin: 0, paddingRight: theme.spacing(2), '&.Mui-expanded': { margin: 0, }, }, })); const AccordionDetails = styled(MuiAccordionDetail)(({ theme }) => ({ marginTop: theme.spacing(1), padding: 0, })); const faqData = [ { summary: 'Are there application deadlines?', detail: 'No. If a job is visible on our careers page, then you can still apply.', }, { summary: 'Does MUI do whiteboarding during interviews?', detail: 'No. We ask applicants to complete challenges that are close to their future day-to-day contributions.', }, { summary: 'Does MUI offer contract job opportunities?', detail: 'Yes. People outside of France can be hired as full-time contractors. (Benefits may vary.)', }, ]; const openRolesData = [ { title: 'Engineering', roles: [ { title: 'React Engineer - xCharts', description: 'You will help form the xCharts team, build ambitious and complex new features, work on strategic problems, and help grow adoption.', url: '/careers/react-engineer-x-charts/', }, { title: 'React Engineer - X', description: 'You will strengthen the MUI X product, build ambitious and complex new features, work on strategic problems, and help grow adoption.', url: '/careers/react-engineer-x/', }, ], }, { title: 'Design', roles: [ { title: 'Design Engineer - xGrid', description: 'You will design and implement a great user and developer experience for the MUI X Data Grid.', url: '/careers/design-engineer-x-grid/', }, ], }, ]; const nextRolesData = [ { title: 'Engineering', roles: [ { title: 'Accessibility Engineer', description: 'You will become our go-to expert for accessibility, to ensure all products meet or exceed WCAG 2.1 level AA guidelines.', url: '/careers/accessibility-engineer/', }, { title: 'Full-stack Engineer - Toolpad', description: 'You will join the MUI Toolpad team, to explore the role of MUI in the low code space and help bring the early prototype to a usable product.', url: '/careers/fullstack-engineer/', }, // { // title: 'React Engineer - X', // description: // 'You will strengthen the MUI X product, build ambitious and complex new features, work on strategic problems, and help grow adoption.', // url: '/careers/react-engineer-x/', // }, { title: 'React Tech Lead - Core', description: 'You will lead the development of MUI Core, positioning the library as the industry standard for design teams while doubling its adoption.', url: '/careers/react-tech-lead-core/', }, { title: 'React Engineer - Core', description: 'You will strengthen the core components team by collaborating with the community to land contributions.', url: '/careers/react-engineer-core/', }, { title: 'React Community Engineer - X', description: 'You will provide guidance to the community and solve their struggle, working primarily in the advanced components team.', url: '/careers/react-community-engineer/', }, ], }, { title: 'Design', roles: [ { title: 'Design Engineer', description: 'You will focus on design to implement great product experiences.', url: '/careers/design-engineer/', }, ], }, { title: 'People', roles: [ { title: 'Technical Recruiter', description: 'You will hire the next engineers, among other roles, joining the team.', url: '/careers/technical-recruiter/', }, ], }, { title: 'Sales', roles: [ { title: 'Account Executive', description: 'You will build client relationships and manage the sales process from start to finish.', }, ], }, { title: 'Support', roles: [ { title: 'Support Agent', description: 'You will provide support for the customers. You will directly impact customer satisfaction and success.', }, ], }, { title: 'Marketing', roles: [ { title: 'Product Marketing Manager', description: 'You will own the marketing efforts at MUI.', url: '/careers/product-marketing-manager/', }, ], }, ] as typeof openRolesData; function renderFAQItem(index: number, defaultExpanded?: boolean) { const faq = faqData[index]; return ( <Accordion variant="outlined" defaultExpanded={defaultExpanded}> <AccordionSummary expandIcon={<KeyboardArrowDownRounded sx={{ fontSize: 20, color: 'primary.main' }} />} > <Typography variant="body2" fontWeight="bold" component="h3"> {faq.summary} </Typography> </AccordionSummary> <AccordionDetails> <Typography component="div" variant="body2" color="text.secondary" sx={{ '& ul': { pl: 2 } }} > {faq.detail} </Typography> </AccordionDetails> </Accordion> ); } function CareersContent() { return ( <React.Fragment> {/* Hero */} <Section cozy> <SectionHeadline alwaysCenter overline="Join us" title={ <Typography variant="h2" component="h1"> Build <GradientText>the next generation</GradientText> <br /> of tools for UI development </Typography> } description="Together, we are enabling developers & designers to bring stunning UIs to life with unrivalled speed and ease." /> </Section> <Divider /> <OurValues /> <Divider /> {/* Perks & benefits */} <Section bg="gradient" cozy> <Grid container spacing={5} alignItems="center"> <Grid item md={6}> <SectionHeadline overline="Working at MUI" title={ <Typography variant="h2" id="perks-and-benefits"> Perks & benefits </Typography> } description="To help you go above and beyond with us, we provide:" /> {[ ['100% remote work:', 'Our entire company is globally distributed.'], [ 'Retreats:', 'We meet up every 8 months for a week of working & having fun together!', ], [ 'Equipment:', 'We provide the hardware of your choice (initial grant of $2,500 USD).', ], ['Time off:', 'We provide 33 days of paid time off globally.'], ].map((textArray) => ( <Box key={textArray[0]} sx={{ display: 'flex', alignItems: 'center', mt: 1 }}> <IconImage name="pricing/yes" /> <Typography variant="body2" color="text.primary" sx={{ ml: 1 }}> <span style={{ fontWeight: 600 }}>{`${textArray[0]} `}</span> {textArray[1]} </Typography> </Box> ))} </Grid> <Grid item xs={12} md={6} container> <Box sx={{ display: 'flex', flexDirection: { xs: 'column', sm: 'row' }, gap: 2 }}> <Paper component={Link} href={ROUTES.handbook} noLinkStyle variant="outlined" sx={{ p: 2, width: '100%' }} > <Typography variant="body2" fontWeight="bold" sx={{ mb: 0.5 }}> Handbook </Typography> <Typography variant="body2" color="text.secondary" sx={{ mb: 1 }}> Learn everything about how MUI as a company is run. </Typography> <Typography sx={(theme) => ({ color: 'primary.600', ...theme.applyDarkStyles({ color: 'primary.400', }), })} variant="body2" fontWeight="bold" > Learn more{' '} <KeyboardArrowRightRounded fontSize="small" sx={{ verticalAlign: 'middle' }} /> </Typography> </Paper> <Paper component={Link} href={ROUTES.blog} noLinkStyle variant="outlined" sx={{ p: 2, width: '100%' }} > <Typography variant="body2" fontWeight="bold" sx={{ mb: 0.5 }}> Blog </Typography> <Typography variant="body2" color="text.secondary" sx={{ mb: 1 }}> Check behind the scenes and news from the company. </Typography> <Typography sx={(theme) => ({ color: 'primary.600', ...theme.applyDarkStyles({ color: 'primary.400', }), })} variant="body2" fontWeight="bold" > Learn more{' '} <KeyboardArrowRightRounded fontSize="small" sx={{ verticalAlign: 'middle' }} /> </Typography> </Paper> </Box> </Grid> </Grid> </Section> <Divider /> {/* Open roles */} <Section cozy> <SectionHeadline title={ <Typography variant="h2" id="open-roles" gutterBottom> Open roles <Badge badgeContent={openRolesData.reduce((acc, item) => acc + item.roles.length, 0)} color="success" showZero sx={{ ml: 3 }} /> </Typography> } description="The company is bootstrapped (so far). It was incorporated in mid-2019 and is growing fast (x2 YoY). We doubled the team in 2020 (6), and kept a similar pace since: 2021 (15), 2022 (25). We plan to reach 40 people in 2023. We're looking for help to grow in the following areas:" /> <Divider sx={{ my: { xs: 2, sm: 4 } }} /> <Stack spacing={2} divider={ <Divider sx={(theme) => ({ my: { xs: 1, sm: 2 }, borderColor: 'grey.100', ...theme.applyDarkStyles({ borderColor: 'primaryDark.600', }), })} /> } > {openRolesData.map((category) => { const roles = category.roles; return ( <React.Fragment key={category.title}> <Typography component="h3" variant="h5" fontWeight="extraBold"> {category.title} </Typography> {roles.length > 0 ? ( roles.map((role) => ( <Role key={role.title} title={role.title} description={role.description} url={role.url} /> )) ) : ( <Typography color="text.secondary">No open roles.</Typography> )} </React.Fragment> ); })} </Stack> </Section> <Divider /> {/* Next roles */} {nextRolesData.length > 0 && ( <Box data-mui-color-scheme="dark" sx={{ bgcolor: 'primaryDark.900' }}> <Section bg="transparent"> <SectionHeadline title={ <Typography variant="h2" id="next-roles" gutterBottom> Next roles </Typography> } description={ <React.Fragment> If none of the roles below fit with what you are looking for, apply to the{' '} <Link href="https://jobs.ashbyhq.com/MUI/4715d81f-d00f-42d4-a0d0-221f40f73e19/application?utm_source=ZNRrPGBkqO"> Dream job </Link>{' '} role! </React.Fragment> } /> <Divider sx={{ my: { xs: 2, sm: 4 } }} /> <Stack spacing={2} divider={<Divider sx={{ my: { xs: 1, sm: 2 } }} />}> {nextRolesData.map((category) => { const roles = category.roles; return ( <React.Fragment key={category.title}> <Typography component="h3" variant="h5" fontWeight="extraBold"> {category.title} </Typography> {roles.length > 0 ? ( roles.map((role) => ( <Role key={role.title} title={role.title} description={role.description} url={role.url} /> )) ) : ( <Typography color="text.secondary">No plans yet.</Typography> )} </React.Fragment> ); })} </Stack> </Section> </Box> )} <Divider /> {/* Frequently asked questions */} <Section bg="transparent"> <Typography variant="h2" sx={{ mb: { xs: 2, sm: 4 } }}> Frequently asked questions </Typography> <Grid container spacing={2}> <Grid item xs={12} md={6}> {renderFAQItem(0, true)} {renderFAQItem(1)} </Grid> <Grid item xs={12} md={6}> {renderFAQItem(2)} <Paper variant="outlined" sx={(theme) => ({ p: 2, borderStyle: 'dashed', borderColor: 'divider', bgcolor: 'white', ...theme.applyDarkStyles({ bgcolor: 'primaryDark.800', }), })} > <Box sx={{ textAlign: 'left' }}> <Typography variant="body2" color="text.primary" fontWeight="bold"> Got any questions unanswered or need more help? </Typography> </Box> <Typography variant="body2" color="text.secondary" sx={{ my: 1, textAlign: 'left' }}> We&apos;re here to help you with any other question you have about our hiring process. </Typography> <Link href="mailto:[email protected]" variant="body2"> Contact us <KeyboardArrowRightRounded fontSize="small" /> </Link> </Paper> </Grid> </Grid> </Section> </React.Fragment> ); } export default function Careers() { return ( <BrandingCssVarsProvider> <Head title="Careers - MUI" description="Interested in joining MUI? Learn about the roles we're hiring for." /> <AppHeaderBanner /> <AppHeader /> <main id="main-content"> <CareersContent /> </main> <Divider /> <AppFooter /> </BrandingCssVarsProvider> ); }
3,982
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/components.tsx
import * as React from 'react'; import Box from '@mui/material/Box'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import ListItemButton from '@mui/material/ListItemButton'; import Typography from '@mui/material/Typography'; import Divider from '@mui/material/Divider'; import KeyboardArrowRightRounded from '@mui/icons-material/KeyboardArrowRightRounded'; import Head from 'docs/src/modules/components/Head'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import Section from 'docs/src/layouts/Section'; import { pageToTitleI18n } from 'docs/src/modules/utils/helpers'; import { useTranslate } from 'docs/src/modules/utils/i18n'; import Link from 'docs/src/modules/components/Link'; import type { MuiPage } from 'docs/src/MuiPage'; import materialPages from 'docs/data/material/pages'; export default function Components() { const t = useTranslate(); const pages = materialPages; const componentPageData = pages.find(({ title }) => title === 'Components'); function renderItem(aPage: MuiPage) { return ( <ListItem key={aPage.pathname} disablePadding> <ListItemButton component={Link} noLinkStyle href={aPage.pathname} sx={{ px: 1, py: 0.5, fontSize: '0.84375rem', fontWeight: 500, '&:hover, &:focus': { '& svg': { opacity: 1 } }, }} > {pageToTitleI18n(aPage, t) || ''} <KeyboardArrowRightRounded sx={{ ml: 'auto', fontSize: '1.125rem', opacity: 0, color: 'primary.main', }} /> </ListItemButton> </ListItem> ); } return ( <BrandingCssVarsProvider> <Head title="Components - MUI" description="MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design. You will develop React applications faster." /> <AppHeader /> <main id="main-content"> <Section bg="gradient" sx={{ py: { xs: 2, sm: 4 } }}> <Typography component="h1" variant="h2" sx={{ mb: 4, pl: 1 }}> All Components </Typography> <Box sx={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(200px, 1fr))', }} > {(componentPageData?.children || []).map((page) => ( <Box key={page.pathname} sx={{ pb: 2 }}> <Typography component="h2" variant="body2" sx={{ fontWeight: 500, color: 'grey.600', px: 1, }} > {pageToTitleI18n(page, t)} </Typography> <List> {(page.children || []).map((nestedPage) => { if (nestedPage.children) { return ( <ListItem key={nestedPage.pathname} sx={{ py: 0, px: 1 }}> <Box sx={{ width: '100%', pt: 1 }}> <Typography component="div" variant="body2" sx={{ fontWeight: 500, color: 'grey.600', }} > {pageToTitleI18n(nestedPage, t) || ''} </Typography> <List>{nestedPage.children.map(renderItem)}</List> </Box> </ListItem> ); } return renderItem(nestedPage); })} </List> </Box> ))} </Box> </Section> </main> <Divider /> <AppFooter /> </BrandingCssVarsProvider> ); }
3,983
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/core.tsx
import * as React from 'react'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import AppHeader from 'docs/src/layouts/AppHeader'; import CoreHero from 'docs/src/components/productCore/CoreHero'; import CoreProducts from 'docs/src/components/productCore/CoreProducts'; import CoreHeroEnd from 'docs/src/components/productCore/CoreHeroEnd'; import References, { CORE_CUSTOMERS } from 'docs/src/components/home/References'; import AppFooter from 'docs/src/layouts/AppFooter'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; export default function Core() { return ( <BrandingCssVarsProvider> <Head title="MUI Core: Ready to use components, free forever" description="Get a growing list of React components, ready-to-use, free forever and with accessibility always in mind." card="/static/social-previews/core-preview.jpg" /> <AppHeaderBanner /> <AppHeader gitHubRepository="https://github.com/mui/material-ui" /> <main id="main-content"> <CoreHero /> <CoreProducts /> <Divider /> <References companies={CORE_CUSTOMERS} /> <Divider /> <CoreHeroEnd /> <Divider /> </main> <AppFooter stackOverflowUrl="https://stackoverflow.com/questions/tagged/material-ui" /> </BrandingCssVarsProvider> ); }
3,984
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/design-kits.tsx
import * as React from 'react'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import DesignKitHero from 'docs/src/components/productDesignKit/DesignKitHero'; import DesignKitValues from 'docs/src/components/productDesignKit/DesignKitValues'; import DesignKitDemo from 'docs/src/components/productDesignKit/DesignKitDemo'; import DesignKitFAQ from 'docs/src/components/productDesignKit/DesignKitFAQ'; import Testimonials from 'docs/src/components/home/Testimonials'; import HeroEnd from 'docs/src/components/home/HeroEnd'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import References, { DESIGNKITS_CUSTOMERS } from 'docs/src/components/home/References'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; export default function DesignKits() { return ( <BrandingCssVarsProvider> <Head title="Material UI in your favorite design tool" description="Pick your favorite design tool to enjoy and use Material UI components. Boost consistency and facilitate communication when working with developers." card="/static/social-previews/designkits-preview.jpg" /> <AppHeaderBanner /> <AppHeader gitHubRepository="https://github.com/mui/mui-design-kits" /> <main id="main-content"> <DesignKitHero /> <References companies={DESIGNKITS_CUSTOMERS} /> <Divider /> <DesignKitValues /> <Divider /> <DesignKitDemo /> <Divider /> <DesignKitFAQ /> <Divider /> <Testimonials /> <Divider /> <HeroEnd /> </main> <Divider /> <AppFooter /> </BrandingCssVarsProvider> ); }
3,985
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/global.css
@tailwind base; @tailwind components; @tailwind utilities;
3,986
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/index.tsx
import * as React from 'react'; import NoSsr from '@mui/material/NoSsr'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import AppHeader from 'docs/src/layouts/AppHeader'; import Hero from 'docs/src/components/home/Hero'; import References, { CORE_CUSTOMERS } from 'docs/src/components/home/References'; import ProductSuite from 'docs/src/components/home/ProductSuite'; import ValueProposition from 'docs/src/components/home/ValueProposition'; import DesignSystemComponents from 'docs/src/components/home/DesignSystemComponents'; import Testimonials from 'docs/src/components/home/Testimonials'; import Sponsors from 'docs/src/components/home/Sponsors'; import HeroEnd from 'docs/src/components/home/HeroEnd'; import AppFooter from 'docs/src/layouts/AppFooter'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import NewsletterToast from 'docs/src/components/home/NewsletterToast'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; export default function Home() { return ( <BrandingCssVarsProvider> <Head title="MUI: The React component library you always wanted" description="MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design." > <script type="application/ld+json" // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML={{ __html: JSON.stringify({ '@context': 'https://schema.org', '@type': 'Organization', name: 'MUI', url: 'https://mui.com/', logo: 'https://mui.com/static/logo.png', sameAs: [ 'https://twitter.com/MUI_hq', 'https://github.com/mui/', 'https://opencollective.com/mui-org', ], }), }} /> </Head> <NoSsr> <NewsletterToast /> </NoSsr> <AppHeaderBanner /> <AppHeader /> <main id="main-content"> <Hero /> <References companies={CORE_CUSTOMERS} /> <Divider /> <ProductSuite /> <Divider /> <ValueProposition /> <Divider /> <DesignSystemComponents /> <Divider /> <Testimonials /> <Divider /> <Sponsors /> <Divider /> <HeroEnd /> <Divider /> </main> <AppFooter /> </BrandingCssVarsProvider> ); }
3,987
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/material-ui.tsx
import * as React from 'react'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import AppHeader from 'docs/src/layouts/AppHeader'; import MaterialHero from 'docs/src/components/productMaterial/MaterialHero'; import MaterialComponents from 'docs/src/components/productMaterial/MaterialComponents'; import MaterialTheming from 'docs/src/components/productMaterial/MaterialTheming'; import MaterialStyling from 'docs/src/components/productMaterial/MaterialStyling'; import MaterialTemplates from 'docs/src/components/productMaterial/MaterialTemplates'; import MaterialDesignKits from 'docs/src/components/productMaterial/MaterialDesignKits'; import CoreHeroEnd from 'docs/src/components/productCore/CoreHeroEnd'; import References, { CORE_CUSTOMERS } from 'docs/src/components/home/References'; import AppFooter from 'docs/src/layouts/AppFooter'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; export default function Core() { return ( <BrandingCssVarsProvider> <Head title="Material UI: React components based on Material Design" description="Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box." card="/static/social-previews/core-preview.jpg" /> <AppHeaderBanner /> <AppHeader gitHubRepository="https://github.com/mui/material-ui" /> <main id="main-content"> <MaterialHero /> <References companies={CORE_CUSTOMERS} /> <Divider /> <MaterialComponents /> <Divider /> <MaterialTheming /> <Divider /> <MaterialStyling /> <Divider /> <MaterialTemplates /> <Divider /> <MaterialDesignKits /> <Divider /> <CoreHeroEnd /> <Divider /> </main> <AppFooter stackOverflowUrl="https://stackoverflow.com/questions/tagged/material-ui" /> </BrandingCssVarsProvider> ); }
3,988
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/pricing.tsx
import * as React from 'react'; import Container from '@mui/material/Container'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import AppHeader from 'docs/src/layouts/AppHeader'; import HeroPricing from 'docs/src/components/pricing/HeroPricing'; import PricingTable from 'docs/src/components/pricing/PricingTable'; import PricingList from 'docs/src/components/pricing/PricingList'; import Testimonials from 'docs/src/components/home/Testimonials'; import PricingWhatToExpect from 'docs/src/components/pricing/PricingWhatToExpect'; import PricingFAQ from 'docs/src/components/pricing/PricingFAQ'; import HeroEnd from 'docs/src/components/home/HeroEnd'; import AppFooter from 'docs/src/layouts/AppFooter'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; import { LicensingModelProvider } from 'docs/src/components/pricing/LicensingModelContext'; export default function Pricing() { return ( <BrandingCssVarsProvider> <Head title="Pricing - MUI" description="The community edition lets you get going right away. Switch to a commercial plan for more components & technical support." /> <AppHeaderBanner /> <AppHeader /> <main id="main-content"> <HeroPricing /> <Divider /> <LicensingModelProvider> {/* Mobile, Tablet */} <Container sx={{ display: { xs: 'block', md: 'none' }, pb: 3, mt: '-1px' }}> <PricingList /> </Container> {/* Desktop */} <Container sx={{ display: { xs: 'none', md: 'block' } }}> <PricingTable /> </Container> </LicensingModelProvider> <PricingWhatToExpect /> <Divider /> <PricingFAQ /> <Divider /> <Testimonials /> <Divider /> <HeroEnd /> <Divider /> </main> <AppFooter /> </BrandingCssVarsProvider> ); }
3,989
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/production-error.js
import * as React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; import * as pageProps from 'docs/src/pages/production-error/index.md?@mui/markdown'; export default function Page() { return <MarkdownDocs {...pageProps} disableAd />; }
3,990
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/templates.tsx
import * as React from 'react'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import AppHeader from 'docs/src/layouts/AppHeader'; import AppFooter from 'docs/src/layouts/AppFooter'; import TemplateHero from 'docs/src/components/productTemplate/TemplateHero'; import ValueProposition from 'docs/src/components/home/ValueProposition'; import TemplateDemo from 'docs/src/components/productTemplate/TemplateDemo'; import Testimonials from 'docs/src/components/home/Testimonials'; import HeroEnd from 'docs/src/components/home/HeroEnd'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import References, { TEMPLATES_CUSTOMERS } from 'docs/src/components/home/References'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; export default function Templates() { return ( <BrandingCssVarsProvider> <Head title="Fully built Material UI templates - MUI" description="A collection of 4.5 average rating templates, selected and curated by MUI's team of maintainers to get your projects up and running today." card="/static/social-previews/templates-preview.jpg" /> <AppHeaderBanner /> <AppHeader /> <main id="main-content"> <TemplateHero /> <References companies={TEMPLATES_CUSTOMERS} /> <Divider /> <ValueProposition /> <Divider /> <TemplateDemo /> <Divider /> <Testimonials /> <Divider /> <HeroEnd /> </main> <Divider /> <AppFooter /> </BrandingCssVarsProvider> ); }
3,991
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/versions.js
import * as React from 'react'; import sortedUniqBy from 'lodash/sortedUniqBy'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; import VersionsContext from 'docs/src/pages/versions/VersionsContext'; import * as pageProps from 'docs/src/pages/versions/versions.md?@mui/markdown'; export default function Page(props) { const { versions } = props; return ( <VersionsContext.Provider value={versions}> <MarkdownDocs {...pageProps} /> </VersionsContext.Provider> ); } function formatVersion(version) { return version .replace('v', '') .split('.') .map((n) => +n + 1000) .join('.'); } async function getBranches() { const result = await fetch('https://api.github.com/repos/mui/material-ui-docs/branches', { headers: { Authorization: process.env.GITHUB_AUTH, }, }); const text = await result.text(); if (result.status !== 200) { throw new Error(text); } return JSON.parse(text); } Page.getInitialProps = async () => { const FILTERED_BRANCHES = ['latest', 'l10n', 'next', 'migration', 'material-ui.com']; const branches = await getBranches(); /** * @type {import('docs/src/pages/versions/VersionsContext').VersionsContextValue} */ const versions = []; branches.forEach((branch) => { if (FILTERED_BRANCHES.indexOf(branch.name) === -1) { const version = branch.name; versions.push({ version, // Replace dot with dashes for Netlify branch subdomains url: `https://${version.replace(/\./g, '-')}.mui.com`, }); } }); // Current version. versions.push({ version: `v${process.env.LIB_VERSION}`, url: 'https://mui.com', }); // Legacy documentation. versions.push({ version: 'v0', url: 'https://v0.mui.com', }); versions.sort((a, b) => formatVersion(b.version).localeCompare(formatVersion(a.version))); if ( branches.find((branch) => branch.name === 'next') && !versions.find((version) => /beta|alpha/.test(version.version)) ) { versions.unshift({ version: `v${Number(versions[0].version[1]) + 1} pre-release`, url: 'https://next.mui.com', }); } return { versions: sortedUniqBy(versions, 'version') }; };
3,992
0
petrpan-code/mui/material-ui/docs
petrpan-code/mui/material-ui/docs/pages/x.tsx
import * as React from 'react'; import Divider from '@mui/material/Divider'; import Head from 'docs/src/modules/components/Head'; import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; import AppHeader from 'docs/src/layouts/AppHeader'; import XHero from 'docs/src/components/productX/XHero'; import XComponents from 'docs/src/components/productX/XComponents'; import XDataGrid from 'docs/src/components/productX/XDataGrid'; import XTheming from 'docs/src/components/productX/XTheming'; import XRoadmap from 'docs/src/components/productX/XRoadmap'; import References, { ADVANCED_CUSTOMERS } from 'docs/src/components/home/References'; import AppFooter from 'docs/src/layouts/AppFooter'; import XPlans from 'docs/src/components/productX/XPlans'; import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; export default function X() { return ( <BrandingCssVarsProvider> <Head title="MUI X: Performant advanced components" description="Build data-rich applications using a growing list of advanced React components. We're kicking it off with the most powerful Data Grid on the market." card="/static/social-previews/x-preview.jpg" /> <AppHeaderBanner /> <AppHeader gitHubRepository="https://github.com/mui/mui-x" /> <main id="main-content"> <XHero /> <References companies={ADVANCED_CUSTOMERS} /> <Divider /> <XComponents /> <Divider /> <XDataGrid /> <Divider /> <XTheming /> <Divider /> <XPlans /> <Divider /> <XRoadmap /> <Divider /> </main> <AppFooter stackOverflowUrl="https://stackoverflow.com/questions/tagged/mui-x" /> </BrandingCssVarsProvider> ); }
3,993
0
petrpan-code/mui/material-ui/docs/pages/base-ui
petrpan-code/mui/material-ui/docs/pages/base-ui/all-components/index.js
import * as React from 'react'; import MarkdownDocs from 'docs/src/modules/components/MarkdownDocsV2'; import AppFrame from 'docs/src/modules/components/AppFrame'; import * as pageProps from 'docs/data/base/all-components/all-components.md?@mui/markdown'; export default function Page() { return <MarkdownDocs {...pageProps} disableToc />; } Page.getLayout = (page) => { return <AppFrame>{page}</AppFrame>; };
3,994
0
petrpan-code/mui/material-ui/docs/pages/base-ui
petrpan-code/mui/material-ui/docs/pages/base-ui/api/badge.json
{ "props": { "badgeContent": { "type": { "name": "node" } }, "children": { "type": { "name": "node" } }, "invisible": { "type": { "name": "bool" }, "default": "false" }, "max": { "type": { "name": "number" }, "default": "99" }, "showZero": { "type": { "name": "bool" }, "default": "false" }, "slotProps": { "type": { "name": "shape", "description": "{ badge?: func<br>&#124;&nbsp;object, root?: func<br>&#124;&nbsp;object }" }, "default": "{}" }, "slots": { "type": { "name": "shape", "description": "{ badge?: elementType, root?: elementType }" }, "default": "{}", "additionalInfo": { "slotsApi": true } } }, "name": "Badge", "imports": ["import { Badge } from '@mui/base/Badge';", "import { Badge } from '@mui/base';"], "styles": { "classes": [], "globalClasses": {}, "name": null }, "slots": [ { "name": "root", "description": "The component that renders the root.", "default": "'span'", "class": ".MuiBadge-root" }, { "name": "badge", "description": "The component that renders the badge.", "default": "'span'", "class": ".MuiBadge-badge" } ], "classes": { "classes": ["invisible"], "globalClasses": {} }, "spread": true, "muiName": "MuiBadge", "forwardsRefTo": "HTMLSpanElement", "filename": "/packages/mui-base/src/Badge/Badge.tsx", "inheritance": null, "demos": "<ul><li><a href=\"/base-ui/react-badge/\">Badge</a></li></ul>", "cssComponent": false }
3,995
0
petrpan-code/mui/material-ui/docs/pages/base-ui
petrpan-code/mui/material-ui/docs/pages/base-ui/api/button.json
{ "props": { "action": { "type": { "name": "union", "description": "func<br>&#124;&nbsp;{ current?: { focusVisible: func } }" } }, "disabled": { "type": { "name": "bool" }, "default": "false" }, "focusableWhenDisabled": { "type": { "name": "bool" }, "default": "false" }, "slotProps": { "type": { "name": "shape", "description": "{ root?: func<br>&#124;&nbsp;object }" }, "default": "{}" }, "slots": { "type": { "name": "shape", "description": "{ root?: elementType }" }, "default": "{}", "additionalInfo": { "slotsApi": true } } }, "name": "Button", "imports": ["import { Button } from '@mui/base/Button';", "import { Button } from '@mui/base';"], "styles": { "classes": [], "globalClasses": {}, "name": null }, "slots": [ { "name": "root", "description": "The component that renders the root.", "default": "props.href || props.to ? 'a' : 'button'", "class": ".MuiButton-root" } ], "classes": { "classes": ["active", "disabled", "focusVisible"], "globalClasses": { "active": "Mui-active", "disabled": "Mui-disabled", "focusVisible": "Mui-focusVisible" } }, "spread": true, "muiName": "MuiButton", "forwardsRefTo": "HTMLButtonElement", "filename": "/packages/mui-base/src/Button/Button.tsx", "inheritance": null, "demos": "<ul><li><a href=\"/base-ui/react-button/\">Button</a></li></ul>", "cssComponent": false }
3,996
0
petrpan-code/mui/material-ui/docs/pages/base-ui
petrpan-code/mui/material-ui/docs/pages/base-ui/api/click-away-listener.json
{ "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>&#124;&nbsp;'onMouseDown'<br>&#124;&nbsp;'onMouseUp'<br>&#124;&nbsp;'onPointerDown'<br>&#124;&nbsp;'onPointerUp'<br>&#124;&nbsp;false" }, "default": "'onClick'" }, "touchEvent": { "type": { "name": "enum", "description": "'onTouchEnd'<br>&#124;&nbsp;'onTouchStart'<br>&#124;&nbsp;false" }, "default": "'onTouchEnd'" } }, "name": "ClickAwayListener", "imports": [ "import { ClickAwayListener } from '@mui/base/ClickAwayListener';", "import { ClickAwayListener } from '@mui/base';" ], "styles": { "classes": [], "globalClasses": {}, "name": null }, "spread": false, "themeDefaultProps": null, "muiName": "MuiClickAwayListener", "filename": "/packages/mui-base/src/ClickAwayListener/ClickAwayListener.tsx", "inheritance": null, "demos": "<ul><li><a href=\"/base-ui/react-click-away-listener/\">Click-Away Listener</a></li></ul>", "cssComponent": false }
3,997
0
petrpan-code/mui/material-ui/docs/pages/base-ui
petrpan-code/mui/material-ui/docs/pages/base-ui/api/dropdown.json
{ "props": { "defaultOpen": { "type": { "name": "bool" } }, "onOpenChange": { "type": { "name": "func" } }, "open": { "type": { "name": "bool" } } }, "name": "Dropdown", "imports": [ "import { Dropdown } from '@mui/base/Dropdown';", "import { Dropdown } from '@mui/base';" ], "styles": { "classes": [], "globalClasses": {}, "name": null }, "spread": false, "themeDefaultProps": null, "muiName": "MuiDropdown", "filename": "/packages/mui-base/src/Dropdown/Dropdown.tsx", "inheritance": null, "demos": "<ul><li><a href=\"/base-ui/react-menu/\">Menu</a></li></ul>", "cssComponent": false }
3,998
0
petrpan-code/mui/material-ui/docs/pages/base-ui
petrpan-code/mui/material-ui/docs/pages/base-ui/api/focus-trap.json
{ "props": { "open": { "type": { "name": "bool" }, "required": true }, "children": { "type": { "name": "custom", "description": "element" } }, "disableAutoFocus": { "type": { "name": "bool" }, "default": "false" }, "disableEnforceFocus": { "type": { "name": "bool" }, "default": "false" }, "disableRestoreFocus": { "type": { "name": "bool" }, "default": "false" }, "getTabbable": { "type": { "name": "func" }, "signature": { "type": "function(root: HTMLElement) => void", "describedArgs": [] } }, "isEnabled": { "type": { "name": "func" }, "default": "function defaultIsEnabled(): boolean {\n return true;\n}" } }, "name": "FocusTrap", "imports": [ "import { FocusTrap } from '@mui/base/FocusTrap';", "import { FocusTrap } from '@mui/base';" ], "styles": { "classes": [], "globalClasses": {}, "name": null }, "spread": false, "themeDefaultProps": null, "muiName": "MuiFocusTrap", "filename": "/packages/mui-base/src/FocusTrap/FocusTrap.tsx", "inheritance": null, "demos": "<ul><li><a href=\"/base-ui/react-focus-trap/\">Focus Trap</a></li></ul>", "cssComponent": false }
3,999