-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e827bc
commit 6b784e7
Showing
6 changed files
with
139 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,43 @@ | ||
export default [ | ||
[ | ||
{ | ||
code: `// Button.stories.jsx`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `import { Button } from './Button';`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `export default { | ||
export default { | ||
filename: "Button.stories.jsx", | ||
code: [ | ||
[ | ||
{ | ||
code: `import { Button } from './Button';`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `export default { | ||
title: 'Example/Button', | ||
component: Button, | ||
// ... | ||
};`, | ||
}, | ||
], | ||
[ | ||
{ code: `export const Primary = {` }, | ||
{ | ||
code: `args: { | ||
}, | ||
], | ||
[ | ||
{ code: `export const Primary = {` }, | ||
{ | ||
code: `args: { | ||
primary: true, | ||
label: 'Click', | ||
background: 'red' | ||
}`, | ||
toggle: true, | ||
}, | ||
{ code: `};` }, | ||
], | ||
[ | ||
{ | ||
code: `// Copy the code below | ||
toggle: true, | ||
}, | ||
{ code: `};` }, | ||
], | ||
[ | ||
{ | ||
code: `// Copy the code below | ||
export const Warning = { | ||
args: { | ||
primary: true, | ||
label: 'Delete now', | ||
backgroundColor: 'red', | ||
} | ||
};`, | ||
}, | ||
}, | ||
], | ||
], | ||
]; | ||
}; |
107 changes: 55 additions & 52 deletions
107
src/features/WriteStoriesModal/code/nextjs-typescript.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,56 @@ | ||
export default [ | ||
[ | ||
{ | ||
code: `// Button.stories.tsx`, | ||
}, | ||
export default { | ||
filename: "Button.stories.tsx", | ||
code: [ | ||
[ | ||
{ | ||
code: `// Button.stories.tsx`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `import type { Meta, StoryObj } from '@storybook/nextjs'; | ||
import { Button } from './Button';`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `const meta: Meta<typeof Button> = { | ||
title: 'Example/Button', | ||
component: Button, | ||
// ... | ||
}; | ||
export default meta;`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `type Story = StoryObj<Button>; | ||
export const Primary: Story = {`, | ||
}, | ||
{ | ||
code: `args: { | ||
primary: true, | ||
label: 'Click', | ||
background: 'red' | ||
}`, | ||
toggle: true, | ||
}, | ||
{ code: `};` }, | ||
], | ||
[ | ||
{ | ||
code: `// Copy the code below | ||
export const Warning: Story = { | ||
args: { | ||
primary: true, | ||
label: 'Delete now', | ||
backgroundColor: 'red', | ||
} | ||
};`, | ||
}, | ||
], | ||
], | ||
[ | ||
{ | ||
code: `import type { Meta, StoryObj } from '@storybook/nextjs'; | ||
import { Button } from './Button';`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `const meta: Meta<typeof Button> = { | ||
title: 'Example/Button', | ||
component: Button, | ||
// ... | ||
}; | ||
export default meta;`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `type Story = StoryObj<Button>; | ||
export const Primary: Story = {`, | ||
}, | ||
{ | ||
code: `args: { | ||
primary: true, | ||
label: 'Click', | ||
background: 'red' | ||
}`, | ||
toggle: true, | ||
}, | ||
{ code: `};` }, | ||
], | ||
[ | ||
{ | ||
code: `// Copy the code below | ||
export const Warning: Story = { | ||
args: { | ||
primary: true, | ||
label: 'Delete now', | ||
backgroundColor: 'red', | ||
} | ||
};`, | ||
}, | ||
], | ||
]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,51 @@ | ||
export default [ | ||
[ | ||
{ | ||
code: `import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Button } from './Button';`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `const meta: Meta<typeof Button> = { | ||
title: 'Example/Button', | ||
component: Button, | ||
// ... | ||
}; | ||
export default meta;`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `type Story = StoryObj<Button>; | ||
export default { | ||
filename: "Button.stories.tsx", | ||
code: [ | ||
[ | ||
{ | ||
code: `import type { Meta, StoryObj } from '@storybook/react'; | ||
export const Primary: Story = {`, | ||
}, | ||
{ | ||
code: `args: { | ||
primary: true, | ||
label: 'Click', | ||
background: 'red' | ||
}`, | ||
toggle: true, | ||
}, | ||
{ code: `};` }, | ||
], | ||
[ | ||
{ | ||
code: `// Copy the code below | ||
export const Warning: Story = { | ||
args: { | ||
primary: true, | ||
label: 'Delete now', | ||
backgroundColor: 'red', | ||
} | ||
};`, | ||
}, | ||
import { Button } from './Button';`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `const meta: Meta<typeof Button> = { | ||
title: 'Example/Button', | ||
component: Button, | ||
// ... | ||
}; | ||
export default meta;`, | ||
}, | ||
], | ||
[ | ||
{ | ||
code: `type Story = StoryObj<Button>; | ||
export const Primary: Story = {`, | ||
}, | ||
{ | ||
code: `args: { | ||
primary: true, | ||
label: 'Click', | ||
background: 'red' | ||
}`, | ||
toggle: true, | ||
}, | ||
{ code: `};` }, | ||
], | ||
[ | ||
{ | ||
code: `// Copy the code below | ||
export const Warning: Story = { | ||
args: { | ||
primary: true, | ||
label: 'Delete now', | ||
backgroundColor: 'red', | ||
} | ||
};`, | ||
}, | ||
], | ||
], | ||
]; | ||
}; |