diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-02 18:57:29 +0200 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-03 15:22:24 +0200 | 
| commit | 732d0943f8041d76262222a092b014f2557085ef (patch) | |
| tree | 16f6f76648b479a9591400ab15bb3e9c914f2226 /src/components/atoms/lists | |
| parent | ca921d7536cfe950b5a7d442977bbf900b48faf4 (diff) | |
chore: add homepage
Diffstat (limited to 'src/components/atoms/lists')
| -rw-r--r-- | src/components/atoms/lists/list.module.scss | 16 | ||||
| -rw-r--r-- | src/components/atoms/lists/list.stories.tsx | 13 | ||||
| -rw-r--r-- | src/components/atoms/lists/list.tsx | 4 | 
3 files changed, 29 insertions, 4 deletions
| 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' }, @@ -72,6 +72,15 @@ const items: ListItem[] = [  ];  /** + * List Stories - Flex list + */ +export const Flex = Template.bind({}); +Flex.args = { +  items, +  kind: 'flex', +}; + +/**   * List Stories - Ordered list   */  export const Ordered = Template.bind({}); 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.     */ | 
