Skip to content

Commit

Permalink
fix: remove unused components, fix types for several components
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
Removed TagButton and TagInput components
  • Loading branch information
matt-cratebind committed Jan 11, 2022
1 parent 6c9bbd5 commit 7411aaa
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 191 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"semantic-release": "^17.0.2",
"tsdx": "^0.14.1",
"tslib": "^2.0.3",
"typescript": "^4.0.5",
"typescript": "^4.5.4",
"vite": "^2.7.10"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const Stack = React.forwardRef(function Stack(
{children}
</StyledStack>
);
}) as ForwardRefComponent<StackProps, 'div'>;
}) as ForwardRefComponent<'div', StackProps>;

export default Stack;

Expand Down
14 changes: 11 additions & 3 deletions src/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const TableContainer = styled.div`
// systemProps
// );

export const StyledTable = React.forwardRef(function SyledTable(
export const StyledTable = React.forwardRef(function StyledTable(
props: any,
ref: any
) {
Expand Down Expand Up @@ -104,9 +104,17 @@ export const Table = forwardRef<Ref, CustomTableProps & MinervaProps>(
({ children, ...props }, ref) => {
return (
<TableContainer>
<StyledTable as="table" ref={ref} {...props}>
<Box
as="table"
ref={ref}
margin={0}
minWidth="100%"
borderCollapse="collapse"
display="table"
{...props}
>
{children}
</StyledTable>
</Box>
</TableContainer>
);
}
Expand Down
86 changes: 44 additions & 42 deletions src/Tag/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from 'react';
// import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Close } from '../Icon/baseIcons';
// import { Close } from '../Icon/baseIcons';

import { MinervaProps, systemProps, Box } from '../layout';
import { MinervaProps, Box } from '../layout';
// import { Icon } from '../Icon';
import { useComponentStyles } from '../theme';
import Button from '../Button';
import { PseudoBoxProps } from '..';
import { ForwardRefComponent } from '../utilities/polymorphic';
// import { ForwardRefComponent } from '../utilities/polymorphic';

export const TagIcon = styled(Button)`
margin-left: 5px;
Expand All @@ -17,57 +19,57 @@ export const TagIcon = styled(Button)`
}
`;

const StyledTag = styled(Box)<MinervaProps>(
props => ({
display: 'inline-flex',
alignItems: 'center',
backgroundColor: '#EDF2F7',
borderRadius: '5px',
padding: '8px 10px',
fontSize: '16px',
...props.theme.Tag,
}),
systemProps
);
// const StyledTag = styled(Box)<MinervaProps>(
// props => ({
// display: 'inline-flex',
// alignItems: 'center',
// backgroundColor: '#EDF2F7',
// borderRadius: '5px',
// padding: '8px 10px',
// fontSize: '16px',
// ...props.theme.Tag,
// }),
// systemProps
// );

export interface TagProps extends MinervaProps {
export interface TagProps extends MinervaProps, PseudoBoxProps {
children?: React.ReactNode;
}

export interface TagButtonProps extends MinervaProps {
iconName?: string;
}
// export interface TagButtonProps extends MinervaProps, PseudoBoxProps {
// iconName?: string;
// }

export const TagButton = React.forwardRef(function TagButton(
{ iconName, ...props },
ref
) {
return (
<Button
ref={ref}
data-testid="input-tag-icon"
marginLeft="5px"
marginTop="1px"
p={0}
bg="transparent"
border={0}
borderRadius="full"
_hover={{ cursor: 'pointer' }}
{...props}
>
<Close size="14px" />
</Button>
);
}) as ForwardRefComponent<TagButtonProps, 'button'>;
// export const TagButton = React.forwardRef(function TagButton(
// { iconName, ...props }: TagButtonProps,
// ref
// ) {
// return (
// <Button
// ref={ref}
// data-testid="input-tag-icon"
// marginLeft="5px"
// marginTop="1px"
// p={0}
// bg="transparent"
// border={0}
// borderRadius="full"
// _hover={{ cursor: 'pointer' }}
// {...props}
// >
// <Close size="14px" />
// </Button>
// );
// });

export const Tag = React.forwardRef(function Tag({ children, ...props }, ref) {
const componentStyles = useComponentStyles('Tag');
return (
<StyledTag ref={ref} {...componentStyles} {...props}>
<Box ref={ref} {...componentStyles} {...props}>
{children}
</StyledTag>
</Box>
);
}) as ForwardRefComponent<TagProps, 'div'>;
}) as ForwardRefComponent<'div', TagProps>;

export default Tag;

Expand Down
47 changes: 0 additions & 47 deletions src/TagsInput/TagsInput.stories.mdx

This file was deleted.

91 changes: 0 additions & 91 deletions src/TagsInput/index.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export * from './Radio';
export * from './InputField';
export { default as InputField } from './InputField';
export * from './Select';
export * from './TagsInput';
// export * from './TagsInput';
export * from './Tabs';

/**
Expand Down
1 change: 0 additions & 1 deletion tsconfig.tsbuildinfo

This file was deleted.

8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20089,10 +20089,10 @@ typescript@^3.2.1, typescript@^3.7.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.9.tgz#e69905c54bc0681d0518bd4d587cc6f2d0b1a674"
integrity sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==

typescript@^4.0.5:
version "4.3.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
typescript@^4.5.4:
version "4.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8"
integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==

ua-parser-js@^0.7.18:
version "0.7.28"
Expand Down

0 comments on commit 7411aaa

Please sign in to comment.