From 30edc92522877cafad47c16e789eea20cdb8eb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Jaenisch?= Date: Sun, 3 Mar 2024 14:53:15 +0100 Subject: [PATCH] feat: link between stories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Right now this works with Template stories but not with Page stories to collect feedback. Signed-off-by: André Jaenisch --- stories/organisms/LoginForm.stories.ts | 10 +++++++++- stories/templates/Login.stories.ts | 12 ++++++++++-- stories/templates/Profile.stories.ts | 12 ++++++++++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/stories/organisms/LoginForm.stories.ts b/stories/organisms/LoginForm.stories.ts index d67df3e..3b69ad1 100644 --- a/stories/organisms/LoginForm.stories.ts +++ b/stories/organisms/LoginForm.stories.ts @@ -1,3 +1,5 @@ +import { withActions } from '@storybook/addon-actions/decorator'; +import { withLinks } from '@storybook/addon-links'; import type { Meta, StoryObj } from '@storybook/svelte'; import LoginForm from '$lib/components/organisms/LoginForm.svelte'; @@ -6,11 +8,17 @@ const meta = { title: 'Organisms/LoginForm', component: LoginForm, tags: ['autodocs'], + args: { + sb: 'Templates/Profile' + }, argTypes: { form: { controls: 'object' }, i18n: { controls: 'object' }, + onSubmit: { action: 'submit' }, + sb: { control: 'radio', options: ['Templates/Profile'] }, servers: { controls: 'object' } - } + }, + decorators: [withActions, withLinks] } satisfies Meta; export default meta; diff --git a/stories/templates/Login.stories.ts b/stories/templates/Login.stories.ts index d5c2ee4..4c24b9f 100644 --- a/stories/templates/Login.stories.ts +++ b/stories/templates/Login.stories.ts @@ -1,3 +1,5 @@ +import { withActions } from '@storybook/addon-actions/decorator'; +import { withLinks } from '@storybook/addon-links'; import type { Meta, StoryObj } from '@storybook/svelte'; import Login from '$lib/components/templates/Login.svelte'; @@ -6,9 +8,15 @@ const meta = { title: 'Templates/Login', component: Login, tags: ['autodocs'], + args: { + sb: 'Templates/Profile' + }, argTypes: { - form: { controls: 'object' } - } + onSubmit: { action: 'submit' }, + form: { controls: 'object' }, + sb: { control: 'radio', options: ['Templates/Profile'] } + }, + decorators: [withActions, withLinks] } satisfies Meta; export default meta; diff --git a/stories/templates/Profile.stories.ts b/stories/templates/Profile.stories.ts index 682828c..0c12897 100644 --- a/stories/templates/Profile.stories.ts +++ b/stories/templates/Profile.stories.ts @@ -1,3 +1,5 @@ +import { withActions } from '@storybook/addon-actions/decorator'; +import { withLinks } from '@storybook/addon-links'; import type { Meta, StoryObj } from '@storybook/svelte'; import Profile from '$lib/components/templates/Profile.svelte'; @@ -6,9 +8,15 @@ const meta = { title: 'Templates/Profile', component: Profile, tags: ['autodocs'], + args: { + sb: 'Templates/ImportProject' + }, argTypes: { - data: { controls: 'object' } - } + onClick: { action: 'click' }, + data: { controls: 'object' }, + sb: { control: 'radio', options: ['Templates/ImportProject'] } + }, + decorators: [withActions, withLinks] } satisfies Meta; export default meta;