@onwave/ui
Version:
onwave ui library
16 lines • 1.28 kB
JavaScript
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
import styled from "@emotion/styled";
import React, { forwardRef } from "react";
export var DropdownMenu = forwardRef(function (_a, ref) {
var isOpen = _a.isOpen, children = _a.children, position = _a.position;
return isOpen ? (React.createElement(Wrapper, { ref: ref, position: position }, children)) : (React.createElement(React.Fragment, null));
});
var Wrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n background: #fff;\n margin-top: 4px;\n min-width: 180px;\n box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.1);\n z-index: 150;\n ", "\n"], ["\n position: absolute;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n background: #fff;\n margin-top: 4px;\n min-width: 180px;\n box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.1);\n z-index: 150;\n ", "\n"])), function (_a) {
var position = _a.position;
return position === "right" && "right: 0;";
});
var templateObject_1;
//# sourceMappingURL=DropdownMenu.js.map