Skip to content

Commit 79d5eac

Browse files
committed
Refactor Textarea exports and update TextField display name
- Changed export of Textarea from remix-hook-form to TextareaField to resolve naming conflicts. - Updated display name of TextField component from RemixTextField to TextField for consistency. These changes enhance clarity in component naming and improve the overall structure of exports.
1 parent 9fb8bac commit 79d5eac

3 files changed

Lines changed: 2 additions & 32 deletions

File tree

.cursor/rules/storybook-testing.mdc

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ This is a monorepo containing form components with comprehensive Storybook inter
1717
- Yarn 4.7.0 with corepack
1818
- TypeScript throughout
1919

20-
<<<<<<< HEAD
21-
=======
2220
## Project Structure
2321
```
2422
lambda-curry/forms/
@@ -446,7 +444,6 @@ const testConditionalFields = async ({ canvas }: StoryContext) => {
446444
- **Focused Testing**: Each story should test one primary workflow
447445
- **Efficient Selectors**: Use semantic queries (role, label) over CSS selectors
448446

449-
>>>>>>> cd5d1a2 (Enhance Storybook testing rules and examples)
450447
### Local Development Workflow
451448
```bash
452449
# Local development commands
@@ -957,48 +954,28 @@ yarn dev # Then navigate to story and use Interactions panel
957954
## Verification Checklist
958955
When creating or modifying Storybook interaction tests, ensure:
959956

960-
<<<<<<< HEAD
961-
1. ✅ Story includes comprehensive play function with user interactions
962-
2. ✅ Uses semantic queries (ByRole, ByLabelText) over CSS selectors
963-
=======
964957
1. ✅ Story includes all three test phases (default, invalid, valid)
965958
2. ✅ Uses React Router stub decorator on individual stories (not meta)
966-
>>>>>>> cd5d1a2 (Enhance Storybook testing rules and examples)
967959
3. ✅ Follows click-before-clear pattern for inputs
968960
4. ✅ Uses findBy* for async assertions
969961
5. ✅ Tests both client-side and server-side validation
970962
6. ✅ Includes proper error handling and success scenarios
971-
<<<<<<< HEAD
972-
7. ✅ Uses step function for complex workflows
973-
8. ✅ Story serves as both documentation and test
974-
9. ✅ Component is properly isolated and focused
975-
10. ✅ Tests complete in reasonable time (< 10 seconds)
976-
11. ✅ Uses React Router stub decorator for form handling
977-
12. ✅ Includes accessibility considerations in queries
978-
=======
979963
7. ✅ Story serves as both documentation and test
980964
8. ✅ Component is properly isolated and focused
981965
9. ✅ Tests complete in reasonable time (< 10 seconds)
982966
10. ✅ Uses semantic queries for better maintainability
983967
11. ✅ Decorators are placed on individual stories for granular control
984968
12. ✅ Meta configuration is kept clean and minimal
985-
>>>>>>> cd5d1a2 (Enhance Storybook testing rules and examples)
986969

987970
## Team Workflow Integration
988971

989972
### Code Review Guidelines
990973
- Verify interaction tests cover happy path and error scenarios
991974
- Ensure stories are self-documenting and demonstrate component usage
992-
<<<<<<< HEAD
993-
- Check that tests follow semantic query patterns
994-
- Validate that play functions are well-organized with step grouping
995-
- Confirm tests don't introduce flaky behavior
996-
=======
997975
- Check that tests follow established patterns and conventions
998976
- Validate that new tests don't introduce flaky behavior
999977
- **Verify decorators are on individual stories, not in meta**
1000978
- Ensure each story has appropriate isolation and dependencies
1001-
>>>>>>> cd5d1a2 (Enhance Storybook testing rules and examples)
1002979

1003980
### Local Development Focus
1004981
- Use Storybook UI for interactive development and debugging
@@ -1008,8 +985,4 @@ When creating or modifying Storybook interaction tests, ensure:
1008985
- Fast feedback loop optimized for developer productivity
1009986
- Individual story decorators provide flexibility for different testing scenarios
1010987

1011-
<<<<<<< HEAD
1012-
Remember: Every story with a play function is both a test and living documentation. Focus on user behavior and accessibility. Use the step function to organize complex interactions. The Interactions panel in Storybook UI is your primary debugging tool for interaction tests.
1013-
=======
1014988
Remember: Every story should test real user workflows and serve as living documentation. Focus on behavior, not implementation details. The testing infrastructure should be reliable, fast, and easy to maintain for local development and Codegen workflows. **Always place decorators on individual stories for maximum flexibility and clarity.**
1015-
>>>>>>> cd5d1a2 (Enhance Storybook testing rules and examples)

packages/components/src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@ export * from './remix-hook-form';
55

66
// Explicitly export Textarea from both locations to handle naming conflicts
77
// The remix-hook-form Textarea is a form-aware wrapper
8-
export { Textarea as RemixTextarea } from './remix-hook-form/textarea';
9-
10-
// The ui Textarea is the base component
11-
export { Textarea } from './ui/textarea';
8+
export { Textarea as TextareaField } from './remix-hook-form/textarea';

packages/components/src/remix-hook-form/text-field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ export const TextField = function RemixTextField(props: TextFieldProps & { ref?:
2525
return <BaseTextField control={control} components={components} {...props} />;
2626
};
2727

28-
TextField.displayName = 'RemixTextField';
28+
TextField.displayName = 'TextField';

0 commit comments

Comments
 (0)