Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UN-554-alert #460

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading