Skip to content

Commit

Permalink
refactor(radio): show invalid state (#146)
Browse files Browse the repository at this point in the history
* refactor: added invalid state demo

and beautified HTML code

* chore: reordered
  • Loading branch information
mfranzke authored Nov 4, 2022
1 parent adf24c7 commit f35721e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion source/_patterns/01-elements/radio/radio.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
<input type="radio" class="elm-radio {{ styleModifier }}"{{#if name}} name="{{ name }}"{{/if }} id="{{ id }}"{{#if checked}} checked{{/if }}{{#if disabled}} disabled{{/if }} value="{{ value }}"{{#if describedbyid }} aria-describedby="{{ describedbyid }}"{{/if }}>
<input type="radio"
class="elm-radio {{ styleModifier }}"{{#if name}} name="{{ name }}"{{/if }}
id="{{ id }}"
{{#if checked}} checked{{/if }}
{{#if disabled}} disabled{{/if }}
value="{{ value }}"
{{#if describedbyid }} aria-describedby="{{ describedbyid }}"{{/if }}
{{#if invalid}}aria-invalid="true"{{/if }}>
<label class="elm-label" for="{{ id }}">{{ label }}</label>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "radio06",
"id": "radio04",
"checked": true,
"disabled": true
}
2 changes: 1 addition & 1 deletion source/_patterns/01-elements/radio/radio~disabled.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"id": "radio05",
"id": "radio03",
"disabled": true
}
4 changes: 4 additions & 0 deletions source/_patterns/01-elements/radio/radio~invalid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"id": "radio05",
"invalid": true
}

0 comments on commit f35721e

Please sign in to comment.