Repository navigation
feat(core): DialogHeroHeader — hero-style Dialog header - #4500
Lee-Dongwook wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9dde34a to
6bf7fb3
Compare
PR Analysis ReportModified ComponentsDialog
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | View full report |
|
Going with #5105 for this one — lab first, so we can adjust the API before it becomes permanent surface. Your placement analysis was the sharpest thing on this issue: lab needs Thanks for the port — the behaviour mapping from the internal component was accurate. [Reviewed by Robohands] |
Issue
#4182
Summary
Adds
DialogHeroHeader— a prominent, "hero"-style header forDialog, the high-emphasis sibling ofDialogHeader. It's for dialogs that open onto a featured/marketing/onboarding moment (illustration or icon, larger title, supporting copy), where the compactDialogHeaderis too understated.Ported the value and behavior of the internal
XDSModalHeroHeader, mapped to Astryx conventions (Modal→Dialog).Placement
Lands as a
Dialogsub-component in@astryxdesign/core(alongsideDialogHeader), not inlab.DialogHeroHeaderneeds the internalDialogContextfor thearia-labelledbytitle handshake and inline-previewautofocus suppression — the same contract
DialogHeaderrelies on. Putting itin
labwould have meant widening core's public API to exportDialogContext;keeping it in core avoids that and makes it a true sibling.
Anatomy / API
A superset-ish sibling of
DialogHeader— sametitle,subtitle,onOpenChange,hasDivider, plus hero-only slots:title— display-scale heading (h2 element,display-3sizing), receivesfocus on open and names the dialog via
aria-labelledbysubtitle— supporting text (secondary)eyebrow— short overline above the title (accent)media— visual slot above the title (illustration / image / icon)align—'center'(default) |'start'onOpenChange— close-button callback (omit = no button), identical toDialogHeaderhasDivider— inherits the Layout divider contextActions (CTAs) intentionally stay in
LayoutFooter, per Astryx's Layout model —the header doesn't take an
actionsslot.Composes entirely from existing primitives (
Heading,Text,Button,Icon,LayoutHeader); StyleX + semantic tokens only;BasePropsescape hatches,displayName,'use client'.What's included
DialogHeroHeader.tsximplementationDialogHeroHeader.test.tsx(18 tests)DialogHeroHeader.doc.mjs(docs / docsZh / docsDense)index.tsexport wired;Dialog.doc.mjssub-component + anatomy noteDialogHeroHeader.stories.tsx)DHH) and a changesetTesting
vitestDialog suite: 70 passed (incl. 18 new)tsc --noEmit: 0 errorsprettier --check,eslint,pnpm check:repo(sync/boundaries/changesets):all clean
Screenshot