Skip to content

Commit

Permalink
feat(ui/storybook-host): create preview file with layout, actions, co…
Browse files Browse the repository at this point in the history
…ntrols, and sorting configs
  • Loading branch information
MFarabi619 committed Sep 14, 2024
1 parent e4f003b commit 12dfc41
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
3 changes: 3 additions & 0 deletions apps/website/app/components/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function Button() {
return <button type="button">Button</button>
}
1 change: 0 additions & 1 deletion libs/storybook-host/.storybook/preview.ts

This file was deleted.

28 changes: 28 additions & 0 deletions libs/storybook-host/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import type { Preview } from '@storybook/react'

const preview: Preview = {
parameters: {
layout: 'fullscreen',
// https://storybook.js.org/docs/essentials/actions
actions: {
argTypesRegex: '^on[A-Z].*',
},
// https://storybook.js.org/docs/essentials/controls
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
options: {
// https://storybook.js.org/docs/writing-stories/naming-components-and-hierarchy#sorting-stories
storySort: {
method: 'alphabetical',
},
},
},
}

export default preview

/* export const tags = ["autodocs"] */
2 changes: 1 addition & 1 deletion libs/storybook-host/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"allowJs": false,
"strict": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": false
"esModuleInterop": true
},
"references": [
{
Expand Down

0 comments on commit 12dfc41

Please sign in to comment.