Dialog Size=Emphasized variant (DES-37)
Pre-release · Type: ✨ Feature
DES-37: Dialog adds a
Size=Emphasizedvariant.
Changes
DES-37: Dialog supports Size=Emphasized
Status: Done
Background:
The Size axis of the Figma Modal component (COMPONENT_SET 21235:6773) contains two values, Default / Emphasized, while the previous implementation only covered Default. As verified in Figma, the only difference between Emphasized and Default is the content container width (Default 464px / Emphasized 708px); the padding / corner radius / font size / structure are identical between the two.
Note: the original
DialogDesignSpec.mdmistakenly recorded theSizeaxis asVariant, and listed an extra, nonexistentOnboardingvalue.Onboarding Modalis a separate component in Figma (nodes18609:2556/21248:3849) and is out of scope for this component. The spec has been corrected accordingly.
Changed files: src/components/Dialog/Dialog.tsx, src/components/Dialog/index.ts, src/components/index.ts, src/components/Dialog/Dialog.test.tsx, src/components/Dialog/DialogDesignSpec.md, packages/design-site/docs/components/patterns/dialog.mdx, packages/design-site/i18n/zh-CN/.../dialog.mdx
Changes:
- Added the public type
DialogSize = 'default' | 'emphasized'andDialogProps.size(default'default').DialogOpenOptionsautomatically inheritssizeviaOmit<DialogProps, ...>, so the imperativeDialog.open()also supports it - Added the size→width mapping
DIALOG_SIZE_CLASS; onlyemphasizedoverrides theui/dialogdefault width (max-w-177= 708px);defaultkeeps the primitive'smax-w-116(464px). Overriding goes throughmergeClass(tailwind-merge 3.3.0); verified thatmax-w-116/max-w-177are deduplicated within the same group ui/dialogstays unchanged (the primitive still provides the 464px default), in line with the layering principle of "ui provides the default visuals, the design layer takes over semantic variants"- Added unit tests: default width
max-w-116;size="emphasized"appliesmax-w-177and overrides the default - design-site adds a "Size" example and a
sizerow in the Props table (bilingual)