Skip to content

Commit

Permalink
Make select all action menu activator a MenuGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
chloerice committed Oct 10, 2024
1 parent 9e03ad2 commit 7dcda58
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
1 change: 1 addition & 0 deletions polaris-react/src/components/ActionMenu/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './ActionMenu';
export {SecondaryAction, MenuGroup} from './components';
40 changes: 15 additions & 25 deletions polaris-react/src/components/BulkActions/BulkActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {Button} from '../Button';
import {ActionList} from '../ActionList';
import {Popover} from '../Popover';
import {InlineStack} from '../InlineStack';
import {MenuGroup} from '../ActionMenu';
import type {ButtonProps} from '../Button';

import {
Expand Down Expand Up @@ -210,33 +211,22 @@ export const BulkActions = ({

const selectAllActionsMarkup = selectMode ? (
<div aria-live={ariaLive}>
<Popover
<MenuGroup
title={i18n.translate(
'Polaris.ResourceList.BulkActions.selectAllMenu.activator',
{selectedItemsCount},
)}
active={selectedAllMenuActive}
actions={[
selectAllOnPageItem,
...(selectAllInStoreItem
? [selectAllInStoreItem, unselectAllItem]
: [unselectAllItem]),
]}
onOpen={() => {}}
onClose={toggleSelectAllMenu}
activator={
<Button
disclosure
pressed={selectedAllMenuActive}
variant="tertiary"
onClick={toggleSelectAllMenu}
>
{i18n.translate(
'Polaris.ResourceList.BulkActions.selectAllMenu.activator',
{selectedItemsCount},
)}
</Button>
}
>
<ActionList
items={[
selectAllOnPageItem,
...(selectAllInStoreItem
? [selectAllInStoreItem, unselectAllItem]
: [unselectAllItem]),
]}
onActionAnyItem={toggleSelectAllMenu}
/>
</Popover>
onClick={toggleSelectAllMenu}
/>
</div>
) : null;

Expand Down
2 changes: 1 addition & 1 deletion polaris-react/src/components/Filters/Filters.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
z-index: var(--p-z-index-1);
position: absolute;
top: 0;
right: calc((-1 * var(--p-space-100)) - 1);
right: calc(-1 * var(--p-space-100));
width: var(--p-width-200);
height: 100%;
pointer-events: none;
Expand Down

0 comments on commit 7dcda58

Please sign in to comment.