Skip to content
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

Checkbox error state HLD update #2467

Merged
merged 3 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Update checkbox error state HLD to move plan to update clickable region of the control to future work",
"packageName": "@ni/nimble-components",
"email": "[email protected]",
"dependentChangeType": "none"
}
18 changes: 7 additions & 11 deletions packages/nimble-components/src/checkbox/specs/error-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ At a high-level, the design of the component will be:
- The `title` of the text is the full error string
- Red error icon (`nimble-icon-exclamation-mark`) on the right side of the label with a 4px margin between the icon and the right edge of the control
- Control indicator (checkbox square) and error icon will both be center-aligned with the first line of label text, both when the label text wraps and when it fits on a single line.
- Control indicator and label will both be interactable -- hovering over them will put the component in the "mouseover" state and clicking them will activate the control
- The error icon along with the space between the label and the error icon will not be interactable

Below are some examples of how the checkbox will look and behave with different configurations. The blue outline shows the bounds of the control, and the blue background indicates the interactable regions of the control.
Below are some examples of how the checkbox will look with an error.

![](spec-images/checkbox-no_error,no_wrap.PNG)
![](spec-images/checkbox-with-error.PNG)

![](spec-images/checkbox-no_error,wrap.PNG)

![](spec-images/checkbox-error,no_wrap.PNG)

![](spec-images/checkbox-error,wrap.PNG)

![](spec-images/checkbox-long_error.PNG)
![](spec-images/checkbox-with-long-error.PNG)

### API

Expand Down Expand Up @@ -66,6 +58,10 @@ The styling changes include (but may not be limited to):
- Verifying the label wraps when the label is longer than the allocated space for the control
- Ensuring the checked/selected indicator is center aligned with the first line of text

### Future Work

There are additional changes that should be made to the `nimble-checkbox` to align it with the design spec. Specifically, only the control indicator and the label should be interactable. Any other space within the `nimble-checkbox` should not be interactable, such as any whitespace to the right of the label or between the label and the error icon. This change however, has both unit test implications (because unit tests today simply call `click()` on the `nimble-checkbox` element) and ARIA implications (because the element with a role of `checkbox` should be clickable). Therefore, it is being considered out of scope for the error state feature.

## Open Issues

_None_
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.