-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add error state to nimble-checkbox #2478
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
:host(.checked:not(.indeterminate)) slot[name='checked-indicator'] { | ||
display: contents; | ||
} | ||
|
||
slot[name='checked-indicator'] svg { |
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.
This isn't a required change as part of this PR, but I noticed that slot[name='checked-indicator'] svg
was listed twice in the styles, so I combined them.
@msmithNI, will you buddy this PR for me? |
@@ -0,0 +1,7 @@ | |||
{ | |||
"type": "minor", |
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.
Am I correct that the styling changes will impact clients by adding additional space around their checkboxes? For example, in the example app it looks like the checkbox has some extra space on all sides so no longer left aligns with the label above it.
https://60e89457a987cf003efc0a5b-ndvckxqkhv.chromatic.com/example-client-app/#/customapp
https://nimble.ni.dev/storybook/example-client-app/#/customapp
Is that an intentional design change? If so then I think we should:
- mention it in the change file comment
- spot check a few SLE apps to ensure it looks ok (I think Fred has complained that a lot of slide outs already have bad checkbox layouts so maybe this is a low bar)
I don't think it merits being marked as a breaking change or doing additional notifications on Teams, but we could consider those too if it seems disruptive.
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.
That padding inside the control bounds doesn't seem right. All our other controls are flush to the bounds of the control
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.
The padding is coming from the visual design specs. Perhaps we need to have a discussion with Brandon if we don't agree with the design.
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.
I think either way I'd vote to split it out into a separate PR and not make the change here. If we do end up wanting it, I'd argue implementation-wise for the checkbox (which is a standalone control) that the padding / margin would be responsibility of the thing that is laying it out.
The padding is for a grouped, labelled set of checkboxes, not for every possible composition of a checkbox. We'd have a separate PR to capture the layout guidance in storybook docs or create something like a checkbox-group to help layout and we would also want to update radio button group at the same time.
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.
I'll pull that change out of this PR.
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.
The left padding has now been removed from the checkbox. The square control is back to being flush with the left edge of the nimble-checkbox
.
Pull Request
π€¨ Rationale
This is part of #2018 and also resolves #2091
π©βπ» Implementation
The
nimble-checkbox
now implementsErrorPattern
to adderror-text
anderror-visible
to its API.The bulk of the implementation is updating the template and styles of the checkbox. These changes include:
controlHeight
(see nimble-checkbox has incorrect heightΒ #2091)π§ͺ Testing
β Checklist