From 732d0943f8041d76262222a092b014f2557085ef Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 2 May 2022 18:57:29 +0200 Subject: chore: add homepage --- src/components/atoms/lists/list.module.scss | 16 ++++++++++++++++ src/components/atoms/lists/list.stories.tsx | 13 +++++++++++-- src/components/atoms/lists/list.tsx | 4 ++-- 3 files changed, 29 insertions(+), 4 deletions(-) (limited to 'src/components/atoms') diff --git a/src/components/atoms/lists/list.module.scss b/src/components/atoms/lists/list.module.scss index df3b49c..f647072 100644 --- a/src/components/atoms/lists/list.module.scss +++ b/src/components/atoms/lists/list.module.scss @@ -1,3 +1,5 @@ +@use "@styles/abstracts/placeholders"; + .list { margin: 0; @@ -36,4 +38,18 @@ margin-bottom: var(--spacing-2xs); } } + + &--flex { + @extend %reset-list; + + display: flex; + flex-flow: row wrap; + gap: var(--spacing-sm); + } + + &--flex &--flex { + display: initial; + position: relative; + top: var(--spacing-2xs); + } } diff --git a/src/components/atoms/lists/list.stories.tsx b/src/components/atoms/lists/list.stories.tsx index 3a80962..54fdd3a 100644 --- a/src/components/atoms/lists/list.stories.tsx +++ b/src/components/atoms/lists/list.stories.tsx @@ -39,8 +39,8 @@ export default { control: { type: 'select', }, - description: 'The list kind: ordered or unordered.', - options: ['ordered', 'unordered'], + description: 'The list kind: flex, ordered or unordered.', + options: ['flex', 'ordered', 'unordered'], table: { category: 'Options', defaultValue: { summary: 'unordered' }, @@ -71,6 +71,15 @@ const items: ListItem[] = [ { id: 'item-4', value: 'Item 4' }, ]; +/** + * List Stories - Flex list + */ +export const Flex = Template.bind({}); +Flex.args = { + items, + kind: 'flex', +}; + /** * List Stories - Ordered list */ diff --git a/src/components/atoms/lists/list.tsx b/src/components/atoms/lists/list.tsx index 6726802..711ade1 100644 --- a/src/components/atoms/lists/list.tsx +++ b/src/components/atoms/lists/list.tsx @@ -30,9 +30,9 @@ export type ListProps = { */ itemsClassName?: string; /** - * The list kind (ordered or unordered). + * The list kind. */ - kind?: 'ordered' | 'unordered'; + kind?: 'ordered' | 'unordered' | 'flex'; /** * Set margin between list items. Default: true. */ -- cgit v1.2.3