Skip to content

Commit acabb46

Browse files
committed
fix: remove redundant readme from story definition
1 parent 1716c8c commit acabb46

16 files changed

+139
-241
lines changed

packages/config/story/src/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React from "react";
22
import type { Meta } from "@storybook/react";
3-
import { Subtitle, Description, Primary, Controls, Markdown, ArgsTable } from "@storybook/blocks";
3+
import { Subtitle, Description, Primary, Controls, ArgsTable } from "@storybook/blocks";
44

55
interface ConfigureStoryExtra {
6-
readme: string;
76
subComponents?: [unknown];
87
}
98

@@ -19,7 +18,7 @@ function isComponent(v: unknown): v is { displayName: string } {
1918
export const configureStory = <T,>(
2019
component: T,
2120
data: Omit<Meta<T>, "component" | "title">,
22-
extra: ConfigureStoryExtra,
21+
extra?: ConfigureStoryExtra,
2322
): Meta<T> => ({
2423
component,
2524
...data,
@@ -33,13 +32,12 @@ export const configureStory = <T,>(
3332
data.parameters?.docs?.page ??
3433
(() => (
3534
<>
36-
<Markdown>{extra.readme}</Markdown>
3735
<Subtitle />
3836
<Description />
3937
<Primary />
4038
{isComponent(component) && <h3>{component.displayName} Props</h3>}
4139
<Controls />
42-
{extra.subComponents?.filter(isComponent).map((i) => (
40+
{extra?.subComponents?.filter(isComponent).map((i) => (
4341
<React.Fragment key={JSON.stringify(i)}>
4442
<h3>{i.displayName} Props</h3>
4543
<ArgsTable of={i} />

packages/docs/stories/src/banner.stories.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,25 @@ import { capitalCase } from "change-case";
66
import { Text } from "@react-ck/text/src";
77
import { Button } from "@react-ck/button/src";
88
import { configureStory } from "@react-ck/story-config";
9-
import readme from "@react-ck/banner/README.md";
109
import { Banner } from "@react-ck/banner/src";
1110
import { Icon } from "@react-ck/icon";
1211

1312
type Story = StoryObj<typeof Banner>;
1413

1514
const meta: Meta<typeof Banner> = {
1615
title: "Layout/Banner",
17-
...configureStory(
18-
Banner,
19-
{
20-
parameters: {
21-
layout: "fullscreen",
22-
},
23-
decorators: [
24-
(Story) => (
25-
<ThemeProvider>
26-
<Story />
27-
</ThemeProvider>
28-
),
29-
],
16+
...configureStory(Banner, {
17+
parameters: {
18+
layout: "fullscreen",
3019
},
31-
{
32-
readme,
33-
},
34-
),
20+
decorators: [
21+
(Story) => (
22+
<ThemeProvider>
23+
<Story />
24+
</ThemeProvider>
25+
),
26+
],
27+
}),
3528
};
3629

3730
export default meta;

packages/docs/stories/src/button.stories.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,21 @@ import { ThemeProvider } from "@react-ck/theme";
44
import { faker } from "@faker-js/faker";
55
import { sentenceCase } from "change-case";
66
import { configureStory } from "@react-ck/story-config";
7-
import readme from "@react-ck/button/README.md";
87
import { Button } from "@react-ck/button/src";
98

109
type Story = StoryObj<typeof Button>;
1110

1211
const meta: Meta<typeof Button> = {
1312
title: "Generic/Button",
14-
...configureStory(
15-
Button,
16-
{
17-
decorators: [
18-
(Story) => (
19-
<ThemeProvider>
20-
<Story />
21-
</ThemeProvider>
22-
),
23-
],
24-
},
25-
{
26-
readme,
27-
},
28-
),
13+
...configureStory(Button, {
14+
decorators: [
15+
(Story) => (
16+
<ThemeProvider>
17+
<Story />
18+
</ThemeProvider>
19+
),
20+
],
21+
}),
2922
};
3023

3124
export default meta;

packages/docs/stories/src/card.stories.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,21 @@ import { ThemeProvider } from "@react-ck/theme";
44
import { faker } from "@faker-js/faker";
55
import { Text } from "@react-ck/text/src";
66
import { configureStory } from "@react-ck/story-config";
7-
import readme from "@react-ck/card/README.md";
87
import { Card, CardImage } from "@react-ck/card/src";
98

109
type Story = StoryObj<typeof Card>;
1110

1211
const meta: Meta<typeof Card> = {
1312
title: "Generic/Card",
14-
...configureStory(
15-
Card,
16-
{
17-
decorators: [
18-
(Story) => (
19-
<ThemeProvider>
20-
<Story />
21-
</ThemeProvider>
22-
),
23-
],
24-
},
25-
{
26-
readme,
27-
},
28-
),
13+
...configureStory(Card, {
14+
decorators: [
15+
(Story) => (
16+
<ThemeProvider>
17+
<Story />
18+
</ThemeProvider>
19+
),
20+
],
21+
}),
2922
};
3023

3124
export default meta;

packages/docs/stories/src/chip.stories.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,21 @@ import type { Meta, StoryObj } from "@storybook/react";
33
import { ThemeProvider } from "@react-ck/theme";
44
import { faker } from "@faker-js/faker";
55
import { configureStory } from "@react-ck/story-config";
6-
import readme from "@react-ck/chip/README.md";
76
import { Chip } from "@react-ck/chip/src";
87

98
type Story = StoryObj<typeof Chip>;
109

1110
const meta: Meta<typeof Chip> = {
1211
title: "Generic/Chip",
13-
...configureStory(
14-
Chip,
15-
{
16-
decorators: [
17-
(Story) => (
18-
<ThemeProvider>
19-
<Story />
20-
</ThemeProvider>
21-
),
22-
],
23-
},
24-
{
25-
readme,
26-
},
27-
),
12+
...configureStory(Chip, {
13+
decorators: [
14+
(Story) => (
15+
<ThemeProvider>
16+
<Story />
17+
</ThemeProvider>
18+
),
19+
],
20+
}),
2821
};
2922

3023
export default meta;

packages/docs/stories/src/collapse.stories.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,21 @@ import { ThemeProvider } from "@react-ck/theme";
44
import { faker } from "@faker-js/faker";
55
import { Text } from "@react-ck/text/src";
66
import { configureStory } from "@react-ck/story-config";
7-
import readme from "@react-ck/collapse/README.md";
87
import { Collapse } from "@react-ck/collapse/src";
98

109
type Story = StoryObj<typeof Collapse>;
1110

1211
const meta: Meta<typeof Collapse> = {
1312
title: "Generic/Collapse",
14-
...configureStory(
15-
Collapse,
16-
{
17-
decorators: [
18-
(Story) => (
19-
<ThemeProvider>
20-
<Story />
21-
</ThemeProvider>
22-
),
23-
],
24-
},
25-
{
26-
readme,
27-
},
28-
),
13+
...configureStory(Collapse, {
14+
decorators: [
15+
(Story) => (
16+
<ThemeProvider>
17+
<Story />
18+
</ThemeProvider>
19+
),
20+
],
21+
}),
2922
};
3023

3124
export default meta;

packages/docs/stories/src/container.stories.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,21 @@ import { ThemeProvider } from "@react-ck/theme";
44
import { faker } from "@faker-js/faker";
55
import { Text } from "@react-ck/text/src";
66
import { configureStory } from "@react-ck/story-config";
7-
import readme from "@react-ck/container/README.md";
87
import { Container } from "@react-ck/container/src";
98

109
type Story = StoryObj<typeof Container>;
1110

1211
const meta: Meta<typeof Container> = {
1312
title: "Layout/Container",
14-
...configureStory(
15-
Container,
16-
{
17-
decorators: [
18-
(Story) => (
19-
<ThemeProvider>
20-
<Story />
21-
</ThemeProvider>
22-
),
23-
],
24-
},
25-
{
26-
readme,
27-
},
28-
),
13+
...configureStory(Container, {
14+
decorators: [
15+
(Story) => (
16+
<ThemeProvider>
17+
<Story />
18+
</ThemeProvider>
19+
),
20+
],
21+
}),
2922
};
3023

3124
export default meta;

packages/docs/stories/src/data-table.stories.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,21 @@ import { ThemeProvider } from "@react-ck/theme";
44
import { faker } from "@faker-js/faker";
55
import { Chip } from "@react-ck/chip/src";
66
import { configureStory } from "@react-ck/story-config";
7-
import readme from "@react-ck/data-table/README.md";
87
import { DataTable } from "@react-ck/data-table/src";
98

109
type Story = StoryObj<typeof DataTable>;
1110

1211
const meta: Meta<typeof DataTable> = {
1312
title: "Generic/DataTable",
14-
...configureStory(
15-
DataTable,
16-
{
17-
decorators: [
18-
(Story) => (
19-
<ThemeProvider>
20-
<Story />
21-
</ThemeProvider>
22-
),
23-
],
24-
},
25-
{
26-
readme,
27-
},
28-
),
13+
...configureStory(DataTable, {
14+
decorators: [
15+
(Story) => (
16+
<ThemeProvider>
17+
<Story />
18+
</ThemeProvider>
19+
),
20+
],
21+
}),
2922
};
3023

3124
export default meta;

packages/docs/stories/src/divider.stories.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,21 @@ import React from "react";
22
import type { Meta, StoryObj } from "@storybook/react";
33
import { ThemeProvider } from "@react-ck/theme";
44
import { configureStory } from "@react-ck/story-config";
5-
import readme from "@react-ck/divider/README.md";
65
import { Divider } from "@react-ck/divider/src";
76

87
type Story = StoryObj<typeof Divider>;
98

109
const meta: Meta<typeof Divider> = {
1110
title: "Generic/Divider",
12-
...configureStory(
13-
Divider,
14-
{
15-
decorators: [
16-
(Story) => (
17-
<ThemeProvider>
18-
<Story />
19-
</ThemeProvider>
20-
),
21-
],
22-
},
23-
{
24-
readme,
25-
},
26-
),
11+
...configureStory(Divider, {
12+
decorators: [
13+
(Story) => (
14+
<ThemeProvider>
15+
<Story />
16+
</ThemeProvider>
17+
),
18+
],
19+
}),
2720
};
2821

2922
export default meta;

packages/docs/stories/src/grid.stories.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { Meta, StoryObj } from "@storybook/react";
33
import { ThemeProvider } from "@react-ck/theme";
44
import { faker } from "@faker-js/faker";
55
import { configureStory } from "@react-ck/story-config/src/index";
6-
import readme from "@react-ck/grid/README.md";
76
import { GridContainer, GridColumn } from "@react-ck/grid/src";
87
import { Card } from "@react-ck/card";
98

@@ -23,7 +22,6 @@ const meta: Meta<typeof GridContainer> = {
2322
],
2423
},
2524
{
26-
readme,
2725
subComponents: [GridColumn],
2826
},
2927
),

0 commit comments

Comments
 (0)