@veracity/vui
Version:
Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.
36 lines (34 loc) • 1.01 kB
JavaScript
import { cs } from "../utils/styles.js";
import { omitThemingProps, useStyleConfig } from "../core/theme.js";
import vui from "../core/vui.js";
import { Box } from "../box/box.js";
import { Dialog } from "../dialog/dialog.js";
import { jsx } from "react/jsx-runtime";
//#region src/drawer/drawer.tsx
/** Drawer component based on Dialog. */
const Drawer = vui((props, ref) => {
const { children, className, dialogProps, isLeft, isOpen, onClose } = omitThemingProps(props);
const styles = useStyleConfig("Drawer", props);
return /* @__PURE__ */ jsx(Dialog, {
isOpen,
onClose,
placement: isLeft ? "left" : "right",
ref,
...dialogProps,
modalType: "drawer",
children: /* @__PURE__ */ jsx(Box, {
className: cs("vui-drawer", className),
column: true,
p: 3,
...styles,
h: "100vh",
overflow: "hidden",
children
})
});
});
Drawer.displayName = "Drawer";
//#endregion
export { Drawer, Drawer as default };
globalThis.__vuiVersion__ = "5.3.1"
//# sourceMappingURL=drawer.js.map