@ai-matrx/kit 0.5.0 → 0.5.2
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 +22 -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 +40 -31
- 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 +40 -31
- package/dist/confirm.js.map +1 -1
- package/dist/index.cjs +40 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -31
- package/dist/index.js.map +1 -1
- package/dist/react-tree.cjs +2 -1
- package/dist/react-tree.cjs.map +1 -1
- package/dist/react-tree.js +2 -1
- package/dist/react-tree.js.map +1 -1
- package/dist/short-link.cjs +55 -0
- package/dist/short-link.cjs.map +1 -0
- package/dist/short-link.d.cts +52 -0
- package/dist/short-link.d.ts +52 -0
- package/dist/short-link.js +34 -0
- package/dist/short-link.js.map +1 -0
- package/package.json +24 -3
package/dist/index.js
CHANGED
|
@@ -868,7 +868,8 @@ function treeContainsComponent(node, Component) {
|
|
|
868
868
|
(child) => treeContainsComponent(child, Component)
|
|
869
869
|
);
|
|
870
870
|
}
|
|
871
|
-
|
|
871
|
+
const runtimeProcess = globalThis.process;
|
|
872
|
+
if (runtimeProcess?.env?.NODE_ENV !== "production") {
|
|
872
873
|
const keys = typeof node === "object" ? ` with keys {${Object.keys(node).join(", ")}}` : "";
|
|
873
874
|
console.error(
|
|
874
875
|
`[treeContainsComponent] A non-renderable value${keys} is being passed as a React child. React will throw 'Objects are not valid as a React child' at the real render site. Stringify it (e.g. JSON.stringify) before rendering.`,
|
|
@@ -908,9 +909,9 @@ var AlertDialogDescription = React2.forwardRef(({ className, ...props }, ref) =>
|
|
|
908
909
|
}
|
|
909
910
|
));
|
|
910
911
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
911
|
-
var AlertDialogContent = React2.forwardRef(({ className, children, ...props }, ref) => {
|
|
912
|
+
var AlertDialogContent = React2.forwardRef(({ className, children, container, ...props }, ref) => {
|
|
912
913
|
const hasDescription = treeContainsComponent(children, AlertDialogDescription) || treeContainsComponent(children, AlertDialogPrimitive.Description);
|
|
913
|
-
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
914
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { container: container ?? void 0, children: [
|
|
914
915
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
915
916
|
/* @__PURE__ */ jsxs(
|
|
916
917
|
AlertDialogContentPrimitive,
|
|
@@ -1019,36 +1020,44 @@ function ConfirmDialog({
|
|
|
1019
1020
|
variant = "default",
|
|
1020
1021
|
busy = false,
|
|
1021
1022
|
confirmDisabled = false,
|
|
1023
|
+
portalContainer,
|
|
1022
1024
|
onConfirm
|
|
1023
1025
|
}) {
|
|
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
|
-
|
|
1026
|
+
return /* @__PURE__ */ jsx2(AlertDialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs2(
|
|
1027
|
+
AlertDialogContent,
|
|
1028
|
+
{
|
|
1029
|
+
className: contentClassName,
|
|
1030
|
+
container: portalContainer ?? void 0,
|
|
1031
|
+
children: [
|
|
1032
|
+
/* @__PURE__ */ jsxs2(AlertDialogHeader, { children: [
|
|
1033
|
+
/* @__PURE__ */ jsx2(AlertDialogTitle, { children: title }),
|
|
1034
|
+
description ? /* @__PURE__ */ jsx2(AlertDialogDescription, { children: description }) : null
|
|
1035
|
+
] }),
|
|
1036
|
+
content ?? null,
|
|
1037
|
+
/* @__PURE__ */ jsxs2(AlertDialogFooter, { children: [
|
|
1038
|
+
cancelLabel === null ? null : /* @__PURE__ */ jsx2(AlertDialogCancel, { className: "max-lg:min-h-11", disabled: busy, children: cancelLabel }),
|
|
1039
|
+
/* @__PURE__ */ jsxs2(
|
|
1040
|
+
AlertDialogAction,
|
|
1041
|
+
{
|
|
1042
|
+
disabled: busy || confirmDisabled,
|
|
1043
|
+
onClick: (event) => {
|
|
1044
|
+
event.preventDefault();
|
|
1045
|
+
void onConfirm();
|
|
1046
|
+
},
|
|
1047
|
+
className: cn(
|
|
1048
|
+
"max-lg:min-h-11",
|
|
1049
|
+
variant === "destructive" && "bg-destructive text-destructive-foreground hover:bg-destructive/90"
|
|
1050
|
+
),
|
|
1051
|
+
children: [
|
|
1052
|
+
busy ? /* @__PURE__ */ jsx2(SpinnerIcon, { className: "mr-2 h-4 w-4 animate-spin" }) : null,
|
|
1053
|
+
confirmLabel
|
|
1054
|
+
]
|
|
1055
|
+
}
|
|
1056
|
+
)
|
|
1057
|
+
] })
|
|
1058
|
+
]
|
|
1059
|
+
}
|
|
1060
|
+
) });
|
|
1052
1061
|
}
|
|
1053
1062
|
|
|
1054
1063
|
// src/confirm/host.tsx
|