diff --git a/packages/clay-css/src/scss/atlas/variables/_forms.scss b/packages/clay-css/src/scss/atlas/variables/_forms.scss index 275075e767..235b1e6023 100644 --- a/packages/clay-css/src/scss/atlas/variables/_forms.scss +++ b/packages/clay-css/src/scss/atlas/variables/_forms.scss @@ -448,6 +448,13 @@ $input-select-size: map-deep-merge( ), ), ), + disabled: ( + option: ( + hover: ( + background-image: none, + ), + ), + ), option: ( padding: 0.4375rem 0.5rem, hover: ( diff --git a/packages/clay-css/src/scss/cadmin/components/_forms.scss b/packages/clay-css/src/scss/cadmin/components/_forms.scss index 25e0c8b7d8..9eae1e4f3d 100644 --- a/packages/clay-css/src/scss/cadmin/components/_forms.scss +++ b/packages/clay-css/src/scss/cadmin/components/_forms.scss @@ -131,10 +131,13 @@ fieldset[disabled] label { // This adds disabled styles to div.form-control inside a disabled fielset. -fieldset[disabled] .form-control { - $disabled: setter(map-get($cadmin-input, disabled), ()); +fieldset[disabled] { + select.form-control[multiple], + .form-control { + $disabled: setter(map-get($cadmin-input, disabled), ()); - @include clay-css($disabled); + @include clay-css($disabled); + } } // Readonly controls as plain text diff --git a/packages/clay-css/src/scss/cadmin/variables/_forms.scss b/packages/clay-css/src/scss/cadmin/variables/_forms.scss index b538ce402d..57939cce45 100644 --- a/packages/clay-css/src/scss/cadmin/variables/_forms.scss +++ b/packages/clay-css/src/scss/cadmin/variables/_forms.scss @@ -1326,6 +1326,13 @@ $cadmin-input-select-size: map-deep-merge( ), ), ), + disabled: ( + option: ( + hover: ( + background-image: none, + ), + ), + ), option: ( padding: 7px 8px, checked: ( diff --git a/packages/clay-css/src/scss/components/_forms.scss b/packages/clay-css/src/scss/components/_forms.scss index b52dee8c42..e7aa167279 100644 --- a/packages/clay-css/src/scss/components/_forms.scss +++ b/packages/clay-css/src/scss/components/_forms.scss @@ -110,8 +110,11 @@ fieldset[disabled] label { // This adds disabled styles to div.form-control inside a disabled fielset. -fieldset[disabled] .form-control { - @include clay-css(map-get($input, disabled)); +fieldset[disabled] { + select.form-control[multiple], + .form-control { + @include clay-css(map-get($input, disabled)); + } } // Readonly controls as plain text diff --git a/packages/clay-form/src/DualListBox.tsx b/packages/clay-form/src/DualListBox.tsx index b8b3685e28..37a9961dfd 100644 --- a/packages/clay-form/src/DualListBox.tsx +++ b/packages/clay-form/src/DualListBox.tsx @@ -60,6 +60,11 @@ interface IProps extends React.HTMLAttributes { transferRTL: string; }; + /** + * Disables the component. + */ + disabled?: boolean; + /** * Disables the button responsible for moving items from right to left box. */ @@ -107,6 +112,7 @@ const ClayDualListBox = ({ transferRTL: 'Transfer Item Right to Left', }, className, + disabled, disableLTR, disableRTL, items = [[], []], @@ -142,6 +148,7 @@ const ClayDualListBox = ({
{ const [arrayLeft, arrayRight] = swapArrayItems( @@ -178,7 +187,9 @@ const ClayDualListBox = ({ aria-label={ariaLabels.transferRTL} className="transfer-button-rtl" data-testid="rtl" - disabled={rightSelected.length === 0 || disableRTL} + disabled={ + rightSelected.length === 0 || disableRTL || disabled + } displayType="secondary" onClick={() => { const [arrayRight, arrayLeft] = swapArrayItems( @@ -196,6 +207,7 @@ const ClayDualListBox = ({ { */ buttonAlignment?: 'center' | 'end'; + /** + * Disables the component. + */ + disabled?: boolean; + /** * Items to be displayed in the Select Box. */ @@ -137,6 +142,7 @@ const ClaySelectBox = ({ }, buttonAlignment = 'end', className, + disabled, id, items, label, @@ -165,7 +171,12 @@ const ClaySelectBox = ({ return (
{label && ( -