Skip to content

Commit a230986

Browse files
committed
feat(Select): disabled state improved
1 parent 5ec81b8 commit a230986

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

src/components/Select/Select.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ const Select = React.forwardRef(
4343
[`${prefix}--select--small`]: small,
4444
[`${prefix}--select--light`]: light,
4545
[`${prefix}--select--invalid`]: invalid,
46+
[`${prefix}--select--disabled`]: disabled,
4647
[className]: className,
4748
});
4849
const labelClasses = classNames(`${prefix}--label`, {
4950
[`${prefix}--visually-hidden`]: hideLabel,
50-
[`${prefix}--label--disabled`]: other.disabled,
51+
[`${prefix}--label--disabled`]: disabled,
5152
});
5253
const errorId = `${id}-error-msg`;
5354
const error = invalid ? (
@@ -99,7 +100,7 @@ const Select = React.forwardRef(
99100
<div className={selectClasses}>
100101
{labelTextComponent}
101102
{!inline && helper}
102-
{componentsX && inline && (
103+
{inline && (
103104
<>
104105
<div className={`${prefix}--select-input--inline__wrapper`}>
105106
<div

src/components/Select/_select.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
}
179179
}
180180

181-
&:disabled ~ * {
181+
&:disabled {
182182
opacity: 0.5;
183183
cursor: not-allowed;
184184
}
@@ -195,6 +195,10 @@
195195
}
196196
}
197197

198+
.#{$prefix}--select-input:disabled ~ .#{$prefix}--select__arrow {
199+
opacity: 0.5;
200+
}
201+
198202
//Skeleton State
199203
.#{$prefix}--select.#{$prefix}--skeleton {
200204
@include skeleton;

src/components/TextArea/TextArea.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ const TextArea = ({
4646
</label>
4747
) : null;
4848

49+
const helperTextClasses = classNames(`${prefix}--form__helper-text`, {
50+
[`${prefix}--form__helper-text--disabled`]: other.disabled,
51+
});
52+
4953
const error = invalid ? (
5054
<div className="wfp--form-requirement">{invalidText}</div>
5155
) : null;
@@ -62,7 +66,7 @@ const TextArea = ({
6266
);
6367

6468
const helper = helperText ? (
65-
<div className="wfp--form__helper-text">{helperText}</div>
69+
<div className={helperTextClasses}>{helperText}</div>
6670
) : null;
6771

6872
return (

src/components/TextInput/TextInput.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ const TextInput = ({
4747
[`${prefix}--label--disabled`]: other.disabled,
4848
});
4949

50+
const helperTextClasses = classNames(`${prefix}--form__helper-text`, {
51+
[`${prefix}--form__helper-text--disabled`]: other.disabled,
52+
});
53+
5054
const label = labelText ? (
5155
<label htmlFor={id} className={labelClasses}>
5256
{labelText}
@@ -73,7 +77,7 @@ const TextInput = ({
7377
);
7478

7579
const helper = helperText ? (
76-
<div className="wfp--form__helper-text">{helperText}</div>
80+
<div className={helperTextClasses}>{helperText}</div>
7781
) : null;
7882

7983
return (

src/documentation/Usage/UsageDevelopers-story.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ storiesOf(' Design|Getting started', module)
5151
{`<Button>ButtonText</Button>`}
5252
</PrismCode>
5353
</Blockquote>
54+
<h3>Polyfills</h3>
55+
<p>
56+
Polyfills are needed for IE browsers. We recommend{' '}
57+
<Link href="https://babeljs.io/docs/en/babel-preset-env">
58+
babel-preset-env
59+
</Link>{' '}
60+
for it.
61+
</p>
5462
<h3>CSS</h3>
5563
<p>
5664
See the{' '}

0 commit comments

Comments
 (0)