Skip to content

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

Open
Dmytro Kirpa (dmytrokirpa) wants to merge 1 commit into
test/react-color-picker-hooksfrom
feat/color-picker-headless-base
Open

feat(react-color-picker): expose headless base APIs#36517
Dmytro Kirpa (dmytrokirpa) wants to merge 1 commit into
test/react-color-picker-hooksfrom
feat/color-picker-headless-base

Conversation

@dmytrokirpa

@dmytrokirpa Dmytro Kirpa (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 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 existing render functions to consume base state
  • add a base ColorPicker context-values hook for headless composition
  • expose supporting public types and APIs, including ColorChannel
  • update the API report and add a minor changefile for @fluentui/react-color-picker

Review guidance

Review this PR relative to test/react-color-picker-hooks. The key boundary is that base hooks own reusable behavior, while existing component hooks continue to add styled-only state.

Validation

PR stack

  1. test(react-color-picker): add hook state coverage #36527: add hook state coverage
  2. This PR: expose reusable color-picker base APIs
  3. feat(react-headless-components-preview): add color picker controls #36518: add headless color-picker controls

Depends on #36527 and should be merged after it.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Pull request demo site: URL

@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 33e4a021a728e9a7ba2f023e1a500fee549c4be5

@mainframev

Copy link
Copy Markdown
Contributor

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

@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) force-pushed the feat/color-picker-headless-base branch from a253416 to 053e0da Compare August 6, 2026 07:53
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) changed the base branch from master to test/react-color-picker-hooks August 6, 2026 07:54
@dmytrokirpa

Copy link
Copy Markdown
Contributor Author

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

good point, added as a first PR in the stack

@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) force-pushed the feat/color-picker-headless-base branch from 053e0da to 89aabe1 Compare August 7, 2026 12:38
@dmytrokirpa
Dmytro Kirpa (dmytrokirpa) force-pushed the feat/color-picker-headless-base branch from 89aabe1 to e7139db Compare August 7, 2026 15:20
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