Skip to content

Commit

Permalink
Merge pull request #173 from gsoft-inc/feature/ds-412
Browse files Browse the repository at this point in the history
converted chromatic stories to CSF3 format
  • Loading branch information
fraincs authored Oct 29, 2024
2 parents 98e4c85 + ad38449 commit 6a68f07
Show file tree
Hide file tree
Showing 268 changed files with 55,835 additions and 8,915 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ import { Content } from "@components/placeholders";
import { H3 } from "@components/typography";
import { Inline } from "@components/layout";
import { Item } from "@components/collection";
import { createAccordionTestSuite } from "./createAccordionTestSuite";
import { paramsBuilder, storiesOfBuilder } from "@stories/utils";

function stories(segment) {
return storiesOfBuilder(module, "Chromatic/Accordion")
.segment(segment)
.parameters(paramsBuilder()
.chromaticDelay(100)
.build())
.build();
}
import { Meta, StoryObj } from "@storybook/react";

createAccordionTestSuite(<Accordion variant="borderless" />, stories("/borderless"));
const meta = {
title: "Chromatic/Accordion-hopper",
component: Accordion,
parameters: {
chromatic: {
delay: 100
}
}
} as Meta<typeof Accordion>;

createAccordionTestSuite(<Accordion variant="bordered" />, stories("/bordered"));
export default meta;

stories()
.add("conditional rendering", () =>
type AccordionStory = StoryObj<typeof meta>;

export const ConditionalRendering: AccordionStory = {
name: "conditional rendering",
render: () => (
<Accordion>
<Item>
<H3>Mars</H3>
Expand All @@ -32,7 +34,11 @@ stories()
</Item>}
</Accordion>
)
.add("styling", () =>
};

export const Styling: AccordionStory = {
name: "styling",
render: () => (
<Inline>
<Accordion border="warning" expandedKeys={["0"]}>
<Item>
Expand All @@ -53,4 +59,5 @@ stories()
</Item>
</Accordion>
</Inline>
);
)
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@ import { Content } from "@components/placeholders";
import { H3 } from "@components/typography";
import { Inline } from "@components/layout";
import { Item } from "@components/collection";
import { createAccordionTestSuite } from "./createAccordionTestSuite-hopper";
import { paramsBuilder, storiesOfBuilder } from "@stories/utils";

function stories(segment) {
return storiesOfBuilder(module, "Chromatic/Accordion-hopper")
.segment(segment)
.parameters(paramsBuilder()
.chromaticDelay(100)
.build())
.build();
}
import { Meta, StoryObj } from "@storybook/react";

createAccordionTestSuite(<Accordion variant="borderless" />, stories("/borderless"));
const meta = {
title: "Chromatic/Accordion",
component: Accordion,
parameters: {
chromatic: {
delay: 100
}
}
} as Meta<typeof Accordion>;

createAccordionTestSuite(<Accordion variant="bordered" />, stories("/bordered"));
export default meta;

stories()
.add("conditional rendering", () =>
type AccordionStory = StoryObj<typeof meta>;

export const ConditionalRendering: AccordionStory = {
name: "conditional rendering",
render: () => (
<Accordion>
<Item>
<H3>Mars</H3>
Expand All @@ -32,7 +34,11 @@ stories()
</Item>}
</Accordion>
)
.add("styling", () =>
};

export const Styling: AccordionStory = {
name: "styling",
render: () => (
<Inline>
<Accordion border="warning" expandedKeys={["0"]}>
<Item>
Expand All @@ -53,4 +59,5 @@ stories()
</Item>
</Accordion>
</Inline>
);
)
};
Loading

0 comments on commit 6a68f07

Please sign in to comment.