docs(ui): add stories for Link#1732
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThis PR extends the Link component API by adding five new public properties to Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/components/Link/Link.stories.ts (1)
106-132: Consider adding a medium-sized button to the Snapshot for complete size coverage.The Snapshot story is excellent for visual regression testing. However, it includes only the
smallsize variant (line 125). Consider adding asize="medium"example alongside the small button to ensure both sizes are captured in snapshot tests.🔧 Suggested enhancement
<div style="display: flex; gap: 1rem;"> <LinkBase to="/" variant="button-primary" size="small">Small Button</LinkBase> + <LinkBase to="/" variant="button-primary" size="medium">Medium Button</LinkBase> </div>
|
This would be a good time to discuss how to structure stories for UI Library Components aka atomic components. I've left I prefer |
Great points. I think when we are able to use autodocs the docs page becomes a sort of showcase. (Obviously there’s the option of using manual doc pages for now but I think those are a lot to manage.) In my experience having the default/primary component usage as the first story makes the autodoc organization flow well. That said, I believe for reducing the number of regression test in chromatic I have seen it suggested to only run those test on a combined story like those. So I think we will still find value in a snapshot or showcase story even after we can use autodocs. |
🔗 Linked issue
Closes: #1731
🧭 Context
Adds stories for the Link component in the storybook.
📚 Description
Note
One tricky thing I ran into with this one is that for the "WithIcon" story I had to pick an Icon that was already for sure bundled by unocss in the build. Otherwise Storybook wasn't displaying the icon. (Was trying to use
i-lucide:scalebut switched toi-lucide:checkinstead)