gwan-design-system 0.1.15 → 0.1.16
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.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2335,23 +2335,31 @@ var Modal = ({
|
|
|
2335
2335
|
var _a;
|
|
2336
2336
|
(_a = modalRef.current) == null ? void 0 : _a.focus();
|
|
2337
2337
|
}, []);
|
|
2338
|
+
(0, import_react7.useEffect)(() => {
|
|
2339
|
+
const handler = (e) => {
|
|
2340
|
+
if (e.key === "Escape") onClear();
|
|
2341
|
+
};
|
|
2342
|
+
window.addEventListener("keydown", handler);
|
|
2343
|
+
return () => window.removeEventListener("keydown", handler);
|
|
2344
|
+
}, [onClear]);
|
|
2338
2345
|
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
2339
2346
|
"div",
|
|
2340
2347
|
{
|
|
2341
2348
|
className: `fixed inset-0 flex items-center justify-center bg-[rgba(0,0,0,0.3)] ${className}`,
|
|
2349
|
+
onMouseDown: onClear,
|
|
2342
2350
|
children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
2343
2351
|
"div",
|
|
2344
2352
|
{
|
|
2345
2353
|
ref: modalRef,
|
|
2346
2354
|
tabIndex: -1,
|
|
2347
2355
|
className: `bg-white p-4 ${size !== "w-full h-full" /* FULL */ && "rounded-lg"} absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col gap-4 ${size}`,
|
|
2348
|
-
|
|
2356
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
2349
2357
|
children: [
|
|
2350
2358
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex flex-row gap-4 items-center", children: [
|
|
2351
2359
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "flex-1 text-3xl", children: title }),
|
|
2352
2360
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "size-4 cursor-pointer", onClick: () => onClear(), children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Cross, {}) })
|
|
2353
2361
|
] }),
|
|
2354
|
-
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "flex-1
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "flex-1", children })
|
|
2355
2363
|
]
|
|
2356
2364
|
}
|
|
2357
2365
|
)
|