Skip to content

feat(react-message-bar): add useMessageBarBase_unstable hook#35908

Open
dmytrokirpa wants to merge 3 commits intomicrosoft:masterfrom
dmytrokirpa:feat/react-message-bar-base-hooks
Open

feat(react-message-bar): add useMessageBarBase_unstable hook#35908
dmytrokirpa wants to merge 3 commits intomicrosoft:masterfrom
dmytrokirpa:feat/react-message-bar-base-hooks

Conversation

@dmytrokirpa
Copy link
Copy Markdown
Contributor

Summary

  • Adds useMessageBarBase_unstable hook and MessageBarBaseProps/MessageBarBaseState types (DistributiveOmit<..., 'shape'>)
  • Extracts all core ARIA/reflow/announce logic (layout computation, live-region announce, refs) into the base hook; intent stays in base as it drives accessibility behavior (politeness)
  • Styled useMessageBar_unstable delegates to base hook and sets default icon children via getIntentIcon(state.intent)
  • Updates renderMessageBar_unstable to accept MessageBarBaseState

Test plan

  • yarn nx build react-message-bar — passes, API md updated
  • yarn nx lint react-message-bar — passes
  • yarn nx test react-message-bar — 105 tests pass

Part of #35562

🤖 Generated with Claude Code

Adds `useMessageBarBase_unstable` hook and `MessageBarBaseProps`/`MessageBarBaseState` types that expose the core ARIA/reflow/announce logic without design-specific `shape` prop. The styled `useMessageBar_unstable` now delegates to the base hook and sets the default intent icon (getIntentIcon). Updates `renderMessageBar_unstable` to accept `MessageBarBaseState`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.299 MB
324.701 kB
1.299 MB
324.737 kB
102 B
36 B
react-message-bar
MessageBar (all components)
23.294 kB
8.63 kB
23.396 kB
8.664 kB
102 B
34 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
70.397 kB
19.96 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.743 kB
68.75 kB
react-components
react-components: FluentProvider & webLightTheme
43.612 kB
14.022 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-timepicker-compat
TimePicker
108.565 kB
35.848 kB
🤖 This report was generated against f1902b44b70e3e59643d0e152253a82ffd0dd2b0

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@@ -0,0 +1,7 @@
{
Copy link
Copy Markdown

@github-actions github-actions bot Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Charts-DonutChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png 5570 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 610 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 499 Changed
vr-tests-react-components/ProgressBar converged 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 119 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 128 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png 23 Changed

@dmytrokirpa dmytrokirpa marked this pull request as ready for review March 27, 2026 00:01
@dmytrokirpa dmytrokirpa requested a review from a team as a code owner March 27, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant