@geezee/react-ui
Version:
Modern and minimalist React UI library.
34 lines (31 loc) • 2.61 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _JSXStyle from "styled-jsx/style";
import React from 'react';
import useTheme from '../styles/use-theme';
import withDefaults from '../utils/with-defaults';
var defaultProps = {
line: false,
title: false,
className: ''
};
var PopoverItem = function PopoverItem(_ref) {
var children = _ref.children,
line = _ref.line,
title = _ref.title,
className = _ref.className,
props = _objectWithoutProperties(_ref, ["children", "line", "title", "className"]);
var theme = useTheme();
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({}, props, {
className: _JSXStyle.dynamic([["3769315592", [theme.palette.cNeutral5, theme.layout.gap, theme.palette.cNeutral7, theme.palette.cNeutral7, theme.palette.cNeutral1]]]) + " " + (props && props.className != null && props.className || "item ".concat(line && !title ? 'line' : '', " ").concat(title ? 'title' : '', " ").concat(className))
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
id: "3769315592",
dynamic: [theme.palette.cNeutral5, theme.layout.gap, theme.palette.cNeutral7, theme.palette.cNeutral7, theme.palette.cNeutral1]
}, ".item.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:".concat(theme.palette.cNeutral5, ";font-size:1rem;line-height:1.4286rem;text-align:left;-webkit-transition:color 0.1s ease 0s,background-color 0.1s ease 0s;transition:color 0.1s ease 0s,background-color 0.1s ease 0s;width:100%;padding:").concat(theme.layout.gap, ";box-sizing:border-box;}.item.__jsx-style-dynamic-selector:hover{color:").concat(theme.palette.cNeutral7, ";}.item.__jsx-style-dynamic-selector>*{margin:0;}.item.title.__jsx-style-dynamic-selector{line-height:1.1429rem;font-weight:500;font-size:1rem;color:").concat(theme.palette.cNeutral7, ";}.item.line.__jsx-style-dynamic-selector{line-height:0;height:0;padding:0;border-top:1px solid ").concat(theme.palette.cNeutral1, ";width:100%;}"))), title && line && /*#__PURE__*/React.createElement(PopoverItem, {
line: true,
title: false,
className: ""
}));
};
var MemoPopoverItem = React.memo(PopoverItem);
export default withDefaults(MemoPopoverItem, defaultProps);