@chayns-components/emoji-input
Version:
Input field that supports HTML elements and emojis
98 lines (94 loc) • 3.61 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.skinTonePopupContentSize = exports.StyledSkinTonePopupOverlay = exports.StyledSkinTonePopupContentEmoji = exports.StyledSkinTonePopupContent = exports.StyledMotionSkinTonePopup = void 0;
var _react = require("motion/react");
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _alignment = require("../../../../../constants/alignment");
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 StyledMotionSkinTonePopup = exports.StyledMotionSkinTonePopup = (0, _styledComponents.default)(_react.motion.div)`
z-index: 1;
`;
const skinTonePopupContentSize = exports.skinTonePopupContentSize = {
height: 48,
width: 200
};
const StyledSkinTonePopupContent = exports.StyledSkinTonePopupContent = _styledComponents.default.div`
align-items: stretch;
background-color: ${({
theme
}) => theme['001']};
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 3px;
box-shadow: 1px 3px 8px rgb(0 0 0 / 30%);
display: flex;
height: ${skinTonePopupContentSize.height}px;
justify-content: stretch;
position: absolute;
width: ${skinTonePopupContentSize.width}px;
z-index: 2;
&::after {
background-color: inherit;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
border-bottom-right-radius: 3px;
border-right: 1px solid rgba(0, 0, 0, 0.1);
box-shadow: 2px 2px 8px rgb(4 3 4 / 10%);
content: '';
height: 14px;
position: absolute;
width: 14px;
z-index: -2;
${({
$anchorAlignment,
$anchorOffset
}) => {
switch ($anchorAlignment) {
case _alignment.AnchorAlignment.Bottom:
return (0, _styledComponents.css)`
bottom: -7px;
left: calc(50% - 7px + ${$anchorOffset}px);
transform: rotate(45deg);
`;
case _alignment.AnchorAlignment.Top:
return (0, _styledComponents.css)`
top: -7px;
left: calc(50% - 7px + ${$anchorOffset}px);
transform: rotate(225deg);
`;
default:
return undefined;
}
}}
}
&::before {
background-color: inherit;
bottom: 0;
content: '';
left: 0;
position: absolute;
right: 0;
top: 0;
z-index: -1;
}
`;
const StyledSkinTonePopupContentEmoji = exports.StyledSkinTonePopupContentEmoji = _styledComponents.default.div`
align-items: center;
display: flex;
flex: 1 1 auto;
font-size: 24px;
justify-content: center;
background-color: ${({
theme,
$isSelected
}) => $isSelected ? theme['secondary-102'] : 'none'};
`;
const StyledSkinTonePopupOverlay = exports.StyledSkinTonePopupOverlay = _styledComponents.default.div`
cursor: default;
height: 100%;
left: 0;
position: absolute;
width: 100%;
z-index: 1;
`;
//# sourceMappingURL=SkinTonePopup.styles.js.map