Skip to content

Commit 488700b

Browse files
author
Nikolai Lopin
committed
docs: moves Card stories to the card folder
1 parent 30786b7 commit 488700b

File tree

4 files changed

+59
-39
lines changed

4 files changed

+59
-39
lines changed

src/components/Card/Card.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type CardProps = BorderRadiusProps &
2525
PaddingProps & {
2626
/**
2727
* Set the visual depth of the card by adding a shadow (available values: 0, 100, 200, 300)
28+
* @default 0
2829
*/
2930
level?: ResponsiveValue<0 | 100 | 200 | 300>;
3031
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React from 'react';
2+
import { Meta, StoryObj } from '@storybook/react';
3+
import { Card } from '../Card';
4+
import { Button } from '../../Button/Button';
5+
6+
const meta: Meta = {
7+
title: 'Components/Card',
8+
component: Card,
9+
argTypes: {
10+
ref: { table: { disable: true } },
11+
forwardedAs: { table: { disable: true } },
12+
theme: { table: { disable: true } },
13+
as: { table: { disable: true } },
14+
children: { description: 'Defines the inner content of the card' },
15+
level: {
16+
options: [0, 100, 200, 300],
17+
control: 'radio'
18+
}
19+
},
20+
args: {
21+
children: 'Card Contents'
22+
}
23+
};
24+
25+
export default meta;
26+
27+
type Story = StoryObj<typeof Card>;
28+
29+
export const Default: Story = {};
30+
31+
export const WithLevel: Story = {
32+
args: {
33+
level: 300
34+
}
35+
};
36+
37+
export const WithReactComponent = {
38+
args: {
39+
children: <Button>A button inside the `Card`</Button>
40+
}
41+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Meta, ArgsTable, Primary, Stories } from '@storybook/blocks';
2+
import { StyledSystemLinks } from '../../../docs/StyledSystemLinks';
3+
import * as CardStories from './Card.stories';
4+
5+
<Meta of={CardStories} />
6+
7+
# Card
8+
9+
<Primary />
10+
11+
## Properties
12+
13+
<ArgsTable story="Default" />
14+
15+
<StyledSystemLinks component="Card" supportedProps={['space', 'height', 'width']} />
16+
17+
<Stories includePrimary={false} />

src/stories/components/Card.stories.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)