From d32337bcd50cf9ace0e3048e675f6c81beb86f98 Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Sun, 3 Sep 2023 16:15:35 +0100 Subject: [PATCH] Update Storybook Story format to latest (#329) * Update Storybook Story format to latest * Lint fixes --- .../ArrayInput/component.stories.tsx | 37 +++++++++++----- .../BooleanInput/component.stories.tsx | 17 +++++--- src/components/Button/component.stories.tsx | 22 ++++++---- src/components/Canvas/component.stories.tsx | 16 +++++-- src/components/Code/component.stories.tsx | 15 +++++-- .../ColorPicker/component.stories.tsx | 20 +++++++-- .../Container/component.stories.tsx | 20 +++++---- src/components/Divider/component.stories.tsx | 15 +++++-- .../GradientPicker/component.stories.tsx | 33 +++++--------- src/components/GridView/component.stories.tsx | 14 ++++-- src/components/InfoBox/component.stories.tsx | 15 +++++-- src/components/Label/component.stories.tsx | 15 +++++-- .../LabelGroup/component.stories.tsx | 21 ++++++--- src/components/Menu/component.stories.tsx | 43 +++++++++++-------- .../NumericInput/component.stories.tsx | 17 +++++--- src/components/Overlay/component.stories.tsx | 16 +++++-- src/components/Panel/component.stories.tsx | 21 ++++++--- src/components/Progress/component.stories.tsx | 15 +++++-- .../RadioButton/component.stories.tsx | 17 +++++--- .../SelectInput/component.stories.tsx | 17 +++++--- .../SliderInput/component.stories.tsx | 17 +++++--- src/components/Spinner/component.stories.tsx | 16 +++++-- .../TextAreaInput/component.stories.tsx | 17 +++++--- .../TextInput/component.stories.tsx | 17 +++++--- src/components/TreeView/component.stories.tsx | 14 ++++-- .../VectorInput/component.stories.tsx | 25 ++++++++--- 26 files changed, 348 insertions(+), 164 deletions(-) diff --git a/src/components/ArrayInput/component.stories.tsx b/src/components/ArrayInput/component.stories.tsx index 07757964..acf32bd1 100644 --- a/src/components/ArrayInput/component.stories.tsx +++ b/src/components/ArrayInput/component.stories.tsx @@ -1,22 +1,39 @@ import * as React from 'react'; +import type { Meta, StoryObj } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; + +import ArrayInput from './component'; -import Component from './component'; import '../../scss/index.js'; -import { action } from '@storybook/addon-actions'; -export default { +const meta: Meta = { title: 'Components/ArrayInput', - component: Component + component: ArrayInput }; -export const String = args => ; +export default meta; +type Story = StoryObj; + +export const String: Story = { + render: args => +}; -export const Number = args => ; +export const Number: Story = { + render: args => +}; -export const Boolean = args => ; +export const Boolean: Story = { + render: args => +}; -export const Vec2 = args => ; +export const Vec2: Story = { + render: args => +}; -export const Vec3 = args => ; +export const Vec3: Story = { + render: args => +}; -export const Vec4 = args => ; +export const Vec4: Story = { + render: args => +}; diff --git a/src/components/BooleanInput/component.stories.tsx b/src/components/BooleanInput/component.stories.tsx index 5c2ce7e3..54d717f2 100644 --- a/src/components/BooleanInput/component.stories.tsx +++ b/src/components/BooleanInput/component.stories.tsx @@ -1,12 +1,19 @@ import * as React from 'react'; +import type { Meta, StoryObj } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; + +import BooleanInput from './component'; -import Component from './component'; import '../../scss/index.js'; -import { action } from '@storybook/addon-actions'; -export default { +const meta: Meta = { title: 'Components/BooleanInput', - component: Component + component: BooleanInput }; -export const Main = args => ; +export default meta; +type Story = StoryObj; + +export const Main: Story = { + render: args => +}; diff --git a/src/components/Button/component.stories.tsx b/src/components/Button/component.stories.tsx index 267a6c34..fd987ee9 100644 --- a/src/components/Button/component.stories.tsx +++ b/src/components/Button/component.stories.tsx @@ -1,17 +1,23 @@ import * as React from 'react'; -import Component from './component'; -import '../../scss/index.js'; +import type { Meta, StoryObj } from '@storybook/react'; import { action } from '@storybook/addon-actions'; -export default { +import Button from './component'; + +import '../../scss/index.js'; + +const meta: Meta = { title: 'Components/Button', - component: Component + component: Button }; -export const Text = (args) => { - return ; +export default meta; +type Story = StoryObj; + +export const Text: Story = { + render: args =>