improvements#6
Conversation
gfazioli
commented
Mar 25, 2026
- feat(SelectStepper): add orientation, swipe, imperative API, gradient, size and docs 🚀
- feat(SelectStepper): 🎨 add size, border, gradient, renderOption and update docs
- 🎉 feat(SelectStepper): add viewHeight prop for vertical orientation
- refactor: update SelectStepper navigation, swipe, and reset behavior — 🚀
- ✨ feat(select-stepper): add responsive props support
…, size and docs 🚀 - Introduce `orientation` prop for vertical mode with updated layout and keyboard handling - Add `swipeable` and `swipeThreshold` props for touch navigation - Expose `controlRef` with `next`, `prev`, `reset`, `navigateTo` methods - Add `gradient` variant support and `size` prop for icon sizing - Update docs, demos, and README to showcase new features - Add error constants and improve test coverage for new behavior - Update CSS for touch-action and orientation handling - Refactor component internals for better state sync and cleanup
…pdate docs - Add size, withBorder, gradient, renderOption props to control visual style. - Introduce onStepStart/onStepEnd callbacks for navigation events. - Update vertical orientation layout and CSS to use viewWidth for height. - Expand docs with new sections and examples. - Add comprehensive tests covering new props, callbacks, and edge cases.
- Introduce `viewHeight` prop to control vertical view area height. - Update styles API and default to use `--select-stepper-view-height`. - Remove `viewWidth` usage in vertical mode and update docs. - Ensure vertical stepper height defaults to 36px.
- Simplify horizontal arrow key handling to left/right only. - Add swipe gesture support with threshold, cancel handling, and disable option. - Improve reset to fallback to first non‑disabled item when initial value is missing. - Guard `navigateTo` against disabled state. - Update docs to reflect new key behavior. - Remove legacy error constants and their export.
- Allow viewWidth, viewHeight, size, and orientation to accept responsive objects - Add demo illustrating responsive viewport width and orientation - Include tests that confirm component accepts responsive values without crashing - Update documentation to explain responsive prop usage - Introduce SelectStepperMediaVariables to inject CSS variables for responsive styling
There was a problem hiding this comment.
Pull request overview
This PR significantly extends the SelectStepper component API and UX to support vertical orientation, swipe navigation, an imperative control API, responsive props, size/gradient styling, and expanded documentation/tests across the package and docs site.
Changes:
- Added responsive
viewWidth/viewHeight/size/orientationsupport via generated CSS variables and breakpoint media queries. - Implemented vertical orientation (layout + icons + keyboard mapping), swipe gestures (pointer events), and an imperative
controlRefAPI. - Expanded Jest test coverage and documentation/demos for the new features.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package/src/index.ts | Exports additional public types and re-exports Mantine types used by the public API. |
| package/src/SelectStepperMediaVariables.tsx | New helper to generate responsive CSS variables via Mantine breakpoints/InlineStyles. |
| package/src/SelectStepper.tsx | Core feature work: orientation, swipe, imperative API, callbacks, responsive sizing, and a11y updates. |
| package/src/SelectStepper.test.tsx | Large expansion of tests for navigation, looping, swipe, orientation, a11y, and controlRef behavior. |
| package/src/SelectStepper.story.tsx | Adds new stories demonstrating vertical, sizes, gradient, imperative API, callbacks, and swipe. |
| package/src/SelectStepper.module.css | Adds vertical-mode layout rules and new CSS variables for height and touch behavior. |
| docs/styles-api/SelectStepper.styles-api.ts | Documents the new --select-stepper-view-height variable. |
| docs/docs.mdx | Adds/reshuffles docs sections for animation callbacks, keyboard navigation, swipe, sizes, responsive props, vertical mode, gradient, and imperative API. |
| docs/demos/index.ts | Registers new demos (emptyValue/gradient/imperative/responsive/sizes/swipeable/vertical). |
| docs/demos/SelectStepper.demo.vertical.tsx | New demo for vertical orientation. |
| docs/demos/SelectStepper.demo.swipeable.tsx | New demo for swipe gestures. |
| docs/demos/SelectStepper.demo.stylesApi.tsx | Fixes package import in code snippet. |
| docs/demos/SelectStepper.demo.size.tsx | New demo for the size prop. |
| docs/demos/SelectStepper.demo.responsive.tsx | New demo for responsive props (viewport + orientation). |
| docs/demos/SelectStepper.demo.inForm.tsx | Updates the “in form” demo content to showcase different usage. |
| docs/demos/SelectStepper.demo.imperative.tsx | New demo for controlRef imperative methods. |
| docs/demos/SelectStepper.demo.gradient.tsx | New demo for gradient variant. |
| docs/demos/SelectStepper.demo.emptyValue.tsx | New demo for emptyValue. |
| docs/demos/SelectStepper.demo.configurator.tsx | Adds configurator controls for variant/orientation/size/viewHeight. |
| README.md | Updates README with feature list and imperative API example; formatting tweaks. |
| CLAUDE.md | Adds repo workflow/architecture guidance (commands, structure, key behaviors). |
Comments suppressed due to low confidence (2)
package/src/SelectStepper.tsx:67
- A new CSS variable
--select-stepper-action-sizeis introduced (set inSelectStepperMediaVariablesand consumed via--ai-sizeon the ActionIcons), but it is not included in the exportedSelectStepperCssVariablestype. This makes the public Styles API types incomplete/inaccurate.
Add --select-stepper-action-size to the root union in SelectStepperCssVariables (or rename/remove the variable if it is intended to be private).
export type SelectStepperCssVariables = {
root:
| '--select-stepper-view-width'
| '--select-stepper-view-height'
| '--select-stepper-animation-duration'
| '--select-stepper-animation-timing-function'
| '--select-stepper-radius';
wrapper: '--select-stepper-margin-top' | '--select-stepper-margin-bottom';
docs/styles-api/SelectStepper.styles-api.ts:27
--select-stepper-action-sizeis now an actual runtime CSS variable (used to drive ActionIcon sizing), but it is not documented in the Styles APIvars.rootlist. This leaves consumers without guidance for overriding the variable.
Add --select-stepper-action-size to SelectStepperStylesApi.vars.root with a short description (e.g. controls navigation button size).
vars: {
root: {
'--select-stepper-view-width': 'Controls the width of the view area',
'--select-stepper-view-height':
'Controls the height of the view area in vertical orientation',
'--select-stepper-animation-duration': 'Controls the duration of scroll animations',
'--select-stepper-animation-timing-function':
'Controls the timing function for scroll animations',
'--select-stepper-radius': 'Controls the border radius',
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Expose `StyleProp` in public exports and update documentation - Document responsive props (`viewWidth`, `viewHeight`, `size`, `orientation`) - Add default swipe threshold and guard against disabled navigation - Prevent unnecessary state updates when next index is unchanged - Adjust container to `wrap="nowrap"` for consistent layout - Update tests count and README to reflect new features
… tweaks - Set wrapper and root max-width to 100% - Add min-width and flex to view for proper sizing - Ensure content fills available width - Fix vertical orientation layout issues
- Ensures the stepper width adapts to its content - Prevents unnecessary horizontal space in the UI - Keeps layout consistent across varying content lengths
… handling 🚀 - Add InlineStyles + useRandomClassName for responsive CSS media queries (viewWidth, viewHeight, size) - Add useMatches for responsive orientation handling in JS - Update action size handling with AI_SIZE_VALUES mapping - Update documentation to reflect new responsive features
- Expand description to highlight new features such as keyboard navigation, swipe, and responsive behavior. - Add relevant keywords for better discoverability and SEO. - Remove outdated tags and clean up keyword list.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update documentation to remove test count reference. - Conditionally apply `wrap="nowrap"` only when not in vertical mode. - Prevent unintended wrapping in vertical layout.
- Adjust demo ref to `SelectStepperRef | null` for correct TypeScript typing. - Add `_value` to `useEffect` dependencies to avoid stale state issues. - Include `aria-labelledby` for non-string labels to improve accessibility.