Add disabled states for form control components
[MAILPOET-2773]
This commit is contained in:
@@ -128,12 +128,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mailpoet-button-disabled {
|
|
||||||
opacity: .4;
|
|
||||||
pointer-events: none;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mailpoet-button-with-spinner {
|
.mailpoet-button-with-spinner {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
touch-action: none;
|
touch-action: none;
|
||||||
|
@@ -6,3 +6,9 @@
|
|||||||
display: block;
|
display: block;
|
||||||
height: $grid-gap;
|
height: $grid-gap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mailpoet-disabled {
|
||||||
|
opacity: .5;
|
||||||
|
pointer-events: none;
|
||||||
|
touch-action: none;
|
||||||
|
}
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
@import 'generic/forms-toggle';
|
@import 'generic/forms-toggle';
|
||||||
@import 'generic/forms-yesno';
|
@import 'generic/forms-yesno';
|
||||||
@import 'generic/grid';
|
@import 'generic/grid';
|
||||||
@import 'generic/helpers';
|
@import 'generic/helpers'; // must be the last
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
// Actual UI components.
|
// Actual UI components.
|
||||||
|
@@ -35,8 +35,8 @@ const Button = ({
|
|||||||
{
|
{
|
||||||
[`mailpoet-button-${dimension}`]: dimension,
|
[`mailpoet-button-${dimension}`]: dimension,
|
||||||
[`mailpoet-button-${variant}`]: variant,
|
[`mailpoet-button-${variant}`]: variant,
|
||||||
'mailpoet-button-disabled': isDisabled,
|
|
||||||
'mailpoet-button-with-spinner': withSpinner,
|
'mailpoet-button-with-spinner': withSpinner,
|
||||||
|
'mailpoet-disabled': isDisabled,
|
||||||
'mailpoet-full-width': isFullWidth,
|
'mailpoet-full-width': isFullWidth,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@@ -17,6 +17,7 @@ const Checkbox = ({
|
|||||||
className={
|
className={
|
||||||
classnames({
|
classnames({
|
||||||
'mailpoet-form-checkbox': true,
|
'mailpoet-form-checkbox': true,
|
||||||
|
'mailpoet-disabled': attributes.disabled,
|
||||||
'mailpoet-full-width': isFullWidth,
|
'mailpoet-full-width': isFullWidth,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,7 @@ const Input = ({
|
|||||||
'mailpoet-form-input',
|
'mailpoet-form-input',
|
||||||
{
|
{
|
||||||
[`mailpoet-form-input-${dimension}`]: dimension,
|
[`mailpoet-form-input-${dimension}`]: dimension,
|
||||||
|
'mailpoet-disabled': attributes.disabled,
|
||||||
'mailpoet-full-width': isFullWidth,
|
'mailpoet-full-width': isFullWidth,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@@ -17,6 +17,7 @@ const Radio = ({
|
|||||||
className={
|
className={
|
||||||
classnames({
|
classnames({
|
||||||
'mailpoet-form-radio': true,
|
'mailpoet-form-radio': true,
|
||||||
|
'mailpoet-disabled': attributes.disabled,
|
||||||
'mailpoet-full-width': isFullWidth,
|
'mailpoet-full-width': isFullWidth,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -69,6 +69,7 @@ const ReactSelect = ({
|
|||||||
'mailpoet-form-select',
|
'mailpoet-form-select',
|
||||||
{
|
{
|
||||||
[`mailpoet-form-input-${dimension}`]: dimension,
|
[`mailpoet-form-input-${dimension}`]: dimension,
|
||||||
|
'mailpoet-disabled': props.disabled,
|
||||||
'mailpoet-full-width': isFullWidth,
|
'mailpoet-full-width': isFullWidth,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@@ -22,6 +22,7 @@ const Select = ({
|
|||||||
'mailpoet-form-select',
|
'mailpoet-form-select',
|
||||||
{
|
{
|
||||||
[`mailpoet-form-input-${dimension}`]: dimension,
|
[`mailpoet-form-input-${dimension}`]: dimension,
|
||||||
|
'mailpoet-disabled': attributes.disabled,
|
||||||
'mailpoet-full-width': isFullWidth,
|
'mailpoet-full-width': isFullWidth,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@@ -16,6 +16,7 @@ const Toggle = ({
|
|||||||
classnames({
|
classnames({
|
||||||
'mailpoet-form-toggle': true,
|
'mailpoet-form-toggle': true,
|
||||||
[`mailpoet-form-toggle-${dimension}`]: dimension,
|
[`mailpoet-form-toggle-${dimension}`]: dimension,
|
||||||
|
'mailpoet-disabled': attributes.disabled,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
@@ -17,6 +17,7 @@ const YesNo = ({
|
|||||||
classnames({
|
classnames({
|
||||||
'mailpoet-form-yesno': true,
|
'mailpoet-form-yesno': true,
|
||||||
'mailpoet-form-yesno-error': showError,
|
'mailpoet-form-yesno-error': showError,
|
||||||
|
'mailpoet-disabled': attributes.disabled,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user