diff --git a/src/components/dropdown-menu/DropdownMenu.tsx b/src/components/dropdown-menu/DropdownMenu.tsx index 71c12fdf..b1872066 100644 --- a/src/components/dropdown-menu/DropdownMenu.tsx +++ b/src/components/dropdown-menu/DropdownMenu.tsx @@ -72,24 +72,26 @@ function DropdownContextMenu(props: Omit, 'trigger'>) { return ( {isPopperElementOpen && ( -
-
- - { - closePopperElement(); - onSelect(selected); - }} - {...otherProps} - /> - + +
+
+ + { + closePopperElement(); + onSelect(selected); + }} + {...otherProps} + /> + +
-
+ )} {children} diff --git a/stories/components/dropdown.stories.tsx b/stories/components/dropdown.stories.tsx index e711bf68..fe352808 100644 --- a/stories/components/dropdown.stories.tsx +++ b/stories/components/dropdown.stories.tsx @@ -17,7 +17,12 @@ import { MenuItems, MenuOptions, } from '../../src/components/dropdown-menu/MenuItems'; -import { DropdownMenu } from '../../src/components/index'; +import { + DropdownMenu, + Table, + ValueRenderers, +} from '../../src/components/index'; +import data from '../data/table.json'; export default { title: 'Components / DropdownMenu', @@ -187,3 +192,79 @@ export function Complex() { ); } +export function TableWithHeaderDropDownMenu() { + const options = useMemo>(() => { + return [ + { label: 'Back', type: 'option', icon: }, + { + label: 'Forward', + type: 'option', + disabled: true, + icon: , + }, + { label: 'Refresh', type: 'option', icon: }, + { type: 'divider' }, + { label: 'Save as', type: 'option', icon: }, + { label: 'Print', type: 'option', icon: }, + { label: 'Cast media to device', type: 'option', icon: }, + { type: 'divider' }, + { + label: 'Send page to your devices', + type: 'option', + icon: , + }, + { + label: 'Create QR Code for this page', + type: 'option', + icon: , + }, + ]; + }, []); + + return ( + + + + + + + + + + + + + + {data + .slice(0, 2) + .map(({ id, name, rn, mw, em, isExpensive, color }) => ( + + + + + + + + + + ))} + +
+ ); +} + +function ColumnWithDropdownMenu({ + value, + options, +}: { + value: string; + options: MenuOptions; +}) { + return ( + + +
{value}
+
+ + ); +}