-
Notifications
You must be signed in to change notification settings - Fork 152
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
Sarka/storybook migration b7 #4485
Conversation
Storybook staging is available at https://kiwicom-orbit-sarka-storybook-migration-b7.surge.sh |
Size Change: -5 B (0%) Total Size: 460 kB
ℹ️ View Unchanged
|
Deploying orbit with Cloudflare Pages
|
781bacd
to
79e6fda
Compare
...args | ||
}) { | ||
return ( | ||
<Box background="cloudLight"> |
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 wrapped the Tabs component and its children by Box
component with a background to better visualize the whole set of components (components could have set padding
, margin
, spacing
).
79e6fda
to
7ad8c3c
Compare
control: { | ||
type: "select", | ||
argTypes: { | ||
spacing: { |
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 defined "table category" for each arg as I mix multiple components here. Some of the components contain the same prop name, so I set a different name for them and then I set the "name" to have a correct prop name in the controls panel (same for the Table component, there is id
common prop).
secondTabContent: "Tab 2", | ||
fullWidth: false, | ||
}; | ||
export const Playground: Story = { |
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.
In this Playground
story I didn't include active
and onClick
props for Tab
/TabPanel
component as it's related to the Controlled state. In case when have two tabs in the playground, I couldn't find a simpler solution to handle the active
state separately for each 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.
I'll comment here since you wrote this comment and it's related, but maybe it could be applied to Controlled
story. Can't we just add something like selected
arg with select options 0-3 and use that to control the tabs?
I assumed until now that for controlled
stories, it's not possible to manipulate with the component manually and you can only change the value via controls. At least that's what's happening e.g. in Card controlled story. Maybe I completely misunderstood 😅
I think we need to revisit this in the 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.
I have two general points:
- Have you checked conditional controls? I think it might be useful in some situations (e.g. with controlled/uncontrolled)
- I don't know if we agreed on something regarding info, but I think mostly we have been setting something like - for default stories "this is the default configuration", for playground "this is playground/you can try all possible combinations" and for RTL "this is a preview of this component in RTL setup". Sometimes you have very random info like "Explore *** component" 😄 Maybe when you will be doing some changes to stories, you can maybe take a look at this so we are consistent.
titleDecrement: "Remove a passenger", | ||
active: false, | ||
}; | ||
export const Stateless: Story & StoryObj<typeof StatelessStepper> = { |
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 we make the increment/decrement buttons work? 🤔
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 couldn't figure it out. I guess it's related to un/controlled state. Do you have any idea how to fix it? 🙏
packages/orbit-components/src/StopoverArrow/StopoverArrow.stories.tsx
Outdated
Show resolved
Hide resolved
secondTabContent: "Tab 2", | ||
fullWidth: false, | ||
}; | ||
export const Playground: Story = { |
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'll comment here since you wrote this comment and it's related, but maybe it could be applied to Controlled
story. Can't we just add something like selected
arg with select options 0-3 and use that to control the tabs?
I assumed until now that for controlled
stories, it's not possible to manipulate with the component manually and you can only change the value via controls. At least that's what's happening e.g. in Card controlled story. Maybe I completely misunderstood 😅
I think we need to revisit this in the stories.
No, I haven't, we can include it in the "fix" ticket and set some internal rules (when use it, etc...)
As far as I remember, we returned it back when the info didn't correspond to the state of a respective story (eg. info describing "playground" in the default Story), but we haven't agreed on any standard of the form of the info description. |
6e56758
to
ec18a44
Compare
ec18a44
to
9523be1
Compare
81df124
to
22ed55c
Compare
This Pull Request meets the following criteria:
For new components:
d.ts
files and are exported inindex.d.ts
Closes https://kiwicom.atlassian.net/jira/software/c/projects/FEPLT/boards/404?selectedIssue=FEPLT-2078