Skip to content

Commit

Permalink
Merge pull request #33 from flowforge/textinput-error-docs
Browse files Browse the repository at this point in the history
Add error example to docs
  • Loading branch information
joepavitt authored Jul 29, 2022
2 parents babc4bf + 7382fd6 commit d91873e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
5 changes: 5 additions & 0 deletions docs/DesignLanguage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@
{{ models.textInput0 }}
<code>{{ groups['input'].components[0].examples[0].code }}</code>
</div>
<div class="example">
<h5>Error State</h5>
<ff-text-input placeholder="Insert something here..." v-model="models.textInput1" :error="'This is the error'"/>
<code>{{ groups['input'].components[0].examples[3].code }}</code>
</div>
<div class="example">
<h5>Type: Password</h5>
<ff-text-input type="password" placeholder="Password goes here..."/>
Expand Down
10 changes: 8 additions & 2 deletions docs/data/input.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"code": "<ff-text-input type\"email\" v-model=\"myEmail\" />"
}, {
"code": "<ff-text-input type\"email\" v-model=\"myEmail\">\n\t<template v-slot:icon><SearchIcon/></template>\n</ff-text-input>"
}, {
"code": "<ff-text-input type\"email\" v-model=\"myEmail\" :error=\"'This is the error.'\"></ff-text-input>"
}],
"props": [{
"key": "disabled",
Expand All @@ -21,9 +23,13 @@
"default": "null",
"description": "Informative text to assist the user with the information required in this input field."
}, {
"key": "password",
"key": "type",
"default": "'button'",
"description": "Any standard HTML button 'type'"
}, {
"key": "error",
"default": "false",
"description": "Hide the content of this text input as a password field."
"description": "Anything other than null/undefined will result in the error state being visualised. Error message can be displayed manually with a <label class=\"ff-error-inline\">"
}],
"slots": [{
"name": "icon",
Expand Down
8 changes: 6 additions & 2 deletions src/stylesheets/ff-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ li.ff-list-item {
display: flex;
gap: 0px;
align-items: center;
background-color: $ff-white;
border-color: $ff-grey-300;
svg {
width: 20px;
height: 20px;
Expand All @@ -216,7 +218,7 @@ li.ff-list-item {
input {
flex-grow: 1;
padding: $ff-unit-sm $ff-unit-md;
border-radius: $ff-unit-xs;
border-radius: $ff-unit-sm;
background: none;
height: 100%;
border-width: 0;
Expand All @@ -238,7 +240,9 @@ li.ff-list-item {

.ff-input--error {
&.ff-text-input {
border-color: $ff-red-300;
border-color: $ff-red-500;
border-width: 2px;
outline: none;
}
}

Expand Down
8 changes: 0 additions & 8 deletions src/stylesheets/ff-theme-light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,4 @@
color: $ff-grey-300;
}
}

.ff-input.ff-text-input {
background-color: $ff-white;
border-color: $ff-grey-300;
&:focus-within {
border-color: $ff-blue-600;
}
}
}

0 comments on commit d91873e

Please sign in to comment.