Invalid state for checkbox and radio#299
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #299 +/- ##
==========================================
+ Coverage 91.96% 92.02% +0.06%
==========================================
Files 203 203
Lines 8411 8426 +15
Branches 1251 1254 +3
==========================================
+ Hits 7735 7754 +19
+ Misses 673 669 -4
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
svenvandescheur
left a comment
There was a problem hiding this comment.
Making this explicit in form fields seems sensible to me. A few remarks though:
- Currenlty, formcontrol.scss does some higher lever trickery to set the red border. Do we we want to remove that in favor of this implementation?
- I don't think this is implemented consistently with other form components (Select, Textarea).
540f1da to
15b2065
Compare
|
I've removed the formcontrol invalid styling in favor of the input specific styling. I've added design tokens for invalid input, select and textarea (along the previously added invalid design tokens for checkbox and radio). With that, i've removed the Each form component now explicitly has a In storybook, each form element has a |
As the formcontrol-danger token was used for input components, it makes more sense to have a `input-danger` token. To keep it consistent with the other "form input error state design tokens", it uses the modifier 'invalid'. Also added design tokens for invalid select and textarea fields.
Added `invalid` property to Input, Checkboxgroup, Radiogroup, Choicefield, DatePicker, DateRangeInput, Select, Textarea, DateInput and Duration form components. The `invalid` property is assigned to the html `aria-invalid` property, added aria context to the form component.
Added invalid styling for radio, checkbox, input, select en textarea components. Because the invalid styling is now applied at a form field level, the invalid styling on the formcontrol has been removed. Realistically, an invalid radio or checkbox should be empty. But to ensure correct working and color contrasts in all scenarios, the styling also covers "filled in" states.
15b2065 to
14086e7
Compare
Closes #298
Adding invalid state and styling to checkbox and radio inputs.
Design for checkbox: https://www.figma.com/design/gWXiUgpX9qeYz95LZlERe7/AdminUI-DS?node-id=3775-2068&p=f&m=dev
Design for radio: https://www.figma.com/design/gWXiUgpX9qeYz95LZlERe7/AdminUI-DS?node-id=3775-2185&p=f&m=dev