Skip to content
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

Merged
merged 6 commits into from
Dec 2, 2021

Conversation

anttimaki
Copy link
Contributor

This PR does much of the same stuff as PR #84. Includes:

  • Configuration for Storybook
  • Short description in README about using Storybook
  • Simple exemplary stories for Select, MultiSelect and Markdown components

Included in PR #84, but not included here:

Closes PR #84.

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.
Copy link
Member

@MythicManiac MythicManiac left a 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

}
]
]
}
Copy link
Member

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)?

Copy link
Contributor Author

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?

Copy link
Member

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

@anttimaki anttimaki merged commit 0dd8bbe into master Dec 2, 2021
@anttimaki anttimaki deleted the storybook-rework branch December 2, 2021 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants