@ai-matrx/design-system 0.15.2 → 0.17.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 +36 -0
- package/README.md +6 -0
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/index.cjs +303 -68
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +2 -2
- package/dist/data-table/index.d.ts +2 -2
- package/dist/data-table/index.js +299 -64
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +12 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +41 -67
- package/dist/index.js.map +1 -1
- package/dist/{types-XXbVB1sh.d.cts → types-4fmLG5AN.d.cts} +16 -1
- package/dist/{types-ClaxTaXq.d.ts → types-pZ95iFk5.d.ts} +16 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1396,55 +1396,29 @@ function ConfirmDialog({
|
|
|
1396
1396
|
}
|
|
1397
1397
|
|
|
1398
1398
|
// src/confirm-host.tsx
|
|
1399
|
-
import {
|
|
1400
|
-
|
|
1401
|
-
_unregisterHost
|
|
1402
|
-
} from "@ai-matrx/kit/confirm-opener";
|
|
1399
|
+
import { confirmOpener } from "@ai-matrx/kit/confirm-opener";
|
|
1400
|
+
import { useOpenerHost } from "@ai-matrx/kit/opener-react";
|
|
1403
1401
|
import * as React14 from "react";
|
|
1404
1402
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1405
1403
|
function ConfirmDialogHost() {
|
|
1406
|
-
const
|
|
1407
|
-
const
|
|
1408
|
-
const queueRef = React14.useRef([]);
|
|
1409
|
-
React14.useEffect(() => {
|
|
1410
|
-
const controller = {
|
|
1411
|
-
show: (opts, resolve) => {
|
|
1412
|
-
queueRef.current.push({ opts, resolve });
|
|
1413
|
-
setTick((n) => n + 1);
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
_registerHost(controller);
|
|
1417
|
-
return () => _unregisterHost(controller);
|
|
1418
|
-
}, []);
|
|
1419
|
-
React14.useEffect(() => {
|
|
1420
|
-
if (active === null && queueRef.current.length > 0) {
|
|
1421
|
-
setActive(queueRef.current.shift());
|
|
1422
|
-
}
|
|
1423
|
-
}, [active, tick]);
|
|
1424
|
-
const handleConfirm = React14.useCallback(() => {
|
|
1425
|
-
if (!active) return;
|
|
1426
|
-
active.resolve(true);
|
|
1427
|
-
setActive(null);
|
|
1428
|
-
}, [active]);
|
|
1404
|
+
const { request, open, settle } = useOpenerHost(confirmOpener);
|
|
1405
|
+
const handleConfirm = React14.useCallback(() => settle(true), [settle]);
|
|
1429
1406
|
const handleOpenChange = React14.useCallback(
|
|
1430
|
-
(
|
|
1431
|
-
if (!
|
|
1432
|
-
active.resolve(false);
|
|
1433
|
-
setActive(null);
|
|
1434
|
-
}
|
|
1407
|
+
(next) => {
|
|
1408
|
+
if (!next) settle(false);
|
|
1435
1409
|
},
|
|
1436
|
-
[
|
|
1410
|
+
[settle]
|
|
1437
1411
|
);
|
|
1438
1412
|
return /* @__PURE__ */ jsx17(
|
|
1439
1413
|
ConfirmDialog,
|
|
1440
1414
|
{
|
|
1441
|
-
open
|
|
1415
|
+
open,
|
|
1442
1416
|
onOpenChange: handleOpenChange,
|
|
1443
|
-
title:
|
|
1444
|
-
description:
|
|
1445
|
-
confirmLabel:
|
|
1446
|
-
cancelLabel:
|
|
1447
|
-
variant:
|
|
1417
|
+
title: request?.title ?? "",
|
|
1418
|
+
description: request?.description,
|
|
1419
|
+
confirmLabel: request?.confirmLabel,
|
|
1420
|
+
cancelLabel: request?.cancelLabel,
|
|
1421
|
+
variant: request?.variant,
|
|
1448
1422
|
onConfirm: handleConfirm
|
|
1449
1423
|
}
|
|
1450
1424
|
);
|
|
@@ -1586,8 +1560,8 @@ ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
|
1586
1560
|
|
|
1587
1561
|
// src/creatable-picker.tsx
|
|
1588
1562
|
import {
|
|
1589
|
-
useRef
|
|
1590
|
-
useState as
|
|
1563
|
+
useRef,
|
|
1564
|
+
useState as useState2
|
|
1591
1565
|
} from "react";
|
|
1592
1566
|
|
|
1593
1567
|
// src/popover.tsx
|
|
@@ -1659,11 +1633,11 @@ function CreatablePicker({
|
|
|
1659
1633
|
renderSelected,
|
|
1660
1634
|
size = "sm"
|
|
1661
1635
|
}) {
|
|
1662
|
-
const [open, setOpen] =
|
|
1663
|
-
const [query, setQuery] =
|
|
1664
|
-
const [busy, setBusy] =
|
|
1665
|
-
const inputRef =
|
|
1666
|
-
const [needsName, setNeedsName] =
|
|
1636
|
+
const [open, setOpen] = useState2(false);
|
|
1637
|
+
const [query, setQuery] = useState2("");
|
|
1638
|
+
const [busy, setBusy] = useState2(false);
|
|
1639
|
+
const inputRef = useRef(null);
|
|
1640
|
+
const [needsName, setNeedsName] = useState2(false);
|
|
1667
1641
|
const selected = options.find((option) => option.value === value) ?? null;
|
|
1668
1642
|
const groups = [];
|
|
1669
1643
|
for (const option of options) {
|
|
@@ -2208,7 +2182,7 @@ var DropdownMenuShortcut = ({
|
|
|
2208
2182
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2209
2183
|
|
|
2210
2184
|
// src/editable-label.tsx
|
|
2211
|
-
import { useCallback as useCallback3, useEffect as
|
|
2185
|
+
import { useCallback as useCallback3, useEffect as useEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
2212
2186
|
import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2213
2187
|
function EditableLabel({
|
|
2214
2188
|
value,
|
|
@@ -2229,16 +2203,16 @@ function EditableLabel({
|
|
|
2229
2203
|
inputClassName
|
|
2230
2204
|
}) {
|
|
2231
2205
|
const controlled = activation === "controlled";
|
|
2232
|
-
const [internalEditing, setInternalEditing] =
|
|
2206
|
+
const [internalEditing, setInternalEditing] = useState4(false);
|
|
2233
2207
|
const editing = controlled ? !!editingProp : internalEditing;
|
|
2234
|
-
const [draft, setDraft] =
|
|
2235
|
-
const [error, setError] =
|
|
2236
|
-
const [busy, setBusy] =
|
|
2237
|
-
const inputRef =
|
|
2238
|
-
|
|
2208
|
+
const [draft, setDraft] = useState4(value);
|
|
2209
|
+
const [error, setError] = useState4(null);
|
|
2210
|
+
const [busy, setBusy] = useState4(false);
|
|
2211
|
+
const inputRef = useRef2(null);
|
|
2212
|
+
useEffect2(() => {
|
|
2239
2213
|
if (!editing) setDraft(value);
|
|
2240
2214
|
}, [value, editing]);
|
|
2241
|
-
|
|
2215
|
+
useEffect2(() => {
|
|
2242
2216
|
if (editing && inputRef.current) {
|
|
2243
2217
|
inputRef.current.focus();
|
|
2244
2218
|
if (selectOnEdit) inputRef.current.select();
|
|
@@ -2515,7 +2489,7 @@ var Label3 = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
2515
2489
|
Label3.displayName = LabelPrimitive.Root.displayName;
|
|
2516
2490
|
|
|
2517
2491
|
// src/overflow-toolbar.tsx
|
|
2518
|
-
import { useLayoutEffect, useMemo, useRef as
|
|
2492
|
+
import { useLayoutEffect, useMemo, useRef as useRef3, useState as useState5 } from "react";
|
|
2519
2493
|
import { Fragment, jsx as jsx26, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2520
2494
|
var GAP_PX = 6;
|
|
2521
2495
|
var TONE = {
|
|
@@ -2601,10 +2575,10 @@ function OverflowToolbar({
|
|
|
2601
2575
|
() => actions.filter((a) => !a.hidden),
|
|
2602
2576
|
[actions]
|
|
2603
2577
|
);
|
|
2604
|
-
const containerRef =
|
|
2605
|
-
const ghostRef =
|
|
2606
|
-
const leadingRef =
|
|
2607
|
-
const [visibleCount, setVisibleCount] =
|
|
2578
|
+
const containerRef = useRef3(null);
|
|
2579
|
+
const ghostRef = useRef3(null);
|
|
2580
|
+
const leadingRef = useRef3(null);
|
|
2581
|
+
const [visibleCount, setVisibleCount] = useState5(visibleActions.length);
|
|
2608
2582
|
const signature = visibleActions.map(
|
|
2609
2583
|
(a) => `${a.id}:${a.hideLabel ? 1 : 0}:${a.running ? 1 : 0}:${a.runningLabel ?? ""}:${a.label}`
|
|
2610
2584
|
).join("|");
|
|
@@ -3518,7 +3492,7 @@ function DefaultOrganizationSwitch({
|
|
|
3518
3492
|
}
|
|
3519
3493
|
|
|
3520
3494
|
// src/tabbed-bottom-sheet.tsx
|
|
3521
|
-
import { useState as
|
|
3495
|
+
import { useState as useState6 } from "react";
|
|
3522
3496
|
import { jsx as jsx39, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3523
3497
|
function TabbedBottomSheet({
|
|
3524
3498
|
open,
|
|
@@ -3526,8 +3500,8 @@ function TabbedBottomSheet({
|
|
|
3526
3500
|
title,
|
|
3527
3501
|
tabs
|
|
3528
3502
|
}) {
|
|
3529
|
-
const [selectedTabId, setSelectedTabId] =
|
|
3530
|
-
const [wasOpen, setWasOpen] =
|
|
3503
|
+
const [selectedTabId, setSelectedTabId] = useState6(null);
|
|
3504
|
+
const [wasOpen, setWasOpen] = useState6(open);
|
|
3531
3505
|
if (open !== wasOpen) {
|
|
3532
3506
|
setWasOpen(open);
|
|
3533
3507
|
if (open) setSelectedTabId(null);
|
|
@@ -3897,15 +3871,15 @@ var TextareaWithPrefix = React31.forwardRef(
|
|
|
3897
3871
|
TextareaWithPrefix.displayName = "TextareaWithPrefix";
|
|
3898
3872
|
|
|
3899
3873
|
// src/use-scroll-fade.ts
|
|
3900
|
-
import { useCallback as useCallback5, useEffect as
|
|
3874
|
+
import { useCallback as useCallback5, useEffect as useEffect4, useRef as useRef5, useState as useState7 } from "react";
|
|
3901
3875
|
var EPSILON = 2;
|
|
3902
3876
|
function useScrollFade() {
|
|
3903
|
-
const [state, setState] =
|
|
3877
|
+
const [state, setState] = useState7({
|
|
3904
3878
|
top: false,
|
|
3905
3879
|
bottom: false
|
|
3906
3880
|
});
|
|
3907
|
-
const nodeRef =
|
|
3908
|
-
const cleanupRef =
|
|
3881
|
+
const nodeRef = useRef5(null);
|
|
3882
|
+
const cleanupRef = useRef5(null);
|
|
3909
3883
|
const measure = useCallback5(() => {
|
|
3910
3884
|
const el = nodeRef.current;
|
|
3911
3885
|
if (!el) return;
|
|
@@ -3938,7 +3912,7 @@ function useScrollFade() {
|
|
|
3938
3912
|
},
|
|
3939
3913
|
[measure]
|
|
3940
3914
|
);
|
|
3941
|
-
|
|
3915
|
+
useEffect4(() => () => cleanupRef.current?.(), []);
|
|
3942
3916
|
return {
|
|
3943
3917
|
ref,
|
|
3944
3918
|
state,
|