Skip to content

Commit

Permalink
fix: remove extra stories, fix type errors, update typescript-eslint …
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
matt-cratebind committed Oct 30, 2020
1 parent 44e9dd8 commit cae2fa2
Show file tree
Hide file tree
Showing 21 changed files with 319 additions and 747 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"@types/jest-axe": "^3.2.1",
"@types/react": "^16.9.23",
"@types/react-dom": "^16.9.5",
"@typescript-eslint/eslint-plugin": "^2.29.0",
"@typescript-eslint/parser": "^2.29.0",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"babel-loader": "^8.0.6",
"babel-plugin-styled-components": "^1.11.1",
"cz-conventional-changelog": "3.1.0",
Expand Down
39 changes: 0 additions & 39 deletions src/Heading/Heading.stories.mdx

This file was deleted.

18 changes: 0 additions & 18 deletions src/Image/Image.stories.mdx

This file was deleted.

53 changes: 0 additions & 53 deletions src/Input/Input.stories.mdx

This file was deleted.

25 changes: 0 additions & 25 deletions src/Link/Link.stories.mdx

This file was deleted.

95 changes: 0 additions & 95 deletions src/Menu/Menu.stories.mdx

This file was deleted.

32 changes: 32 additions & 0 deletions src/Menu/Menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import {
MenuList,
MenuItem,
MenuLink,
MenuDivider,
} from '.';
import { Icon } from '..';
import { filteredArgs } from '../utils';
import { Flex } from '../layout';

const meta: Meta = {
title: 'Menu',
Expand Down Expand Up @@ -56,3 +58,33 @@ const Template: Story<MenuContainerProps> = ({}) => {

export const Basic = Template.bind({});
Basic.args = {};

export const PositionedRight = () => (
<Flex justifyContent="flex-end">
<MenuContainer>
<MenuButton>
Actions <Icon name="chevron-down" ml={2} size="14px" />
</MenuButton>
<MenuList menuPosition="right">
<MenuItem onSelect={() => alert('Edit Profile')}>Edit Profile</MenuItem>
<MenuItem onSelect={() => alert('Settings')}>Settings</MenuItem>
</MenuList>
</MenuContainer>
</Flex>
);

export const DisabledItems = () => (
<MenuContainer>
<MenuButton>
Actions <Icon name="chevron-down" ml={2} size="14px" />
</MenuButton>
<MenuList>
<MenuItem onSelect={() => alert('Edit Profile')}>Edit Profile</MenuItem>
<MenuItem disabled onSelect={() => alert('Settings')}>
Settings
</MenuItem>
<MenuDivider />
<MenuLink href="https://minerva-ui-docs.vercel.app">Sign Out</MenuLink>
</MenuList>
</MenuContainer>
);
7 changes: 4 additions & 3 deletions src/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {
MenuItems as ReachMenuItems,
MenuProps,
MenuButtonProps,
MenuItemsProps,
} from '@reach/menu-button';
import { PopoverProps, positionDefault, positionRight } from '@reach/popover';
import { positionDefault, positionRight } from '@reach/popover';
import styled from 'styled-components';
import Button from '../Button';
import { Box, MinervaProps } from '../layout';
Expand All @@ -29,7 +30,7 @@ export const MenuButton = (props: MenuButtonProps & MinervaProps) => (
<Button as={ReachMenuButton} {...props} />
);

export interface MenuListProps extends MinervaProps, PopoverProps {
export interface MenuListProps extends MinervaProps {
children?: React.ReactNode;
menuPosition?: 'left' | 'right';
}
Expand Down Expand Up @@ -64,7 +65,7 @@ export const OverlayBox = props => (
export const MenuList = ({
menuPosition = 'left',
...props
}: MenuListProps) => (
}: MenuListProps & MenuItemsProps) => (
<ReachMenuPopover
position={menuPosition === 'right' ? positionRight : positionDefault}
>
Expand Down
Loading

0 comments on commit cae2fa2

Please sign in to comment.