@gssfed/vital-ui-kit-react
Version:
Vital UI Kit for React!
46 lines (37 loc) • 1.69 kB
JavaScript
var _templateObject = _taggedTemplateLiteral([''], ['']),
_templateObject2 = _taggedTemplateLiteral(['\n display: block;\n padding: 0.5em 1em 0.5em;\n clear: both;\n line-height: 1;\n color: ', ';\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n\n &:hover {\n text-decoration: none;\n background-color: ', ';\n }\n'], ['\n display: block;\n padding: 0.5em 1em 0.5em;\n clear: both;\n line-height: 1;\n color: ', ';\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n\n &:hover {\n text-decoration: none;\n background-color: ', ';\n }\n']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
import * as React from 'react';
import styled from 'styled-components';
var Root = styled.li(_templateObject);
var Item = styled.div(_templateObject2, function (_ref) {
var theme = _ref.theme;
return theme.select.item.color;
}, function (_ref2) {
var theme = _ref2.theme;
return theme.select.item.hoverBg;
});
var DroplistItem = function DroplistItem(_ref3) {
var item = _ref3.item,
onClick = _ref3.onClick;
return React.createElement(
Root,
null,
React.createElement(
Item,
{ value: item.value, onClick: function (_onClick) {
function onClick() {
return _onClick.apply(this, arguments);
}
onClick.toString = function () {
return _onClick.toString();
};
return onClick;
}(function () {
return onClick(item);
}) },
item.content
)
);
};
export default DroplistItem;