aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/layout
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-15 18:35:16 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-15 18:49:49 +0100
commit0f936ec0e7606cb79434d94096b6e113a7ce78eb (patch)
tree465ec7f66ac9459be6a18ac046e10357814c7b92 /src/components/atoms/layout
parent4e4d2eb25365be861e19f9756cf334ba2faa6911 (diff)
refactor(stories): migrate stories to CSF3 format
Diffstat (limited to 'src/components/atoms/layout')
-rw-r--r--src/components/atoms/layout/article/article.stories.ts17
-rw-r--r--src/components/atoms/layout/article/article.stories.tsx34
-rw-r--r--src/components/atoms/layout/aside/aside.stories.ts17
-rw-r--r--src/components/atoms/layout/aside/aside.stories.tsx34
-rw-r--r--src/components/atoms/layout/footer/footer.stories.ts17
-rw-r--r--src/components/atoms/layout/footer/footer.stories.tsx34
-rw-r--r--src/components/atoms/layout/header/header.stories.ts17
-rw-r--r--src/components/atoms/layout/header/header.stories.tsx34
-rw-r--r--src/components/atoms/layout/main/main.stories.ts17
-rw-r--r--src/components/atoms/layout/main/main.stories.tsx57
-rw-r--r--src/components/atoms/layout/nav/nav.stories.ts17
-rw-r--r--src/components/atoms/layout/nav/nav.stories.tsx34
-rw-r--r--src/components/atoms/layout/section/section.stories.ts17
-rw-r--r--src/components/atoms/layout/section/section.stories.tsx37
-rw-r--r--src/components/atoms/layout/time/time.stories.ts17
-rw-r--r--src/components/atoms/layout/time/time.stories.tsx32
16 files changed, 136 insertions, 296 deletions
diff --git a/src/components/atoms/layout/article/article.stories.ts b/src/components/atoms/layout/article/article.stories.ts
new file mode 100644
index 0000000..f0bda0e
--- /dev/null
+++ b/src/components/atoms/layout/article/article.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Article } from './article';
+
+const meta = {
+ component: Article,
+ title: 'Atoms/Layout/Article',
+} satisfies Meta<typeof Article>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: 'The article contents.',
+ },
+};
diff --git a/src/components/atoms/layout/article/article.stories.tsx b/src/components/atoms/layout/article/article.stories.tsx
deleted file mode 100644
index 4c5b158..0000000
--- a/src/components/atoms/layout/article/article.stories.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Article as ArticleComponent } from './article';
-
-/**
- * Article - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout',
- component: ArticleComponent,
- argTypes: {
- children: {
- control: {
- type: 'text',
- },
- description: 'The contents.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof ArticleComponent>;
-
-const Template: ComponentStory<typeof ArticleComponent> = (args) => (
- <ArticleComponent {...args} />
-);
-
-/**
- * Layout Stories - Article
- */
-export const Article = Template.bind({});
-Article.args = {
- children: 'The article content.',
-};
diff --git a/src/components/atoms/layout/aside/aside.stories.ts b/src/components/atoms/layout/aside/aside.stories.ts
new file mode 100644
index 0000000..c58372a
--- /dev/null
+++ b/src/components/atoms/layout/aside/aside.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Aside } from './aside';
+
+const meta = {
+ component: Aside,
+ title: 'Atoms/Layout/Aside',
+} satisfies Meta<typeof Aside>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: 'The aside contents.',
+ },
+};
diff --git a/src/components/atoms/layout/aside/aside.stories.tsx b/src/components/atoms/layout/aside/aside.stories.tsx
deleted file mode 100644
index a394d1b..0000000
--- a/src/components/atoms/layout/aside/aside.stories.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Aside as AsideComponent } from './aside';
-
-/**
- * Aside - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout',
- component: AsideComponent,
- argTypes: {
- children: {
- control: {
- type: 'text',
- },
- description: 'The contents.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof AsideComponent>;
-
-const Template: ComponentStory<typeof AsideComponent> = (args) => (
- <AsideComponent {...args} />
-);
-
-/**
- * Layout Stories - Aside
- */
-export const Aside = Template.bind({});
-Aside.args = {
- children: 'The aside content.',
-};
diff --git a/src/components/atoms/layout/footer/footer.stories.ts b/src/components/atoms/layout/footer/footer.stories.ts
new file mode 100644
index 0000000..662524c
--- /dev/null
+++ b/src/components/atoms/layout/footer/footer.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Footer } from './footer';
+
+const meta = {
+ component: Footer,
+ title: 'Atoms/Layout/Footer',
+} satisfies Meta<typeof Footer>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: 'The footer contents.',
+ },
+};
diff --git a/src/components/atoms/layout/footer/footer.stories.tsx b/src/components/atoms/layout/footer/footer.stories.tsx
deleted file mode 100644
index 0df1647..0000000
--- a/src/components/atoms/layout/footer/footer.stories.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Footer as FooterComponent } from './footer';
-
-/**
- * Footer - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout',
- component: FooterComponent,
- argTypes: {
- children: {
- control: {
- type: 'text',
- },
- description: 'The contents.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof FooterComponent>;
-
-const Template: ComponentStory<typeof FooterComponent> = (args) => (
- <FooterComponent {...args} />
-);
-
-/**
- * Layout Stories - Footer
- */
-export const Footer = Template.bind({});
-Footer.args = {
- children: 'The footer content.',
-};
diff --git a/src/components/atoms/layout/header/header.stories.ts b/src/components/atoms/layout/header/header.stories.ts
new file mode 100644
index 0000000..2afe715
--- /dev/null
+++ b/src/components/atoms/layout/header/header.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Header } from './header';
+
+const meta = {
+ component: Header,
+ title: 'Atoms/Layout/Header',
+} satisfies Meta<typeof Header>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: 'The header contents.',
+ },
+};
diff --git a/src/components/atoms/layout/header/header.stories.tsx b/src/components/atoms/layout/header/header.stories.tsx
deleted file mode 100644
index 3d98263..0000000
--- a/src/components/atoms/layout/header/header.stories.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Header as HeaderComponent } from './header';
-
-/**
- * Header - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout',
- component: HeaderComponent,
- argTypes: {
- children: {
- control: {
- type: 'text',
- },
- description: 'The contents.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof HeaderComponent>;
-
-const Template: ComponentStory<typeof HeaderComponent> = (args) => (
- <HeaderComponent {...args} />
-);
-
-/**
- * Layout Stories - Header
- */
-export const Header = Template.bind({});
-Header.args = {
- children: 'The header content.',
-};
diff --git a/src/components/atoms/layout/main/main.stories.ts b/src/components/atoms/layout/main/main.stories.ts
new file mode 100644
index 0000000..79aedbb
--- /dev/null
+++ b/src/components/atoms/layout/main/main.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Main } from './main';
+
+const meta = {
+ component: Main,
+ title: 'Atoms/Layout/Main',
+} satisfies Meta<typeof Main>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: 'The main contents.',
+ },
+};
diff --git a/src/components/atoms/layout/main/main.stories.tsx b/src/components/atoms/layout/main/main.stories.tsx
deleted file mode 100644
index 6a22ed5..0000000
--- a/src/components/atoms/layout/main/main.stories.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Main as MainComponent } from './main';
-
-/**
- * Main - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout',
- component: MainComponent,
- argTypes: {
- children: {
- control: {
- type: 'text',
- },
- description: 'The content.',
- type: {
- name: 'string',
- required: true,
- },
- },
- className: {
- control: {
- type: 'text',
- },
- description: 'Set additional classnames to the main element.',
- table: {
- category: 'Styles',
- },
- type: {
- name: 'string',
- required: false,
- },
- },
- id: {
- control: {
- type: 'text',
- },
- description: 'The main element id.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof MainComponent>;
-
-const Template: ComponentStory<typeof MainComponent> = (args) => (
- <MainComponent {...args} />
-);
-
-/**
- * Layout Stories - Main
- */
-export const Main = Template.bind({});
-Main.args = {
- children: 'The main content.',
-};
diff --git a/src/components/atoms/layout/nav/nav.stories.ts b/src/components/atoms/layout/nav/nav.stories.ts
new file mode 100644
index 0000000..6ee4e5e
--- /dev/null
+++ b/src/components/atoms/layout/nav/nav.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Nav } from './nav';
+
+const meta = {
+ component: Nav,
+ title: 'Atoms/Layout/Nav',
+} satisfies Meta<typeof Nav>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: 'The nav contents.',
+ },
+};
diff --git a/src/components/atoms/layout/nav/nav.stories.tsx b/src/components/atoms/layout/nav/nav.stories.tsx
deleted file mode 100644
index 5649abf..0000000
--- a/src/components/atoms/layout/nav/nav.stories.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Nav as NavComponent } from './nav';
-
-/**
- * Nav - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout',
- component: NavComponent,
- argTypes: {
- children: {
- control: {
- type: 'text',
- },
- description: 'The contents.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof NavComponent>;
-
-const Template: ComponentStory<typeof NavComponent> = (args) => (
- <NavComponent {...args} />
-);
-
-/**
- * Layout Stories - Nav
- */
-export const Nav = Template.bind({});
-Nav.args = {
- children: 'The nav content.',
-};
diff --git a/src/components/atoms/layout/section/section.stories.ts b/src/components/atoms/layout/section/section.stories.ts
new file mode 100644
index 0000000..f8df223
--- /dev/null
+++ b/src/components/atoms/layout/section/section.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Section } from './section';
+
+const meta = {
+ component: Section,
+ title: 'Atoms/Layout/Section',
+} satisfies Meta<typeof Section>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ children: 'The section contents.',
+ },
+};
diff --git a/src/components/atoms/layout/section/section.stories.tsx b/src/components/atoms/layout/section/section.stories.tsx
deleted file mode 100644
index fdc8217..0000000
--- a/src/components/atoms/layout/section/section.stories.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Heading } from '../../heading';
-import { Section as SectionComponent } from './section';
-
-/**
- * Section - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout/Section',
- component: SectionComponent,
- argTypes: {
- children: {
- description: 'The section contents.',
- type: {
- name: 'function',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof SectionComponent>;
-
-const Template: ComponentStory<typeof SectionComponent> = (args) => (
- <SectionComponent {...args} />
-);
-
-/**
- * Section Story
- */
-export const Section = Template.bind({});
-Section.args = {
- children: (
- <>
- <Heading level={2}>A section title</Heading>
- <div>The body</div>
- </>
- ),
-};
diff --git a/src/components/atoms/layout/time/time.stories.ts b/src/components/atoms/layout/time/time.stories.ts
new file mode 100644
index 0000000..6e00a4c
--- /dev/null
+++ b/src/components/atoms/layout/time/time.stories.ts
@@ -0,0 +1,17 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { Time } from './time';
+
+const meta = {
+ component: Time,
+ title: 'Atoms/Layout/Time',
+} satisfies Meta<typeof Time>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+export const Example: Story = {
+ args: {
+ date: '2022-03-15 10:44:20',
+ },
+};
diff --git a/src/components/atoms/layout/time/time.stories.tsx b/src/components/atoms/layout/time/time.stories.tsx
deleted file mode 100644
index d534f14..0000000
--- a/src/components/atoms/layout/time/time.stories.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { Time } from './time';
-
-/**
- * Time - Storybook Meta
- */
-export default {
- title: 'Atoms/Layout/Time',
- component: Time,
- argTypes: {
- date: {
- control: {
- type: 'text',
- },
- description: 'A valid date string.',
- type: {
- name: 'string',
- required: true,
- },
- },
- },
-} as ComponentMeta<typeof Time>;
-
-const Template: ComponentStory<typeof Time> = (args) => <Time {...args} />;
-
-/**
- * Time Stories - Default
- */
-export const Default = Template.bind({});
-Default.args = {
- date: '2022-03-15 10:44:20',
-};