-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use Storybook to create reusable UI components in isolation #289
Conversation
Storybook is an open source tool for building UI components and pages in isolation. In this project it hopefully helps us to create reusable UI components. Storybook was initialized using the CLI tool and react-webpack default settings. Some dependencies were manually added to package.json to get rid of warnings.
This should make it easier to spot problems the components might have when rendered on our dark background color.
Wraps each Storybook story with ChakraProvider, making the expected styles work.
Also add short doc string for the components, to see how Storybook displays these on its Docs tab.
Storybook's play function allows initializing the components to specific states by mimicking user actions. Ideally components' hard-to-reach states can be shown without user having to manually interact with the component. The examples included in this commit are rather lame, but they work as an showcase for what can be done with Storybook. Storybook also provides tools for visual, accessibility and snapshot testing, but the current components didn't entice me to check these out at this time. Maybe later when more suitable components are created.
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.
Looks good to me 👍 merge at will
} | ||
] | ||
] | ||
} |
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.
pre-commit not handling missing newlines in this repo? Should we perhaps add pre-commit or something similar (in another PR)?
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.
Well there is this long-forgotten PR: #32 .
There's also seems to be a pre-commit config in the repo, but I've not set it up yet. Should we use pre-commit as we do in our other repos and ignore that old PR?
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.
Yeah that sounds like a good idea
This PR does much of the same stuff as PR #84. Includes:
Select
,MultiSelect
andMarkdown
componentsIncluded in PR #84, but not included here:
Closes PR #84.