@blockchain-com/components
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -0,1 +1,3 @@ | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
@@ -22,8 +24,3 @@ | ||
import Link from '../../Atoms/Links/Link'; | ||
var Wrapper = styled(Link).attrs({ | ||
href: function href(props) { | ||
return props.url; | ||
}, | ||
target: '_blank' | ||
})(_templateObject(), function (props) { | ||
var Wrapper = styled(Link)(_templateObject(), function (props) { | ||
return props.size; | ||
@@ -41,9 +38,7 @@ }, function (props) { | ||
size = _ref.size, | ||
url = _ref.url, | ||
rest = _objectWithoutProperties(_ref, ["name", "size", "url"]); | ||
rest = _objectWithoutProperties(_ref, ["name", "size"]); | ||
return React.createElement(Wrapper, { | ||
size: size, | ||
url: url | ||
}, React.createElement(Image, { | ||
return React.createElement(Wrapper, _extends({ | ||
size: size | ||
}, rest), React.createElement(Image, { | ||
name: name, | ||
@@ -56,4 +51,3 @@ selectable: true | ||
name: PropTypes.oneOf(['facebook', 'linkedIn', 'twitter']), | ||
size: PropTypes.string, | ||
url: PropTypes.string.isRequired | ||
size: PropTypes.string | ||
}; | ||
@@ -60,0 +54,0 @@ CircleBadge.defaultProps = { |
@@ -54,8 +54,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var children = _ref.children, | ||
width = _ref.width, | ||
value = _ref.value, | ||
onChange = _ref.onChange, | ||
onClick = _ref.onClick, | ||
rest = _objectWithoutProperties(_ref, ["children", "value", "onChange", "onClick"]); | ||
rest = _objectWithoutProperties(_ref, ["children", "width", "value", "onChange", "onClick"]); | ||
return React.createElement(Wrapper, null, React.createElement(SearchInput, _extends({ | ||
return React.createElement(Wrapper, { | ||
width: width | ||
}, React.createElement(SearchInput, _extends({ | ||
onChange: onChange, | ||
@@ -75,4 +78,8 @@ value: value | ||
onClick: PropTypes.func, | ||
value: PropTypes.any | ||
value: PropTypes.any, | ||
width: PropTypes.string | ||
}; | ||
SearchBar.defaultProps = { | ||
width: '100%' | ||
}; | ||
export default SearchBar; |
@@ -14,2 +14,10 @@ /* eslint no-console: 0 */ | ||
it('should render correctly with width', () => { | ||
const tree = mountWithTheme( | ||
<SearchBar onChange={jest.fn()} value="My search" width="200px" />, | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
it('should render correctly with value', () => { | ||
@@ -16,0 +24,0 @@ const tree = mountWithTheme( |
@@ -9,4 +9,5 @@ import React from 'react' | ||
.add('default', () => <SearchBar />) | ||
.add('with width', () => <SearchBar width="200px" />) | ||
.add('with value', () => <SearchBar value="My search" />) | ||
.add('with onChange', () => <SearchBar onChange={action('text-change')} />) | ||
.add('with onClick', () => <SearchBar onClick={action('icon-click')} />) |
@@ -54,8 +54,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var children = _ref.children, | ||
width = _ref.width, | ||
onChange = _ref.onChange, | ||
onClick = _ref.onClick, | ||
value = _ref.value, | ||
rest = _objectWithoutProperties(_ref, ["children", "onChange", "onClick", "value"]); | ||
rest = _objectWithoutProperties(_ref, ["children", "width", "onChange", "onClick", "value"]); | ||
return React.createElement(Wrapper, null, React.createElement(SearchInput, _extends({ | ||
return React.createElement(Wrapper, { | ||
width: width | ||
}, React.createElement(SearchInput, _extends({ | ||
onChange: onChange, | ||
@@ -75,4 +78,8 @@ value: value | ||
onClick: PropTypes.func, | ||
value: PropTypes.any | ||
value: PropTypes.any, | ||
width: PropTypes.string | ||
}; | ||
SearchBarUnderlined.defaultProps = { | ||
width: '100%' | ||
}; | ||
export default SearchBarUnderlined; |
@@ -14,2 +14,14 @@ /* eslint no-console: 0 */ | ||
it('should render correctly with width', () => { | ||
const tree = mountWithTheme( | ||
<SearchBarUnderlined | ||
onChange={jest.fn()} | ||
value="My search" | ||
width="200px" | ||
/>, | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
it('should render correctly with value', () => { | ||
@@ -16,0 +28,0 @@ const tree = mountWithTheme( |
@@ -9,2 +9,3 @@ import React from 'react' | ||
.add('default', () => <SearchBarUnderlined />) | ||
.add('with width', () => <SearchBarUnderlined width="200px" />) | ||
.add('with value', () => <SearchBarUnderlined value="My search" />) | ||
@@ -11,0 +12,0 @@ .add('with onChange', () => ( |
@@ -20,2 +20,4 @@ "use strict"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
@@ -37,8 +39,3 @@ | ||
var Wrapper = (0, _styledComponents.default)(_Link.default).attrs({ | ||
href: function href(props) { | ||
return props.url; | ||
}, | ||
target: '_blank' | ||
})(_templateObject(), function (props) { | ||
var Wrapper = (0, _styledComponents.default)(_Link.default)(_templateObject(), function (props) { | ||
return props.size; | ||
@@ -56,9 +53,7 @@ }, function (props) { | ||
size = _ref.size, | ||
url = _ref.url, | ||
rest = _objectWithoutProperties(_ref, ["name", "size", "url"]); | ||
rest = _objectWithoutProperties(_ref, ["name", "size"]); | ||
return _react.default.createElement(Wrapper, { | ||
size: size, | ||
url: url | ||
}, _react.default.createElement(_Image.default, { | ||
return _react.default.createElement(Wrapper, _extends({ | ||
size: size | ||
}, rest), _react.default.createElement(_Image.default, { | ||
name: name, | ||
@@ -71,4 +66,3 @@ selectable: true | ||
name: _propTypes.default.oneOf(['facebook', 'linkedIn', 'twitter']), | ||
size: _propTypes.default.string, | ||
url: _propTypes.default.string.isRequired | ||
size: _propTypes.default.string | ||
}; | ||
@@ -75,0 +69,0 @@ CircleBadge.defaultProps = { |
@@ -70,8 +70,11 @@ "use strict"; | ||
var children = _ref.children, | ||
width = _ref.width, | ||
value = _ref.value, | ||
onChange = _ref.onChange, | ||
onClick = _ref.onClick, | ||
rest = _objectWithoutProperties(_ref, ["children", "value", "onChange", "onClick"]); | ||
rest = _objectWithoutProperties(_ref, ["children", "width", "value", "onChange", "onClick"]); | ||
return _react.default.createElement(Wrapper, null, _react.default.createElement(SearchInput, _extends({ | ||
return _react.default.createElement(Wrapper, { | ||
width: width | ||
}, _react.default.createElement(SearchInput, _extends({ | ||
onChange: onChange, | ||
@@ -91,5 +94,9 @@ value: value | ||
onClick: _propTypes.default.func, | ||
value: _propTypes.default.any | ||
value: _propTypes.default.any, | ||
width: _propTypes.default.string | ||
}; | ||
SearchBar.defaultProps = { | ||
width: '100%' | ||
}; | ||
var _default = SearchBar; | ||
exports.default = _default; |
@@ -14,2 +14,10 @@ /* eslint no-console: 0 */ | ||
it('should render correctly with width', () => { | ||
const tree = mountWithTheme( | ||
<SearchBar onChange={jest.fn()} value="My search" width="200px" />, | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
it('should render correctly with value', () => { | ||
@@ -16,0 +24,0 @@ const tree = mountWithTheme( |
@@ -9,4 +9,5 @@ import React from 'react' | ||
.add('default', () => <SearchBar />) | ||
.add('with width', () => <SearchBar width="200px" />) | ||
.add('with value', () => <SearchBar value="My search" />) | ||
.add('with onChange', () => <SearchBar onChange={action('text-change')} />) | ||
.add('with onClick', () => <SearchBar onClick={action('icon-click')} />) |
@@ -70,8 +70,11 @@ "use strict"; | ||
var children = _ref.children, | ||
width = _ref.width, | ||
onChange = _ref.onChange, | ||
onClick = _ref.onClick, | ||
value = _ref.value, | ||
rest = _objectWithoutProperties(_ref, ["children", "onChange", "onClick", "value"]); | ||
rest = _objectWithoutProperties(_ref, ["children", "width", "onChange", "onClick", "value"]); | ||
return _react.default.createElement(Wrapper, null, _react.default.createElement(SearchInput, _extends({ | ||
return _react.default.createElement(Wrapper, { | ||
width: width | ||
}, _react.default.createElement(SearchInput, _extends({ | ||
onChange: onChange, | ||
@@ -91,5 +94,9 @@ value: value | ||
onClick: _propTypes.default.func, | ||
value: _propTypes.default.any | ||
value: _propTypes.default.any, | ||
width: _propTypes.default.string | ||
}; | ||
SearchBarUnderlined.defaultProps = { | ||
width: '100%' | ||
}; | ||
var _default = SearchBarUnderlined; | ||
exports.default = _default; |
@@ -14,2 +14,14 @@ /* eslint no-console: 0 */ | ||
it('should render correctly with width', () => { | ||
const tree = mountWithTheme( | ||
<SearchBarUnderlined | ||
onChange={jest.fn()} | ||
value="My search" | ||
width="200px" | ||
/>, | ||
) | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
it('should render correctly with value', () => { | ||
@@ -16,0 +28,0 @@ const tree = mountWithTheme( |
@@ -9,2 +9,3 @@ import React from 'react' | ||
.add('default', () => <SearchBarUnderlined />) | ||
.add('with width', () => <SearchBarUnderlined width="200px" />) | ||
.add('with value', () => <SearchBarUnderlined value="My search" />) | ||
@@ -11,0 +12,0 @@ .add('with onChange', () => ( |
{ | ||
"name": "@blockchain-com/components", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Blockchain.com components library", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2795878
13549