Skip to content

Commit

Permalink
Merge pull request #1050 from gsoft-inc/feature/csf
Browse files Browse the repository at this point in the history
Feature/csf
  • Loading branch information
fraincs committed Nov 14, 2022
2 parents 9940321 + 4a73322 commit f171974
Show file tree
Hide file tree
Showing 81 changed files with 12,183 additions and 9,848 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
"@storybook/addon-a11y": "6.5.13-alpha.0",
"@storybook/addon-essentials": "6.5.13-alpha.0",
"@storybook/react": "6.5.13-alpha.0 ",
"@storybook/testing-library": "0.0.13",
"@storybook/testing-react": "1.3.0",
"@svgr/core": "6.2.1",
"@svgr/webpack": "5.5.0",
"@testing-library/dom": "^8.18.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,32 @@ import { Alert, AlertTrigger } from "@components/alert";
import { Button } from "@components/button";
import { Content } from "@components/placeholders";
import { Heading } from "@components/typography";
import { storiesOfBuilder } from "@stories/utils";

function stories(segment) {
return storiesOfBuilder(module, "Chromatic/AlertTrigger")
.segment(segment)
.build();
}
export default {
title: "Chromatic/AlertTrigger",
component: AlertTrigger
};

stories()
.add("default", () =>
<AlertTrigger>
<Button variant="secondary">Open</Button>
<Alert primaryButtonLabel="Yes">
<Heading>Launch</Heading>
<Content>Are you sure you want to launch the space shuttle?</Content>
</Alert>
</AlertTrigger>
)
.add("default open", () =>
<AlertTrigger defaultOpen>
<Button variant="secondary">Open</Button>
<Alert primaryButtonLabel="Yes">
<Heading>Launch</Heading>
<Content>Are you sure you want to launch the space shuttle?</Content>
</Alert>
</AlertTrigger>
);
export const Default = () => (
<AlertTrigger>
<Button variant="secondary">Open</Button>
<Alert primaryButtonLabel="Yes">
<Heading>Launch</Heading>
<Content>Are you sure you want to launch the space shuttle?</Content>
</Alert>
</AlertTrigger>
);

Default.storyName = "default";

export const DefaultOpen = () => (
<AlertTrigger defaultOpen>
<Button variant="secondary">Open</Button>
<Alert primaryButtonLabel="Yes">
<Heading>Launch</Heading>
<Content>Are you sure you want to launch the space shuttle?</Content>
</Alert>
</AlertTrigger>
);

DefaultOpen.storyName = "default open";

0 comments on commit f171974

Please sign in to comment.