Add disabled states for form control components

[MAILPOET-2773]
This commit is contained in:
Ján Mikláš
2020-05-22 11:47:07 +02:00
committed by Veljko V
parent 61dd1c61de
commit 7517baeea8
11 changed files with 15 additions and 8 deletions

View File

@@ -128,12 +128,6 @@
}
}
.mailpoet-button-disabled {
opacity: .4;
pointer-events: none;
touch-action: none;
}
.mailpoet-button-with-spinner {
pointer-events: none;
touch-action: none;

View File

@@ -6,3 +6,9 @@
display: block;
height: $grid-gap;
}
.mailpoet-disabled {
opacity: .5;
pointer-events: none;
touch-action: none;
}

View File

@@ -36,7 +36,7 @@
@import 'generic/forms-toggle';
@import 'generic/forms-yesno';
@import 'generic/grid';
@import 'generic/helpers';
@import 'generic/helpers'; // must be the last
// Components
// Actual UI components.

View File

@@ -35,8 +35,8 @@ const Button = ({
{
[`mailpoet-button-${dimension}`]: dimension,
[`mailpoet-button-${variant}`]: variant,
'mailpoet-button-disabled': isDisabled,
'mailpoet-button-with-spinner': withSpinner,
'mailpoet-disabled': isDisabled,
'mailpoet-full-width': isFullWidth,
}
)

View File

@@ -17,6 +17,7 @@ const Checkbox = ({
className={
classnames({
'mailpoet-form-checkbox': true,
'mailpoet-disabled': attributes.disabled,
'mailpoet-full-width': isFullWidth,
})
}

View File

@@ -21,6 +21,7 @@ const Input = ({
'mailpoet-form-input',
{
[`mailpoet-form-input-${dimension}`]: dimension,
'mailpoet-disabled': attributes.disabled,
'mailpoet-full-width': isFullWidth,
}
)

View File

@@ -17,6 +17,7 @@ const Radio = ({
className={
classnames({
'mailpoet-form-radio': true,
'mailpoet-disabled': attributes.disabled,
'mailpoet-full-width': isFullWidth,
})
}

View File

@@ -69,6 +69,7 @@ const ReactSelect = ({
'mailpoet-form-select',
{
[`mailpoet-form-input-${dimension}`]: dimension,
'mailpoet-disabled': props.disabled,
'mailpoet-full-width': isFullWidth,
}
)

View File

@@ -22,6 +22,7 @@ const Select = ({
'mailpoet-form-select',
{
[`mailpoet-form-input-${dimension}`]: dimension,
'mailpoet-disabled': attributes.disabled,
'mailpoet-full-width': isFullWidth,
}
)

View File

@@ -16,6 +16,7 @@ const Toggle = ({
classnames({
'mailpoet-form-toggle': true,
[`mailpoet-form-toggle-${dimension}`]: dimension,
'mailpoet-disabled': attributes.disabled,
})
}
>

View File

@@ -17,6 +17,7 @@ const YesNo = ({
classnames({
'mailpoet-form-yesno': true,
'mailpoet-form-yesno-error': showError,
'mailpoet-disabled': attributes.disabled,
})
}
>