@mirror-physics/fractal-ui 0.2.0-next.28 → 0.2.0-next.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +8 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -589,13 +589,13 @@ function UILoader({ size = 48, tone = "neutral", className, style, label = "Load
|
|
|
589
589
|
// src/components/Modal/Modal.tsx
|
|
590
590
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
591
591
|
var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 4L4 12M4 4L12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
592
|
-
function Modal({ open, onClose, title, children, danger, warn, footer, noClose, size = "sm", loading = false, loadingLabel = "Loading", className }) {
|
|
593
|
-
useEscapeDismiss(80, onClose, open && !noClose);
|
|
592
|
+
function Modal({ open, onClose, title, children, danger, warn, footer, noClose, closeDisabled = false, size = "sm", loading = false, loadingLabel = "Loading", className }) {
|
|
593
|
+
useEscapeDismiss(80, onClose, open && !noClose && !closeDisabled);
|
|
594
594
|
if (!open) return null;
|
|
595
595
|
const sizeClass = `fractal-modal-panel--${size}`;
|
|
596
596
|
const accentClass = danger ? "fractal-modal-panel--danger" : warn ? "fractal-modal-panel--warn" : "";
|
|
597
597
|
return (0, import_react_dom.createPortal)(
|
|
598
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fractal-modal-overlay", onClick: noClose ? void 0 : onClose, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
598
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fractal-modal-overlay", onClick: noClose || closeDisabled ? void 0 : onClose, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
599
599
|
"div",
|
|
600
600
|
{
|
|
601
601
|
className: cn("fractal-modal-panel", sizeClass, accentClass, className),
|
|
@@ -603,7 +603,7 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
603
603
|
children: [
|
|
604
604
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fractal-modal-title-row", children: [
|
|
605
605
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: cn("fractal-modal-title", danger && "fractal-modal-title--danger", warn && "fractal-modal-title--warn"), children: title }),
|
|
606
|
-
!noClose && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick: onClose, title: "Close", className: "fractal-modal-close", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon, {}) })
|
|
606
|
+
!noClose && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick: onClose, title: "Close", disabled: closeDisabled, className: "fractal-modal-close", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CloseIcon, {}) })
|
|
607
607
|
] }),
|
|
608
608
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { "aria-busy": loading || void 0, className: cn("fractal-modal-body", size === "lg" && "fractal-modal-body--lg", loading && "fractal-modal-body--loading"), children: loading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(UILoader, { label: loadingLabel }) : children }),
|
|
609
609
|
footer && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fractal-modal-footer", children: footer })
|