1
1
import TextField from "@mui/material/TextField" ;
2
2
import { action } from "@storybook/addon-actions" ;
3
- import { ComponentMeta , Story } from "@storybook/react" ;
4
3
import { FormFooter } from "../FormFooter/FormFooter" ;
5
4
import { Stack } from "../Stack/Stack" ;
6
5
import { FullPageForm , FullPageFormProps } from "./FullPageForm" ;
6
+ import type { Meta , StoryObj } from "@storybook/react" ;
7
7
8
- export default {
9
- title : "components/FullPageForm" ,
10
- component : FullPageForm ,
11
- } as ComponentMeta < typeof FullPageForm > ;
12
-
13
- const Template : Story < FullPageFormProps > = ( args ) => (
14
- < FullPageForm { ...args } >
8
+ const Template = ( props : FullPageFormProps ) => (
9
+ < FullPageForm { ...props } >
15
10
< form
16
11
onSubmit = { ( e ) => {
17
12
e . preventDefault ( ) ;
@@ -26,8 +21,17 @@ const Template: Story<FullPageFormProps> = (args) => (
26
21
</ FullPageForm >
27
22
) ;
28
23
29
- export const Example = Template . bind ( { } ) ;
30
- Example . args = {
31
- title : "My Form" ,
32
- detail : "Lorem ipsum dolor" ,
24
+ const meta : Meta < typeof FullPageForm > = {
25
+ title : "components/FullPageForm" ,
26
+ component : Template ,
27
+ } ;
28
+
29
+ export default meta ;
30
+ type Story = StoryObj < typeof FullPageForm > ;
31
+
32
+ export const Example : Story = {
33
+ args : {
34
+ title : "My Form" ,
35
+ detail : "Lorem ipsum dolor" ,
36
+ } ,
33
37
} ;
0 commit comments