Skip to content

Commit

Permalink
Merge pull request #460 from AppQuality/UN-554-alert
Browse files Browse the repository at this point in the history
UN-554-alert
  • Loading branch information
marcbon authored Dec 16, 2024
2 parents 9952315 + 6a5b33e commit ff2f7b6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { GlobalStyle } from "./stories/shared/globalStyle";
export * from "./stories/accordions";

// --- Alerts ---
export * from "./stories/alerts";
export * from "./stories/notifications/alerts";

// --- Avatar ---
export * from "./stories/avatar";
Expand Down
6 changes: 0 additions & 6 deletions src/stories/alerts/_types.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions src/stories/alerts/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Meta as ComponentMeta, StoryFn as Story } from "@storybook/react";
import { Alert } from ".";
import { AlertArgs } from "./_types";
import { Alert, AlertArgs } from ".";

const Template: Story<AlertArgs> = (args) => {
return (
Expand All @@ -25,7 +24,7 @@ Default.parameters = {
};

export default {
title: "Atoms/Alerts",
title: "Molecules/Notification/Alerts",
component: Alert,
parameters: {
// Sets a delay for the component's stories
Expand Down
11 changes: 11 additions & 0 deletions src/stories/notifications/alerts/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Alert as ZendeskAlert, Title as ZendeskTitle, Close as ZendeskClose } from '@zendeskgarden/react-notifications';
import { IAlertProps } from '@zendeskgarden/react-notifications';


export interface AlertArgs extends IAlertProps {}

const Alert = (props: AlertArgs) => <ZendeskAlert {...props}/>;
Alert.Title = ZendeskTitle;
Alert.Close = ZendeskClose;

export { Alert };
8 changes: 8 additions & 0 deletions src/stories/theme/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { colors } from "./colors";
import { fontWeights } from "./fontWeights";
import { palette } from "./palette";
import { getColor } from "./utils";
import { AlertArgs } from "../notifications/alerts";

export const components = {
...DEFAULT_THEME.components,
Expand Down Expand Up @@ -41,6 +42,13 @@ export const components = {
}),
};
},
"notifications.alert": ({ type }: AlertArgs) => {
return {
...(type === "success" && {
backgroundColor: getColor(colors.successHue, 10),
}),
};
},
"text.primary": () => ({
color: getColor(colors.primaryHue, 600),
}),
Expand Down
1 change: 1 addition & 0 deletions src/stories/theme/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const palette = {
"900": "#734A15",
},
"green": {
"10": "#EBF5F2",
"50": "#B3E8D9",
"100": "#80D9C0",
"200": "#66D1B3",
Expand Down

0 comments on commit ff2f7b6

Please sign in to comment.