-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Integrate shadcn/ui InputGroup for Prefix/Suffix Functionality #165
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
base: main
Are you sure you want to change the base?
feat: Integrate shadcn/ui InputGroup for Prefix/Suffix Functionality #165
Conversation
β¦tionality - Add official shadcn/ui InputGroup component with proper accessibility - Refactor TextField to use InputGroup when prefix/suffix props are provided - Maintain backward compatibility with existing TextField API - Deprecate legacy FieldPrefix/FieldSuffix components (kept for compatibility) - Add biome-ignore comments for intentional WAI-ARIA role usage - All existing tests pass with the new implementation Benefits: - Cleaner, more maintainable code structure - Better accessibility with proper semantic markup - Official shadcn/ui patterns and styling - Support for inline-start, inline-end, block-start, block-end alignment - No breaking changes - existing code continues to work Requested by: Jake Ruesink
|
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the β¨ Finishing touchesπ§ͺ Generate unit tests (beta)
Comment |
|
π Storybook Preview: View Storybook This preview will be updated automatically when you push new changes to this PR.
|
Update InputGroup component styles to match the simpler, cleaner look of the original FieldPrefix/FieldSuffix implementation instead of shadcn's default styling. Changes: - Simplified InputGroup wrapper: removed shadow-xs, dark mode backgrounds, complex borders - Updated to use simple focus-within ring (matching original wrapper behavior) - Changed InputGroupAddon to use text-base (not text-sm) and gray-500/gray-700 colors - Added proper border styling: border-y + border-l/r for prefix/suffix - Simplified InputGroupText to just whitespace-nowrap (matching original) - Updated InputGroupInput to conditionally remove borders/radius based on addons Result: Inputs with prefix/suffix now match the original Lambda Curry design while using the official shadcn/ui component architecture underneath. Requested by: Jake Ruesink
β¦addons Fix the border and border-radius coordination so prefix/suffix addons connect seamlessly with the input field without visible gaps. Changes: - Move border/radius removal logic from InputGroupInput to TextField - TextField now explicitly passes 'rounded-l-none border-l-0' when prefix exists - TextField now explicitly passes 'rounded-r-none border-r-0' when suffix exists - Simplified InputGroupInput to just handle base styling - This matches the original implementation's approach exactly Result: Borders and corners now connect cleanly between addons and input, matching the original FieldPrefix/FieldSuffix behavior. Requested by: Jake Ruesink
|
π Broken test auto-fixer β’ Learn more
π» View my work β’ π Stop β’ π« Ban all checks βοΈ Check suite settings |
β¦ility Complete refactor focusing purely on the new InputGroup implementation without backward compatibility concerns. Changes: - Removed deprecated FieldPrefix and FieldSuffix components entirely - Simplified InputGroup wrapper to just focus-within ring - Rewrote InputGroupAddon with simple 'start'/'end' alignment (not inline-start/inline-end) - Removed CVA variants in favor of simple conditional logic (isPrefix/isSuffix) - Fixed height to h-10 for proper alignment with inputs - Explicitly remove borders on connecting sides (border-r-0 for prefix, border-l-0 for suffix) - Simplified InputGroupText to just whitespace-nowrap - TextField explicitly passes rounded-l-none/border-l-0 for prefix and rounded-r-none/border-r-0 for suffix Result: Clean, simple implementation matching the original Lambda Curry design with proper border/radius coordination between addons and input. Requested by: Jake Ruesink
- Fix className prop access in TextField InputGroupInput component - Fix Storybook story type definitions in select-alignment.stories.tsx - Remove invalid focusTrap option from userEvent.keyboard call Fixes failing typecheck in PR quality checks workflow.
|
β Fixed all failing checks on PR #165! I've successfully resolved the TypeScript errors that were causing the "PR Quality Checks" workflow to fail: π§ Issues Fixed:1. TextField Component (
|
|
β Check Suite Issue Resolved I investigated the failed check suite on PR #165 and found that the issue has already been resolved. Here's what happened: π Root CauseThe failed check suite (commit
β ResolutionThe issues were already fixed in commit
π Current StatusThe branch is in a healthy state and all checks should pass on the next CI run. The failed check suite was a temporary issue that has been resolved through the subsequent commits on the PR. No additional changes were needed - the fix was already implemented! π π» View my work β’ π Stop β’ π« Ban all checks β’ React π or π |
π― Summary
This PR integrates the official shadcn/ui InputGroup component to replace the custom "hacky" prefix/suffix implementation in the TextField component, as requested by @jakeruesink.
β¨ What Changed
Added
InputGroupcomponent (packages/components/src/ui/input-group.tsx)InputGroup- Main containerInputGroupAddon- Wrapper for prefix/suffix with alignment controlInputGroupText- For text prefix/suffixInputGroupInput- Input field for use within groupsInputGroupTextarea- Textarea field for use within groupsInputGroupButton- Button component for use within groupsModified
TextFieldto use InputGroup whenprefixorsuffixprops are providedFieldPrefixandFieldSuffixcomponents (kept for backward compatibility)packages/components/src/ui/index.tsπ Benefits
β Cleaner, more maintainable code - Uses official shadcn/ui patterns instead of custom solutions
β Better accessibility - Proper semantic structure with WAI-ARIA compliance
β More flexible - Supports
inline-start,inline-end,block-start,block-endalignmentβ No breaking changes - Existing TextField API and usage remain unchanged
β Future-proof - Aligns with shadcn/ui ecosystem and updates
π Implementation Details
Before (Custom Implementation)
After (shadcn/ui Pattern)
π§ͺ Testing
Example Usage (Unchanged)
π References
π Migration Notes
No action required! This is a non-breaking change. The existing TextField API continues to work exactly as before.
For developers who want to use advanced InputGroup features (buttons, tooltips, dropdowns, etc.), the new components are now available for direct use:
Requested by: Jake Ruesink
Related Audio: [Research discussion on shadcn/ui form updates]
π» View my work β’ About Codegen
β Remove Codegen from PR β’ π« Ban action checks