-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add storybook, basic story and documentation example #1
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
deca844
chore: add storybook, basic story and documentation example
storyworks 3e6b8a8
fix: remove redundant code
storyworks 5a89122
style: fix linting
storyworks 70974b0
fix: lint
storyworks 7afd789
fix: prettier
storyworks dac6e48
chore: make main and preview into ts files
storyworks ca6c497
fix: remove space
storyworks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Imports the Storybook's configuration API | ||
import type { StorybookConfig } from '@storybook/core-common' | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'], | ||
staticDirs: ['../public'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/preset-create-react-app', | ||
'@storybook/addon-interactions' | ||
], | ||
typescript: { | ||
check: false, | ||
checkOptions: {}, | ||
reactDocgen: 'react-docgen-typescript', | ||
reactDocgenTypescriptOptions: { | ||
shouldExtractLiteralValuesFromEnum: true, | ||
propFilter: (prop) => | ||
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true | ||
} | ||
}, | ||
framework: '@storybook/react', | ||
core: { | ||
builder: 'webpack5' | ||
}, | ||
features: { | ||
postcss: false | ||
} | ||
// refs: { | ||
// 'design-system': { | ||
// title: 'Design System', | ||
// url: 'https://5ccbc373887ca40020446347-yldsqjoxzb.chromatic.com' | ||
// } | ||
// } | ||
} | ||
|
||
module.exports = config |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Story } from '@storybook/react' | ||
import { IonApp } from '@ionic/react' | ||
import { setupIonicReact } from '@ionic/react' | ||
|
||
/* Core CSS required for Ionic components to work properly */ | ||
import '@ionic/react/css/core.css' | ||
|
||
/* Basic CSS for apps built with Ionic */ | ||
import '@ionic/react/css/normalize.css' | ||
import '@ionic/react/css/structure.css' | ||
import '@ionic/react/css/typography.css' | ||
|
||
/* Optional CSS utils that can be commented out */ | ||
import '@ionic/react/css/padding.css' | ||
import '@ionic/react/css/float-elements.css' | ||
import '@ionic/react/css/text-alignment.css' | ||
import '@ionic/react/css/text-transformation.css' | ||
import '@ionic/react/css/flex-utils.css' | ||
import '@ionic/react/css/display.css' | ||
|
||
setupIonicReact() | ||
|
||
export const decorators = [ | ||
(Story: Story) => ( | ||
<IonApp> | ||
<Story /> | ||
</IonApp> | ||
) | ||
] | ||
|
||
const customViewports = { | ||
mobileMin: { | ||
name: 'Small Mobile', | ||
styles: { | ||
width: '360px', | ||
height: '640px' | ||
}, | ||
type: 'mobile' | ||
}, | ||
mobileMax: { | ||
name: 'Large Mobile', | ||
styles: { | ||
width: '540px', | ||
height: '960px' | ||
}, | ||
type: 'mobile' | ||
}, | ||
tablet: { | ||
name: 'Tablet', | ||
styles: { | ||
width: '768px', | ||
height: '1024px' | ||
}, | ||
type: 'tablet' | ||
} | ||
} | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
backgrounds: { | ||
disable: true, | ||
grid: { | ||
disable: true | ||
} | ||
}, | ||
chromatic: { viewports: [360] }, | ||
controls: { disabled: true }, | ||
layout: 'fullscreen', | ||
viewport: { | ||
viewports: customViewports | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Derived from https://storybook.js.org/docs/react/configure/overview#using-storybook-api and storybookjs/storybook#17589