@ai-matrx/design-system 0.86.349 → 0.86.351
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 -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-CEA6X445.js → chunk-CFUXEGW2.js} +2 -2
- package/dist/{chunk-54UK6P7E.js → chunk-FLWSEDUW.js} +3 -3
- package/dist/{chunk-BC7LMEOD.js → chunk-GJ6UGQ4X.js} +7 -3
- package/dist/chunk-GJ6UGQ4X.js.map +1 -0
- package/dist/{chunk-6CDAHINE.js → chunk-GMNROZQJ.js} +4 -4
- package/dist/{chunk-6CDAHINE.js.map → chunk-GMNROZQJ.js.map} +1 -1
- package/dist/{chunk-6QKT52FR.js → chunk-MTE6N7XU.js} +2 -2
- package/dist/{chunk-S6F34AX5.js → chunk-QA7EHFRX.js} +2 -2
- package/dist/{chunk-CJBSBKG5.js → chunk-SOCNWQMX.js} +2 -2
- package/dist/{chunk-GLLPO66A.js → chunk-U46XUQI7.js} +2 -2
- package/dist/{chunk-KYH42WEX.js → chunk-UGQRAQTE.js} +433 -344
- package/dist/chunk-UGQRAQTE.js.map +1 -0
- 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 +547 -458
- package/dist/controls.cjs.map +1 -1
- package/dist/controls.css +52 -18
- package/dist/controls.d.cts +51 -3
- package/dist/controls.d.ts +51 -3
- package/dist/controls.js +13 -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 +53 -43
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +52 -45
- package/dist/data-table/index.js.map +1 -1
- 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 +158 -16
- package/dist/desktop.cjs.map +1 -1
- package/dist/desktop.css +46 -0
- package/dist/desktop.d.cts +6 -5
- package/dist/desktop.d.ts +6 -5
- package/dist/desktop.js +127 -17
- package/dist/desktop.js.map +1 -1
- package/dist/index.cjs +19 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- 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 +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 +2 -2
- 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-KYH42WEX.js.map +0 -1
- package/dist/chunk-XTP6HOB6.js.map +0 -1
- /package/dist/{chunk-CEA6X445.js.map → chunk-CFUXEGW2.js.map} +0 -0
- /package/dist/{chunk-54UK6P7E.js.map → chunk-FLWSEDUW.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-CJBSBKG5.js.map → chunk-SOCNWQMX.js.map} +0 -0
- /package/dist/{chunk-GLLPO66A.js.map → chunk-U46XUQI7.js.map} +0 -0
- /package/dist/{chunk-TWRC7NP4.js.map → chunk-WUD23YTG.js.map} +0 -0
package/dist/lite-table.js
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/notice-stack.ts
|
|
22
|
+
var notice_stack_exports = {};
|
|
23
|
+
__export(notice_stack_exports, {
|
|
24
|
+
NOTICE_STACK: () => NOTICE_STACK,
|
|
25
|
+
collapseNotices: () => collapseNotices,
|
|
26
|
+
noticeKey: () => noticeKey,
|
|
27
|
+
noticeLifetimeMs: () => noticeLifetimeMs,
|
|
28
|
+
visibleNotices: () => visibleNotices
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(notice_stack_exports);
|
|
31
|
+
var NOTICE_STACK = {
|
|
32
|
+
/** The corner every notice floats in. */
|
|
33
|
+
corner: "top-right",
|
|
34
|
+
/** Cards shown at once; the rest fold into "N more". */
|
|
35
|
+
maxVisible: 3,
|
|
36
|
+
/** Info and success: gone after this long. */
|
|
37
|
+
infoMs: 4e3,
|
|
38
|
+
/** Errors and warnings: stay until dismissed, or this long at most. */
|
|
39
|
+
errorMs: 3e4,
|
|
40
|
+
/** The card's width: small, never the window's. */
|
|
41
|
+
widthRem: 22
|
|
42
|
+
};
|
|
43
|
+
function noticeKey(tone, title, message) {
|
|
44
|
+
const text = (v) => typeof v === "string" || typeof v === "number" ? String(v).trim() : "";
|
|
45
|
+
return `${tone}\0${text(title)}\0${text(message)}`;
|
|
46
|
+
}
|
|
47
|
+
function collapseNotices(items, keyOf) {
|
|
48
|
+
const groups = [];
|
|
49
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
50
|
+
for (const item of items) {
|
|
51
|
+
const key = keyOf(item);
|
|
52
|
+
const found = key !== null ? byKey.get(key) : void 0;
|
|
53
|
+
if (found) {
|
|
54
|
+
found.members.push(item);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const group = { key, members: [item] };
|
|
58
|
+
groups.push(group);
|
|
59
|
+
if (key !== null) byKey.set(key, group);
|
|
60
|
+
}
|
|
61
|
+
return groups.map((g) => ({ item: g.members[g.members.length - 1], members: g.members, count: g.members.length }));
|
|
62
|
+
}
|
|
63
|
+
function visibleNotices(groups, max = NOTICE_STACK.maxVisible) {
|
|
64
|
+
if (groups.length <= max) return { shown: [...groups], folded: 0 };
|
|
65
|
+
return { shown: groups.slice(groups.length - max), folded: groups.length - max };
|
|
66
|
+
}
|
|
67
|
+
function noticeLifetimeMs(tone) {
|
|
68
|
+
return tone === "danger" || tone === "warning" || tone === "error" ? NOTICE_STACK.errorMs : NOTICE_STACK.infoMs;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=notice-stack.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/notice-stack.ts"],"sourcesContent":["/**\n * @ai-matrx/design-system/notice-stack — THE ONE NOTICE LOOK AND STACK RULE, for the web and Matrx 2.\n *\n * Arman, 2026-10-23, looking at two full-width red bars across Matrx 2 Cloud Chat: \"Let's eliminate\n * this terrible pattern of having giant errors that shit the entire ui. If we're going to have a\n * place for errors, it should be a small something that resembles errors from a normal macos\".\n *\n * Champion: the macOS notification banner. A small rounded card of translucent material in the\n * window's TOP-RIGHT corner (where macOS puts every notification, so the eye already looks there;\n * the bottom of our windows holds the composer and the list's foot, which a notice must not sit on),\n * the tone's icon, a one-line title, an optional second line, at most one action, and ×.\n *\n * The stack rule, the same on both hosts:\n * - identical notices (same tone, title and line) collapse into ONE card with a count;\n * - at most 3 cards show; the rest fold into \"N more\";\n * - info and success go after NOTICE_STACK.infoMs; errors and warnings stay until dismissed\n * or until NOTICE_STACK.errorMs (long, so a notice nobody saw does not sit there for ever).\n *\n * The desktop renders it through `Notices` + `Banner` (desktop/layout.tsx, desktop/state.tsx); the\n * web through its one sonner Toaster (matrx-frontend components/ui/sonner.tsx), which reads these\n * constants and keys every toast with `noticeKey` so the same notice never stacks twice.\n */\n\nexport const NOTICE_STACK = {\n /** The corner every notice floats in. */\n corner: \"top-right\",\n /** Cards shown at once; the rest fold into \"N more\". */\n maxVisible: 3,\n /** Info and success: gone after this long. */\n infoMs: 4000,\n /** Errors and warnings: stay until dismissed, or this long at most. */\n errorMs: 30000,\n /** The card's width: small, never the window's. */\n widthRem: 22,\n} as const;\n\nexport type NoticeStackTone = \"neutral\" | \"info\" | \"warning\" | \"danger\" | \"success\";\n\n/** The identity two notices share when they say the same thing (tone, title, line). */\nexport function noticeKey(tone: string, title: unknown, message?: unknown): string {\n const text = (v: unknown): string => (typeof v === \"string\" || typeof v === \"number\" ? String(v).trim() : \"\");\n return `${tone}\\u0000${text(title)}\\u0000${text(message)}`;\n}\n\nexport interface CollapsedNotice<T> {\n /** The latest notice of the group (its dismiss and action are the live ones). */\n readonly item: T;\n /** Every notice the group holds, oldest first. */\n readonly members: readonly T[];\n /** How many identical notices it stands for. */\n readonly count: number;\n}\n\n/**\n * Identical notices become one with a count, in the order each first appeared. A notice whose key\n * is null (a rich one that says nothing comparable) stands alone.\n */\nexport function collapseNotices<T>(items: readonly T[], keyOf: (item: T) => string | null): CollapsedNotice<T>[] {\n const groups: { key: string | null; members: T[] }[] = [];\n const byKey = new Map<string, { key: string | null; members: T[] }>();\n for (const item of items) {\n const key = keyOf(item);\n const found = key !== null ? byKey.get(key) : undefined;\n if (found) {\n found.members.push(item);\n continue;\n }\n const group = { key, members: [item] };\n groups.push(group);\n if (key !== null) byKey.set(key, group);\n }\n return groups.map((g) => ({ item: g.members[g.members.length - 1] as T, members: g.members, count: g.members.length }));\n}\n\n/** The cards on screen and how many fold away (the newest show). */\nexport function visibleNotices<T>(groups: readonly T[], max: number = NOTICE_STACK.maxVisible): { shown: T[]; folded: number } {\n if (groups.length <= max) return { shown: [...groups], folded: 0 };\n return { shown: groups.slice(groups.length - max), folded: groups.length - max };\n}\n\n/** How long a notice of this tone stays (ms; Infinity never happens: errors cap at errorMs). */\nexport function noticeLifetimeMs(tone: NoticeStackTone | \"error\"): number {\n return tone === \"danger\" || tone === \"warning\" || tone === \"error\" ? NOTICE_STACK.errorMs : NOTICE_STACK.infoMs;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBO,IAAM,eAAe;AAAA;AAAA,EAE1B,QAAQ;AAAA;AAAA,EAER,YAAY;AAAA;AAAA,EAEZ,QAAQ;AAAA;AAAA,EAER,SAAS;AAAA;AAAA,EAET,UAAU;AACZ;AAKO,SAAS,UAAU,MAAc,OAAgB,SAA2B;AACjF,QAAM,OAAO,CAAC,MAAwB,OAAO,MAAM,YAAY,OAAO,MAAM,WAAW,OAAO,CAAC,EAAE,KAAK,IAAI;AAC1G,SAAO,GAAG,IAAI,KAAS,KAAK,KAAK,CAAC,KAAS,KAAK,OAAO,CAAC;AAC1D;AAeO,SAAS,gBAAmB,OAAqB,OAAyD;AAC/G,QAAM,SAAiD,CAAC;AACxD,QAAM,QAAQ,oBAAI,IAAkD;AACpE,aAAW,QAAQ,OAAO;AACxB,UAAM,MAAM,MAAM,IAAI;AACtB,UAAM,QAAQ,QAAQ,OAAO,MAAM,IAAI,GAAG,IAAI;AAC9C,QAAI,OAAO;AACT,YAAM,QAAQ,KAAK,IAAI;AACvB;AAAA,IACF;AACA,UAAM,QAAQ,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE;AACrC,WAAO,KAAK,KAAK;AACjB,QAAI,QAAQ,KAAM,OAAM,IAAI,KAAK,KAAK;AAAA,EACxC;AACA,SAAO,OAAO,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,SAAS,CAAC,GAAQ,SAAS,EAAE,SAAS,OAAO,EAAE,QAAQ,OAAO,EAAE;AACxH;AAGO,SAAS,eAAkB,QAAsB,MAAc,aAAa,YAA4C;AAC7H,MAAI,OAAO,UAAU,IAAK,QAAO,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,QAAQ,EAAE;AACjE,SAAO,EAAE,OAAO,OAAO,MAAM,OAAO,SAAS,GAAG,GAAG,QAAQ,OAAO,SAAS,IAAI;AACjF;AAGO,SAAS,iBAAiB,MAAyC;AACxE,SAAO,SAAS,YAAY,SAAS,aAAa,SAAS,UAAU,aAAa,UAAU,aAAa;AAC3G;","names":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ai-matrx/design-system/notice-stack — THE ONE NOTICE LOOK AND STACK RULE, for the web and Matrx 2.
|
|
3
|
+
*
|
|
4
|
+
* Arman, 2026-10-23, looking at two full-width red bars across Matrx 2 Cloud Chat: "Let's eliminate
|
|
5
|
+
* this terrible pattern of having giant errors that shit the entire ui. If we're going to have a
|
|
6
|
+
* place for errors, it should be a small something that resembles errors from a normal macos".
|
|
7
|
+
*
|
|
8
|
+
* Champion: the macOS notification banner. A small rounded card of translucent material in the
|
|
9
|
+
* window's TOP-RIGHT corner (where macOS puts every notification, so the eye already looks there;
|
|
10
|
+
* the bottom of our windows holds the composer and the list's foot, which a notice must not sit on),
|
|
11
|
+
* the tone's icon, a one-line title, an optional second line, at most one action, and ×.
|
|
12
|
+
*
|
|
13
|
+
* The stack rule, the same on both hosts:
|
|
14
|
+
* - identical notices (same tone, title and line) collapse into ONE card with a count;
|
|
15
|
+
* - at most 3 cards show; the rest fold into "N more";
|
|
16
|
+
* - info and success go after NOTICE_STACK.infoMs; errors and warnings stay until dismissed
|
|
17
|
+
* or until NOTICE_STACK.errorMs (long, so a notice nobody saw does not sit there for ever).
|
|
18
|
+
*
|
|
19
|
+
* The desktop renders it through `Notices` + `Banner` (desktop/layout.tsx, desktop/state.tsx); the
|
|
20
|
+
* web through its one sonner Toaster (matrx-frontend components/ui/sonner.tsx), which reads these
|
|
21
|
+
* constants and keys every toast with `noticeKey` so the same notice never stacks twice.
|
|
22
|
+
*/
|
|
23
|
+
declare const NOTICE_STACK: {
|
|
24
|
+
/** The corner every notice floats in. */
|
|
25
|
+
readonly corner: "top-right";
|
|
26
|
+
/** Cards shown at once; the rest fold into "N more". */
|
|
27
|
+
readonly maxVisible: 3;
|
|
28
|
+
/** Info and success: gone after this long. */
|
|
29
|
+
readonly infoMs: 4000;
|
|
30
|
+
/** Errors and warnings: stay until dismissed, or this long at most. */
|
|
31
|
+
readonly errorMs: 30000;
|
|
32
|
+
/** The card's width: small, never the window's. */
|
|
33
|
+
readonly widthRem: 22;
|
|
34
|
+
};
|
|
35
|
+
type NoticeStackTone = "neutral" | "info" | "warning" | "danger" | "success";
|
|
36
|
+
/** The identity two notices share when they say the same thing (tone, title, line). */
|
|
37
|
+
declare function noticeKey(tone: string, title: unknown, message?: unknown): string;
|
|
38
|
+
interface CollapsedNotice<T> {
|
|
39
|
+
/** The latest notice of the group (its dismiss and action are the live ones). */
|
|
40
|
+
readonly item: T;
|
|
41
|
+
/** Every notice the group holds, oldest first. */
|
|
42
|
+
readonly members: readonly T[];
|
|
43
|
+
/** How many identical notices it stands for. */
|
|
44
|
+
readonly count: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Identical notices become one with a count, in the order each first appeared. A notice whose key
|
|
48
|
+
* is null (a rich one that says nothing comparable) stands alone.
|
|
49
|
+
*/
|
|
50
|
+
declare function collapseNotices<T>(items: readonly T[], keyOf: (item: T) => string | null): CollapsedNotice<T>[];
|
|
51
|
+
/** The cards on screen and how many fold away (the newest show). */
|
|
52
|
+
declare function visibleNotices<T>(groups: readonly T[], max?: number): {
|
|
53
|
+
shown: T[];
|
|
54
|
+
folded: number;
|
|
55
|
+
};
|
|
56
|
+
/** How long a notice of this tone stays (ms; Infinity never happens: errors cap at errorMs). */
|
|
57
|
+
declare function noticeLifetimeMs(tone: NoticeStackTone | "error"): number;
|
|
58
|
+
|
|
59
|
+
export { NOTICE_STACK, collapseNotices, noticeKey, noticeLifetimeMs, visibleNotices };
|
|
60
|
+
export type { CollapsedNotice, NoticeStackTone };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ai-matrx/design-system/notice-stack — THE ONE NOTICE LOOK AND STACK RULE, for the web and Matrx 2.
|
|
3
|
+
*
|
|
4
|
+
* Arman, 2026-10-23, looking at two full-width red bars across Matrx 2 Cloud Chat: "Let's eliminate
|
|
5
|
+
* this terrible pattern of having giant errors that shit the entire ui. If we're going to have a
|
|
6
|
+
* place for errors, it should be a small something that resembles errors from a normal macos".
|
|
7
|
+
*
|
|
8
|
+
* Champion: the macOS notification banner. A small rounded card of translucent material in the
|
|
9
|
+
* window's TOP-RIGHT corner (where macOS puts every notification, so the eye already looks there;
|
|
10
|
+
* the bottom of our windows holds the composer and the list's foot, which a notice must not sit on),
|
|
11
|
+
* the tone's icon, a one-line title, an optional second line, at most one action, and ×.
|
|
12
|
+
*
|
|
13
|
+
* The stack rule, the same on both hosts:
|
|
14
|
+
* - identical notices (same tone, title and line) collapse into ONE card with a count;
|
|
15
|
+
* - at most 3 cards show; the rest fold into "N more";
|
|
16
|
+
* - info and success go after NOTICE_STACK.infoMs; errors and warnings stay until dismissed
|
|
17
|
+
* or until NOTICE_STACK.errorMs (long, so a notice nobody saw does not sit there for ever).
|
|
18
|
+
*
|
|
19
|
+
* The desktop renders it through `Notices` + `Banner` (desktop/layout.tsx, desktop/state.tsx); the
|
|
20
|
+
* web through its one sonner Toaster (matrx-frontend components/ui/sonner.tsx), which reads these
|
|
21
|
+
* constants and keys every toast with `noticeKey` so the same notice never stacks twice.
|
|
22
|
+
*/
|
|
23
|
+
declare const NOTICE_STACK: {
|
|
24
|
+
/** The corner every notice floats in. */
|
|
25
|
+
readonly corner: "top-right";
|
|
26
|
+
/** Cards shown at once; the rest fold into "N more". */
|
|
27
|
+
readonly maxVisible: 3;
|
|
28
|
+
/** Info and success: gone after this long. */
|
|
29
|
+
readonly infoMs: 4000;
|
|
30
|
+
/** Errors and warnings: stay until dismissed, or this long at most. */
|
|
31
|
+
readonly errorMs: 30000;
|
|
32
|
+
/** The card's width: small, never the window's. */
|
|
33
|
+
readonly widthRem: 22;
|
|
34
|
+
};
|
|
35
|
+
type NoticeStackTone = "neutral" | "info" | "warning" | "danger" | "success";
|
|
36
|
+
/** The identity two notices share when they say the same thing (tone, title, line). */
|
|
37
|
+
declare function noticeKey(tone: string, title: unknown, message?: unknown): string;
|
|
38
|
+
interface CollapsedNotice<T> {
|
|
39
|
+
/** The latest notice of the group (its dismiss and action are the live ones). */
|
|
40
|
+
readonly item: T;
|
|
41
|
+
/** Every notice the group holds, oldest first. */
|
|
42
|
+
readonly members: readonly T[];
|
|
43
|
+
/** How many identical notices it stands for. */
|
|
44
|
+
readonly count: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Identical notices become one with a count, in the order each first appeared. A notice whose key
|
|
48
|
+
* is null (a rich one that says nothing comparable) stands alone.
|
|
49
|
+
*/
|
|
50
|
+
declare function collapseNotices<T>(items: readonly T[], keyOf: (item: T) => string | null): CollapsedNotice<T>[];
|
|
51
|
+
/** The cards on screen and how many fold away (the newest show). */
|
|
52
|
+
declare function visibleNotices<T>(groups: readonly T[], max?: number): {
|
|
53
|
+
shown: T[];
|
|
54
|
+
folded: number;
|
|
55
|
+
};
|
|
56
|
+
/** How long a notice of this tone stays (ms; Infinity never happens: errors cap at errorMs). */
|
|
57
|
+
declare function noticeLifetimeMs(tone: NoticeStackTone | "error"): number;
|
|
58
|
+
|
|
59
|
+
export { NOTICE_STACK, collapseNotices, noticeKey, noticeLifetimeMs, visibleNotices };
|
|
60
|
+
export type { CollapsedNotice, NoticeStackTone };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
NOTICE_STACK,
|
|
4
|
+
collapseNotices,
|
|
5
|
+
noticeKey,
|
|
6
|
+
noticeLifetimeMs,
|
|
7
|
+
visibleNotices
|
|
8
|
+
} from "./chunk-4WSXAP24.js";
|
|
9
|
+
export {
|
|
10
|
+
NOTICE_STACK,
|
|
11
|
+
collapseNotices,
|
|
12
|
+
noticeKey,
|
|
13
|
+
noticeLifetimeMs,
|
|
14
|
+
visibleNotices
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=notice-stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|