-
-
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.
- Loading branch information
Showing
6 changed files
with
287 additions
and
3 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<Alert size="sm" startDecorator={<AddShoppingCartIcon/>}>This is an alert in the small size.</Alert> | ||
<Alert size="md" startDecorator={<AddShoppingCartIcon/>}>This is an alert in the medium size.</Alert> | ||
<Alert size="lg" startDecorator={<AddShoppingCartIcon/>}>This is an alert in the large size.</Alert> | ||
<Alert size="sm" startDecorator={<AddShoppingCartIcon />}> | ||
This is an alert in the small size. | ||
</Alert> | ||
<Alert size="md" startDecorator={<AddShoppingCartIcon />}> | ||
This is an alert in the medium size. | ||
</Alert> | ||
<Alert size="lg" startDecorator={<AddShoppingCartIcon />}> | ||
This is an alert in the large size. | ||
</Alert> |
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,47 @@ | ||
import InfoIcon from '@mui/icons-material/Info'; | ||
import WarningIcon from '@mui/icons-material/Warning'; | ||
import ReportIcon from '@mui/icons-material/Report'; | ||
import CheckCircleIcon from '@mui/icons-material/CheckCircle'; | ||
import CloseRoundedIcon from '@mui/icons-material/CloseRounded'; | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import Alert from '@mui/joy/Alert'; | ||
import IconButton from '@mui/joy/IconButton'; | ||
import Typography from '@mui/joy/Typography'; | ||
|
||
export default function AlertVariousStates() { | ||
const items = [ | ||
{ title: 'Success', color: 'success', icon: <CheckCircleIcon /> }, | ||
{ title: 'Warning', color: 'warning', icon: <WarningIcon /> }, | ||
{ title: 'Error', color: 'danger', icon: <ReportIcon /> }, | ||
{ title: 'Info', color: 'info', icon: <InfoIcon /> }, | ||
]; | ||
|
||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, width: '100%', flexDirection: 'column' }}> | ||
{items.map(({ title, color, icon }) => ( | ||
<Alert | ||
key={title} | ||
sx={{ alignItems: 'flex-start', pt: 0.5 }} | ||
startDecorator={ | ||
<IconButton variant="soft" size="sm" color={color}> | ||
{icon} | ||
</IconButton> | ||
} | ||
variant="soft" | ||
color={color} | ||
endDecorator={ | ||
<IconButton variant="soft" size="sm" color={color}> | ||
<CloseRoundedIcon /> | ||
</IconButton> | ||
} | ||
> | ||
<Box sx={{ display: 'flex', flexDirection: 'column', pt: 0.5, pb: 1 }}> | ||
<Typography fontWeight="lg">{title}</Typography> | ||
<Typography fontSize="sm">{`${title} message.`}</Typography> | ||
</Box> | ||
</Alert> | ||
))} | ||
</Box> | ||
); | ||
} |
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,51 @@ | ||
import InfoIcon from '@mui/icons-material/Info'; | ||
import WarningIcon from '@mui/icons-material/Warning'; | ||
import ReportIcon from '@mui/icons-material/Report'; | ||
import CheckCircleIcon from '@mui/icons-material/CheckCircle'; | ||
import CloseRoundedIcon from '@mui/icons-material/CloseRounded'; | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import Alert from '@mui/joy/Alert'; | ||
import IconButton from '@mui/joy/IconButton'; | ||
import Typography from '@mui/joy/Typography'; | ||
import { ColorPaletteProp } from '@mui/joy/styles'; | ||
|
||
export default function AlertVariousStates() { | ||
const items: { | ||
title: string; | ||
color: ColorPaletteProp; | ||
icon: React.ReactElement; | ||
}[] = [ | ||
{ title: 'Success', color: 'success', icon: <CheckCircleIcon /> }, | ||
{ title: 'Warning', color: 'warning', icon: <WarningIcon /> }, | ||
{ title: 'Error', color: 'danger', icon: <ReportIcon /> }, | ||
{ title: 'Info', color: 'info', icon: <InfoIcon /> }, | ||
]; | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, width: '100%', flexDirection: 'column' }}> | ||
{items.map(({ title, color, icon }) => ( | ||
<Alert | ||
key={title} | ||
sx={{ alignItems: 'flex-start', pt: 0.5 }} | ||
startDecorator={ | ||
<IconButton variant="soft" size="sm" color={color}> | ||
{icon} | ||
</IconButton> | ||
} | ||
variant="soft" | ||
color={color} | ||
endDecorator={ | ||
<IconButton variant="soft" size="sm" color={color}> | ||
<CloseRoundedIcon /> | ||
</IconButton> | ||
} | ||
> | ||
<Box sx={{ display: 'flex', flexDirection: 'column', pt: 0.5, pb: 1 }}> | ||
<Typography fontWeight="lg">{title}</Typography> | ||
<Typography fontSize="sm">{`${title} message.`}</Typography> | ||
</Box> | ||
</Alert> | ||
))} | ||
</Box> | ||
); | ||
} |
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,85 @@ | ||
import WarningIcon from '@mui/icons-material/Warning'; | ||
import CloseIcon from '@mui/icons-material/Close'; | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import Alert from '@mui/joy/Alert'; | ||
import IconButton from '@mui/joy/IconButton'; | ||
import Typography from '@mui/joy/Typography'; | ||
import Button from '@mui/joy/Button'; | ||
|
||
export default function AlertWithDangerState() { | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, width: '100%', flexDirection: 'column' }}> | ||
<Alert | ||
startDecorator={ | ||
<IconButton variant="soft" size="sm" color="danger"> | ||
<WarningIcon /> | ||
</IconButton> | ||
} | ||
variant="soft" | ||
color="danger" | ||
endDecorator={ | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Button variant="soft" color="danger" sx={{ mr: 1 }} fontWeight="md"> | ||
Undo | ||
</Button> | ||
<IconButton variant="soft" size="sm" color="danger"> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Box> | ||
} | ||
> | ||
<Typography color="danger" fontWeight="md"> | ||
This file was successfully deleted | ||
</Typography> | ||
</Alert> | ||
<Alert | ||
startDecorator={ | ||
<IconButton variant="solid" size="sm" color="danger"> | ||
<WarningIcon /> | ||
</IconButton> | ||
} | ||
variant="solid" | ||
color="danger" | ||
endDecorator={ | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Button variant="solid" color="danger" sx={{ mr: 1 }} fontWeight="md"> | ||
Undo | ||
</Button> | ||
<IconButton variant="solid" size="sm" color="danger"> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Box> | ||
} | ||
> | ||
<Typography sx={{ color: 'white' }} fontWeight="md"> | ||
This file was successfully deleted | ||
</Typography> | ||
</Alert> | ||
|
||
<Alert | ||
startDecorator={ | ||
<IconButton variant="plain" size="sm" color="danger"> | ||
<WarningIcon /> | ||
</IconButton> | ||
} | ||
variant="outlined" | ||
color="danger" | ||
endDecorator={ | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Button variant="plain" color="danger" sx={{ mr: 1 }} fontWeight="md"> | ||
Undo | ||
</Button> | ||
<IconButton variant="solid" size="sm" color="danger"> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Box> | ||
} | ||
> | ||
<Typography color="danger" fontWeight="md"> | ||
This file was successfully deleted | ||
</Typography> | ||
</Alert> | ||
</Box> | ||
); | ||
} |
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,85 @@ | ||
import WarningIcon from '@mui/icons-material/Warning'; | ||
import CloseIcon from '@mui/icons-material/Close'; | ||
import * as React from 'react'; | ||
import Box from '@mui/joy/Box'; | ||
import Alert from '@mui/joy/Alert'; | ||
import IconButton from '@mui/joy/IconButton'; | ||
import Typography from '@mui/joy/Typography'; | ||
import Button from '@mui/joy/Button'; | ||
|
||
export default function AlertWithDangerState() { | ||
return ( | ||
<Box sx={{ display: 'flex', gap: 2, width: '100%', flexDirection: 'column' }}> | ||
<Alert | ||
startDecorator={ | ||
<IconButton variant="soft" size="sm" color="danger"> | ||
<WarningIcon /> | ||
</IconButton> | ||
} | ||
variant="soft" | ||
color="danger" | ||
endDecorator={ | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Button variant="soft" color="danger" sx={{ mr: 1 }} fontWeight="md"> | ||
Undo | ||
</Button> | ||
<IconButton variant="soft" size="sm" color="danger"> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Box> | ||
} | ||
> | ||
<Typography color="danger" fontWeight="md"> | ||
This file was successfully deleted | ||
</Typography> | ||
</Alert> | ||
<Alert | ||
startDecorator={ | ||
<IconButton variant="solid" size="sm" color="danger"> | ||
<WarningIcon /> | ||
</IconButton> | ||
} | ||
variant="solid" | ||
color="danger" | ||
endDecorator={ | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Button variant="solid" color="danger" sx={{ mr: 1 }} fontWeight="md"> | ||
Undo | ||
</Button> | ||
<IconButton variant="solid" size="sm" color="danger"> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Box> | ||
} | ||
> | ||
<Typography sx={{ color: 'white' }} fontWeight="md"> | ||
This file was successfully deleted | ||
</Typography> | ||
</Alert> | ||
|
||
<Alert | ||
startDecorator={ | ||
<IconButton variant="plain" size="sm" color="danger"> | ||
<WarningIcon /> | ||
</IconButton> | ||
} | ||
variant="outlined" | ||
color="danger" | ||
endDecorator={ | ||
<Box sx={{ display: 'flex', alignItems: 'center' }}> | ||
<Button variant="plain" color="danger" sx={{ mr: 1 }} fontWeight="md"> | ||
Undo | ||
</Button> | ||
<IconButton variant="solid" size="sm" color="danger"> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Box> | ||
} | ||
> | ||
<Typography color="danger" fontWeight="md"> | ||
This file was successfully deleted | ||
</Typography> | ||
</Alert> | ||
</Box> | ||
); | ||
} |
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