Skip to content

feat(react-cap-theme): add react-spinbutton component#658

Draft
pixel-perfectionist wants to merge 5 commits into
mainfrom
olkatruk/cap-theme/spin-button
Draft

feat(react-cap-theme): add react-spinbutton component#658
pixel-perfectionist wants to merge 5 commits into
mainfrom
olkatruk/cap-theme/spin-button

Conversation

@pixel-perfectionist

Copy link
Copy Markdown
Member

Adds react-spinbutton component to react-cap-theme (CAP theme style overrides for SpinButton).

Changes

  • SpinButton.types.ts — component types
  • useSpinButtonStyles.styles.ts — CAP theme style hook overrides
  • index.ts — exports
  • changefile

Draft for review.

@pixel-perfectionist pixel-perfectionist force-pushed the olkatruk/cap-theme/spin-button branch from a6101de to 0eba508 Compare June 9, 2026 00:34
Alexander Katrukhin and others added 5 commits July 7, 2026 11:11
Add a CAP-themed SpinButton style hook layering CAP deltas on the Fluent base
state: pill radius on the `outline` appearance (root and `::before` border),
accessible stroke on all four borders (Fluent base only makes the bottom
accessible), CAP field heights (36px medium / 28px small), and removal of the
Fluent animated focus underline (`::after`) on `outline` only — other
appearances keep the base focus underline.

Registered via CAP_STYLE_HOOKS.useSpinButtonStyles_unstable, mirroring the
react-input / react-search pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Default, Appearance, Size, and Disabled stories adapted from the Fluent
react-spinbutton examples. Rendered under CAP_STYLE_HOOKS via the storybook
decorator to visually verify the CAP outline overrides.
…state matrices

Style fixes to match the Figma (CAP Web Toolkit) light-theme specs:
- pressed/focus border uses brand stroke (colorCompoundBrandStroke, #0f6cbd)
  instead of the neutral accessible-pressed gray.
- invalid no longer clobbered: outlineInteractive is skipped when invalid so
  the Fluent base red border (colorPaletteRedBorder2) shows; CAP adds the brand
  focus border for the invalid+focus case.
- placeholder color now matches Figma: rest #616161 (colorNeutralForeground3),
  darkening to #242424 on hover/focus (base left it uncolored / too dark).
- steppers polished per size (Figma): medium 34px col / 11px padding, small
  26px col / 7px padding, outer corner matched to the pill radius (12/8px) so
  the hover background follows the curve.

Stories: small + medium NoValue/WithValue state matrices covering rest, hover,
pressed, error, disabled, read-only and focus, with hover/pressed/focus forced
via storybook-addon-pseudo-states and a size-matched CAP brand leading circle.
The SpinButton refactor deleted SpinButton.types.ts and re-pointed the
styles hook at @fluentui/react-components' SpinButtonState (size only
'small' | 'medium'). This broke type-check: index.ts imported the deleted
module and the 'large' size branches no longer type-checked.

Restore SpinButton.types.ts re-exporting the base state with size widened
to include the CAP-only 'large' value, and source it from the styles hook.
Base state is imported from @fluentui/react-components (already a peer dep)
to satisfy @nx/dependency-checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pixel-perfectionist pixel-perfectionist force-pushed the olkatruk/cap-theme/spin-button branch from 20a1550 to 9696353 Compare July 9, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant