-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1528 from vivid-planet/merge-main-into-next
Merge main into next
- Loading branch information
Showing
13 changed files
with
407 additions
and
15 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,23 @@ | ||
--- | ||
"@comet/admin": minor | ||
--- | ||
|
||
Add `Alert` component | ||
|
||
**Example:** | ||
|
||
```tsx | ||
import { Alert, OkayButton, SaveButton } from "@comet/admin"; | ||
|
||
<Alert | ||
severity="warning" | ||
title="Title" | ||
action={ | ||
<Button variant="text" startIcon={<ArrowRight />}> | ||
Action Text | ||
</Button> | ||
} | ||
> | ||
Notification Text | ||
</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,5 @@ | ||
--- | ||
"@comet/cms-admin": minor | ||
--- | ||
|
||
Make all DAM license fields optional if `LicenseType` is `ROYALTY_FREE` even if `requireLicense` is true in `DamConfig` |
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,6 @@ | ||
addAssignees: author | ||
|
||
addReviewers: true | ||
|
||
reviewers: | ||
- johnnyomair |
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
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,152 @@ | ||
import { Alert, OkayButton, SaveButton } from "@comet/admin"; | ||
import { ArrowRight } from "@comet/admin-icons"; | ||
import { Button, Card, CardContent, Typography } from "@mui/material"; | ||
import { Stack } from "@mui/system"; | ||
import { storiesOf } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
function Story() { | ||
return ( | ||
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 50 }}> | ||
<Card variant="outlined"> | ||
<CardContent> | ||
<Typography variant="h4" marginBottom={4}> | ||
With Title | ||
</Typography> | ||
<Stack spacing={4} direction="column"> | ||
<Alert | ||
severity="info" | ||
title="Title" | ||
action={ | ||
<Button variant="text" startIcon={<ArrowRight />}> | ||
Action Text | ||
</Button> | ||
} | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Notification Text | ||
</Alert> | ||
<Alert | ||
severity="warning" | ||
title="Title" | ||
action={ | ||
<Button variant="text" startIcon={<ArrowRight />}> | ||
Action Text | ||
</Button> | ||
} | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas vel vehicula est. Nunc congue velit sem, ac porttitor | ||
massa semper nec. Proin quis volutpat magna. Mauris eget libero et mi imperdiet ultrices. Donec eget interdum odio. | ||
Maecenas blandit ipsum et eros tempus porttitor. Aliquam erat volutpat. | ||
</Alert> | ||
<Alert | ||
severity="error" | ||
title="Title" | ||
action={ | ||
<Button variant="text" startIcon={<ArrowRight />}> | ||
Action Text | ||
</Button> | ||
} | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Notification Text | ||
</Alert> | ||
<Alert | ||
severity="success" | ||
title="Title" | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Notification Text | ||
</Alert> | ||
</Stack> | ||
</CardContent> | ||
</Card> | ||
|
||
<Card> | ||
<CardContent> | ||
<Typography variant="h4" marginBottom={4}> | ||
Without Title | ||
</Typography> | ||
<Stack spacing={4} marginBottom={6}> | ||
<Alert | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Notification Text | ||
</Alert> | ||
<Alert | ||
severity="warning" | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Notification Text | ||
</Alert> | ||
<Alert | ||
severity="error" | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Notification Text | ||
</Alert> | ||
<Alert | ||
severity="success" | ||
action={ | ||
<Button variant="text" startIcon={<ArrowRight />}> | ||
Action Text | ||
</Button> | ||
} | ||
onClose={() => { | ||
// noop | ||
}} | ||
> | ||
Notification Text | ||
</Alert> | ||
</Stack> | ||
</CardContent> | ||
</Card> | ||
|
||
<Card> | ||
<CardContent> | ||
<Stack spacing={4}> | ||
<Typography variant="h4">Without Close Button</Typography> | ||
<Alert title="Title"> | ||
<Typography>Notification Text</Typography> | ||
</Alert> | ||
<Alert severity="warning"> | ||
<Typography>Notification Text</Typography> | ||
</Alert> | ||
<Alert | ||
severity="warning" | ||
action={ | ||
<Button variant="text" startIcon={<ArrowRight />}> | ||
Action Text | ||
</Button> | ||
} | ||
> | ||
<Typography>Notification Text</Typography> | ||
</Alert> | ||
<Typography variant="h4">Other Actions</Typography> | ||
<Alert title="Title" action={<SaveButton />}> | ||
Text | ||
</Alert> | ||
<Alert severity="warning" action={<OkayButton />} /> | ||
</Stack> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
); | ||
} | ||
|
||
storiesOf("@comet/admin/alert/Alert", module).add("Alerts", () => <Story />); |
45 changes: 45 additions & 0 deletions
45
packages/admin/admin-theme/src/componentsTheme/MuiAlert.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,45 @@ | ||
import { Check, Error, Info, Warning } from "@comet/admin-icons"; | ||
import React from "react"; | ||
|
||
import { mergeOverrideStyles } from "../utils/mergeOverrideStyles"; | ||
import { GetMuiComponentTheme } from "./getComponentsTheme"; | ||
|
||
export const getMuiAlert: GetMuiComponentTheme<"MuiAlert"> = (component, { palette }) => ({ | ||
...component, | ||
defaultProps: { | ||
variant: "outlined", | ||
|
||
iconMapping: { | ||
info: <Info color="info" />, | ||
success: <Check color="success" />, | ||
error: <Error color="error" />, | ||
warning: <Warning color="warning" />, | ||
}, | ||
...component?.defaultProps, | ||
}, | ||
styleOverrides: mergeOverrideStyles<"MuiAlert">(component?.styleOverrides, { | ||
root: {}, | ||
outlined: { | ||
borderLeftWidth: 5, | ||
backgroundColor: "#fff", | ||
borderRadius: 4, | ||
color: palette.grey[800], | ||
}, | ||
outlinedSuccess: { | ||
borderColor: "#14CC33", | ||
}, | ||
outlinedInfo: { | ||
borderColor: "#29B6F6", | ||
}, | ||
outlinedWarning: { | ||
borderColor: "#FFB31A", | ||
}, | ||
outlinedError: { | ||
borderColor: "#D11700", | ||
}, | ||
icon: { | ||
marginRight: 0, | ||
padding: 0, | ||
}, | ||
}), | ||
}); |
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
Oops, something went wrong.