aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/widgets/links-list-widget.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-04-20 19:24:21 +0200
committerArmand Philippot <git@armandphilippot.com>2022-04-20 19:27:29 +0200
commita08291b1586858fc894a27d56f55f87a88f8dbd3 (patch)
tree0aa36c8add0ad0ecc07c0f7f20f5af3e2f7abe46 /src/components/organisms/widgets/links-list-widget.stories.tsx
parent362cf45bc520a68a1c1be20e1189ca2307577dde (diff)
refactor(storybook): reorganize design system
Add more stories for each components and change some components categories for better organization.
Diffstat (limited to 'src/components/organisms/widgets/links-list-widget.stories.tsx')
-rw-r--r--src/components/organisms/widgets/links-list-widget.stories.tsx37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/components/organisms/widgets/links-list-widget.stories.tsx b/src/components/organisms/widgets/links-list-widget.stories.tsx
index 528f6f7..0f03a2c 100644
--- a/src/components/organisms/widgets/links-list-widget.stories.tsx
+++ b/src/components/organisms/widgets/links-list-widget.stories.tsx
@@ -2,8 +2,11 @@ import { ComponentMeta, ComponentStory } from '@storybook/react';
import { IntlProvider } from 'react-intl';
import LinksListWidget from './links-list-widget';
+/**
+ * LinksListWidget - Storybook Meta
+ */
export default {
- title: 'Organisms/Widgets',
+ title: 'Organisms/Widgets/LinksList',
component: LinksListWidget,
args: {
kind: 'unordered',
@@ -35,6 +38,8 @@ export default {
level: {
control: {
type: 'number',
+ min: 1,
+ max: 6,
},
description: 'The heading level.',
type: {
@@ -53,12 +58,17 @@ export default {
},
},
},
+ decorators: [
+ (Story) => (
+ <IntlProvider locale="en">
+ <Story />
+ </IntlProvider>
+ ),
+ ],
} as ComponentMeta<typeof LinksListWidget>;
const Template: ComponentStory<typeof LinksListWidget> = (args) => (
- <IntlProvider locale="en">
- <LinksListWidget {...args} />
- </IntlProvider>
+ <LinksListWidget {...args} />
);
const items = [
@@ -84,9 +94,24 @@ const items = [
{ name: 'Level 1: Item 4', url: '#' },
];
-export const LinksList = Template.bind({});
-LinksList.args = {
+/**
+ * Links List Widget Stories - Unordered
+ */
+export const Unordered = Template.bind({});
+Unordered.args = {
items,
+ kind: 'unordered',
+ level: 2,
+ title: 'A list of links',
+};
+
+/**
+ * Links List Widget Stories - Ordered
+ */
+export const Ordered = Template.bind({});
+Ordered.args = {
+ items,
+ kind: 'ordered',
level: 2,
title: 'A list of links',
};