Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-fab-extended-width.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-ui': patch
---

Fix: `<Fab variant="extended">` no longer gets a fixed `width` from `MuiFabSizes`. The size-based width/height variants are now scoped to `variant: 'circular'` only, so extended Fabs can grow with their label (controlled via `min-width` instead) as MUI intends. Previously every extended Fab without an explicit `size` matched the default `large` rule and was forced to 54px wide.
5 changes: 4 additions & 1 deletion packages/next-ui/Theme/MuiFab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ const sizes: FabSize[] = [
/**
* This defines the sizes for the added responsive variant.
*
* Only applied to circular (default) Fabs — extended Fabs must keep `width: auto` and rely on their
* content + `min-width`, otherwise they collapse to a fixed square regardless of label.
*
* To override the sizes, please do not add variant declarations direcly, but modify
* `yourTheme.components.MuiFabExtra.sizes` instead.
*/
export const MuiFabSizes: FabVariants = sizes.map((size) => ({
props: { size },
props: { size, variant: 'circular' },
style: ({ theme }) => fabWidthHeight(size, theme),
}))

Expand Down
Loading