summaryrefslogtreecommitdiffstats
path: root/src/components/organisms
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms')
-rw-r--r--src/components/organisms/forms/comment-form.stories.tsx21
-rw-r--r--src/components/organisms/forms/contact-form.stories.tsx11
-rw-r--r--src/components/organisms/forms/search-form.stories.tsx10
-rw-r--r--src/components/organisms/forms/settings-form.stories.tsx20
-rw-r--r--src/components/organisms/layout/comment.stories.tsx1
-rw-r--r--src/components/organisms/layout/comments-list.stories.tsx4
-rw-r--r--src/components/organisms/layout/header.stories.tsx10
-rw-r--r--src/components/organisms/layout/posts-list.stories.tsx44
-rw-r--r--src/components/organisms/modals/search-modal.stories.tsx10
-rw-r--r--src/components/organisms/modals/settings-modal.stories.tsx20
-rw-r--r--src/components/organisms/toolbar/main-nav.stories.tsx11
-rw-r--r--src/components/organisms/toolbar/search.stories.tsx13
-rw-r--r--src/components/organisms/toolbar/settings.stories.tsx3
-rw-r--r--src/components/organisms/toolbar/settings.tsx9
-rw-r--r--src/components/organisms/toolbar/toolbar.stories.tsx10
-rw-r--r--src/components/organisms/widgets/image-widget.stories.tsx21
-rw-r--r--src/components/organisms/widgets/links-list-widget.stories.tsx21
-rw-r--r--src/components/organisms/widgets/social-media.stories.tsx8
-rw-r--r--src/components/organisms/widgets/table-of-contents.stories.tsx8
19 files changed, 198 insertions, 57 deletions
diff --git a/src/components/organisms/forms/comment-form.stories.tsx b/src/components/organisms/forms/comment-form.stories.tsx
index 8b11df7..1a9e7b7 100644
--- a/src/components/organisms/forms/comment-form.stories.tsx
+++ b/src/components/organisms/forms/comment-form.stories.tsx
@@ -13,6 +13,8 @@ export default {
component: CommentForm,
args: {
saveComment,
+ titleAlignment: 'left',
+ titleLevel: 2,
},
argTypes: {
className: {
@@ -56,6 +58,9 @@ export default {
type: null,
},
description: 'A callback function to process the comment form data.',
+ table: {
+ category: 'Events',
+ },
type: {
name: 'function',
required: true,
@@ -74,6 +79,21 @@ export default {
required: false,
},
},
+ titleAlignment: {
+ control: {
+ type: 'select',
+ },
+ description: 'The heading alignment.',
+ options: ['center', 'left'],
+ table: {
+ category: 'Options',
+ defaultValue: { summary: 'left' },
+ },
+ type: {
+ name: 'string',
+ required: false,
+ },
+ },
titleLevel: {
control: {
type: 'number',
@@ -83,6 +103,7 @@ export default {
description: 'The title level (hn).',
table: {
category: 'Options',
+ defaultValue: { summary: 2 },
},
type: {
name: 'number',
diff --git a/src/components/organisms/forms/contact-form.stories.tsx b/src/components/organisms/forms/contact-form.stories.tsx
index 39d0b71..191d448 100644
--- a/src/components/organisms/forms/contact-form.stories.tsx
+++ b/src/components/organisms/forms/contact-form.stories.tsx
@@ -1,5 +1,4 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { IntlProvider } from 'react-intl';
import ContactForm from './contact-form';
/**
@@ -40,19 +39,15 @@ export default {
type: null,
},
description: 'A callback function to process the contact form data.',
+ table: {
+ category: 'Events',
+ },
type: {
name: 'function',
required: true,
},
},
},
- decorators: [
- (Story) => (
- <IntlProvider locale="en">
- <Story />
- </IntlProvider>
- ),
- ],
} as ComponentMeta<typeof ContactForm>;
const Template: ComponentStory<typeof ContactForm> = (args) => (
diff --git a/src/components/organisms/forms/search-form.stories.tsx b/src/components/organisms/forms/search-form.stories.tsx
index 6ea6122..d8c8e1e 100644
--- a/src/components/organisms/forms/search-form.stories.tsx
+++ b/src/components/organisms/forms/search-form.stories.tsx
@@ -39,6 +39,16 @@ export default {
required: false,
},
},
+ searchPage: {
+ control: {
+ type: 'text',
+ },
+ description: 'The search results page url.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
},
} as ComponentMeta<typeof SearchForm>;
diff --git a/src/components/organisms/forms/settings-form.stories.tsx b/src/components/organisms/forms/settings-form.stories.tsx
index 46305e7..70e1844 100644
--- a/src/components/organisms/forms/settings-form.stories.tsx
+++ b/src/components/organisms/forms/settings-form.stories.tsx
@@ -8,6 +8,16 @@ export default {
title: 'Organisms/Forms',
component: SettingsForm,
argTypes: {
+ ackeeStorageKey: {
+ control: {
+ type: 'text',
+ },
+ description: 'The local storage key for Ackee setting.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
className: {
control: {
type: 'text',
@@ -21,6 +31,16 @@ export default {
required: false,
},
},
+ motionStorageKey: {
+ control: {
+ type: 'text',
+ },
+ description: 'The local storage key for reduced motion setting.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
tooltipClassName: {
control: {
type: 'text',
diff --git a/src/components/organisms/layout/comment.stories.tsx b/src/components/organisms/layout/comment.stories.tsx
index c31b77a..c7649ab 100644
--- a/src/components/organisms/layout/comment.stories.tsx
+++ b/src/components/organisms/layout/comment.stories.tsx
@@ -12,6 +12,7 @@ export default {
title: 'Organisms/Layout',
component: CommentComponent,
args: {
+ canReply: true,
saveComment,
},
argTypes: {
diff --git a/src/components/organisms/layout/comments-list.stories.tsx b/src/components/organisms/layout/comments-list.stories.tsx
index 4d95205..1ed159a 100644
--- a/src/components/organisms/layout/comments-list.stories.tsx
+++ b/src/components/organisms/layout/comments-list.stories.tsx
@@ -1,5 +1,5 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import CommentsListComponent, { Comment } from './comments-list';
+import CommentsListComponent, { type Comment } from './comments-list';
const saveComment = async () => {
/** Do nothing. */
@@ -29,6 +29,8 @@ export default {
depth: {
control: {
type: 'number',
+ min: 0,
+ max: 4,
},
description: 'The maximum depth. Use `0` to not display nested comments.',
type: {
diff --git a/src/components/organisms/layout/header.stories.tsx b/src/components/organisms/layout/header.stories.tsx
index 3ceb337..a5233ea 100644
--- a/src/components/organisms/layout/header.stories.tsx
+++ b/src/components/organisms/layout/header.stories.tsx
@@ -92,6 +92,16 @@ export default {
required: true,
},
},
+ searchPage: {
+ control: {
+ type: 'text',
+ },
+ description: 'The search results page url.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
title: {
control: {
type: 'text',
diff --git a/src/components/organisms/layout/posts-list.stories.tsx b/src/components/organisms/layout/posts-list.stories.tsx
index 77318f4..96fb2f0 100644
--- a/src/components/organisms/layout/posts-list.stories.tsx
+++ b/src/components/organisms/layout/posts-list.stories.tsx
@@ -10,10 +10,26 @@ export default {
args: {
byYear: false,
isLoading: false,
+ pageNumber: 1,
showLoadMoreBtn: false,
+ siblings: 1,
titleLevel: 2,
},
argTypes: {
+ baseUrl: {
+ control: {
+ type: 'text',
+ },
+ description: 'The pagination base url.',
+ table: {
+ category: 'Options',
+ defaultValue: { summary: '/page/' },
+ },
+ type: {
+ name: 'string',
+ required: false,
+ },
+ },
byYear: {
control: {
type: 'boolean',
@@ -55,6 +71,20 @@ export default {
required: false,
},
},
+ pageNumber: {
+ control: {
+ type: 'number',
+ },
+ description: 'The current page number.',
+ table: {
+ category: 'Options',
+ defaultValue: { summary: 1 },
+ },
+ type: {
+ name: 'number',
+ required: false,
+ },
+ },
posts: {
description: 'The posts data.',
type: {
@@ -77,6 +107,20 @@ export default {
required: false,
},
},
+ siblings: {
+ control: {
+ type: 'number',
+ },
+ description: 'The number of page siblings inside pagination.',
+ table: {
+ category: 'Options',
+ defaultValue: { summary: 1 },
+ },
+ type: {
+ name: 'number',
+ required: false,
+ },
+ },
titleLevel: {
control: {
type: 'number',
diff --git a/src/components/organisms/modals/search-modal.stories.tsx b/src/components/organisms/modals/search-modal.stories.tsx
index f40696c..5a607c6 100644
--- a/src/components/organisms/modals/search-modal.stories.tsx
+++ b/src/components/organisms/modals/search-modal.stories.tsx
@@ -24,6 +24,16 @@ export default {
required: false,
},
},
+ searchPage: {
+ control: {
+ type: 'text',
+ },
+ description: 'The search results page url.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
},
} as ComponentMeta<typeof SearchModal>;
diff --git a/src/components/organisms/modals/settings-modal.stories.tsx b/src/components/organisms/modals/settings-modal.stories.tsx
index 0fe8c18..d263e2b 100644
--- a/src/components/organisms/modals/settings-modal.stories.tsx
+++ b/src/components/organisms/modals/settings-modal.stories.tsx
@@ -8,6 +8,16 @@ export default {
title: 'Organisms/Modals',
component: SettingsModal,
argTypes: {
+ ackeeStorageKey: {
+ control: {
+ type: 'text',
+ },
+ description: 'A local storage key for Ackee.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
className: {
control: {
type: 'text',
@@ -21,6 +31,16 @@ export default {
required: false,
},
},
+ motionStorageKey: {
+ control: {
+ type: 'text',
+ },
+ description: 'A local storage key for reduced motion setting..',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
tooltipClassName: {
control: {
type: 'text',
diff --git a/src/components/organisms/toolbar/main-nav.stories.tsx b/src/components/organisms/toolbar/main-nav.stories.tsx
index 04b22cb..831636f 100644
--- a/src/components/organisms/toolbar/main-nav.stories.tsx
+++ b/src/components/organisms/toolbar/main-nav.stories.tsx
@@ -1,6 +1,5 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
import { useState } from 'react';
-import { IntlProvider } from 'react-intl';
import MainNav from './main-nav';
/**
@@ -46,19 +45,15 @@ export default {
type: null,
},
description: 'A callback function to change main nav state.',
+ table: {
+ category: 'Events',
+ },
type: {
name: 'function',
required: true,
},
},
},
- decorators: [
- (Story) => (
- <IntlProvider locale="en">
- <Story />
- </IntlProvider>
- ),
- ],
} as ComponentMeta<typeof MainNav>;
const Template: ComponentStory<typeof MainNav> = ({
diff --git a/src/components/organisms/toolbar/search.stories.tsx b/src/components/organisms/toolbar/search.stories.tsx
index 6aaffde..f0f65b4 100644
--- a/src/components/organisms/toolbar/search.stories.tsx
+++ b/src/components/organisms/toolbar/search.stories.tsx
@@ -35,11 +35,24 @@ export default {
required: true,
},
},
+ searchPage: {
+ control: {
+ type: 'text',
+ },
+ description: 'The search results page url.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
setIsActive: {
control: {
type: null,
},
description: 'A callback function to update modal state.',
+ table: {
+ category: 'Events',
+ },
type: {
name: 'function',
required: true,
diff --git a/src/components/organisms/toolbar/settings.stories.tsx b/src/components/organisms/toolbar/settings.stories.tsx
index 9d04932..08ec579 100644
--- a/src/components/organisms/toolbar/settings.stories.tsx
+++ b/src/components/organisms/toolbar/settings.stories.tsx
@@ -41,6 +41,9 @@ export default {
type: null,
},
description: 'Define the modal state: either opened or closed.',
+ table: {
+ category: 'Events',
+ },
type: {
name: 'boolean',
required: true,
diff --git a/src/components/organisms/toolbar/settings.tsx b/src/components/organisms/toolbar/settings.tsx
index 9985ba0..f558eb7 100644
--- a/src/components/organisms/toolbar/settings.tsx
+++ b/src/components/organisms/toolbar/settings.tsx
@@ -9,14 +9,7 @@ import SettingsModal, {
import settingsStyles from './settings.module.scss';
import sharedStyles from './toolbar-items.module.scss';
-export type SettingsProps = Pick<
- SettingsModalProps,
- 'ackeeStorageKey' | 'motionStorageKey' | 'tooltipClassName'
-> & {
- /**
- * Set additional classnames to the modal wrapper.
- */
- className?: string;
+export type SettingsProps = SettingsModalProps & {
/**
* The button state.
*/
diff --git a/src/components/organisms/toolbar/toolbar.stories.tsx b/src/components/organisms/toolbar/toolbar.stories.tsx
index 1f07e79..d613442 100644
--- a/src/components/organisms/toolbar/toolbar.stories.tsx
+++ b/src/components/organisms/toolbar/toolbar.stories.tsx
@@ -54,6 +54,16 @@ export default {
value: {},
},
},
+ searchPage: {
+ control: {
+ type: 'text',
+ },
+ description: 'The search results page url.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
},
parameters: {
layout: 'fullscreen',
diff --git a/src/components/organisms/widgets/image-widget.stories.tsx b/src/components/organisms/widgets/image-widget.stories.tsx
index 3014b36..fa39745 100644
--- a/src/components/organisms/widgets/image-widget.stories.tsx
+++ b/src/components/organisms/widgets/image-widget.stories.tsx
@@ -1,5 +1,4 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { IntlProvider } from 'react-intl';
import ImageWidget from './image-widget';
/**
@@ -27,6 +26,19 @@ export default {
required: false,
},
},
+ className: {
+ control: {
+ type: 'text',
+ },
+ description: 'Set additional classnames to the widget wrapper.',
+ table: {
+ category: 'Styles',
+ },
+ type: {
+ name: 'string',
+ required: false,
+ },
+ },
description: {
control: {
type: 'text',
@@ -107,13 +119,6 @@ export default {
},
},
},
- decorators: [
- (Story) => (
- <IntlProvider locale="en">
- <Story />
- </IntlProvider>
- ),
- ],
} as ComponentMeta<typeof ImageWidget>;
const Template: ComponentStory<typeof ImageWidget> = (args) => (
diff --git a/src/components/organisms/widgets/links-list-widget.stories.tsx b/src/components/organisms/widgets/links-list-widget.stories.tsx
index 0f03a2c..cdfa96a 100644
--- a/src/components/organisms/widgets/links-list-widget.stories.tsx
+++ b/src/components/organisms/widgets/links-list-widget.stories.tsx
@@ -1,5 +1,4 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { IntlProvider } from 'react-intl';
import LinksListWidget from './links-list-widget';
/**
@@ -12,6 +11,19 @@ export default {
kind: 'unordered',
},
argTypes: {
+ className: {
+ control: {
+ type: 'text',
+ },
+ description: 'Set additional classnames to the list wrapper.',
+ table: {
+ category: 'Styles',
+ },
+ type: {
+ name: 'string',
+ required: false,
+ },
+ },
items: {
description: 'The widget data.',
type: {
@@ -58,13 +70,6 @@ export default {
},
},
},
- decorators: [
- (Story) => (
- <IntlProvider locale="en">
- <Story />
- </IntlProvider>
- ),
- ],
} as ComponentMeta<typeof LinksListWidget>;
const Template: ComponentStory<typeof LinksListWidget> = (args) => (
diff --git a/src/components/organisms/widgets/social-media.stories.tsx b/src/components/organisms/widgets/social-media.stories.tsx
index 2fa8bd7..6c9de4d 100644
--- a/src/components/organisms/widgets/social-media.stories.tsx
+++ b/src/components/organisms/widgets/social-media.stories.tsx
@@ -1,5 +1,4 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { IntlProvider } from 'react-intl';
import SocialMediaWidget, { Media } from './social-media';
/**
@@ -40,13 +39,6 @@ export default {
},
},
},
- decorators: [
- (Story) => (
- <IntlProvider locale="en">
- <Story />
- </IntlProvider>
- ),
- ],
} as ComponentMeta<typeof SocialMediaWidget>;
const Template: ComponentStory<typeof SocialMediaWidget> = (args) => (
diff --git a/src/components/organisms/widgets/table-of-contents.stories.tsx b/src/components/organisms/widgets/table-of-contents.stories.tsx
index fba7c54..d8b3af7 100644
--- a/src/components/organisms/widgets/table-of-contents.stories.tsx
+++ b/src/components/organisms/widgets/table-of-contents.stories.tsx
@@ -1,5 +1,4 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { IntlProvider } from 'react-intl';
import ToCWidget from './table-of-contents';
/**
@@ -21,13 +20,6 @@ export default {
},
},
},
- decorators: [
- (Story) => (
- <IntlProvider locale="en">
- <Story />
- </IntlProvider>
- ),
- ],
} as ComponentMeta<typeof ToCWidget>;
const Template: ComponentStory<typeof ToCWidget> = (args) => (