diff --git a/components/input/Input.jsx b/components/input/Input.jsx index 46c18005..23832ce6 100644 --- a/components/input/Input.jsx +++ b/components/input/Input.jsx @@ -46,7 +46,8 @@ class Input extends React.Component { render () { const { children, disabled, error, floating, icon, - label: labelText, maxLength, multiline, type, value, ...others} = this.props; + label: labelText, maxLength, multiline, required, + type, value, ...others} = this.props; const length = maxLength && value ? value.length : 0; const labelClassName = ClassNames(style.label, {[style.fixed]: !floating}); @@ -76,7 +77,11 @@ class Input extends React.Component { {InputElement} {icon ? : null} - {labelText ? : null} + {labelText ? + : null} {error ? {error} : null} {maxLength ? {length}/{maxLength} : null} {children} diff --git a/components/input/_config.scss b/components/input/_config.scss index e3d9fb92..2061d772 100644 --- a/components/input/_config.scss +++ b/components/input/_config.scss @@ -10,7 +10,8 @@ $input-text-bottom-border-color: rgba($color-black, 0.12) !default; $input-text-highlight-color: $color-primary !default; $input-text-disabled-color: $input-text-bottom-border-color !default; $input-text-disabled-text-color: $input-text-label-color !default; -$input-text-error-color: rgb(222, 50, 38) !default; +$input-text-error-color: rgb(222, 230, 38) !default; +$input-text-required-color: rgb(222, 50, 38) !default; $input-underline-height: 2 * $unit; $input-icon-font-size: 2.4 * $unit; $input-icon-size: 2 * $input-icon-font-size; diff --git a/components/input/style.scss b/components/input/style.scss index f77b5896..623e0601 100644 --- a/components/input/style.scss +++ b/components/input/style.scss @@ -40,6 +40,9 @@ ~ .label:not(.fixed) { color: $input-text-highlight-color; } + ~ .label > .required { + color: $input-text-required-color; + } ~ .icon { color: $input-text-highlight-color; } @@ -125,6 +128,9 @@ > .counter, > .label { color: $input-text-error-color; } + > .label > .required { + color: $input-text-required-color; + } } .hidden { diff --git a/spec/components/input.jsx b/spec/components/input.jsx index 5c031598..a6e26ca0 100644 --- a/spec/components/input.jsx +++ b/spec/components/input.jsx @@ -21,13 +21,13 @@ class InputTest extends React.Component { - + P} /> );