Skip to content

Commit

Permalink
docs: fix form stories (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
pure-js authored Oct 18, 2023
1 parent 9a1f4f1 commit 8abbdea
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/button/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Button } from './Button';
export { Button as default } from './Button';
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { Meta, StoryObj } from '@storybook/react';

import { Form } from './Form';
import Input from '@/components/input';

import { Primary, Medium } from '@/components/input/Input.stories';
// import * as ButtonStories from '@/components/button/Button.stories';

const meta = {
title: 'Form',
Expand All @@ -14,10 +18,20 @@ const meta = {
} satisfies Meta<typeof Form>;

export default meta;
type Story = StoryObj<typeof meta>;
type Story = StoryObj<typeof Form>;

export const LoggedIn: Story = {
args: {},
const FormTemplate: Story = {
render: ({ ...args }) => {
return (
<Form {...args}>
<Input {...Primary.args} />
<Input {...Medium.args} />
</Form>
);
},
};

export const LoggedOut: Story = {};
export const Login: Story = {
...FormTemplate,
args: {},
};
2 changes: 1 addition & 1 deletion src/components/form/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Form } from './Form';
export { Form as default } from './Form';
2 changes: 1 addition & 1 deletion src/components/input/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Input } from './Input';
export { Input as default } from './Input';
6 changes: 3 additions & 3 deletions src/pages/sign-in/SignIn.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Route } from '@tanstack/react-router';

import { Form } from '@/components/form';
import { Input } from '@/components/input';
import { Button } from '@/components/button';
import Form from '@/components/form';
import Input from '@/components/input';
import Button from '@/components/button';
import { rootRoute } from '@/pages/__root';

export const SignInPage = () => {
Expand Down

0 comments on commit 8abbdea

Please sign in to comment.