-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add demos for variant prop and improve demos
- Loading branch information
Showing
8 changed files
with
158 additions
and
20 deletions.
There are no files selected for viewing
64 changes: 57 additions & 7 deletions
64
docs/data/joy/components/circular-progress/CircularProgressColors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,66 @@ | ||
import Typography from '@mui/joy/Typography'; | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import CircularProgress from '@mui/joy/CircularProgress'; | ||
|
||
import Radio from '@mui/joy/Radio'; | ||
import RadioGroup from '@mui/joy/RadioGroup'; | ||
import Sheet from '@mui/joy/Sheet'; | ||
|
||
export default function CircularProgressColors() { | ||
const [variant, setVariant] = React.useState('solid'); | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap' }}> | ||
<CircularProgress color="primary" /> | ||
<CircularProgress color="neutral" /> | ||
<CircularProgress color="danger" /> | ||
<CircularProgress color="info" /> | ||
<CircularProgress color="success" /> | ||
<CircularProgress color="warning" /> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: 3, | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: 'grid', | ||
gridTemplateColumns: 'repeat(3, minmax(150px, 1fr))', | ||
gap: 1, | ||
}} | ||
> | ||
<CircularProgress variant={variant} color="primary" /> | ||
<CircularProgress variant={variant} color="neutral" /> | ||
<CircularProgress variant={variant} color="danger" /> | ||
<CircularProgress variant={variant} color="info" /> | ||
<CircularProgress variant={variant} color="success" /> | ||
<CircularProgress variant={variant} color="warning" /> | ||
</Box> | ||
<Sheet | ||
sx={{ | ||
background: 'transparent', | ||
pl: 4, | ||
borderLeft: '1px solid', | ||
borderColor: 'divider', | ||
}} | ||
> | ||
<Typography | ||
level="body2" | ||
fontWeight="xl" | ||
id="variant-label" | ||
textColor="text.primary" | ||
mb={1} | ||
> | ||
Variant: | ||
</Typography> | ||
<RadioGroup | ||
size="sm" | ||
aria-labelledby="variant-label" | ||
name="variant" | ||
value={variant} | ||
onChange={(event) => setVariant(event.target.value)} | ||
> | ||
<Radio label="Solid" value="solid" /> | ||
<Radio label="Soft" value="soft" /> | ||
<Radio label="Outlined" value="outlined" /> | ||
<Radio label="Plain" value="plain" /> | ||
</RadioGroup> | ||
</Sheet> | ||
</Box> | ||
); | ||
} |
64 changes: 57 additions & 7 deletions
64
docs/data/joy/components/circular-progress/CircularProgressColors.tsx
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,16 +1,66 @@ | ||
import Typography from '@mui/joy/Typography'; | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import CircularProgress from '@mui/joy/CircularProgress'; | ||
import { VariantProp } from '@mui/joy'; | ||
import Radio from '@mui/joy/Radio'; | ||
import RadioGroup from '@mui/joy/RadioGroup'; | ||
import Sheet from '@mui/joy/Sheet'; | ||
|
||
export default function CircularProgressColors() { | ||
const [variant, setVariant] = React.useState<VariantProp>('solid'); | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap' }}> | ||
<CircularProgress color="primary" /> | ||
<CircularProgress color="neutral" /> | ||
<CircularProgress color="danger" /> | ||
<CircularProgress color="info" /> | ||
<CircularProgress color="success" /> | ||
<CircularProgress color="warning" /> | ||
<Box | ||
sx={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: 3, | ||
}} | ||
> | ||
<Box | ||
sx={{ | ||
display: 'grid', | ||
gridTemplateColumns: 'repeat(3, minmax(150px, 1fr))', | ||
gap: 1, | ||
}} | ||
> | ||
<CircularProgress variant={variant} color="primary" /> | ||
<CircularProgress variant={variant} color="neutral" /> | ||
<CircularProgress variant={variant} color="danger" /> | ||
<CircularProgress variant={variant} color="info" /> | ||
<CircularProgress variant={variant} color="success" /> | ||
<CircularProgress variant={variant} color="warning" /> | ||
</Box> | ||
<Sheet | ||
sx={{ | ||
background: 'transparent', | ||
pl: 4, | ||
borderLeft: '1px solid', | ||
borderColor: 'divider', | ||
}} | ||
> | ||
<Typography | ||
level="body2" | ||
fontWeight="xl" | ||
id="variant-label" | ||
textColor="text.primary" | ||
mb={1} | ||
> | ||
Variant: | ||
</Typography> | ||
<RadioGroup | ||
size="sm" | ||
aria-labelledby="variant-label" | ||
name="variant" | ||
value={variant} | ||
onChange={(event) => setVariant(event.target.value as VariantProp)} | ||
> | ||
<Radio label="Solid" value="solid" /> | ||
<Radio label="Soft" value="soft" /> | ||
<Radio label="Outlined" value="outlined" /> | ||
<Radio label="Plain" value="plain" /> | ||
</RadioGroup> | ||
</Sheet> | ||
</Box> | ||
); | ||
} |
6 changes: 0 additions & 6 deletions
6
docs/data/joy/components/circular-progress/CircularProgressColors.tsx.preview
This file was deleted.
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
14 changes: 14 additions & 0 deletions
14
docs/data/joy/components/circular-progress/CircularProgressVariants.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import CircularProgress from '@mui/joy/CircularProgress'; | ||
|
||
export default function CircularProgressVariants() { | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap' }}> | ||
<CircularProgress variant="solid" /> | ||
<CircularProgress variant="soft" /> | ||
<CircularProgress variant="outlined" /> | ||
<CircularProgress variant="plain" /> | ||
</Box> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
docs/data/joy/components/circular-progress/CircularProgressVariants.tsx
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,14 @@ | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import CircularProgress from '@mui/joy/CircularProgress'; | ||
|
||
export default function CircularProgressVariants() { | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, alignItems: 'center', flexWrap: 'wrap' }}> | ||
<CircularProgress variant="solid" /> | ||
<CircularProgress variant="soft" /> | ||
<CircularProgress variant="outlined" /> | ||
<CircularProgress variant="plain" /> | ||
</Box> | ||
); | ||
} |
4 changes: 4 additions & 0 deletions
4
docs/data/joy/components/circular-progress/CircularProgressVariants.tsx.preview
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,4 @@ | ||
<CircularProgress variant="solid" /> | ||
<CircularProgress variant="soft" /> | ||
<CircularProgress variant="outlined" /> | ||
<CircularProgress variant="plain" /> |
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