-
-
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
CLI: Component-driven React / Vue / Angular / Preact / Svelte templates #11505
Conversation
@tmeasday @tooppaaa @domyen I've updated the button to use CSS and it's working. If it looks good, I'll update the other ones. I'm not really up on CSS best practices. @tmeasday the action stuff is already set up by @tooppaaa. i made it a little bit more specific and added an |
E2E added that covers
I applied a bit of changes and extended your work @shilman on CSS. |
@tooppaaa These changes look great. 💯 |
type="button" | ||
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')} | ||
style={backgroundColor && { backgroundColor }} | ||
{...props} |
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.
Won't typescript complain about this? ButtonProps does not contain all possible props for a button element, I might be wrong but I think you'd need to do something like:
export interface ButtonProps extends React.DetailedHTMLProps<
React.ButtonHTMLAttributes<HTMLButtonElement>,
HTMLButtonElement
> {
primary?: boolean;
....
}
}; | ||
|
||
export const LoggedOut = Template.bind({}); | ||
LoggedOut.args = {}; |
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.
Is the empty args here just to show people they can use it or is it necessary? There's already an example in LoggedIn
, so no need to add it, right? It might lead to people thinking that they always need to add an empty args to every story
@@ -20,7 +18,7 @@ function configureMain(addons: string[], custom?: any) { | |||
function configurePreview(framework: SupportedFrameworks) { | |||
const parameters = ` | |||
export const parameters = { | |||
actions: { argTypesRegex: "^on.*" }, | |||
actions: { argTypesRegex: "^on[A-Z].*" }, |
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.
do you think it would be nice to add a small comment telling people that they can change this to other stuff like "^(on|handle)[A-Z].*"
in case they use a different pattern, or even already just add that regex because it might useful anyway?
<ul> | ||
<li> | ||
Use a higher-level connected component. Storybook helps you compose such data from the | ||
"args" of child component stories |
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.
maybe a hyperlink in the args would be useful for reference?
I can confirm that http://componentdriven.org/ works now, not https though
…--
Yann Braga
Software Developer
m: +31618338183
a: Amsterdam, Netherlands.
w: github.com/yannbf e: yannbf@gmail.com
<https://linkedin.com/in/yannbraga>
|
@tooppaaa @yannbf When I run the sample app ( |
We should probably get the https sorted too huh |
Fixed now, try https://componentdriven.org |
This adds a hidden dependency on prop-types which is not installed during the CLI install process. |
Issue: #10723
What I did
0.Introduction.stories.mdx
toIntroduction.stories.mdx
main.js
to order MDX firstButton
to CSSWhat's next
How to test
Modify
scripts/run-e2e.ts
:Then run: