@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.d.cts
CHANGED
|
@@ -641,6 +641,13 @@ interface ConfirmDialogProps {
|
|
|
641
641
|
* choice is missing, not loading — `busy` would show a misleading spinner.
|
|
642
642
|
*/
|
|
643
643
|
confirmDisabled?: boolean | undefined;
|
|
644
|
+
/**
|
|
645
|
+
* The question is not answerable yet — Confirm is ABSENT, not disabled (a
|
|
646
|
+
* control is absent or honest, never dead). The body carries its own loading
|
|
647
|
+
* state; Cancel stays. Set by `ConfirmDialogHost` while `ConfirmOptions.ready`
|
|
648
|
+
* is pending (0.54.0).
|
|
649
|
+
*/
|
|
650
|
+
confirmHeld?: boolean | undefined;
|
|
644
651
|
/**
|
|
645
652
|
* Explicit portal target. Default (undefined): the container injected by
|
|
646
653
|
* `PortalContainerProvider`, else `document.body`. Hosts with retargeting
|
|
@@ -654,7 +661,7 @@ interface ConfirmDialogProps {
|
|
|
654
661
|
* Drop-in replacement for `window.confirm`. Use this anywhere you would
|
|
655
662
|
* otherwise reach for a browser-level confirm dialog.
|
|
656
663
|
*/
|
|
657
|
-
declare function ConfirmDialog({ open, onOpenChange, title, description, content, contentClassName, confirmLabel, cancelLabel, variant, busy, confirmDisabled, portalContainer, onConfirm, }: ConfirmDialogProps): React.JSX.Element;
|
|
664
|
+
declare function ConfirmDialog({ open, onOpenChange, title, description, content, contentClassName, confirmLabel, cancelLabel, variant, busy, confirmDisabled, confirmHeld, portalContainer, onConfirm, }: ConfirmDialogProps): React.JSX.Element;
|
|
658
665
|
|
|
659
666
|
declare function ConfirmDialogHost(): React.JSX.Element;
|
|
660
667
|
|
package/dist/index.d.ts
CHANGED
|
@@ -641,6 +641,13 @@ interface ConfirmDialogProps {
|
|
|
641
641
|
* choice is missing, not loading — `busy` would show a misleading spinner.
|
|
642
642
|
*/
|
|
643
643
|
confirmDisabled?: boolean | undefined;
|
|
644
|
+
/**
|
|
645
|
+
* The question is not answerable yet — Confirm is ABSENT, not disabled (a
|
|
646
|
+
* control is absent or honest, never dead). The body carries its own loading
|
|
647
|
+
* state; Cancel stays. Set by `ConfirmDialogHost` while `ConfirmOptions.ready`
|
|
648
|
+
* is pending (0.54.0).
|
|
649
|
+
*/
|
|
650
|
+
confirmHeld?: boolean | undefined;
|
|
644
651
|
/**
|
|
645
652
|
* Explicit portal target. Default (undefined): the container injected by
|
|
646
653
|
* `PortalContainerProvider`, else `document.body`. Hosts with retargeting
|
|
@@ -654,7 +661,7 @@ interface ConfirmDialogProps {
|
|
|
654
661
|
* Drop-in replacement for `window.confirm`. Use this anywhere you would
|
|
655
662
|
* otherwise reach for a browser-level confirm dialog.
|
|
656
663
|
*/
|
|
657
|
-
declare function ConfirmDialog({ open, onOpenChange, title, description, content, contentClassName, confirmLabel, cancelLabel, variant, busy, confirmDisabled, portalContainer, onConfirm, }: ConfirmDialogProps): React.JSX.Element;
|
|
664
|
+
declare function ConfirmDialog({ open, onOpenChange, title, description, content, contentClassName, confirmLabel, cancelLabel, variant, busy, confirmDisabled, confirmHeld, portalContainer, onConfirm, }: ConfirmDialogProps): React.JSX.Element;
|
|
658
665
|
|
|
659
666
|
declare function ConfirmDialogHost(): React.JSX.Element;
|
|
660
667
|
|
package/dist/index.js
CHANGED
|
@@ -1532,6 +1532,7 @@ function ConfirmDialog({
|
|
|
1532
1532
|
variant = "default",
|
|
1533
1533
|
busy = false,
|
|
1534
1534
|
confirmDisabled = false,
|
|
1535
|
+
confirmHeld = false,
|
|
1535
1536
|
portalContainer,
|
|
1536
1537
|
onConfirm
|
|
1537
1538
|
}) {
|
|
@@ -1548,7 +1549,7 @@ function ConfirmDialog({
|
|
|
1548
1549
|
content ?? null,
|
|
1549
1550
|
/* @__PURE__ */ jsxs9(AlertDialogFooter, { children: [
|
|
1550
1551
|
cancelLabel === null ? null : /* @__PURE__ */ jsx18(AlertDialogCancel, { className: "max-lg:min-h-11", disabled: busy, children: cancelLabel }),
|
|
1551
|
-
/* @__PURE__ */ jsxs9(
|
|
1552
|
+
confirmHeld ? null : /* @__PURE__ */ jsxs9(
|
|
1552
1553
|
AlertDialogAction,
|
|
1553
1554
|
{
|
|
1554
1555
|
disabled: busy || confirmDisabled,
|
|
@@ -1582,6 +1583,20 @@ import * as React15 from "react";
|
|
|
1582
1583
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1583
1584
|
function ConfirmDialogHost() {
|
|
1584
1585
|
const { shown, open, settle } = useOpenerHost(confirmOpener);
|
|
1586
|
+
const [readyFor, setReadyFor] = React15.useState(null);
|
|
1587
|
+
const ready = shown?.ready;
|
|
1588
|
+
React15.useEffect(() => {
|
|
1589
|
+
if (!shown || !ready) return void 0;
|
|
1590
|
+
let live = true;
|
|
1591
|
+
const release = () => {
|
|
1592
|
+
if (live) setReadyFor(shown);
|
|
1593
|
+
};
|
|
1594
|
+
Promise.resolve(ready).then(release, release);
|
|
1595
|
+
return () => {
|
|
1596
|
+
live = false;
|
|
1597
|
+
};
|
|
1598
|
+
}, [shown, ready]);
|
|
1599
|
+
const held = !!ready && readyFor !== shown;
|
|
1585
1600
|
const handleConfirm = React15.useCallback(() => settle(true), [settle]);
|
|
1586
1601
|
const handleOpenChange = React15.useCallback(
|
|
1587
1602
|
(next) => {
|
|
@@ -1599,6 +1614,7 @@ function ConfirmDialogHost() {
|
|
|
1599
1614
|
confirmLabel: shown?.confirmLabel,
|
|
1600
1615
|
cancelLabel: shown?.cancelLabel,
|
|
1601
1616
|
variant: shown?.variant,
|
|
1617
|
+
confirmHeld: held,
|
|
1602
1618
|
onConfirm: handleConfirm
|
|
1603
1619
|
}
|
|
1604
1620
|
);
|
|
@@ -1612,10 +1628,10 @@ import * as React18 from "react";
|
|
|
1612
1628
|
import * as React16 from "react";
|
|
1613
1629
|
|
|
1614
1630
|
// src/use-scroll-fade.ts
|
|
1615
|
-
import { useCallback as useCallback2, useEffect, useRef, useState as
|
|
1631
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useRef, useState as useState3 } from "react";
|
|
1616
1632
|
var EPSILON = 2;
|
|
1617
1633
|
function useScrollFade() {
|
|
1618
|
-
const [state, setState] =
|
|
1634
|
+
const [state, setState] = useState3({
|
|
1619
1635
|
top: false,
|
|
1620
1636
|
bottom: false
|
|
1621
1637
|
});
|
|
@@ -1653,7 +1669,7 @@ function useScrollFade() {
|
|
|
1653
1669
|
},
|
|
1654
1670
|
[measure]
|
|
1655
1671
|
);
|
|
1656
|
-
|
|
1672
|
+
useEffect2(() => () => cleanupRef.current?.(), []);
|
|
1657
1673
|
return {
|
|
1658
1674
|
ref,
|
|
1659
1675
|
state,
|
|
@@ -2059,7 +2075,7 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
2059
2075
|
// src/creatable-picker.tsx
|
|
2060
2076
|
import {
|
|
2061
2077
|
useRef as useRef4,
|
|
2062
|
-
useState as
|
|
2078
|
+
useState as useState4
|
|
2063
2079
|
} from "react";
|
|
2064
2080
|
|
|
2065
2081
|
// src/popover.tsx
|
|
@@ -2135,11 +2151,11 @@ function CreatablePicker({
|
|
|
2135
2151
|
renderSelected,
|
|
2136
2152
|
size = "sm"
|
|
2137
2153
|
}) {
|
|
2138
|
-
const [open, setOpen] =
|
|
2139
|
-
const [query, setQuery] =
|
|
2140
|
-
const [busy, setBusy] =
|
|
2154
|
+
const [open, setOpen] = useState4(false);
|
|
2155
|
+
const [query, setQuery] = useState4("");
|
|
2156
|
+
const [busy, setBusy] = useState4(false);
|
|
2141
2157
|
const inputRef = useRef4(null);
|
|
2142
|
-
const [needsName, setNeedsName] =
|
|
2158
|
+
const [needsName, setNeedsName] = useState4(false);
|
|
2143
2159
|
const selected = options.find((option) => option.value === value) ?? null;
|
|
2144
2160
|
const groups = [];
|
|
2145
2161
|
for (const option of options) {
|
|
@@ -2806,7 +2822,7 @@ var DropdownMenuShortcut = ({
|
|
|
2806
2822
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2807
2823
|
|
|
2808
2824
|
// src/editable-label.tsx
|
|
2809
|
-
import { useCallback as useCallback6, useEffect as
|
|
2825
|
+
import { useCallback as useCallback6, useEffect as useEffect5, useRef as useRef6, useState as useState6 } from "react";
|
|
2810
2826
|
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2811
2827
|
function EditableLabel({
|
|
2812
2828
|
value,
|
|
@@ -2827,16 +2843,16 @@ function EditableLabel({
|
|
|
2827
2843
|
inputClassName
|
|
2828
2844
|
}) {
|
|
2829
2845
|
const controlled = activation === "controlled";
|
|
2830
|
-
const [internalEditing, setInternalEditing] =
|
|
2846
|
+
const [internalEditing, setInternalEditing] = useState6(false);
|
|
2831
2847
|
const editing = controlled ? !!editingProp : internalEditing;
|
|
2832
|
-
const [draft, setDraft] =
|
|
2833
|
-
const [error, setError] =
|
|
2834
|
-
const [busy, setBusy] =
|
|
2848
|
+
const [draft, setDraft] = useState6(value);
|
|
2849
|
+
const [error, setError] = useState6(null);
|
|
2850
|
+
const [busy, setBusy] = useState6(false);
|
|
2835
2851
|
const inputRef = useRef6(null);
|
|
2836
|
-
|
|
2852
|
+
useEffect5(() => {
|
|
2837
2853
|
if (!editing) setDraft(value);
|
|
2838
2854
|
}, [value, editing]);
|
|
2839
|
-
|
|
2855
|
+
useEffect5(() => {
|
|
2840
2856
|
if (editing && inputRef.current) {
|
|
2841
2857
|
inputRef.current.focus();
|
|
2842
2858
|
if (selectOnEdit) inputRef.current.select();
|
|
@@ -3113,7 +3129,7 @@ var Label4 = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
3113
3129
|
Label4.displayName = LabelPrimitive.Root.displayName;
|
|
3114
3130
|
|
|
3115
3131
|
// src/overflow-toolbar.tsx
|
|
3116
|
-
import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo2, useRef as useRef7, useState as
|
|
3132
|
+
import { useLayoutEffect as useLayoutEffect2, useMemo as useMemo2, useRef as useRef7, useState as useState7 } from "react";
|
|
3117
3133
|
import { Fragment as Fragment3, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3118
3134
|
var GAP_PX = 6;
|
|
3119
3135
|
var TONE = {
|
|
@@ -3202,7 +3218,7 @@ function OverflowToolbar({
|
|
|
3202
3218
|
const containerRef = useRef7(null);
|
|
3203
3219
|
const ghostRef = useRef7(null);
|
|
3204
3220
|
const leadingRef = useRef7(null);
|
|
3205
|
-
const [visibleCount, setVisibleCount] =
|
|
3221
|
+
const [visibleCount, setVisibleCount] = useState7(visibleActions.length);
|
|
3206
3222
|
const signature = visibleActions.map(
|
|
3207
3223
|
(a) => `${a.id}:${a.hideLabel ? 1 : 0}:${a.running ? 1 : 0}:${a.runningLabel ?? ""}:${a.label}`
|
|
3208
3224
|
).join("|");
|
|
@@ -5246,7 +5262,7 @@ var Switch = React37.forwardRef(({ className, size = "md", ...props }, ref) => /
|
|
|
5246
5262
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
5247
5263
|
|
|
5248
5264
|
// src/tabbed-bottom-sheet.tsx
|
|
5249
|
-
import { useState as
|
|
5265
|
+
import { useState as useState10 } from "react";
|
|
5250
5266
|
import { jsx as jsx49, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5251
5267
|
function TabbedBottomSheet({
|
|
5252
5268
|
open,
|
|
@@ -5255,8 +5271,8 @@ function TabbedBottomSheet({
|
|
|
5255
5271
|
tabs,
|
|
5256
5272
|
initialTabId = null
|
|
5257
5273
|
}) {
|
|
5258
|
-
const [selectedTabId, setSelectedTabId] =
|
|
5259
|
-
const [wasOpen, setWasOpen] =
|
|
5274
|
+
const [selectedTabId, setSelectedTabId] = useState10(initialTabId);
|
|
5275
|
+
const [wasOpen, setWasOpen] = useState10(open);
|
|
5260
5276
|
if (open !== wasOpen) {
|
|
5261
5277
|
setWasOpen(open);
|
|
5262
5278
|
if (open) setSelectedTabId(initialTabId);
|
|
@@ -6151,7 +6167,7 @@ function useTapGuardRef(forwarded, propViolation) {
|
|
|
6151
6167
|
}
|
|
6152
6168
|
|
|
6153
6169
|
// src/tap-target/tap-features.tsx
|
|
6154
|
-
import { useEffect as
|
|
6170
|
+
import { useEffect as useEffect9 } from "react";
|
|
6155
6171
|
import { jsx as jsx57, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6156
6172
|
var TAP_TONE_CLASS = {
|
|
6157
6173
|
default: "text-foreground",
|
|
@@ -6193,7 +6209,7 @@ function matchesShortcut(e, shortcut) {
|
|
|
6193
6209
|
return e.key.toLowerCase() === p.key;
|
|
6194
6210
|
}
|
|
6195
6211
|
function useTapShortcut(shortcut, getNode, enabled) {
|
|
6196
|
-
|
|
6212
|
+
useEffect9(() => {
|
|
6197
6213
|
if (!shortcut || !enabled) return;
|
|
6198
6214
|
const onKey = (e) => {
|
|
6199
6215
|
if (!matchesShortcut(e, shortcut)) return;
|
|
@@ -6889,7 +6905,7 @@ function TapTargetLabeled({
|
|
|
6889
6905
|
}
|
|
6890
6906
|
|
|
6891
6907
|
// src/tap-target/tap-target-copy.tsx
|
|
6892
|
-
import { forwardRef as forwardRef35, useEffect as
|
|
6908
|
+
import { forwardRef as forwardRef35, useEffect as useEffect10, useRef as useRef12, useState as useState11 } from "react";
|
|
6893
6909
|
import { Fragment as Fragment7, jsx as jsx60, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6894
6910
|
var COPY = /* @__PURE__ */ jsxs35(Fragment7, { children: [
|
|
6895
6911
|
/* @__PURE__ */ jsx60("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
@@ -6908,9 +6924,9 @@ var VARIANTS = {
|
|
|
6908
6924
|
};
|
|
6909
6925
|
var TapTargetCopyButton = forwardRef35(
|
|
6910
6926
|
function TapTargetCopyButton2({ value, variant = "glass", onCopied, ariaLabel = "Copy", tooltip, ...rest }, ref) {
|
|
6911
|
-
const [state, setState] =
|
|
6927
|
+
const [state, setState] = useState11("idle");
|
|
6912
6928
|
const timer = useRef12(null);
|
|
6913
|
-
|
|
6929
|
+
useEffect10(() => () => {
|
|
6914
6930
|
if (timer.current) clearTimeout(timer.current);
|
|
6915
6931
|
}, []);
|
|
6916
6932
|
const copy = async () => {
|
|
@@ -6944,11 +6960,11 @@ var TapTargetCopyButton = forwardRef35(
|
|
|
6944
6960
|
// src/tap-target/tap-target-search.tsx
|
|
6945
6961
|
import {
|
|
6946
6962
|
useCallback as useCallback11,
|
|
6947
|
-
useEffect as
|
|
6963
|
+
useEffect as useEffect11,
|
|
6948
6964
|
useId,
|
|
6949
6965
|
useLayoutEffect as useLayoutEffect3,
|
|
6950
6966
|
useRef as useRef13,
|
|
6951
|
-
useState as
|
|
6967
|
+
useState as useState12
|
|
6952
6968
|
} from "react";
|
|
6953
6969
|
import { Fragment as Fragment8, jsx as jsx61, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6954
6970
|
var SHORTCUT_LABEL = {
|
|
@@ -6983,8 +6999,8 @@ function TapTargetSearchGroup({
|
|
|
6983
6999
|
width = "fit",
|
|
6984
7000
|
shortcut = false
|
|
6985
7001
|
}) {
|
|
6986
|
-
const [ownValue, setOwnValue] =
|
|
6987
|
-
const [ownOpen, setOwnOpen] =
|
|
7002
|
+
const [ownValue, setOwnValue] = useState12(defaultValue);
|
|
7003
|
+
const [ownOpen, setOwnOpen] = useState12(defaultOpen);
|
|
6988
7004
|
const value = valueProp ?? ownValue;
|
|
6989
7005
|
const open = openProp ?? ownOpen;
|
|
6990
7006
|
const fieldId = useId();
|
|
@@ -6992,7 +7008,7 @@ function TapTargetSearchGroup({
|
|
|
6992
7008
|
const inputRef = useRef13(null);
|
|
6993
7009
|
const triggerRef = useRef13(null);
|
|
6994
7010
|
const measureRef = useRef13(null);
|
|
6995
|
-
const [buttonsWidth, setButtonsWidth] =
|
|
7011
|
+
const [buttonsWidth, setButtonsWidth] = useState12(null);
|
|
6996
7012
|
useLayoutEffect3(() => {
|
|
6997
7013
|
const el = measureRef.current;
|
|
6998
7014
|
if (!el) return;
|
|
@@ -7021,7 +7037,7 @@ function TapTargetSearchGroup({
|
|
|
7021
7037
|
useLayoutEffect3(() => {
|
|
7022
7038
|
if (open) inputRef.current?.focus();
|
|
7023
7039
|
}, [open]);
|
|
7024
|
-
|
|
7040
|
+
useEffect11(() => {
|
|
7025
7041
|
if (!shortcut) return;
|
|
7026
7042
|
const onKey = (e) => {
|
|
7027
7043
|
const mod = e.metaKey || e.ctrlKey;
|