-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add required support for labels (#87)
for required text-field and selects, the label will automatically get an asterik *
- Loading branch information
1 parent
ff1fd85
commit 70675de
Showing
14 changed files
with
169 additions
and
3 deletions.
There are no files selected for viewing
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,25 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[{package,bower}.json] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[{.eslintrc,.scss-lint.yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.{scss,sass}] | ||
indent_style = space | ||
indent_size = 2 |
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
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
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 |
---|---|---|
|
@@ -42,6 +42,23 @@ storiesOf('Text Field', module) | |
</label> | ||
</div> | ||
)) | ||
.add('Text field, required', () => { | ||
setTimeout(initTextField); | ||
return ( | ||
<div className="ray-text-field ray-text-field--active"> | ||
<input | ||
className="ray-text-field__input" | ||
id="email" | ||
type="email" | ||
placeholder="[email protected]" | ||
required | ||
/> | ||
<label className="ray-text-field__label" htmlFor="email"> | ||
Email address | ||
</label> | ||
</div> | ||
); | ||
}) | ||
.add('Text field, textarea', () => { | ||
setTimeout(initTextArea); | ||
|
||
|
@@ -58,6 +75,23 @@ storiesOf('Text Field', module) | |
</div> | ||
); | ||
}) | ||
.add('Text field, textarea - required', () => { | ||
setTimeout(initTextArea); | ||
|
||
return ( | ||
<div className="ray-text-area"> | ||
<textarea | ||
className="ray-text-area__input" | ||
id="textarea" | ||
placeholder="Few people are aware..." | ||
required | ||
/> | ||
<label className="ray-text-area__label" htmlFor="textarea"> | ||
Fun fact about Ray Eames | ||
</label> | ||
</div> | ||
); | ||
}) | ||
.add('Text field, multi-row textarea', () => { | ||
setTimeout(initTextArea); | ||
|
||
|
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
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 |
---|---|---|
|
@@ -19,6 +19,23 @@ export function textFieldFixture() { | |
`; | ||
} | ||
|
||
export function textFieldFixtureRequired() { | ||
return html` | ||
<div class="${baseClass}"> | ||
<input | ||
class="${baseClass}__input" | ||
id="email" | ||
type="email" | ||
placeholder="[email protected]" | ||
required | ||
/> | ||
<label class="${baseClass}__label" for="email"> | ||
Email address | ||
</label> | ||
</div> | ||
`; | ||
} | ||
|
||
export function textFieldFixtureNoInput() { | ||
return html` | ||
<div class="${baseClass}"> | ||
|