From c72ea861218530d35b5035e71cb026c494e6c84c Mon Sep 17 00:00:00 2001 From: webrooster Date: Tue, 7 Feb 2023 16:07:56 +0100 Subject: [PATCH] fix(Controls): sort control in logic order --- .../stories/Avatar.stories.tsx | 2 ++ .../stories/ImageContainer.stories.tsx | 2 +- .../stories/User.stories.tsx | 2 +- .../stories/buttons/Button.stories.tsx | 2 +- .../stories/buttons/NaviButton.stories.tsx | 13 +++++++++++-- .../stories/forms/Switch.stories.tsx | 6 +++++- .../stories/forms/TextBox.stories.tsx | 14 ++++++++++++++ .../stories/mumble/Mumble.stories.tsx | 4 ++-- .../stories/mumble/MumbleHeader.stories.tsx | 4 ++-- 9 files changed, 39 insertions(+), 10 deletions(-) diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/Avatar.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/Avatar.stories.tsx index e49f9ef7..99517469 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/Avatar.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/Avatar.stories.tsx @@ -18,9 +18,11 @@ export default { control: 'text', }, imageCallBack: { + control: false, action: action('image clicked'), }, buttonCallBack: { + control: false, action: action('button clicked'), }, }, diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/ImageContainer.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/ImageContainer.stories.tsx index 6c4d6ce0..999c3cbe 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/ImageContainer.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/ImageContainer.stories.tsx @@ -26,8 +26,8 @@ export default { args: { src: 'https://picsum.photos/640/360', alt: 'This is a profile picture', - loading: false, type: 'container', + loading: false, }, } as ComponentMeta; diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/User.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/User.stories.tsx index b362add0..4f96e653 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/User.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/User.stories.tsx @@ -50,6 +50,7 @@ export default { args: { label: 'Display Name', variant: 'small', + type: 'edit', username: { label: 'Username', href: '', @@ -87,7 +88,6 @@ export default { label: 'Follow', fCallBack: action('btn clicked'), }, - type: 'edit', }, } as ComponentMeta; diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/buttons/Button.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/buttons/Button.stories.tsx index 54f4d50b..50b6dc3e 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/buttons/Button.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/buttons/Button.stories.tsx @@ -40,11 +40,11 @@ export default { args: { label: 'Button Label', type: 'button', - disabled: false, size: 'small', width: 'default', color: 'slate', icon: 'logo', + disabled: false, }, } as ComponentMeta; diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/buttons/NaviButton.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/buttons/NaviButton.stories.tsx index ea91ad54..724a6d96 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/buttons/NaviButton.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/buttons/NaviButton.stories.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { ComponentStory, ComponentMeta } from '@storybook/react'; import { NaviButton } from '../../components/buttons/NaviButton'; -import { IconsMapped } from '../../components/icons/IconMap'; import NaviButtonReadme from '../../docs/NaviButton.md'; export default { @@ -19,13 +18,23 @@ export default { }, icon: { control: 'select', - options: Object.keys(IconsMapped), + options: ['settings', 'logout'], if: { arg: 'variant', eq: 'default' }, }, avatar: { control: 'object', }, }, + args: { + label: 'Label', + variant: 'default', + icon: 'settings', + avatar: { + variant: 'small', + src: 'https://media.giphy.com/media/cfuL5gqFDreXxkWQ4o/giphy.gif', + alt: 'Alternative text', + }, + }, } as ComponentMeta; const Template: ComponentStory = (args) => { diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/forms/Switch.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/forms/Switch.stories.tsx index 6291fba2..a5c568a1 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/forms/Switch.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/forms/Switch.stories.tsx @@ -7,7 +7,11 @@ import { action } from '@storybook/addon-actions'; export default { title: 'Form/Switch', component: Switch, - parameters: {}, + argTypes: { + value: { + control: 'text', + }, + }, } as ComponentMeta; const Template: ComponentStory = (args) => ; diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/forms/TextBox.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/forms/TextBox.stories.tsx index 1c5911e4..b508c91b 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/forms/TextBox.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/forms/TextBox.stories.tsx @@ -8,6 +8,20 @@ import debounce from 'lodash.debounce'; export default { title: 'Form', component: TextBox, + argTypes: { + inputValue: { + control: false, + table: { + disable: true, + }, + }, + setInputValue: { + control: false, + table: { + disable: true, + }, + }, + }, } as ComponentMeta; const Template: ComponentStory = (args) => { diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/mumble/Mumble.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/mumble/Mumble.stories.tsx index b40f2ff7..215d72b7 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/mumble/Mumble.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/mumble/Mumble.stories.tsx @@ -37,6 +37,8 @@ export default { }, args: { variant: 'timeline', + text: 'Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit​​, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris. Hi mindless mortuis soulless creaturas, imo evil stalking.', + mbSpacing: '0', user: { avatar: { alt: 'avatar', @@ -71,7 +73,6 @@ export default { }, variant: 'xlarge', }, - text: 'Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro. De carne lumbering animata corpora quaeritis. Summus brains sit​​, morbo vel maleficia? De apocalypsi gorger omero undead survivor dictum mauris. Hi mindless mortuis soulless creaturas, imo evil stalking.', img: { alt: 'This is a profile picture!', fCallBack: action('icon clicked'), @@ -89,7 +90,6 @@ export default { fCallBack: action('share clicked'), label: 'Share', }, - mbSpacing: '0', }, } as ComponentMeta; diff --git a/packages/design-system-component-library-yeahyeahyeah/stories/mumble/MumbleHeader.stories.tsx b/packages/design-system-component-library-yeahyeahyeah/stories/mumble/MumbleHeader.stories.tsx index 7f27fb4d..717a86da 100644 --- a/packages/design-system-component-library-yeahyeahyeah/stories/mumble/MumbleHeader.stories.tsx +++ b/packages/design-system-component-library-yeahyeahyeah/stories/mumble/MumbleHeader.stories.tsx @@ -29,6 +29,7 @@ export default { args: { variant: 'edit', mbSpacing: '32', + text: 'Schreib etwas über dich.', banner: { src: 'https://loremflickr.com/640/360', alt: 'Picture', @@ -66,8 +67,6 @@ export default { imageCallBack: action('avatar image clicked'), }, }, - - text: 'Schreib etwas über dich.', }, } as ComponentMeta; @@ -82,6 +81,7 @@ MumbleStory.parameters = { component: MumbleHeaderReadme, }, }, + // controls: { sort: 'requiredFirst' }, }; MumbleStory.storyName = 'Mumble-Header';