-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat!: Refactor TextInput for better accessibility #69
feat!: Refactor TextInput for better accessibility #69
Conversation
- dropped the prop "fullWidth" -> it's now ON all the time - dropped the prop "kind" -> it's now "dark" all the time
WalkthroughThe updates across various files reflect a refactoring and enhancement of a UI component library, specifically targeting the Changes
TipsChat with CodeRabbit Bot (
|
BundleMonFiles updated (1)
Unchanged files (2)
Total files change +61B +0.66% Final result: ✅ View report in BundleMon website ➡️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (7)
- packages/documentation/src/stories/TextInput.stories.tsx (3 hunks)
- packages/ui-components/lib/tokens.ts (2 hunks)
- packages/ui-components/src/components/TextInput/TextInput.tsx (2 hunks)
- packages/ui-components/src/components/TextInput/TextInputTypes.d.ts (1 hunks)
- packages/ui-components/src/components/TextInput/tests/TextInput.test.tsx (2 hunks)
- packages/ui-components/src/components/TextInput/utilities.ts (1 hunks)
- packages/ui-components/src/components/index.css (2 hunks)
Files skipped from review due to trivial changes (1)
- packages/ui-components/src/components/index.css
Additional comments: 16
packages/ui-components/src/components/TextInput/TextInput.tsx (2)
10-15: The default values for
focusKind
,borderKind
, anderrorKind
have been set to "light", "dark", and "light" respectively. Verify that these defaults align with the intended design and theming after the removal of thekind
prop and that they are consistent with the rest of the application's design system.30-38: The
getTextInputClasses
function is being called with the new prop namesfocusKind
,borderKind
, anderrorKind
. Ensure that thegetTextInputClasses
function has been updated to handle these new argument names correctly and that it no longer expects afullWidth
argument.packages/documentation/src/stories/TextInput.stories.tsx (3)
13-20: The
args
object has been updated to reflect the new prop namesfocusKind
,borderKind
, anderrorKind
. However, ensure that all instances whereTextInput
is used throughout the project are updated to use these new prop names.34-51: The
argTypes
object has been correctly updated to match the new prop names and provide the appropriate controls for Storybook. This will allow users to interact with the new props in the Storybook UI.58-69: The addition of a wrapping
div
element in theBasic
story provides a structured layout for theTextInput
component. This change enhances the visual presentation in Storybook and does not affect the functionality of the component.packages/ui-components/src/components/TextInput/__tests__/TextInput.test.tsx (2)
30-34:
The test correctly checks for the updated error message class name following the theme change from dark to light.86-92:
The test correctly checks for the updated error message class name and ARIA attributes, ensuring the component remains accessible after the refactor.packages/ui-components/lib/tokens.ts (2)
1-4: The introduction of
errorColorLight
is consistent with the pull request's goal of enhancing accessibility and theming. However, ensure that all references to the olderrorColorDark
or any other dark-themed error colors are updated across the entire codebase to useerrorColorLight
where appropriate.29-48: The renaming of color tokens to include
-light
and-dark
suffixes is a good practice for clarity and maintainability. However, it's important to verify that all references to these tokens in the codebase have been updated to reflect the new naming convention.packages/ui-components/src/components/TextInput/TextInputTypes.d.ts (1)
- 4-12:
The changes to theTextInputProps
type are consistent with the pull request summary and reflect the new API design. Ensure that all instances whereTextInput
is used are updated to use the new prop names and that the removal of thefullWidth
prop is accounted for in the styling.packages/ui-components/src/components/TextInput/utilities.ts (6)
10-19:
The interface has been correctly updated to match the new API changes. Ensure that all usages of this interface are updated accordingly.34-48:
The function has been updated to use the newfocusKind
anderrorKind
properties correctly.51-65:
The function has been updated to use the newnoBorder
,error
,borderKind
, anderrorKind
properties correctly.68-85:
The function has been updated to use the newdisabled
,raw
,error
, anderrorKind
properties correctly.88-102:
The function has been updated to use the newerror
,raw
, anderrorKind
properties correctly.105-147:
The function has been refactored to use the new parameters and the removal of thefullWidth
prop has been accounted for. Ensure that all usages of this function are updated to pass the correct parameters.
Summary by CodeRabbit
Documentation
TextInput
component documentation to reflect new property names and usage.New Features
Refactor
TextInput
component for clarity:kind
tofocusKind
,focus
toborderKind
, andborder
toerrorKind
.fullWidth
property fromTextInput
to streamline component options.Style
Tests
TextInput
component tests.