Skip to content

Commit

Permalink
Fixed Input styles for Storybook web
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonortiz committed Aug 16, 2023
1 parent 1b21312 commit c5b4e27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .ondevice/storybook.requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ global.STORIES = [
directory: "./storybook/stories",
files: "**/*.stories.?(ts|tsx|js|jsx)",
importPathMatcher:
"^\\.[\\\\/](?:storybook\\/stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$",
"^\\.[\\\\/](?:storybook[\\\\/]stories(?:[\\\\/](?!\\.)(?:(?:(?!(?:^|[\\\\/])\\.).)*?)[\\\\/]|[\\\\/]|$)(?!\\.)(?=.)[^\\\\/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$",
},
];

Expand Down Expand Up @@ -49,6 +49,7 @@ const getStories = () => {
return {
"./storybook/stories/Avatar/Avatar.stories.js": require("../storybook/stories/Avatar/Avatar.stories.js"),
"./storybook/stories/CheckBox/CheckBox.stories.js": require("../storybook/stories/CheckBox/CheckBox.stories.js"),
"./storybook/stories/DesignStystem/Colors.stories.js": require("../storybook/stories/DesignStystem/Colors.stories.js"),
"./storybook/stories/Image/Image.stories.js": require("../storybook/stories/Image/Image.stories.js"),
"./storybook/stories/Input/Input.stories.js": require("../storybook/stories/Input/Input.stories.js"),
"./storybook/stories/Loading/Loading.stories.js": require("../storybook/stories/Loading/Loading.stories.js"),
Expand Down
4 changes: 2 additions & 2 deletions src/components/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const Input = React.forwardRef<TextInput, InputProps>(
};

const hasMessage = !!statusMessage;
const isLabelVisible = inputState === 'focus' && !value;
const isLabelVisible = !disabled && !readOnly && inputState === 'focus' && !value;

const validBorderColor = getBorderColor({inputState, hasMessage, status, inputColor});
const validLabelColor = getLabelColor({
Expand Down Expand Up @@ -115,7 +115,7 @@ const Input = React.forwardRef<TextInput, InputProps>(
letterSpacing: 0,
lineHeight: 19,
position: 'absolute',
bottom: raiseLabel({disabled, hasMessage, inputState}) ? 25 : 5,
bottom: raiseLabel({disabled, hasMessage, inputState}) ? 25 : 0,
},
input: {
color: validInputTextColor,
Expand Down

0 comments on commit c5b4e27

Please sign in to comment.