feat(component): add Radio component#2933
Conversation
✅ Deploy Preview for boosted ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
2a44495 to
7f9cdad
Compare
|
|
||
| `.control-item-assets-container` are containers controlling the position of the `.control-item-indicator` and the optional icon. | ||
|
|
||
| `.control-item-label` extend their clickable area until a `.control-item`, `.checkbox-standalone`, `.radio-button-standalone` or a `position: relative;` is found in the page hierarchy. It permits to have a more consistent approach, whatever the DOM is. Nonetheless, it means that none of the elements next to the label should be interactive. |
There was a problem hiding this comment.
I missed it on the checkbox review, but the .control-item does not exist on its own.
|
|
||
| #### Radio button | ||
|
|
||
| - <span class="badge text-bg-status-positive-emphasized">New</span> `.radio-button-item`, `.radio-button-standalone`, `.radio-button-additional-label`, `.radio-button-item-outlined` have been added. |
There was a problem hiding this comment.
In the checkbox part we are listing all control-item classes. Maybe we should move this list to the Checks & radios section since it is used in both components.
scss/forms/_control-item.scss
Outdated
| } | ||
|
|
||
| .radio-button-additional-label { | ||
| display: block; |
There was a problem hiding this comment.
it is a flex item, this display should be useful.
|
|
||
| ## Approach | ||
|
|
||
| Browser default radio buttons are replaced with the help of `.control-item`. Radio buttons allows user to select a single option from a set of mutually exclusive choices. |
There was a problem hiding this comment.
.control-item class does not exist :)
|
|
||
| ### Outlined | ||
|
|
||
| You can display an outlined radio buttons by adding a `.radio-button-item-outlined` to `.control-item`. If there is an outlined radio button item in a group, all its siblings should also be outlined. |
There was a problem hiding this comment.
| You can display an outlined radio buttons by adding a `.radio-button-item-outlined` to `.control-item`. If there is an outlined radio button item in a group, all its siblings should also be outlined. | |
| You can display an outlined radio buttons by adding a `.radio-button-item-outlined` to `.radio-button-item`. If there is an outlined radio button item in a group, all its siblings should also be outlined. |
|
|
||
| ### Divider | ||
|
|
||
| You can display a divider by adding `.control-item-divider` to a `.control-item`. |
There was a problem hiding this comment.
| You can display a divider by adding `.control-item-divider` to a `.control-item`. | |
| You can display a divider by adding `.control-item-divider` to a `.radio-button-item`. |
|
|
||
| ### Icon | ||
|
|
||
| You can display an icon by adding `.control-item-assets-container` with an icon (SVG or font-icon most likely) inside as a child of a `.control-item`. |
There was a problem hiding this comment.
| You can display an icon by adding `.control-item-assets-container` with an icon (SVG or font-icon most likely) inside as a child of a `.control-item`. | |
| You can display an icon by adding `.control-item-assets-container` with an icon (SVG or font-icon most likely) inside as a child of a `.radio-button-item`. |
|
|
||
| ### Reverse | ||
|
|
||
| You can reverse the component by adding `.control-item-reverse` to a `.control-item`. |
There was a problem hiding this comment.
| You can reverse the component by adding `.control-item-reverse` to a `.control-item`. | |
| You can reverse the component by adding `.control-item-reverse` to a `.radio-button-item`. |
|
|
||
| ### Invalid | ||
|
|
||
| You can display an invalid radio button by adding `.is-invalid` to a `.control-item-indicator`. <!-- Please take a look at our [Validation]({{< docsref "/forms/validation" >}}) page to know more about this. --> |
There was a problem hiding this comment.
The link can be uncommented since we have the page now.
| You can display an invalid radio button by adding `.is-invalid` to a `.control-item-indicator`. <!-- Please take a look at our [Validation]({{< docsref "/forms/validation" >}}) page to know more about this. --> | |
| You can display an invalid radio button by adding `.is-invalid` to a `.control-item-indicator`. Please take a look at our [Validation]({{< docsref "/forms/validation" >}}) page to know more about this. |
There was a problem hiding this comment.
Ok, porting this to Checkbox too
Note: Please transform
- [ ]into- (NA)in the description when things are not applicableRelated issues
closes #2892
Types of change
Live previews
Checklist
Contribution
Accessibility
Design
Development
Documentation
Checklist (for Core Team only)
After the merge