@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
94 lines (87 loc) • 3.41 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledSearchBoxBodyHeadGroupName = exports.StyledSearchBoxBodyHead = exports.StyledSearchBoxBodyContent = exports.StyledMotionSearchBoxBody = void 0;
var _react = require("motion/react");
var _styledComponents = _interopRequireWildcard(require("styled-components"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
const StyledMotionSearchBoxBody = exports.StyledMotionSearchBoxBody = (0, _styledComponents.default)(_react.motion.div)`
background: ${({
theme
}) => theme['000']};
position: absolute;
z-index: 4;
display: flex;
flex-direction: column;
border: 1px solid rgba(160, 160, 160, 0.3);
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
border-top: none;
width: ${({
$width
}) => $width - 2}px;
max-height: 300px;
box-shadow: 0 0 0 1px
rgba(${({
theme
}) => theme['009-rgb']}, 0.08) inset;
`;
const StyledSearchBoxBodyHead = exports.StyledSearchBoxBodyHead = _styledComponents.default.div`
padding: 10px 10px 5px;
display: flex;
flex-direction: column;
${({
$hasGroupName
}) => $hasGroupName && (0, _styledComponents.css)`
gap: 15px;
`}
${({
$hasScrolled
}) => $hasScrolled && (0, _styledComponents.css)`
box-shadow: 0 1px 4px #0000001a;
`}
`;
const StyledSearchBoxBodyHeadGroupName = exports.StyledSearchBoxBodyHeadGroupName = _styledComponents.default.div`
color: ${({
theme
}) => theme.text};
font-weight: bold;
`;
const StyledSearchBoxBodyContent = exports.StyledSearchBoxBodyContent = _styledComponents.default.div`
display: flex;
flex-direction: column;
cursor: pointer;
width: 100%;
max-height: ${({
$headHeight
}) => 300 - $headHeight}px;
overflow-y: ${({
$height,
$headHeight
}) => $height + $headHeight <= 300 ? 'hidden' : 'auto'};
// Styles for custom scrollbar
${({
$browser,
theme
}) => $browser === 'firefox' ? (0, _styledComponents.css)`
scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
scrollbar-width: thin;
` : (0, _styledComponents.css)`
&::-webkit-scrollbar {
width: 5px;
}
&::-webkit-scrollbar-track {
background-color: transparent;
}
&::-webkit-scrollbar-button {
background-color: transparent;
height: 5px;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(${theme['text-rgb']}, 0.15);
border-radius: 20px;
}
`}
`;
//# sourceMappingURL=SearchBoxBody.styles.js.map