@ai-matrx/design-system 0.49.23 → 0.49.25

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.49.25
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/design-system/v0.49.24..npm/design-system/v0.49.25 -- apps/shared/design-system`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.49.24
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/design-system/v0.49.23..npm/design-system/v0.49.24 -- apps/shared/design-system`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.49.23
4
16
 
5
17
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -1,5 +1,5 @@
1
1
  import { AgentPayloadInput } from './copy-types.cjs';
2
- import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-DZNCPJsU.cjs';
2
+ import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-frtWJUl5.cjs';
3
3
  import '../content-transfer.cjs';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -1,5 +1,5 @@
1
1
  import { AgentPayloadInput } from './copy-types.js';
2
- import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-LwqRKKni.js';
2
+ import { g as MatrxDataTableCopyConfig, M as MatrxColumnDef } from '../layered-filters-CKS15cIc.js';
3
3
  import '../content-transfer.js';
4
4
  import 'react';
5
5
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-DZNCPJsU.cjs';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-frtWJUl5.cjs';
2
2
  import '../content-transfer.cjs';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-LwqRKKni.js';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../layered-filters-CKS15cIc.js';
2
2
  import '../content-transfer.js';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
3
  import { CopyControlProps } from './copy-types.cjs';
4
4
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.cjs';
5
- import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-DZNCPJsU.cjs';
5
+ import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-frtWJUl5.cjs';
6
6
  import { MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.cjs';
7
7
  export { MatrxTableMenuItem, MatrxTableMenuSection } from './menu-targets.cjs';
8
8
  import '../content-transfer.cjs';
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
3
  import { CopyControlProps } from './copy-types.js';
4
4
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.js';
5
- import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-LwqRKKni.js';
5
+ import { b as TableSavedViewsProps, c as MatrxDataTableDensity, d as MatrxDataTableRecordControls } from '../layered-filters-CKS15cIc.js';
6
6
  import { MatrxTableMenuTarget, MatrxTableMenuPayload, MatrxTableMenuSectionsResolver, MatrxTableMenuIconName } from './menu-targets.js';
7
7
  export { MatrxTableMenuItem, MatrxTableMenuSection } from './menu-targets.js';
8
8
  import '../content-transfer.js';
@@ -36974,7 +36974,7 @@ function GenericTablePagination({
36974
36974
  // src/data-table/TableViewTabs.tsx
36975
36975
  var import_react7 = require("react");
36976
36976
  var import_jsx_runtime24 = require("react/jsx-runtime");
36977
- function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, related, editingId, onEditCancel, onEditDone, closable = true, addHint = "New view from the current one \xB7 double-click a tab to rename", renameable = true }) {
36977
+ function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, related, editingId, onEditCancel, onEditDone, closable = true, closeLabel = "Close", addHint = "New view from the current one \xB7 double-click a tab to rename", renameable = true }) {
36978
36978
  const [renaming, setRenaming] = (0, import_react7.useState)(null);
36979
36979
  const [draft, setDraft] = (0, import_react7.useState)("");
36980
36980
  const opened = (0, import_react7.useRef)(null);
@@ -37063,9 +37063,9 @@ function TableViewTabs({ tabs, activeId, onSelect, onAdd, onClose, onRename, rel
37063
37063
  canClose(tab.id) && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Tooltip, { children: [
37064
37064
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", "aria-hidden": "true", tabIndex: -1, "data-close-tab": tab.id, onClick: () => onClose(tab.id), className: "flex size-7 items-center justify-center rounded hover:bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(X, { className: "size-4" }) }) }),
37065
37065
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(TooltipContent, { children: [
37066
- "Close ",
37067
- tab.label,
37068
- " (Delete)"
37066
+ closeLabel,
37067
+ " ",
37068
+ tab.label
37069
37069
  ] })
37070
37070
  ] })
37071
37071
  ] }, tab.id)) }),
@@ -51492,6 +51492,7 @@ function MatrxDataTableCore(coreProps) {
51492
51492
  sort
51493
51493
  ]
51494
51494
  );
51495
+ const declaredDefaultSort = urlState ? urlState.defaultSort ?? null : defaultSort;
51495
51496
  const declaredDefaultViewSnapshot = (0, import_react22.useMemo)(
51496
51497
  () => defaultViewSnapshot ?? {
51497
51498
  __kind: "matrx-table-view",
@@ -51501,14 +51502,14 @@ function MatrxDataTableCore(coreProps) {
51501
51502
  search: "",
51502
51503
  anyOf: "",
51503
51504
  columnFilters: {},
51504
- sort: defaultSort
51505
+ sort: declaredDefaultSort
51505
51506
  },
51506
51507
  columns: {
51507
51508
  order: columns.map(columnId),
51508
51509
  hidden: columns.filter((column) => column.hidden).map(columnId)
51509
51510
  }
51510
51511
  },
51511
- [columns, defaultPageSize, defaultSort, defaultViewSnapshot]
51512
+ [columns, defaultPageSize, declaredDefaultSort, defaultViewSnapshot]
51512
51513
  );
51513
51514
  const applySavedView = (0, import_react22.useCallback)(
51514
51515
  (rawSnapshot) => {
@@ -54214,14 +54215,17 @@ function SavedViewsControl({
54214
54215
  onReload,
54215
54216
  presentation = "menu",
54216
54217
  onRename,
54218
+ onRemove,
54217
54219
  related
54218
54220
  }) {
54219
54221
  const unsavedChangesId = (0, import_react23.useId)();
54220
54222
  const [saveOpen, setSaveOpen] = (0, import_react23.useState)(false);
54221
54223
  const [name, setName] = (0, import_react23.useState)("");
54222
54224
  const [saving, setSaving] = (0, import_react23.useState)(false);
54225
+ const [removing, setRemoving] = (0, import_react23.useState)(false);
54223
54226
  const [actionError, setActionError] = (0, import_react23.useState)(null);
54224
54227
  const [pendingSelect, setPendingSelect] = (0, import_react23.useState)(void 0);
54228
+ const [pendingRemove, setPendingRemove] = (0, import_react23.useState)(null);
54225
54229
  const visibleError = actionError ?? error;
54226
54230
  const select = (id) => {
54227
54231
  if (id === activeId) return;
@@ -54270,6 +54274,25 @@ function SavedViewsControl({
54270
54274
  setSaving(false);
54271
54275
  }
54272
54276
  };
54277
+ const requestRemove = (id) => {
54278
+ const view = views.find((candidate) => candidate.id === id);
54279
+ if (!view || !onRemove) return;
54280
+ setActionError(null);
54281
+ setPendingRemove({ id: view.id, name: view.name });
54282
+ };
54283
+ const remove = async () => {
54284
+ if (!pendingRemove || !onRemove) return;
54285
+ setRemoving(true);
54286
+ setActionError(null);
54287
+ try {
54288
+ await onRemove(pendingRemove.id);
54289
+ setPendingRemove(null);
54290
+ } catch (cause) {
54291
+ setActionError(cause instanceof Error ? cause.message : String(cause));
54292
+ } finally {
54293
+ setRemoving(false);
54294
+ }
54295
+ };
54273
54296
  const activeName = activeId ? views.find((view) => view.id === activeId)?.name : void 0;
54274
54297
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-matrx-table-saved-views": true, children: [
54275
54298
  presentation === "tabs" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
@@ -54283,12 +54306,12 @@ function SavedViewsControl({
54283
54306
  setActionError(null);
54284
54307
  setSaveOpen(true);
54285
54308
  },
54286
- onClose: () => {
54287
- },
54309
+ onClose: requestRemove,
54288
54310
  onRename: (id, label) => {
54289
54311
  if (onRename) void Promise.resolve(onRename(id, label)).catch((cause) => setActionError(cause instanceof Error ? cause.message : String(cause)));
54290
54312
  },
54291
- closable: false,
54313
+ closable: Boolean(onRemove),
54314
+ closeLabel: "Delete saved view",
54292
54315
  renameable: Boolean(onRename),
54293
54316
  addHint: "Save a named view to your account",
54294
54317
  related
@@ -54329,6 +54352,7 @@ function SavedViewsControl({
54329
54352
  setSaveOpen(true);
54330
54353
  }, children: "Save current view\u2026" }),
54331
54354
  activeId && onUpdate ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DropdownMenuItem, { disabled: saving, onSelect: () => void update(), children: "Update current view" }) : null,
54355
+ activeId && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DropdownMenuItem, { disabled: saving || removing, onSelect: () => requestRemove(activeId), children: "Delete current view\u2026" }) : null,
54332
54356
  onReload ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DropdownMenuItem, { disabled: saving || loading, onSelect: () => void reload(), children: "Reload views" }) : null
54333
54357
  ] })
54334
54358
  ] }),
@@ -54336,7 +54360,7 @@ function SavedViewsControl({
54336
54360
  "This table view has unsaved changes. ",
54337
54361
  presentation === "tabs" ? onUpdate ? "Use Save changes to update it." : "Use Save as view to keep it." : "Open the view menu to save or update it."
54338
54362
  ] }) : null,
54339
- visibleError && !saveOpen ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorBox, { className: "basis-full break-words text-xs text-destructive", message: visibleError, operation: "Load or save a saved view", origin: "design-system/SavedViewsControl" }) : null,
54363
+ visibleError && !saveOpen && !pendingRemove ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorBox, { className: "basis-full break-words text-xs text-destructive", message: visibleError, operation: "Load or save a saved view", origin: "design-system/SavedViewsControl" }) : null,
54340
54364
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Dialog, { open: saveOpen, onOpenChange: setSaveOpen, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DialogContent, { children: [
54341
54365
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DialogTitle, { children: "Save current view" }) }),
54342
54366
  visibleError ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorBox, { className: "text-sm text-destructive", message: visibleError, operation: "Save a view", origin: "design-system/SavedViewsControl" }) : null,
@@ -54350,7 +54374,7 @@ function SavedViewsControl({
54350
54374
  if (!open) setPendingSelect(void 0);
54351
54375
  }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DialogContent, { children: [
54352
54376
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DialogTitle, { children: "Unsaved view changes" }) }),
54353
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "text-sm text-muted-foreground", children: "Switching views will discard the changes you have not saved." }),
54377
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DialogDescription, { children: "Switching views will discard the changes you have not saved." }),
54354
54378
  /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DialogFooter, { children: [
54355
54379
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "button", variant: "outline", onClick: () => setPendingSelect(void 0), children: "Stay on this view" }),
54356
54380
  /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "button", onClick: () => {
@@ -54359,6 +54383,25 @@ function SavedViewsControl({
54359
54383
  if (next !== void 0) onSelect(next);
54360
54384
  }, children: "Discard changes and switch" })
54361
54385
  ] })
54386
+ ] }) }),
54387
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Dialog, { open: pendingRemove !== null, onOpenChange: (open) => {
54388
+ if (!open && !removing) setPendingRemove(null);
54389
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DialogContent, { children: [
54390
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DialogTitle, { children: [
54391
+ "Delete ",
54392
+ pendingRemove ? `\u201C${pendingRemove.name}\u201D` : "saved view",
54393
+ "?"
54394
+ ] }) }),
54395
+ actionError ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorBox, { className: "text-sm text-destructive", message: actionError, operation: "Delete a saved view", origin: "design-system/SavedViewsControl" }) : null,
54396
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DialogDescription, { children: [
54397
+ "This removes the saved view from your account",
54398
+ activeId === pendingRemove?.id && dirty ? " and discards its unsaved layout changes" : "",
54399
+ "."
54400
+ ] }),
54401
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(DialogFooter, { children: [
54402
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "button", variant: "outline", disabled: removing, onClick: () => setPendingRemove(null), children: "Cancel" }),
54403
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { type: "button", variant: "destructive", disabled: removing, onClick: () => void remove(), children: removing ? "Deleting\u2026" : "Delete view" })
54404
+ ] })
54362
54405
  ] }) })
54363
54406
  ] });
54364
54407
  }