feat(react-cap-theme): add react-spinbutton component#658
Draft
pixel-perfectionist wants to merge 5 commits into
Draft
feat(react-cap-theme): add react-spinbutton component#658pixel-perfectionist wants to merge 5 commits into
pixel-perfectionist wants to merge 5 commits into
Conversation
a6101de to
0eba508
Compare
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>
20a1550 to
9696353
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
react-spinbuttoncomponent toreact-cap-theme(CAP theme style overrides for SpinButton).Changes
SpinButton.types.ts— component typesuseSpinButtonStyles.styles.ts— CAP theme style hook overridesindex.ts— exportsDraft for review.