feat(sheet): improve customizability with size prop, actions slot, and layout fixes#302
Conversation
|
/review |
…d layout fixes - Add `size` prop to Sheet.Content for width variations (sm/md/lg/xl/full) - Add `actions` prop to Sheet.Header for action buttons beside the title - Increase Sheet.Title font size to text-lg for better hierarchy - Move close button from absolute positioning into Header normal flow
- Wrap actions and close button in a shared items-center container - Fix example body padding from '1rem 0' to '0 1rem' to match Header/Footer
c2d693e to
abe2ac9
Compare
- Replace XIcon with directional chevrons (ChevronsRight/Left/Up/Down) based on sheet side - Add hover background style (bg-accent) to close button matching sidebar trigger style - Remove opacity-based hover in favor of color-based transition
|
I don't necessarily have an issue with this change, but I do think we're adding action buttons everywhere haha, I'm a bit worried AI will get confused on which action goes where (and humans too) |
|
Fair point, though I don't think this will be a big concern in practice. Providing a dedicated actions slot is a pretty common pattern — Ant Design does it with |
|
Yeah I don't think it's too much of a concern, maybe we just need to clarify in the skill what action belongs in which component? Depends how opinionated we want to be. The change itself looks fine though :) |
Summary
Enhance the Sheet component to address several customizability and layout issues.
Changes
API
actionprop onSheet.Header— allows placing action buttons (save, edit, etc.) to the right of the title areaUI
sizeprop onSheet.Content— supportssm(384px),md(512px),lg(720px),xl(960px), andfull(100%) width variations for left/right side sheetsSheet.Titlefont size — increased totext-lgfor better visibility and hierarchybg-accenthover background matching the sidebar trigger style, replacing the previous opacity-based hoverScreen shots
Default
Sheet with
actionpropExample