@ai-matrx/design-system 0.86.348 → 0.86.350
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 +17 -2
- package/dist/carousel.cjs.map +1 -1
- package/dist/carousel.js +5 -5
- package/dist/chunk-4WSXAP24.js +51 -0
- package/dist/chunk-4WSXAP24.js.map +1 -0
- package/dist/{chunk-XTP6HOB6.js → chunk-6XNYYROM.js} +1 -1
- package/dist/chunk-6XNYYROM.js.map +1 -0
- package/dist/{chunk-54UK6P7E.js → chunk-BCGNEWZM.js} +3 -3
- package/dist/{chunk-CEA6X445.js → chunk-CFUXEGW2.js} +2 -2
- package/dist/{chunk-BC7LMEOD.js → chunk-GJ6UGQ4X.js} +7 -3
- package/dist/chunk-GJ6UGQ4X.js.map +1 -0
- package/dist/{chunk-6QKT52FR.js → chunk-MTE6N7XU.js} +2 -2
- package/dist/{chunk-S6F34AX5.js → chunk-QA7EHFRX.js} +2 -2
- package/dist/{chunk-KYH42WEX.js → chunk-SC3XPADZ.js} +3 -3
- package/dist/{chunk-CJBSBKG5.js → chunk-SOCNWQMX.js} +2 -2
- package/dist/{chunk-GLLPO66A.js → chunk-U46XUQI7.js} +2 -2
- package/dist/{chunk-6CDAHINE.js → chunk-UTADJKVR.js} +2 -2
- package/dist/{chunk-TWRC7NP4.js → chunk-WUD23YTG.js} +4 -4
- package/dist/{chunk-MIJMP4WI.js → chunk-YRF22M5S.js} +6 -1
- package/dist/{chunk-MIJMP4WI.js.map → chunk-YRF22M5S.js.map} +1 -1
- package/dist/clipboard-fallback-dialog.cjs.map +1 -1
- package/dist/clipboard-fallback-dialog.js +1 -1
- package/dist/controls.cjs.map +1 -1
- package/dist/controls.css +25 -0
- package/dist/controls.d.cts +2 -2
- package/dist/controls.d.ts +2 -2
- package/dist/controls.js +5 -5
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +4 -4
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +5 -5
- package/dist/data-table/index.cjs +8 -5
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +9 -9
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +2 -2
- package/dist/data-table/spreadsheet.cjs +6 -2
- package/dist/data-table/spreadsheet.cjs.map +1 -1
- package/dist/data-table/spreadsheet.d.cts +4 -1
- package/dist/data-table/spreadsheet.d.ts +4 -1
- package/dist/data-table/spreadsheet.js +3 -1
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +2 -2
- package/dist/desktop.cjs +93 -12
- package/dist/desktop.cjs.map +1 -1
- package/dist/desktop.css +27 -0
- package/dist/desktop.d.cts +6 -5
- package/dist/desktop.d.ts +6 -5
- package/dist/desktop.js +64 -15
- package/dist/desktop.js.map +1 -1
- package/dist/index.cjs +17 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -12
- package/dist/index.d.ts +21 -12
- package/dist/index.js +21 -14
- package/dist/index.js.map +1 -1
- package/dist/item.cjs.map +1 -1
- package/dist/item.js +2 -2
- package/dist/lite-table.cjs.map +1 -1
- package/dist/lite-table.js +1 -1
- package/dist/notice-stack.cjs +70 -0
- package/dist/notice-stack.cjs.map +1 -0
- package/dist/notice-stack.d.cts +60 -0
- package/dist/notice-stack.d.ts +60 -0
- package/dist/notice-stack.js +16 -0
- package/dist/notice-stack.js.map +1 -0
- package/dist/record-list.cjs.map +1 -1
- package/dist/record-list.js +2 -2
- package/dist/settings.cjs.map +1 -1
- package/dist/settings.js +3 -3
- package/dist/swipe-deck.cjs +95 -25
- package/dist/swipe-deck.cjs.map +1 -1
- package/dist/swipe-deck.css +14 -0
- package/dist/swipe-deck.d.cts +20 -0
- package/dist/swipe-deck.d.ts +20 -0
- package/dist/swipe-deck.js +87 -25
- package/dist/swipe-deck.js.map +1 -1
- package/dist/writing-field.cjs.map +1 -1
- package/dist/writing-field.js +2 -2
- package/package.json +12 -18
- package/dist/chunk-BC7LMEOD.js.map +0 -1
- package/dist/chunk-XTP6HOB6.js.map +0 -1
- /package/dist/{chunk-54UK6P7E.js.map → chunk-BCGNEWZM.js.map} +0 -0
- /package/dist/{chunk-CEA6X445.js.map → chunk-CFUXEGW2.js.map} +0 -0
- /package/dist/{chunk-6QKT52FR.js.map → chunk-MTE6N7XU.js.map} +0 -0
- /package/dist/{chunk-S6F34AX5.js.map → chunk-QA7EHFRX.js.map} +0 -0
- /package/dist/{chunk-KYH42WEX.js.map → chunk-SC3XPADZ.js.map} +0 -0
- /package/dist/{chunk-CJBSBKG5.js.map → chunk-SOCNWQMX.js.map} +0 -0
- /package/dist/{chunk-GLLPO66A.js.map → chunk-U46XUQI7.js.map} +0 -0
- /package/dist/{chunk-6CDAHINE.js.map → chunk-UTADJKVR.js.map} +0 -0
- /package/dist/{chunk-TWRC7NP4.js.map → chunk-WUD23YTG.js.map} +0 -0
|
@@ -3,8 +3,8 @@ import "../chunk-QFP4BUKZ.js";
|
|
|
3
3
|
import {
|
|
4
4
|
RecordId,
|
|
5
5
|
shortUuid
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-U46XUQI7.js";
|
|
7
|
+
import "../chunk-6XNYYROM.js";
|
|
8
8
|
import "../chunk-BD77DHUO.js";
|
|
9
9
|
import "../chunk-BKCJUFD3.js";
|
|
10
10
|
import "../chunk-PIQJULQB.js";
|
package/dist/desktop.cjs
CHANGED
|
@@ -2885,6 +2885,44 @@ function NavigatorCustomizeSheet({ open, onOpenChange, items, onChange, onRestor
|
|
|
2885
2885
|
] }) });
|
|
2886
2886
|
}
|
|
2887
2887
|
|
|
2888
|
+
// src/notice-stack.ts
|
|
2889
|
+
var NOTICE_STACK = {
|
|
2890
|
+
/** The corner every notice floats in. */
|
|
2891
|
+
corner: "top-right",
|
|
2892
|
+
/** Cards shown at once; the rest fold into "N more". */
|
|
2893
|
+
maxVisible: 3,
|
|
2894
|
+
/** Info and success: gone after this long. */
|
|
2895
|
+
infoMs: 4e3,
|
|
2896
|
+
/** Errors and warnings: stay until dismissed, or this long at most. */
|
|
2897
|
+
errorMs: 3e4,
|
|
2898
|
+
/** The card's width: small, never the window's. */
|
|
2899
|
+
widthRem: 22
|
|
2900
|
+
};
|
|
2901
|
+
function noticeKey(tone, title, message) {
|
|
2902
|
+
const text = (v) => typeof v === "string" || typeof v === "number" ? String(v).trim() : "";
|
|
2903
|
+
return `${tone}\0${text(title)}\0${text(message)}`;
|
|
2904
|
+
}
|
|
2905
|
+
function collapseNotices(items, keyOf) {
|
|
2906
|
+
const groups = [];
|
|
2907
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
2908
|
+
for (const item2 of items) {
|
|
2909
|
+
const key2 = keyOf(item2);
|
|
2910
|
+
const found = key2 !== null ? byKey.get(key2) : void 0;
|
|
2911
|
+
if (found) {
|
|
2912
|
+
found.members.push(item2);
|
|
2913
|
+
continue;
|
|
2914
|
+
}
|
|
2915
|
+
const group = { key: key2, members: [item2] };
|
|
2916
|
+
groups.push(group);
|
|
2917
|
+
if (key2 !== null) byKey.set(key2, group);
|
|
2918
|
+
}
|
|
2919
|
+
return groups.map((g) => ({ item: g.members[g.members.length - 1], members: g.members, count: g.members.length }));
|
|
2920
|
+
}
|
|
2921
|
+
function visibleNotices(groups, max = NOTICE_STACK.maxVisible) {
|
|
2922
|
+
if (groups.length <= max) return { shown: [...groups], folded: 0 };
|
|
2923
|
+
return { shown: groups.slice(groups.length - max), folded: groups.length - max };
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2888
2926
|
// src/desktop/layout.tsx
|
|
2889
2927
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2890
2928
|
var WIDTH = {
|
|
@@ -2892,12 +2930,26 @@ var WIDTH = {
|
|
|
2892
2930
|
wide: "max-w-none",
|
|
2893
2931
|
full: "max-w-none"
|
|
2894
2932
|
};
|
|
2895
|
-
function
|
|
2896
|
-
|
|
2933
|
+
function noticeElements(children) {
|
|
2934
|
+
const out = [];
|
|
2935
|
+
for (const c of React16.Children.toArray(children)) {
|
|
2936
|
+
if (!React16.isValidElement(c)) continue;
|
|
2937
|
+
if (c.type === React16.Fragment) out.push(...noticeElements(c.props.children));
|
|
2938
|
+
else out.push(c);
|
|
2939
|
+
}
|
|
2940
|
+
return out;
|
|
2941
|
+
}
|
|
2942
|
+
function elementKey(el) {
|
|
2943
|
+
const p = el.props;
|
|
2944
|
+
if (typeof p.tone !== "string" || typeof p.title !== "string" && typeof p.title !== "number") return null;
|
|
2945
|
+
return noticeKey(p.tone, p.title, p.message);
|
|
2897
2946
|
}
|
|
2947
|
+
var NoticeStackContext = React16.createContext(false);
|
|
2898
2948
|
function Notices({ children, className, onHeight, ...props }) {
|
|
2899
2949
|
const stack = React16.useRef(null);
|
|
2900
|
-
const
|
|
2950
|
+
const [expanded, setExpanded] = React16.useState(false);
|
|
2951
|
+
const elements = noticeElements(children);
|
|
2952
|
+
const drawn = elements.length > 0;
|
|
2901
2953
|
React16.useLayoutEffect(() => {
|
|
2902
2954
|
const el = stack.current;
|
|
2903
2955
|
if (!onHeight) return;
|
|
@@ -2913,7 +2965,27 @@ function Notices({ children, className, onHeight, ...props }) {
|
|
|
2913
2965
|
};
|
|
2914
2966
|
}, [onHeight, drawn]);
|
|
2915
2967
|
if (!drawn) return null;
|
|
2916
|
-
|
|
2968
|
+
const groups = collapseNotices(elements, elementKey);
|
|
2969
|
+
const { shown, folded } = expanded ? { shown: groups, folded: 0 } : visibleNotices(groups);
|
|
2970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2971
|
+
"div",
|
|
2972
|
+
{
|
|
2973
|
+
ref: stack,
|
|
2974
|
+
"data-slot": "notices",
|
|
2975
|
+
"data-float": "",
|
|
2976
|
+
"aria-live": "polite",
|
|
2977
|
+
style: { width: `${NOTICE_STACK.widthRem}rem` },
|
|
2978
|
+
className: cn("flex flex-col items-stretch gap-2 empty:hidden", className),
|
|
2979
|
+
...props,
|
|
2980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(NoticeStackContext.Provider, { value: true, children: [
|
|
2981
|
+
folded > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", "data-slot": "notices-more", className: "self-end rounded-full px-2 py-0.5", onClick: () => setExpanded(true), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { variant: "caption", tone: "secondary", children: [
|
|
2982
|
+
folded,
|
|
2983
|
+
" more"
|
|
2984
|
+
] }) }) : null,
|
|
2985
|
+
shown.map((g) => g.count > 1 ? React16.cloneElement(g.item, { count: g.count }) : g.item)
|
|
2986
|
+
] })
|
|
2987
|
+
}
|
|
2988
|
+
);
|
|
2917
2989
|
}
|
|
2918
2990
|
function NoticeSlot({ children, className, ...props }) {
|
|
2919
2991
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { "data-slot": "notice-slot", "aria-live": "polite", className: cn("h-16 shrink-0 overflow-hidden [&>*]:h-full [&>*]:overflow-hidden", className), ...props, children });
|
|
@@ -2921,14 +2993,14 @@ function NoticeSlot({ children, className, ...props }) {
|
|
|
2921
2993
|
var Page = React16.forwardRef(function Page2({ width = "wide", header, notices, sidebar, scopeBar, footer, flush, className, children, ...props }, ref) {
|
|
2922
2994
|
const frame = (
|
|
2923
2995
|
// The frame is always there (with or without notices), so a notice never remounts the page.
|
|
2924
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-slot": "page-frame", className: "flex h-full min-w-0 flex-1 flex-col bg-content", children: [
|
|
2996
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-slot": "page-frame", className: "relative flex h-full min-w-0 flex-1 flex-col bg-content", children: [
|
|
2925
2997
|
scopeBar ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { "data-slot": "page-scope-bar", className: "flex h-control-lg shrink-0 items-center gap-2 border-b border-separator px-3", children: scopeBar }) : null,
|
|
2926
2998
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref, "data-slot": "page", "data-flush": flush || void 0, className: cn("min-h-0 flex-1 overflow-y-auto bg-content", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex w-full flex-col", flush ? "min-h-full" : "gap-5 px-5 pb-5 pt-3", WIDTH[width]), children: [
|
|
2927
2999
|
header,
|
|
2928
3000
|
children
|
|
2929
3001
|
] }) }),
|
|
2930
3002
|
footer ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { "data-slot": "page-footer", className: "flex shrink-0 flex-col border-t border-separator bg-content", children: footer }) : null,
|
|
2931
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Notices, { "data-page-notices": "",
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Notices, { "data-page-notices": "", children: notices })
|
|
2932
3004
|
] })
|
|
2933
3005
|
);
|
|
2934
3006
|
if (!sidebar) return frame;
|
|
@@ -5413,22 +5485,31 @@ var BANNER_ICON = {
|
|
|
5413
5485
|
danger: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Glyph, { d: ALERT }),
|
|
5414
5486
|
success: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Glyph, { d: DONE })
|
|
5415
5487
|
};
|
|
5416
|
-
function Banner({ tone, icon, title, message, actions, detail, onDismiss, className, ...props }) {
|
|
5488
|
+
function Banner({ tone, icon, title, message, actions, detail, onDismiss, count, className, ...props }) {
|
|
5417
5489
|
const [copied, setCopied] = React34.useState(false);
|
|
5490
|
+
const floating = React34.useContext(NoticeStackContext);
|
|
5418
5491
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5419
5492
|
"div",
|
|
5420
5493
|
{
|
|
5421
5494
|
role: tone === "danger" || tone === "warning" ? "alert" : "status",
|
|
5422
5495
|
"data-slot": "banner",
|
|
5423
5496
|
"data-tone": tone,
|
|
5424
|
-
|
|
5497
|
+
"data-float": floating ? "" : void 0,
|
|
5498
|
+
"data-count": count && count > 1 ? count : void 0,
|
|
5499
|
+
className: cn("flex min-h-row items-center gap-2.5 rounded-group px-3 py-2", floating ? "items-start" : BANNER_TONE[tone].box, className),
|
|
5425
5500
|
...props,
|
|
5426
5501
|
children: [
|
|
5427
5502
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: cn("flex shrink-0 self-start pt-px [&_svg]:size-icon", BANNER_TONE[tone].icon), children: icon ?? BANNER_ICON[tone] }),
|
|
5428
5503
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-slot": "banner-body", className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-2", children: [
|
|
5429
5504
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-slot": "banner-text", className: "flex min-w-0 flex-1 basis-56 flex-col gap-0.5", title: detail || void 0, children: [
|
|
5430
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.
|
|
5431
|
-
|
|
5505
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Text, { emphasized: true, className: floating ? "line-clamp-1" : void 0, children: [
|
|
5506
|
+
title,
|
|
5507
|
+
count && count > 1 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { "data-slot": "banner-count", className: "ml-1.5 font-normal text-label-secondary", children: [
|
|
5508
|
+
"\xD7",
|
|
5509
|
+
count
|
|
5510
|
+
] }) : null
|
|
5511
|
+
] }),
|
|
5512
|
+
message ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Text, { as: "p", tone: "secondary", selectable: true, className: floating ? "line-clamp-2" : void 0, children: message }) : null
|
|
5432
5513
|
] }),
|
|
5433
5514
|
actions || detail ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-slot": "banner-actions", className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
5434
5515
|
detail ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
@@ -6720,7 +6801,7 @@ function EndOfList({ onEndReached }) {
|
|
|
6720
6801
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6721
6802
|
var LIST_WIDTH = { md: "w-70", lg: "w-85" };
|
|
6722
6803
|
function SplitView({ header, notices, source, list, listHeader, listFooter, detail, listWidth = "lg", detailScrolls = true, narrow, className, ...props }) {
|
|
6723
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { "data-slot": "split-view", className: cn("flex h-full min-h-0 flex-col bg-content", className), ...props, children: [
|
|
6804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { "data-slot": "split-view", className: cn("relative flex h-full min-h-0 flex-col bg-content", className), ...props, children: [
|
|
6724
6805
|
header ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "shrink-0 px-5 empty:hidden", children: header }) : null,
|
|
6725
6806
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { "data-slot": "split-columns", "data-narrow": detail !== void 0 ? narrow : void 0, "data-has-source": source ? "" : void 0, className: "flex min-h-0 flex-1", children: [
|
|
6726
6807
|
source ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { "data-slot": "split-view-source", className: "flex w-52 min-w-40 shrink flex-col overflow-y-auto border-r border-separator py-2", children: source }) : null,
|
|
@@ -6731,7 +6812,7 @@ function SplitView({ header, notices, source, list, listHeader, listFooter, deta
|
|
|
6731
6812
|
] }),
|
|
6732
6813
|
detail !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { "data-slot": "split-view-detail", className: cn("flex min-w-80 flex-1 flex-col", detailScrolls ? "overflow-y-auto" : "min-h-0"), children: detail }) : null
|
|
6733
6814
|
] }),
|
|
6734
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Notices, { "data-page-notices": "",
|
|
6815
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Notices, { "data-page-notices": "", children: notices })
|
|
6735
6816
|
] });
|
|
6736
6817
|
}
|
|
6737
6818
|
|