-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Pull Request ## π€¨ Rationale Includes `nimble-component` implementation for #2019 ## π©βπ» Implementation - Adds `error-visible` and `error-text` attributes to the `nimble-radio-group` - Updates the radio group template to include an error icon and error text - Note: This required forking FAST's template - Updated radio group styling to match visual design ## π§ͺ Testing - Manually tested in storybook - Forked FAST's radio group tests since the template was forked - Updated matrix tests ## β Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [ ] I have updated the project documentation to reflect my changes or determined no changes are needed.
- Loading branch information
1 parent
52a5408
commit 8aa7c1e
Showing
8 changed files
with
612 additions
and
9 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@ni-nimble-components-e5bfd621-8ece-4d9c-a6ea-eb128a70e8ac.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Implement error states on nimble-radio-group", | ||
"packageName": "@ni/nimble-components", | ||
"email": "20542556+mollykreis@users.noreply.github.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { elements, html, slotted } from '@microsoft/fast-element'; | ||
import { Orientation } from '@microsoft/fast-web-utilities'; | ||
import type { RadioGroup } from '.'; | ||
import { errorTextTemplate } from '../patterns/error/template'; | ||
import { iconExclamationMarkTag } from '../icons/exclamation-mark'; | ||
|
||
/* eslint-disable @typescript-eslint/indent */ | ||
export const template = html<RadioGroup>` | ||
<template | ||
role="radiogroup" | ||
aria-disabled="${x => x.disabled}" | ||
aria-readonly="${x => x.readOnly}" | ||
@click="${(x, c) => x.clickHandler(c.event as MouseEvent)}" | ||
@keydown="${(x, c) => x.keydownHandler(c.event as KeyboardEvent)}" | ||
@focusout="${(x, c) => x.focusOutHandler(c.event as FocusEvent)}" | ||
> | ||
<div class="label-container"> | ||
<slot name="label"></slot> | ||
<${iconExclamationMarkTag} | ||
severity="error" | ||
class="error-icon" | ||
></${iconExclamationMarkTag}> | ||
</div> | ||
<div | ||
class="positioning-region ${x => (x.orientation === Orientation.horizontal ? 'horizontal' : 'vertical')}" | ||
part="positioning-region" | ||
> | ||
<slot | ||
${slotted({ | ||
property: 'slottedRadioButtons', | ||
filter: elements('[role=radio]') | ||
})} | ||
></slot> | ||
${errorTextTemplate} | ||
</div> | ||
</template> | ||
`; |
Oops, something went wrong.