-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Controls: Remove auto inference and add to CLI template #14182
Conversation
@@ -19,6 +19,12 @@ function configurePreview(framework: SupportedFrameworks) { | |||
const parameters = ` | |||
export const parameters = { | |||
actions: { argTypesRegex: "^on[A-Z].*" }, | |||
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.
we could maybe add a link to the docs as a comment?
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.
great idea, let's follow up when the new docs are live
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.
Thanks so much @yannbf 🙏
A PR at storybookjs#14182 removed the default custom regex matchers for colors and dates Controls, and instead added them to the generated output from the CLI. However the docs don't reflect this change, and felt quite confusing for me working in a project that didn't use a recent version of the CLI, and therefore didn't have the "default" matchers from the CLI. I've tried to change the wording to reflect that they are only "defaults" if the reader actually sees them in the `.storybook/preview.js` file. I'm open to inputs on wording, or basically anything.
Issue: #14014
What I did
Seems like the controls matchers as a preset were causing confusion, so this PR removes them and explicitly adds them in the CLI templates for discoverability.
How to test
1 - checkout the branch
2 - run yarn bootstrap && yarn start
3 - Check the examples at
examples/official-storybook/stories/addon-controls.stories.tsx
, they should still work