Skip to content

Commit 1b1ec1b

Browse files
authored
feat(opentrons-ai-client): add style to container of Textarea (#14987)
* feat(opentrons-ai-client): add style to container of Textarea
1 parent 9b6fb78 commit 1b1ec1b

File tree

1 file changed

+17
-10
lines changed
  • opentrons-ai-client/src/molecules/InputPrompt

1 file changed

+17
-10
lines changed

opentrons-ai-client/src/molecules/InputPrompt/index.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,7 @@ export function InputPrompt(/* props: InputPromptProps */): JSX.Element {
5454

5555
return (
5656
<StyledForm id="User_Prompt" onSubmit={() => handleSubmit(onSubmit)}>
57-
<Flex
58-
padding={SPACING.spacing40}
59-
gridGap={SPACING.spacing40}
60-
flexDirection={DIRECTION_ROW}
61-
backgroundColor={COLORS.white}
62-
borderRadius={BORDERS.borderRadius4}
63-
justifyContent={JUSTIFY_CENTER}
64-
alignItems={ALIGN_CENTER}
65-
maxHeight="21.25rem"
66-
>
57+
<Flex css={CONTAINER_STYLE}>
6758
<StyledTextarea
6859
rows={calcTextAreaHeight()}
6960
placeholder={t('type_your_prompt')}
@@ -79,6 +70,21 @@ const StyledForm = styled.form`
7970
width: 100%;
8071
`
8172

73+
const CONTAINER_STYLE = css`
74+
padding: ${SPACING.spacing40};
75+
grid-gap: ${SPACING.spacing40};
76+
flex-direction: ${DIRECTION_ROW};
77+
background-color: ${COLORS.white};
78+
border-radius: ${BORDERS.borderRadius4};
79+
justify-content: ${JUSTIFY_CENTER};
80+
align-items: ${ALIGN_CENTER};
81+
max-height: 21.25rem;
82+
83+
&:focus-within {
84+
border: 1px ${BORDERS.styleSolid}${COLORS.blue50};
85+
}
86+
`
87+
8288
const StyledTextarea = styled.textarea`
8389
resize: none;
8490
min-height: 3.75rem;
@@ -93,6 +99,7 @@ const StyledTextarea = styled.textarea`
9399
width: 100%;
94100
font-size: ${TYPOGRAPHY.fontSize20};
95101
line-height: ${TYPOGRAPHY.lineHeight24};
102+
96103
::placeholder {
97104
position: absolute;
98105
top: 50%;

0 commit comments

Comments
 (0)