-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: refactor error label to align icon and make text consistent size, …
…closes #4166
- Loading branch information
1 parent
7e71b91
commit 1c1bde6
Showing
9 changed files
with
28 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import { FiAlertCircle } from 'react-icons/fi'; | ||
|
||
import { Box, Stack, StackProps, color } from '@stacks/ui'; | ||
import { css } from 'leather-styles/css'; | ||
import { HStack, HstackProps } from 'leather-styles/jsx'; | ||
|
||
export function ErrorLabel({ children, ...rest }: StackProps) { | ||
export function ErrorLabel({ children, ...rest }: HstackProps) { | ||
return ( | ||
<Stack | ||
spacing="tight" | ||
color={color('feedback-error')} | ||
isInline | ||
<HStack | ||
gap="tight" | ||
color="error" | ||
alignItems="flex-start" | ||
{...rest} | ||
textAlign="left" | ||
width="100%" | ||
textStyle="body.02" | ||
className={css({ | ||
'& svg': { | ||
mt: '2px', | ||
}, | ||
})} | ||
> | ||
<Box | ||
size="1rem" | ||
color={color('feedback-error')} | ||
as={FiAlertCircle} | ||
position="relative" | ||
strokeWidth={1.5} | ||
/> | ||
<Box>{children}</Box> | ||
</Stack> | ||
<FiAlertCircle size="1rem" /> | ||
{children} | ||
</HStack> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters