UNPKG

@yamada-ui/modal

Version:

Yamada UI modal component

74 lines (71 loc) 2.69 kB
"use client" "use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/modal-body.tsx var modal_body_exports = {}; __export(modal_body_exports, { ModalBody: () => ModalBody }); module.exports = __toCommonJS(modal_body_exports); var import_core = require("@yamada-ui/core"); var import_utils2 = require("@yamada-ui/utils"); // src/modal-context.ts var import_utils = require("@yamada-ui/utils"); var [ModalProvider, useModal] = (0, import_utils.createContext)({ name: `ModalContext`, errorMessage: `useModal returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" ` }); var [DialogProvider, useDialog] = (0, import_utils.createContext)({ name: `DialogContext`, errorMessage: `useDialog returned is 'undefined'. Seems you forgot to wrap the components in "<Dialog />" ` }); var [DrawerProvider, useDrawer] = (0, import_utils.createContext)({ name: `DrawerContext`, errorMessage: `useDrawer returned is 'undefined'. Seems you forgot to wrap the components in "<Drawer />" ` }); // src/modal-body.tsx var import_jsx_runtime = require("react/jsx-runtime"); var ModalBody = (0, import_core.forwardRef)( ({ className, __css, ...rest }, ref) => { const { bodyRef, scrollBehavior, styles } = useModal(); const css = { alignItems: "flex-start", display: "flex", flexDirection: "column", overflow: scrollBehavior === "inside" ? "auto" : void 0, ...__css ? __css : styles.body }; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_core.ui.div, { ref: (0, import_utils2.mergeRefs)(bodyRef, ref), className: (0, import_utils2.cx)("ui-modal__body", className), __css: css, ...rest } ); } ); ModalBody.displayName = "ModalBody"; ModalBody.__ui__ = "ModalBody"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { ModalBody }); //# sourceMappingURL=modal-body.js.map