feat(form-field): normalize stories and helpers#11
Conversation
There was a problem hiding this comment.
Pull request overview
This PR normalizes Storybook stories and helper code across form-field components, implementing consistent code style and structure. The changes include:
- Converting from double quotes to single quotes and removing semicolons
- Updating import statements to use type imports where appropriate
- Migrating from
@storybook/reactto@storybook/react-vite - Restructuring stories to use centralized
argsandargTypes - Adding new test files for several components
- Extracting multi-combobox story logic into reusable helper functions
Reviewed changes
Copilot reviewed 59 out of 59 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| textarea/textarea.tsx | Formatting update (quotes, semicolons, type imports) |
| textarea/textarea.stories.tsx | Added args/argTypes, Storybook vite migration, useEffect for controlled input |
| text-input/text-input.tsx | Formatting update, React type imports standardization |
| text-input/text-input.test.tsx | New test file covering basic input functionality |
| text-input/text-input.stories.tsx | Added args/argTypes, Storybook vite migration |
| single-combobox/*.tsx | Formatting updates + API change (null handling) |
| single-combobox/single-combobox.stories.tsx | Added args/argTypes, placeholder prop support |
| search-input/*.tsx | Formatting updates, type imports |
| search-input/*.stories.tsx | Added args/argTypes, useEffect, Storybook vite migration |
| radio-input/*.tsx | Formatting updates |
| radio-input/radio-input.stories.tsx | Added comprehensive args/argTypes with useEffect |
| radio-box/*.tsx | Formatting updates |
| radio-box/radio-box.stories.tsx | Added args/argTypes for customizable story controls |
| number-input/number-input.tsx | Formatting updates, type imports |
| multi-combobox/*.tsx | Formatting updates |
| multi-combobox/multi-combobox.story-helpers.tsx | New file extracting reusable story components |
| multi-combobox/*.stories.tsx | Refactored into multiple story files using helpers |
| listbox/*.tsx | Formatting updates, type imports |
| listbox/*.stories.tsx | Added args/argTypes, improved story flexibility |
| form-field*.tsx | Formatting updates, type imports |
| form-field-group.test.tsx | New test file for form field groups |
| form-field-group.stories.tsx | Added args/argTypes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| value?: TValue | null | ||
| onChange: (value: TValue | null) => void |
There was a problem hiding this comment.
The type definition for value and onChange has been changed to include null in the union type (TValue | null). This is a breaking change to the API. Previously, the value could be TValue or undefined, but now it explicitly includes null. This could affect existing code that doesn't handle null values or relies on undefined behavior.
| @@ -1,18 +1,22 @@ | |||
| import React from "react"; | |||
| import type { ElementType } from 'react' | |||
| import { ReactNode } from 'react' | |||
There was a problem hiding this comment.
The imports from React are inconsistent. Line 1 uses a type import for ElementType, while line 2 uses a regular import for ReactNode. Both should be type imports since they're only used for type annotations. The second import should be: import type { ReactNode } from 'react'
| import { ReactNode } from 'react' | |
| import type { ReactNode } from 'react' |
Overview
feat(form-field): normalize stories and helpers
Changes