From a3a4c50f26b8750ae1c87f1f1103b84b7d2e6315 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 14 Nov 2023 15:11:22 +0100 Subject: refactor(components): replace LinksListWidget with LinksWidget * avoid List component repeat * rewrite tests and CSS * add an id to LinksWidgetItemData (previously LinksListItems) type because the label could be duplicated --- .../widgets/links-list-widget.stories.tsx | 91 ---------------------- 1 file changed, 91 deletions(-) delete mode 100644 src/components/organisms/widgets/links-list-widget.stories.tsx (limited to 'src/components/organisms/widgets/links-list-widget.stories.tsx') diff --git a/src/components/organisms/widgets/links-list-widget.stories.tsx b/src/components/organisms/widgets/links-list-widget.stories.tsx deleted file mode 100644 index 6e5f170..0000000 --- a/src/components/organisms/widgets/links-list-widget.stories.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import { Heading } from '../../atoms'; -import { LinksListWidget } from './links-list-widget'; - -/** - * LinksListWidget - Storybook Meta - */ -export default { - title: 'Organisms/Widgets/LinksList', - component: LinksListWidget, - args: { - isOrdered: false, - }, - 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: { - name: 'object', - required: true, - value: {}, - }, - }, - }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); - -const items = [ - { name: 'Level 1: Item 1', url: '#' }, - { - name: 'Level 1: Item 2', - url: '#', - child: [ - { name: 'Level 2: Item 1', url: '#' }, - { name: 'Level 2: Item 2', url: '#' }, - { - name: 'Level 2: Item 3', - url: '#', - child: [ - { name: 'Level 3: Item 1', url: '#' }, - { name: 'Level 3: Item 2', url: '#' }, - ], - }, - { name: 'Level 2: Item 4', url: '#' }, - ], - }, - { name: 'Level 1: Item 3', url: '#' }, - { name: 'Level 1: Item 4', url: '#' }, -]; - -/** - * Links List Widget Stories - Unordered - */ -export const Unordered = Template.bind({}); -Unordered.args = { - heading: ( - - Quo et totam - - ), - items, -}; - -/** - * Links List Widget Stories - Ordered - */ -export const Ordered = Template.bind({}); -Ordered.args = { - heading: ( - - Quo et totam - - ), - isOrdered: true, - items, -}; -- cgit v1.2.3