-
Notifications
You must be signed in to change notification settings - Fork 149
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
- Loading branch information
1 parent
e349e0c
commit 688e389
Showing
10 changed files
with
36 additions
and
59 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,31 @@ | ||
import { FiAlertCircle } from 'react-icons/fi'; | ||
|
||
import { Box, Stack, StackProps, color } from '@stacks/ui'; | ||
import { css } from 'leather-styles/css'; | ||
import { Box, HStack, HstackProps } from 'leather-styles/jsx'; | ||
|
||
export function ErrorLabel({ children, ...rest }: StackProps) { | ||
interface ErrorLabelProps extends HstackProps { | ||
dataTestId?: string; | ||
} | ||
|
||
export function ErrorLabel({ children, dataTestId }: ErrorLabelProps) { | ||
return ( | ||
<Stack | ||
spacing="tight" | ||
color={color('feedback-error')} | ||
isInline | ||
<HStack | ||
gap="tight" | ||
color="error" | ||
alignItems="flex-start" | ||
{...rest} | ||
textAlign="left" | ||
data-testid={dataTestId} | ||
width="100%" | ||
textStyle="body.02" | ||
// lineHeight="20px" | ||
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
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