Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DS-95] add TextField Error Focus status #139

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({
"&.Mui-focused fieldset": {
border: `1px solid ${lunit_token.core.focused}`,
},
"&.Mui-error.Mui-focused fieldset": {
border: `2px solid ${lunit_token.component.textfield_border_error}`,
},
"&.Mui-disabled": {
opacity: 0.38,
"&:hover::before": {
Expand Down Expand Up @@ -110,7 +113,6 @@ const commonStyle = ({ lunit_token }: { lunit_token: ColorToken }) => ({
},
},
background: lunit_token.component.textfield_bg,
overflow: "hidden",
color: lunit_token.core.text_normal,
"&:hover": {
position: "relative",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ const MultiTemplate: StoryFn<typeof TextField> = (args) => (
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Focused
</TableCell>
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Error Focused
</TableCell>
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Disabled
</TableCell>
Expand All @@ -123,6 +126,9 @@ const MultiTemplate: StoryFn<typeof TextField> = (args) => (
<TableCell>
<TextField {...args} multiline focused />
</TableCell>
<TableCell>
<TextField {...args} multiline error focused />
</TableCell>
<TableCell>
<TextField {...args} multiline disabled />
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ const SingleTemplate: StoryFn<typeof TextField> = (args) => (
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Focused
</TableCell>
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Error Focused
</TableCell>
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Disabled
</TableCell>
Expand All @@ -115,6 +118,9 @@ const SingleTemplate: StoryFn<typeof TextField> = (args) => (
<TableCell>
<TextField {...args} focused />
</TableCell>
<TableCell>
<TextField {...args} error focused />
</TableCell>
<TableCell>
<TextField {...args} disabled />
</TableCell>
Expand All @@ -137,6 +143,9 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
focused
</TableCell>
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Error focused
</TableCell>
<TableCell sx={{ typography: "body2_14_medium", color: "inherit" }}>
Disabled
</TableCell>
Expand All @@ -156,6 +165,9 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
<TableCell>
<TextField {...args} focused leftIcon={<Bell />} />
</TableCell>
<TableCell>
<TextField {...args} error focused leftIcon={<Bell />} />
</TableCell>
<TableCell>
<TextField {...args} disabled leftIcon={<Bell />} />
</TableCell>
Expand All @@ -173,6 +185,9 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
<TableCell>
<TextField {...args} focused rightIcon={<Bell />} />
</TableCell>
<TableCell>
<TextField {...args} error focused rightIcon={<Bell />} />
</TableCell>
<TableCell>
<TextField {...args} disabled rightIcon={<Bell />} />
</TableCell>
Expand All @@ -195,6 +210,15 @@ const SingleWithIconTemplate: StoryFn<typeof TextField> = (args) => (
rightIcon={<Bell />}
/>
</TableCell>
<TableCell>
<TextField
{...args}
error
focused
leftIcon={<Bell />}
rightIcon={<Bell />}
/>
</TableCell>
<TableCell>
<TextField
{...args}
Expand Down
Loading