Fixed Storybook arg types in Admin X DS

refs. https://github.com/TryGhost/Team/issues/3150

We are using ReactNode type parameters which can't be set directly in Storybook.
This commit is contained in:
Peter Zimon 2023-05-17 18:14:09 +02:00
parent 3c7dd63ec4
commit 2e42454f13
5 changed files with 32 additions and 17 deletions

View File

@ -1,7 +0,0 @@
import { Meta } from '@storybook/blocks';
<Meta title="About / Install" />
# Install
Work in progress but should be something like `yarn add @tryghost/admin-x-ds`

View File

@ -1,7 +1,11 @@
import { Meta } from '@storybook/blocks';
<Meta title="About / Introduction" />
<Meta title="About" />
# Welcome to Admin X Design System
Work in progress
Work in progress!
## Install
Should be something like `yarn add @tryghost/admin-x-ds`

View File

@ -7,18 +7,23 @@ const meta = {
title: 'Global / Input / Dropdown',
component: Dropdown,
tags: ['autodocs'],
decorators: [(_story: any) => (<div style={{maxWidth: '400px'}}>{_story()}</div>)]
decorators: [(_story: any) => (<div style={{maxWidth: '400px'}}>{_story()}</div>)],
argTypes: {
help: {
control: 'text'
}
}
} satisfies Meta<typeof Dropdown>;
export default meta;
type Story = StoryObj<typeof Dropdown>;
const dropdownOptions: DropdownOption[] = [
{value: 'Option 1', label: 'option-1'},
{value: 'Option 2', label: 'option-2'},
{value: 'Option 3', label: 'option-3'},
{value: 'Option 4', label: 'option-4'},
{value: 'Option 5', label: 'option-5'}
{value: 'option-1', label: 'Option 1'},
{value: 'option-2', label: 'Option 2'},
{value: 'option-3', label: 'Option 3'},
{value: 'option-4', label: 'Option 4'},
{value: 'option-5', label: 'Option 5'}
];
export const Default: Story = {

View File

@ -6,7 +6,12 @@ const meta = {
title: 'Global / Input / Textfield',
component: TextField,
tags: ['autodocs'],
decorators: [(_story: any) => (<div style={{maxWidth: '400px'}}>{_story()}</div>)]
decorators: [(_story: any) => (<div style={{maxWidth: '400px'}}>{_story()}</div>)],
argTypes: {
help: {
control: 'text'
}
}
} satisfies Meta<typeof TextField>;
export default meta;

View File

@ -5,7 +5,15 @@ import SettingValue from './SettingValue';
const meta = {
title: 'Settings / Setting Value',
component: SettingValue,
tags: ['autodocs']
tags: ['autodocs'],
argTypes: {
value: {
control: 'text'
},
help: {
control: 'text'
}
}
} satisfies Meta<typeof SettingValue>;
export default meta;