Skip to content

Commit 69d1e28

Browse files
committed
feat(stories): add section stories
1 parent caf890a commit 69d1e28

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import { Children } from '@/@types/components'
2+
import type { Meta, StoryObj } from '@storybook/react'
3+
4+
import { Link } from '@/components/Link'
5+
import { Section } from '@/components/Section'
6+
7+
const { Container, Header, Footer, Title, Description, Content, SubSection } =
8+
Section
9+
10+
const Illustration = () => (
11+
<div className="flex h-24 w-24 items-center justify-center rounded-full bg-cyan-800 text-xl font-bold text-white">
12+
Image
13+
</div>
14+
)
15+
16+
const SectionLayout = ({ children }: Children) => (
17+
<Container>
18+
<Header>
19+
<Title>Section Title</Title>
20+
<Description>Section Description</Description>
21+
</Header>
22+
23+
<Content>
24+
<SubSection.Content.Container>
25+
<SubSection.Content.Illustration>
26+
<Illustration />
27+
</SubSection.Content.Illustration>
28+
<SubSection.Content.Description>
29+
{children}
30+
</SubSection.Content.Description>
31+
</SubSection.Content.Container>
32+
<SubSection.Links.Container>
33+
<Link textColor="black" target="_blank" hover="bgCyan" iconName="Link2">
34+
Link
35+
</Link>
36+
</SubSection.Links.Container>
37+
</Content>
38+
39+
<Footer>Section Footer</Footer>
40+
</Container>
41+
)
42+
43+
const meta = {
44+
title: 'Design System/Components/Section/Container',
45+
component: SectionLayout,
46+
parameters: {
47+
layout: 'centered',
48+
},
49+
tags: ['section', 'component'],
50+
argTypes: {
51+
children: {
52+
name: 'Text',
53+
description:
54+
'The text that will be showed on the center of this component.',
55+
},
56+
},
57+
} satisfies Meta<typeof SectionLayout>
58+
59+
export default meta
60+
type Story = StoryObj<typeof meta>
61+
62+
export const Default: Story = {
63+
args: {
64+
children:
65+
'Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eius, accusamus at quas enim distinctio consequuntur, ut illum delectus nisi libero voluptas quo eligendi!',
66+
},
67+
}

0 commit comments

Comments
 (0)