Skip to content

Commit

Permalink
make text in the disabled input gray
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrBukov committed Apr 6, 2021
1 parent fae959a commit ea2ccb3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Form/FormSectionTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const name = 'formSectionTitle';
const [FormSectionTitleTag, theme] = createThemeTag(name, ({ FONTS }: *) => ({
root: {
...FONTS.H5,
letterSpacing: '0.5px',
},
modifiers: {},
defaults: {},
Expand Down
6 changes: 6 additions & 0 deletions src/components/Input/Input.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@ export const withKindUnderline = () => (
withKindUnderline.story = {
name: 'with kind="underline"',
};

export const disabledStory = () => <Input value="hello@8base.com" name="input" onChange={ () => null } disabled />;

disabledStory.story = {
name: 'with disabled=true',
};
4 changes: 3 additions & 1 deletion src/components/Input/Input.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const [InputTag, themeInput] = createThemeTag(name, ({ COLORS, SIZES, FONTS }: *
root: props => ({
width: props.width ? `${props.width}rem` : props.stretch ? '100%' : SIZES.FIELD_WIDTH,
outline: 'none',
paddingLeft: props.hasLeftIcon ? '36px' : '8px',
paddingTop: '1px',
paddingLeft: props.hasLeftIcon ? '36px' : '15px',
paddingRight: props.hasRightIcon || (props.type === 'number' && !props.hideNumberArrows) ? '48px' : '16px',

backgroundColor: (props.disabled || props.readOnly)
Expand Down Expand Up @@ -38,6 +39,7 @@ const [InputTag, themeInput] = createThemeTag(name, ({ COLORS, SIZES, FONTS }: *
},

...FONTS.BODY_1,
color: props.disabled ? COLORS.LIGHT_TEXT_COLOR : COLORS.PRIMARY_TEXT_COLOR,
height: '36px',
transition: 'all .15s ease-in-out',

Expand Down
5 changes: 5 additions & 0 deletions src/components/InputField/InputField.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ export const common = () => (
mask="999-999"
stretch={ false }
/>
<InputField
label="Email"
disabled
input={{ name: 'input', value: 'hello@8base.com', onChange }}
/>
</Column>
</Grid.Box>
<Grid.Box>
Expand Down

0 comments on commit ea2ccb3

Please sign in to comment.