Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/menu-item-trailing-alignment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@razorpay/blade': patch
---

fix(ActionList/Menu): vertically center `trailing` slot of items so that it aligns with the `title` and `leading` slot
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Sandbox } from '~utils/storybook/Sandbox';
import StoryPageWrapper from '~utils/storybook/StoryPageWrapper';
import { Box } from '~components/Box';
import {
ArrowRightIcon,
DownloadIcon,
SettingsIcon,
BankIcon,
Expand Down Expand Up @@ -175,6 +176,13 @@ const ActionListWithTrailingComponentsExample: StoryFn<typeof ActionListComponen
value="faqs"
trailing={<ActionListItemText>⌘ + H</ActionListItemText>}
/>
<ActionListItem
title="Create a Payout"
description="Pay a single beneficiary"
value="create_payout"
leading={<ActionListItemIcon icon={DownloadIcon} />}
trailing={<ActionListItemIcon icon={ArrowRightIcon} />}
/>
</ActionListComponent>
</Box>
</BaseBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,15 @@ const _BaseMenuItem: React.ForwardRefRenderFunction<BladeElementRef, BaseMenuIte
) : null}
</Box>
</Box>
<Box marginLeft="auto">{trailing}</Box>
<Box
marginLeft="auto"
display="flex"
justifyContent="center"
alignItems="center"
minHeight={makeSize(itemFirstRowHeight)}
>
{trailing}
</Box>
</Box>
)}
</StyledMenuItemContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,20 @@ exports[`<BottomSheet /> should compose with DropdownButton 1`] = `
}

.c24.c24.c24.c24.c24 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-left: auto;
min-height: 20px;
}

.c12.c12.c12.c12.c12 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1322,11 +1322,19 @@ exports[`<Dropdown /> should render dropdown 1`] = `
/>
</View>
<View
alignItems="center"
data-blade-component="box"
display="flex"
justifyContent="center"
minHeight="20px"
style={
[
{
"alignItems": "center",
"display": "flex",
"justifyContent": "center",
"marginLeft": "auto",
"minHeight": 20,
},
]
}
Expand Down Expand Up @@ -1501,11 +1509,19 @@ exports[`<Dropdown /> should render dropdown 1`] = `
/>
</View>
<View
alignItems="center"
data-blade-component="box"
display="flex"
justifyContent="center"
minHeight="20px"
style={
[
{
"alignItems": "center",
"display": "flex",
"justifyContent": "center",
"marginLeft": "auto",
"minHeight": 20,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,19 @@ exports[`<FilterChipSelectInput /> (native) should render with default props 1`]
/>
</View>
<View
alignItems="center"
data-blade-component="box"
display="flex"
justifyContent="center"
minHeight="20px"
style={
[
{
"alignItems": "center",
"display": "flex",
"justifyContent": "center",
"marginLeft": "auto",
"minHeight": 20,
},
]
}
Expand Down Expand Up @@ -753,11 +761,19 @@ exports[`<FilterChipSelectInput /> (native) should render with default props 1`]
/>
</View>
<View
alignItems="center"
data-blade-component="box"
display="flex"
justifyContent="center"
minHeight="20px"
style={
[
{
"alignItems": "center",
"display": "flex",
"justifyContent": "center",
"marginLeft": "auto",
"minHeight": 20,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,11 +1219,19 @@ exports[`<Dropdown /> with <AutoComplete /> should render AutoComplete 1`] = `
/>
</View>
<View
alignItems="center"
data-blade-component="box"
display="flex"
justifyContent="center"
minHeight="20px"
style={
[
{
"alignItems": "center",
"display": "flex",
"justifyContent": "center",
"marginLeft": "auto",
"minHeight": 20,
},
]
}
Expand Down Expand Up @@ -1524,11 +1532,19 @@ exports[`<Dropdown /> with <AutoComplete /> should render AutoComplete 1`] = `
/>
</View>
<View
alignItems="center"
data-blade-component="box"
display="flex"
justifyContent="center"
minHeight="20px"
style={
[
{
"alignItems": "center",
"display": "flex",
"justifyContent": "center",
"marginLeft": "auto",
"minHeight": 20,
},
]
}
Expand Down Expand Up @@ -1829,11 +1845,19 @@ exports[`<Dropdown /> with <AutoComplete /> should render AutoComplete 1`] = `
/>
</View>
<View
alignItems="center"
data-blade-component="box"
display="flex"
justifyContent="center"
minHeight="20px"
style={
[
{
"alignItems": "center",
"display": "flex",
"justifyContent": "center",
"marginLeft": "auto",
"minHeight": 20,
},
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,20 @@ exports[`<BottomSheet /> & <Dropdown /> with <AutoComplete /> should render Bott
}

.c51.c51.c51.c51.c51 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-left: auto;
min-height: 20px;
}

.c52.c52.c52.c52.c52 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,20 @@ exports[`Menu renders a Menu 1`] = `
}

.c28.c28.c28.c28.c28 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-left: auto;
min-height: 20px;
}

.c29.c29.c29.c29.c29 {
Expand Down Expand Up @@ -1270,7 +1283,20 @@ exports[`Menu should support data-analytics attribute 1`] = `
}

.c28.c28.c28.c28.c28 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-left: auto;
min-height: 20px;
}

.c29.c29.c29.c29.c29 {
Expand Down
Loading