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

Introduce Storybook #3293

Open
2 tasks done
asvae opened this issue Apr 2, 2023 · 0 comments
Open
2 tasks done

Introduce Storybook #3293

asvae opened this issue Apr 2, 2023 · 0 comments
Assignees
Labels
d3: medium No cheats. Monsters a bit faster. implementation Requires implementation v4: must have This is something really user want to have

Comments

@asvae
Copy link
Member

asvae commented Apr 2, 2023

  • Add histoire to vuestic-ui
  • Convert stories from vue-book for a couple of components (va-button, va-badge, va-breadcrumbs)
Stories documentation

We use histoire to develop and test components.

In component folder you'll generally see a structure like this:

components/va-badge/stories/
- VaBadge.story.vue
- VaBadge-avatar.vue // optional
- ...

Let's see what each of these do.

VaBadge.story.vue is a main story file of component, there should be only one such file. Here's how it looks inside:

<Story title="va-badge">
  <Variant title="default">
    <va-badge text="Paid" />
    <va-badge
      text="Success theme color"
      color="success"
    />
  </Variant>
  <Variant title="text color">
    <va-badge text="Default" />
    <va-badge
      text="Dark theme color"
      text-color="textPrimary"
    />
  </Variant>
  <Variant title="avatar">
    <va-badge-avatar />
  </Variant>
<Story>
  • If variant is about basic use of component - it should be titled as default.
  • If variant is too large (has state or needs special styling or imports other component i.e. va-badge-avatar) - it's recommended to move it to separate component, then import it to main story.
  • Story and Variant are the only components with caps because of Histoire requirements. All other components in template should be kebab-case.
  • You can add other files you need to stories folder as well.
  • See histoire docs on Story and Variant for details on customization.

State we'll end up with:

  • few stories would work with histoire
  • most stories would work with vue-book (which is the only one deployed on staging)

That's not great, but converting everything at once is too big of a change.

This was referenced Apr 2, 2023
@asvae asvae added the implementation Requires implementation label Apr 3, 2023
@m0ksem m0ksem removed their assignment May 24, 2023
@asvae asvae changed the title Introduce Histoire Introduce Storybook May 29, 2023
@asvae asvae added v4: must have This is something really user want to have d3: medium No cheats. Monsters a bit faster. labels May 29, 2023
@asvae asvae self-assigned this Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d3: medium No cheats. Monsters a bit faster. implementation Requires implementation v4: must have This is something really user want to have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants