@jackcrane/ui 0.1.12 → 0.1.13
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/jcui.cjs.js +59 -33
- package/dist/jcui.es.js +59 -33
- package/package.json +1 -1
package/dist/jcui.cjs.js
CHANGED
|
@@ -27367,39 +27367,65 @@ const styles$1 = {
|
|
|
27367
27367
|
};
|
|
27368
27368
|
const useModal = ({ title: title2, content: content2, footer: footer2 }) => {
|
|
27369
27369
|
const [open2, setOpen] = React__namespace.useState(false);
|
|
27370
|
-
const
|
|
27371
|
-
|
|
27372
|
-
|
|
27373
|
-
|
|
27374
|
-
|
|
27375
|
-
|
|
27376
|
-
|
|
27377
|
-
|
|
27378
|
-
|
|
27379
|
-
|
|
27380
|
-
|
|
27381
|
-
|
|
27382
|
-
|
|
27383
|
-
|
|
27384
|
-
|
|
27385
|
-
|
|
27386
|
-
|
|
27387
|
-
|
|
27388
|
-
|
|
27389
|
-
|
|
27390
|
-
|
|
27391
|
-
|
|
27392
|
-
|
|
27393
|
-
|
|
27394
|
-
|
|
27395
|
-
|
|
27396
|
-
|
|
27397
|
-
|
|
27398
|
-
|
|
27399
|
-
|
|
27400
|
-
|
|
27401
|
-
|
|
27402
|
-
|
|
27370
|
+
const modalConfigRef = React__namespace.useRef({
|
|
27371
|
+
open: open2,
|
|
27372
|
+
setOpen,
|
|
27373
|
+
title: title2,
|
|
27374
|
+
content: content2,
|
|
27375
|
+
footer: footer2
|
|
27376
|
+
});
|
|
27377
|
+
modalConfigRef.current = {
|
|
27378
|
+
open: open2,
|
|
27379
|
+
setOpen,
|
|
27380
|
+
title: title2,
|
|
27381
|
+
content: content2,
|
|
27382
|
+
footer: footer2
|
|
27383
|
+
};
|
|
27384
|
+
const Modal = React__namespace.useMemo(
|
|
27385
|
+
() => function Modal2() {
|
|
27386
|
+
const {
|
|
27387
|
+
open: isOpen,
|
|
27388
|
+
setOpen: onOpenChange,
|
|
27389
|
+
title: currentTitle,
|
|
27390
|
+
content: currentContent,
|
|
27391
|
+
footer: currentFooter
|
|
27392
|
+
} = modalConfigRef.current;
|
|
27393
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Root, { open: isOpen, onOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Portal, { children: [
|
|
27394
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { className: `${styles$1.overlay} ${hatchStyles.hatch}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.overlayBackdrop }) }),
|
|
27395
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27396
|
+
Content,
|
|
27397
|
+
{
|
|
27398
|
+
className: `${styles$1.content} ${chamferStyles.chamfer}`,
|
|
27399
|
+
children: [
|
|
27400
|
+
currentTitle && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27401
|
+
"div",
|
|
27402
|
+
{
|
|
27403
|
+
style: {
|
|
27404
|
+
display: "flex",
|
|
27405
|
+
flexDirection: "row",
|
|
27406
|
+
justifyContent: "space-between",
|
|
27407
|
+
alignItems: "center",
|
|
27408
|
+
margin: -12,
|
|
27409
|
+
marginBottom: 0,
|
|
27410
|
+
padding: 12,
|
|
27411
|
+
borderBottom: "var(--border-thickness) solid var(--border-color)"
|
|
27412
|
+
},
|
|
27413
|
+
className: classNames(hatchStyles.hatch),
|
|
27414
|
+
children: [
|
|
27415
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Title, { className: styles$1.title, children: currentTitle }),
|
|
27416
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Close, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", variant: "danger", children: "Close" }) })
|
|
27417
|
+
]
|
|
27418
|
+
}
|
|
27419
|
+
),
|
|
27420
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.body, children: currentContent }),
|
|
27421
|
+
currentFooter && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames(styles$1.footer, hatchStyles.hatch), children: currentFooter })
|
|
27422
|
+
]
|
|
27423
|
+
}
|
|
27424
|
+
)
|
|
27425
|
+
] }) });
|
|
27426
|
+
},
|
|
27427
|
+
[]
|
|
27428
|
+
);
|
|
27403
27429
|
const trigger2 = (node) => /* @__PURE__ */ jsxRuntimeExports.jsx(Trigger, { asChild: true, children: node });
|
|
27404
27430
|
return { Modal, trigger: trigger2, open: open2, setOpen };
|
|
27405
27431
|
};
|
package/dist/jcui.es.js
CHANGED
|
@@ -27349,39 +27349,65 @@ const styles$1 = {
|
|
|
27349
27349
|
};
|
|
27350
27350
|
const useModal = ({ title: title2, content: content2, footer: footer2 }) => {
|
|
27351
27351
|
const [open2, setOpen] = React.useState(false);
|
|
27352
|
-
const
|
|
27353
|
-
|
|
27354
|
-
|
|
27355
|
-
|
|
27356
|
-
|
|
27357
|
-
|
|
27358
|
-
|
|
27359
|
-
|
|
27360
|
-
|
|
27361
|
-
|
|
27362
|
-
|
|
27363
|
-
|
|
27364
|
-
|
|
27365
|
-
|
|
27366
|
-
|
|
27367
|
-
|
|
27368
|
-
|
|
27369
|
-
|
|
27370
|
-
|
|
27371
|
-
|
|
27372
|
-
|
|
27373
|
-
|
|
27374
|
-
|
|
27375
|
-
|
|
27376
|
-
|
|
27377
|
-
|
|
27378
|
-
|
|
27379
|
-
|
|
27380
|
-
|
|
27381
|
-
|
|
27382
|
-
|
|
27383
|
-
|
|
27384
|
-
|
|
27352
|
+
const modalConfigRef = React.useRef({
|
|
27353
|
+
open: open2,
|
|
27354
|
+
setOpen,
|
|
27355
|
+
title: title2,
|
|
27356
|
+
content: content2,
|
|
27357
|
+
footer: footer2
|
|
27358
|
+
});
|
|
27359
|
+
modalConfigRef.current = {
|
|
27360
|
+
open: open2,
|
|
27361
|
+
setOpen,
|
|
27362
|
+
title: title2,
|
|
27363
|
+
content: content2,
|
|
27364
|
+
footer: footer2
|
|
27365
|
+
};
|
|
27366
|
+
const Modal = React.useMemo(
|
|
27367
|
+
() => function Modal2() {
|
|
27368
|
+
const {
|
|
27369
|
+
open: isOpen,
|
|
27370
|
+
setOpen: onOpenChange,
|
|
27371
|
+
title: currentTitle,
|
|
27372
|
+
content: currentContent,
|
|
27373
|
+
footer: currentFooter
|
|
27374
|
+
} = modalConfigRef.current;
|
|
27375
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Root, { open: isOpen, onOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Portal, { children: [
|
|
27376
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { className: `${styles$1.overlay} ${hatchStyles.hatch}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.overlayBackdrop }) }),
|
|
27377
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27378
|
+
Content,
|
|
27379
|
+
{
|
|
27380
|
+
className: `${styles$1.content} ${chamferStyles.chamfer}`,
|
|
27381
|
+
children: [
|
|
27382
|
+
currentTitle && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27383
|
+
"div",
|
|
27384
|
+
{
|
|
27385
|
+
style: {
|
|
27386
|
+
display: "flex",
|
|
27387
|
+
flexDirection: "row",
|
|
27388
|
+
justifyContent: "space-between",
|
|
27389
|
+
alignItems: "center",
|
|
27390
|
+
margin: -12,
|
|
27391
|
+
marginBottom: 0,
|
|
27392
|
+
padding: 12,
|
|
27393
|
+
borderBottom: "var(--border-thickness) solid var(--border-color)"
|
|
27394
|
+
},
|
|
27395
|
+
className: classNames(hatchStyles.hatch),
|
|
27396
|
+
children: [
|
|
27397
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Title, { className: styles$1.title, children: currentTitle }),
|
|
27398
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Close, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "small", variant: "danger", children: "Close" }) })
|
|
27399
|
+
]
|
|
27400
|
+
}
|
|
27401
|
+
),
|
|
27402
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.body, children: currentContent }),
|
|
27403
|
+
currentFooter && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classNames(styles$1.footer, hatchStyles.hatch), children: currentFooter })
|
|
27404
|
+
]
|
|
27405
|
+
}
|
|
27406
|
+
)
|
|
27407
|
+
] }) });
|
|
27408
|
+
},
|
|
27409
|
+
[]
|
|
27410
|
+
);
|
|
27385
27411
|
const trigger2 = (node) => /* @__PURE__ */ jsxRuntimeExports.jsx(Trigger, { asChild: true, children: node });
|
|
27386
27412
|
return { Modal, trigger: trigger2, open: open2, setOpen };
|
|
27387
27413
|
};
|