@ai-matrx/kit 0.5.0 → 0.5.1
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/CHANGELOG.md +12 -0
- package/dist/confirm-opener.cjs +68 -0
- package/dist/confirm-opener.cjs.map +1 -0
- package/dist/confirm-opener.d.cts +65 -0
- package/dist/confirm-opener.d.ts +65 -0
- package/dist/confirm-opener.js +45 -0
- package/dist/confirm-opener.js.map +1 -0
- package/dist/confirm.cjs +38 -30
- package/dist/confirm.cjs.map +1 -1
- package/dist/confirm.d.cts +8 -1
- package/dist/confirm.d.ts +8 -1
- package/dist/confirm.js +38 -30
- package/dist/confirm.js.map +1 -1
- package/dist/index.cjs +38 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -30
- package/dist/index.js.map +1 -1
- package/package.json +12 -2
package/dist/index.js
CHANGED
|
@@ -908,9 +908,9 @@ var AlertDialogDescription = React2.forwardRef(({ className, ...props }, ref) =>
|
|
|
908
908
|
}
|
|
909
909
|
));
|
|
910
910
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
911
|
-
var AlertDialogContent = React2.forwardRef(({ className, children, ...props }, ref) => {
|
|
911
|
+
var AlertDialogContent = React2.forwardRef(({ className, children, container, ...props }, ref) => {
|
|
912
912
|
const hasDescription = treeContainsComponent(children, AlertDialogDescription) || treeContainsComponent(children, AlertDialogPrimitive.Description);
|
|
913
|
-
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
913
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { container: container ?? void 0, children: [
|
|
914
914
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
915
915
|
/* @__PURE__ */ jsxs(
|
|
916
916
|
AlertDialogContentPrimitive,
|
|
@@ -1019,36 +1019,44 @@ function ConfirmDialog({
|
|
|
1019
1019
|
variant = "default",
|
|
1020
1020
|
busy = false,
|
|
1021
1021
|
confirmDisabled = false,
|
|
1022
|
+
portalContainer,
|
|
1022
1023
|
onConfirm
|
|
1023
1024
|
}) {
|
|
1024
|
-
return /* @__PURE__ */ jsx2(AlertDialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs2(
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1025
|
+
return /* @__PURE__ */ jsx2(AlertDialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs2(
|
|
1026
|
+
AlertDialogContent,
|
|
1027
|
+
{
|
|
1028
|
+
className: contentClassName,
|
|
1029
|
+
container: portalContainer ?? void 0,
|
|
1030
|
+
children: [
|
|
1031
|
+
/* @__PURE__ */ jsxs2(AlertDialogHeader, { children: [
|
|
1032
|
+
/* @__PURE__ */ jsx2(AlertDialogTitle, { children: title }),
|
|
1033
|
+
description ? /* @__PURE__ */ jsx2(AlertDialogDescription, { children: description }) : null
|
|
1034
|
+
] }),
|
|
1035
|
+
content ?? null,
|
|
1036
|
+
/* @__PURE__ */ jsxs2(AlertDialogFooter, { children: [
|
|
1037
|
+
cancelLabel === null ? null : /* @__PURE__ */ jsx2(AlertDialogCancel, { className: "max-lg:min-h-11", disabled: busy, children: cancelLabel }),
|
|
1038
|
+
/* @__PURE__ */ jsxs2(
|
|
1039
|
+
AlertDialogAction,
|
|
1040
|
+
{
|
|
1041
|
+
disabled: busy || confirmDisabled,
|
|
1042
|
+
onClick: (event) => {
|
|
1043
|
+
event.preventDefault();
|
|
1044
|
+
void onConfirm();
|
|
1045
|
+
},
|
|
1046
|
+
className: cn(
|
|
1047
|
+
"max-lg:min-h-11",
|
|
1048
|
+
variant === "destructive" && "bg-destructive text-destructive-foreground hover:bg-destructive/90"
|
|
1049
|
+
),
|
|
1050
|
+
children: [
|
|
1051
|
+
busy ? /* @__PURE__ */ jsx2(SpinnerIcon, { className: "mr-2 h-4 w-4 animate-spin" }) : null,
|
|
1052
|
+
confirmLabel
|
|
1053
|
+
]
|
|
1054
|
+
}
|
|
1055
|
+
)
|
|
1056
|
+
] })
|
|
1057
|
+
]
|
|
1058
|
+
}
|
|
1059
|
+
) });
|
|
1052
1060
|
}
|
|
1053
1061
|
|
|
1054
1062
|
// src/confirm/host.tsx
|