diff --git a/.changeset/astryx-discover-lists-the-lab-dialogheroheader-c-dhhr.md b/.changeset/astryx-discover-lists-the-lab-dialogheroheader-c-dhhr.md new file mode 100644 index 0000000000000..493bfcbe22a9e --- /dev/null +++ b/.changeset/astryx-discover-lists-the-lab-dialogheroheader-c-dhhr.md @@ -0,0 +1,6 @@ +--- +'@astryxdesign/cli': patch +--- + +[feat] `astryx discover` lists the Lab DialogHeroHeader component and its DialogHeroHeaderShowcase template from `@astryxdesign/lab`. (#4182) +@jiunshinn diff --git a/.changeset/dialog-when-the-opening-dialog-s-first-data-auto-wr66.md b/.changeset/dialog-when-the-opening-dialog-s-first-data-auto-wr66.md new file mode 100644 index 0000000000000..115b0fc049f3e --- /dev/null +++ b/.changeset/dialog-when-the-opening-dialog-s-first-data-auto-wr66.md @@ -0,0 +1,6 @@ +--- +'@astryxdesign/core': patch +--- + +[fix] Dialog: when the opening Dialog's first data-autofocus request is hidden, inert, or cannot take focus, the next request takes it; a header's default title request comes after every explicit request (#4182) +@jiunshinn diff --git a/.changeset/internal-lab-s-dialogheroheader-reads-the-dialog-ctse.md b/.changeset/internal-lab-s-dialogheroheader-reads-the-dialog-ctse.md new file mode 100644 index 0000000000000..cb437fc0b86e5 --- /dev/null +++ b/.changeset/internal-lab-s-dialogheroheader-reads-the-dialog-ctse.md @@ -0,0 +1,6 @@ +--- +'@astryxdesign/core': patch +--- + +[chore] Internal: Lab's DialogHeroHeader reads the Dialog's title id and inline state through an internal entry reserved for Astryx's own packages; nothing a consumer sees changes (#4182) +@jiunshinn diff --git a/.github/scripts/story-play-guard.js b/.github/scripts/story-play-guard.js index db34b39b9cfb8..8172d0cb9ab67 100644 --- a/.github/scripts/story-play-guard.js +++ b/.github/scripts/story-play-guard.js @@ -347,6 +347,20 @@ const TARGETS = [ guards: 'the rendered RTL wrapper mirrors fixed-track item order while responsive and span geometry remain bounded', }, + { + component: 'DialogHeroHeader', + story: 'lab-dialogheroheader--media-bleed-geometry', + guards: + 'media reaches the dialog edges at theme-default, 0/2/8 padding, a ' + + 'theme override, and RTL while the title keeps the cancelled inset', + }, + { + component: 'DialogHeroHeader', + story: 'lab-dialogheroheader--custom-heading-focus-after-rerender', + guards: + 'a custom heading keeps focus and keeps naming the open modal while ' + + 'the header re-renders with a new title element', + }, { component: 'TabList', story: 'core-tablist--full-bleed-geometry', diff --git a/apps/storybook/stories/DialogHeroHeader.stories.tsx b/apps/storybook/stories/DialogHeroHeader.stories.tsx new file mode 100644 index 0000000000000..59c3f89f93e01 --- /dev/null +++ b/apps/storybook/stories/DialogHeroHeader.stories.tsx @@ -0,0 +1,628 @@ +// Copyright (c) Meta Platforms, Inc. and affiliates. + +/** + * @file DialogHeroHeader.stories.tsx + * @input DialogHeroHeader and its Dialog, Layout, Heading, and media composition + * @output Inline visual states, an interactive modal example, and a media + * bleed geometry guard across Dialog paddings and RTL + * @position Storybook coverage for the experimental hero header; the geometry + * story's play function is required CI via story-play-guard.js + */ + +import { + useEffect, + useId, + useState, + type ComponentProps, + type CSSProperties, +} from 'react'; +import type {Meta, StoryObj} from '@storybook/react'; +import {DialogHeroHeader} from '@astryxdesign/lab'; +import {Dialog} from '@astryxdesign/core/Dialog'; +import { + Layout, + LayoutContent, + LayoutFooter, + HStack, +} from '@astryxdesign/core/Layout'; +import {Button} from '@astryxdesign/core/Button'; +import {Heading} from '@astryxdesign/core/Heading'; +import {Icon} from '@astryxdesign/core/Icon'; +import {Text} from '@astryxdesign/core/Text'; +import DialogHeroHeaderShowcase from '../../../packages/lab/blocks/DialogHeroHeaderShowcase'; +import * as stylex from '@stylexjs/stylex'; + +const styles = stylex.create({ + heroSvg: { + display: 'block', + }, +}); + +// Self-contained stand-in for a hero image / illustration. A real app would +// pass an ,