-
Notifications
You must be signed in to change notification settings - Fork 321
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
docs: migrate stories to use LiveEdit, add TS inner types to those stories #2080
docs: migrate stories to use LiveEdit, add TS inner types to those stories #2080
Conversation
… story this should apply decorators which are declared in the same object of the story, not only global decorators, so we can make our stories cleaner
…egex for variety of cases
…s who don't need LiveEdit)
Exceptions:
|
@@ -55,6 +62,11 @@ export const SingleCheckbox = { | |||
} | |||
/> | |||
), | |||
|
|||
name: "Single checkbox" |
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.
why did you remove the name?
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.
Storybook automatically parses the name from the exported story and uses its naming convention.
So 99% of our stories "name" attribute is the same as Storybook would parse.
The cases where it's different it is usually something unnoticeable that wasn't inserted by purpose, such as a lowercased story name
PR would fail until #2090 is merged because of decorator types issue from |
@@ -299,9 +302,7 @@ export const AsyncOptions = { | |||
<Dropdown asyncOptions={fetchUserOptions} placeholder="Async options" cacheOptions defaultOptions /> | |||
</div> | |||
); | |||
}, | |||
|
|||
name: "Async Dropdown" |
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 think you also need to add it this one back :)
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've removed it intentionally and changed the name of the exported story to AsyncDropdown instead of AsyncOptions, so the name of the story now should be the same as the old one
@@ -92,11 +105,16 @@ export const DifferentIcon = { | |||
</Menu> | |||
</MenuButton> | |||
), | |||
|
|||
name: "Different Icon" |
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.
Also need to be reverted :)
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.
Storybook uses lodash's startCase
method:
https://lodash.com/docs/#startCase
so export const DifferentIcon
would result in a story with the name "Different Icon", so no need for the name here as it would result the same
@@ -112,11 +130,16 @@ export const WithText = { | |||
</MenuButton> | |||
</div> | |||
), | |||
|
|||
name: "With Text" |
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.
Same
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.
same as the above about startCase
@@ -170,6 +204,11 @@ export const CustomTriggerElement = { | |||
</MenuButton> | |||
); | |||
}, | |||
|
|||
name: "Custom Trigger Element" |
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.
Same
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 one also is already using a startCase convention
@shaharzil the only changed story here is the The rest had no change in the build: https://monday.chromatic.com/build?appId=62037c72e0e4d6004a9a450f&number=5331, meaning all the names remained the same (which means what we've discussed - that the parsing of the names remains the same, as if we didn't changed anything in this logic) |
https://monday.monday.com/boards/3532714909/pulses/6494680289