Skip to content

feat(react-color-picker): expose headless base APIs - #36517

Open
dmytrokirpa wants to merge 2 commits into
masterfrom
feat/color-picker-headless-base
Open

feat(react-color-picker): expose headless base APIs#36517
dmytrokirpa wants to merge 2 commits into
masterfrom
feat/color-picker-headless-base

Conversation

@dmytrokirpa

@dmytrokirpa dmytrokirpa commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Motivation

@fluentui/react-headless-components-preview needs the color picker behavior and slot state without applying the styled components’ visual-only state. This PR separates that reusable behavior from the styled wrappers so the follow-up PR can compose headless color picker controls without duplicating interaction logic.

No visual or behavioral change is intended for the existing @fluentui/react-color-picker components.

Changes

  • add base props and state types for ColorPicker, ColorArea, ColorSlider, and AlphaSlider
  • extract and export use*Base_unstable hooks containing shared slot, input, color, orientation, and change-handling behavior
  • keep the existing styled hooks as thin wrappers that add visual-only state such as shape
  • allow the existing render functions to consume base state
  • add a base ColorPicker context-values hook for headless composition
  • expose the supporting public types and APIs, including ColorChannel
  • add hook-level tests for default state, context inheritance, prop precedence, and color-change forwarding
  • update the API report and add a minor changefile for @fluentui/react-color-picker

Review guidance

The key boundary is that base hooks own reusable behavior, while the existing component hooks continue to add styled-only state. The existing component API and rendering path remain intact.

Validation

PR stack

  1. This PR: expose reusable color picker base APIs
  2. feat(react-headless-components-preview): add color picker controls #36518: consume the base APIs in headless color picker controls

Please review and merge this PR before #36518.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Pull request demo site: URL

@dmytrokirpa dmytrokirpa self-assigned this Aug 5, 2026
@dmytrokirpa
dmytrokirpa force-pushed the feat/color-picker-headless-base branch from 2e9e6cd to d4cd9c6 Compare August 5, 2026 13:19
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-color-picker
ColorArea
43.944 kB
15.811 kB
43.986 kB
15.826 kB
42 B
15 B
react-color-picker
ColorPicker
14.988 kB
6.041 kB
15.035 kB
6.057 kB
47 B
16 B
react-color-picker
ColorSlider
38.952 kB
14.294 kB
38.994 kB
14.313 kB
42 B
19 B
react-components
react-components: entire library
1.295 MB
326.559 kB
1.296 MB
326.582 kB
189 B
23 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
66.297 kB
19.006 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
226.106 kB
68.067 kB
react-components
react-components: FluentProvider & webLightTheme
39.52 kB
13.116 kB
react-portal-compat
PortalCompatProvider
5.341 kB
2.146 kB
react-timepicker-compat
TimePicker
140.991 kB
46.069 kB
🤖 This report was generated against f752d69f810deb2b41b8ce66fa41ab09cfed4505

@@ -0,0 +1,7 @@
{

@github-actions github-actions Bot Aug 5, 2026

Copy link
Copy Markdown

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/Menu Converged - submenuIndicator slotted content 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 413 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 726 Changed
vr-tests-react-components/Positioning.Positioning end.chromium.png 897 Changed
vr-tests-react-components/ProgressBar converged 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 53 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 77 Changed
vr-tests-react-components/Skeleton converged 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Skeleton converged.Opaque Skeleton with circle - Dark Mode.default.chromium.png 3 Changed
vr-tests-react-components/TagPicker 4 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png 658 Changed
vr-tests-react-components/TagPicker.disabled - High Contrast.disabled input hover.chromium.png 1319 Changed
vr-tests-react-components/TagPicker.disabled - RTL.disabled input hover.chromium.png 635 Changed
vr-tests-react-components/TagPicker.disabled.disabled input hover.chromium.png 677 Changed

There were 4 duplicate changes discarded. Check the build logs for more information.

@mainframev

Copy link
Copy Markdown
Contributor

@dmytrokirpa previously we were adding tests to prevent hook regressions, should we add a test before this PR will be merged?

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.

3 participants