Skip to content

Commit d3635af

Browse files
committed
refactor: add stories
1 parent 943212a commit d3635af

File tree

12 files changed

+145
-17
lines changed

12 files changed

+145
-17
lines changed

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/components/all/src/container/index.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
box-sizing: border-box;
88
max-width: get-css-var(container, max-width);
9-
padding: get-css-var(container, spacing-y) get-css-var(spacing-x);
9+
padding: get-css-var(container, spacing-y) get-css-var(container, spacing-x);
1010
margin: 0 auto;
1111
}
1212

packages/components/all/src/divider/styles/index.module.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
.horizontal {
1212
@include define-css-var(divider, width, 100%);
1313
@include define-css-var(divider, height, 1px);
14+
min-width: get-spacing(2);
1415
}
1516

1617
.vertical {
1718
@include define-css-var(divider, width, 1px);
1819
@include define-css-var(divider, height, 100%);
20+
min-height: get-spacing(2);
1921
}

packages/docs/stories/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"dependencies": {
1818
"@rck/all": "^1.0.0",
1919
"@rck/button": "^1.0.0",
20+
"@rck/icon": "^1.0.0",
2021
"@rck/input": "^1.0.0",
2122
"@rck/theme": "^1.0.0"
2223
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import { faker } from "@faker-js/faker";
55
import { sentenceCase } from "change-case";
66
import { Button } from "@rck/button/src/index";
77

8-
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
9-
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout
10-
// More on argTypes: https://storybook.js.org/docs/react/api/argtypes
11-
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
12-
138
const meta: Meta<typeof Button> = {
149
title: "Components/Button",
1510
component: Button,
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
import { ThemeProvider } from "@rck/theme";
4+
import { faker } from "@faker-js/faker";
5+
import { Card, Text } from "@rck/all/src";
6+
7+
const meta: Meta<typeof Card> = {
8+
title: "Components/Card",
9+
component: Card,
10+
decorators: [
11+
(Story) => (
12+
<ThemeProvider>
13+
<Story />
14+
</ThemeProvider>
15+
),
16+
],
17+
};
18+
19+
export default meta;
20+
21+
type Story = StoryObj<typeof Card>;
22+
23+
export const Default: Story = {
24+
args: {
25+
children: <Text>{faker.lorem.sentence()}</Text>,
26+
},
27+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
import { ThemeProvider } from "@rck/theme";
4+
import { faker } from "@faker-js/faker";
5+
import { Chip } from "@rck/all/src";
6+
7+
const meta: Meta<typeof Chip> = {
8+
title: "Components/Chip",
9+
component: Chip,
10+
decorators: [
11+
(Story) => (
12+
<ThemeProvider>
13+
<Story />
14+
</ThemeProvider>
15+
),
16+
],
17+
};
18+
19+
export default meta;
20+
21+
type Story = StoryObj<typeof Chip>;
22+
23+
export const Default: Story = {
24+
args: {
25+
children: faker.lorem.words({ min: 1, max: 2 }),
26+
},
27+
};
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from "react";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
import { ThemeProvider } from "@rck/theme";
4+
import { faker } from "@faker-js/faker";
5+
import { Collapse, Text } from "@rck/all/src";
6+
7+
const meta: Meta<typeof Collapse> = {
8+
title: "Components/Collapse",
9+
component: Collapse,
10+
decorators: [
11+
(Story) => (
12+
<ThemeProvider>
13+
<Story />
14+
</ThemeProvider>
15+
),
16+
],
17+
};
18+
19+
export default meta;
20+
21+
type Story = StoryObj<typeof Collapse>;
22+
23+
export const Default: Story = {
24+
parameters: {
25+
layout: "padded",
26+
},
27+
args: {
28+
header: <Text type="h2">{faker.lorem.sentence()}</Text>,
29+
children: <Text>{faker.lorem.sentence()}</Text>,
30+
},
31+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from "react";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
import { ThemeProvider } from "@rck/theme";
4+
import { Divider } from "@rck/all/src";
5+
6+
const meta: Meta<typeof Divider> = {
7+
title: "Components/Divider",
8+
component: Divider,
9+
decorators: [
10+
(Story) => (
11+
<ThemeProvider>
12+
<Story />
13+
</ThemeProvider>
14+
),
15+
],
16+
};
17+
18+
export default meta;
19+
20+
type Story = StoryObj<typeof Divider>;
21+
22+
export const Default: Story = {};
23+
24+
export const vertical: Story = {
25+
args: {
26+
type: "vertical",
27+
},
28+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from "react";
2+
import type { Meta, StoryObj } from "@storybook/react";
3+
import { ThemeProvider } from "@rck/theme";
4+
import { Icon } from "@rck/icon";
5+
6+
const meta: Meta<typeof Icon> = {
7+
title: "Components/Icon",
8+
component: Icon,
9+
decorators: [
10+
(Story) => (
11+
<ThemeProvider>
12+
<Story />
13+
</ThemeProvider>
14+
),
15+
],
16+
};
17+
18+
export default meta;
19+
20+
type Story = StoryObj<typeof Icon>;
21+
22+
export const Default: Story = {
23+
args: {
24+
name: "BsBellFill",
25+
},
26+
};

0 commit comments

Comments
 (0)