Skip to content

chore: update storybook configuration #418

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

Merged
merged 7 commits into from
Feb 16, 2022
Merged

chore: update storybook configuration #418

merged 7 commits into from
Feb 16, 2022

Conversation

jzempel
Copy link
Member

@jzempel jzempel commented Feb 10, 2022

Description

Sets react-containers up for enhanced storybook usage that is consistent with react-components and the refactor that happened under zendeskgarden/react-components#1265. Note, unlike that former (gigantic ... lessons learned 😬) PR, this isolates configuration updates in prep for future demo storybook refactors. My plan is to take those refactors one package at a time.

Some of the goodies to highlight here include:

  • the ability to package import top-level components into Storybook. i.e. import { useAccordion } from '@zendeskgarden/container-accordion'; (see .storybook/babel.config.js and .tsconfig.json for details)
  • the addition of Garden's tailwindcss for rudimentary demo styling 🎉. The storybook demos under react-containers are intentionally not meant to mirror the high-fidelity design styling of react-components. However, there's no need to make demo-life harder on ourselves than necessary.
  • consistency with react-components: add-on panel position, alphabetically sorted controls, etc
  • a global style to give default focus outline a bit more visual "punch" (it is sometimes a bit difficult to see the default gray in these un-styled demos)

Checklist

  • 🌐 Storybook demo is up-to-date (yarn start)
  • analyzed via axe and evaluated using VoiceOver
  • 💂‍♂️ includes new unit tests
  • 📝 tested in Chrome, Firefox, Safari, Edge, and IE11

@jzempel jzempel requested a review from a team as a code owner February 10, 2022 15:47
@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.967% when pulling d96adcb on jzempel/demo-refactor into 25f39c4 on main.

@@ -101,6 +104,7 @@
"rollup-plugin-size-snapshot": "0.12.0",
"rollup-plugin-typescript2": "0.31.1",
"styled-components": "5.3.3",
"tailwindcss": "3.0.19",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for adding tailwindcss and @zendeskgarden/tailwindcss?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like tailwindcss is the library and @zendeskgarden/tailwindcss is the plugin.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtomcal if you haven't yet, please see the PR description.

node_modules
utils/storybook/coverage
*.log

# Package specific
packages/**/dist
package-lock.json

# Demo specific
demo/**/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has there been any changes to add demo folder yet?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. TBD per PR description.

@@ -16,7 +16,7 @@
"lint:md": "markdownlint README.md packages/*/src/**/*.md packages/*/src/*.md packages/*/README.md",
"new": "utils/scripts/new.js",
"prepare": "yarn build",
"start": "start-storybook -p 6006",
"start": "start-storybook --no-version-updates -p 6006",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find --no-version-updates in their CLI docs. https://storybook.js.org/docs/react/api/cli-options Is this an undocumented flag?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's documented with yarn start-storybook --help. Also see storybookjs/storybook#8488

@jzempel jzempel merged commit 559da4b into main Feb 16, 2022
@jzempel jzempel deleted the jzempel/demo-refactor branch February 16, 2022 21:36
@jzempel jzempel mentioned this pull request Feb 22, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants