first commit
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Stack from '@mui/material/Stack';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
|
||||
export default function Circular() {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '20px'
|
||||
}}
|
||||
>
|
||||
Circular
|
||||
</Typography>
|
||||
|
||||
<Stack sx={{ color: 'grey.500' }} spacing={2} direction="row">
|
||||
<CircularProgress color="secondary" />
|
||||
<CircularProgress color="success" />
|
||||
<CircularProgress color="inherit" />
|
||||
</Stack>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Stack from '@mui/material/Stack';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
|
||||
export default function CircularDeterminate() {
|
||||
|
||||
const [progress, setProgress] = React.useState(0);
|
||||
|
||||
React.useEffect(() => {
|
||||
const timer = setInterval(() => {
|
||||
setProgress((prevProgress) => (prevProgress >= 100 ? 0 : prevProgress + 10));
|
||||
}, 800);
|
||||
|
||||
return () => {
|
||||
clearInterval(timer);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '20px'
|
||||
}}
|
||||
>
|
||||
Circular Determinate
|
||||
</Typography>
|
||||
|
||||
<Stack spacing={2} direction="row">
|
||||
<CircularProgress variant="determinate" value={25} />
|
||||
<CircularProgress variant="determinate" value={50} />
|
||||
<CircularProgress variant="determinate" value={75} />
|
||||
<CircularProgress variant="determinate" value={100} />
|
||||
<CircularProgress variant="determinate" value={progress} />
|
||||
</Stack>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Box from '@mui/material/Box';
|
||||
import Card from "@mui/material/Card";
|
||||
|
||||
function CircularProgressWithLabel(props) {
|
||||
return (
|
||||
<Box sx={{ position: 'relative', display: 'inline-flex' }}>
|
||||
<CircularProgress variant="determinate" {...props} />
|
||||
<Box
|
||||
sx={{
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
position: 'absolute',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Typography variant="caption" component="div" color="text.secondary">
|
||||
{`${Math.round(props.value)}%`}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
CircularProgressWithLabel.propTypes = {
|
||||
/**
|
||||
* The value of the progress indicator for the determinate variant.
|
||||
* Value between 0 and 100.
|
||||
* @default 0
|
||||
*/
|
||||
value: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
export default function CircularStatic() {
|
||||
const [progress, setProgress] = React.useState(10);
|
||||
|
||||
React.useEffect(() => {
|
||||
const timer = setInterval(() => {
|
||||
setProgress((prevProgress) => (prevProgress >= 100 ? 0 : prevProgress + 10));
|
||||
}, 800);
|
||||
return () => {
|
||||
clearInterval(timer);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '15px'
|
||||
}}
|
||||
>
|
||||
Default
|
||||
</Typography>
|
||||
|
||||
<CircularProgressWithLabel value={progress} />
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import { styled } from '@mui/material/styles';
|
||||
import Box from '@mui/material/Box';
|
||||
import CircularProgress, {
|
||||
circularProgressClasses,
|
||||
} from '@mui/material/CircularProgress';
|
||||
import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress';
|
||||
|
||||
const BorderLinearProgress = styled(LinearProgress)(({ theme }) => ({
|
||||
height: 10,
|
||||
borderRadius: 5,
|
||||
[`&.${linearProgressClasses.colorPrimary}`]: {
|
||||
backgroundColor: theme.palette.grey[theme.palette.mode === 'light' ? 200 : 800],
|
||||
},
|
||||
[`& .${linearProgressClasses.bar}`]: {
|
||||
borderRadius: 5,
|
||||
backgroundColor: theme.palette.mode === 'light' ? '#1a90ff' : '#308fe8',
|
||||
},
|
||||
}));
|
||||
|
||||
// Inspired by the former Facebook spinners.
|
||||
function FacebookCircularProgress(props) {
|
||||
return (
|
||||
<Box sx={{ position: 'relative' }}>
|
||||
<CircularProgress
|
||||
variant="determinate"
|
||||
sx={{
|
||||
color: (theme) =>
|
||||
theme.palette.grey[theme.palette.mode === 'light' ? 200 : 800],
|
||||
}}
|
||||
size={40}
|
||||
thickness={4}
|
||||
{...props}
|
||||
value={100}
|
||||
/>
|
||||
<CircularProgress
|
||||
variant="indeterminate"
|
||||
disableShrink
|
||||
sx={{
|
||||
color: (theme) => (theme.palette.mode === 'light' ? '#1a90ff' : '#308fe8'),
|
||||
animationDuration: '550ms',
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
[`& .${circularProgressClasses.circle}`]: {
|
||||
strokeLinecap: 'round',
|
||||
},
|
||||
}}
|
||||
size={40}
|
||||
thickness={4}
|
||||
{...props}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Customization() {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Customization
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ flexGrow: 1 }}>
|
||||
<FacebookCircularProgress />
|
||||
<br />
|
||||
<BorderLinearProgress variant="determinate" value={50} />
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Box from '@mui/material/Box';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import { green } from '@mui/material/colors';
|
||||
import Button from '@mui/material/Button';
|
||||
import Fab from '@mui/material/Fab';
|
||||
import CheckIcon from '@mui/icons-material/Check';
|
||||
import SaveIcon from '@mui/icons-material/Save';
|
||||
|
||||
export default function InteractiveIntegration() {
|
||||
|
||||
const [loading, setLoading] = React.useState(false);
|
||||
const [success, setSuccess] = React.useState(false);
|
||||
const timer = React.useRef();
|
||||
|
||||
const buttonSx = {
|
||||
...(success && {
|
||||
bgcolor: green[500],
|
||||
'&:hover': {
|
||||
bgcolor: green[700],
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
return () => {
|
||||
clearTimeout(timer.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const handleButtonClick = () => {
|
||||
if (!loading) {
|
||||
setSuccess(false);
|
||||
setLoading(true);
|
||||
timer.current = window.setTimeout(() => {
|
||||
setSuccess(true);
|
||||
setLoading(false);
|
||||
}, 2000);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Interactive Integration
|
||||
</Typography>
|
||||
|
||||
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
||||
<Box sx={{ m: 1, position: 'relative' }}>
|
||||
<Fab
|
||||
aria-label="save"
|
||||
color="primary"
|
||||
sx={buttonSx}
|
||||
onClick={handleButtonClick}
|
||||
>
|
||||
{success ? <CheckIcon className="whiteColor" /> : <SaveIcon className="whiteColor" />}
|
||||
</Fab>
|
||||
{loading && (
|
||||
<CircularProgress
|
||||
size={68}
|
||||
sx={{
|
||||
color: green[500],
|
||||
position: 'absolute',
|
||||
top: -6,
|
||||
left: -6,
|
||||
zIndex: 1,
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
<Box sx={{ m: 1, position: 'relative' }}>
|
||||
<Button
|
||||
variant="contained"
|
||||
sx={buttonSx}
|
||||
disabled={loading}
|
||||
onClick={handleButtonClick}
|
||||
className="whiteColor"
|
||||
>
|
||||
Accept terms
|
||||
</Button>
|
||||
{loading && (
|
||||
<CircularProgress
|
||||
size={24}
|
||||
sx={{
|
||||
color: green[500],
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
marginTop: '-12px',
|
||||
marginLeft: '-12px',
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import React from "react";
|
||||
import Card from "@mui/material/Card";
|
||||
import { Typography } from "@mui/material";
|
||||
import Stack from '@mui/material/Stack';
|
||||
import LinearProgress from '@mui/material/LinearProgress';
|
||||
|
||||
export default function LinearIndeterminate() {
|
||||
return (
|
||||
<>
|
||||
<Card
|
||||
sx={{
|
||||
boxShadow: "none",
|
||||
borderRadius: "10px",
|
||||
p: "25px",
|
||||
mb: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
as="h3"
|
||||
sx={{
|
||||
fontSize: 18,
|
||||
fontWeight: 500,
|
||||
mb: '10px'
|
||||
}}
|
||||
>
|
||||
Linear Indeterminate
|
||||
</Typography>
|
||||
|
||||
<Stack sx={{ width: '100%', color: 'grey.500' }} spacing={2}>
|
||||
<LinearProgress color="secondary" />
|
||||
<LinearProgress color="success" />
|
||||
<LinearProgress color="inherit" />
|
||||
</Stack>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user