-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
136 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { mdx } from '@mdx-js/react'; | ||
import { BreakpointsShowcase } from '~/showcase'; | ||
import { MdxLayout } from '~/layout'; | ||
export default MdxLayout; | ||
|
||
# Breakpoints | ||
|
||
Change screen size to observe changes. | ||
|
||
<BreakpointsShowcase /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const breakpoints = { | ||
values: { | ||
xs: 0, | ||
sm: 600, | ||
md: 900, | ||
lg: 1200, | ||
xl: 1536, | ||
}, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react'; | ||
import { styled } from '@mui/material/styles'; | ||
|
||
const Root = styled('div')(({ theme }) => ({ | ||
width: '100%', | ||
padding: theme.spacing(1), | ||
[theme.breakpoints.down('md')]: { | ||
backgroundColor: theme.palette.secondary.main, | ||
}, | ||
[theme.breakpoints.up('md')]: { | ||
backgroundColor: theme.palette.primary.main, | ||
}, | ||
[theme.breakpoints.up('lg')]: { | ||
backgroundColor: theme.palette.info.main, | ||
}, | ||
})); | ||
|
||
const Text = styled('p')(({ theme }) => ({ | ||
[theme.breakpoints.down('md')]: { | ||
color: theme.palette.secondary.contrastText, | ||
}, | ||
[theme.breakpoints.up('md')]: { | ||
color: theme.palette.primary.contrastText, | ||
}, | ||
[theme.breakpoints.up('lg')]: { | ||
color: theme.palette.info.contrastText, | ||
}, | ||
})); | ||
|
||
export const BreakpointsShowcase = () => ( | ||
<Root> | ||
<Text>{'down(sm): palette.secondary'}</Text> | ||
<Text>{'up(md): palette.primary'}</Text> | ||
<Text>{'up(lg): pallete.info'}</Text> | ||
</Root> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import { Caption } from '@divriots/dockit-react/caption'; | ||
import { useTheme } from '@mui/material/styles'; | ||
|
||
const Box = ({ caption, zIndex, index }) => ( | ||
<div | ||
style={{ | ||
height: '6rem', | ||
minWidth: '8rem', | ||
marginLeft: `${index * 4 - 8}rem`, | ||
padding: '1rem', | ||
marginTop: `-2rem`, | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
border: '1px solid #FFF', | ||
borderRadius: '0.375rem', | ||
boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25)', | ||
backgroundColor: '#6366F1', | ||
zIndex, | ||
}} | ||
> | ||
<Caption text={`${caption}: ${zIndex}`} style={{ color: '#fff' }} /> | ||
</div> | ||
); | ||
|
||
export const ZIndexShowcase = () => { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
paddingTop: '6rem', | ||
}} | ||
> | ||
{Object.entries(theme.zIndex).map(([name, zIndex], i) => ( | ||
<Box key={name} index={i} caption={name} zIndex={zIndex} /> | ||
))} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from './PaletteShowcase'; | ||
export * from './TypographyShowcase'; | ||
export * from './SpacingShowcase'; | ||
export * from './BreakpointsShowcase'; | ||
export * from './ZIndexShowcase'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { light, dark } from '~/colors'; | ||
import { fonts } from '~/fonts'; | ||
import { spacing } from '~/spacing'; | ||
import { breakpoints } from '~/breakpoints'; | ||
import { zIndex } from '~/z-index'; | ||
import { createTheme as createThemeMui, PaletteMode } from '@mui/material'; | ||
|
||
export const createTheme = (mode: PaletteMode) => | ||
createThemeMui({ | ||
palette: mode === 'light' ? light : dark, | ||
typography: fonts, | ||
spacing, | ||
breakpoints, | ||
zIndex, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { mdx } from '@mdx-js/react'; | ||
import { ZIndexShowcase } from '~/showcase'; | ||
import { MdxLayout } from '~/layout'; | ||
export default MdxLayout; | ||
|
||
# ZIndex | ||
|
||
<ZIndexShowcase /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const zIndex = { | ||
appBar: 1100, | ||
drawer: 1200, | ||
mobileStepper: 1000, | ||
modal: 1300, | ||
snackbar: 1400, | ||
speedDial: 1050, | ||
tooltip: 1500, | ||
}; |