Skip to content

Commit

Permalink
feat(dropdown): refactored dropdown (#177)
Browse files Browse the repository at this point in the history
- Moved dropdown to be called select
  - Created new components, ButtonBase, List, ListItem, MenuItem
  - No contract changes to propTypes
  - Custom PropType Validation for deprecation/unimplemented features
  - Added react-testing-library to improve unit/functional testing
  • Loading branch information
tysonwolker committed Jan 13, 2020
1 parent 0e580ad commit 32dbe76
Show file tree
Hide file tree
Showing 25 changed files with 1,704 additions and 989 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"react/destructuring-assignment": "ignoreClassFields",
"react/forbid-foreign-prop-types": "off",
"react/jsx-filename-extension": "off",
"prettier/prettier": ["error"]
"prettier/prettier": ["error"],
"import/prefer-default-export": "off",
"react/require-default-props": "off"
}
}
321 changes: 304 additions & 17 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"express": "^4.16.4",
"highlight-words-core": "^1.2.2",
"lodash.debounce": "4.0.8",
"prop-types": "^15.6.2",
"prop-types": "^15.7.2",
"rc-input-number": "^4.5.1",
"react-highlight-words": "^0.16.0",
"react-switch": "4.1.0",
Expand All @@ -64,6 +64,8 @@
"@semantic-release/changelog": "^3.0.1",
"@semantic-release/git": "^7.0.5",
"@semantic-release/npm": "^5.1.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
Expand Down
47 changes: 47 additions & 0 deletions src/components/ButtonBase/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react';
import PropTypes from 'prop-types';
import { css } from '@emotion/core';

export function buttonBaseStyles() {
return css({
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
position: 'relative',
cursor: 'pointer',
padding: 0,
border: 0,
background: 'transparent',
color: 'inherit',
textDecoration: 'none',
userSelect: 'none',
verticalAlign: 'middle',
maxWidth: '100%'
});
}

export function ButtonBase(props) {
const {
component: Component = 'button',
children,
overrideClassName,
...otherProps
} = props;

return (
<Component
css={css(buttonBaseStyles(props), overrideClassName)}
{...otherProps}
>
{children}
</Component>
);
}

ButtonBase.propTypes = {
component: PropTypes.string,
children: PropTypes.node,
className: PropTypes.string
};

export default ButtonBase;
Loading

0 comments on commit 32dbe76

Please sign in to comment.