@ai-matrx/design-system 0.53.3 → 0.54.0
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 +15 -0
- package/dist/data-table/index.cjs +25 -23
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +25 -23
- package/dist/data-table/index.js.map +1 -1
- package/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +48 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1856,6 +1856,7 @@ function ConfirmDialog({
|
|
|
1856
1856
|
variant = "default",
|
|
1857
1857
|
busy = false,
|
|
1858
1858
|
confirmDisabled = false,
|
|
1859
|
+
confirmHeld = false,
|
|
1859
1860
|
portalContainer,
|
|
1860
1861
|
onConfirm
|
|
1861
1862
|
}) {
|
|
@@ -1872,7 +1873,7 @@ function ConfirmDialog({
|
|
|
1872
1873
|
content ?? null,
|
|
1873
1874
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(AlertDialogFooter, { children: [
|
|
1874
1875
|
cancelLabel === null ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AlertDialogCancel, { className: "max-lg:min-h-11", disabled: busy, children: cancelLabel }),
|
|
1875
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1876
|
+
confirmHeld ? null : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1876
1877
|
AlertDialogAction,
|
|
1877
1878
|
{
|
|
1878
1879
|
disabled: busy || confirmDisabled,
|
|
@@ -1906,6 +1907,20 @@ var React15 = __toESM(require("react"), 1);
|
|
|
1906
1907
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1907
1908
|
function ConfirmDialogHost() {
|
|
1908
1909
|
const { shown, open, settle } = (0, import_opener_react.useOpenerHost)(import_confirm_opener.confirmOpener);
|
|
1910
|
+
const [readyFor, setReadyFor] = React15.useState(null);
|
|
1911
|
+
const ready = shown?.ready;
|
|
1912
|
+
React15.useEffect(() => {
|
|
1913
|
+
if (!shown || !ready) return void 0;
|
|
1914
|
+
let live = true;
|
|
1915
|
+
const release = () => {
|
|
1916
|
+
if (live) setReadyFor(shown);
|
|
1917
|
+
};
|
|
1918
|
+
Promise.resolve(ready).then(release, release);
|
|
1919
|
+
return () => {
|
|
1920
|
+
live = false;
|
|
1921
|
+
};
|
|
1922
|
+
}, [shown, ready]);
|
|
1923
|
+
const held = !!ready && readyFor !== shown;
|
|
1909
1924
|
const handleConfirm = React15.useCallback(() => settle(true), [settle]);
|
|
1910
1925
|
const handleOpenChange = React15.useCallback(
|
|
1911
1926
|
(next) => {
|
|
@@ -1923,6 +1938,7 @@ function ConfirmDialogHost() {
|
|
|
1923
1938
|
confirmLabel: shown?.confirmLabel,
|
|
1924
1939
|
cancelLabel: shown?.cancelLabel,
|
|
1925
1940
|
variant: shown?.variant,
|
|
1941
|
+
confirmHeld: held,
|
|
1926
1942
|
onConfirm: handleConfirm
|
|
1927
1943
|
}
|
|
1928
1944
|
);
|