@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
86 lines (80 loc) • 3.71 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.StyledSearchInputPseudoElement = exports.StyledSearchInputIconTrigger = exports.StyledSearchInput = exports.StyledMotionSearchInputIconWrapperContent = exports.StyledMotionSearchInputIconWrapper = exports.StyledMotionSearchInputContentWrapper = void 0;
var _react = require("motion/react");
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _keyboardFocusHighlighting = require("../../utils/keyboardFocusHighlighting.styles");
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 StyledSearchInput = exports.StyledSearchInput = _styledComponents.default.div`
display: flex;
align-items: center;
height: ${({
$size
}) => $size === 'medium' ? '42px' : '32px'};
${({
$shouldUseAbsolutePositioning,
theme
}) => $shouldUseAbsolutePositioning ? (0, _styledComponents.css)`
justify-content: center;
aspect-ratio: 1;
border-radius: 3px;
position: relative;
cursor: pointer;
@media (pointer: fine) {
&:hover {
background-color: ${theme[201]};
}
}
` : (0, _styledComponents.css)`
gap: 8px;
justify-content: flex-end;
width: 100%;
`}
`;
const StyledSearchInputPseudoElement = exports.StyledSearchInputPseudoElement = _styledComponents.default.div`
position: absolute;
right: 0;
left: 0;
`;
const StyledMotionSearchInputContentWrapper = exports.StyledMotionSearchInputContentWrapper = (0, _styledComponents.default)(_react.motion.div)`
${({
$shouldUseAbsolutePositioning
}) => $shouldUseAbsolutePositioning && (0, _styledComponents.css)`
position: absolute;
top: 0;
right: 0;
`}
overflow: ${({
$shouldShowKeyboardHighlighting
}) => $shouldShowKeyboardHighlighting ? 'visible' : 'hidden'};
`;
const StyledMotionSearchInputIconWrapperContent = exports.StyledMotionSearchInputIconWrapperContent = (0, _styledComponents.default)(_react.motion.div)`
display: flex;
cursor: pointer;
`;
const StyledSearchInputIconTrigger = exports.StyledSearchInputIconTrigger = _styledComponents.default.div`
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border-radius: 6px;
cursor: pointer;
${({
$shouldShowKeyboardHighlighting
}) => $shouldShowKeyboardHighlighting && (0, _styledComponents.css)`
&:focus-visible {
transition: none;
${_keyboardFocusHighlighting.keyboardFocusHighlightingRingCss}
border-radius: 50%;
box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.35);
outline-offset: 2px;
}
`}
`;
const StyledMotionSearchInputIconWrapper = exports.StyledMotionSearchInputIconWrapper = _styledComponents.default.div`
width: 18px;
`;
//# sourceMappingURL=SearchInput.styles.js.map