diff --git a/.changeset/menu-item-trailing-alignment.md b/.changeset/menu-item-trailing-alignment.md new file mode 100644 index 0000000000..acf5274ec1 --- /dev/null +++ b/.changeset/menu-item-trailing-alignment.md @@ -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 diff --git a/packages/blade/src/components/ActionList/ActionList.stories.tsx b/packages/blade/src/components/ActionList/ActionList.stories.tsx index 9530254c68..47784759b5 100644 --- a/packages/blade/src/components/ActionList/ActionList.stories.tsx +++ b/packages/blade/src/components/ActionList/ActionList.stories.tsx @@ -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, @@ -175,6 +176,13 @@ const ActionListWithTrailingComponentsExample: StoryFn⌘ + H} /> + } + trailing={} + /> diff --git a/packages/blade/src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx b/packages/blade/src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx index 8d15240a47..0a04520f7c 100644 --- a/packages/blade/src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx +++ b/packages/blade/src/components/BaseMenu/BaseMenuItem/BaseMenuItem.tsx @@ -126,7 +126,15 @@ const _BaseMenuItem: React.ForwardRefRenderFunction - {trailing} + + {trailing} + )} diff --git a/packages/blade/src/components/BottomSheet/__tests__/__snapshots__/BottomSheet.web.test.tsx.snap b/packages/blade/src/components/BottomSheet/__tests__/__snapshots__/BottomSheet.web.test.tsx.snap index 594ccc6795..96b834775a 100644 --- a/packages/blade/src/components/BottomSheet/__tests__/__snapshots__/BottomSheet.web.test.tsx.snap +++ b/packages/blade/src/components/BottomSheet/__tests__/__snapshots__/BottomSheet.web.test.tsx.snap @@ -165,7 +165,20 @@ exports[` 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 { diff --git a/packages/blade/src/components/Dropdown/__tests__/__snapshots__/Dropdown.native.test.tsx.snap b/packages/blade/src/components/Dropdown/__tests__/__snapshots__/Dropdown.native.test.tsx.snap index d90bf33c20..aabc4de10a 100644 --- a/packages/blade/src/components/Dropdown/__tests__/__snapshots__/Dropdown.native.test.tsx.snap +++ b/packages/blade/src/components/Dropdown/__tests__/__snapshots__/Dropdown.native.test.tsx.snap @@ -1322,11 +1322,19 @@ exports[` should render dropdown 1`] = ` /> should render dropdown 1`] = ` /> (native) should render with default props 1`] /> (native) should render with default props 1`] /> with should render AutoComplete 1`] = ` /> with should render AutoComplete 1`] = ` /> with should render AutoComplete 1`] = ` /> & with 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 { diff --git a/packages/blade/src/components/Menu/__tests__/__snapshots__/Menu.web.test.tsx.snap b/packages/blade/src/components/Menu/__tests__/__snapshots__/Menu.web.test.tsx.snap index 992cb3d454..7aea2e91e5 100644 --- a/packages/blade/src/components/Menu/__tests__/__snapshots__/Menu.web.test.tsx.snap +++ b/packages/blade/src/components/Menu/__tests__/__snapshots__/Menu.web.test.tsx.snap @@ -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 { @@ -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 {