@yamada-ui/modal
Version:
Yamada UI modal component
95 lines (91 loc) • 3.24 kB
JavaScript
"use client"
;
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/dialog-footer.tsx
var dialog_footer_exports = {};
__export(dialog_footer_exports, {
DialogFooter: () => DialogFooter
});
module.exports = __toCommonJS(dialog_footer_exports);
var import_core2 = require("@yamada-ui/core");
var import_utils3 = 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-footer.tsx
var import_core = require("@yamada-ui/core");
var import_utils2 = require("@yamada-ui/utils");
var import_jsx_runtime = require("react/jsx-runtime");
var ModalFooter = (0, import_core.forwardRef)(
({ className, __css, ...rest }, ref) => {
const { styles } = useModal();
const css = {
alignItems: "center",
display: "flex",
justifyContent: "flex-end",
...__css ? __css : styles.footer
};
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
import_core.ui.footer,
{
ref,
className: (0, import_utils2.cx)("ui-modal__footer", className),
__css: css,
...rest
}
);
}
);
ModalFooter.displayName = "ModalFooter";
ModalFooter.__ui__ = "ModalFooter";
// src/dialog-footer.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var DialogFooter = (0, import_core2.forwardRef)(
({ className, ...rest }, ref) => {
const styles = useDialog();
const css = { ...styles.footer };
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
ModalFooter,
{
ref,
className: (0, import_utils3.cx)("ui-dialog__footer", className),
__css: css,
...rest
}
);
}
);
DialogFooter.displayName = "DialogFooter";
DialogFooter.__ui__ = "DialogFooter";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DialogFooter
});
//# sourceMappingURL=dialog-footer.js.map