-
Notifications
You must be signed in to change notification settings - Fork 153
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
fix(Alert): adjust styles when closable is true and inlineActions is set #4435
Conversation
Storybook staging is available at https://kiwicom-orbit-sarka-fix-alert-button-overflow.surge.sh |
Size Change: +27 B (+0.01%) Total Size: 445 kB
ℹ️ View Unchanged
|
Deploying orbit with Cloudflare Pages
|
78b6841
to
af6eb33
Compare
I was also thinking about extending this PR by adding visual tests? I've checked respective |
@@ -159,6 +159,7 @@ const Alert = (props: Props) => { | |||
title && inlineActions ? "flex-row" : "flex-col", | |||
!title && "items-center", | |||
inlineActions && "justify-between", | |||
inlineActions && closable && "mr-md", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work well in RTL. Also, I'm wondering if we can't refactor the current hack we are using for positioning the button (it being absolute with translates is 🤯 )… Can you take a look at that?
And yes, feel free to add more visual tests, for sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work well in RTL.
Should be fixed now.
Also, I'm wondering if we can't refactor the current hack we are using for positioning the button (it being absolute with translates is 🤯 )… Can you take a look at that?
Sure, I have some ideas. On it. 💻
And yes, feel free to add more visual tests, for sure!
OK. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change with absolute
position removal - 06aa6d3
Please, ignore the min-h-icon-medium
classname changes.
- checked with RTL version ✅
- checked without button and multiline content ✅
- mobile view ✅
AlertCloseButton
is used only within the Alert
component, so the changes shouldn't affect any other component.
Visual tests added ✅
a0af89a
to
4b8f19c
Compare
4b8f19c
to
b9c7e76
Compare
c76498c
to
618af59
Compare
2974ab6
to
53f09b8
Compare
@@ -145,7 +145,7 @@ const Alert = (props: Props) => { | |||
<div | |||
className={cx( | |||
"me-xs m-0 shrink-0 leading-none", | |||
inlineActions && "flex items-center", | |||
inlineActions && "lm:mt-[6px] flex items-center self-baseline", // TODO: [6px] can be replaced by space tokens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added margin-top
to align the icon with the bottom line of the first row of the title.
I added a comment for the future steps once space tokens are implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. You can squash the last two commits into one. And please change the mentioned classes 🙏
@@ -164,8 +164,9 @@ const Alert = (props: Props) => { | |||
{title && ( | |||
<div | |||
className={cx( | |||
"text-ink-dark flex min-h-[20px] items-center font-bold", | |||
"text-ink-dark min-h-icon-medium flex items-center font-bold", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this icon class 🥲
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -74,7 +74,7 @@ const ContentWrapper = ({ | |||
return ( | |||
<div | |||
className={cx( | |||
"flex min-h-[20px] items-center", | |||
"min-h-icon-medium flex items-center", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
0620c08
to
2d83c5b
Compare
2d83c5b
to
d199948
Compare
This Pull Request meets the following criteria:
For new components:
d.ts
files and are exported inindex.d.ts
Closes https://kiwicom.atlassian.net/browse/FEPLT-2068