-
Notifications
You must be signed in to change notification settings - Fork 92
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(docs): introduce storybook and migrate react-tabs examples #873
Conversation
@@ -1 +0,0 @@ | |||
packages/notifications/index.d.ts |
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.
This file should have been removed with the v8 release
ref | ||
) => { | ||
const theme = useContext(ThemeContext); |
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.
I updated the theme reference logic here to align with the more recent components. This doesn't affect the public API.
|
||
export default { | ||
title: 'Components/Tabs', | ||
subcomponents: { Tabs, TabList, Tab, TabPanel }, |
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.
By only listing subcomponents
we don't have to override the arguments that we don't want to display in the story controls.
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.
Just a quick run-through while this is in draft mode. This is going to be a very nice QoL improvement.
.storybook/preview.js
Outdated
locale: { | ||
name: 'direction', | ||
description: 'Locale direction', | ||
defaultValue: 'ltr', | ||
toolbar: { | ||
icon: 'globe', | ||
items: [ | ||
{ value: 'ltr', title: 'LTR' }, | ||
{ value: 'rtl', title: 'RTL' } | ||
] | ||
} | ||
}, | ||
bedrock: { | ||
name: 'bedrock', | ||
description: 'CSS Bedrock', | ||
defaultValue: 'disabled', | ||
toolbar: { | ||
icon: 'paintbrush', | ||
items: [ | ||
{ value: 'disabled', title: 'Disabled' }, | ||
{ value: 'enabled', title: 'Enabled' } | ||
] | ||
} | ||
} |
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.
Can these be made to work like the "Grid" toggle rather than choosing from a menu?
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.
Looking through their docs I haven't been able to find anything about different global toolbar types. Since it's an essential plugin it seems they have a deeper integration than we do in preview.js
. I'll keep looking through their docs though.
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.
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.
Without a fully-custom addon I'm not sure we will be able to replicate this. Feels like it could be a good follow-on before we would make the global cut.
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.
Ok, let's capture the task and see if we can make something of it. Just having the functionality is fine for now.
@jzempel IE11 support could be tricky here. I'm now extending the default babel configuration provided by Storybook, but it seems they have an IE11 regression in the most recent release storybookjs/storybook#12179 I feel comfortable going forward with this knowing that all of our internal consumers have recently ended IE11 support. We should still be conscious of it in the main site, but we should be ok in the short-term here. |
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.
Looking good 👍
Oh no. What's the plan for Garden to get new components out the door with guaranteed IE11 support (still needed here, unfortunately)? |
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.
Nice, improved, future-proof config 🎉 Also, README is looking niiice.
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.
[nit] Should the "change preview background" grid icon remain visible in the header? Doesn't look like it does anything.
This.is.awesome.
This should be removed right now. I've disabled the |
The latest deployment sez otherwise 🤷 |
You're correct. It should be gone though. Will add it to the CSS Bedrock task to look into this. |
Description
This PR begins our migration from multiple Styleguidist builds to a single Storybook instance. This will significantly reduce our build times and improve the development and consumer experience for our "knobs" style examples.
I've used the
react-tabs
package as the first migration example as it's already documented on the new website.Detail
Storybook Config
storybook v6
includes a lot of new things and I've tried to stick as close to their opinionated defaults as possible. Some unique things to point out:@babel/preset-typescript
preset and a TS checker that runs in a separate process.eslint-loader
andsvgr
to the default webpack configa11y-addon
which includes an axe panel showing applicable rules as well as a color filter dropdown.Story format
For each package we can include the
README
similar to stylguidist. I've also created a basic example format which:HTMLAttribute
and other extensions)TODO
Fix README reference link formattingCorrect IE11 issues (something to do with our babel config customization)Checklist
designer as a reviewer)
yarn start
)?bedrock
)💂♂️ includes new unit tests