-
Notifications
You must be signed in to change notification settings - Fork 0
Add region select components for US states and Canada provinces #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add region select components for US states and Canada provinces #127
Conversation
- Create base RegionSelect component with shadcn styling - Add US_STATES and CANADA_PROVINCES data - Create convenience wrapper components for US states and Canada provinces - Create form-aware wrapper components for remix-hook-form - Add Storybook stories and tests Co-authored-by: Jake Ruesink <jake@lambdacurry.com>
|
|
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces a new Select component and data sets (US/Canada regions), adds UI and Remix Hook Form wrappers, updates exports, adds Storybook stories/tests for form interactions, removes legacy DropdownMenuSelect, and updates form/phone input internals. Also adds repo docs and root/package version/dependency updates. Changes
Sequence Diagram(s)sequenceDiagram
actor U as User
participant SB as Storybook Story
participant RF as Remix Form (useRemixForm)
participant FE as fetcher.Form
participant A as Remix Action (handleFormSubmission)
participant Z as zodResolver/getValidatedFormData
U->>SB: Interact with Selects (open, search, choose)
SB->>RF: Field value updates via Select onValueChange
U->>FE: Submit form
FE->>A: POST form data
A->>Z: Validate request
alt Invalid
Z-->>A: { errors }
A-->>FE: { errors }
FE-->>SB: Display FormMessage
else Valid
Z-->>A: { data }
A-->>FE: { message, selectedRegions }
FE-->>SB: Render success summary/message
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
🔍 Check Suite Status for PR #127
|
…select stories - Removed direct dependency on @remix-run/react - Created a mock fetcher implementation for Storybook - Fixed build error in Storybook
|
@codegen-sh please fix these => Failed to build the preview error during build:
|
|
✅ Fixed failing checks in this commit. The issues were:
These changes should resolve the build failures while maintaining the functionality of the region select components. |
- Update FormField import in region-select.tsx - Replace @storybook/jest with @storybook/test Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
|
✅ I've fixed the build errors in the PR:
These changes have been pushed to the same PR branch. The build should now pass successfully. I also see that a check suite agent has been automatically created to handle the failing GitHub Actions checks. It will work on fixing any remaining issues with the PR. 💻 View my work • 🛑 Stop • React 👍 or 👎 |
|
@codegen-sh please run build and fix issues until it passes and then push up the fix
|
- Update FormItem import in region-select.tsx - Replace @storybook/jest with @storybook/test Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
|
✅ Build is now passing successfully! I've fixed the following issues:
These changes have been pushed to the same PR branch. The build now passes successfully for both the components package and the Storybook documentation. The PR is ready for review: View PR #127 💻 View my work • 🛑 Stop • React 👍 or 👎 |
|
📝 Storybook Preview: View Storybook This preview will be updated automatically when you push new changes to this PR.
|
- Use withReactRouterStubDecorator instead of mock fetcher - Update story structure to match other components - Improve test organization with step function - Add source code example in docs Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Add search functionality - Remove check icon from trigger - Improve dropdown styling - Add react-stately dependency Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Lighten selected gray background - Darken hover gray background - Remove black border around dropdown - Make search input full width without border Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Fix Alabama gray background issue by removing default background - Add auto-scroll to selected item when dropdown opens - Improve hover and selected state styling Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Remove bg-gray-50 from first item - Install Playwright for Storybook tests Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
…and Canada province helpers
- Updated imports in data files to use SelectOption from select.tsx instead of RegionOption from region-select.tsx - Removed non-existent tooltip export from UI index file
- Removed dropdown-menu-select-field.tsx from UI components - Removed dropdown-menu-select.tsx from remix-hook-form components - Removed dropdown-menu-select.stories.tsx from docs - Updated index files to remove exports for these components This completes the migration to the new Select component.
…workspaces configuration. Refactor select component imports and improve accessibility features in select.tsx and phone-input-field.tsx. Enhance Storybook stories for region selection components with better querying methods.
…ambda-curry/forms into codegen-bot/refactor-select-components
…er decorators and enhancing play functionality for form submission tests. This improves the structure and readability of the stories while ensuring comprehensive testing of user interactions.
… `components` prop to allow users to override FormControl, FormLabel, FormDescription, and FormMessage. Updated Select UI to utilize default icons and support custom Trigger, Item, and SearchInput components.
…e version to 0.19.4 in package.json.
…ity and customization. Added support for dynamic aria attributes and enhanced Storybook tests to verify selection updates. Cleaned up unused region selection code and utilized clsx for class management in custom components.
Overview
This PR implements a new dropdown selector component for US states and Canada provinces as requested in LC-319. The component follows the forms repo patterns and matches the shadcn trigger styling with the 360training dropdown styling.
Features
RegionSelectcomponent that can be used for any region selectionImplementation Details
RegionSelectcomponent inpackages/components/src/ui/region-select.tsxUSStateSelectandCanadaProvinceSelectcomponentsTesting
Screenshots
The components can be viewed in Storybook after deployment.
Related Issues
Closes LC-319
💻 View my work • 👤 Initiated by
Jake Ruesink• About Codegen⛔ Remove Codegen from PR • 🚫 Ban action checks
Summary by CodeRabbit