Skip to content

Commit

Permalink
feat: added disabled mode to label
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikeofic committed Aug 21, 2023
1 parent 991c7ea commit 5e4b992
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/components/form/elements/form-control-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class FormControlLabel extends Component {
static propTypes = {
label: PropTypes.string,
labelHighLight: PropTypes.bool,
disabled: PropTypes.bool,
placeholder: PropTypes.string,
activeLabel: PropTypes.bool,
onBlur: PropTypes.func,
Expand Down Expand Up @@ -93,6 +94,7 @@ class FormControlLabel extends Component {
iconLeft,
iconLeftClick,
context,
disabled,
...rest
} = this.props;

Expand All @@ -111,6 +113,7 @@ class FormControlLabel extends Component {
[styles.isAutofilled]: this.state.isAutofilled,
[styles[`has-${validationState}`]]: validationState,
[styles.isOutline]: this.props.outline,
[styles.disabled]: disabled,
});

const inputClasses = classNames(styles.formControl, {
Expand Down Expand Up @@ -148,6 +151,7 @@ class FormControlLabel extends Component {
onHover={this.onHoverLabel}
onBlur={this.onBlurLabel}
checkIsAutofilled={this.checkIsAutofilled}
disabled={disabled}
/>
{typeof iconRight === 'string'
? <Icon className={iconRightClasses} name={iconRight} size={18} onClick={iconRightClick} />
Expand Down
5 changes: 5 additions & 0 deletions source/components/form/elements/form-control-label.styl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ $c-label = #00A0b2;
$c-label-active = #878786;
$c-text-default = #333;
$c-border-input = #60605f;
$c-disabled = #c7c7c7;

/* ==========================================================================
Form Label Component
Expand Down Expand Up @@ -64,6 +65,10 @@ Form Label Component
}
}

.disabled {
color: $c-disabled;
}

.iconRight, .iconLeft {
pointer-events: none;
position: absolute;
Expand Down

0 comments on commit 5e4b992

Please sign in to comment.